This commit is contained in:
Djeex
2025-09-02 23:44:18 +02:00
parent b17652e471
commit 191fa82711
3 changed files with 5 additions and 7 deletions

View File

@ -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");

View File

@ -47,9 +47,9 @@ function renderGallery() {
const div = document.createElement('div'); const div = document.createElement('div');
div.className = 'photo flex-item flex-column'; div.className = 'photo flex-item flex-column';
div.innerHTML = ` div.innerHTML = `
<div class="flex-item"> <div class="flex-item">
<img class="fade-in-img" src="/photos/${img.src}"> <img class="fade-in-img" src="/photos/${img.src}">
</div> </div>
<div class="tags-display" data-index="${i}"></div> <div class="tags-display" data-index="${i}"></div>
<div class="flex-item flex-full"> <div class="flex-item flex-full">
<div class="flex-item flex-end"> <div class="flex-item flex-end">
@ -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 = () => {

View File

@ -1093,5 +1093,4 @@ justify-content: center;
position: relative; position: relative;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
} }