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": "sequel-numeral",
"title": "Sequel Numeral",
"description": "The remocn wordmark opens beside a giant red numeral 2 with 'Part two. Out now.'.",
"dependencies": ["remotion", "@remotion/google-fonts"],
"files": [
{
"path": "registry/remocn/sequel-numeral/index.tsx",
"content": "\"use client\";\n\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport { loadFont as loadRubik } from \"@remotion/google-fonts/Rubik\";\nimport { useEffect, useRef, useState } from \"react\";\nimport {\n AbsoluteFill,\n continueRender,\n delayRender,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst rubik = loadRubik(\"normal\", {\n weights: [\"400\", \"500\"],\n subsets: [\"latin\"],\n});\nconst manrope = loadManrope(\"normal\", {\n weights: [\"600\"],\n subsets: [\"latin\"],\n});\n\nexport interface SequelNumeralProps {\n name?: string;\n numeral?: string;\n tagline?: string;\n accent?: string;\n background?: string;\n speed?: number;\n theme?: \"dark\" | \"light\";\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\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 whiteSpace: \"pre\",\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\nconst RED = \"#E60012\";\n\nconst THEMES = {\n dark: { bg: \"#000000\", ink: \"#FFFFFF\", soft: \"rgba(255,255,255,0.64)\" },\n light: { bg: \"#FFFFFF\", ink: \"#000000\", soft: \"rgba(0,0,0,0.6)\" },\n} as const;\n\nconst NUM_TRACK = -0.03;\nconst LOGO_CAP = 0.76;\nconst SUP = 0.52;\n\nconst NAME_AT = 0;\nconst SUP_AT = 10;\nconst DROP_AT = 42;\nconst DROP_LEN = 10;\nconst GROW_AT = 50;\nconst SETTLE_LEN = 26;\nconst TAG_AT = 82;\n\nconst EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst EASE_DROP = Easing.bezier(0.55, 0, 0.25, 1);\nconst CLAMP = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n} as const;\n\ninterface Metrics {\n name: number;\n nameBase: number;\n num: number;\n numCap: number;\n numBase: number;\n tagline: number;\n}\n\nconst isRemocn = (name: string) => name.trim().toLowerCase() === \"remocn\";\n\nconst baseOf = (asc: number, desc: number) => (1 - (asc + desc)) / 2 + asc;\n\nfunction measure(name: string, numeral: string, tagline: string): Metrics {\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) throw new Error(\"sequel-numeral: no 2d context\");\n ctx.font = `600 100px \"${manrope.fontFamily}\"`;\n const nameText = isRemocn(name) ? \"emocn\" : name;\n const nameRaw =\n ctx.measureText(nameText).width / 100 - 0.025 * nameText.length;\n const nameW = isRemocn(name)\n ? nameRaw + 0.04 + (LOGO_CAP * 124.06) / 134.26\n : nameRaw;\n const nm = ctx.measureText(\"e\");\n const nameBase = baseOf(\n nm.fontBoundingBoxAscent / 100,\n nm.fontBoundingBoxDescent / 100,\n );\n\n ctx.font = `500 100px \"${rubik.fontFamily}\"`;\n const nmText = numeral || \"2\";\n const fm = ctx.measureText(nmText);\n const num =\n fm.width / 100 + NUM_TRACK * Math.max(0, Array.from(nmText).length - 1);\n const numCap = fm.actualBoundingBoxAscent / 100;\n const numBase = baseOf(\n fm.fontBoundingBoxAscent / 100,\n fm.fontBoundingBoxDescent / 100,\n );\n\n ctx.font = `400 100px \"${rubik.fontFamily}\"`;\n const tagW = tagline ? ctx.measureText(tagline).width / 100 : 0;\n return { name: nameW, nameBase, num, numCap, numBase, tagline: tagW };\n}\n\nfunction useMetrics(name: string, numeral: string, tagline: string) {\n const key = [name, numeral, tagline].join(\"\\u0001\");\n const [state, setState] = useState<{ key: string; m: Metrics } | null>(null);\n const [handle] = useState(() => delayRender(\"sequel-numeral: measuring\"));\n const released = useRef(false);\n useEffect(() => {\n let live = true;\n const [n, nu, tg] = key.split(\"\\u0001\");\n Promise.all([\n rubik.waitUntilDone(),\n manrope.waitUntilDone(),\n document.fonts.load(`500 100px \"${rubik.fontFamily}\"`),\n document.fonts.load(`400 100px \"${rubik.fontFamily}\"`),\n document.fonts.load(`600 100px \"${manrope.fontFamily}\"`),\n ])\n .catch(() => undefined)\n .then(() => {\n if (!live) return;\n setState({ key, m: measure(n, nu, tg) });\n if (!released.current) {\n released.current = true;\n continueRender(handle);\n }\n });\n return () => {\n live = false;\n };\n }, [key, handle]);\n return state && state.key === key ? state.m : null;\n}\n\nexport function SequelNumeral({\n name = \"remocn\",\n numeral = \"2\",\n tagline = \"Part two. Out now.\",\n accent = RED,\n background,\n speed = 1,\n theme = \"dark\",\n}: SequelNumeralProps) {\n const t = useCurrentFrame() * speed;\n const { width: W, height: H, fps } = useVideoConfig();\n const c = THEMES[theme];\n const m = useMetrics(name, numeral, tagline);\n\n const transparent = background === \"transparent\";\n const stage = transparent ? \"transparent\" : (background ?? c.bg);\n\n if (!m) {\n return (\n <div style={{ position: \"absolute\", inset: 0, background: stage }} />\n );\n }\n\n const portrait = H > W * 1.1;\n const margin = Math.min(W, H) * (portrait ? 0.07 : 0.075);\n\n const L0 = Math.min(\n H * (portrait ? 0.075 : 0.16),\n (W * (portrait ? 0.62 : 0.5)) / m.name,\n );\n const L1 = L0 * (portrait ? 0.62 : 0.5);\n const supS0 = (SUP * LOGO_CAP * L0) / m.numCap;\n const gapSup = 0.06 * L0;\n\n const capTarget = H * (portrait ? 0.46 : 0.8);\n const room = W - 2 * margin - m.name * L1;\n const S1 = Math.min(capTarget / m.numCap, room / (m.num + 0.08));\n const gap1 = 0.08 * S1;\n\n const nameP = interpolate(t, [NAME_AT, NAME_AT + 18], [0, 1], {\n ...CLAMP,\n easing: EASE_OUT,\n });\n const supP = interpolate(t, [SUP_AT, SUP_AT + 12], [0, 1], {\n ...CLAMP,\n easing: EASE_OUT,\n });\n const drop = interpolate(t, [DROP_AT, DROP_AT + DROP_LEN], [0, 1], {\n ...CLAMP,\n easing: EASE_DROP,\n });\n const grow = spring({\n frame: t - GROW_AT,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n });\n const settle = spring({\n frame: t - GROW_AT,\n fps,\n config: { damping: 200, stiffness: 120, mass: 0.9 },\n durationInFrames: SETTLE_LEN,\n });\n const tagP = interpolate(t, [TAG_AT, TAG_AT + 16], [0, 1], {\n ...CLAMP,\n easing: EASE_OUT,\n });\n\n const L = L0 + (L1 - L0) * settle;\n const cap = LOGO_CAP * L;\n const supS = (SUP * cap) / m.numCap;\n const sizeFree = supS + (S1 - supS) * grow;\n const gap = gapSup + (gap1 - gapSup) * Math.min(1, Math.max(0, grow));\n\n const lock0 = m.name * L0 + gapSup + m.num * supS0;\n const nameLeft0 = (W - lock0) / 2;\n const nameLeft1 = W - margin - m.num * S1 - gap1 - m.name * L1;\n const nameLeft = nameLeft0 + (nameLeft1 - nameLeft0) * settle;\n const numLeft = nameLeft + m.name * L + gap;\n\n const base0 = H / 2 + (LOGO_CAP * L0) / 2;\n const base1 = (H + m.numCap * S1) / 2;\n const baseY = base0 + (base1 - base0) * settle;\n\n const supBase = baseY - cap + m.numCap * sizeFree;\n const numBaseY = supBase + (baseY - supBase) * drop;\n const size = Math.min(sizeFree, (numBaseY - margin) / m.numCap);\n\n const nameRise = (1 - nameP) * L * 1.2;\n const tagFs = Math.min(\n H * (portrait ? 0.022 : 0.04),\n (W * 0.6) / Math.max(0.1, m.tagline),\n );\n\n return (\n <AbsoluteFill style={{ background: stage, overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: nameLeft - L * 0.1,\n top: baseY - L * 1.1,\n width: m.name * L + L * 0.3,\n height: L * 1.4,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: L * 0.1,\n top: L * 1.1 - m.nameBase * L + nameRise,\n height: L,\n }}\n >\n {isRemocn(name) ? (\n <RemocnLogo fontSize={L} color={c.ink} />\n ) : (\n <div\n style={{\n fontFamily: manrope.fontFamily,\n fontWeight: 600,\n fontSize: L,\n lineHeight: 1,\n letterSpacing: \"-0.025em\",\n whiteSpace: \"pre\",\n color: c.ink,\n }}\n >\n {name}\n </div>\n )}\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: numLeft,\n top: numBaseY - m.numBase * size,\n height: size,\n lineHeight: `${size}px`,\n whiteSpace: \"pre\",\n fontFamily: rubik.fontFamily,\n fontWeight: 500,\n fontSize: size,\n letterSpacing: `${NUM_TRACK}em`,\n color: accent,\n opacity: supP,\n transform: `translateY(${((1 - supP) * cap * 0.4).toFixed(2)}px)`,\n }}\n >\n {numeral}\n </div>\n\n {tagline ? (\n <div\n style={{\n position: \"absolute\",\n left: margin,\n top: margin,\n height: tagFs * 1.3,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n fontFamily: rubik.fontFamily,\n fontWeight: 400,\n fontSize: tagFs,\n lineHeight: `${tagFs * 1.3}px`,\n letterSpacing: \"-0.01em\",\n whiteSpace: \"pre\",\n color: c.soft,\n transform: `translateY(${((1 - tagP) * tagFs * 1.4).toFixed(2)}px)`,\n }}\n >\n {tagline}\n </div>\n </div>\n ) : null}\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/sequel-numeral.tsx"
}
],
"type": "registry:component"
}