diff --git a/src/js/script.js b/src/js/script.js index da80180f06..957677d245 100644 --- a/src/js/script.js +++ b/src/js/script.js @@ -15,23 +15,6 @@ const filterSelects = Object.fromEntries( ); let activeFilters = {}; -const enableLazyLoading = (images, root) => { - const imageObserver = new IntersectionObserver( - (entries, observer) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { - const image = entry.target; - image.src = image.dataset.src; - image.removeAttribute("data-src"); - imageObserver.unobserve(image); - } - }); - }, - { root, rootMargin: "0px 0px 100% 0px" }, - ); - images.forEach((image) => imageObserver.observe(image)); -}; - const toggleItem = (img, condition = true) => { if (condition) { img.style.removeProperty("width"); @@ -234,9 +217,6 @@ wallContainer.addEventListener("click", ({ target }) => { } }); -// Hook up lazy loading -enableLazyLoading(wallContainer.querySelectorAll("[data-src]"), wallContainer); - // Initialize MemeWall memewall = new MemeWall(wallContainer, wallItemToggleCb); if (window.location.hash) goToMeme(window.location.hash.substring(1)); diff --git a/src/pages/index.astro b/src/pages/index.astro index 008a5faefe..2e890f068c 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -53,7 +53,7 @@ const description = > 20 ? "lazy" : "eager"} decoding="async"