From acb2162bdb04611ec8bec5bdf817eeab93631414 Mon Sep 17 00:00:00 2001 From: Nino Date: Sun, 21 Feb 2016 02:09:38 +0100 Subject: [PATCH] Update bgzy.min.js --- bgzy.min.js | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/bgzy.min.js b/bgzy.min.js index c301c17..4c4b557 100644 --- a/bgzy.min.js +++ b/bgzy.min.js @@ -4,20 +4,21 @@ * Copyright(c) Nino Camdzic 2016 * Released under MIT license. */ -!function(n,t,e){var i,o=t[n]={},s=function(n,i){function o(){d.style.opacity="1.0",d.style.transitionDuration=m.conf.timeout+"ms",d.className=m.conf.tickerClass+" transition trigger"}function s(){d.style.transitionDuration="",d.className=m.conf.tickerClass,d.style.opacity="0.0"}function a(){var n=e.createElement("div"),t=m.conf.zIndex -n.className=m.conf.wrapperClass,n.addEventListener("transitionend",u,!1) -for(var i=0;2>i;i++){var o=e.createElement("div") -o.className=m.conf.backgroundClass,o.style.zIndex=t--,n.appendChild(o),v.push(o)}d=e.createElement("div"),d.className=m.conf.tickerClass,m.conf.showTicker||(d.style.display="none"),n.appendChild(d),e.body.appendChild(n)}function r(n,t){for(var i=0;i0))throw Error("No images specified.") -a(),r(n,function(){if(g++,1===g){v[k].style.backgroundImage="url('"+this.src+"')" -for(var t=0;t-1&&(s(),f())}function y(){h.cleanUp(),v[k].style.transition="",v[k].style.zIndex=m.conf.zIndex-1,v[w].style.zIndex=m.conf.zIndex,k=w,b=!1,p&&t.clearTimeout(p),z?z=!1:m.play()}var d,h,p,m=this,g=0,x=!1,v=[],k=0,w=-1,C=0,b=!1,z=!1,I=0 -this.conf={zIndex:-9999,wrapperClass:"bgzy",backgroundClass:"bg",showTicker:!1,tickerClass:"ticker",timeout:3e3,fx:"fadeOut",fxDuration:1e3} -for(var D in i)i.hasOwnProperty(D)&&(this.conf[D]=i[D]) -this.play=function(){x&&!b&&(m.conf.showTicker?o():p=t.setTimeout(f,m.conf.timeout))},this.stop=function(){x&&l()},this.next=function(){x&&!b&&(l(),f())},this.prev=function(){x&&!b&&(l(),f(-1))},c()} -s.prototype.fx=o.fx={fadeOut:function(n,t,e){return{cleanUp:function(){n.style.opacity=""},run:function(){n.style.transition="opacity "+e.fxDuration+"ms",n.style.opacity="0.0"}}},slideUp:function(n,t,e){return{cleanUp:function(){n.style.height=""},run:function(){n.style.transition="height "+e.fxDuration+"ms",n.style.height="0"}}},slideLeft:function(n,t,e){return{cleanUp:function(){n.style.width=""},run:function(){n.style.transition="width "+e.fxDuration+"ms",n.style.width="0"}}},zoomFadeOut:function(n,t,e){return{cleanUp:function(){n.style.transform="",n.style.opacity=""},run:function(){n.style.transition="all "+e.fxDuration+"ms, opacity "+e.fxDuration+"ms",n.style.transform="scale(1.1)",n.style.opacity="0.0"}}}},o.inst=function(n,t){return i||(i=new s(n,t)),i}}("bgzy",window,document) + !function(n,t,e){var i,o=t[n]={},r=function(n,i){function o(n){return n instanceof Array?n[0]:n}function r(n){return n instanceof Array?n[1]:x.conf.fx}function s(){p.style.opacity="1.0",p.style.transitionDuration=x.conf.timeout+"ms",p.className=x.conf.tickerClass+" transition trigger"}function a(){p.style.transitionDuration="",p.className=x.conf.tickerClass,p.style.opacity="0.0"}function c(){var n=e.createElement("div"),t=x.conf.zIndex + n.className=x.conf.wrapperClass,n.addEventListener("transitionend",d,!1) + for(var i=0;2>i;i++){var o=e.createElement("div") + o.className=x.conf.backgroundClass,o.style.zIndex=t--,n.appendChild(o),w.push(o)}p=e.createElement("div"),p.className=x.conf.tickerClass,x.conf.showTicker||(p.style.display="none"),n.appendChild(p),e.body.appendChild(n)}function f(n,t){for(var i=0;i0))throw Error("No images specified.") + c(),f(n,function(){if(v++,1===v){w[C].style.backgroundImage="url('"+this.src+"')" + for(var t=0;t-1){z=t + break}}}n.length===v&&(k=!0,x.play())})}function u(t){I=!0,t=t?t:1,b=C===w.length-1?0:C+1 + var e=z + z===n.length-1&&1===t?z=0:0===z&&-1===t?z=n.length-1:z+=t + var i=w[C],s=w[b],a=o(n[z]),c=r(n[e]) + s.style.backgroundImage="url("+a+")",m=x.fx[c](i,s,x.conf),T=0,m.run()}function y(){x.conf.showTicker?a():t.clearTimeout(g),D=!0}function d(n){var t=n.target.className + t===x.conf.backgroundClass?(0===T&&h(),T++):x.conf.showTicker&&t.indexOf(x.conf.tickerClass)>-1&&(a(),u())}function h(){m.cleanUp(),w[C].style.transition="",w[C].style.zIndex=x.conf.zIndex-1,w[b].style.zIndex=x.conf.zIndex,C=b,I=!1,g&&t.clearTimeout(g),D?D=!1:x.play()}var p,m,g,x=this,v=0,k=!1,w=[],C=0,b=-1,z=0,I=!1,D=!1,T=0 + this.conf={zIndex:-9999,wrapperClass:"bgzy",backgroundClass:"bg",showTicker:!1,tickerClass:"ticker",timeout:3e3,fx:"fadeOut",fxDuration:1e3} + for(var E in i)i.hasOwnProperty(E)&&(this.conf[E]=i[E]) + this.play=function(){k&&!I&&(x.conf.showTicker?s():g=t.setTimeout(u,x.conf.timeout))},this.stop=function(){k&&y()},this.next=function(){k&&!I&&(y(),u())},this.prev=function(){k&&!I&&(y(),u(-1))},l()} + r.prototype.fx=o.fx={fadeOut:function(n,t,e){return{cleanUp:function(){n.style.opacity=""},run:function(){n.style.transition="opacity "+e.fxDuration+"ms",n.style.opacity="0.0"}}},slideUp:function(n,t,e){return{cleanUp:function(){n.style.height=""},run:function(){n.style.transition="height "+e.fxDuration+"ms",n.style.height="0"}}},slideLeft:function(n,t,e){return{cleanUp:function(){n.style.width=""},run:function(){n.style.transition="width "+e.fxDuration+"ms",n.style.width="0"}}},zoomFadeOut:function(n,t,e){return{cleanUp:function(){n.style.transform="",n.style.opacity=""},run:function(){n.style.transition="all "+e.fxDuration+"ms, opacity "+e.fxDuration+"ms",n.style.transform="scale(1.1)",n.style.opacity="0.0"}}}},o.inst=function(n,t){return i||(i=new r(n,t)),i}}("bgzy",window,document)