@@ -8,6 +8,7 @@ import { Button } from "@/components/ui/button"
88export function HeroSection ( ) {
99 const [ isVisible , setIsVisible ] = useState ( false )
1010 const [ currentLine , setCurrentLine ] = useState ( 0 )
11+ const [ mousePosition , setMousePosition ] = useState ( { x : 0 , y : 0 } )
1112 const codeLines = [
1213 {
1314 id : 1 ,
@@ -59,25 +60,98 @@ export function HeroSection() {
5960 return ( ) => clearTimeout ( timer )
6061 } , [ ] )
6162
63+ // Manejo del movimiento del mouse para el patrón topográfico
64+ useEffect ( ( ) => {
65+ const handleMouseMove = ( e : MouseEvent ) => {
66+ const rect = sectionRef . current ?. getBoundingClientRect ( )
67+ if ( rect ) {
68+ setMousePosition ( {
69+ x : ( ( e . clientX - rect . left ) / rect . width ) * 100 ,
70+ y : ( ( e . clientY - rect . top ) / rect . height ) * 100 ,
71+ } )
72+ }
73+ }
74+
75+ const section = sectionRef . current
76+ if ( section ) {
77+ section . addEventListener ( 'mousemove' , handleMouseMove )
78+ return ( ) => section . removeEventListener ( 'mousemove' , handleMouseMove )
79+ }
80+ } , [ ] )
81+
6282 return (
6383 < section
6484 id = "home"
6585 ref = { sectionRef }
6686 className = "min-h-screen flex items-center py-20 relative overflow-hidden"
6787 style = { { position : "relative" } }
6888 >
69- { /* Spotlights de color en los lados */ }
89+ { /* Patrón topográfico animado */ }
7090 < div
7191 aria-hidden = "true"
7292 className = "pointer-events-none absolute inset-0 z-0"
7393 style = { {
74- background :
75- `radial-gradient(400px 200px at 0% 20%, rgba(255,217,69,0.18), transparent 70%),` +
76- `radial-gradient(400px 200px at 100% 80%, rgba(255,217,69,0.22), transparent 70%)` +
77- `,radial-gradient(300px 150px at 50% 100%, rgba(255,217,69,0.10), transparent 80%)` ,
78- transition : "background 0.5s" ,
94+ background : `
95+ radial-gradient(circle at ${ mousePosition . x } % ${ mousePosition . y } %,
96+ rgba(0,240,80,0.15) 0%,
97+ rgba(0,240,80,0.08) 25%,
98+ rgba(0,240,80,0.04) 50%,
99+ transparent 70%
100+ )
101+ ` ,
102+ transition : 'background 0.3s ease-out' ,
79103 } }
80- />
104+ >
105+ { /* Líneas topográficas */ }
106+ < svg
107+ className = "absolute inset-0 w-full h-full"
108+ style = { {
109+ transform : `translate(${ ( mousePosition . x - 50 ) * 0.02 } px, ${ ( mousePosition . y - 50 ) * 0.02 } px)` ,
110+ transition : 'transform 0.3s ease-out' ,
111+ } }
112+ >
113+ < defs >
114+ < pattern id = "topographic" x = "0" y = "0" width = "120" height = "120" patternUnits = "userSpaceOnUse" >
115+ { /* Líneas topográficas concéntricas */ }
116+ < circle cx = "60" cy = "60" r = "10" fill = "none" stroke = "rgba(0,240,80,0.1)" strokeWidth = "0.5" />
117+ < circle cx = "60" cy = "60" r = "20" fill = "none" stroke = "rgba(0,240,80,0.08)" strokeWidth = "0.5" />
118+ < circle cx = "60" cy = "60" r = "30" fill = "none" stroke = "rgba(0,240,80,0.06)" strokeWidth = "0.5" />
119+ < circle cx = "60" cy = "60" r = "40" fill = "none" stroke = "rgba(0,240,80,0.04)" strokeWidth = "0.5" />
120+ < circle cx = "60" cy = "60" r = "50" fill = "none" stroke = "rgba(0,240,80,0.02)" strokeWidth = "0.5" />
121+ </ pattern >
122+ </ defs >
123+ < rect width = "100%" height = "100%" fill = "url(#topographic)" />
124+ </ svg >
125+
126+ { /* Líneas adicionales que siguen el cursor */ }
127+ < div
128+ className = "absolute w-96 h-96 rounded-full border border-dark-accent/10"
129+ style = { {
130+ left : `${ mousePosition . x } %` ,
131+ top : `${ mousePosition . y } %` ,
132+ transform : 'translate(-50%, -50%)' ,
133+ transition : 'all 0.3s ease-out' ,
134+ } }
135+ />
136+ < div
137+ className = "absolute w-64 h-64 rounded-full border border-dark-accent/15"
138+ style = { {
139+ left : `${ mousePosition . x } %` ,
140+ top : `${ mousePosition . y } %` ,
141+ transform : 'translate(-50%, -50%)' ,
142+ transition : 'all 0.4s ease-out' ,
143+ } }
144+ />
145+ < div
146+ className = "absolute w-32 h-32 rounded-full border border-dark-accent/20"
147+ style = { {
148+ left : `${ mousePosition . x } %` ,
149+ top : `${ mousePosition . y } %` ,
150+ transform : 'translate(-50%, -50%)' ,
151+ transition : 'all 0.5s ease-out' ,
152+ } }
153+ />
154+ </ div >
81155 < div className = "container px-4 md:px-6 relative z-10" >
82156 < div className = "grid gap-8 lg:grid-cols-[1fr_400px] lg:gap-12 xl:grid-cols-[1fr_500px]" >
83157 < div className = "flex flex-col justify-center space-y-8" >
0 commit comments