Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "terminal-cursor-zoom",
"title": "Terminal Cursor Zoom",
"description": "Camera locked to the typing cursor, dollying across a terminal as a command types at high zoom.",
"dependencies": ["remotion"],
"registryDependencies": ["@remocn/terminal-simulator"],
"files": [
{
"path": "registry/remocn/terminal-cursor-zoom/index.tsx",
"content": "\"use client\";\n\nimport { AbsoluteFill, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { TerminalSimulator } from \"@/components/remocn/terminal-simulator\";\n\nexport interface TerminalCursorZoomProps {\n command?: string;\n zoom?: number;\n fontSize?: number;\n prompt?: string;\n title?: string;\n charsPerFrame?: number;\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst WINDOW_WIDTH = 900;\nconst WINDOW_HEIGHT = 480;\nconst CONTENT_PADDING = 20;\nconst CHROME_HEIGHT = 40;\nconst PROMPT_GAP = 8;\nconst FIRST_LINE_FRAME = 10;\n\nexport function TerminalCursorZoom({\n command = \"npx shadcn add @remocn/terminal-cursor-zoom\",\n zoom = 2.8,\n fontSize = 20,\n prompt = \"$\",\n title = \"~/code/remocn-demo\",\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalCursorZoomProps) {\n const frame = useCurrentFrame();\n\n const charWidth = fontSize * 0.6;\n const windowLeft = (STAGE_WIDTH - WINDOW_WIDTH) / 2;\n const windowTop = (STAGE_HEIGHT - WINDOW_HEIGHT) / 2;\n const textStartX =\n windowLeft + CONTENT_PADDING + prompt.length * charWidth + PROMPT_GAP;\n const lineHeight = Math.round(fontSize * 1.6);\n const cursorY = windowTop + CHROME_HEIGHT + CONTENT_PADDING + lineHeight / 2;\n\n const lineStart = Math.round(FIRST_LINE_FRAME / speed);\n const localFrame = (frame - lineStart) * speed;\n const linearRevealed = Math.floor(\n interpolate(\n localFrame,\n [0, command.length / charsPerFrame],\n [0, command.length],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n ),\n );\n const revealed = Math.min(\n command.length,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n\n const cursorX = textStartX + revealed * charWidth;\n const tx = STAGE_WIDTH / 2 - zoom * cursorX;\n const ty = STAGE_HEIGHT / 2 - zoom * cursorY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n translate: `${tx}px ${ty}px`,\n scale: `${zoom}`,\n transformOrigin: \"0 0\",\n }}\n >\n <TerminalSimulator\n lines={[{ text: command, type: \"command\", delay: 0 }]}\n prompt={prompt}\n title={title}\n fontSize={fontSize}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/terminal-cursor-zoom.tsx"
}
],
"type": "registry:component"
}