From 96ea02bca9e74d9c29e8610c2b8c30c5b9cce1dd Mon Sep 17 00:00:00 2001 From: Michael Pilosov Date: Mon, 15 Jan 2024 02:27:09 +0000 Subject: [PATCH] update site --- out/index.html | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/out/index.html b/out/index.html index cbaad4f..3875c4a 100644 --- a/out/index.html +++ b/out/index.html @@ -1,21 +1,26 @@ + Image Gallery +

Image Gallery

-
@@ -65,14 +72,14 @@ function loadImages() { var gallery = document.getElementById('gallery'); - for (var i = 0; i <= 199; i++) { + for (var i = 175; i < 275; i++) { // Changed from i <= 100 to i < 100 let imageName = 'v' + i + '.png'; let img = document.createElement('img'); img.src = imageName; - img.onerror = function() { this.style.display = 'none'; }; - img.onload = function() { + img.onerror = function () { this.style.display = 'none'; }; + img.onload = function () { this.classList.add('gallery-img'); - this.onclick = function() { + this.onclick = function () { openLightbox(this.src, this.src.split('/').pop()); currentImageIndex = imageArray.indexOf(this); }; @@ -82,14 +89,7 @@ gallery.appendChild(img); } } - function updateGridLayout(columns) { - var gallery = document.getElementById('gallery'); - gallery.style.gridTemplateColumns = `repeat(${columns}, 1fr)`; - } - document.getElementById('layoutSlider').addEventListener('input', function() { - updateGridLayout(this.value); - }); function openLightbox(src, filename) { document.getElementById('lightbox').style.display = 'flex'; @@ -102,7 +102,7 @@ } // Keyboard navigation for lightbox - document.onkeydown = function(e) { + document.onkeydown = function (e) { if (document.getElementById('lightbox').style.display === 'flex') { if (e.key === 'ArrowRight') { navigateLightbox(1); // Next image @@ -130,10 +130,10 @@ navigateLightbox(direction); } } - window.onload = function() { - loadImages(); - updateGridLayout(document.getElementById('layoutSlider').value); - }; - + window.onload = function () { + loadImages(); + }; + - + + \ No newline at end of file