1+ "use client" ;
2+ import { useEffect , useRef } from "react" ;
3+ import { gsap } from "gsap" ;
4+
5+ export default function Hero ( ) {
6+ const cardsRef = useRef ( [ ] ) ;
7+
8+ useEffect ( ( ) => {
9+ const tl = gsap . timeline ( { repeat : - 1 , yoyo : true , defaults : { ease : "power1.inOut" , duration : 1 } } ) ;
10+ tl . to ( cardsRef . current , {
11+ stagger : 0.2 ,
12+ y : ( i ) => - 20 - i * 10 ,
13+ x : ( i ) => ( i - 1.5 ) * 40 ,
14+ rotation : ( i ) => ( i - 1.5 ) * 5 ,
15+ } ) . to ( cardsRef . current , { delay : 1 , y : 0 , x : 0 , rotation : 0 , stagger : 0.2 } ) ;
16+ } , [ ] ) ;
17+
18+ return (
19+ < section className = "flex justify-center items-center py-12 px-6" >
20+ < div className = "max-w-6xl w-full bg-white rounded-xl shadow-lg flex flex-col md:flex-row items-center overflow-hidden" >
21+ { /* Left: Heading and CTA */ }
22+ < div className = "w-full md:w-1/2 p-8 md:px-14 md:py-24 flex flex-col justify-center items-start" >
23+ < h1 className = "text-4xl md:text-4xl font-semibold text-neutral-900 mb-4" >
24+ Build Fast with Stream< span className = "px-2 py-2 bg-black text-white rounded-lg" > UI</ span >
25+ </ h1 >
26+ < p className = "text-neutral-600 dark:text-neutral-400 text-lg mb-6" >
27+ Copy-paste clean, ready-to-use React + Tailwind components into your projects without installation.
28+ </ p >
29+ < div className = "flex gap-4" >
30+ < a
31+ href = "#components"
32+ className = "bg-black shadow-xl text-white px-5 py-3 rounded-lg hover:bg-neutral-800 transition"
33+ >
34+ Browse Components
35+ </ a >
36+ < a
37+ href = "#features"
38+ className = "border shadow-xl border-neutral-700 text-neutral-900 px-5 py-3 rounded-lg hover:bg-neutral-100 transition"
39+ >
40+ Learn More
41+ </ a >
42+ </ div >
43+ { /* Reviewed by */ }
44+ < div className = "flex items-center gap-2 mt-6" >
45+ < div className = "flex -space-x-3" >
46+ < div className = "w-8 h-8 rounded-full bg-blue-600 flex items-center justify-center text-white text-sm font-medium" > S</ div >
47+ < div className = "w-8 h-8 rounded-full bg-orange-600 flex items-center justify-center text-white text-sm font-medium" > N</ div >
48+ < div className = "w-8 h-8 rounded-full bg-pink-600 flex items-center justify-center text-white text-sm font-medium" > R</ div >
49+ < div className = "w-8 h-8 rounded-full bg-green-600 flex items-center justify-center text-white text-sm font-medium" > V</ div >
50+ </ div >
51+ < span className = "text-sm text-neutral-500" > Reviewed by 100+ users</ span >
52+ </ div >
53+ </ div >
54+ { /* Right: Animated Cards */ }
55+ < div className = "w-full md:w-1/2 p-8 flex justify-center items-center relative h-72" >
56+ { [ ...Array ( 4 ) ] . map ( ( _ , i ) => (
57+ < div
58+ key = { i }
59+ ref = { ( el ) => ( cardsRef . current [ i ] = el ) }
60+ className = "absolute w-40 h-60 bg-neutral-100 rounded-lg shadow-md"
61+ />
62+ ) ) }
63+ </ div >
64+ </ div >
65+ </ section >
66+ ) ;
67+ }
0 commit comments