import React from 'react'; import { useCurrentFrame } from 'remotion'; import { colors, fonts } from '../lib/theme'; type OverlayChar = { char: string; confirmed: boolean; }; type TerminalScreenProps = { typed: string; cursorVisible: boolean; overlayChars?: OverlayChar[]; fontSize?: number; }; /** * Renders a terminal area styled exactly like the real Codeman xterm.js terminal. * Background #0d0d0d, Fira Code font, block cursor, Claude Code prompt. */ export const TerminalScreen: React.FC = ({ typed, cursorVisible, overlayChars, fontSize = 28, }) => { const frame = useCurrentFrame(); // Block cursor — solid, no blink (matches Codeman's cursorBlink: false) const cursorOn = cursorVisible; // But add a subtle blink for video clarity so viewers notice it const cursorOpacity = cursorOn ? (Math.floor(frame / 20) % 2 === 0 ? 0.9 : 0.6) : 0; const lineHeight = Math.round(fontSize * 1.35); const charWidth = fontSize * 0.6; return (
{/* Previous terminal output lines (fake history for realism) */}
❯ claude --dangerously-skip-permissions
╭────────────────────────────────────╮
│ Claude Code session active │
╰────────────────────────────────────╯
{/* Active prompt line — this is where the typing happens */}
{/* Prompt character */} ❯ {/* Typed text */} {overlayChars ? ( // Zerolag mode: show overlay chars with confirmed/unconfirmed color overlayChars.map((oc, i) => ( {oc.char} )) ) : ( {typed} )} {/* Block cursor */}
); };