diff --git a/bower.json b/bower.json index 2223e5ad..3122eacc 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "baguettebox.js", - "version": "0.6.0", + "version": "0.7.0", "description": "Simple and easy to use lightbox script written in pure JavaScript", "main": [ "./build/js/baguetteBox.js", diff --git a/dist/baguetteBox.min.css b/dist/baguetteBox.min.css index 265932cb..8d138240 100644 --- a/dist/baguetteBox.min.css +++ b/dist/baguetteBox.min.css @@ -1,6 +1,6 @@ /*! * baguetteBox.js * @author feimosi - * @version 0.6.0 + * @version 0.7.0 * @url https://github.com/feimosi/baguetteBox.js - */#baguetteBox-overlay{display:none;opacity:0;position:fixed;overflow:hidden;top:0;left:0;width:100%;height:100%;z-index:1000000;background-color:#222;background-color:rgba(0,0,0,.8);-webkit-transition:opacity .5s ease;transition:opacity .5s ease}#baguetteBox-overlay.visible{opacity:1}#baguetteBox-overlay .full-image{display:inline-block;position:relative;width:100%;height:100%;text-align:center}#baguetteBox-overlay .full-image figure{display:inline;margin:0;height:100%}#baguetteBox-overlay .full-image img{display:inline-block;width:auto;height:auto;max-height:100%;max-width:100%;vertical-align:middle;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);-moz-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}#baguetteBox-overlay .full-image figcaption{display:block;position:absolute;bottom:0;width:100%;text-align:center;line-height:1.8;color:#ccc;background-color:#000;background-color:rgba(0,0,0,.6);font-family:sans-serif}#baguetteBox-overlay .full-image:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#baguetteBox-slider{position:absolute;left:0;top:0;height:100%;width:100%;white-space:nowrap;-webkit-transition:left .4s ease;transition:left .4s ease}#baguetteBox-slider.bounce-from-right{-webkit-animation:bounceFromRight .4s ease-out;animation:bounceFromRight .4s ease-out}#baguetteBox-slider.bounce-from-left{-webkit-animation:bounceFromLeft .4s ease-out;animation:bounceFromLeft .4s ease-out}.baguetteBox-button#next-button,.baguetteBox-button#previous-button{top:50%;top:calc(50% - 30px);width:44px;height:60px}.baguetteBox-button{position:absolute;cursor:pointer;outline:0;padding:0;margin:0;border:0;-moz-border-radius:15%;border-radius:15%;background-color:#323232;background-color:rgba(50,50,50,.5);color:#ddd;font:1.6em sans-serif;-webkit-transition:background-color .4s ease;transition:background-color .4s ease}.baguetteBox-button:hover{background-color:rgba(50,50,50,.9)}.baguetteBox-button#next-button{right:2%}.baguetteBox-button#previous-button{left:2%}.baguetteBox-button#close-button{top:20px;right:2%;right:calc(2% + 6px);width:30px;height:30px}.spinner{width:40px;height:40px;display:inline-block;position:absolute;top:50%;left:50%;margin-top:-20px;margin-left:-20px}.double-bounce1,.double-bounce2{width:100%;height:100%;-moz-border-radius:50%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:bounce 2s infinite ease-in-out;animation:bounce 2s infinite ease-in-out}.double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounceFromRight{0%{margin-left:0}50%{margin-left:-30px}100%{margin-left:0}}@keyframes bounceFromRight{0%{margin-left:0}50%{margin-left:-30px}100%{margin-left:0}}@-webkit-keyframes bounceFromLeft{0%{margin-left:0}50%{margin-left:30px}100%{margin-left:0}}@keyframes bounceFromLeft{0%{margin-left:0}50%{margin-left:30px}100%{margin-left:0}}@-webkit-keyframes bounce{0%,100%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounce{0%,100%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}} \ No newline at end of file + */#baguetteBox-overlay{display:none;opacity:0;position:fixed;overflow:hidden;top:0;left:0;width:100%;height:100%;z-index:1000000;background-color:#222;background-color:rgba(0,0,0,.8);-webkit-transition:opacity .5s ease;transition:opacity .5s ease}#baguetteBox-overlay.visible{opacity:1}#baguetteBox-overlay .full-image{display:inline-block;position:relative;width:100%;height:100%;text-align:center}#baguetteBox-overlay .full-image figure{display:inline;margin:0;height:100%}#baguetteBox-overlay .full-image img{display:inline-block;width:auto;height:auto;max-height:100%;max-width:100%;vertical-align:middle;-webkit-box-shadow:0 0 8px rgba(0,0,0,.6);-moz-box-shadow:0 0 8px rgba(0,0,0,.6);box-shadow:0 0 8px rgba(0,0,0,.6)}#baguetteBox-overlay .full-image figcaption{display:block;position:absolute;bottom:0;width:100%;text-align:center;line-height:1.8;color:#ccc;background-color:#000;background-color:rgba(0,0,0,.6);font-family:sans-serif}#baguetteBox-overlay .full-image:before{content:"";display:inline-block;height:50%;width:1px;margin-right:-1px}#baguetteBox-slider{position:absolute;left:0;top:0;height:100%;width:100%;white-space:nowrap;-webkit-transition:left .4s ease,-webkit-transform .4s ease;transition:left .4s ease,-moz-transform .4s ease;transition:left .4s ease,transform .4s ease}#baguetteBox-slider.bounce-from-right{-webkit-animation:bounceFromRight .4s ease-out;animation:bounceFromRight .4s ease-out}#baguetteBox-slider.bounce-from-left{-webkit-animation:bounceFromLeft .4s ease-out;animation:bounceFromLeft .4s ease-out}.baguetteBox-button#next-button,.baguetteBox-button#previous-button{top:50%;top:calc(50% - 30px);width:44px;height:60px}.baguetteBox-button{position:absolute;cursor:pointer;outline:0;padding:0;margin:0;border:0;-moz-border-radius:15%;border-radius:15%;background-color:#323232;background-color:rgba(50,50,50,.5);color:#ddd;font:1.6em sans-serif;-webkit-transition:background-color .4s ease;transition:background-color .4s ease}.baguetteBox-button:hover{background-color:rgba(50,50,50,.9)}.baguetteBox-button#next-button{right:2%}.baguetteBox-button#previous-button{left:2%}.baguetteBox-button#close-button{top:20px;right:2%;right:calc(2% + 6px);width:30px;height:30px}.spinner{width:40px;height:40px;display:inline-block;position:absolute;top:50%;left:50%;margin-top:-20px;margin-left:-20px}.double-bounce1,.double-bounce2{width:100%;height:100%;-moz-border-radius:50%;border-radius:50%;background-color:#fff;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:bounce 2s infinite ease-in-out;animation:bounce 2s infinite ease-in-out}.double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}@-webkit-keyframes bounceFromRight{0%{margin-left:0}50%{margin-left:-30px}100%{margin-left:0}}@keyframes bounceFromRight{0%{margin-left:0}50%{margin-left:-30px}100%{margin-left:0}}@-webkit-keyframes bounceFromLeft{0%{margin-left:0}50%{margin-left:30px}100%{margin-left:0}}@keyframes bounceFromLeft{0%{margin-left:0}50%{margin-left:30px}100%{margin-left:0}}@-webkit-keyframes bounce{0%,100%{-webkit-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes bounce{0%,100%{-webkit-transform:scale(0);-moz-transform:scale(0);transform:scale(0)}50%{-webkit-transform:scale(1);-moz-transform:scale(1);transform:scale(1)}} \ No newline at end of file diff --git a/dist/baguetteBox.min.js b/dist/baguetteBox.min.js index 9d077ee9..0d4573cd 100644 --- a/dist/baguetteBox.min.js +++ b/dist/baguetteBox.min.js @@ -1,7 +1,7 @@ /*! * baguetteBox.js * @author feimosi - * @version 0.6.0 + * @version 0.7.0 * @url https://github.com/feimosi/baguetteBox.js */ -var baguetteBox=function(){function e(e,n){t(),M=document.querySelectorAll(e),[].forEach.call(M,function(e){var t=H.length;H.push(e.getElementsByTagName("a")),H[t].options=n,[].forEach.call(H[t],function(e,n){g(e,"click",function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,o(t),s(n)})})})}function t(){return(y=document.getElementById(N))?(h=document.getElementById(T),v=document.getElementById("previous-button"),b=document.getElementById("next-button"),void(E=document.getElementById("close-button"))):(y=document.createElement("div"),y=document.getElementsByTagName("body")[0].appendChild(y),y.id=N,h=document.createElement("div"),h=y.appendChild(h),h.id=T,h.style.left="0%",v=document.createElement("button"),v.id="previous-button",v.innerHTML=w,v=y.appendChild(v),b=document.createElement("button"),b.id="next-button",b.innerHTML=B,b=y.appendChild(b),E=document.createElement("button"),E.id="close-button",E.innerHTML=C,E=y.appendChild(E),v.className=b.className=E.className="baguetteBox-button",void n())}function n(){g(y,"click",function(e){e.target&&"IMG"!==e.target.nodeName&&l()}),g(document.getElementById("previous-button"),"click",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,d()}),g(document.getElementById("next-button"),"click",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,u()}),g(document.getElementById("close-button"),"click",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,l()}),g(y,"touchstart",function(e){k=e.changedTouches[0].pageX}),g(y,"touchmove",function(e){A||(e.preventDefault?e.preventDefault():e.returnValue=!1,touch=e.touches[0]||e.changedTouches[0],touch.pageX-k>40?(A=!0,d()):touch.pageX-k<-40&&(A=!0,u()))}),g(y,"touchend",function(){A=!1}),g(document,"keydown",function(e){switch(e.keyCode){case 37:d();break;case 39:u();break;case 27:l()}})}function o(e){if(P!==e){for(P=e,i(H[e].options);h.firstChild;)h.removeChild(h.firstChild);D.length=0;for(var t=0;t
',o.appendChild(i),x.captions&&imageCaption&&(a.innerHTML=imageCaption,o.appendChild(a)),x.async&&t&&t()}}function r(e){var t=imageElement.getAttribute("href");if(e.dataset){var n=[];for(var o in e.dataset)"at-"===o.substring(0,3)&&(n[o.replace("at-","")]=e.dataset[o]);keys=Object.keys(n).sort(function(e,t){return parseInt(e)=i){t=n[keys[a]];break}t=n[keys[a]]}}return t}function u(){L<=D.length-2?(L++,p(),m(L)):(h.className="bounce-from-right",setTimeout(function(){h.className=""},400))}function d(){L>=1?(L--,p(),f(L)):(h.className="bounce-from-left",setTimeout(function(){h.className=""},400))}function p(){"fadeIn"===x.animation?(h.style.opacity=0,setTimeout(function(){h.style.left=100*-L+"%",h.style.opacity=1},400)):h.style.left=100*-L+"%"}function m(e){e-L>=x.preload||c(e+1,function(){m(e+1)})}function f(e){L-e>=x.preload||c(e-1,function(){f(e-1)})}function g(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}var y,h,v,b,E,k,w='<',B='>',C='X',N="baguetteBox-overlay",T="baguetteBox-slider",x={},I={captions:!0,buttons:"auto",async:!1,preload:2,animation:"slideIn"},L=0,P=-1,A=!1,M=[],H=[],D=[];return Array.prototype.forEach||(Array.prototype.forEach=function(e,t){for(var n=this.length,o=0;n>o;o++)e.call(t,this[o],o,this)}),{run:e}}(); \ No newline at end of file +var baguetteBox=function(){function e(e,n){t(),H=document.querySelectorAll(e),[].forEach.call(H,function(e){var t=D.length;D.push(e.getElementsByTagName("a")),D[t].options=n,[].forEach.call(D[t],function(e,n){y(e,"click",function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,o(t),s(n)})})}),P.transforms=p()}function t(){return(h=document.getElementById(C))?(v=document.getElementById(x),b=document.getElementById("previous-button"),E=document.getElementById("next-button"),void(k=document.getElementById("close-button"))):(h=document.createElement("div"),h.id=C,document.getElementsByTagName("body")[0].appendChild(h),v=document.createElement("div"),v.id=x,h.appendChild(v),b=document.createElement("button"),b.id="previous-button",b.innerHTML=B,h.appendChild(b),E=document.createElement("button"),E.id="next-button",E.innerHTML=N,h.appendChild(E),k=document.createElement("button"),k.id="close-button",k.innerHTML=T,h.appendChild(k),b.className=E.className=k.className="baguetteBox-button",void n())}function n(){y(h,"click",function(e){e.target&&"IMG"!==e.target.nodeName&&r()}),y(document.getElementById("previous-button"),"click",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,d()}),y(document.getElementById("next-button"),"click",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,u()}),y(document.getElementById("close-button"),"click",function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,r()}),y(h,"touchstart",function(e){w=e.changedTouches[0].pageX}),y(h,"touchmove",function(e){M||(e.preventDefault?e.preventDefault():e.returnValue=!1,touch=e.touches[0]||e.changedTouches[0],touch.pageX-w>40?(M=!0,d()):touch.pageX-w<-40&&(M=!0,u()))}),y(h,"touchend",function(){M=!1}),y(document,"keydown",function(e){switch(e.keyCode){case 37:d();break;case 39:u();break;case 27:r()}})}function o(e){if(A!==e){for(A=e,i(D[e].options);v.firstChild;)v.removeChild(v.firstChild);S.length=0;for(var t=0;t
',i.onload=function(){var e=this.parentNode.querySelector(".spinner");this.parentNode.removeChild(e),!I.async&&t&&t()},i.setAttribute("src",imageSrc),o.appendChild(i),I.captions&&imageCaption&&(a.innerHTML=imageCaption,o.appendChild(a)),I.async&&t&&t()}}function c(e){var t=imageElement.getAttribute("href");if(e.dataset){var n=[];for(var o in e.dataset)"at-"!==o.substring(0,3)||isNaN(o.substring(3))||(n[o.replace("at-","")]=e.dataset[o]);keys=Object.keys(n).sort(function(e,t){return parseInt(e)=i){t=n[keys[a]];break}t=n[keys[a]]}}return t}function u(){L<=S.length-2?(L++,m(),f(L)):(v.className="bounce-from-right",setTimeout(function(){v.className=""},400))}function d(){L>=1?(L--,m(),g(L)):(v.className="bounce-from-left",setTimeout(function(){v.className=""},400))}function m(){var e=100*-L+"%";"fadeIn"===I.animation?(v.style.opacity=0,setTimeout(function(){I.transforms?v.style.transform=v.style.webkitTransform="translate3d("+e+",0,0)":v.style.left=e,v.style.opacity=1},400)):I.transforms?v.style.transform=v.style.webkitTransform="translate3d("+e+",0,0)":v.style.left=e}function p(){var e=document.createElement("div"),t=!1;return t="undefined"!=typeof e.style.perspective||"undefined"!=typeof e.style.webkitPerspective}function f(e){e-L>=I.preload||l(e+1,function(){f(e+1)})}function g(e){L-e>=I.preload||l(e-1,function(){g(e-1)})}function y(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}var h,v,b,E,k,w,B='<',N='>',T='X',C="baguetteBox-overlay",x="baguetteBox-slider",I={},P={captions:!0,buttons:"auto",async:!1,preload:2,animation:"slideIn"},L=0,A=-1,M=!1,H=[],D=[],S=[];return Array.prototype.forEach||(Array.prototype.forEach=function(e,t){for(var n=this.length,o=0;n>o;o++)e.call(t,this[o],o,this)}),{run:e}}(); \ No newline at end of file diff --git a/package.json b/package.json index 249d89ac..40e9c5e6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "baguetteBox.js", - "version": "0.6.0", + "version": "0.7.0", "description": "Simple and easy to use lightbox script written in pure JavaScript", "main": "gulpfile.js", "devDependencies": { diff --git a/src/baguetteBox.js b/src/baguetteBox.js index f2309b40..a950de05 100644 --- a/src/baguetteBox.js +++ b/src/baguetteBox.js @@ -1,7 +1,7 @@ /*! * baguetteBox.js * @author feimosi - * @version 0.6.0 + * @version 0.7.0 * @url https://github.com/feimosi/baguetteBox.js */ diff --git a/src/baguetteBox.scss b/src/baguetteBox.scss index e79ceb58..81609347 100644 --- a/src/baguetteBox.scss +++ b/src/baguetteBox.scss @@ -1,7 +1,7 @@ /*! * baguetteBox.js * @author feimosi - * @version 0.6.0 + * @version 0.7.0 * @url https://github.com/feimosi/baguetteBox.js */