diff --git a/static/js/app.js b/static/js/app.js index f103073..e14330e 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -326,9 +326,11 @@ function advanceSlide() { next.classList.add('active'); current.classList.remove('active'); activeSlot = nextSlot; - // Preload the upcoming photo into the now-hidden slot slideIndex = (slideIndex + 1) % photos.length; - current.src = photos[(slideIndex + 1) % photos.length]; + const preloadSrc = photos[(slideIndex + 1) % photos.length]; + // Only change src after the fade-out completes — changing it mid-transition + // causes the new image to appear at partial opacity (the flash the user sees) + current.addEventListener('transitionend', () => { current.src = preloadSrc; }, { once: true }); }; // If the preloaded image is ready, swap immediately; otherwise wait for it