')}),t+="",this.$list=e(t).appendTo(this.$grid).on("click touchstart","li",function(){o.jumpTo(e(this).data("index"))}),this.$list.find("img").hide().one("load",function(){var t,n,o,s,i=e(this).parent().removeClass("fancybox-thumbs-loading"),a=i.outerWidth(),r=i.outerHeight();t=this.naturalWidth||this.width,n=this.naturalHeight||this.height,o=t/a,s=n/r,o>=1&&s>=1&&(o>s?(t/=s,n=r):(t=a,n/=o)),e(this).css({width:Math.floor(t),height:Math.floor(n),"margin-top":Math.min(0,Math.floor(.3*r-.3*n)),"margin-left":Math.min(0,Math.floor(.5*a-.5*t))}).show()}).each(function(){this.src=e(this).data("src")})},focus:function(){this.instance.current&&this.$list.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+this.instance.current.index+'"]').addClass("fancybox-thumbs-active").focus()},close:function(){this.$grid.hide()},update:function(){this.instance.$refs.container.toggleClass("fancybox-container--thumbs",this.isVisible),this.isVisible?(this.$grid||this.create(),this.$grid.show(),this.focus()):this.$grid&&this.$grid.hide(),this.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible?this.hide():this.show()}}),e(t).on("onInit.fb",function(t,e){var o=e.group[0],s=e.group[1];e.opts.thumbs&&!e.Thumbs&&e.group.length>1&&("image"==o.type||o.opts.thumb||o.opts.$thumb)&&("image"==s.type||s.opts.thumb||s.opts.$thumb)&&(e.Thumbs=new n(e))}),e(t).on("beforeMove.fb",function(t,e,n){var o=e&&e.Thumbs;o&&(n.modal?(o.$button.hide(),o.hide()):(e.opts.thumbs.showOnStart===!0&&e.firstRun&&o.show(),o.$button.show(),o.isVisible&&o.focus()))}),e(t).on("beforeClose.fb",function(t,e){e&&e.Thumbs&&(e.Thumbs.isVisible&&e.opts.thumbs.hideOnClosing!==!1&&e.Thumbs.close(),e.Thumbs=null)})}(document,window.jQuery),function(t,e,n){"use strict";function o(){var t=e.location.hash.substr(1),n=t.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,s=n.join("-");return o<1&&(o=1),{hash:t,index:o,gallery:s}}function s(t){var e;""!==t.gallery&&(e=n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1),e.length?e.trigger("click"):n("#"+n.escapeSelector(t.gallery)).trigger("click"))}function i(t){var e;return!!t&&(e=t.current?t.current.opts:t.opts,e.$orig?e.$orig.data("fancybox"):e.hash||"")}n.escapeSelector||(n.escapeSelector=function(t){var e=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,n=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t};return(t+"").replace(e,n)});var a=null;n(function(){setTimeout(function(){n.fancybox.defaults.hash!==!1&&(n(e).on("hashchange.fb",function(){var t=o();n.fancybox.getInstance()?a&&a!==t.gallery+"-"+t.index&&(a=null,n.fancybox.close()):""!==t.gallery&&s(t)}),n(t).on({"onInit.fb":function(t,e){var n=o(),s=i(e);s&&n.gallery&&s==n.gallery&&(e.currIndex=n.index-1)},"beforeMove.fb":function(n,o,s){var r=i(o);r&&""!==r&&(e.location.hash.indexOf(r)<0&&(o.opts.origHash=e.location.hash),a=r+(o.group.length>1?"-"+(s.index+1):""),"pushState"in history?history.pushState("",t.title,e.location.pathname+e.location.search+"#"+a):e.location.hash=a)},"beforeClose.fb":function(n,o,s){var r=i(o),c=o&&o.opts.origHash?o.opts.origHash:"";r&&""!==r&&("pushState"in history?history.pushState("",t.title,e.location.pathname+e.location.search+c):e.location.hash=c),a=null}}),s(o()))},50)})}(document,window,window.jQuery); !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Macy=e()}(this,function(){"use strict";function t(t){var e=document.body.clientWidth,o=void 0;for(var n in t.breakAt)if(e1&&void 0!==arguments[1])||arguments[1],n=t(e),r=void 0,i=100/n;return o?1===n?"100%":(r=(n-1)*e.margin/n,"calc("+i+"% - "+r+"px)"):i}function o(o,n){var r=t(o.options),i=0,s=void 0;return 1===++n?0:(s=(o.options.margin-(r-1)*o.options.margin/r)*(n-1),i+=e(o.options,!1)*(n-1),"calc("+i+"% + "+s+"px)")}function n(t){for(var e=0,o=t.container,n=t.rows,r=n.length-1;r>=0;r--)e=n[r]>e?n[r]:e;o.style.height=e+"px"}function r(e,o){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];l(e,t(e.options),r),o.forEach(function(t){var o=0,n=parseInt(t.offsetHeight,10);isNaN(n)||(e.rows.forEach(function(t,n){t2&&void 0!==arguments[2]&&arguments[2],i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=t(e.options);l(e,s,r),o.forEach(function(t){e.lastcol===s&&(e.lastcol=0);var o=c(t,"height");o=parseInt(o.replace("px",""),10),isNaN(o)||(t.style.position="absolute",t.style.top=e.rows[e.lastcol]+"px",t.style.left=""+e.cols[e.lastcol],e.rows[e.lastcol]+=isNaN(o)?0:o+e.options.margin,e.lastcol+=1,i&&(t.dataset.macyComplete=1))}),i&&(e.tmpRows=null),n(e)}function s(t,e){var o=void 0;return function(){o&&clearTimeout(o),o=setTimeout(t,e)}}Object.getOwnPropertyNames(Array.prototype).forEach(function(t){"length"!==t&&(NodeList.prototype[t]=Array.prototype[t],HTMLCollection.prototype[t]=Array.prototype[t])});var a=function t(e,o){if(!(this instanceof t))return new t(e,o);if(e=e.replace(/^\s*/,"").replace(/\s*$/,""),o)return this.byCss(e,o);for(var n in this.selectors)if(o=n.split("/"),new RegExp(o[1],o[2]).test(e))return this.selectors[n](e);return this.byCss(e)};a.prototype.byCss=function(t,e){return(e||document).querySelectorAll(t)},a.prototype.selectors={},a.prototype.selectors[/^\.[\w\-]+$/]=function(t){return document.getElementsByClassName(t.substring(1))},a.prototype.selectors[/^\w+$/]=function(t){return document.getElementsByTagName(t)},a.prototype.selectors[/^\#[\w\-]+$/]=function(t){return document.getElementById(t.substring(1))};var c=function(t,e){return window.getComputedStyle(t,null).getPropertyValue(e)},l=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t.lastcol||(t.lastcol=0),n){t.rows=[],t.cols=[],t.lastcol=0;for(var r=e-1;r>=0;r--)t.rows[r]=0,t.cols[r]=o(t,r)}if(t.tmpRows){t.rows=[];for(var r=e-1;r>=0;r--)t.rows[r]=t.tmpRows[r]}else{t.tmpRows=[];for(var r=e-1;r>=0;r--)t.tmpRows[r]=t.rows[r]}},u=function(t){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=o?t.container.children:a(':scope > *:not([data-macy-complete="1"])',t.container),c=e(t.options);return s.forEach(function(t){o&&(t.dataset.macyComplete=0),t.style.width=c}),t.options.trueOrder?i(t,s,o,n):r(t,s,o,n)},p=function(t,e){setTimeout(function(){var o=t();e&&e(o)},0)},f=function(t,e,o){t&&p(t),o.req===o.complete&&p(e)},h=function(t,e,o){var n=t.length,r=0;t.forEach(function(t){t.complete&&(r++,f(e,o,{req:n,complete:r})),t.addEventListener("load",function(){r++,f(e,o,{req:n,complete:r})})})},d=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:m;if(!(this instanceof t))return new t(e);if(this.options={},d(this.options,m,e),this.container=a(e.container),this.container instanceof a||!this.container)return!!e.debug&&console.error("Error: Container not found");delete this.options.container,this.container.length&&(this.container=this.container[0]),this.container.style.position="relative",this.rows=[];var o=this.recalculate.bind(this,!1,!1),n=this.recalculate.bind(this,!0,!0),r=a("img",this.container);if(this.resizer=s(function(){n()},100),window.addEventListener("resize",this.resizer),e.waitForImages)return h(r,null,n);this.recalculate(!0,!1),h(r,o,n)};return v.init=function(t){return console.warn("Depreciated: Macy.init will be removed in v3.0.0 opt to use Macy directly like so Macy({ /*options here*/ }) "),new v(t)},v.prototype.recalculateOnImageLoad=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=a("img",this.container),n=this.recalculate.bind(this,e,!1),r=this.recalculate.bind(this,e,!0);return t?h(o,null,r):(n(),h(o,n,r))},v.prototype.runOnImageLoad=function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=a("img",this.container);return e?h(o,t,t):h(o,null,t)},v.prototype.recalculate=function(){return u(this,arguments.length>0&&void 0!==arguments[0]&&arguments[0],!(arguments.length>1&&void 0!==arguments[1])||arguments[1])},v.prototype.remove=function(){window.removeEventListener("resize",this.resizer),this.container.children.forEach(function(t){t.removeAttribute("data-macy-complete"),t.removeAttribute("style")}),this.container.removeAttribute("style")},v.prototype.reInit=function(){this.recalculate(!0,!0),window.addEventListener("resize",this.resizer)},v}); $(window).scroll(function(){ window.dispatchEvent(new Event('resize')); }); if ($('.portfolio-items').length) { var macyPortfolioTwo = Macy({ container: '.portfolio-items', trueOrder: !1, waitForImages: !0, margin: 20, columns: 2, breakAt: {520: 2, 400: 1} }); }