From fbd15e275163675e2b3f34abd1bdfd929a2cc905 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 17 Jun 2026 12:25:30 +0000 Subject: [PATCH 1/2] Update src/components/Layout.tsx --- src/components/Layout.tsx | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/src/components/Layout.tsx b/src/components/Layout.tsx index 9592ef7..bb874b5 100644 --- a/src/components/Layout.tsx +++ b/src/components/Layout.tsx @@ -1,34 +1,10 @@ -import FooterMinimal from '@/components/sections/footer/FooterMinimal'; -import NavbarFloatingLogo from '@/components/ui/NavbarFloatingLogo'; -import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; -import SiteBackgroundSlot from "@/components/ui/SiteBackgroundSlot"; -import { Facebook, Instagram, Phone } from "lucide-react"; import { Outlet } from 'react-router-dom'; -import { StyleProvider } from "@/components/ui/StyleProvider"; +import FooterMinimal from '@/components/sections/footer/FooterMinimal'; +import SectionErrorBoundary from '@/components/ui/SectionErrorBoundary'; export default function Layout() { - const navItems = [ - { "name": "Home", "href": "#hero" }, - { "name": "Programs", "href": "#programs" }, - { "name": "Trainers", "href": "#trainers" }, - { "name": "Pricing", "href": "#pricing" }, - { "name": "Contact", "href": "#contact" }, - { "name": "Why Us", "href": "#why-us" }, - { "name": "Testimonials", "href": "#testimonials" } - ]; - return ( - - - - - +
@@ -39,10 +15,10 @@ export default function Layout() { socialLinks={[ { icon: "Facebook", href: "#" }, { icon: "Instagram", href: "#" }, - { icon: "Phone", href: "tel:+923424861918" }, + { icon: "Phone", href: "tel:+923424861918" } ]} /> - +
); -} +} \ No newline at end of file -- 2.49.1 From 374ca8f1bfb4729e14a421f2978ae8cecb9ca073 Mon Sep 17 00:00:00 2001 From: bender Date: Wed, 17 Jun 2026 12:25:31 +0000 Subject: [PATCH 2/2] Update src/components/sections/hero/HeroVideoExpand.tsx --- .../sections/hero/HeroVideoExpand.tsx | 169 ++++-------------- 1 file changed, 33 insertions(+), 136 deletions(-) diff --git a/src/components/sections/hero/HeroVideoExpand.tsx b/src/components/sections/hero/HeroVideoExpand.tsx index e0e7f08..24d8092 100644 --- a/src/components/sections/hero/HeroVideoExpand.tsx +++ b/src/components/sections/hero/HeroVideoExpand.tsx @@ -1,146 +1,43 @@ -import { useEffect, useRef, useState } from "react"; -import { AnimatePresence, motion, useScroll, useTransform } from "motion/react"; -import ImageOrVideo from "@/components/ui/ImageOrVideo"; -import AutoFillText from "@/components/ui/AutoFillText"; -import { useButtonClick } from "@/hooks/useButtonClick"; +import { useState, useEffect, useRef } from 'react'; -const StaggerText = ({ text }: { text: string }) => ( - - {[...text].map((char, index) => ( - - {char} - - ))} - -); - -type HeroVideoExpandProps = { +interface HeroVideoExpandProps { title: string; - primaryButton: { text: string; href: string }; - secondaryButton: { text: string; href: string }; + description: string; + videoSrc: string; onComplete?: () => void; -} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never }); +} -const HeroVideoExpand = ({ - title, - videoSrc, - imageSrc, - primaryButton, - secondaryButton, - onComplete, -}: HeroVideoExpandProps) => { - const [showLoader, setShowLoader] = useState(true); - const [expanded, setExpanded] = useState(false); - const handlePrimaryClick = useButtonClick(primaryButton.href); - const handleSecondaryClick = useButtonClick(secondaryButton.href); - - const sectionRef = useRef(null); - const { scrollYProgress } = useScroll({ - target: sectionRef, - offset: ["start start", "end start"], - }); - const videoY = useTransform(scrollYProgress, [0, 1], ["0px", "150px"]); - const videoScale = useTransform(scrollYProgress, [0, 1], [1, 1.1]); +export default function HeroVideoExpand({ title, description, videoSrc, onComplete }: HeroVideoExpandProps) { + const videoRef = useRef(null); useEffect(() => { - const expandTimer = setTimeout(() => setExpanded(true), 600); - const hideTimer = setTimeout(() => { - setShowLoader(false); - onComplete?.(); - }, 1500); - return () => { - clearTimeout(expandTimer); - clearTimeout(hideTimer); + const video = videoRef.current; + if (!video) return; + + const handleEnded = () => { + if (onComplete) onComplete(); }; - }, []); + + video.addEventListener('ended', handleEnded); + return () => { + video.removeEventListener('ended', handleEnded); + }; + }, [onComplete]); return ( - <> - - {showLoader && ( - - - - - - )} - - -
- - - - -
- -
-
- - {title} - - -
- - - - - - - - - - -
-
-
-
- +
+
); -}; - -export default HeroVideoExpand; +} \ No newline at end of file -- 2.49.1