/*! * Template Functions */ !function(e){"use strict";e(window).load(function(){e(".page-loader").delay(350).fadeOut("slow")}),e(document).ready(function(){function t(t,a){var o=e("#show-more"),i="numPosts="+t+"&pageNumber="+a;e.ajax({type:"GET",data:i,dataType:"html",url:"index.html",success:function(i){var r=e(i),n=(a-1)*t,s=+n+t;if(r.find(".portfolio-item").slice(n).length){var l=r.find(".portfolio-item").slice(n,s);e(".row-portfolio").append(l).isotope("appended",l).resize(),setTimeout(function(){o.text(C)},300),e("a.gallery").magnificPopup({type:"image",gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1]},image:{titleSrc:"title",tError:"The image could not be loaded."}}),e(".portfolio-item").each(function(){e(".portfolio-img-wrap",this).css("background-image","url("+e(".portfolio-img-wrap",this).attr("data-background")+")")})}else setTimeout(function(){o.text(b)},300),setTimeout(function(){e("#show-more").animate({opacity:0}).css("display","none")},1500),e("a.gallery").magnificPopup({type:"image",gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1]},image:{titleSrc:"title",tError:"The image could not be loaded."}})},error:function(e,t,a){console.log(e+" :: "+t+" :: "+a),setTimeout(function(){o.removeClass("ss-loading"),o.text(x)},300)}})}var a;a=!!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);var o=e(".header");e(window).scroll(function(){var t=e(window).scrollTop();t>=5?o.addClass("header-small"):o.removeClass("header-small"),e(".module-header").length<=0&&e(".module-slides").length<=0&&(o.addClass("header-small"),console.log("dsf"))}).scroll();var i=e(".module-header");i.length>=0&&(i.hasClass("bg-dark")?o.addClass("header-light"):o.removeClass("header-light")),e(".show-menu-btn").on("click",function(){return e(".overlay-menu").toggleClass("active"),e("body").toggleClass("menu-opened"),!1}),e(".close-menu").on("click",function(){return setTimeout(function(){e(".overlay-menu").removeClass("active"),e("body").removeClass("menu-opened")},500),!1}),e(window).keydown(function(t){if(e(".overlay-menu").hasClass("active")&&27===t.which)return setTimeout(function(){e(".overlay-menu").removeClass("active"),e("body").removeClass("menu-opened")},500),!1}),e(".module-slides").superslides({play:1e4,animation:"fade",animation_speed:800,pagination:!0}),e(document).on("animated.slides",function(){var t=e(".module-slides").superslides("current"),a=e(".slides-container li").eq(t);e(".slides-container li").removeClass("active-slide"),a.addClass("active-slide"),e(".slides-container li.bg-dark").hasClass("active-slide")?o.addClass("header-light"):o.removeClass("header-light")}),e(".rotate").textrotator({animation:"dissolve",separator:"|",speed:3e3}),e("[data-background]").each(function(){e(this).css("background-image","url("+e(this).attr("data-background")+")")}),e(".parallax").jarallax({speed:.4});var r=e("#filters"),n=e(".row-portfolio");e("a",r).on("click",function(){var t=e(this).attr("data-filter");return e(".current",r).removeClass("current"),e(this).addClass("current"),n.isotope({filter:t}),!1}),e(window).on("resize",function(){e(".row-portfolio").imagesLoaded(function(){e(".row-portfolio").isotope({layoutMode:"masonry",itemSelector:".portfolio-item",transitionDuration:"0.6s",masonry:{columnWidth:".grid-sizer"}})})}).resize(),e(window).on("resize",function(){setTimeout(function(){e(".blog-masonry").isotope({layoutMode:"masonry",transitionDuration:"0.6s"})},1e3)}).resize(),e(".tms-slides").owlCarousel({autoPlay:5e3,nav:!1,singleItem:!0,pagination:!0,paginationSpeed:1e3}),e(".image-slider").owlCarousel({autoPlay:4e3,navigation:!0,loop:!0,nav:!0,singleItem:!0,pagination:!1,center:!0,navigationText:['','']}),e(".progress-bar").each(function(){e(this).appear(function(){var t=e(this).attr("aria-valuenow");e(this).animate({width:t+"%"}),e(this).find(".pb-number-box").animate({opacity:1},900),e(this).find(".pb-number").countTo({from:0,to:t,speed:900,refreshInterval:30})})}),e(".counter-timer").each(function(){e(this).appear(function(){var t=e(this).attr("data-to");e(this).countTo({from:0,to:t,speed:1500,refreshInterval:10,formatter:function(e,t){return e=e.toFixed(t.decimals),e=e.replace(/\B(?=(\d{3})+(?!\d))/g,",")}})})}),e(".chart").each(function(){e(this).appear(function(){e(this).easyPieChart(e.extend({barColor:"#111111",trackColor:"#eee",scaleColor:!1,lineCap:"round",lineWidth:3,size:180},e(this).data("chart-options")));var t=e(this).attr("data-percent");e(this).find(".chart-text span").countTo({from:0,to:t,speed:1e3,refreshInterval:10,formatter:function(e,t){return e=e.toFixed(t.decimals),e=e.replace(/\B(?=(\d{3})+(?!\d))/g,",")}})})}),e(".twitter-feed").each(function(t){e(this).attr("id","twitter-"+t);var a=e(this).data("twitter"),o=e(this).data("number"),i={id:a,domId:"twitter-"+t,maxTweets:o,enableLinks:!0,showPermalinks:!1};twitterFetcher.fetch(i)}),e(".lightbox").magnificPopup({type:"image"}),e("[rel=gallery]").magnificPopup({type:"image",gallery:{enabled:!0,navigateByImgClick:!0,preload:[0,1]},image:{titleSrc:"title",tError:"The image could not be loaded."}}),e(".lightbox-video").magnificPopup({type:"iframe"});var s=new WOW({mobile:!1});s.init(),e("body").fitVids();var l=/\[[^(\]\[)]*\]/g,d=e("#map"),c=Math.max(e(window).width(),window.innerWidth)>736;if(d.length>0){var m,u=d[0].getAttribute("data-addresses").match(l),p=d[0].getAttribute("data-info").match(l),h=d.data("icon"),g=d.data("zoom"),f=[];u.forEach(function(e,t){var a="{";if(a+='"latLng":'+e,0==t&&(m=JSON.parse(e)),p[t]){var o=p[t].replace(/\[|\]/g,"");a+=', "data":"'+o+'"'}a+="}",f.push(JSON.parse(a))});var y={scrollwheel:!1,styles:[{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:.2}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}]};y.center=m,y.zoom=g,y.draggable=c;var v={};v.icon=h,d.gmap3({map:{options:y},marker:{values:f,options:v,events:{click:function(t,a,o){if(o.data){var i=e(this).gmap3("get"),r=e(this).gmap3({get:{name:"infowindow"}});r?(r.open(i,t),r.setContent(o.data)):e(this).gmap3({infowindow:{anchor:t,options:{content:o.data}}})}}}}})}var w=0,T=5,b="Done",C="More works",k="Loading...",x="Error! Check the console for more information.";e("#show-more").on("click",function(){return e(this).text(k),setTimeout(function(){t(T,w)},300),w++,!1}),e(".smoothscroll").on("click",function(t){var a=this.hash,i=e(a);e("html, body").stop().animate({scrollTop:i.offset().top-o.height()},600,"swing"),t.preventDefault()}),e('a[href="#top"]').on("click",function(){return e("html, body").animate({scrollTop:0},"slow"),!1});var P,I=document.body;window.addEventListener("scroll",function(){clearTimeout(P),I.classList.contains("disable-hover")||I.classList.add("disable-hover"),P=setTimeout(function(){I.classList.remove("disable-hover")},100)},!1)})}(jQuery);