import React, { useState, useEffect, useRef } from 'react'; import { TerminalWindow } from './TerminalWindow'; export const MultiModelAnimation: React.FC = () => { const [stage, setStage] = useState(0); const containerRef = useRef(null); const [isVisible, setIsVisible] = useState(false); // Intersection Observer useEffect(() => { const observer = new IntersectionObserver( ([entry]) => { if (entry.isIntersecting) { setIsVisible(true); observer.disconnect(); } }, { threshold: 0.3 } ); if (containerRef.current) { observer.observe(containerRef.current); } return () => observer.disconnect(); }, []); // Animation Sequence useEffect(() => { if (!isVisible) return; const timeline = [ { s: 1, delay: 500 }, // Start typing command { s: 2, delay: 1300 }, // Opus line { s: 3, delay: 1900 }, // Sonnet line { s: 4, delay: 2500 }, // Haiku line { s: 5, delay: 3100 }, // Subagent line { s: 6, delay: 3600 }, // Connected success { s: 7, delay: 4200 }, // Draw lines { s: 8, delay: 5000 }, // Msg 1 { s: 9, delay: 5500 }, // Msg 2 { s: 10, delay: 6000 }, // Msg 3 { s: 11, delay: 7000 }, // Tagline 1 { s: 12, delay: 7500 }, // Tagline 2 { s: 13, delay: 8200 }, // Tagline 3 ]; let timeouts: ReturnType[] = []; timeline.forEach(step => { timeouts.push(setTimeout(() => setStage(step.s), step.delay)); }); return () => timeouts.forEach(clearTimeout); }, [isVisible]); return (
{/* Background Ambience */}
= 6 ? 'opacity-100' : 'opacity-0'}`} />
{/* Terminal Section */}
{/* Command */}
= 1 ? 'opacity-100' : 'opacity-0'}`}> claudish \
{/* Flags */}
= 2} flag="--model-opus" flagColor="text-purple-400" value="google/gemini-3-pro-preview" comment="Complex planning & vision" /> = 3} flag="--model-sonnet" flagColor="text-blue-400" value="openai/gpt-5.1-codex" comment="Main coding logic" /> = 4} flag="--model-haiku" flagColor="text-green-400" value="x-ai/grok-code-fast-1" comment="Fast context processing" /> = 5} flag="--model-subagent" flagColor="text-orange-400" value="minimax/minimax-m2" comment="Background worker agents" />
{/* Success State */}
= 6 ? 'opacity-100' : 'opacity-0'}`}>
Connection established to 4 distinct providers
Semantic complexity router: Active
{/* Ready State */}
= 6 ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-2'}`}> » Ready. Orchestrating multi-model mesh. = 13 ? 'hidden' : 'animate-cursor-blink'}`}>
{/* Visual Badges & Lines */}
{/* Connection Lines (SVG) */} {stage >= 7 && ( {/* Desktop: Connecting Top to Bottom */} {/* Mobile: Simple connections */} )} {/* Badges Grid */}
= 2} color="purple" role="PLANNING NODE" modelName="GEMINI 3" icon="◈" mapping="maps to --model-opus" /> = 3} color="blue" role="CODING NODE" modelName="GPT 5.1" icon="❖" mapping="maps to --model-sonnet" /> = 4} color="green" role="FAST NODE" modelName="GROK FAST" icon="⚡" mapping="maps to --model-haiku" /> = 5} color="orange" role="BACKGROUND" modelName="MINIMAX M2" icon="⟁" mapping="maps to --model-subagent" />
{/* Info Pills */}
= 8} text="Unified Context Window" delay={0} /> = 9} text="Standardized Tool Use" delay={100} /> = 10} text="Complexity Routing" delay={200} />
{/* Tagline Reveal */}
= 11 ? 'opacity-100' : 'opacity-0'} ${stage >= 13 ? 'text-gray-600 line-through decoration-gray-700' : 'text-gray-400'}`}> Not switching.
= 12 ? 'opacity-100' : 'opacity-0'} ${stage >= 13 ? 'text-gray-600 line-through decoration-gray-700' : 'text-gray-400'}`}> Not merging.
= 13 ? 'opacity-100 scale-110 blur-0' : 'opacity-0 scale-90 blur-md'}`}> Collaborating.
); }; // Helper: Command Row in Terminal const CommandRow: React.FC<{ visible: boolean; flag: string; flagColor: string; value: string; comment: string }> = ({ visible, flag, flagColor, value, comment }) => (
{flag} {value} # {comment}
); // Helper: Badge Component const Badge: React.FC<{ active: boolean; color: 'purple' | 'blue' | 'green' | 'orange'; role: string; modelName: string; icon: string; mapping: string; }> = ({ active, color, role, modelName, icon, mapping }) => { const colors = { purple: { border: 'border-purple-500', text: 'text-purple-400', bg: 'bg-purple-500/10', glow: 'shadow-purple-500/20' }, blue: { border: 'border-blue-500', text: 'text-blue-400', bg: 'bg-blue-500/10', glow: 'shadow-blue-500/20' }, green: { border: 'border-green-500', text: 'text-green-400', bg: 'bg-green-500/10', glow: 'shadow-green-500/20' }, orange: { border: 'border-orange-500', text: 'text-orange-400', bg: 'bg-orange-500/10', glow: 'shadow-orange-500/20' }, }; const c = colors[color]; return (
{role} {icon}
{modelName}
{mapping}
{/* Active Glow Line */}
); }; // Helper: Info Pill const InfoPill: React.FC<{ visible: boolean; text: string; delay: number }> = ({ visible, text, delay }) => (
{text}
);