From 290ecbdf18a7a6371edd2705507747e231b393f3 Mon Sep 17 00:00:00 2001 From: bender Date: Sat, 21 Mar 2026 22:56:50 +0000 Subject: [PATCH] Update src/app/page.tsx --- src/app/page.tsx | 50 ++++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index d06151a..ebc2389 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -26,6 +26,8 @@ export default function LandingPage() { const galleryRef = useRef(null); const shoesRef = useRef(null); const veilsRef = useRef(null); + const shoesContainerRef = useRef(null); + const veilsContainerRef = useRef(null); useEffect(() => { let ticking = false; @@ -60,35 +62,33 @@ export default function LandingPage() { } } - // Check if shoes section is in view for arrow detection - if (shoesRef.current) { - const shoesRect = shoesRef.current.getBoundingClientRect(); - const shoesInView = shoesRect.top < window.innerHeight && shoesRect.bottom > 0; + // Check if shoes container (with button) is in view + if (shoesContainerRef.current) { + const shoesContainerRect = shoesContainerRef.current.getBoundingClientRect(); + const shoesContainerInView = shoesContainerRect.top < window.innerHeight && shoesContainerRect.bottom > 0; - // Show up arrow when scrolled past shoes section - // Show down arrow when above shoes section - if (!shoesInView && currentScrollY > lastScrollY) { - // We've scrolled past the shoes section, show the up arrow - setShowShoesArrow(true); + // Show more button when scrolled past shoes section + // Hide when user scrolls back to shoes area + if (!shoesContainerInView && currentScrollY > lastScrollY) { + // We've scrolled past the shoes section, show the more button setShowShoesMoreButton(true); - } else if (shoesInView) { - // We're at or above the shoes section - setShowShoesArrow(false); + } else if (shoesContainerInView && currentScrollY < lastScrollY) { + // We're back at or above the shoes section, hide the button setShowShoesMoreButton(false); } } - // Check if veils section is in view for more button - if (veilsRef.current) { - const veilsRect = veilsRef.current.getBoundingClientRect(); - const veilsInView = veilsRect.top < window.innerHeight && veilsRect.bottom > 0; + // Check if veils container (with button) is in view + if (veilsContainerRef.current) { + const veilsContainerRect = veilsContainerRef.current.getBoundingClientRect(); + const veilsContainerInView = veilsContainerRect.top < window.innerHeight && veilsContainerRect.bottom > 0; // Show more button when scrolled past veils section // Hide when user scrolls back to veils area - if (!veilsInView && currentScrollY > lastScrollY) { + if (!veilsContainerInView && currentScrollY > lastScrollY) { // We've scrolled past the veils section, show the more button setShowVeilsMoreButton(true); - } else if (veilsInView && currentScrollY < lastScrollY) { + } else if (veilsContainerInView && currentScrollY < lastScrollY) { // We're back at or above the veils section, hide the button setShowVeilsMoreButton(false); } @@ -528,7 +528,7 @@ export default function LandingPage() { className="group relative inline-flex items-center gap-2 px-4 md:px-6 py-2 md:py-3 bg-gradient-to-r from-[#D4AF37] to-[#D4AF37] text-black rounded-lg font-semibold hover:shadow-lg transition-all duration-300 ease-out shadow-lg" aria-label="View More Dresses" > - More + View More @@ -631,7 +631,7 @@ export default function LandingPage() {
-
+
- More + View More
@@ -686,7 +686,7 @@ export default function LandingPage() {
-
+
- More + View More
-- 2.49.1