Beta-2.1 - The clearer, the faster #22
@@ -9,7 +9,6 @@ window.addEventListener("DOMContentLoaded", () => {
 | 
				
			|||||||
    entries.forEach(entry => {
 | 
					    entries.forEach(entry => {
 | 
				
			||||||
      if (entry.isIntersecting) {
 | 
					      if (entry.isIntersecting) {
 | 
				
			||||||
        const img = entry.target;
 | 
					        const img = entry.target;
 | 
				
			||||||
        console.log("Lazy-loading image:", img.dataset.src);
 | 
					 | 
				
			||||||
        img.src = img.dataset.src;
 | 
					        img.src = img.dataset.src;
 | 
				
			||||||
        img.onload = () => {
 | 
					        img.onload = () => {
 | 
				
			||||||
          img.classList.add("loaded");
 | 
					          img.classList.add("loaded");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -93,7 +93,7 @@ function renderGallery() {
 | 
				
			|||||||
    removeAllBtnBottom.style.display = imagesToShow.length > 0 ? 'inline-block' : 'none';
 | 
					    removeAllBtnBottom.style.display = imagesToShow.length > 0 ? 'inline-block' : 'none';
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // --- Fade-in effect for loaded images ---
 | 
					  // Fade-in effect for loaded images
 | 
				
			||||||
  const fadeImages = document.querySelectorAll("img.fade-in-img");
 | 
					  const fadeImages = document.querySelectorAll("img.fade-in-img");
 | 
				
			||||||
  fadeImages.forEach(img => {
 | 
					  fadeImages.forEach(img => {
 | 
				
			||||||
    const onLoad = () => {
 | 
					    const onLoad = () => {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1094,4 +1094,3 @@ justify-content: center;
 | 
				
			|||||||
    flex-wrap: nowrap;
 | 
					    flex-wrap: nowrap;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user