'use client' import { useState, useEffect, useRef, useMemo, useCallback } from 'react' import { Language } from '@/lib/types' import GradientText from '../ui/GradientText' import FadeInView from '../ui/FadeInView' import { type Milestone, MILESTONES, STATS } from './MilestonesSlide.data' import { THEMES } from './MilestonesSlide.themes' import { StarField, SoftGrid, Timeline, StatCard, DetailModal } from './MilestonesSlide.parts' interface MilestonesSlideProps { lang: Language } const MONO: React.CSSProperties = { fontFamily: '"JetBrains Mono","SF Mono",ui-monospace,monospace', fontVariantNumeric: 'tabular-nums', } const CSS_KF = ` @keyframes msFlow { 0%{stroke-dashoffset:0} 100%{stroke-dashoffset:-18} } @keyframes msFadeIn { from{opacity:0} to{opacity:1} } @keyframes msScaleIn { from{opacity:0;transform:scale(.94)} to{opacity:1;transform:scale(1)} } @keyframes msHeadingDark { 0%,100%{text-shadow:0 0 22px rgba(167,139,250,.3)} 50% {text-shadow:0 0 40px rgba(167,139,250,.6)} } @keyframes msHeadingLight { 0%,100%{text-shadow:0 0 22px rgba(124,58,237,.15)} 50% {text-shadow:0 0 36px rgba(124,58,237,.30)} } @keyframes msPulse { 0%,100%{r:9;opacity:.4} 50% {r:14;opacity:.05} } ` // ── Light mode hook ─────────────────────────────────────────────────────────── function useIsLight() { const [isLight, setIsLight] = useState(false) useEffect(() => { const check = () => setIsLight(document.documentElement.classList.contains('theme-light')) check() const obs = new MutationObserver(check) obs.observe(document.documentElement, { attributes: true, attributeFilter: ['class'] }) return () => obs.disconnect() }, []) return isLight } // ── Inner slide (fixed 1280×680) ────────────────────────────────────────────── function MilestonesInner({ t, de, sel, setSel }: { t: typeof THEMES.dark; de: boolean sel: Milestone | null setSel: (m: Milestone | null) => void }) { const doneCnt = useMemo(() => MILESTONES.filter(m => m.done).length, []) const total = MILESTONES.length return (
{/* Ambient glow */}
{t.stars ? : } {/* Progress indicator */}
{de ? 'Fortschritt' : 'Progress'}
{doneCnt} / {total}
{/* Tip */}
{de ? 'Tipp:' : 'Tip:'} {de ? 'Klick auf einen Meilenstein' : 'Click any milestone'}
{/* Timeline */}
{/* Stats */}
{STATS.map(s => )}
{/* Footer */}
{de ? 'Stand heute · live-Metriken aus der Plattform' : 'As of today · live metrics from the platform'}
setSel(null)} t={t} de={de} />
) } // ── Main slide ──────────────────────────────────────────────────────────────── const INNER_W = 1280 const INNER_H = 600 export default function MilestonesSlide({ lang }: MilestonesSlideProps) { const de = lang === 'de' const isLight = useIsLight() const t = isLight ? THEMES.light : THEMES.dark const [sel, setSel] = useState(null) const [scale, setScale] = useState(1) const containerRef = useRef(null) const calcScale = useCallback(() => { if (containerRef.current) { const w = containerRef.current.offsetWidth setScale(Math.min(w / INNER_W, 1)) } }, []) useEffect(() => { calcScale() const obs = new ResizeObserver(calcScale) if (containerRef.current) obs.observe(containerRef.current) return () => obs.disconnect() }, [calcScale]) return (

{de ? 'Meilensteine' : 'Milestones'}

{de ? 'Von der Idee zur GmbH — was wir bereits erreicht haben' : 'From idea to GmbH — what we have already achieved'}

) }