From 7eef7d33b435a9eb1ae6c09f57ba2ecc2c6832e8 Mon Sep 17 00:00:00 2001 From: Frederik Niedernolte Date: Fri, 28 Aug 2020 17:10:47 +0200 Subject: [PATCH 1/2] Load Twitter only when needed Performance improvements --- assets/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts/main.js b/assets/scripts/main.js index c85d475c..26c60ebe 100644 --- a/assets/scripts/main.js +++ b/assets/scripts/main.js @@ -2,4 +2,4 @@ * mapache-godofredoninja v3.1.1 * Copyright 2019 GodoFredoNinja (https://github.com/godofredoninja/mapache) * Licensed under gpl-3.0 - */!function a(o,s,l){function c(t,e){if(!s[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=s[t]={exports:{}};o[t][0].call(i.exports,function(e){return c(o[t][1][e]||e)},i,i.exports,a,o,s,l)}return s[t].exports}for(var u="function"==typeof require&&require,e=0;e49?function(){l(t,{timeout:a});if(a!==P.ricTimeout){a=P.ricTimeout}}:ee(function(){I(t)},true);return function(e){var t;if(e=e===true){a=33}if(r){return}r=true;t=i-(u.now()-n);if(t<0){t=0}if(e||t<9){o()}else{I(o,t)}}},re=function(e){var t,r;var n=99;var i=function(){t=null;e()};var a=function(){var e=u.now()-r;if(e0;if(i&&Q(n,"overflow")!="visible"){r=n.getBoundingClientRect();i=w>r.left&&br.top-1&&g500&&F.clientWidth>500?500:370:P.expand;D._defEx=c;u=c*P.expFactor;f=P.hFac;L=null;if(_2&&v>2&&!N.hidden){_=u;k=0}else if(v>1&&k>1&&C<6){_=c}else{_=z}}if(l!==a){m=innerWidth+a*f;y=innerHeight+a;o=a*-1;l=a}r=d[t].getBoundingClientRect();if((E=r.bottom)>=o&&(g=r.top)<=y&&(w=r.right)>=o*f&&(b=r.left)<=m&&(E||w||b||g)&&(P.loadHidden||q(d[t]))&&(h&&C<3&&!s&&(v<3||k<4)||S(d[t],a))){T(d[t]);i=true;if(C>9){break}}else if(!i&&h&&!n&&C<4&&k<4&&v>2&&(p[0]||P.preloadAfterLoad)&&(p[0]||!s&&(E||w||b||g||d[t][H](P.sizesAttr)!="auto"))){n=p[0]||d[t]}}if(n&&!i){T(n)}}};var r=te(t);var A=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}j(e);V(t,P.loadedClass);Y(t,P.loadingClass);J(t,M);X(t,"lazyloaded")};var n=ee(A);var M=function(e){n({target:e.target})};var O=function(t,r){try{t.contentWindow.location.replace(r)}catch(e){t.src=r}};var R=function(e){var t;var r=e[H](P.srcsetAttr);if(t=P.customMedia[e[H]("data-media")||e[H]("media")]){e.setAttribute("media",t)}if(r){e.setAttribute("srcset",r)}};var o=ee(function(t,e,r,n,i){var a,o,s,l,c,u;if(!(c=X(t,"lazybeforeunveil",e)).defaultPrevented){if(n){if(r){V(t,P.autosizesClass)}else{t.setAttribute("sizes",n)}}o=t[H](P.srcsetAttr);a=t[H](P.srcAttr);if(i){s=t.parentNode;l=s&&G.test(s.nodeName||"")}u=e.firesLoad||"src"in t&&(o||a||l);c={target:t};V(t,P.loadingClass);if(u){clearTimeout(f);f=I(j,2500);J(t,M,true)}if(l){$.call(s.getElementsByTagName("source"),R)}if(o){t.setAttribute("srcset",o)}else if(a&&!l){if(d.test(t.nodeName)){O(t,a)}else{t.src=a}}if(i&&(o||l)){K(t,{src:a})}}if(t._lazyRace){delete t._lazyRace}Y(t,P.lazyClass);Z(function(){var e=t.complete&&t.naturalWidth>1;if(!u||e){if(e){V(t,"ls-is-cached")}A(c);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){C--}},true)});var T=function(e){if(e._lazyRace){return}var t;var r=a.test(e.nodeName);var n=r&&(e[H](P.sizesAttr)||e[H]("sizes"));var i=n=="auto";if((i||!h)&&r&&(e[H]("src")||e.srcset)&&!e.complete&&!U(e,P.errorClass)&&U(e,P.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(i){ne.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;C++;o(e,t,i,n,r)};var i=re(function(){P.loadMode=3;r()});var s=function(){if(P.loadMode==3){P.loadMode=2}i()};var l=function(){if(h){return}if(u.now()-e<999){I(l,999);return}h=true;P.loadMode=3;r();B("scroll",s,true)};return{_:function(){e=u.now();D.elements=N.getElementsByClassName(P.lazyClass);p=N.getElementsByClassName(P.lazyClass+" "+P.preloadClass);B("scroll",r,true);B("resize",r,true);if(c.MutationObserver){new MutationObserver(r).observe(F,{childList:true,subtree:true,attributes:true})}else{F[W]("DOMNodeInserted",r,true);F[W]("DOMAttrModified",r,true);setInterval(r,999)}B("hashchange",r,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){N[W](e,r,true)});if(/d$|^c/.test(N.readyState)){l()}else{B("load",l);N[W]("DOMContentLoaded",r);I(l,2e4)}if(D.elements.length){t();Z._lsFlush()}else{r()}},checkElems:r,unveil:T,_aLSL:s}}(),ne=function(){var r;var a=ee(function(e,t,r,n){var i,a,o;e._lazysizesWidth=n;n+="px";e.setAttribute("sizes",n);if(G.test(t.nodeName||"")){i=t.getElementsByTagName("source");for(a=0,o=i.length;a\n \n
\n ').concat(t.likes.count,'\n ').concat(t.comments.count,"\n
\n \n ");a.innerHTML+=r}),r.classList.remove("u-hide"),r.appendChild(a),r.appendChild(i)}var o=n(e("@babel/runtime/regenerator")),s=n(e("./app.fetch"));r.default=function(t,r){var n,i;return o.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return n="https://api.instagram.com/v1/users/".concat(t.userId,"/media/recent/?access_token=").concat(t.token,"&count=10&callback=?"),e.prev=1,e.next=4,o.default.awrap((0,s.default)(n));case 4:i=e.sent,a(i,t.userName,r),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.remove();case 11:case"end":return e.stop()}},null,null,[[1,8]])}},{"./app.fetch":12,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/regenerator":9}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.loadStyle=function(e){var t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)},r.loadScript=function(e,t){var r=document.createElement("script");r.src=e,r.defer=!0,t&&r.addEventListener("load",t),document.body.appendChild(r)}},{}],15:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=n(e("@babel/runtime/helpers/slicedToArray")),s=e("./app.variables");r.default=function(t){(0,s.qsa)(".js-social-media").forEach(function(e){return a=e,void Object.entries(t).forEach(function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];if("string"===n[0]||s.urlRegexp.test(n[0])){var i=document.createElement("a");i.href=n[0],i.title=n[1],i.target="_blank",i.rel="noopener noreferrer",i.innerHTML=''),a.appendChild(i)}});var a})}},{"./app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/slicedToArray":7}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.iframeVideo=r.urlRegexp=r.qsa=r.qs=void 0;var n=document.querySelector.bind(document);r.qs=n;var i=document.querySelectorAll.bind(document);r.qsa=i;r.urlRegexp=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \+\.-]*)*\/?$/;r.iframeVideo=['iframe[src*="player.vimeo.com"]','iframe[src*="dailymotion.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="player.twitch.tv"]','iframe[src*="kickstarter.com"][src*="video.html"]']},{}],17:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");e("lazysizes");var i=n(e("./util/Router")),a=n(e("./routes/common")),o=n(e("./routes/post")),s=n(e("./routes/post-single")),l=n(e("./routes/video")),c=new i.default({common:a.default,isArticle:o.default,isVideo:l.default,isArticleSingle:s.default});window.addEventListener("load",c.loadEvents(),!1)},{"./routes/common":18,"./routes/post":20,"./routes/post-single":19,"./routes/video":21,"./util/Router":22,"@babel/runtime/helpers/interopRequireDefault":4,lazysizes:10}],18:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=n(e("../app/app.social-media")),o=e("../app/app.load-style-script"),s=e("../app/app.variables"),l={init:function(){"object"===("undefined"==typeof followSocialMedia?"undefined":(0,i.default)(followSocialMedia))&&null!==followSocialMedia&&(0,a.default)(followSocialMedia)},finalize:function(){(0,s.qsa)(".js-dark-mode").forEach(function(e){return e.addEventListener("click",function(e){e.preventDefault();var t=document.documentElement;"light"===t.getAttribute("data-theme")?(t.setAttribute("data-theme","dark"),localStorage.setItem("selected-theme","dark")):(t.setAttribute("data-theme","light"),localStorage.setItem("selected-theme","light"))})}),(0,s.qs)(".js-menu-toggle").addEventListener("click",function(e){e.preventDefault(),document.body.classList.toggle("has-menu")});var e=(0,s.qs)(".js-scrcoll-home");e&&e.addEventListener("click",function(e){e.preventDefault();var t=(0,s.qs)("#hm-cover").offsetHeight-60;if(window)try{window.scroll({top:t,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,t)}}),(0,s.qs)(".js-back-to-top").addEventListener("click",function(e){if(e.preventDefault(),window)try{window.scroll({top:0,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,0)}});var t=(0,s.qs)(".js-twitter-feed");if("undefined"!=typeof twitterFeed&&t){t.classList.remove("u-hide");var r=document.createElement("div");r.innerHTML='"),t.appendChild(r),(0,o.loadScript)("https://platform.twitter.com/widgets.js")}"undefined"!=typeof searchSettings&&"undefined"!=typeof siteSearch&&(0,o.loadScript)("https://unpkg.com/@tryghost/content-api@1.3.4/umd/content-api.min.js",function(){(0,o.loadScript)(siteSearch)});var n=(0,s.qs)(".back-to-top"),i=document.body,a=i.closest(".has-cover");window.addEventListener("scroll",function(){var e=window.scrollY;n&&500n.bottom||r.rightn.right)){i=!0;break}i?o.classList.add("is-hidden"):o.classList.remove("is-hidden")})}}}};r.default=i},{"../app/app.variables":16}],20:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=e("../app/app.load-style-script"),o=n(e("../app/app.instagram")),s=e("../app/app.variables"),l={init:function(){var e=(0,s.qsa)(s.iframeVideo.join(","));e.length&&e.forEach(function(e){var t=document.createElement("div");t.className="video-responsive",e.parentNode.insertBefore(t,e),t.appendChild(e)})},finalize:function(){(0,s.qsa)(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),r=e.attributes.width.value/e.attributes.height.value;t.style.flex=r+" 1 0%"}),(0,s.qsa)(".js-post-content img").forEach(function(e){if(!e.closest("a")){e.classList.add("mapache-light-gallery"),e.setAttribute("data-src",e.src);var t=e.nextSibling;null!==t&&"figcaption"===t.nodeName.toLowerCase()&&e.setAttribute("data-sub-html",t.innerHTML)}}),(0,s.qsa)(".mapache-light-gallery").length&&((0,a.loadStyle)("https://unpkg.com/lightgallery.js/dist/css/lightgallery.min.css"),(0,a.loadScript)("https://cdn.jsdelivr.net/npm/lightgallery.js@1.1.3/dist/js/lightgallery.min.js",function(){(0,a.loadScript)("https://unpkg.com/lg-zoom.js@1.0.1/dist/lg-zoom.min.js"),window.lightGallery((0,s.qs)(".js-post-content"),{selector:".mapache-light-gallery"})}));var e=(0,s.qs)(".js-instagram");"object"===("undefined"==typeof instagramFeed?"undefined":(0,i.default)(instagramFeed))&&null!==instagramFeed&&e&&(0,o.default)(instagramFeed,e),(0,s.qsa)('code[class*="language-"]').length&&"undefined"!=typeof sitePrismJs&&(0,a.loadScript)(sitePrismJs),(0,s.qsa)(".js-share").forEach(function(e){return e.addEventListener("click",function(e){var t=window,r=document,n=void 0!==t.screenLeft?t.screenLeft:t.screenX,i=void 0!==t.screenTop?t.screenTop:t.screenY,a=(t.innerWidth?t.innerWidth:r.documentElement.clientWidth?r.documentElement.clientWidth:t.screen.width)/2-320+n,o=(t.innerHeight?t.innerHeight:r.documentElement.clientHeight?r.documentElement.clientHeight:t.screen.height)/2-200+i,s=t.open(e.currentTarget.href,"share-window","scrollbars=yes, width=".concat(640,", height=").concat(400,", top=").concat(o,", left=").concat(a));t.focus&&s.focus(),e.preventDefault()})})}};r.default=l},{"../app/app.instagram":13,"../app/app.load-style-script":14,"../app/app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/typeof":8}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=e("../app/app.variables"),n={init:function(){var e=(0,i.qs)(".js-post-content").querySelectorAll(i.iframeVideo.join(","))[0];if(e){var t=(0,i.qs)(".cc-video-embed"),r=document.body;e.closest(".kg-embed-card")?t.appendChild(e.closest(".kg-embed-card")):t.appendChild(e.parentNode);var n=function(){window.scrollY>(0,i.qs)(".js-video-post").offsetTop-100?r.classList.add("has-video-fixed"):r.classList.remove("has-video-fixed")};120049?function(){l(t,{timeout:a});if(a!==P.ricTimeout){a=P.ricTimeout}}:ee(function(){I(t)},true);return function(e){var t;if(e=e===true){a=33}if(r){return}r=true;t=i-(u.now()-n);if(t<0){t=0}if(e||t<9){o()}else{I(o,t)}}},re=function(e){var t,r;var n=99;var i=function(){t=null;e()};var a=function(){var e=u.now()-r;if(e0;if(i&&Q(n,"overflow")!="visible"){r=n.getBoundingClientRect();i=w>r.left&&br.top-1&&g500&&F.clientWidth>500?500:370:P.expand;D._defEx=c;u=c*P.expFactor;f=P.hFac;L=null;if(_2&&v>2&&!N.hidden){_=u;k=0}else if(v>1&&k>1&&C<6){_=c}else{_=z}}if(l!==a){m=innerWidth+a*f;y=innerHeight+a;o=a*-1;l=a}r=d[t].getBoundingClientRect();if((E=r.bottom)>=o&&(g=r.top)<=y&&(w=r.right)>=o*f&&(b=r.left)<=m&&(E||w||b||g)&&(P.loadHidden||q(d[t]))&&(h&&C<3&&!s&&(v<3||k<4)||S(d[t],a))){T(d[t]);i=true;if(C>9){break}}else if(!i&&h&&!n&&C<4&&k<4&&v>2&&(p[0]||P.preloadAfterLoad)&&(p[0]||!s&&(E||w||b||g||d[t][H](P.sizesAttr)!="auto"))){n=p[0]||d[t]}}if(n&&!i){T(n)}}};var r=te(t);var A=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}j(e);V(t,P.loadedClass);Y(t,P.loadingClass);J(t,M);X(t,"lazyloaded")};var n=ee(A);var M=function(e){n({target:e.target})};var O=function(t,r){try{t.contentWindow.location.replace(r)}catch(e){t.src=r}};var R=function(e){var t;var r=e[H](P.srcsetAttr);if(t=P.customMedia[e[H]("data-media")||e[H]("media")]){e.setAttribute("media",t)}if(r){e.setAttribute("srcset",r)}};var o=ee(function(t,e,r,n,i){var a,o,s,l,c,u;if(!(c=X(t,"lazybeforeunveil",e)).defaultPrevented){if(n){if(r){V(t,P.autosizesClass)}else{t.setAttribute("sizes",n)}}o=t[H](P.srcsetAttr);a=t[H](P.srcAttr);if(i){s=t.parentNode;l=s&&G.test(s.nodeName||"")}u=e.firesLoad||"src"in t&&(o||a||l);c={target:t};V(t,P.loadingClass);if(u){clearTimeout(f);f=I(j,2500);J(t,M,true)}if(l){$.call(s.getElementsByTagName("source"),R)}if(o){t.setAttribute("srcset",o)}else if(a&&!l){if(d.test(t.nodeName)){O(t,a)}else{t.src=a}}if(i&&(o||l)){K(t,{src:a})}}if(t._lazyRace){delete t._lazyRace}Y(t,P.lazyClass);Z(function(){var e=t.complete&&t.naturalWidth>1;if(!u||e){if(e){V(t,"ls-is-cached")}A(c);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){C--}},true)});var T=function(e){if(e._lazyRace){return}var t;var r=a.test(e.nodeName);var n=r&&(e[H](P.sizesAttr)||e[H]("sizes"));var i=n=="auto";if((i||!h)&&r&&(e[H]("src")||e.srcset)&&!e.complete&&!U(e,P.errorClass)&&U(e,P.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(i){ne.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;C++;o(e,t,i,n,r)};var i=re(function(){P.loadMode=3;r()});var s=function(){if(P.loadMode==3){P.loadMode=2}i()};var l=function(){if(h){return}if(u.now()-e<999){I(l,999);return}h=true;P.loadMode=3;r();B("scroll",s,true)};return{_:function(){e=u.now();D.elements=N.getElementsByClassName(P.lazyClass);p=N.getElementsByClassName(P.lazyClass+" "+P.preloadClass);B("scroll",r,true);B("resize",r,true);if(c.MutationObserver){new MutationObserver(r).observe(F,{childList:true,subtree:true,attributes:true})}else{F[W]("DOMNodeInserted",r,true);F[W]("DOMAttrModified",r,true);setInterval(r,999)}B("hashchange",r,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){N[W](e,r,true)});if(/d$|^c/.test(N.readyState)){l()}else{B("load",l);N[W]("DOMContentLoaded",r);I(l,2e4)}if(D.elements.length){t();Z._lsFlush()}else{r()}},checkElems:r,unveil:T,_aLSL:s}}(),ne=function(){var r;var a=ee(function(e,t,r,n){var i,a,o;e._lazysizesWidth=n;n+="px";e.setAttribute("sizes",n);if(G.test(t.nodeName||"")){i=t.getElementsByTagName("source");for(a=0,o=i.length;a\n \n
\n ').concat(t.likes.count,'\n ').concat(t.comments.count,"\n
\n \n ");a.innerHTML+=r}),r.classList.remove("u-hide"),r.appendChild(a),r.appendChild(i)}var o=n(e("@babel/runtime/regenerator")),s=n(e("./app.fetch"));r.default=function(t,r){var n,i;return o.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return n="https://api.instagram.com/v1/users/".concat(t.userId,"/media/recent/?access_token=").concat(t.token,"&count=10&callback=?"),e.prev=1,e.next=4,o.default.awrap((0,s.default)(n));case 4:i=e.sent,a(i,t.userName,r),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.remove();case 11:case"end":return e.stop()}},null,null,[[1,8]])}},{"./app.fetch":12,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/regenerator":9}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.loadStyle=function(e){var t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)},r.loadScript=function(e,t){var r=document.createElement("script");r.src=e,r.defer=!0,t&&r.addEventListener("load",t),document.body.appendChild(r)}},{}],15:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=n(e("@babel/runtime/helpers/slicedToArray")),s=e("./app.variables");r.default=function(t){(0,s.qsa)(".js-social-media").forEach(function(e){return a=e,void Object.entries(t).forEach(function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];if("string"===n[0]||s.urlRegexp.test(n[0])){var i=document.createElement("a");i.href=n[0],i.title=n[1],i.target="_blank",i.rel="noopener noreferrer",i.innerHTML=''),a.appendChild(i)}});var a})}},{"./app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/slicedToArray":7}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.iframeVideo=r.urlRegexp=r.qsa=r.qs=void 0;var n=document.querySelector.bind(document);r.qs=n;var i=document.querySelectorAll.bind(document);r.qsa=i;r.urlRegexp=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \+\.-]*)*\/?$/;r.iframeVideo=['iframe[src*="player.vimeo.com"]','iframe[src*="dailymotion.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="player.twitch.tv"]','iframe[src*="kickstarter.com"][src*="video.html"]']},{}],17:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");e("lazysizes");var i=n(e("./util/Router")),a=n(e("./routes/common")),o=n(e("./routes/post")),s=n(e("./routes/post-single")),l=n(e("./routes/video")),c=new i.default({common:a.default,isArticle:o.default,isVideo:l.default,isArticleSingle:s.default});window.addEventListener("load",c.loadEvents(),!1)},{"./routes/common":18,"./routes/post":20,"./routes/post-single":19,"./routes/video":21,"./util/Router":22,"@babel/runtime/helpers/interopRequireDefault":4,lazysizes:10}],18:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=n(e("../app/app.social-media")),o=e("../app/app.load-style-script"),s=e("../app/app.variables"),l={init:function(){"object"===("undefined"==typeof followSocialMedia?"undefined":(0,i.default)(followSocialMedia))&&null!==followSocialMedia&&(0,a.default)(followSocialMedia)},finalize:function(){(0,s.qsa)(".js-dark-mode").forEach(function(e){return e.addEventListener("click",function(e){e.preventDefault();var t=document.documentElement;"light"===t.getAttribute("data-theme")?(t.setAttribute("data-theme","dark"),localStorage.setItem("selected-theme","dark")):(t.setAttribute("data-theme","light"),localStorage.setItem("selected-theme","light"))})}),(0,s.qs)(".js-menu-toggle").addEventListener("click",function(e){e.preventDefault(),document.body.classList.toggle("has-menu")});var e=(0,s.qs)(".js-scrcoll-home");e&&e.addEventListener("click",function(e){e.preventDefault();var t=(0,s.qs)("#hm-cover").offsetHeight-60;if(window)try{window.scroll({top:t,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,t)}}),(0,s.qs)(".js-back-to-top").addEventListener("click",function(e){if(e.preventDefault(),window)try{window.scroll({top:0,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,0)}});const mediaQuery = window.matchMedia('(min-width: 1001px)');mediaQuery.addEventListener('change', (event) => { if (event.matches) var t=(0,s.qs)(".js-twitter-feed");if("undefined"!=typeof twitterFeed&&t){t.classList.remove("u-hide");var r=document.createElement("div");r.innerHTML='"),t.appendChild(r),(0,o.loadScript)("https://platform.twitter.com/widgets.js")}});"undefined"!=typeof searchSettings&&"undefined"!=typeof siteSearch&&(0,o.loadScript)("https://unpkg.com/@tryghost/content-api@1.3.4/umd/content-api.min.js",function(){(0,o.loadScript)(siteSearch)});var n=(0,s.qs)(".back-to-top"),i=document.body,a=i.closest(".has-cover");window.addEventListener("scroll",function(){var e=window.scrollY;n&&500n.bottom||r.rightn.right)){i=!0;break}i?o.classList.add("is-hidden"):o.classList.remove("is-hidden")})}}}};r.default=i},{"../app/app.variables":16}],20:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=e("../app/app.load-style-script"),o=n(e("../app/app.instagram")),s=e("../app/app.variables"),l={init:function(){var e=(0,s.qsa)(s.iframeVideo.join(","));e.length&&e.forEach(function(e){var t=document.createElement("div");t.className="video-responsive",e.parentNode.insertBefore(t,e),t.appendChild(e)})},finalize:function(){(0,s.qsa)(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),r=e.attributes.width.value/e.attributes.height.value;t.style.flex=r+" 1 0%"}),(0,s.qsa)(".js-post-content img").forEach(function(e){if(!e.closest("a")){e.classList.add("mapache-light-gallery"),e.setAttribute("data-src",e.src);var t=e.nextSibling;null!==t&&"figcaption"===t.nodeName.toLowerCase()&&e.setAttribute("data-sub-html",t.innerHTML)}}),(0,s.qsa)(".mapache-light-gallery").length&&((0,a.loadStyle)("https://unpkg.com/lightgallery.js/dist/css/lightgallery.min.css"),(0,a.loadScript)("https://cdn.jsdelivr.net/npm/lightgallery.js@1.1.3/dist/js/lightgallery.min.js",function(){(0,a.loadScript)("https://unpkg.com/lg-zoom.js@1.0.1/dist/lg-zoom.min.js"),window.lightGallery((0,s.qs)(".js-post-content"),{selector:".mapache-light-gallery"})}));var e=(0,s.qs)(".js-instagram");"object"===("undefined"==typeof instagramFeed?"undefined":(0,i.default)(instagramFeed))&&null!==instagramFeed&&e&&(0,o.default)(instagramFeed,e),(0,s.qsa)('code[class*="language-"]').length&&"undefined"!=typeof sitePrismJs&&(0,a.loadScript)(sitePrismJs),(0,s.qsa)(".js-share").forEach(function(e){return e.addEventListener("click",function(e){var t=window,r=document,n=void 0!==t.screenLeft?t.screenLeft:t.screenX,i=void 0!==t.screenTop?t.screenTop:t.screenY,a=(t.innerWidth?t.innerWidth:r.documentElement.clientWidth?r.documentElement.clientWidth:t.screen.width)/2-320+n,o=(t.innerHeight?t.innerHeight:r.documentElement.clientHeight?r.documentElement.clientHeight:t.screen.height)/2-200+i,s=t.open(e.currentTarget.href,"share-window","scrollbars=yes, width=".concat(640,", height=").concat(400,", top=").concat(o,", left=").concat(a));t.focus&&s.focus(),e.preventDefault()})})}};r.default=l},{"../app/app.instagram":13,"../app/app.load-style-script":14,"../app/app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/typeof":8}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=e("../app/app.variables"),n={init:function(){var e=(0,i.qs)(".js-post-content").querySelectorAll(i.iframeVideo.join(","))[0];if(e){var t=(0,i.qs)(".cc-video-embed"),r=document.body;e.closest(".kg-embed-card")?t.appendChild(e.closest(".kg-embed-card")):t.appendChild(e.parentNode);var n=function(){window.scrollY>(0,i.qs)(".js-video-post").offsetTop-100?r.classList.add("has-video-fixed"):r.classList.remove("has-video-fixed")};1200 Date: Fri, 11 Sep 2020 22:29:37 +0200 Subject: [PATCH 2/2] Update main.js Fixes the initial loading --- assets/scripts/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/scripts/main.js b/assets/scripts/main.js index 26c60ebe..c88f7691 100644 --- a/assets/scripts/main.js +++ b/assets/scripts/main.js @@ -2,4 +2,4 @@ * mapache-godofredoninja v3.1.1 * Copyright 2019 GodoFredoNinja (https://github.com/godofredoninja/mapache) * Licensed under gpl-3.0 - */!function a(o,s,l){function c(t,e){if(!s[t]){if(!o[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);var n=new Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}var i=s[t]={exports:{}};o[t][0].call(i.exports,function(e){return c(o[t][1][e]||e)},i,i.exports,a,o,s,l)}return s[t].exports}for(var u="function"==typeof require&&require,e=0;e49?function(){l(t,{timeout:a});if(a!==P.ricTimeout){a=P.ricTimeout}}:ee(function(){I(t)},true);return function(e){var t;if(e=e===true){a=33}if(r){return}r=true;t=i-(u.now()-n);if(t<0){t=0}if(e||t<9){o()}else{I(o,t)}}},re=function(e){var t,r;var n=99;var i=function(){t=null;e()};var a=function(){var e=u.now()-r;if(e0;if(i&&Q(n,"overflow")!="visible"){r=n.getBoundingClientRect();i=w>r.left&&br.top-1&&g500&&F.clientWidth>500?500:370:P.expand;D._defEx=c;u=c*P.expFactor;f=P.hFac;L=null;if(_2&&v>2&&!N.hidden){_=u;k=0}else if(v>1&&k>1&&C<6){_=c}else{_=z}}if(l!==a){m=innerWidth+a*f;y=innerHeight+a;o=a*-1;l=a}r=d[t].getBoundingClientRect();if((E=r.bottom)>=o&&(g=r.top)<=y&&(w=r.right)>=o*f&&(b=r.left)<=m&&(E||w||b||g)&&(P.loadHidden||q(d[t]))&&(h&&C<3&&!s&&(v<3||k<4)||S(d[t],a))){T(d[t]);i=true;if(C>9){break}}else if(!i&&h&&!n&&C<4&&k<4&&v>2&&(p[0]||P.preloadAfterLoad)&&(p[0]||!s&&(E||w||b||g||d[t][H](P.sizesAttr)!="auto"))){n=p[0]||d[t]}}if(n&&!i){T(n)}}};var r=te(t);var A=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}j(e);V(t,P.loadedClass);Y(t,P.loadingClass);J(t,M);X(t,"lazyloaded")};var n=ee(A);var M=function(e){n({target:e.target})};var O=function(t,r){try{t.contentWindow.location.replace(r)}catch(e){t.src=r}};var R=function(e){var t;var r=e[H](P.srcsetAttr);if(t=P.customMedia[e[H]("data-media")||e[H]("media")]){e.setAttribute("media",t)}if(r){e.setAttribute("srcset",r)}};var o=ee(function(t,e,r,n,i){var a,o,s,l,c,u;if(!(c=X(t,"lazybeforeunveil",e)).defaultPrevented){if(n){if(r){V(t,P.autosizesClass)}else{t.setAttribute("sizes",n)}}o=t[H](P.srcsetAttr);a=t[H](P.srcAttr);if(i){s=t.parentNode;l=s&&G.test(s.nodeName||"")}u=e.firesLoad||"src"in t&&(o||a||l);c={target:t};V(t,P.loadingClass);if(u){clearTimeout(f);f=I(j,2500);J(t,M,true)}if(l){$.call(s.getElementsByTagName("source"),R)}if(o){t.setAttribute("srcset",o)}else if(a&&!l){if(d.test(t.nodeName)){O(t,a)}else{t.src=a}}if(i&&(o||l)){K(t,{src:a})}}if(t._lazyRace){delete t._lazyRace}Y(t,P.lazyClass);Z(function(){var e=t.complete&&t.naturalWidth>1;if(!u||e){if(e){V(t,"ls-is-cached")}A(c);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){C--}},true)});var T=function(e){if(e._lazyRace){return}var t;var r=a.test(e.nodeName);var n=r&&(e[H](P.sizesAttr)||e[H]("sizes"));var i=n=="auto";if((i||!h)&&r&&(e[H]("src")||e.srcset)&&!e.complete&&!U(e,P.errorClass)&&U(e,P.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(i){ne.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;C++;o(e,t,i,n,r)};var i=re(function(){P.loadMode=3;r()});var s=function(){if(P.loadMode==3){P.loadMode=2}i()};var l=function(){if(h){return}if(u.now()-e<999){I(l,999);return}h=true;P.loadMode=3;r();B("scroll",s,true)};return{_:function(){e=u.now();D.elements=N.getElementsByClassName(P.lazyClass);p=N.getElementsByClassName(P.lazyClass+" "+P.preloadClass);B("scroll",r,true);B("resize",r,true);if(c.MutationObserver){new MutationObserver(r).observe(F,{childList:true,subtree:true,attributes:true})}else{F[W]("DOMNodeInserted",r,true);F[W]("DOMAttrModified",r,true);setInterval(r,999)}B("hashchange",r,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){N[W](e,r,true)});if(/d$|^c/.test(N.readyState)){l()}else{B("load",l);N[W]("DOMContentLoaded",r);I(l,2e4)}if(D.elements.length){t();Z._lsFlush()}else{r()}},checkElems:r,unveil:T,_aLSL:s}}(),ne=function(){var r;var a=ee(function(e,t,r,n){var i,a,o;e._lazysizesWidth=n;n+="px";e.setAttribute("sizes",n);if(G.test(t.nodeName||"")){i=t.getElementsByTagName("source");for(a=0,o=i.length;a\n \n
\n ').concat(t.likes.count,'\n ').concat(t.comments.count,"\n
\n \n ");a.innerHTML+=r}),r.classList.remove("u-hide"),r.appendChild(a),r.appendChild(i)}var o=n(e("@babel/runtime/regenerator")),s=n(e("./app.fetch"));r.default=function(t,r){var n,i;return o.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return n="https://api.instagram.com/v1/users/".concat(t.userId,"/media/recent/?access_token=").concat(t.token,"&count=10&callback=?"),e.prev=1,e.next=4,o.default.awrap((0,s.default)(n));case 4:i=e.sent,a(i,t.userName,r),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.remove();case 11:case"end":return e.stop()}},null,null,[[1,8]])}},{"./app.fetch":12,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/regenerator":9}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.loadStyle=function(e){var t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)},r.loadScript=function(e,t){var r=document.createElement("script");r.src=e,r.defer=!0,t&&r.addEventListener("load",t),document.body.appendChild(r)}},{}],15:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=n(e("@babel/runtime/helpers/slicedToArray")),s=e("./app.variables");r.default=function(t){(0,s.qsa)(".js-social-media").forEach(function(e){return a=e,void Object.entries(t).forEach(function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];if("string"===n[0]||s.urlRegexp.test(n[0])){var i=document.createElement("a");i.href=n[0],i.title=n[1],i.target="_blank",i.rel="noopener noreferrer",i.innerHTML=''),a.appendChild(i)}});var a})}},{"./app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/slicedToArray":7}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.iframeVideo=r.urlRegexp=r.qsa=r.qs=void 0;var n=document.querySelector.bind(document);r.qs=n;var i=document.querySelectorAll.bind(document);r.qsa=i;r.urlRegexp=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \+\.-]*)*\/?$/;r.iframeVideo=['iframe[src*="player.vimeo.com"]','iframe[src*="dailymotion.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="player.twitch.tv"]','iframe[src*="kickstarter.com"][src*="video.html"]']},{}],17:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");e("lazysizes");var i=n(e("./util/Router")),a=n(e("./routes/common")),o=n(e("./routes/post")),s=n(e("./routes/post-single")),l=n(e("./routes/video")),c=new i.default({common:a.default,isArticle:o.default,isVideo:l.default,isArticleSingle:s.default});window.addEventListener("load",c.loadEvents(),!1)},{"./routes/common":18,"./routes/post":20,"./routes/post-single":19,"./routes/video":21,"./util/Router":22,"@babel/runtime/helpers/interopRequireDefault":4,lazysizes:10}],18:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=n(e("../app/app.social-media")),o=e("../app/app.load-style-script"),s=e("../app/app.variables"),l={init:function(){"object"===("undefined"==typeof followSocialMedia?"undefined":(0,i.default)(followSocialMedia))&&null!==followSocialMedia&&(0,a.default)(followSocialMedia)},finalize:function(){(0,s.qsa)(".js-dark-mode").forEach(function(e){return e.addEventListener("click",function(e){e.preventDefault();var t=document.documentElement;"light"===t.getAttribute("data-theme")?(t.setAttribute("data-theme","dark"),localStorage.setItem("selected-theme","dark")):(t.setAttribute("data-theme","light"),localStorage.setItem("selected-theme","light"))})}),(0,s.qs)(".js-menu-toggle").addEventListener("click",function(e){e.preventDefault(),document.body.classList.toggle("has-menu")});var e=(0,s.qs)(".js-scrcoll-home");e&&e.addEventListener("click",function(e){e.preventDefault();var t=(0,s.qs)("#hm-cover").offsetHeight-60;if(window)try{window.scroll({top:t,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,t)}}),(0,s.qs)(".js-back-to-top").addEventListener("click",function(e){if(e.preventDefault(),window)try{window.scroll({top:0,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,0)}});const mediaQuery = window.matchMedia('(min-width: 1001px)');mediaQuery.addEventListener('change', (event) => { if (event.matches) var t=(0,s.qs)(".js-twitter-feed");if("undefined"!=typeof twitterFeed&&t){t.classList.remove("u-hide");var r=document.createElement("div");r.innerHTML='"),t.appendChild(r),(0,o.loadScript)("https://platform.twitter.com/widgets.js")}});"undefined"!=typeof searchSettings&&"undefined"!=typeof siteSearch&&(0,o.loadScript)("https://unpkg.com/@tryghost/content-api@1.3.4/umd/content-api.min.js",function(){(0,o.loadScript)(siteSearch)});var n=(0,s.qs)(".back-to-top"),i=document.body,a=i.closest(".has-cover");window.addEventListener("scroll",function(){var e=window.scrollY;n&&500n.bottom||r.rightn.right)){i=!0;break}i?o.classList.add("is-hidden"):o.classList.remove("is-hidden")})}}}};r.default=i},{"../app/app.variables":16}],20:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=e("../app/app.load-style-script"),o=n(e("../app/app.instagram")),s=e("../app/app.variables"),l={init:function(){var e=(0,s.qsa)(s.iframeVideo.join(","));e.length&&e.forEach(function(e){var t=document.createElement("div");t.className="video-responsive",e.parentNode.insertBefore(t,e),t.appendChild(e)})},finalize:function(){(0,s.qsa)(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),r=e.attributes.width.value/e.attributes.height.value;t.style.flex=r+" 1 0%"}),(0,s.qsa)(".js-post-content img").forEach(function(e){if(!e.closest("a")){e.classList.add("mapache-light-gallery"),e.setAttribute("data-src",e.src);var t=e.nextSibling;null!==t&&"figcaption"===t.nodeName.toLowerCase()&&e.setAttribute("data-sub-html",t.innerHTML)}}),(0,s.qsa)(".mapache-light-gallery").length&&((0,a.loadStyle)("https://unpkg.com/lightgallery.js/dist/css/lightgallery.min.css"),(0,a.loadScript)("https://cdn.jsdelivr.net/npm/lightgallery.js@1.1.3/dist/js/lightgallery.min.js",function(){(0,a.loadScript)("https://unpkg.com/lg-zoom.js@1.0.1/dist/lg-zoom.min.js"),window.lightGallery((0,s.qs)(".js-post-content"),{selector:".mapache-light-gallery"})}));var e=(0,s.qs)(".js-instagram");"object"===("undefined"==typeof instagramFeed?"undefined":(0,i.default)(instagramFeed))&&null!==instagramFeed&&e&&(0,o.default)(instagramFeed,e),(0,s.qsa)('code[class*="language-"]').length&&"undefined"!=typeof sitePrismJs&&(0,a.loadScript)(sitePrismJs),(0,s.qsa)(".js-share").forEach(function(e){return e.addEventListener("click",function(e){var t=window,r=document,n=void 0!==t.screenLeft?t.screenLeft:t.screenX,i=void 0!==t.screenTop?t.screenTop:t.screenY,a=(t.innerWidth?t.innerWidth:r.documentElement.clientWidth?r.documentElement.clientWidth:t.screen.width)/2-320+n,o=(t.innerHeight?t.innerHeight:r.documentElement.clientHeight?r.documentElement.clientHeight:t.screen.height)/2-200+i,s=t.open(e.currentTarget.href,"share-window","scrollbars=yes, width=".concat(640,", height=").concat(400,", top=").concat(o,", left=").concat(a));t.focus&&s.focus(),e.preventDefault()})})}};r.default=l},{"../app/app.instagram":13,"../app/app.load-style-script":14,"../app/app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/typeof":8}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=e("../app/app.variables"),n={init:function(){var e=(0,i.qs)(".js-post-content").querySelectorAll(i.iframeVideo.join(","))[0];if(e){var t=(0,i.qs)(".cc-video-embed"),r=document.body;e.closest(".kg-embed-card")?t.appendChild(e.closest(".kg-embed-card")):t.appendChild(e.parentNode);var n=function(){window.scrollY>(0,i.qs)(".js-video-post").offsetTop-100?r.classList.add("has-video-fixed"):r.classList.remove("has-video-fixed")};120049?function(){l(t,{timeout:a});if(a!==P.ricTimeout){a=P.ricTimeout}}:ee(function(){I(t)},true);return function(e){var t;if(e=e===true){a=33}if(r){return}r=true;t=i-(u.now()-n);if(t<0){t=0}if(e||t<9){o()}else{I(o,t)}}},re=function(e){var t,r;var n=99;var i=function(){t=null;e()};var a=function(){var e=u.now()-r;if(e0;if(i&&Q(n,"overflow")!="visible"){r=n.getBoundingClientRect();i=w>r.left&&br.top-1&&g500&&F.clientWidth>500?500:370:P.expand;D._defEx=c;u=c*P.expFactor;f=P.hFac;L=null;if(_2&&v>2&&!N.hidden){_=u;k=0}else if(v>1&&k>1&&C<6){_=c}else{_=z}}if(l!==a){m=innerWidth+a*f;y=innerHeight+a;o=a*-1;l=a}r=d[t].getBoundingClientRect();if((E=r.bottom)>=o&&(g=r.top)<=y&&(w=r.right)>=o*f&&(b=r.left)<=m&&(E||w||b||g)&&(P.loadHidden||q(d[t]))&&(h&&C<3&&!s&&(v<3||k<4)||S(d[t],a))){T(d[t]);i=true;if(C>9){break}}else if(!i&&h&&!n&&C<4&&k<4&&v>2&&(p[0]||P.preloadAfterLoad)&&(p[0]||!s&&(E||w||b||g||d[t][H](P.sizesAttr)!="auto"))){n=p[0]||d[t]}}if(n&&!i){T(n)}}};var r=te(t);var A=function(e){var t=e.target;if(t._lazyCache){delete t._lazyCache;return}j(e);V(t,P.loadedClass);Y(t,P.loadingClass);J(t,M);X(t,"lazyloaded")};var n=ee(A);var M=function(e){n({target:e.target})};var O=function(t,r){try{t.contentWindow.location.replace(r)}catch(e){t.src=r}};var R=function(e){var t;var r=e[H](P.srcsetAttr);if(t=P.customMedia[e[H]("data-media")||e[H]("media")]){e.setAttribute("media",t)}if(r){e.setAttribute("srcset",r)}};var o=ee(function(t,e,r,n,i){var a,o,s,l,c,u;if(!(c=X(t,"lazybeforeunveil",e)).defaultPrevented){if(n){if(r){V(t,P.autosizesClass)}else{t.setAttribute("sizes",n)}}o=t[H](P.srcsetAttr);a=t[H](P.srcAttr);if(i){s=t.parentNode;l=s&&G.test(s.nodeName||"")}u=e.firesLoad||"src"in t&&(o||a||l);c={target:t};V(t,P.loadingClass);if(u){clearTimeout(f);f=I(j,2500);J(t,M,true)}if(l){$.call(s.getElementsByTagName("source"),R)}if(o){t.setAttribute("srcset",o)}else if(a&&!l){if(d.test(t.nodeName)){O(t,a)}else{t.src=a}}if(i&&(o||l)){K(t,{src:a})}}if(t._lazyRace){delete t._lazyRace}Y(t,P.lazyClass);Z(function(){var e=t.complete&&t.naturalWidth>1;if(!u||e){if(e){V(t,"ls-is-cached")}A(c);t._lazyCache=true;I(function(){if("_lazyCache"in t){delete t._lazyCache}},9)}if(t.loading=="lazy"){C--}},true)});var T=function(e){if(e._lazyRace){return}var t;var r=a.test(e.nodeName);var n=r&&(e[H](P.sizesAttr)||e[H]("sizes"));var i=n=="auto";if((i||!h)&&r&&(e[H]("src")||e.srcset)&&!e.complete&&!U(e,P.errorClass)&&U(e,P.lazyClass)){return}t=X(e,"lazyunveilread").detail;if(i){ne.updateElem(e,true,e.offsetWidth)}e._lazyRace=true;C++;o(e,t,i,n,r)};var i=re(function(){P.loadMode=3;r()});var s=function(){if(P.loadMode==3){P.loadMode=2}i()};var l=function(){if(h){return}if(u.now()-e<999){I(l,999);return}h=true;P.loadMode=3;r();B("scroll",s,true)};return{_:function(){e=u.now();D.elements=N.getElementsByClassName(P.lazyClass);p=N.getElementsByClassName(P.lazyClass+" "+P.preloadClass);B("scroll",r,true);B("resize",r,true);if(c.MutationObserver){new MutationObserver(r).observe(F,{childList:true,subtree:true,attributes:true})}else{F[W]("DOMNodeInserted",r,true);F[W]("DOMAttrModified",r,true);setInterval(r,999)}B("hashchange",r,true);["focus","mouseover","click","load","transitionend","animationend"].forEach(function(e){N[W](e,r,true)});if(/d$|^c/.test(N.readyState)){l()}else{B("load",l);N[W]("DOMContentLoaded",r);I(l,2e4)}if(D.elements.length){t();Z._lsFlush()}else{r()}},checkElems:r,unveil:T,_aLSL:s}}(),ne=function(){var r;var a=ee(function(e,t,r,n){var i,a,o;e._lazysizesWidth=n;n+="px";e.setAttribute("sizes",n);if(G.test(t.nodeName||"")){i=t.getElementsByTagName("source");for(a=0,o=i.length;a\n \n
\n ').concat(t.likes.count,'\n ').concat(t.comments.count,"\n
\n \n ");a.innerHTML+=r}),r.classList.remove("u-hide"),r.appendChild(a),r.appendChild(i)}var o=n(e("@babel/runtime/regenerator")),s=n(e("./app.fetch"));r.default=function(t,r){var n,i;return o.default.async(function(e){for(;;)switch(e.prev=e.next){case 0:return n="https://api.instagram.com/v1/users/".concat(t.userId,"/media/recent/?access_token=").concat(t.token,"&count=10&callback=?"),e.prev=1,e.next=4,o.default.awrap((0,s.default)(n));case 4:i=e.sent,a(i,t.userName,r),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),r.remove();case 11:case"end":return e.stop()}},null,null,[[1,8]])}},{"./app.fetch":12,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/regenerator":9}],14:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.loadStyle=function(e){var t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)},r.loadScript=function(e,t){var r=document.createElement("script");r.src=e,r.defer=!0,t&&r.addEventListener("load",t),document.body.appendChild(r)}},{}],15:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var o=n(e("@babel/runtime/helpers/slicedToArray")),s=e("./app.variables");r.default=function(t){(0,s.qsa)(".js-social-media").forEach(function(e){return a=e,void Object.entries(t).forEach(function(e){var t=(0,o.default)(e,2),r=t[0],n=t[1];if("string"===n[0]||s.urlRegexp.test(n[0])){var i=document.createElement("a");i.href=n[0],i.title=n[1],i.target="_blank",i.rel="noopener noreferrer",i.innerHTML=''),a.appendChild(i)}});var a})}},{"./app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/slicedToArray":7}],16:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.iframeVideo=r.urlRegexp=r.qsa=r.qs=void 0;var n=document.querySelector.bind(document);r.qs=n;var i=document.querySelectorAll.bind(document);r.qsa=i;r.urlRegexp=/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \+\.-]*)*\/?$/;r.iframeVideo=['iframe[src*="player.vimeo.com"]','iframe[src*="dailymotion.com"]','iframe[src*="youtube.com"]','iframe[src*="youtube-nocookie.com"]','iframe[src*="player.twitch.tv"]','iframe[src*="kickstarter.com"][src*="video.html"]']},{}],17:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");e("lazysizes");var i=n(e("./util/Router")),a=n(e("./routes/common")),o=n(e("./routes/post")),s=n(e("./routes/post-single")),l=n(e("./routes/video")),c=new i.default({common:a.default,isArticle:o.default,isVideo:l.default,isArticleSingle:s.default});window.addEventListener("load",c.loadEvents(),!1)},{"./routes/common":18,"./routes/post":20,"./routes/post-single":19,"./routes/video":21,"./util/Router":22,"@babel/runtime/helpers/interopRequireDefault":4,lazysizes:10}],18:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=n(e("../app/app.social-media")),o=e("../app/app.load-style-script"),s=e("../app/app.variables"),l={init:function(){"object"===("undefined"==typeof followSocialMedia?"undefined":(0,i.default)(followSocialMedia))&&null!==followSocialMedia&&(0,a.default)(followSocialMedia)},finalize:function(){(0,s.qsa)(".js-dark-mode").forEach(function(e){return e.addEventListener("click",function(e){e.preventDefault();var t=document.documentElement;"light"===t.getAttribute("data-theme")?(t.setAttribute("data-theme","dark"),localStorage.setItem("selected-theme","dark")):(t.setAttribute("data-theme","light"),localStorage.setItem("selected-theme","light"))})}),(0,s.qs)(".js-menu-toggle").addEventListener("click",function(e){e.preventDefault(),document.body.classList.toggle("has-menu")});var e=(0,s.qs)(".js-scrcoll-home");e&&e.addEventListener("click",function(e){e.preventDefault();var t=(0,s.qs)("#hm-cover").offsetHeight-60;if(window)try{window.scroll({top:t,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,t)}}),(0,s.qs)(".js-back-to-top").addEventListener("click",function(e){if(e.preventDefault(),window)try{window.scroll({top:0,left:0,behavior:"smooth"})}catch(e){window.scrollTo(0,0)}});const mediaQuery=window.matchMedia("(min-width: 1001px)");function mediaQueryChange(){if(mediaQuery.matches)var t=(0, s.qs)(".js-twitter-feed");if("undefined"!=typeof twitterFeed&&t){t.classList.remove("u-hide");var r=document.createElement("div");r.innerHTML='"),t.appendChild(r),(0,o.loadScript)("https://platform.twitter.com/widgets.js")}}mediaQuery.addEventListener('change',mediaQueryChange);mediaQueryChange();"undefined"!=typeof searchSettings&&"undefined"!=typeof siteSearch&&(0,o.loadScript)("https://unpkg.com/@tryghost/content-api@1.3.4/umd/content-api.min.js",function(){(0,o.loadScript)(siteSearch)});var n=(0,s.qs)(".back-to-top"),i=document.body,a=i.closest(".has-cover");window.addEventListener("scroll",function(){var e=window.scrollY;n&&500n.bottom||r.rightn.right)){i=!0;break}i?o.classList.add("is-hidden"):o.classList.remove("is-hidden")})}}}};r.default=i},{"../app/app.variables":16}],20:[function(e,t,r){"use strict";var n=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=n(e("@babel/runtime/helpers/typeof")),a=e("../app/app.load-style-script"),o=n(e("../app/app.instagram")),s=e("../app/app.variables"),l={init:function(){var e=(0,s.qsa)(s.iframeVideo.join(","));e.length&&e.forEach(function(e){var t=document.createElement("div");t.className="video-responsive",e.parentNode.insertBefore(t,e),t.appendChild(e)})},finalize:function(){(0,s.qsa)(".kg-gallery-image img").forEach(function(e){var t=e.closest(".kg-gallery-image"),r=e.attributes.width.value/e.attributes.height.value;t.style.flex=r+" 1 0%"}),(0,s.qsa)(".js-post-content img").forEach(function(e){if(!e.closest("a")){e.classList.add("mapache-light-gallery"),e.setAttribute("data-src",e.src);var t=e.nextSibling;null!==t&&"figcaption"===t.nodeName.toLowerCase()&&e.setAttribute("data-sub-html",t.innerHTML)}}),(0,s.qsa)(".mapache-light-gallery").length&&((0,a.loadStyle)("https://unpkg.com/lightgallery.js/dist/css/lightgallery.min.css"),(0,a.loadScript)("https://cdn.jsdelivr.net/npm/lightgallery.js@1.1.3/dist/js/lightgallery.min.js",function(){(0,a.loadScript)("https://unpkg.com/lg-zoom.js@1.0.1/dist/lg-zoom.min.js"),window.lightGallery((0,s.qs)(".js-post-content"),{selector:".mapache-light-gallery"})}));var e=(0,s.qs)(".js-instagram");"object"===("undefined"==typeof instagramFeed?"undefined":(0,i.default)(instagramFeed))&&null!==instagramFeed&&e&&(0,o.default)(instagramFeed,e),(0,s.qsa)('code[class*="language-"]').length&&"undefined"!=typeof sitePrismJs&&(0,a.loadScript)(sitePrismJs),(0,s.qsa)(".js-share").forEach(function(e){return e.addEventListener("click",function(e){var t=window,r=document,n=void 0!==t.screenLeft?t.screenLeft:t.screenX,i=void 0!==t.screenTop?t.screenTop:t.screenY,a=(t.innerWidth?t.innerWidth:r.documentElement.clientWidth?r.documentElement.clientWidth:t.screen.width)/2-320+n,o=(t.innerHeight?t.innerHeight:r.documentElement.clientHeight?r.documentElement.clientHeight:t.screen.height)/2-200+i,s=t.open(e.currentTarget.href,"share-window","scrollbars=yes, width=".concat(640,", height=").concat(400,", top=").concat(o,", left=").concat(a));t.focus&&s.focus(),e.preventDefault()})})}};r.default=l},{"../app/app.instagram":13,"../app/app.load-style-script":14,"../app/app.variables":16,"@babel/runtime/helpers/interopRequireDefault":4,"@babel/runtime/helpers/typeof":8}],21:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var i=e("../app/app.variables"),n={init:function(){var e=(0,i.qs)(".js-post-content").querySelectorAll(i.iframeVideo.join(","))[0];if(e){var t=(0,i.qs)(".cc-video-embed"),r=document.body;e.closest(".kg-embed-card")?t.appendChild(e.closest(".kg-embed-card")):t.appendChild(e.parentNode);var n=function(){window.scrollY>(0,i.qs)(".js-video-post").offsetTop-100?r.classList.add("has-video-fixed"):r.classList.remove("has-video-fixed")};1200