diff --git a/README.md b/README.md index 2fbe554..055d959 100644 --- a/README.md +++ b/README.md @@ -760,33 +760,26 @@ Spotlight.show([ /* Gallery */ ],{ ``` -## Note +## Preload Library / Async Load -It is very common to load the library right before the closing body tag of your document. - -> If you like to override css classes for custom styling you may need to add _"!important"_ flag to the css property value. +> If you like to override css classes for custom styling you may need to add ___!important___ flag to the css property value. ```html + - + ``` -Load library as async: - -```html - -``` - -Initialize Spotlight manually (once): +Initialize library manually (once): ```js Spotlight.init(); diff --git a/demo/spotlight.bundle.js b/demo/spotlight.bundle.js index bfa2343..2f215c4 100644 --- a/demo/spotlight.bundle.js +++ b/demo/spotlight.bundle.js @@ -1,5 +1,5 @@ /** - * Spotlight.js v0.6.4 (Bundle) + * Spotlight.js v0.6.5 (Bundle) * Copyright 2019 Nextapps GmbH * Author: Thomas Wilkerling * Licence: Apache-2.0 @@ -8,24 +8,24 @@ (function(){'use strict';var aa={};function ba(a){for(var b=a.classList,c={},d=0;d=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;T[k]={src:w&&(w.href||w.src)||t.src||t.href,title:w&&w.title||t.title||(x=(t||document).getElementsByTagName("img")).length&&x[0].alt||d||"",description:w&&w.description||t.description||e||""}}G=b||1;Ia(!0);Ja()}} function Ka(a,b,c,d){if(d||a[c])I[c]=b&&b[c]||d} function La(a,b){I={};b&&Ma(b);Ma(a);Ka(a,b,"description");Ka(a,b,"title");Ka(a,b,"prefetch",!0);Ka(a,b,"preloader",!0);ua=a.onchange;J=I.infinite;J="undefined"!==typeof J&&"false"!==J;ta="false"!==I.progress;va=1*I.player||7E3;if((a=I.zoom)||""===a)I["zoom-in"]=I["zoom-out"]=a,delete I.zoom;if((a=I.control)||""===a){a="string"===typeof a?a.split(","):a;for(b=0;b
'; -l(N,"transition","none");document.body.appendChild(N);wa=V("scene");xa=V("footer");ya=V("title");za=V("description");Aa=V("arrow-left");Ba=V("arrow-right");O=V("fullscreen");Ca=V("page");Da=V("player");Ea=V("progress");P=V("preloader");S=document.documentElement||document.body;document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){});S.requestFullScreen||(S.requestFullScreen= -S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){});Ga=[[window,"keydown",Ra],[window,"wheel",Sa],[window,"hashchange",Ta],[window,"resize",Ua],[P,"mousedown",Va],[P,"mouseleave",Wa],[P,"mouseup",Wa],[P,"mousemove",Xa],[P,"touchstart",Va,{passive:!1}],[P,"touchcancel",Wa],[P,"touchend",Wa],[P,"touchmove",Xa,{passive:!0}],[O,"",Ya],[Aa,"",Za],[Ba,"",W],[Da,"",$a],[V("autofit"),"",ab],[V("zoom-in"),"",bb],[V("zoom-out"),"",cb],[V("close"),"", -db],[V("theme"),"",Na]]}function Ua(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,eb())}function eb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function fb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?cb():bb())}function Ta(){K&&"#spotlight"===location.hash&&db(!0)}function $a(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&ib()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function jb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} -function Va(a){B=!0;C=!1;var b=kb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Wa(a){if(B&&!C)return B=!1,jb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&Za()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Xa(a){if(B){Fa||(Fa=requestAnimationFrame(lb));var b=kb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&mb(A=b);a||Y()}function mb(a){A=a||1;eb()}function cb(a){var b=.65*A;1<=b&&(mb(A=b),r=q=0,E=!0,X());a||Y()}function hb(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");fb(!0);Ua();Y()} -function db(a){fb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&$a(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function Za(){if(1G;G=a;Ja(b);return!0}}function ib(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} +function Oa(){var a=G;K=L[a-1];M=K.firstElementChild;G=a;if(!M){var b="false"!==I.preloader;M=new Image;M.onload=function(){b&&h(P,"show");T&&(y=this.width,z=this.height,l(this,{visibility:"visible",opacity:1,transform:""}),"false"!==I.prefetch&&a
', +l(N,"transition","none"),document.body.appendChild(N),wa=V("scene"),xa=V("footer"),ya=V("title"),za=V("description"),Aa=V("arrow-left"),Ba=V("arrow-right"),O=V("fullscreen"),Ca=V("page"),Da=V("player"),Ea=V("progress"),P=V("preloader"),S=document.documentElement||document.body,document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){}),S.requestFullScreen||(S.requestFullScreen= +S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){}),Ga=[[window,"keydown",Sa],[window,"wheel",Ta],[window,"hashchange",Ua],[window,"resize",Va],[P,"mousedown",Wa],[P,"mouseleave",Xa],[P,"mouseup",Xa],[P,"mousemove",Ya],[P,"touchstart",Wa,{passive:!1}],[P,"touchcancel",Xa],[P,"touchend",Xa],[P,"touchmove",Ya,{passive:!0}],[O,"",Za],[Aa,"",$a],[Ba,"",W],[Da,"",ab],[V("autofit"),"",bb],[V("zoom-in"),"",cb],[V("zoom-out"),"",db],[V("close"),"", +eb],[V("theme"),"",Na]],Ra=!0)}function Va(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,fb())}function fb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function gb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?db():cb())}function Ua(){K&&"#spotlight"===location.hash&&eb(!0)}function ab(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&jb()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function kb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} +function Wa(a){B=!0;C=!1;var b=lb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Xa(a){if(B&&!C)return B=!1,kb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&$a()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Ya(a){if(B){Fa||(Fa=requestAnimationFrame(mb));var b=lb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&nb(A=b);a||Y()}function nb(a){A=a||1;fb()}function db(a){var b=.65*A;1<=b&&(nb(A=b),r=q=0,E=!0,X());a||Y()}function ib(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");gb(!0);Va();Y()} +function eb(a){gb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&ab(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function $a(){if(1G;G=a;Ja(b);return!0}}function jb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} function Na(a){"boolean"===typeof a?ra=a:(ra=!ra,Y());ra?f(N,sa):h(N,sa)} function Ja(a){r=q=0;A=1;var b=I.animation,c=!0,d=!0,e=!0;if(b||""===b){c=d=e=!1;b="string"===typeof b?b.split(","):b;for(var k=0;k=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;T[k]={src:w&&(w.href||w.src)||t.src||t.href,title:w&&w.title||t.title||(x=(t||document).getElementsByTagName("img")).length&&x[0].alt||d||"",description:w&&w.description||t.description||e||""}}G=b||1;Ia(!0);Ja()}} +function Ka(a,b,c,d){if(d||a[c])I[c]=b&&b[c]||d} +function La(a,b){I={};b&&Ma(b);Ma(a);Ka(a,b,"description");Ka(a,b,"title");Ka(a,b,"prefetch",!0);Ka(a,b,"preloader",!0);ua=a.onchange;J=I.infinite;J="undefined"!==typeof J&&"false"!==J;ta="false"!==I.progress;va=1*I.player||7E3;if((a=I.zoom)||""===a)I["zoom-in"]=I["zoom-out"]=a,delete I.zoom;if((a=I.control)||""===a){a="string"===typeof a?a.split(","):a;for(b=0;b
', +l(N,"transition","none"),document.body.appendChild(N),wa=V("scene"),xa=V("footer"),ya=V("title"),za=V("description"),Aa=V("arrow-left"),Ba=V("arrow-right"),O=V("fullscreen"),Ca=V("page"),Da=V("player"),Ea=V("progress"),P=V("preloader"),S=document.documentElement||document.body,document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){}),S.requestFullScreen||(S.requestFullScreen= +S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){}),Ga=[[window,"keydown",Sa],[window,"wheel",Ta],[window,"hashchange",Ua],[window,"resize",Va],[P,"mousedown",Wa],[P,"mouseleave",Xa],[P,"mouseup",Xa],[P,"mousemove",Ya],[P,"touchstart",Wa,{passive:!1}],[P,"touchcancel",Xa],[P,"touchend",Xa],[P,"touchmove",Ya,{passive:!0}],[O,"",Za],[Aa,"",$a],[Ba,"",W],[Da,"",ab],[V("autofit"),"",bb],[V("zoom-in"),"",cb],[V("zoom-out"),"",db],[V("close"),"", +eb],[V("theme"),"",Na]],Ra=!0)}function Va(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,fb())}function fb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function gb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?db():cb())}function Ua(){K&&"#spotlight"===location.hash&&eb(!0)}function ab(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&jb()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function kb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} +function Wa(a){B=!0;C=!1;var b=lb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Xa(a){if(B&&!C)return B=!1,kb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&$a()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Ya(a){if(B){Fa||(Fa=requestAnimationFrame(mb));var b=lb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&nb(A=b);a||Y()}function nb(a){A=a||1;fb()}function db(a){var b=.65*A;1<=b&&(nb(A=b),r=q=0,E=!0,X());a||Y()}function ib(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");gb(!0);Va();Y()} +function eb(a){gb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&ab(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function $a(){if(1G;G=a;Ja(b);return!0}}function jb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} +function Na(a){"boolean"===typeof a?ra=a:(ra=!ra,Y());ra?f(N,sa):h(N,sa)} +function Ja(a){r=q=0;A=1;var b=I.animation,c=!0,d=!0,e=!0;if(b||""===b){c=d=e=!1;b="string"===typeof b?b.split(","):b;for(var k=0;k=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;var M=U,ib=k,jb=w&&(w.href||w.src)||t.src||t.href,Aa;(Aa=w&&w.title||t.title)||(Aa=(x=(t||document).getElementsByTagName("img")).length&&x[0].alt);M[ib]={src:jb,title:Aa||d||"",description:w&&w.description||t.description||e|| +function g(a){return"string"===typeof a?document.querySelectorAll(a):a};function la(a,b,c,d){ma("add",a,b,c,d)}function na(a,b,c,d){ma("remove",a,b,c,d)}function ma(a,b,c,d,e){b[a+"EventListener"](c||"click",d,"undefined"===typeof e?!0:e)}function n(a,b){a||(a=window.event);a&&(a.stopImmediatePropagation(),b||a.preventDefault(),b||(a.returnValue=!1));return!1};var p="theme fullscreen autofit zoom-in zoom-out page title description player progress".split(" "),q,r,oa,pa,u,v,y,z,A,B,C,D,E,F,qa,ra,G,H,I,J,sa,ta,ua,K,L,N,va,O,wa,xa,ya,za,Ba,P,Ca,Da,Ea,Q,R,Fa,S,T,U,Ga;function V(a){return(O||document).getElementsByClassName(a)[0]} +function Ha(a,b){if(H=a.length){L||(L=(O||document).getElementsByClassName("pane"));var c=L.length,d=I.title,e=I.description;U=Array(H);for(var k=0;k=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;var M=U,jb=k,kb=w&&(w.href||w.src)||t.src||t.href,Aa;(Aa=w&&w.title||t.title)||(Aa=(x=(t||document).getElementsByTagName("img")).length&&x[0].alt);M[jb]={src:kb,title:Aa||d||"",description:w&&w.description||t.description||e|| ""}}G=b||1;Ia(!0);Ja()}}function Ka(a,b,c,d){if(d||a[c])I[c]=b&&b[c]||d} function La(a,b){I={};b&&Ma(b);Ma(a);Ka(a,b,"description");Ka(a,b,"title");Ka(a,b,"prefetch",!0);Ka(a,b,"preloader",!0);ta=a.onchange;J=I.infinite;J="undefined"!==typeof J&&"false"!==J;sa="false"!==I.progress;ua=1*I.player||7E3;if((a=I.zoom)||""===a)I["zoom-in"]=I["zoom-out"]=a,delete I.zoom;if((a=I.control)||""===a){a="string"===typeof a?a.split(","):a;for(b=0;b
'; -l(O,"transition","none");document.body.appendChild(O);va=V("scene");wa=V("footer");xa=V("title");ya=V("description");za=V("arrow-left");Ba=V("arrow-right");P=V("fullscreen");Ca=V("page");Da=V("player");Ea=V("progress");Q=V("preloader");T=document.documentElement||document.body;document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){});T.requestFullScreen||(T.requestFullScreen= -T.webkitRequestFullScreen||T.msRequestFullScreen||T.mozRequestFullScreen||l(P,"display","none")||function(){});Ga=[[window,"keydown",Ra],[window,"wheel",Sa],[window,"hashchange",Ta],[window,"resize",Ua],[Q,"mousedown",Va],[Q,"mouseleave",Wa],[Q,"mouseup",Wa],[Q,"mousemove",Xa],[Q,"touchstart",Va,{passive:!1}],[Q,"touchcancel",Wa],[Q,"touchend",Wa],[Q,"touchmove",Xa,{passive:!0}],[P,"",Ya],[za,"",Za],[Ba,"",W],[Da,"",$a],[V("autofit"),"",ab],[V("zoom-in"),"",bb],[V("zoom-out"),"",cb],[V("close"),"", -db],[V("theme"),"",Na]]}function Ua(){u=O.clientWidth;v=O.clientHeight;N&&(y=N.width,z=N.height,eb())}function eb(){l(N,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(va,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function fb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?cb():bb())}function Ta(){K&&"#spotlight"===location.hash&&db(!0)}function $a(a){("boolean"===typeof a?a:!R)?R||(R=setInterval(W,ua),f(Da,"on"),sa&&kb()):R&&(R=clearInterval(R),h(Da,"on"),sa&&m(Ea,"transform",""));return R}function Y(){S?clearTimeout(S):f(O,"menu");var a=I.autohide;S="false"!==a?setTimeout(function(){h(O,"menu");S=null},1*a||3E3):1}function lb(a){"boolean"===typeof a&&(S=a?S:0);S?(S=clearTimeout(S),h(O,"menu")):Y();return n(a)} -function Va(a){B=!0;C=!1;var b=mb(a);D=y*A<=u;oa=b.x;pa=b.y;return n(a,!0)}function Wa(a){if(B&&!C)return B=!1,lb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&Za()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Xa(a){if(B){Fa||(Fa=requestAnimationFrame(nb));var b=mb(a),c=(y*A-u)/2;C=!0;q-=oa-(oa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=pa-(pa=b.y),r>c?r=c:0=b&&ob(A=b);a||Y()}function ob(a){A=a||1;eb()}function cb(a){var b=.65*A;1<=b&&(ob(A=b),r=q=0,E=!0,X());a||Y()}function hb(){location.hash="spotlight";location.hash="show";l(O,"transition","");f(T,"hide-scrollbars");f(O,"show");fb(!0);Ua();Y()} -function db(a){fb(!1);history.go(!0===a?-1:-2);h(T,"hide-scrollbars");h(O,"show");R&&$a(!1);N.parentNode.removeChild(N);K=L=N=U=I=ta=null}function Za(){if(1G;G=a;Ja(b);return!0}}function kb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:ua+"ms",transform:"translateX(0)"})} +function Oa(){var a=G;K=L[a-1];N=K.firstElementChild;G=a;if(!N){var b="false"!==I.preloader;N=new Image;N.onload=function(){b&&h(Q,"show");U&&(y=this.width,z=this.height,l(this,{visibility:"visible",opacity:1,transform:""}),"false"!==I.prefetch&&a
', +l(O,"transition","none"),document.body.appendChild(O),va=V("scene"),wa=V("footer"),xa=V("title"),ya=V("description"),za=V("arrow-left"),Ba=V("arrow-right"),P=V("fullscreen"),Ca=V("page"),Da=V("player"),Ea=V("progress"),Q=V("preloader"),T=document.documentElement||document.body,document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){}),T.requestFullScreen||(T.requestFullScreen= +T.webkitRequestFullScreen||T.msRequestFullScreen||T.mozRequestFullScreen||l(P,"display","none")||function(){}),Ga=[[window,"keydown",Sa],[window,"wheel",Ta],[window,"hashchange",Ua],[window,"resize",Va],[Q,"mousedown",Wa],[Q,"mouseleave",Xa],[Q,"mouseup",Xa],[Q,"mousemove",Ya],[Q,"touchstart",Wa,{passive:!1}],[Q,"touchcancel",Xa],[Q,"touchend",Xa],[Q,"touchmove",Ya,{passive:!0}],[P,"",Za],[za,"",$a],[Ba,"",W],[Da,"",ab],[V("autofit"),"",bb],[V("zoom-in"),"",cb],[V("zoom-out"),"",db],[V("close"),"", +eb],[V("theme"),"",Na]],Ra=!0)}function Va(){u=O.clientWidth;v=O.clientHeight;N&&(y=N.width,z=N.height,fb())}function fb(){l(N,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(va,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function gb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?db():cb())}function Ua(){K&&"#spotlight"===location.hash&&eb(!0)}function ab(a){("boolean"===typeof a?a:!R)?R||(R=setInterval(W,ua),f(Da,"on"),sa&&lb()):R&&(R=clearInterval(R),h(Da,"on"),sa&&m(Ea,"transform",""));return R}function Y(){S?clearTimeout(S):f(O,"menu");var a=I.autohide;S="false"!==a?setTimeout(function(){h(O,"menu");S=null},1*a||3E3):1}function mb(a){"boolean"===typeof a&&(S=a?S:0);S?(S=clearTimeout(S),h(O,"menu")):Y();return n(a)} +function Wa(a){B=!0;C=!1;var b=nb(a);D=y*A<=u;oa=b.x;pa=b.y;return n(a,!0)}function Xa(a){if(B&&!C)return B=!1,mb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&$a()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Ya(a){if(B){Fa||(Fa=requestAnimationFrame(ob));var b=nb(a),c=(y*A-u)/2;C=!0;q-=oa-(oa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=pa-(pa=b.y),r>c?r=c:0=b&&pb(A=b);a||Y()}function pb(a){A=a||1;fb()}function db(a){var b=.65*A;1<=b&&(pb(A=b),r=q=0,E=!0,X());a||Y()}function ib(){location.hash="spotlight";location.hash="show";l(O,"transition","");f(T,"hide-scrollbars");f(O,"show");gb(!0);Va();Y()} +function eb(a){gb(!1);history.go(!0===a?-1:-2);h(T,"hide-scrollbars");h(O,"show");R&&ab(!1);N.parentNode.removeChild(N);K=L=N=U=I=ta=null}function $a(){if(1G;G=a;Ja(b);return!0}}function lb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:ua+"ms",transform:"translateX(0)"})} function Na(a){"boolean"===typeof a?qa=a:(qa=!qa,Y());qa?f(O,ra):h(O,ra)} function Ja(a){r=q=0;A=1;var b=I.animation,c=!0,d=!0,e=!0;if(b||""===b){c=d=e=!1;b="string"===typeof b?b.split(","):b;for(var k=0;k=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;T[k]={src:w&&(w.href||w.src)||t.src||t.href,title:w&&w.title||t.title||(x=(t||document).getElementsByTagName("img")).length&&x[0].alt||d||"",description:w&&w.description||t.description||e||""}}G=b||1;Ia(!0);Ja()}} function Ka(a,b,c,d){if(d||a[c])I[c]=b&&b[c]||d} function La(a,b){I={};b&&Ma(b);Ma(a);Ka(a,b,"description");Ka(a,b,"title");Ka(a,b,"prefetch",!0);Ka(a,b,"preloader",!0);ua=a.onchange;J=I.infinite;J="undefined"!==typeof J&&"false"!==J;ta="false"!==I.progress;va=1*I.player||7E3;if((a=I.zoom)||""===a)I["zoom-in"]=I["zoom-out"]=a,delete I.zoom;if((a=I.control)||""===a){a="string"===typeof a?a.split(","):a;for(b=0;b
'; -l(N,"transition","none");document.body.appendChild(N);wa=V("scene");xa=V("footer");ya=V("title");za=V("description");Aa=V("arrow-left");Ba=V("arrow-right");O=V("fullscreen");Ca=V("page");Da=V("player");Ea=V("progress");P=V("preloader");S=document.documentElement||document.body;document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){});S.requestFullScreen||(S.requestFullScreen= -S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){});Ga=[[window,"keydown",Ra],[window,"wheel",Sa],[window,"hashchange",Ta],[window,"resize",Ua],[P,"mousedown",Va],[P,"mouseleave",Wa],[P,"mouseup",Wa],[P,"mousemove",Xa],[P,"touchstart",Va,{passive:!1}],[P,"touchcancel",Wa],[P,"touchend",Wa],[P,"touchmove",Xa,{passive:!0}],[O,"",Ya],[Aa,"",Za],[Ba,"",W],[Da,"",$a],[V("autofit"),"",ab],[V("zoom-in"),"",bb],[V("zoom-out"),"",cb],[V("close"),"", -db],[V("theme"),"",Na]]}function Ua(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,eb())}function eb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function fb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?cb():bb())}function Ta(){K&&"#spotlight"===location.hash&&db(!0)}function $a(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&ib()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function jb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} -function Va(a){B=!0;C=!1;var b=kb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Wa(a){if(B&&!C)return B=!1,jb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&Za()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Xa(a){if(B){Fa||(Fa=requestAnimationFrame(lb));var b=kb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&mb(A=b);a||Y()}function mb(a){A=a||1;eb()}function cb(a){var b=.65*A;1<=b&&(mb(A=b),r=q=0,E=!0,X());a||Y()}function hb(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");fb(!0);Ua();Y()} -function db(a){fb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&$a(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function Za(){if(1G;G=a;Ja(b);return!0}}function ib(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} +function Oa(){var a=G;K=L[a-1];M=K.firstElementChild;G=a;if(!M){var b="false"!==I.preloader;M=new Image;M.onload=function(){b&&h(P,"show");T&&(y=this.width,z=this.height,l(this,{visibility:"visible",opacity:1,transform:""}),"false"!==I.prefetch&&a
', +l(N,"transition","none"),document.body.appendChild(N),wa=V("scene"),xa=V("footer"),ya=V("title"),za=V("description"),Aa=V("arrow-left"),Ba=V("arrow-right"),O=V("fullscreen"),Ca=V("page"),Da=V("player"),Ea=V("progress"),P=V("preloader"),S=document.documentElement||document.body,document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){}),S.requestFullScreen||(S.requestFullScreen= +S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){}),Ga=[[window,"keydown",Sa],[window,"wheel",Ta],[window,"hashchange",Ua],[window,"resize",Va],[P,"mousedown",Wa],[P,"mouseleave",Xa],[P,"mouseup",Xa],[P,"mousemove",Ya],[P,"touchstart",Wa,{passive:!1}],[P,"touchcancel",Xa],[P,"touchend",Xa],[P,"touchmove",Ya,{passive:!0}],[O,"",Za],[Aa,"",$a],[Ba,"",W],[Da,"",ab],[V("autofit"),"",bb],[V("zoom-in"),"",cb],[V("zoom-out"),"",db],[V("close"),"", +eb],[V("theme"),"",Na]],Ra=!0)}function Va(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,fb())}function fb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function gb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?db():cb())}function Ua(){K&&"#spotlight"===location.hash&&eb(!0)}function ab(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&jb()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function kb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} +function Wa(a){B=!0;C=!1;var b=lb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Xa(a){if(B&&!C)return B=!1,kb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&$a()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Ya(a){if(B){Fa||(Fa=requestAnimationFrame(mb));var b=lb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&nb(A=b);a||Y()}function nb(a){A=a||1;fb()}function db(a){var b=.65*A;1<=b&&(nb(A=b),r=q=0,E=!0,X());a||Y()}function ib(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");gb(!0);Va();Y()} +function eb(a){gb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&ab(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function $a(){if(1G;G=a;Ja(b);return!0}}function jb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} function Na(a){"boolean"===typeof a?ra=a:(ra=!ra,Y());ra?f(N,sa):h(N,sa)} function Ja(a){r=q=0;A=1;var b=I.animation,c=!0,d=!0,e=!0;if(b||""===b){c=d=e=!1;b="string"===typeof b?b.split(","):b;for(var k=0;k=c){var x=L[0].cloneNode(!1);l(x,"left",100*k+"%");L[0].parentNode.appendChild(x)}x=void 0;T[k]={src:w&&(w.href||w.src)||t.src||t.href,title:w&&w.title||t.title||(x=(t||document).getElementsByTagName("img")).length&&x[0].alt||d||"",description:w&&w.description||t.description||e||""}}G=b||1;Ia(!0);Ja()}} function Ka(a,b,c,d){if(d||a[c])I[c]=b&&b[c]||d} function La(a,b){I={};b&&Ma(b);Ma(a);Ka(a,b,"description");Ka(a,b,"title");Ka(a,b,"prefetch",!0);Ka(a,b,"preloader",!0);ua=a.onchange;J=I.infinite;J="undefined"!==typeof J&&"false"!==J;ta="false"!==I.progress;va=1*I.player||7E3;if((a=I.zoom)||""===a)I["zoom-in"]=I["zoom-out"]=a,delete I.zoom;if((a=I.control)||""===a){a="string"===typeof a?a.split(","):a;for(b=0;b
'; -l(N,"transition","none");document.body.appendChild(N);wa=V("scene");xa=V("footer");ya=V("title");za=V("description");Aa=V("arrow-left");Ba=V("arrow-right");O=V("fullscreen");Ca=V("page");Da=V("player");Ea=V("progress");P=V("preloader");S=document.documentElement||document.body;document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){});S.requestFullScreen||(S.requestFullScreen= -S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){});Ga=[[window,"keydown",Ra],[window,"wheel",Sa],[window,"hashchange",Ta],[window,"resize",Ua],[P,"mousedown",Va],[P,"mouseleave",Wa],[P,"mouseup",Wa],[P,"mousemove",Xa],[P,"touchstart",Va,{passive:!1}],[P,"touchcancel",Wa],[P,"touchend",Wa],[P,"touchmove",Xa,{passive:!0}],[O,"",Ya],[Aa,"",Za],[Ba,"",W],[Da,"",$a],[V("autofit"),"",ab],[V("zoom-in"),"",bb],[V("zoom-out"),"",cb],[V("close"),"", -db],[V("theme"),"",Na]]}function Ua(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,eb())}function eb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function fb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?cb():bb())}function Ta(){K&&"#spotlight"===location.hash&&db(!0)}function $a(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&ib()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function jb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} -function Va(a){B=!0;C=!1;var b=kb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Wa(a){if(B&&!C)return B=!1,jb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&Za()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Xa(a){if(B){Fa||(Fa=requestAnimationFrame(lb));var b=kb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&mb(A=b);a||Y()}function mb(a){A=a||1;eb()}function cb(a){var b=.65*A;1<=b&&(mb(A=b),r=q=0,E=!0,X());a||Y()}function hb(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");fb(!0);Ua();Y()} -function db(a){fb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&$a(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function Za(){if(1G;G=a;Ja(b);return!0}}function ib(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} +function Oa(){var a=G;K=L[a-1];M=K.firstElementChild;G=a;if(!M){var b="false"!==I.preloader;M=new Image;M.onload=function(){b&&h(P,"show");T&&(y=this.width,z=this.height,l(this,{visibility:"visible",opacity:1,transform:""}),"false"!==I.prefetch&&a
', +l(N,"transition","none"),document.body.appendChild(N),wa=V("scene"),xa=V("footer"),ya=V("title"),za=V("description"),Aa=V("arrow-left"),Ba=V("arrow-right"),O=V("fullscreen"),Ca=V("page"),Da=V("player"),Ea=V("progress"),P=V("preloader"),S=document.documentElement||document.body,document.cancelFullScreen||(document.cancelFullScreen=document.exitFullscreen||document.webkitCancelFullScreen||document.webkitExitFullscreen||document.mozCancelFullScreen||function(){}),S.requestFullScreen||(S.requestFullScreen= +S.webkitRequestFullScreen||S.msRequestFullScreen||S.mozRequestFullScreen||l(O,"display","none")||function(){}),Ga=[[window,"keydown",Sa],[window,"wheel",Ta],[window,"hashchange",Ua],[window,"resize",Va],[P,"mousedown",Wa],[P,"mouseleave",Xa],[P,"mouseup",Xa],[P,"mousemove",Ya],[P,"touchstart",Wa,{passive:!1}],[P,"touchcancel",Xa],[P,"touchend",Xa],[P,"touchmove",Ya,{passive:!0}],[O,"",Za],[Aa,"",$a],[Ba,"",W],[Da,"",ab],[V("autofit"),"",bb],[V("zoom-in"),"",cb],[V("zoom-out"),"",db],[V("close"),"", +eb],[V("theme"),"",Na]],Ra=!0)}function Va(){u=N.clientWidth;v=N.clientHeight;M&&(y=M.width,z=M.height,fb())}function fb(){l(M,"transform","translate(-50%, -50%) scale("+A+")")}function X(a,b){l(K,"transform",a||b?"translate("+a+"px, "+b+"px)":"")}function Ia(a,b){(a?m:l)(wa,"transform","translateX("+(100*-(G-1)+(b||0))+"%)")}function gb(a){for(var b=0;b.5*(0>a?1:a?-1:0)?db():cb())}function Ua(){K&&"#spotlight"===location.hash&&eb(!0)}function ab(a){("boolean"===typeof a?a:!Q)?Q||(Q=setInterval(W,va),f(Da,"on"),ta&&jb()):Q&&(Q=clearInterval(Q),h(Da,"on"),ta&&m(Ea,"transform",""));return Q}function Y(){R?clearTimeout(R):f(N,"menu");var a=I.autohide;R="false"!==a?setTimeout(function(){h(N,"menu");R=null},1*a||3E3):1}function kb(a){"boolean"===typeof a&&(R=a?R:0);R?(R=clearTimeout(R),h(N,"menu")):Y();return n(a)} +function Wa(a){B=!0;C=!1;var b=lb(a);D=y*A<=u;pa=b.x;qa=b.y;return n(a,!0)}function Xa(a){if(B&&!C)return B=!1,kb(a);D&&C&&(Ia(!0,q/u*100),q<-(v/10)&&W()||q>v/10&&$a()||Ia(),q=0,D=!1,X());B=!1;return n(a)}function Ya(a){if(B){Fa||(Fa=requestAnimationFrame(mb));var b=lb(a),c=(y*A-u)/2;C=!0;q-=pa-(pa=b.x);D?E=!0:q>c?q=c:0v&&(c=(z*A-v)/2,r-=qa-(qa=b.y),r>c?r=c:0=b&&nb(A=b);a||Y()}function nb(a){A=a||1;fb()}function db(a){var b=.65*A;1<=b&&(nb(A=b),r=q=0,E=!0,X());a||Y()}function ib(){location.hash="spotlight";location.hash="show";l(N,"transition","");f(S,"hide-scrollbars");f(N,"show");gb(!0);Va();Y()} +function eb(a){gb(!1);history.go(!0===a?-1:-2);h(S,"hide-scrollbars");h(N,"show");Q&&ab(!1);M.parentNode.removeChild(M);K=L=M=T=I=ua=null}function $a(){if(1G;G=a;Ja(b);return!0}}function jb(){m(Ea,{transitionDuration:"",transform:""});l(Ea,{transitionDuration:va+"ms",transform:"translateX(0)"})} function Na(a){"boolean"===typeof a?ra=a:(ra=!ra,Y());ra?f(N,sa):h(N,sa)} function Ja(a){r=q=0;A=1;var b=I.animation,c=!0,d=!0,e=!0;if(b||""===b){c=d=e=!1;b="string"===typeof b?b.split(","):b;for(var k=0;k @@ -69,7 +69,7 @@ Goto Github


-

+

Anchors & Images Lorem ipsum dolor sit amet @@ -77,12 +77,12 @@ - +

Custom Elements -
+
@@ -93,7 +93,8 @@ Slide   Fade   Scale   - Flip + Flip   + Custom

@@ -134,7 +135,9 @@ Spotlight.show(gallery, { index: index, - theme: "dark", + player: false, + zoom: false, + theme: "custom", animation: [ checkboxes[0].checked && checkboxes[0].value, checkboxes[1].checked && checkboxes[1].value, @@ -146,6 +149,6 @@ - + \ No newline at end of file