From 9c248bea063015d2a9482a27dcb39901e106808d Mon Sep 17 00:00:00 2001 From: esefxdz Date: Fri, 3 Oct 2025 11:32:54 +0300 Subject: [PATCH] we back --- gallery-container.html | 68 ++++++++++++++++++++++++++++++++---------- js/gallery.js | 17 ++++------- 2 files changed, 58 insertions(+), 27 deletions(-) diff --git a/gallery-container.html b/gallery-container.html index 141ebed..37f2aa9 100644 --- a/gallery-container.html +++ b/gallery-container.html @@ -1,16 +1,52 @@ - - - - - Gallery - - - - - - - - - + \ No newline at end of file diff --git a/js/gallery.js b/js/gallery.js index 18a9480..fc23ce5 100644 --- a/js/gallery.js +++ b/js/gallery.js @@ -1,17 +1,12 @@ document.addEventListener('DOMContentLoaded', () => { const galleryContainer = document.getElementById('gallery-container'); - if (!galleryContainer) { - console.error("Gallery container not found!"); - return; - } + const totalImages = 50; // number of images you want to load - const files = galleryContainer.dataset.files.split(','); - - files.forEach((file, index) => { + for (let i = 1; i <= totalImages; i++) { const img = document.createElement('img'); - img.src = `gallery/${file.trim()}`; - img.alt = `Image ${index + 1}`; - img.onerror = () => { img.style.display = 'none'; }; + img.src = `gallery/${i}.jpg`; // assuming .jpg extension, change if needed + img.alt = `Image ${i}`; + img.onerror = () => { img.style.display = 'none'; }; // hide broken images galleryContainer.appendChild(img); - }); + } });