"use client"; import { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { ArrowDownIcon, DownloadIcon, GithubIcon, LinkedinIcon, MailIcon } from 'lucide-react'; interface HeroProps { data: { name: string; about: string; avatarUrl: string; contact: { email: string; social: { name: string; url: string; icon: any; }[]; }; }; } // Simple typewriter effect const useTypewriter = (text: string, speed: number = 100) => { const [displayText, setDisplayText] = useState(''); const [currentIndex, setCurrentIndex] = useState(0); const [isDone, setIsDone] = useState(false); useEffect(() => { if (currentIndex < text.length) { const timeout = setTimeout(() => { setDisplayText(prev => prev + text[currentIndex]); setCurrentIndex(prev => prev + 1); }, speed); return () => clearTimeout(timeout); } else { setIsDone(true); } }, [currentIndex, speed, text]); return { displayText, isDone }; }; const HeroSection: React.FC = ({ data }) => { const { displayText, isDone } = useTypewriter(data.about, 30); const containerVariants = { hidden: { opacity: 0 }, visible: { opacity: 1, transition: { staggerChildren: 0.1, delayChildren: 0.3, } } }; const itemVariants = { hidden: { y: 20, opacity: 0 }, visible: { y: 0, opacity: 1, transition: { type: "spring", stiffness: 100 } } }; return (
{/* Background gradient */}
{/* Animated particles - Add pointer-events-none to prevent blocking clicks */}
{Array.from({ length: 20 }).map((_, i) => ( ))}
{/* Left content */} Hello, I'm {data.name} Software Developer

{displayText} {!isDone && }

Contact Me Resume {data.contact.social.map((social, index) => ( ))}
{/* Right content - Avatar */}
{data.name}
{/* Scroll down indicator */} Scroll Down
); }; export default HeroSection;