From 651cc9427b187d06fce13a032dea7f42f64c734a Mon Sep 17 00:00:00 2001 From: bender Date: Sat, 21 Mar 2026 22:16:01 +0000 Subject: [PATCH] Update src/app/page.tsx --- src/app/page.tsx | 51 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 37 insertions(+), 14 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 759e6a1..8062906 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -10,11 +10,13 @@ import FooterSimple from "@/components/sections/footer/FooterSimple"; import TestimonialAboutCard from "@/components/sections/about/TestimonialAboutCard"; import BlogCardThree from "@/components/sections/blog/BlogCardThree"; import { Star, Heart, Users, Camera, Sparkles, Crown, Phone, MessageCircle, User, Play, ChevronRight, X, ArrowDown, ArrowUp, Instagram, MapPin } from "lucide-react"; -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; export default function LandingPage() { const [showModal, setShowModal] = useState(false); const [showBackToTop, setShowBackToTop] = useState(false); + const [showViewMoreButton, setShowViewMoreButton] = useState(false); + const viewMoreButtonRef = useRef(null); useEffect(() => { const handleScroll = () => { @@ -25,6 +27,25 @@ export default function LandingPage() { return () => window.removeEventListener('scroll', handleScroll); }, []); + useEffect(() => { + const observer = new IntersectionObserver( + ([entry]) => { + setShowViewMoreButton(entry.isIntersecting); + }, + { threshold: 0.1 } + ); + + if (viewMoreButtonRef.current) { + observer.observe(viewMoreButtonRef.current); + } + + return () => { + if (viewMoreButtonRef.current) { + observer.unobserve(viewMoreButtonRef.current); + } + }; + }, []); + const scrollToGallery = () => { const gallerySectionElement = document.getElementById('gallery'); if (gallerySectionElement) { @@ -375,18 +396,20 @@ export default function LandingPage() { products={initialDresses} /> - {/* View More Button Positioned After 6th Picture */} -
-
- -
+ {/* View More Button - Positioned after 6th picture, visible when 6th item is in view */} +
+ {showViewMoreButton && ( +
+ +
+ )}
@@ -611,4 +634,4 @@ export default function LandingPage() { ); -} \ No newline at end of file +} -- 2.49.1