import { useEffect, useRef } from 'react'; import { gsap } from 'gsap'; import { ArrowDown, Play, Sparkles, Terminal } from 'lucide-react'; export default function Hero() { const heroRef = useRef(null); const titleRef = useRef(null); const subtitleRef = useRef(null); const ctaRef = useRef(null); const canvasRef = useRef(null); useEffect(() => { // Binary rain animation const canvas = canvasRef.current; const ctx = canvas.getContext('2d'); let animationId; const resize = () => { canvas.width = window.innerWidth; canvas.height = window.innerHeight; }; resize(); window.addEventListener('resize', resize); const chars = '01アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン'; const fontSize = 14; const columns = canvas.width / fontSize; const drops = Array(Math.floor(columns)).fill(1); const draw = () => { ctx.fillStyle = 'rgba(10, 10, 15, 0.05)'; ctx.fillRect(0, 0, canvas.width, canvas.height); ctx.fillStyle = '#00f0ff'; ctx.font = `${fontSize}px JetBrains Mono`; drops.forEach((drop, i) => { const char = chars[Math.floor(Math.random() * chars.length)]; ctx.fillText(char, i * fontSize, drop * fontSize); drops[i] = drop * fontSize > canvas.height && Math.random() > 0.975 ? 0 : drop + 1; }); }; const animate = () => { draw(); animationId = requestAnimationFrame(animate); }; animate(); // GSAP Animations const tl = gsap.timeline({ defaults: { ease: 'power4.out' } }); tl.from('.hero-badge', { y: 30, opacity: 0, duration: 0.8, }) .from(titleRef.current, { y: 100, opacity: 0, duration: 1, skewY: 7, }, '-=0.4') .from(subtitleRef.current, { y: 50, opacity: 0, duration: 0.8, }, '-=0.6') .from('.hero-stats', { y: 30, opacity: 0, duration: 0.6, stagger: 0.1, }, '-=0.4') .from(ctaRef.current, { y: 30, opacity: 0, duration: 0.6, }, '-=0.3'); // Floating elements animation gsap.to('.float-element', { y: -20, rotation: 5, duration: 3, ease: 'sine.inOut', yoyo: true, repeat: -1, stagger: 0.5, }); return () => { cancelAnimationFrame(animationId); window.removeEventListener('resize', resize); }; }, []); const scrollToWorkbench = () => { document.getElementById('workbench').scrollIntoView({ behavior: 'smooth' }); }; return (
{/* Binary Rain Canvas */} {/* Gradient Orbs */}
{/* Grid Pattern */}
{/* Floating Code Elements */}
bash

npm run optimize

{`{`}

"performance": "99.9%",

"optimization": "complete"

{`}`}

AI Enhanced

{/* Main Content */}
{/* Badge */}
SYSTEM ONLINE v2.024
{/* Title */}

FORGE YOUR DIGITAL EDGE

{/* Subtitle */}

Advanced protocols for developers who refuse to settle. Master the arcane arts of performance, automation, and system architecture.

{/* Stats */}
{[ { value: '500+', label: 'Pro Tips' }, { value: '50K+', label: 'Developers' }, { value: '99.9%', label: 'Uptime' }, ].map((stat, i) => (
{stat.value}
{stat.label}
))}
{/* CTA Buttons */}
{/* Scroll Indicator */}
); }