From b7b4b5dd36fbb3411c39262552888e29e916335b Mon Sep 17 00:00:00 2001 From: j Date: Fri, 28 Mar 2025 11:14:33 +0000 Subject: [PATCH] mobile view --- camp/static/css/site.scss | 17 ++++++++++++----- camp/static/js/gallery.js | 6 +++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/camp/static/css/site.scss b/camp/static/css/site.scss index 5166a4f..4804d43 100644 --- a/camp/static/css/site.scss +++ b/camp/static/css/site.scss @@ -22,11 +22,13 @@ height: calc(100vh - 180px); } @media screen and (max-width: 39.9375em) { - .photo-container .image { - height: auto; - width: 100%; - } - + &:open { + overflow: auto; + } + .photo-container .image { + height: auto; + width: 100%; + } } .main-image { width: 100%; @@ -45,6 +47,11 @@ margin-top: 10px; overflow: auto; } + @media screen and (max-width: 39.9375em) { + .thumbnails { + flex-wrap: wrap; + } + } .thumbnail { width: 80px; height: 60px; diff --git a/camp/static/js/gallery.js b/camp/static/js/gallery.js index bffa4ae..8254a27 100644 --- a/camp/static/js/gallery.js +++ b/camp/static/js/gallery.js @@ -142,7 +142,11 @@ function loadGallery(images, idx, main, thumbnails) { gallery.querySelectorAll(".thumbnail").forEach((thumb, i) => { thumb.classList.toggle("active", i === index); }); - gallery.querySelector('.active').scrollIntoView() + if document.querySelector(".thumbnail").parentElement + + if (thumbnailsContainer && thumbnailsContainer(thumbnailsContainer).flexWrap == "nowrap") { + gallery.querySelector('.active').scrollIntoView() + } } if (images[index].orig) { download.href = images[index].orig