summaryrefslogtreecommitdiff
path: root/public/js/lib/bg.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-04 22:22:30 -0400
committerJules Laplace <jules@okfoc.us>2015-08-04 22:22:30 -0400
commit39f3e69d477a605ae676a64222e2486f67856b8e (patch)
treea2abd9bba064db70ffeaea8064af8abdac859902 /public/js/lib/bg.js
parent23608321549df020dc0a2c79fc00f5edd1ffe2e6 (diff)
css
Diffstat (limited to 'public/js/lib/bg.js')
-rw-r--r--public/js/lib/bg.js10
1 files changed, 4 insertions, 6 deletions
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