{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "reel-wall",
  "title": "Reel Wall",
  "description": "Curved video wall for Remotion. A ring of vertical clips turns past in the dark: it eases in from rest on twos, then keeps turning at an even speed. The ring, lens and ease are fitted frame by frame from a reference recording.",
  "dependencies": [
    "remotion"
  ],
  "files": [
    {
      "path": "registry/snap-cn/reel-wall/index.tsx",
      "content": "// Reel Wall · snapcn — https://snapcn.dev/docs/scenes/reel-wall\n\"use client\";\n\nimport type { CSSProperties } from \"react\";\nimport {\n  Easing,\n  Freeze,\n  getRemotionEnvironment,\n  interpolate,\n  OffthreadVideo,\n  staticFile,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\n/**\n * A \"reel wall\": a curved wall of vertical clips turns past in the dark. It\n * eases in from rest, then keeps turning at an even speed for as long as the\n * composition runs.\n *\n * Replicated from a 24fps reference, fitted on its own frames. The wall is a\n * CSS 3D ring: every card is a plane `RING_R` in front of the ring's axis,\n * viewed through a `perspective` of `PERSPECTIVE` (median edge error 0.64px\n * against the recording). Lengths are reference pixels (`REF_W` wide) and scale\n * with the frame; the timeline is in 24fps frames.\n *\n * The wall moves \"on twos\": it holds every picture for two frames, like the\n * reference, which is part of its look. The opening fade runs on every frame.\n *\n * Like `announce-title` it paints a cinematic world rather than a surface — a\n * dark stage under clips — so it takes no `theme`/`mode`; its colours are props.\n */\n\nexport interface ReelWallProps {\n  /**\n   * Clips for the wall, left to right; they repeat around the ring. Video URLs\n   * play muted. Absolute URLs or paths under `public/`.\n   */\n  videos?: string[];\n  /** The page behind the wall. */\n  background?: string;\n  /** A card before its clip has a frame to show. */\n  cardColor?: string;\n  speed?: number;\n  className?: string;\n}\n\n/** Creator-style clips, 12s each, compressed. Absolute, because a root-relative\n *  default becomes `staticFile()` in a render and 404s in the project this file\n *  was just copied into. Ceiling: a clip shorter than the composition stops on\n *  its last frame — pass clips at least as long as the scene runs. */\nconst DEFAULT_VIDEOS = [1, 2, 3, 4, 5, 6].map(\n  (n) => `https://media.snapcn.dev/demos/stock/wall-${n}.mp4`,\n);\n\n// ─── Geometry, in reference pixels ────────────────────────────────────────────\nexport const REF_W = 716;\nconst REF_H = 398;\n/** The card, its ring and the lens. */\nexport const CARD = { w: 201.92, h: 349.09 } as const;\nexport const RING_R = 1837.36;\nexport const PERSPECTIVE = 446.54;\n/** Angle between neighbouring cards, radians. */\nexport const PITCH = 0.1328;\n/** Perspective origin, from the top-left of the frame. */\nexport const ORIGIN = { x: 356.76, y: 197.99 } as const;\n\n// ─── Timeline (24fps frames) ──────────────────────────────────────────────────\n/** Where the fitted ease hands over to an even turn, in 12fps steps. */\nconst CRUISE_AT = 52;\n/** The ease-in, radians over 12fps steps: a cubic-bezier fitted to 53 measured\n *  steps (0.31px RMS). Valid up to `CRUISE_AT`; past it the bezier overshoots. */\nconst easeIn = (step: number) =>\n  interpolate(step, [0, 67.8], [-0.0497, -0.2656], {\n    extrapolateLeft: \"clamp\",\n    extrapolateRight: \"clamp\",\n    easing: Easing.bezier(0.344, 0.0049, 0.7833, 1.3384),\n  });\n/** Turn per step once cruising: the ease's own speed where it hands over. */\nconst CRUISE = easeIn(CRUISE_AT) - easeIn(CRUISE_AT - 1);\n\n/** The wall's turn at a 12fps step: the fitted ease-in, then an even turn. */\nexport const wallTurn = (step: number) =>\n  step <= CRUISE_AT\n    ? easeIn(step)\n    : easeIn(CRUISE_AT) + (step - CRUISE_AT) * CRUISE;\n\n/** The opening fade-in: a black veil that clears in 9 frames. */\nexport const veil = (f: number) =>\n  f >= 9 ? 0 : 0.142 * (1 - Math.max(f, 0) / 9) ** 3.7;\n\n/** Hold every picture for two frames: 0, 1, 1, 3, 3, 5, … */\nconst onTwos = (f: number) => (f < 1 ? 0 : Math.floor((f - 1) / 2) * 2 + 1);\n\nfunction resolveSrc(src: string): string {\n  const isLocal = src.startsWith(\"/\") && !src.startsWith(\"//\");\n  if (!isLocal || getRemotionEnvironment().isPlayer) return src;\n  // A value that already came out of staticFile() carries the static base.\n  const base = staticFile(\"_\").slice(0, -2);\n  if (base && src.startsWith(`${base}/`)) return src;\n  try {\n    return staticFile(src.replace(/^\\/+/, \"\"));\n  } catch {\n    return src;\n  }\n}\n\nconst cover: CSSProperties = {\n  width: \"100%\",\n  height: \"100%\",\n  // Preflight's `img { max-width: 100% }` collapses a box sized by its parent.\n  maxWidth: \"none\",\n  objectFit: \"cover\",\n  display: \"block\",\n};\n\nexport function ReelWall({\n  videos = DEFAULT_VIDEOS,\n  background = \"#0e0e0e\",\n  cardColor = \"#1a1a1a\",\n  speed = 1,\n  className,\n}: ReelWallProps) {\n  const { width, height, fps } = useVideoConfig();\n  const frame = useCurrentFrame() * ((speed * 24) / fps);\n  const u = width / REF_W;\n  // The reference frame is a hair wider than 16:9; centre it vertically.\n  const dy = (height - REF_H * u) / 2;\n\n  const held = onTwos(Math.floor(frame));\n  const theta = wallTurn((held + 1) / 2);\n  // Only the cards within reach of the lens; the rest are behind the frame.\n  const first = Math.floor((-theta - 0.6) / PITCH);\n  const n = videos.length;\n\n  return (\n    <div\n      className={className}\n      style={{\n        position: \"absolute\",\n        inset: 0,\n        overflow: \"hidden\",\n        backgroundColor: background,\n      }}\n    >\n      <div\n        style={{\n          position: \"absolute\",\n          left: 0,\n          top: dy,\n          width,\n          height: REF_H * u,\n          perspective: PERSPECTIVE * u,\n          perspectiveOrigin: `${ORIGIN.x * u}px ${ORIGIN.y * u}px`,\n        }}\n      >\n        {/* The page: lit from the middle, falling to black at the sides. */}\n        <div\n          style={{\n            position: \"absolute\",\n            inset: 0,\n            background:\n              \"radial-gradient(ellipse 60% 75% at 50% 50%, rgba(0,0,0,0) 0%, rgba(0,0,0,0.45) 70%, rgba(0,0,0,0.92) 100%)\",\n          }}\n        />\n        {Array.from({ length: 10 }, (_, i) => first + i).map((k) => {\n          const src = n ? videos[((k % n) + n) % n] : undefined;\n          return (\n            <div\n              key={k}\n              style={{\n                position: \"absolute\",\n                left: (ORIGIN.x - CARD.w / 2) * u,\n                top: (ORIGIN.y - CARD.h / 2) * u,\n                width: CARD.w * u,\n                height: CARD.h * u,\n                overflow: \"hidden\",\n                backgroundColor: cardColor,\n                transform: `translateZ(${-RING_R * u}px) rotateY(${theta + k * PITCH}rad) translateZ(${RING_R * u}px)`,\n              }}\n            >\n              {src && (\n                // The clips hold on twos with the wall.\n                <Freeze frame={held}>\n                  <OffthreadVideo src={resolveSrc(src)} muted style={cover} />\n                </Freeze>\n              )}\n            </div>\n          );\n        })}\n      </div>\n\n      {veil(frame) > 0 && (\n        <div\n          style={{\n            position: \"absolute\",\n            inset: 0,\n            background: \"#000\",\n            opacity: veil(frame),\n          }}\n        />\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/snap-cn/reel-wall.tsx"
    }
  ],
  "docs": "Docs and props: https://snapcn.dev/docs/scenes/reel-wall?ref=cli — pass your own vertical clips as videos; they repeat around the ring. — 82 Pro components too — charts, launch scenes, device shots: https://snapcn.dev/docs/pricing?ref=cli-docs",
  "type": "registry:component"
}
