From 816bc986e3c75f8f43e710a0416670e940340b2e Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Mon, 2 Feb 2026 14:14:46 +0000 Subject: [PATCH] Hide intro video on scroll Loading screen now dismisses when user scrolls, uses mouse wheel, or swipes on mobile - in addition to skip button and timer. Co-Authored-By: Claude Opus 4.5 --- waitlist.js | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/waitlist.js b/waitlist.js index 5585319..d9a8d7f 100644 --- a/waitlist.js +++ b/waitlist.js @@ -36,25 +36,41 @@ function initLoadingScreen() { const loadingScreen = document.getElementById('loading-screen'); if (!loadingScreen) return; + let isHiding = false; + + function hideLoadingScreen() { + if (isHiding) return; + isHiding = true; + loadingScreen.classList.add('hidden'); + // Remove from DOM after transition completes + setTimeout(function() { + loadingScreen.remove(); + }, 1200); + // Clean up scroll listener + window.removeEventListener('scroll', onScroll); + window.removeEventListener('wheel', onScroll); + window.removeEventListener('touchmove', onScroll); + } + + function onScroll() { + hideLoadingScreen(); + } + const skipButton = document.getElementById('skip-loading'); if (skipButton) { - skipButton.addEventListener('click', function() { - loadingScreen.classList.add('hidden'); - setTimeout(function() { - loadingScreen.remove(); - }, 1200); - }); + skipButton.addEventListener('click', hideLoadingScreen); } + // Hide on scroll, wheel, or touch + window.addEventListener('scroll', onScroll, { passive: true }); + window.addEventListener('wheel', onScroll, { passive: true }); + window.addEventListener('touchmove', onScroll, { passive: true }); + // Wait for page to fully load window.addEventListener('load', function() { // Add delay to allow title animation to complete (6s zoom + 4s title = ~6s total) setTimeout(function() { - loadingScreen.classList.add('hidden'); - // Remove from DOM after transition completes - setTimeout(function() { - loadingScreen.remove(); - }, 1200); + hideLoadingScreen(); }, 6500); // Wait for animations to complete }); }