1+ "use client" ;
2+
3+ import { motion } from "framer-motion" ;
4+ import Link from "next/link" ;
5+ import Image from "next/image" ;
16import { Button } from "../ui/Button" ;
27import { Heading , Text } from "../ui/Typography" ;
38import { Section } from "../ui/Section" ;
49import { Badge } from "../ui/Badge" ;
5- import Link from "next/link " ;
6- import Image from "next/image " ;
10+ import { AnimatedSection } from "../ui/AnimatedSection " ;
11+ import { Typewriter } from "../ui/Typewriter " ;
712
813interface HeroSectionProps {
914 title : string ;
@@ -38,42 +43,67 @@ export function HeroSection({
3843 className = "" ,
3944} : HeroSectionProps ) {
4045 return (
41- < Section
42- variant = "surface"
43- spacing = "xl"
44- maxWidth = "none"
46+ < AnimatedSection
47+ variant = "section"
4548 className = { `relative h-auto md:h-screen flex items-center justify-center overflow-hidden ${ className } ` }
4649 >
4750 < div className = "container mx-auto max-w-4xl text-center space-y-6" >
4851 { avatarSrc && (
49- < div className = "mb-8 relative w-32 h-32 mx-auto" >
52+ < motion . div
53+ className = "mb-8 relative w-32 h-32 mx-auto"
54+ initial = { { opacity : 0 , scale : 0.8 } }
55+ animate = { { opacity : 1 , scale : 1 } }
56+ transition = { { duration : 0.8 , delay : 0.2 } }
57+ >
5058 < Image
5159 src = { avatarSrc }
5260 alt = { avatarAlt }
5361 fill
5462 className = "rounded-full object-cover border-4 border-accent"
5563 priority
5664 />
57- </ div >
65+ </ motion . div >
5866 ) }
5967
60- < Heading
61- as = "h1"
62- size = "h1"
63- className = "font-mono text-[2.5rem] md:text-[3.5rem] font-bold text-text"
68+ < motion . div
69+ initial = { { opacity : 1 , y : 0 } }
70+ animate = { { opacity : 1 , y : 0 } }
71+ transition = { { duration : 0.8 , delay : 0.1 } }
6472 >
65- { title }
66- </ Heading >
73+ < h1 className = "font-mono text-[2.5rem] md:text-[3.5rem] font-bold text-text" data-testid = "hero-heading" >
74+ < Typewriter
75+ text = { title }
76+ speed = { 50 }
77+ className = "font-mono text-[2.5rem] md:text-[3.5rem] font-bold text-text"
78+ />
79+ </ h1 >
80+ </ motion . div >
6781
68- < div className = "bg-[#f6f8fa] dark:bg-[#21262d] border border-[#d0d7de] dark:border-[#30363d] text-[#656d76] dark:text-[#8b949e] font-sans text-sm px-3 py-1 rounded-full inline-flex items-center" >
82+ < motion . div
83+ initial = { { opacity : 1 , y : 0 } }
84+ animate = { { opacity : 1 , y : 0 } }
85+ transition = { { duration : 0.8 , delay : 0.3 } }
86+ className = "bg-[#f6f8fa] dark:bg-[#21262d] border border-[#d0d7de] dark:border-[#30363d] text-[#656d76] dark:text-[#8b949e] font-sans text-sm px-3 py-1 rounded-full inline-flex items-center"
87+ >
6988 📍 { location || "Available for remote opportunities" }
70- </ div >
89+ </ motion . div >
7190
72- < Text size = "base" className = "mb-8 font-sans text-base font-normal text-text max-w-2xl mx-auto" >
73- { description }
74- </ Text >
91+ < motion . div
92+ initial = { { opacity : 1 , y : 0 } }
93+ animate = { { opacity : 1 , y : 0 } }
94+ transition = { { duration : 0.8 , delay : 0.4 } }
95+ >
96+ < Text size = "base" className = "mb-8 font-sans text-base font-normal text-text max-w-2xl mx-auto" >
97+ { description }
98+ </ Text >
99+ </ motion . div >
75100
76- < div className = "flex flex-col sm:flex-row gap-4 justify-center items-center" >
101+ < motion . div
102+ className = "flex flex-col sm:flex-row gap-4 justify-center items-center"
103+ initial = { { opacity : 1 , y : 0 } }
104+ animate = { { opacity : 1 , y : 0 } }
105+ transition = { { duration : 0.8 , delay : 0.5 } }
106+ >
77107 { ctaPrimary && (
78108 < Link
79109 href = { ctaPrimary . link }
@@ -117,17 +147,21 @@ export function HeroSection({
117147 </ Link >
118148 </ Button >
119149 ) }
120- </ div >
150+ </ motion . div >
121151
122- < div >
152+ < motion . div
153+ initial = { { opacity : 1 , y : 0 } }
154+ animate = { { opacity : 1 , y : 0 } }
155+ transition = { { duration : 0.8 , delay : 0.6 } }
156+ >
123157 < div
124158 data-testid = "scroll-indicator"
125159 className = "absolute bottom-8 left-1/2 -translate-x-1/2 animate-bounce text-[#656d76] dark:text-[#8b949e] font-sans text-sm"
126160 >
127161 Scroll to explore ↓
128162 </ div >
129- </ div >
163+ </ motion . div >
130164 </ div >
131- </ Section >
165+ </ AnimatedSection >
132166 ) ;
133167}
0 commit comments