diff --git a/src/components/sections/hero/HeroExpand.tsx b/src/components/sections/hero/HeroExpand.tsx index dedb1fc..93d474a 100644 --- a/src/components/sections/hero/HeroExpand.tsx +++ b/src/components/sections/hero/HeroExpand.tsx @@ -1,146 +1,14 @@ -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 React, { useEffect } from 'react'; -const StaggerText = ({ text }: { text: string }) => ( - - {[...text].map((char, index) => ( - - {char} - - ))} - -); - -type HeroExpandProps = { +interface HeroExpandProps { title: string; - primaryButton: { text: string; href: string }; - secondaryButton: { text: string; href: string }; - onComplete?: () => void; -} & ({ imageSrc: string; videoSrc?: never } | { videoSrc: string; imageSrc?: never }); - -const HeroExpand = ({ - title, - videoSrc, - imageSrc, - primaryButton, - secondaryButton, - onComplete, -}: HeroExpandProps) => { - 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]); + onComplete: () => void; +} +export default function HeroExpand({ title, onComplete }: HeroExpandProps) { useEffect(() => { - const expandTimer = setTimeout(() => setExpanded(true), 600); - const hideTimer = setTimeout(() => { - setShowLoader(false); - onComplete?.(); - }, 1500); - return () => { - clearTimeout(expandTimer); - clearTimeout(hideTimer); - }; - }, []); + onComplete(); + }, [onComplete]); - return ( - <> - - {showLoader && ( - - - - - - )} - - -
- - - - -
- -
-
- - {title} - - -
- - - - - - - - - - -
-
-
-
- - ); -}; - -export default HeroExpand; + return
{title}
; +} \ No newline at end of file diff --git a/src/pages/HomePage.tsx b/src/pages/HomePage.tsx index ba462e6..4fc7f9a 100644 --- a/src/pages/HomePage.tsx +++ b/src/pages/HomePage.tsx @@ -6,7 +6,6 @@ import FeaturesImageBento from '@/components/sections/features/FeaturesImageBent import HeroTiltedCards from '@/components/sections/hero/HeroTiltedCards'; import MetricsFeatureCards from '@/components/sections/metrics/MetricsFeatureCards'; import TestimonialOverlayCards from '@/components/sections/testimonial/TestimonialOverlayCards'; -import { Award, Coffee, Star } from "lucide-react"; import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; export default function HomePage() {