PageSourceSearch

https://chickenroadnaija.com/wp-content/plugins/frontblocks/includes/dist/frontblocks-gallery-min.js?ver=1.0.2

js chickenroadnaija.com collected 2026-10-10 00:50:15 UTC 5,729 bytes, 1 lines download raw bytes

1function initFrontBlocksGallery(){initMasonryGalleries(),initGridGalleries(),initLightbox()}function initMasonryGalleries(){document.querySelectorAll(".frontblocks-gallery-masonry").forEach(function(t){const e=parseInt(t.getAttribute("data-columns"))||3,n=parseInt(t.getAttribute("data-gutter"))||20;setupMasonryLayout(t,e,n)})}function initGridGalleries(){document.querySelectorAll(".frontblocks-gallery-grid").forEach(function(t){const e=parseInt(t.getAttribute("data-columns"))||3,n=parseInt(t.getAttribute("data-gutter"))||20;setupGridLayout(t,e,n)})}function setupGridLayout(t,e,n){t.style.setProperty("--frontblocks-gutter",n+"px")}function setupMasonryLayout(t,e,n){t.style.position="relative",t.style.display="block",t.style.width="100%",t.style.setProperty("--frontblocks-gutter",n+"px");const o=t.querySelectorAll("figure.wp-block-image");if(0===o.length)return;const r=t.offsetWidth,l=(r-n*(e-1))/e;let i=getResponsiveColumns(e,r);l<200&&(i=Math.max(1,Math.floor((r+n)/(200+n)))),o.forEach(function(t){t.style.margin="0",t.style.marginBottom=n+"px"});const c=new Masonry(t,{itemSelector:"figure.wp-block-image",columnWidth:".wp-block-image",gutter:n,percentPosition:!0,transitionDuration:"0.3s"}),s=t.querySelectorAll("img");let a=0;0!==s.length?(s.forEach(function(t){t.complete?++a===s.length&&c.layout():t.addEventListener("load",function(){++a===s.length&&c.layout()})}),a===s.length&&c.layout(),t.masonryInstance=c,window.addEventListener("resize",function(){t.masonryInstance&&t.masonryInstance.layout()})):c.layout()}function getResponsiveColumns(t,e){return e<=480?Math.min(t,2):e<=768?Math.min(t,3):e<=1024?Math.min(t,4):t}function initLightbox(){let t=document.getElementById("frontblocks-lightbox");t||(t=createLightbox(),document.body.appendChild(t)),document.querySelectorAll(".frontblocks-gallery-masonry, .frontblocks-gallery-grid").forEach(function(t){if("true"===t.getAttribute("data-lightbox")){const e=t.querySelectorAll("img");e.forEach(function(t,n){t.style.cursor="pointer",t.addEventListener("click",function(t){t.preventDefault(),openLightbox(e,n)})})}})}function createLightbox(){const t=document.createElement("div");t.id="frontblocks-lightbox",t.className="frontblocks-lightbox",t.innerHTML='\n        <div class="frontblocks-lightbox-content">\n            <button class="frontblocks-lightbox-close">&times;</button>\n            <img src="" alt="">\n            <div class="frontblocks-lightbox-caption"></div>\n            <div class="frontblocks-lightbox-counter"></div>\n            <button class="frontblocks-lightbox-nav frontblocks-lightbox-prev">&lt;</button>\n            <button class="frontblocks-lightbox-nav frontblocks-lightbox-next">&gt;</button>\n        </div>\n    ';const e=t.querySelector(".frontblocks-lightbox-close"),n=t.querySelector(".frontblocks-lightbox-prev"),o=t.querySelector(".frontblocks-lightbox-next");return e.addEventListener("click",closeLightbox),n.addEventListener("click",showPreviousImage),o.addEventListener("click",showNextImage),t.addEventListener("click",function(e){e.target===t&&closeLightbox()}),document.addEventListener("keydown",function(e){"Escape"===e.key&&t.classList.contains("active")?closeLightbox():"ArrowLeft"===e.key&&t.classList.contains("active")?showPreviousImage():"ArrowRight"===e.key&&t.classList.contains("active")&&showNextImage()}),t}window.addEventListener("load",function(){initFrontBlocksGallery()});let currentImages=[],currentImageIndex=0;function openLightbox(t,e){currentImages=Array.from(t),currentImageIndex=e;const n=document.getElementById("frontblocks-lightbox"),o=n.querySelector("img");o.src=currentImages[currentImageIndex].src,o.alt=currentImages[currentImageIndex].alt||"",n.classList.add("active"),document.body.style.overflow="hidden",updateLightboxCaption(),updateLightboxCounter(),updateLightboxNavigation()}function closeLightbox(){document.getElementById("frontblocks-lightbox").classList.remove("active"),document.body.style.overflow="",currentImages=[],currentImageIndex=0}function showPreviousImage(){0!==currentImages.length&&(currentImageIndex=(currentImageIndex-1+currentImages.length)%currentImages.length,updateLightboxImage())}function showNextImage(){0!==currentImages.length&&(currentImageIndex=(currentImageIndex+1)%currentImages.length,updateLightboxImage())}function updateLightboxImage(){const t=document.getElementById("frontblocks-lightbox").querySelector("img");t.src=currentImages[currentImageIndex].src,t.alt=currentImages[currentImageIndex].alt||"",updateLightboxCaption(),updateLightboxCounter(),updateLightboxNavigation()}function updateLightboxCaption(){const t=document.getElementById("frontblocks-lightbox").querySelector(".frontblocks-lightbox-caption");if(0===currentImages.length)return void(t.textContent="");const e=currentImages[currentImageIndex];let n="";if(e.alt&&""!==e.alt.trim())n=e.alt;else if(e.title&&""!==e.title.trim())n=e.title;else{const t=e.closest("figure");
1if(t){const e=t.querySelector("figcaption");e&&(n=e.textContent.trim())}}t.textContent=n,t.style.display=n?"block":"none"}function updateLightboxCounter(){const t=document.getElementById("frontblocks-lightbox").querySelector(".frontblocks-lightbox-counter");currentImages.length<=1?t.style.display="none":(t.style.display="block",t.textContent=`${currentImageIndex+1} / ${currentImages.length}`)}function updateLightboxNavigation(){const t=document.getElementById("frontblocks-lightbox"),e=t.querySelector(".frontblocks-lightbox-prev"),n=t.querySelector(".frontblocks-lightbox-next"),o=currentImages.length>1;e.style.display=o?"block":"none",n.style.display=o?"block":"none"}function reinitFrontBlocksGallery(){initFrontBlocksGallery()}window.reinitFrontBlocksGallery=reinitFrontBlocksGallery;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.