/* global React */ const { useState: stS, useEffect: stE, useMemo: stM, useRef: stR } = React; // 8 Frage/Antwort-Paare — kurz, on-brand, monochrom rendert const STREAM_PAIRS = [ { kind: 'typewriter', label: 'Typewriter', q: 'Wann startet ein Projekt?', a: 'Audit in 2 Wochen, Build ab Woche 3.' }, { kind: 'words', label: 'Word fade', q: 'Was kostet ein Retainer?', a: 'Ab €18.000 pro Monat für ein 3er-Team.' }, { kind: 'tokens', label: 'Token chunks',q: 'Welches Modell läuft?', a: 'Claude Code fürs Reasoning, GPT-5 für Sprache.' }, { kind: 'blur', label: 'Blur reveal', q: 'Bekomme ich Logs?', a: 'Ja, jeder Agent-Call ist einsehbar.' }, { kind: 'cascade', label: 'Cascade', q: 'Wer arbeitet am Projekt?', a: 'Senior-Team. Kein Outsourcing, kein Praktikant.' }, { kind: 'lines', label: 'Line slide', q: 'Wie reportet ihr?', a: 'Wöchentlich KPIs.\nMonatlich Strategie.\nQuartalsweise Audit.' }, { kind: 'decode', label: 'Decode', q: 'Was bekomme ich am Ende?', a: 'Code, Doku, Training — alles übergebbar.' }, { kind: 'drop', label: 'Drop in', q: 'Was, wenn AI nicht passt?', a: 'Sagen wir dir im Audit.' }, ]; // ---------- Renderer ---------- function STypewriter({ text }) { const [n, setN] = stS(0); stE(() => { if (n >= text.length) return; const t = setTimeout(() => setN(x => x + 1), 30 + (text[n] === ' ' ? 40 : 0)); return () => clearTimeout(t); }, [n, text]); const done = n >= text.length; return {text.slice(0, n)}{!done && ▌}; } function SWords({ text }) { const words = text.split(' '); return {words.map((w, i) => {w}{i < words.length - 1 ? '\u00A0' : ''} )}; } function STokens({ text }) { const chunks = stM(() => { const out = []; let i = 0; while (i < text.length) { const len = 2 + Math.floor(Math.random() * 4); // 2–5 out.push(text.slice(i, i + len)); i += len; } return out; }, [text]); const [n, setN] = stS(0); stE(() => { if (n >= chunks.length) return; const t = setTimeout(() => setN(x => x + 1), 70 + Math.random() * 70); return () => clearTimeout(t); }, [n, chunks]); const done = n >= chunks.length; return {chunks.slice(0, n).join('')}{!done && ▌}; } function SCascade({ text }) { return {[...text].map((c, i) => {c === ' ' ? '\u00A0' : c} )}; } function SBlur({ text }) { const words = text.split(' '); return {words.map((w, i) => {w}{i < words.length - 1 ? '\u00A0' : ''} )}; } const SCRAMBLE_GLYPHS = '/\\<>{}[]+=-#$%&*?'; function SScramble({ text }) { const [tick, setTick] = stS(0); stE(() => { const id = setInterval(() => setTick(t => t + 1), 30); return () => clearInterval(id); }, []); const out = [...text].map((c, i) => { if (c === ' ' || c === '\n' || c === ',' || c === '.') return c; const start = i * 2; const end = start + 7; if (tick < start) return '\u00A0'; if (tick >= end) return c; return SCRAMBLE_GLYPHS[Math.floor(Math.random() * SCRAMBLE_GLYPHS.length)]; }); return {out.join('')}; } function SWipe({ text }) { return {text}{text}; } function SLines({ text }) { const lines = text.split('\n'); return <>{lines.map((l, i) =>
Acht Mikro-Patterns. Eine Frage. Was passiert, während die Maschine denkt.