diff --git a/src/components/Map/markerManager.js b/src/components/Map/markerManager.js index 3b85a53..ea18533 100644 --- a/src/components/Map/markerManager.js +++ b/src/components/Map/markerManager.js @@ -519,6 +519,20 @@ function initModalGallery(modalWrap, gallery) { }); }); setActive(0); + let touchStartX = 0; + const touchThreshold = 30; + heroImg.addEventListener("touchstart", (event) => { + if (!event.touches?.length) return; + touchStartX = event.touches[0].clientX; + }); + heroImg.addEventListener("touchend", (event) => { + if (!event.changedTouches?.length) return; + const dx = event.changedTouches[0].clientX - touchStartX; + if (Math.abs(dx) < touchThreshold) return; + const direction = dx > 0 ? -1 : 1; + const nextIndex = (activeIndex + direction + gallery.length) % gallery.length; + setActive(nextIndex); + }); } function openImageLightbox(src) {