diff --git a/bower.json b/bower.json index 387ba4af..bc7f7c8d 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "baguettebox.js", - "version": "1.2.1", + "version": "1.3.0", "description": "Simple and easy to use lightbox script written in pure JavaScript", "main": [ "./build/js/baguetteBox.js", diff --git a/build/css/baguetteBox.css b/build/css/baguetteBox.css index 9ee49556..aea10522 100644 --- a/build/css/baguetteBox.css +++ b/build/css/baguetteBox.css @@ -1,7 +1,7 @@ /*! * baguetteBox.js * @author feimosi - * @version 1.2.1 + * @version 1.3.0 * @url https://github.com/feimosi/baguetteBox.js */ diff --git a/build/js/baguetteBox.js b/build/js/baguetteBox.js index a9af8d80..58867b1d 100644 --- a/build/js/baguetteBox.js +++ b/build/js/baguetteBox.js @@ -1,7 +1,7 @@ /*! * baguetteBox.js * @author feimosi - * @version 1.2.1 + * @version 1.3.0 * @url https://github.com/feimosi/baguetteBox.js */ diff --git a/dist/baguetteBox.min.css b/dist/baguetteBox.min.css index 7d93eba8..4fc83ea8 100644 --- a/dist/baguetteBox.min.css +++ b/dist/baguetteBox.min.css @@ -1,6 +1,6 @@ /*! * baguetteBox.js * @author feimosi - * @version 1.2.1 + * @version 1.3.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,-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}.baguetteBox-button svg{position:absolute;left:0;top:0}.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 18fa2693..b2615a2b 100644 --- a/dist/baguetteBox.min.js +++ b/dist/baguetteBox.min.js @@ -1,7 +1,7 @@ /*! * baguetteBox.js * @author feimosi - * @version 1.2.1 + * @version 1.3.0 * @url https://github.com/feimosi/baguetteBox.js */ var baguetteBox=function(){function t(t,n){H.transforms=f(),H.svg=g(),e(),j=document.querySelectorAll(t),[].forEach.call(j,function(t){var e=t.getElementsByTagName("a");e=[].filter.call(e,function(t){return A.test(t.href)});var o=D.length;D.push(e),D[o].options=n,[].forEach.call(D[o],function(t,e){m(t,"click",function(t){t.preventDefault?t.preventDefault():t.returnValue=!1,i(o),a(e)})})})}function e(){return(b=v("baguetteBox-overlay"))?(k=v("baguetteBox-slider"),w=v("previous-button"),C=v("next-button"),void(T=v("close-button"))):(b=y("div"),b.id="baguetteBox-overlay",document.getElementsByTagName("body")[0].appendChild(b),k=y("div"),k.id="baguetteBox-slider",b.appendChild(k),w=y("button"),w.id="previous-button",w.innerHTML=H.svg?E:"<",b.appendChild(w),C=y("button"),C.id="next-button",C.innerHTML=H.svg?x:">",b.appendChild(C),T=y("button"),T.id="close-button",T.innerHTML=H.svg?B:"X",b.appendChild(T),w.className=C.className=T.className="baguetteBox-button",void n())}function n(){m(b,"click",function(t){t.target&&"IMG"!==t.target.nodeName&&"FIGCAPTION"!==t.target.nodeName&&r()}),m(w,"click",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,c()}),m(C,"click",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,u()}),m(T,"click",function(t){t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,r()}),m(b,"touchstart",function(t){N=t.changedTouches[0].pageX}),m(b,"touchmove",function(t){S||(t.preventDefault?t.preventDefault():t.returnValue=!1,touch=t.touches[0]||t.changedTouches[0],touch.pageX-N>40?(S=!0,c()):touch.pageX-N<-40&&(S=!0,u()))}),m(b,"touchend",function(){S=!1}),m(document,"keydown",function(t){switch(t.keyCode){case 37:c();break;case 39:u();break;case 27:r()}})}function i(t){if(M!==t){for(M=t,o(D[t].options);k.firstChild;)k.removeChild(k.firstChild);X.length=0;for(var e,n=0;n
',o.onload=function(){var n=document.querySelector("#baguette-img-"+t+" .spinner");i.removeChild(n),!I.async&&e&&e()},o.setAttribute("src",imageSrc),i.appendChild(o),I.captions&&imageCaption&&(a.innerHTML=imageCaption,i.appendChild(a)),I.async&&e&&e()}}function l(t){var e=imageElement.href;if(t.dataset){var n=[];for(var i in t.dataset)"at-"!==i.substring(0,3)||isNaN(i.substring(3))||(n[i.replace("at-","")]=t.dataset[i]);keys=Object.keys(n).sort(function(t,e){return parseInt(t)=1?(L--,d(),h(L),t=!0):I.animation&&(k.className="bounce-from-left",setTimeout(function(){k.className=""},400),t=!1),I.onChange&&I.onChange(L,X.length),t}function d(){var t=100*-L+"%";"fadeIn"===I.animation?(k.style.opacity=0,setTimeout(function(){H.transforms?k.style.transform=k.style.webkitTransform="translate3d("+t+",0,0)":k.style.left=t,k.style.opacity=1},400)):H.transforms?k.style.transform=k.style.webkitTransform="translate3d("+t+",0,0)":k.style.left=t}function f(){var t=y("div");return"undefined"!=typeof t.style.perspective||"undefined"!=typeof t.style.webkitPerspective}function g(){var t=y("div");return t.innerHTML="","http://www.w3.org/2000/svg"==(t.firstChild&&t.firstChild.namespaceURI)}function p(t){t-L>=I.preload||s(t+1,function(){p(t+1)})}function h(t){L-t>=I.preload||s(t-1,function(){h(t-1)})}function m(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)}function v(t){return document.getElementById(t)}function y(t){return document.createElement(t)}var b,k,w,C,T,N,E='',x='',B='',I={},P={captions:!0,buttons:"auto",async:!1,preload:2,animation:"slideIn",afterShow:null,afterHide:null,onChange:null},H={},L=0,M=-1,S=!1,A=/.+\.(gif|jpe?g|png|webp)/i,j=[],D=[],X=[];return[].forEach||(Array.prototype.forEach=function(t,e){for(var n=0;n