/*! * baguetteBox.js * @author feimosi * @version 1.3.2 * @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){n&&n.filter&&(A=n.filter);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"),T=v("close-button"),void 0):(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",n(),void 0)}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