"use client"; import { useState, useEffect } from "react"; import { motion, AnimatePresence } from "framer-motion"; const INTRO_LINES = [ "EVANDRO", "FONSECA", "JUNIOR", ]; export default function PageIntro() { const [isVisible, setIsVisible] = useState(true); const [counter, setCounter] = useState(0); useEffect(() => { // Animate counter from 0 to 100 const duration = 2000; const start = performance.now(); const tick = (now: number) => { const elapsed = now - start; const progress = Math.min(elapsed / duration, 1); // Eased progress const eased = 1 - Math.pow(1 - progress, 3); setCounter(Math.floor(eased * 100)); if (progress < 1) { requestAnimationFrame(tick); } else { // Wait a beat then hide setTimeout(() => setIsVisible(false), 400); } }; requestAnimationFrame(tick); }, []); return ( {isVisible && ( {/* Horizontal lines decoration */}
{[...Array(5)].map((_, i) => ( ))}
{/* Counter */} {counter.toString().padStart(3, "0")} {/* Progress bar */}
{/* Name reveal */}
{INTRO_LINES.map((line, i) => (
{line}
))} {/* Subtitle */} Software Engineer
{/* Corner markers */}
{/* Top-left */}
{/* Top-right */}
{/* Bottom-left */}
)} ); }