Glass Code Walk

A camera that scans a glass code block top to bottom as it types, then pulls back to a centered hold

Installation

$ pnpm dlx shadcn@latest add @remocn/glass-code-walk

Usage

// src/Root.tsx
import { Composition } from "remotion";
import { GlassCodeWalk } from "@/components/remocn/glass-code-walk";

const GlassCodeWalkScene = () => (
  <GlassCodeWalk
    title="scene.tsx"
    code={`export function Intro() {\n  return <h1>Ship it</h1>;\n}`}
  />
);

export const RemotionRoot = () => (
  <Composition
    id="GlassCodeWalk"
    component={GlassCodeWalkScene}
    durationInFrames={150}
    fps={30}
    width={1280}
    height={720}
  />
);

The camera mirrors glass-code-block's line layout to keep the revealing line pinned, so it pairs with that component — npx shadcn add @remocn/glass-code-walk pulls it in automatically. Renders transparent; supply the background with Backdrop so the glass has an image to refract.

Props

PropTypeDefaultDescription
code
stringSource code to render. Newlines split into lines the camera scans.
title
string"scene.tsx"Filename shown in the chrome bar
width
number880Glass block width in pixels; centering and the camera pin derive from it
height
number420Glass block height in pixels
fontSize
number18Code font size in pixels; line geometry is derived from it
staggerFrames
number10Frames between each line's reveal; the camera scan tracks the same cadence
zoom
number2.6Camera scale while scanning before the pull-back to centered
speed
number1Playback multiplier applied to both the reveal and the camera
className
stringOptional className passed to the outer container