diff --git a/src/app/page.tsx b/src/app/page.tsx index 790d5ef..a23e688 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -34,7 +34,7 @@ export default function LandingPage() { let ticking = false; const handleScroll = () => { - if (!ticking) { + if (!ticking && !showModal) { window.requestAnimationFrame(() => { const currentScrollY = window.scrollY; setShowBackToTop(currentScrollY > 300); @@ -76,7 +76,19 @@ export default function LandingPage() { window.addEventListener('scroll', handleScroll); return () => window.removeEventListener('scroll', handleScroll); - }, [lastScrollY]); + }, [lastScrollY, showModal]); + + useEffect(() => { + if (showModal) { + document.body.style.overflow = 'hidden'; + } else { + document.body.style.overflow = 'unset'; + } + + return () => { + document.body.style.overflow = 'unset'; + }; + }, [showModal]); const scrollToGallery = () => { const gallerySectionElement = document.getElementById('gallery'); @@ -455,7 +467,7 @@ export default function LandingPage() { {/* Modal Gallery */} {showModal && ( -