Claude Code
Animated Claude Code CLI welcome screen — terminal window with a dashed welcome box, recent activity and what's new panels, and a prompt line that types a command with a block cursor. Dark/light themes.
Source
components/kuchi/claude-code.tsx
1"use client";23import { loadFont } from "@remotion/google-fonts/JetBrainsMono";4import {5 AbsoluteFill,6 interpolate,7 spring,8 useCurrentFrame,9 useVideoConfig,10} from "remotion";11import { Caret } from "@/components/kuchi/type-caret";12import { useTypewriter } from "@/lib/kuchi-kit";1314const { fontFamily: MONO_FAMILY } = loadFont();1516export interface ClaudeCodeProps {17 title?: string;18 userName?: string;19 model?: string;20 cwd?: string;21 placeholder?: string;22 prompt?: string;23 accentColor?: string;24 speed?: number;25}2627interface Theme {28 page: string;29 windowBar: string;30 windowBody: string;31 fg: string;32 fgMuted: string;33 fgDim: string;34 boxBorder: string;35}3637export const THEMES: Record<"light" | "dark", Theme> = {38 light: {39 page: "#E8E5DD",40 windowBar: "#D8D3CA",41 windowBody: "#FBFAF7",42 fg: "#1F1E1D",43 fgMuted: "#73726C",44 fgDim: "#A3A097",45 boxBorder: "#D97757",46 },47 dark: {48 page: "#2B2A28",49 windowBar: "#3A3633",50 windowBody: "#1B1A18",51 fg: "#E8E5DD",52 fgMuted: "#8A857C",53 fgDim: "#6B6660",54 boxBorder: "#D97757",55 },56};5758export const TYPING_START_FRAME = 48;5960export const TYPING_CPS = 18;6162export const WHATS_NEW: string[] = [63 "/agents to create subagents",64 "/security-review for review agent",65 "ctrl+b to background bashes",66];6768function introBounceIn(69 frame: number,70 fps: number,71): { translateY: number; scale: number } {72 const s = spring({73 fps,74 frame,75 config: { damping: 14, stiffness: 110, mass: 0.7 },76 });77 const translateY = interpolate(s, [0, 1], [28, 0]);78 const scale = interpolate(s, [0, 1], [0.97, 1]);79 return { translateY, scale };80}8182function fadeUpAt(83 frame: number,84 range: [number, number],85): { opacity: number; translateY: number } {86 const opts = {87 extrapolateLeft: "clamp" as const,88 extrapolateRight: "clamp" as const,89 };90 return {91 opacity: interpolate(frame, range, [0, 1], opts),92 translateY: interpolate(frame, range, [12, 0], opts),93 };94}9596function Mascot({ accent, size = 96 }: { accent: string; size?: number }) {97 return (98 <svg99 height={size}100 viewBox="0 0 24 24"101 width={size}102 xmlns="http://www.w3.org/2000/svg"103 >104 <title>Claude Code</title>105 <path106 clipRule="evenodd"107 d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"108 fill={accent}109 fillRule="evenodd"110 />111 </svg>112 );113}114115export function ClaudeCode({116 title = "Claude Code v2.0.0",117 userName = "Meaghan",118 model = "Opus 4.8 • Max 20x",119 cwd = "/users/meaghan/code/apps",120 placeholder = 'Try "edit <filepath> to ..."',121 prompt = "edit src/theme.ts to add a dark mode toggle",122 accentColor = "#D97757",123 speed = 1,124}: ClaudeCodeProps) {125 const frame = useCurrentFrame();126 const { width, height, fps } = useVideoConfig();127 const t = THEMES.dark;128129 const refW = 1280;130 const refH = 720;131 const stageScale = Math.min(width / refW, height / refH);132133 const tw = useTypewriter(prompt, {134 cps: TYPING_CPS,135 speed,136 startFrame: TYPING_START_FRAME,137 });138 const showText = tw.count > 0;139140 const intro = introBounceIn(frame * speed, fps);141 const leftFade = fadeUpAt(frame * speed, [6, 22]);142 const rightFade = fadeUpAt(frame * speed, [12, 30]);143 const promptFade = fadeUpAt(frame * speed, [18, 36]);144145 const border = accentColor;146147 const winLeft = 90;148 const winTop = 40;149 const winWidth = 1100;150 const winHeight = 620;151 const barHeight = 40;152153 return (154 <AbsoluteFill style={{ background: "transparent" }}>155 <div156 style={{157 position: "absolute",158 left: "50%",159 top: "50%",160 width: refW,161 height: refH,162 translate: "-50% -50%",163 scale: `${stageScale}`,164 }}165 >166 <div167 style={{168 position: "absolute",169 left: winLeft,170 top: winTop,171 width: winWidth,172 height: winHeight,173 background: t.windowBody,174 borderRadius: 12,175 overflow: "hidden",176 boxShadow: "0 24px 60px -20px rgba(0,0,0,0.6)",177 opacity: intro.scale,178 translate: `0 ${intro.translateY}px`,179 scale: `${intro.scale}`,180 transformOrigin: "center top",181 display: "flex",182 flexDirection: "column",183 boxSizing: "border-box",184 }}185 >186 <div187 style={{188 height: barHeight,189 background: t.windowBar,190 display: "flex",191 alignItems: "center",192 gap: 8,193 paddingLeft: 16,194 flexShrink: 0,195 }}196 >197 <div198 style={{199 width: 12,200 height: 12,201 borderRadius: "50%",202 background: "#FF5F57",203 }}204 />205 <div206 style={{207 width: 12,208 height: 12,209 borderRadius: "50%",210 background: "#FEBC2E",211 }}212 />213 <div214 style={{215 width: 12,216 height: 12,217 borderRadius: "50%",218 background: "#28C840",219 }}220 />221 </div>222223 <div224 style={{225 flex: 1,226 position: "relative",227 padding: 28,228 boxSizing: "border-box",229 display: "flex",230 flexDirection: "column",231 }}232 >233 <div234 style={{235 position: "relative",236 border: `1px dashed ${border}`,237 borderRadius: 6,238 padding: "28px 24px 24px",239 opacity: leftFade.opacity,240 translate: `0 ${leftFade.translateY}px`,241 }}242 >243 <span244 style={{245 position: "absolute",246 top: -11,247 left: 22,248 padding: "0 10px",249 background: t.windowBody,250 color: accentColor,251 fontFamily: MONO_FAMILY,252 fontSize: 16,253 fontWeight: 700,254 }}255 >256 {title}257 </span>258259 <div style={{ display: "flex", flexDirection: "row" }}>260 <div261 style={{262 width: "42%",263 display: "flex",264 flexDirection: "column",265 alignItems: "flex-start",266 gap: 16,267 paddingRight: 24,268 boxSizing: "border-box",269 }}270 >271 <div272 style={{273 fontFamily: MONO_FAMILY,274 fontSize: 20,275 color: t.fg,276 }}277 >278 Welcome back {userName}!279 </div>280 <div style={{ alignSelf: "center" }}>281 <Mascot accent={accentColor} />282 </div>283 <div284 style={{285 display: "flex",286 flexDirection: "column",287 gap: 4,288 }}289 >290 <div291 style={{292 fontFamily: MONO_FAMILY,293 fontSize: 15,294 color: t.fgMuted,295 }}296 >297 {model}298 </div>299 <div300 style={{301 fontFamily: MONO_FAMILY,302 fontSize: 15,303 color: t.fgMuted,304 }}305 >306 {cwd}307 </div>308 </div>309 </div>310311 <div312 style={{313 width: "58%",314 borderLeft: `1px dashed ${border}`,315 paddingLeft: 24,316 boxSizing: "border-box",317 display: "flex",318 flexDirection: "column",319 opacity: rightFade.opacity,320 translate: `0 ${rightFade.translateY}px`,321 }}322 >323 <div>324 <div325 style={{326 fontFamily: MONO_FAMILY,327 fontSize: 15,328 fontWeight: 700,329 color: accentColor,330 marginBottom: 10,331 }}332 >333 What's new334 </div>335 <div336 style={{337 display: "flex",338 flexDirection: "column",339 gap: 6,340 }}341 >342 {WHATS_NEW.map((line) => (343 <div344 key={line}345 style={{346 fontFamily: MONO_FAMILY,347 fontSize: 14,348 color: t.fg,349 }}350 >351 {line}352 </div>353 ))}354 <div355 style={{356 fontFamily: MONO_FAMILY,357 fontSize: 14,358 color: t.fgDim,359 }}360 >361 ... /help for more362 </div>363 </div>364 </div>365 </div>366 </div>367 </div>368369 <div style={{ height: 32 }} />370371 <div372 style={{373 opacity: promptFade.opacity,374 translate: `0 ${promptFade.translateY}px`,375 }}376 >377 <div378 style={{379 height: 1,380 background: t.fgDim,381 opacity: 0.4,382 marginBottom: 16,383 }}384 />385 <div386 style={{387 display: "flex",388 flexDirection: "row",389 alignItems: "center",390 fontFamily: MONO_FAMILY,391 fontSize: 17,392 whiteSpace: "pre",393 }}394 >395 <span style={{ color: t.fgMuted }}>{"> "}</span>396 {showText ? (397 <span398 style={{399 position: "relative",400 color: t.fg,401 display: "inline-flex",402 alignItems: "center",403 }}404 >405 {tw.text}406 <span style={{ opacity: 0.55, display: "inline-flex" }}>407 <Caret408 width={11}409 height={22}410 color={t.fg}411 blink={!tw.typing}412 speed={speed}413 marginLeft={2}414 />415 </span>416 </span>417 ) : (418 <span419 style={{420 position: "relative",421 color: t.fgMuted,422 display: "inline-flex",423 alignItems: "center",424 }}425 >426 <span style={{ opacity: 0.55, display: "inline-flex" }}>427 <Caret428 width={11}429 height={22}430 color={t.fg}431 blink={!tw.typing}432 speed={speed}433 />434 </span>435 <span style={{ marginLeft: 6 }}>{placeholder}</span>436 </span>437 )}438 </div>439 </div>440 </div>441 </div>442 </div>443 </AbsoluteFill>444 );445}







