ghost-theme-sd.ai/assets/built/source.js

2 lines
51 KiB
JavaScript
Raw Normal View History

function dropdown(){const o=window.matchMedia("(max-width: 767px)"),i=document.querySelector(".gh-navigation"),r=i.querySelector(".gh-navigation-menu"),a=r?.querySelector(".nav");if(a){const e=document.querySelector(".gh-navigation-logo"),t=a.innerHTML;o.matches&&a.querySelectorAll("li").forEach(function(e,t){e.style.transitionDelay=.03*(t+1)+"s"});const n=function(){if(!o.matches){for(var e=[];a.offsetWidth+64>r.offsetWidth&&a.lastElementChild;)e.unshift(a.lastElementChild),a.lastElementChild.remove();if(e.length){const t=document.createElement("button"),n=(t.setAttribute("class","gh-more-toggle gh-icon-button"),t.setAttribute("aria-label","More"),t.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" fill="currentColor"><path d="M21.333 16c0-1.473 1.194-2.667 2.667-2.667v0c1.473 0 2.667 1.194 2.667 2.667v0c0 1.473-1.194 2.667-2.667 2.667v0c-1.473 0-2.667-1.194-2.667-2.667v0zM13.333 16c0-1.473 1.194-2.667 2.667-2.667v0c1.473 0 2.667 1.194 2.667 2.667v0c0 1.473-1.194 2.667-2.667 2.667v0c-1.473 0-2.667-1.194-2.667-2.667v0zM5.333 16c0-1.473 1.194-2.667 2.667-2.667v0c1.473 0 2.667 1.194 2.667 2.667v0c0 1.473-1.194 2.667-2.667 2.667v0c-1.473 0-2.667-1.194-2.667-2.667v0z"></path></svg>',document.createElement("div"));n.setAttribute("class","gh-dropdown"),10<=e.length?(i.classList.add("is-dropdown-mega"),n.style.gridTemplateRows=`repeat(${Math.ceil(e.length/2)}, 1fr)`):i.classList.remove("is-dropdown-mega"),e.forEach(function(e){n.appendChild(e)}),t.appendChild(n),a.appendChild(t),i.classList.add("is-dropdown-loaded"),window.addEventListener("click",function(e){i.classList.contains("is-dropdown-open")?i.classList.remove("is-dropdown-open"):t.contains(e.target)&&i.classList.add("is-dropdown-open")})}else i.classList.add("is-dropdown-loaded")}};imagesLoaded(e,function(){n()}),window.addEventListener("load",function(){e||n()}),window.addEventListener("resize",function(){setTimeout(()=>{a.innerHTML=t,n()},1)})}}function lightbox(e){document.querySelectorAll(e).forEach(function(e){e.addEventListener("click",function(e){var t=e;t.preventDefault();for(var n,o=[],i=0,r=t.target.closest(".kg-card").previousElementSibling;r&&(r.classList.contains("kg-image-card")||r.classList.contains("kg-gallery-card"));){var a=[];r.querySelectorAll("img").forEach(function(e){a.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e}),i+=1}),r=r.previousElementSibling,o=a.concat(o)}t.target.classList.contains("kg-image")?o.push({src:t.target.getAttribute("src"),msrc:t.target.getAttribute("src"),w:t.target.getAttribute("width"),h:t.target.getAttribute("height"),el:t.target}):(n=!1,t.target.closest(".kg-gallery-card").querySelectorAll("img").forEach(function(e){o.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e}),n||e===t.target?n=!0:i+=1}));for(var s=t.target.closest(".kg-card").nextElementSibling;s&&(s.classList.contains("kg-image-card")||s.classList.contains("kg-gallery-card"));)s.querySelectorAll("img").forEach(function(e){o.push({src:e.getAttribute("src"),msrc:e.getAttribute("src"),w:e.getAttribute("width"),h:e.getAttribute("height"),el:e})}),s=s.nextElementSibling;e=document.querySelectorAll(".pswp")[0];new PhotoSwipe(e,PhotoSwipeUI_Default,o,{bgOpacity:.9,closeOnScroll:!0,fullscreenEl:!1,history:!1,index:i,shareEl:!1,zoomEl:!1,getThumbBoundsFn:function(e){var e=o[e].el,t=window.pageYOffset||document.documentElement.scrollTop,e=e.getBoundingClientRect();return{x:e.left,y:e.top+t,w:e.width}}}).init()})})}function pagination(e=!0,s,l=!1){const c=document.querySelector(".gh-feed");if(!c)return;let t=!1;async function n(){var t=document.querySelector("link[rel=next]");if(t)try{var e=await(await fetch(t.href)).text(),n=(new DOMParser).parseFromString(e,"text/html"),o=n.querySelectorAll(".gh-feed:not(.gh-featured):not(.gh-related) > *");const r=document.createDocumentFragment(),a=[];o.forEach(function(e){e=document.importNode(e,!0);l&&(e.style.visibility="hidden"),r.appendChild(e),a.push(e)}),c.appendChild(r)
2023-09-15 10:47:56 +01:00
//# sourceMappingURL=source.js.map