diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-08-04 22:22:30 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-08-04 22:22:30 -0400 |
| commit | 39f3e69d477a605ae676a64222e2486f67856b8e (patch) | |
| tree | a2abd9bba064db70ffeaea8064af8abdac859902 | |
| parent | 23608321549df020dc0a2c79fc00f5edd1ffe2e6 (diff) | |
css
| -rw-r--r-- | public/css/css.css | 3 | ||||
| -rw-r--r-- | public/js/lib/bg.js | 10 | ||||
| -rw-r--r-- | server/index.js | 2 |
3 files changed, 7 insertions, 8 deletions
diff --git a/public/css/css.css b/public/css/css.css index 3b8cf24..c20b717 100644 --- a/public/css/css.css +++ b/public/css/css.css @@ -1,4 +1,5 @@ html,body{width:100%;height:100%;margin:0;padding:0;} -#bg{position:fixed;top:0;left:0;z-index:-1;background-color:black;} +#bg{position:absolute;top:0;left:0;z-index:-1;background-color:black;z-index:-1;background-position:center center;background-size:contain;} +#bg.tile{background-size:auto auto;} html{background:black;} body{background:transparent;} diff --git a/public/js/lib/bg.js b/public/js/lib/bg.js index 5a188f3..98bcc1b 100644 --- a/public/js/lib/bg.js +++ b/public/js/lib/bg.js @@ -3,9 +3,9 @@ var bg = (function(){ var bg = {} bg.el = document.getElementById("bg") - bg.change = function(url){ + bg.change = function(picture){ var img = new Image () - img.src = url + img.src = picture.url oktween.add({ obj: bg.el.style, from: { opacity: 1 }, @@ -13,17 +13,15 @@ var bg = (function(){ easing: "circ_in", duration: 500, finished: function(){ - bg.el.style.backgroundImage = "url(" + url + ")" + bg.el.style.backgroundImage = "url(" + picture.url + ")" + bg.el.className = picture.tile ? "tile" : "" } }).then({ delay: 500, - obj: bg.el.style, - from: { opacity: 0 }, to: { opacity: 1 }, easing: "circ_in", duration: 500, }) - } })()
\ No newline at end of file diff --git a/server/index.js b/server/index.js index 89ba350..d375351 100644 --- a/server/index.js +++ b/server/index.js @@ -15,8 +15,8 @@ var app = express() var server app.set('port', config.port) -app.set('views', path.join(__dirname, '../views')) app.set('view engine', 'ejs') +app.set('views', path.join(__dirname, '../views')) app.use(express.static(path.join(__dirname, '../public'))) app.use(require('morgan')("combined", {})) app.use(require("express-json")()) |
