summaryrefslogtreecommitdiff
path: root/public/js/lib/bg.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2015-08-04 22:14:25 -0400
committerJules Laplace <jules@okfoc.us>2015-08-04 22:14:25 -0400
commit23608321549df020dc0a2c79fc00f5edd1ffe2e6 (patch)
tree126f6eb00f6e66972802813eafa4dc80c488e291 /public/js/lib/bg.js
parent927b6670e2da26bf1823efd49462c8bfb8317cb7 (diff)
pull in video stuff and write bg wrapper :)
Diffstat (limited to 'public/js/lib/bg.js')
-rw-r--r--public/js/lib/bg.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/public/js/lib/bg.js b/public/js/lib/bg.js
new file mode 100644
index 0000000..5a188f3
--- /dev/null
+++ b/public/js/lib/bg.js
@@ -0,0 +1,29 @@
+var bg = (function(){
+
+ var bg = {}
+ bg.el = document.getElementById("bg")
+
+ bg.change = function(url){
+ var img = new Image ()
+ img.src = url
+ oktween.add({
+ obj: bg.el.style,
+ from: { opacity: 1 },
+ to: { opacity: 0 },
+ easing: "circ_in",
+ duration: 500,
+ finished: function(){
+ bg.el.style.backgroundImage = "url(" + url + ")"
+ }
+ }).then({
+ delay: 500,
+ obj: bg.el.style,
+ from: { opacity: 0 },
+ to: { opacity: 1 },
+ easing: "circ_in",
+ duration: 500,
+ })
+
+ }
+
+})() \ No newline at end of file