/** * Galleria - v1.6.1 2019-10-17 * * * Copyright (c) 2010 - 2019 worse is better UG * Licensed under the MIT License. */ !function(a,b){"function"==typeof define&&define.amd?define(["../galleria","jquery"],function(c,d){return b(a,c,d)}):"object"==typeof module&&module.exports?module.exports=b(a,require("galleria"),require("jquery")):b(a,a.Galleria,a.jQuery)}(window,function(a,b,c){return b.addTheme({name:"folio",version:1.6,author:"Galleria",css:"galleria.folio.css",defaults:{transition:"pulse",thumbCrop:"width",imageCrop:!1,carousel:!1,show:!1,easing:"galleriaOut",trueFullscreen:!1,_webkitCursor:!1,_animate:!0,_center:!1,_onClick:null},init:function(d){b.requires(1.6,"This version of Folio theme requires Galleria version 1.6 or later"),this.addElement("preloader","loaded","close").append({container:"preloader",preloader:"loaded",stage:"close"});var e=this,f=this.$("stage"),g=this.$("thumbnails"),h=this.$("thumbnails-container"),i=this.$("images"),j=this.$("info"),k=this.$("loader"),l=this.$("target"),m=0,n=l.width(),o=d._center,p=0,q=0,r=a.location.hash.substr(2),s=function(b){e.$("info").css({left:e.finger?20:Math.max(20,c(a).width()/2-b/2+10)})},t=function(b){return Math.min.apply(a,b)},u=function(b){return Math.max.apply(a,b)},v=function(d,e){e=c.extend({speed:400,width:190,onbrick:function(){},onheight:function(){},delay:0,debug:!1},e),d=c(d);var f,i,j,k,l=d.children(),m=d.width(),n=Math.floor(m/e.width),q=[],r={float:"none",position:"absolute",display:b.SAFARI?"inline-block":"block"};if(o){var m=h.width(),s=(m-(n*p-10))/2;g.css("left",n?s:0)}if(d.data("colCount")!==n&&(d.data("colCount",n),l.length)){for(f=0;f-1;f--)q[f]===t(q)&&(i=f);j={top:q[i],left:e.width*i},"number"==typeof j.top&&"number"==typeof j.left&&(e.speed?a.setTimeout(function(a,c,d){return function(e){b.utils.animate(a,d,{easing:"galleriaOut",duration:c.speed,complete:c.onbrick})}}(g,e,j),d*e.delay):(g.css(j),e.onbrick.call(g)),g.data("height")||g.data("height",g.outerHeight(!0)),q[i]+=g.data("height"))}),k=u(q),k<0||"number"==typeof k&&(e.speed?d.animate({height:u(q)},e.speed,e.onheight):(d.height(u(q)),e.onheight.call(d)))}};o&&this.$("container").addClass("center"),this.bind("fullscreen_enter",function(a){this.$("container").css("height","100%"),e.finger&&c.each(e._controls.slides,function(a,b){c(b.container).show()})}),this.bind("fullscreen_exit",function(a){this.getData().iframe&&(c(this._controls.getActive().container).find("iframe").remove(),this.$("container").removeClass("iframe")),b.TOUCH||c(e._controls.getActive().container).hide(),e.finger&&c.each(e._controls.slides,function(a,b){c(b.container).hide()})}),this._fullscreen.beforeExit=function(a){j.hide(),b.IE8&&b.utils.animate(e.getActiveImage(),{opacity:0},{duration:200}),b.utils.animate(f[0],{opacity:0},{duration:200,complete:function(){f.css({visibility:"hidden",opacity:1}),g.show(),b.utils.animate(g[0],{opacity:1},{duration:200}),a()}})},this.bind("thumbnail",function(h){this.addElement("plus");var j=h.thumbTarget,k=this.$("plus").css({display:"block"}).insertAfter(j),n=c(j).parent().data("index",h.index);d.showInfo&&this.hasInfo(h.index)&&k.append(""+this.getData(h.index).title+""),p=p||c(j).parent().outerWidth(!0),q=q||p-c(j).width(),c(j).css("opacity",0),n.off(d.thumbEventType),b.IE?k.hide():k.css("opacity",0),b.TOUCH?n.on("touchstart",function(){k.css("opacity",1)}).on("touchend",function(){k.hide()}):n.hover(function(){b.IE?k.show():k.stop().css("opacity",1)},function(){b.IE?k.hide():k.stop().animate({opacity:0},300)}),m++,this.$("loaded").css("width",m/this.getDataLength()*100+"%"),m===this.getDataLength()&&(this.$("preloader").fadeOut(100),g.data("colCount",null),v(g,{width:p,speed:d._animate?400:0,onbrick:function(){var h=this,j=c(h).find("img, .img");a.setTimeout(function(a){return function(){b.utils.animate(a,{opacity:1},{duration:d.transition_speed,complete:function(){c(a).parent().css("background","#000")}}),a.parent().off("click:fast click").on("click:fast",function(){var a=c(this).data("index");if(b.IE<9&&c(this).find(".galleria-plus").hide(),c.isFunction(d._onClick))return void d._onClick.call(e,e.getData(a));f.css({visibility:"visible",opacity:0}),e.$("target").height(e.$("target").height()),e.finger&&i.css("opacity",0),b.utils.animate(g[0],{opacity:0},{duration:100,complete:function(){g.hide(),e.enterFullscreen(),b.utils.animate(f[0],{opacity:1},{duration:200,complete:function(){e.finger&&(i.animate({opacity:1}),e.finger.moveTo(a)),e.finger&&e.finger.setPosition(-a*e.finger.width),e.show(a)}})}})})}}(j),d._animate?100*j.parent().data("index"):0)},onheight:function(){l.height(g.height())}}))}),this.bind("loadstart",function(a){a.cached||k.show()}),this.bind("data",function(){m=0}),this.bind("loadfinish",function(a){a.galleriaData&&(k.hide(),this.finger||j.hide(),this.hasInfo()&&d.showInfo&&this.isFullscreen()&&!this.finger&&j.fadeIn(d.transition?d.transitionSpeed:0),s(c(a.imageTarget).width()),this.finger&&d.showInfo&&j.show())}),b.TOUCH||d._webkitCursor||(this.addIdleState(this.get("image-nav-left"),{left:-100}),this.addIdleState(this.get("image-nav-right"),{right:-100}),this.addIdleState(this.get("info"),{opacity:0})),this.$("container").css({width:d.width,height:"auto"}),d._webkitCursor&&b.WEBKIT&&!b.TOUCH&&this.$("image-nav-right,image-nav-left").addClass("cur"),b.TOUCH&&this.setOptions({transition:"fadeslide",initialTransition:!1}),this.$("close").on("click:fast",function(){e.exitFullscreen()}),b.History&&r&&(f.css("visibility","visible"),g.css("opacity",0),this.$("preloader").hide(),this.enterFullscreen(function(){this.show(parseInt(r,10))}));var w=null,x=function(a){if(w=null,e.isFullscreen())return void(e.getActiveImage()&&s(e.getActiveImage().width));var b=h.width();b!==n&&(n=b,v(g,{width:p,delay:50,debug:!0,onheight:function(){l.height(g.height())}}))};c(a).resize(function(){w&&clearTimeout(w),w=setTimeout(x,200)}),x()}}),b});