{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "round-slam",
  "title": "Round Slam",
  "description": "'ROUND 1' slams in, then 'SHIP!' punches over a red slashed band.",
  "dependencies": ["remotion", "@remotion/google-fonts"],
  "files": [
    {
      "path": "registry/remocn/round-slam/index.tsx",
      "content": "\"use client\";\n\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport { loadFont } from \"@remotion/google-fonts/Unbounded\";\nimport type React from \"react\";\nimport {\n  AbsoluteFill,\n  Easing,\n  interpolate,\n  useCurrentFrame,\n  useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: display } = loadFont(\"normal\", {\n  weights: [\"400\", \"500\"],\n  subsets: [\"latin\"],\n});\nconst manrope = loadManrope(\"normal\", {\n  weights: [\"600\"],\n  subsets: [\"latin\"],\n});\n\nconst REMOCN_R_PATH =\n  \"M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z\";\n\n/** Full logo as on remocn.dev: R mark (0.76em tall, baseline-aligned) + \"emocn\" in Manrope 600. */\nfunction RemocnLogo({ fontSize, color }: { fontSize: number; color: string }) {\n  return (\n    <div\n      style={{\n        display: \"flex\",\n        alignItems: \"baseline\",\n        color,\n        fontFamily: manrope.fontFamily,\n        fontWeight: 600,\n        fontSize,\n        letterSpacing: \"-0.025em\",\n        lineHeight: 1,\n      }}\n    >\n      <svg\n        viewBox=\"0 0 124.06 134.26\"\n        style={{ height: \"0.76em\", width: \"auto\" }}\n        aria-hidden\n      >\n        <path fill=\"currentColor\" d={REMOCN_R_PATH} />\n      </svg>\n      <span style={{ marginLeft: \"0.04em\" }}>emocn</span>\n    </div>\n  );\n}\n\nexport interface RoundSlamProps {\n  /** The round call, slammed in first in two hits (\"ROUND\" then \"1\"). */\n  round?: string;\n  /** The finisher word, punched in bigger and cracked open by the slashes. */\n  call?: string;\n  /** One of the thin speed slashes. */\n  accent?: string;\n  theme?: \"dark\" | \"light\";\n  speed?: number;\n}\n\n// Beat sheet (30fps, speed 1):\n//   0–6    \"ROUND\" slams in from 1.9× with two echo ghosts; small shake on landing\n//   6–12   the round number slams in from 2.6×; frame 12 is the impact frame\n//          (one inverted frame) and the camera shakes for 10 frames\n//  12–34   hold with a slow push\n//  34–43   the round call ducks up to a label above the stage\n//  38–44   the call word punches in from 2.8×; frame 44 is the second impact:\n//          inverted frame, bigger shake, the word splits along a diagonal crack\n//  44–53   speed slashes crack outward from the centre, the main \"chrome\" band\n//          opens behind the word\n//  56–66   the logo rises in under the band; poster hold to the end\nconst ROUND_AT = 0;\nconst ROUND_LEN = 6;\nconst NUM_AT = 6;\nconst NUM_LEN = 6;\nconst DUCK_AT = 34;\nconst DUCK_LEN = 9;\nconst CALL_AT = 38;\nconst CALL_LEN = 6;\nconst LOGO_AT = 56;\n\n// Steep cuts slashed through the band, outside the word.\nconst CUTS = [\n  { x: -0.43, w: 22, delay: 0 },\n  { x: -0.385, w: 7, delay: 1 },\n  { x: 0.4, w: 14, delay: 2 },\n];\n\nconst SLAM = Easing.bezier(0.12, 0.9, 0.25, 1);\nconst OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst INOUT = Easing.bezier(0.65, 0, 0.25, 1);\nconst CLAMP = {\n  extrapolateLeft: \"clamp\",\n  extrapolateRight: \"clamp\",\n} as const;\n\n// gradients.sh \"chrome\": bg #050203, [#e0202e, #ffd6b8, #4fe3f0].\nconst CHROME = [\"#E0202E\", \"#FFD6B8\", \"#4FE3F0\"] as const;\n\nconst THEMES = {\n  dark: {\n    stage: \"#0A0A0B\",\n    ink: \"#F3F2EF\",\n    dim: \"#8A8990\",\n    slashA: CHROME[2],\n    slashB: CHROME[1],\n    logo: \"#F3F2EF\",\n  },\n  light: {\n    stage: \"#F5F4F0\",\n    ink: \"#121214\",\n    dim: \"#7E7D77\",\n    slashA: \"#1F8FA0\",\n    slashB: CHROME[0],\n    logo: \"#121214\",\n  },\n} as const;\n\nfunction ramp(t: number, from: number, len: number) {\n  return interpolate(t, [from, from + len], [0, 1], CLAMP);\n}\n\n/** Decaying camera shake that starts at `at`, stepped per frame like a game hit-stop. */\nfunction shake(t: number, at: number, len: number, amp: number) {\n  const d = Math.floor(t - at);\n  if (d < 0 || d >= len) return { x: 0, y: 0 };\n  const k = (1 - d / len) ** 2;\n  return {\n    x: amp * k * Math.sin(d * 2.4 + 0.6),\n    y: amp * 0.6 * k * Math.cos(d * 3.1 + 0.3),\n  };\n}\n\n/**\n * A slash with pointed tips, running along the x axis of the (rotated) stage.\n * `reach` is how far it has cracked out from the centre, 0–1.\n */\nfunction slashPoly(\n  cx: number,\n  cy: number,\n  thick: number,\n  half: number,\n  reach: number,\n  tip: number,\n) {\n  const r = half * reach;\n  const top = cy - thick / 2;\n  const bot = cy + thick / 2;\n  return `polygon(${cx - r - tip}px ${cy}px, ${cx - r}px ${top}px, ${cx + r}px ${top}px, ${cx + r + tip}px ${cy}px, ${cx + r}px ${bot}px, ${cx - r}px ${bot}px)`;\n}\n\nexport function RoundSlam({\n  round = \"ROUND 1\",\n  call = \"SHIP!\",\n  accent = \"#3B5BFD\",\n  theme = \"dark\",\n  speed = 1,\n}: RoundSlamProps) {\n  const t = useCurrentFrame() * speed;\n  const { width: W, height: H } = useVideoConfig();\n  const c = THEMES[theme];\n  const u = Math.min(W / 1280, H / 720);\n\n  const words = round.trim().split(/\\s+/);\n  const head = words.length > 1 ? words.slice(0, -1).join(\" \") : round;\n  const tail = words.length > 1 ? words[words.length - 1] : \"\";\n\n  // ── Impact frames ─────────────────────────────────────────────────────────\n  const numHit = NUM_AT + NUM_LEN;\n  const callHit = CALL_AT + CALL_LEN;\n  const inverted =\n    (t >= numHit && t < numHit + speed) ||\n    (t >= callHit && t < callHit + speed);\n  const s1 = shake(t, ROUND_AT + ROUND_LEN, 5, 5 * u);\n  const s2 = shake(t, numHit, 10, 13 * u);\n  const s3 = shake(t, callHit, 14, 20 * u);\n  const camX = s1.x + s2.x + s3.x;\n  const camY = s1.y + s2.y + s3.y;\n  const push = interpolate(t, [numHit, DUCK_AT], [1, 1.035], CLAMP);\n  const settle = interpolate(t, [callHit, callHit + 70], [1, 1.025], CLAMP);\n\n  // ── Round call ────────────────────────────────────────────────────────────\n  const roundFs = 150 * u;\n  const roundScale = (d: number) =>\n    1.9 - 0.9 * SLAM(ramp(d, ROUND_AT, ROUND_LEN));\n  const numScale = (d: number) => 2.6 - 1.6 * SLAM(ramp(d, NUM_AT, NUM_LEN));\n  const duck = INOUT(ramp(t, DUCK_AT, DUCK_LEN));\n  const roundY = interpolate(duck, [0, 1], [0.5 * H, 0.205 * H]);\n  const roundK = interpolate(duck, [0, 1], [push, 0.36]);\n\n  // ── Call word and the band ────────────────────────────────────────────────\n  const callFs = 250 * u;\n  const callY = 0.54 * H;\n  const callScale = (d: number) => 2.8 - 1.8 * SLAM(ramp(d, CALL_AT, CALL_LEN));\n  const callOp = ramp(t, CALL_AT, 3);\n  const crack = Math.max(0, 1 - Math.max(0, t - callHit) / 9);\n  const crackOff = t >= callHit ? 30 * u * crack * crack : 0;\n\n  const half = 0.72 * W;\n  const bandOpen = OUT(ramp(t, callHit + 1, 9));\n  const bandThick = interpolate(bandOpen, [0, 1], [6 * u, 0.4 * H]);\n  const bandReach = OUT(ramp(t, callHit, 5));\n  const drift = interpolate(t, [callHit, callHit + 80], [0, 10], CLAMP);\n\n  const slashes = [\n    { dy: -0.27 * H, thick: 7 * u, delay: 0, fill: c.slashA },\n    { dy: -0.235 * H, thick: 3 * u, delay: 2, fill: accent },\n    { dy: 0.24 * H, thick: 11 * u, delay: 1, fill: c.slashB },\n    { dy: 0.275 * H, thick: 3 * u, delay: 3, fill: c.slashA },\n  ];\n\n  const bandGround = [\n    `radial-gradient(38% 55% at ${30 + drift}% 34%, ${CHROME[1]}e6 0%, transparent 62%)`,\n    `radial-gradient(55% 80% at ${68 - drift}% 68%, #FF3B4Acc 0%, transparent 70%)`,\n    `linear-gradient(100deg, #4A0610 4%, ${CHROME[0]} 30%, #C0142A 64%, #2E0410 96%)`,\n  ].join(\", \");\n\n  const logoP = OUT(ramp(t, LOGO_AT, 10));\n\n  const word = (\n    text: string,\n    fs: number,\n    color: string,\n    extra?: React.CSSProperties,\n  ) => (\n    <div\n      style={{\n        fontFamily: display,\n        fontWeight: 500,\n        fontSize: fs,\n        lineHeight: 1,\n        letterSpacing: \"-0.02em\",\n        color,\n        whiteSpace: \"nowrap\",\n        ...extra,\n      }}\n    >\n      {text}\n    </div>\n  );\n\n  // The call word, sliced on a diagonal so the two halves can crack apart.\n  const cutTop = `polygon(0 0, 100% 0, 100% 38%, 0 62%)`;\n  const cutBot = `polygon(0 62%, 100% 38%, 100% 100%, 0 100%)`;\n  const callBox = (scale: number, opacity: number, key: string) => (\n    <div\n      key={key}\n      style={{\n        position: \"absolute\",\n        left: 0,\n        width: W,\n        top: callY - callFs * 0.6,\n        height: callFs * 1.2,\n        transform: `scale(${scale})`,\n        opacity,\n      }}\n    >\n      {(crackOff > 0.01 ? [cutTop, cutBot] : [\"none\"]).map((clip, i) => (\n        <div\n          key={clip}\n          style={{\n            position: \"absolute\",\n            inset: 0,\n            display: \"flex\",\n            alignItems: \"center\",\n            justifyContent: \"center\",\n            clipPath: clip === \"none\" ? undefined : clip,\n            transform: `translateX(${i === 0 ? crackOff : -crackOff}px)`,\n          }}\n        >\n          {word(\n            call,\n            callFs,\n            theme === \"dark\" ? \"#FFFFFF\" : bandOpen > 0.5 ? \"#FFFFFF\" : c.ink,\n            {\n              paddingTop: callFs * 0.06,\n            },\n          )}\n        </div>\n      ))}\n    </div>\n  );\n\n  return (\n    <AbsoluteFill style={{ background: c.stage, overflow: \"hidden\" }}>\n      <div\n        style={{\n          position: \"absolute\",\n          inset: 0,\n          background: c.stage,\n          filter: inverted ? \"invert(1)\" : undefined,\n        }}\n      >\n        <div\n          style={{\n            position: \"absolute\",\n            inset: 0,\n            transform: `translate(${camX}px, ${camY}px) rotate(-6deg) scale(${settle})`,\n            transformOrigin: \"50% 50%\",\n          }}\n        >\n          {/* The chrome band and slashes crack open behind the call word. */}\n          {t >= callHit ? (\n            <>\n              <div\n                style={{\n                  position: \"absolute\",\n                  inset: `${-0.2 * H}px ${-0.2 * W}px`,\n                  clipPath: slashPoly(\n                    W / 2 + 0.2 * W,\n                    callY + 0.2 * H,\n                    bandThick,\n                    half,\n                    bandReach,\n                    bandThick * 0.9,\n                  ),\n                  background: bandGround,\n                }}\n              />\n              {CUTS.map((k) => {\n                const x = W / 2 + k.x * W;\n                const top = callY - bandThick / 2 - 2;\n                const bot = callY + bandThick / 2 + 2;\n                const lean = 0.32 * bandThick;\n                const w = k.w * u;\n                const p = OUT(ramp(t, callHit + 2 + k.delay, 5));\n                const yEnd = top + (bot - top) * p;\n                const xAt = (y: number) =>\n                  x + lean - ((y - top) / (bot - top)) * 2 * lean;\n                return (\n                  <div\n                    key={k.x}\n                    style={{\n                      position: \"absolute\",\n                      inset: 0,\n                      clipPath: `polygon(${xAt(top)}px ${top}px, ${xAt(top) + w}px ${top}px, ${xAt(yEnd) + w}px ${yEnd}px, ${xAt(yEnd)}px ${yEnd}px)`,\n                      background: c.stage,\n                    }}\n                  />\n                );\n              })}\n              {slashes.map((s) => {\n                const reach = OUT(ramp(t, callHit + s.delay, 6));\n                return (\n                  <div\n                    key={s.dy}\n                    style={{\n                      position: \"absolute\",\n                      inset: 0,\n                      clipPath: slashPoly(\n                        W / 2,\n                        callY + s.dy,\n                        s.thick,\n                        half,\n                        reach,\n                        60 * u,\n                      ),\n                      background: s.fill,\n                    }}\n                  />\n                );\n              })}\n            </>\n          ) : null}\n\n          {/* Round call: echoes trail the slam, then it ducks to a label. */}\n          {[4, 2, 0].map((lag) => {\n            const tt = t - lag;\n            const ghost = lag > 0;\n            const headK = roundScale(tt);\n            const numK = numScale(tt);\n            const headOp = ramp(tt, ROUND_AT, 2) * (ghost ? 0.18 / lag : 1);\n            const numOp = ramp(tt, NUM_AT, 2) * (ghost ? 0.18 / lag : 1);\n            if (ghost && t > numHit + lag) return null;\n            return (\n              <div\n                key={lag}\n                style={{\n                  position: \"absolute\",\n                  left: 0,\n                  width: W,\n                  top: roundY - roundFs * 0.6,\n                  height: roundFs * 1.2,\n                  display: \"flex\",\n                  alignItems: \"center\",\n                  justifyContent: \"center\",\n                  gap: 0.32 * roundFs,\n                  transform: `scale(${ghost ? 1 : roundK})`,\n                }}\n              >\n                {word(head, roundFs, c.ink, {\n                  transform: `scale(${headK})`,\n                  opacity: headOp,\n                  paddingTop: roundFs * 0.06,\n                })}\n                {tail\n                  ? word(tail, roundFs, c.ink, {\n                      transform: `scale(${numK})`,\n                      opacity: numOp,\n                      paddingTop: roundFs * 0.06,\n                    })\n                  : null}\n              </div>\n            );\n          })}\n\n          {/* Call word with echoes. */}\n          {t >= CALL_AT\n            ? [4, 2].map((lag) =>\n                t < callHit + lag\n                  ? callBox(\n                      callScale(t - lag),\n                      ramp(t - lag, CALL_AT, 3) * (0.2 / lag),\n                      `g${lag}`,\n                    )\n                  : null,\n              )\n            : null}\n          {t >= CALL_AT ? callBox(callScale(t), callOp, \"call\") : null}\n        </div>\n\n        {/* Logo under the band. */}\n        <div\n          style={{\n            position: \"absolute\",\n            left: 0,\n            width: W,\n            top: 0.885 * H,\n            display: \"flex\",\n            justifyContent: \"center\",\n            opacity: logoP,\n            transform: `translateY(${(1 - logoP) * 18 * u}px)`,\n          }}\n        >\n          <RemocnLogo fontSize={34 * u} color={c.logo} />\n        </div>\n      </div>\n    </AbsoluteFill>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/remocn/round-slam.tsx"
    }
  ],
  "type": "registry:component"
}
