'use client'; import { useRef, useEffect, useState } from 'react'; const steps = [ { title: 'Les Débuts', text: "J'ai commencé par le web en 2019 suite à un stage, je n'ai plus jamais arrêté. Aujourd'hui je veux en faire mon métier.", year: '2019', position: 'top' as const, left: '16%', }, { title: 'L\'Évolution', text: "Après un bac STI2D avec mention Très bien j'ai entamé un BUT Informatique Parcours Développement IA.", year: '2022', position: 'bottom' as const, left: '50%', }, { title: 'Aujourd\'hui', text: "Je suis entrepreneur, co-fondateur d'une startup et développeur freelance, je vis de ma passion.", year: '2026', position: 'top' as const, left: '84%', }, ]; const lineTop = '58%'; export default function TimelineSection() { const sectionRef = useRef(null); const [visible, setVisible] = useState(false); useEffect(() => { const section = sectionRef.current; if (!section) return; const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { setVisible(true); section.querySelectorAll('.reveal').forEach((el) => el.classList.add('visible')); observer.unobserve(section); } }, { threshold: 0.12 } ); observer.observe(section); return () => observer.disconnect(); }, []); return (
{/* Label */}
Parcours

À propos

{/* Mobile layout */}
{steps.map((step, i) => (
{step.year}

{step.title}

{step.text}

))}
{/* Desktop timeline */}
{/* Background track */}
{/* Animated progress line */}
{steps.map((step, i) => (
{/* Dot */}
{/* Year label */}
{step.year}
{/* Card */}

{step.title}

{step.text}

))}
); }