From e62f004e7b48d203565763896199e72208a6e374 Mon Sep 17 00:00:00 2001 From: Nino Date: Sun, 14 Feb 2016 04:24:25 +0100 Subject: [PATCH] Create bgzy.min.js Minified --- bgzy.min.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bgzy.min.js diff --git a/bgzy.min.js b/bgzy.min.js new file mode 100644 index 0000000..1b74763 --- /dev/null +++ b/bgzy.min.js @@ -0,0 +1,21 @@ +/** + * bgzy.js vX.X.X + * + * 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(){g++,1===g&&(v[k].style.backgroundImage="url('"+this.src+"')"),n.length===g&&(x=!0,m.play())})}function f(t){z=!0,t=t?t:1,w=k===v.length-1?0:k+1 +var e=C +C===n.length-1&&1===t?C=0:0===C&&-1===t?C=n.length-1:C+=t +var i=v[k],o=v[w],s=n[C],a=m.conf.fx +s instanceof Array&&(s=n[C][0],a=n[e][1]),o.style.backgroundImage="url("+s+")",p=m.fx[a](i,o,m.conf),I=0,p.run()}function l(){m.conf.showTicker?s():t.clearTimeout(h),b=!0}function u(n){var t=n.target.className +t===m.conf.backgroundClass?(0===I&&y(),I++):m.conf.showTicker&&t.indexOf(m.conf.tickerClass)>-1&&(s(),f())}function y(){p.cleanUp(),v[k].style.transition="",v[k].style.zIndex=m.conf.zIndex-1,v[w].style.zIndex=m.conf.zIndex,k=w,z=!1,h&&t.clearTimeout(h),b?b=!1:m.play()}var d,p,h,m=this,g=0,x=!1,v=[],k=0,w=-1,C=0,z=!1,b=!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&&!z&&(m.conf.showTicker?o():h=t.setTimeout(f,m.conf.timeout))},this.stop=function(){x&&l()},this.next=function(){x&&!z&&(l(),f())},this.prev=function(){x&&!z&&(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)