Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"type": "remotion-element",
"version": 1,
"element": {
"assets": [],
"dependencies": [
{
"name": "@remotion/google-fonts",
"version": null
}
],
"dimensions": null,
"displayName": "Mvp Card",
"initialProps": null,
"slug": "mvp-card",
"sourceCode": "import { loadFont } from \"@remotion/google-fonts/Antonio\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst { fontFamily: antonio } = 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\ninterface MvpStat {\n /** Final value. Counts from `from` (default 0) to here. */\n value: number;\n /** Where the count starts. Set it above `value` to count down. */\n from?: number;\n decimals?: number;\n suffix?: string;\n label: string;\n}\n\ninterface MvpCardProps {\n /** The huge word behind the card. */\n title?: string;\n /** Small label at the top right. */\n kicker?: string;\n /** Event line under the kicker. */\n event?: string;\n /** Role tag next to the logo on the card. */\n role?: string;\n /** Player number in the portrait corner. */\n number?: string;\n /** Three stat rows that count up inside the card. */\n stats?: MvpStat[];\n /** Small markers: kicker tick and stat ticks. */\n accent?: string;\n theme?: \"dark\" | \"light\";\n speed?: number;\n}\n\n// Beat sheet (30fps, speed 1):\n// 0–9 the card slams up and open from its centre line, a little over-scaled\n// 3–14 a light sweep crosses the card face; the frame kicks on landing\n// 5–20 the giant \"MVP\" rises letter by letter right of the card, filled\n// with the \"fluted\" gradient, cap bottom on the card's bottom edge\n// 11–23 logo, role tag, kicker and event line slide in\n// 18–62 three stats count (the bug count runs down), staggered 8f, each\n// lights its marker when it lands\n// 62– poster hold\nconst SLAM = Easing.bezier(0.12, 0.9, 0.25, 1);\nconst OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst COUNT = Easing.bezier(0.3, 0.6, 0.15, 1);\nconst CLAMP = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n} as const;\n\n// gradients.sh \"fluted\": bg #050507, [#1d2a8f, #2f7bff, #ff7a3d, #ffe2c4].\nconst FLUTED = [\"#1D2A8F\", \"#2F7BFF\", \"#FF7A3D\", \"#FFE2C4\"] as const;\n\n// Antonio 500 advance widths (em) for caps, plus its cap height and the\n// baseline position inside a line-height: 1 box.\nconst ADV: Record<string, number> = {\n A: 0.445,\n B: 0.455,\n C: 0.454,\n D: 0.471,\n E: 0.373,\n F: 0.369,\n G: 0.465,\n H: 0.486,\n I: 0.247,\n J: 0.435,\n K: 0.451,\n L: 0.345,\n M: 0.645,\n N: 0.5,\n O: 0.466,\n P: 0.441,\n Q: 0.466,\n R: 0.464,\n S: 0.409,\n T: 0.315,\n U: 0.472,\n V: 0.436,\n W: 0.656,\n X: 0.399,\n Y: 0.409,\n Z: 0.343,\n \" \": 0.2,\n};\nconst CAP = 0.859;\nconst BASELINE = 1.008;\n\nconst THEMES = {\n dark: {\n stage: \"#060608\",\n card: \"#111114\",\n edge: \"#26262C\",\n rule: \"#222228\",\n ink: \"#F3F2EF\",\n dim: \"#86858C\",\n title: (a: number) =>\n `linear-gradient(${172 + a}deg, ${FLUTED[3]} 0%, ${FLUTED[2]} 30%, #B2507A 52%, ${FLUTED[1]} 76%, ${FLUTED[0]} 100%)`,\n },\n light: {\n stage: \"#F5F4F0\",\n card: \"#FFFFFF\",\n edge: \"#E3E1DA\",\n rule: \"#ECEAE4\",\n ink: \"#121214\",\n dim: \"#7E7D77\",\n title: (a: number) =>\n `linear-gradient(${172 + a}deg, ${FLUTED[2]} 0%, #C9466A 34%, ${FLUTED[1]} 70%, ${FLUTED[0]} 100%)`,\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/** A hit: up in 1 frame, eases back over `len`. */\nfunction kick(d: number, len = 8) {\n if (d < 0) return 0;\n if (d < 1) return d;\n const k = Math.max(0, 1 - (d - 1) / len);\n return k * k;\n}\n\nfunction MvpCardBase({\n title = \"MVP\",\n kicker = \"Most valuable player\",\n event = \"Grand final 2026\",\n role = \"Carry\",\n number = \"01\",\n stats = [\n { value: 12.4, decimals: 1, label: \"Renders / min\" },\n { value: 0, from: 37, label: \"Bugs\" },\n { value: 100, suffix: \"%\", label: \"Uptime\" },\n ],\n accent = \"#3B5BFD\",\n theme = \"dark\",\n speed = 1,\n}: MvpCardProps) {\n const t = useCurrentFrame() * speed + 1;\n const { width: W, height: H } = useVideoConfig();\n const c = THEMES[theme];\n const u = Math.min(W / 1280, H / 720);\n\n // ── Layout ────────────────────────────────────────────────────────────────\n const cardW = 384 * u;\n const cardH = 628 * u;\n const cardX = W / 2 - 576 * u;\n const cardY = (H - cardH) / 2;\n const pad = 26 * u;\n const portraitH = 236 * u;\n const nameH = 86 * u;\n const rowH =\n (cardH - portraitH - nameH - pad * 0.6) / Math.max(1, stats.length);\n const corner = 34 * u;\n\n const titleLeft = cardX + cardW + 40 * u;\n const titleRight = W - 48 * u;\n const letters = Array.from(title.toUpperCase());\n const track = -0.01;\n const advSum = letters.reduce(\n (a, ch) => a + (ADV[ch] ?? 0.45) + track,\n -track,\n );\n const titleFs = Math.min(560 * u, (titleRight - titleLeft) / advSum);\n const letterX: number[] = [];\n letters.reduce((x, ch) => {\n letterX.push(x);\n return x + ((ADV[ch] ?? 0.45) + track) * titleFs;\n }, 0);\n const titleW = advSum * titleFs;\n const capBottom = cardY + cardH;\n\n // ── Entrance ──────────────────────────────────────────────────────────────\n const open = SLAM(ramp(t, 0, 6));\n const settle = SLAM(ramp(t, 0, 9));\n const cardScale = 1 + 0.07 * (1 - settle);\n const cardLift = (1 - settle) * 46 * u;\n const sweep = interpolate(t, [3, 14], [-0.6, 1.6], CLAMP);\n const nameIn = OUT(ramp(t, 11, 10));\n const kickerIn = OUT(ramp(t, 13, 10));\n const lettersAt = (i: number) => 5 + i * 3;\n const lastLetter = lettersAt(letters.length - 1) + 5;\n const hit = Math.max(kick(t - 4, 8), kick(t - lastLetter, 9) * 0.8);\n const drift = interpolate(t, [0, 120], [0, 8], CLAMP);\n\n const statAt = (i: number) => 18 + i * 8;\n const statLen = 22;\n\n return (\n <AbsoluteFill style={{ background: c.stage, overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `scale(${1 + 0.012 * hit})`,\n }}\n >\n {/* Kicker and event line, top right. */}\n <div\n style={{\n position: \"absolute\",\n left: titleLeft + 6 * u,\n top: cardY + 4 * u,\n opacity: kickerIn,\n transform: `translateX(${(1 - kickerIn) * 30 * u}px)`,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14 * u,\n fontFamily: antonio,\n fontWeight: 500,\n fontSize: 24 * u,\n lineHeight: 1,\n letterSpacing: \"0.22em\",\n textTransform: \"uppercase\",\n color: c.dim,\n whiteSpace: \"nowrap\",\n }}\n >\n <div style={{ width: 30 * u, height: 4 * u, background: accent }} />\n {kicker}\n </div>\n <div\n style={{\n marginTop: 14 * u,\n fontFamily: antonio,\n fontWeight: 400,\n fontSize: 78 * u,\n lineHeight: 1,\n letterSpacing: \"-0.01em\",\n textTransform: \"uppercase\",\n color: c.ink,\n whiteSpace: \"nowrap\",\n }}\n >\n {event}\n </div>\n </div>\n\n {/* The giant title, rising letter by letter, cap bottom on the card bottom. */}\n <div\n style={{\n position: \"absolute\",\n left: titleLeft,\n width: titleW,\n top: capBottom - (CAP + 0.03) * titleFs,\n height: (CAP + 0.03) * titleFs + 2 * u,\n overflow: \"hidden\",\n }}\n >\n {letters.map((ch, i) => {\n const p = SLAM(ramp(t, lettersAt(i), 9));\n return (\n <span\n key={`${i}-${ch}`}\n style={{\n position: \"absolute\",\n left: letterX[i],\n top: (CAP + 0.03) * titleFs - BASELINE * titleFs,\n fontFamily: antonio,\n fontWeight: 500,\n fontSize: titleFs,\n lineHeight: 1,\n backgroundImage: c.title(drift),\n backgroundSize: `${titleW}px ${titleFs * 1.1}px`,\n backgroundPosition: `${-letterX[i]}px ${0.1 * titleFs}px`,\n backgroundRepeat: \"no-repeat\",\n WebkitBackgroundClip: \"text\",\n backgroundClip: \"text\",\n color: \"transparent\",\n transform: `translateY(${(1 - p) * (CAP + 0.06) * titleFs}px)`,\n whiteSpace: \"pre\",\n }}\n >\n {ch}\n </span>\n );\n })}\n </div>\n\n {/* The card. */}\n <div\n style={{\n position: \"absolute\",\n left: cardX,\n top: cardY,\n width: cardW,\n height: cardH,\n transform: `translateY(${cardLift}px) scale(${cardScale})`,\n clipPath: `inset(${50 * (1 - open)}% 0 ${50 * (1 - open)}% 0)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `polygon(0 0, calc(100% - ${corner}px) 0, 100% ${corner}px, 100% 100%, 0 100%)`,\n background: c.card,\n boxShadow: `inset 0 0 0 ${1.5 * u}px ${c.edge}`,\n overflow: \"hidden\",\n }}\n >\n {/* Portrait: the R mark as the player. */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: cardW,\n height: portraitH,\n overflow: \"hidden\",\n background: [\n `radial-gradient(70% 80% at ${78 - drift}% 18%, ${FLUTED[2]} 0%, transparent 62%)`,\n `radial-gradient(60% 70% at ${70 - drift * 0.5}% 6%, ${FLUTED[3]}cc 0%, transparent 46%)`,\n `radial-gradient(90% 90% at ${14 + drift}% 96%, ${FLUTED[1]} 0%, transparent 70%)`,\n `linear-gradient(160deg, #B2507A 0%, ${FLUTED[0]} 100%)`,\n ].join(\", \"),\n }}\n >\n <svg\n viewBox=\"0 0 124.06 134.26\"\n height={234 * u}\n width={(234 * u * 124.06) / 134.26}\n style={{\n position: \"absolute\",\n left: cardW / 2 - (234 * u * 124.06) / 134.26 / 2 + 6 * u,\n bottom: -26 * u,\n transform: `translateY(${(1 - nameIn) * 30 * u}px)`,\n }}\n aria-hidden\n >\n <path fill=\"#FFFFFF\" d={REMOCN_R_PATH} />\n </svg>\n <div\n style={{\n position: \"absolute\",\n left: pad,\n top: pad - 4 * u,\n fontFamily: antonio,\n fontWeight: 500,\n fontSize: 64 * u,\n lineHeight: 1,\n letterSpacing: \"-0.01em\",\n color: \"#FFFFFF\",\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {number}\n </div>\n </div>\n\n {/* Name row. */}\n <div\n style={{\n position: \"absolute\",\n left: pad,\n right: pad,\n top: portraitH,\n height: nameH,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n borderBottom: `${1.5 * u}px solid ${c.rule}`,\n opacity: nameIn,\n transform: `translateX(${(1 - nameIn) * 24 * u}px)`,\n }}\n >\n <RemocnLogo fontSize={54 * u} color={c.ink} />\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10 * u,\n height: 36 * u,\n padding: `0 ${14 * u}px`,\n background: accent,\n fontFamily: antonio,\n fontWeight: 500,\n fontSize: 23 * u,\n letterSpacing: \"0.16em\",\n textTransform: \"uppercase\",\n color: \"#FFFFFF\",\n paddingTop: 2 * u,\n }}\n >\n {role}\n </div>\n </div>\n\n {/* Stats. */}\n {stats.map((s, i) => {\n const at = statAt(i);\n const p = COUNT(ramp(t, at, statLen));\n const from = s.from ?? 0;\n const v = from + (s.value - from) * p;\n const dec = s.decimals ?? 0;\n const shown = `${v.toFixed(dec)}${s.suffix ?? \"\"}`;\n const rowIn = OUT(ramp(t, at - 2, 8));\n const land = kick(t - at - statLen, 9);\n return (\n <div\n key={`${i}-${s.label}`}\n style={{\n position: \"absolute\",\n left: pad,\n right: pad,\n top: portraitH + nameH + i * rowH,\n height: rowH,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n borderBottom:\n i < stats.length - 1\n ? `${1.5 * u}px solid ${c.rule}`\n : \"none\",\n opacity: rowIn,\n transform: `translateY(${(1 - rowIn) * 16 * u}px)`,\n }}\n >\n <div\n style={{\n fontFamily: antonio,\n fontWeight: 500,\n fontSize: 78 * u,\n lineHeight: 1,\n letterSpacing: \"-0.01em\",\n fontVariantNumeric: \"tabular-nums\",\n color: c.ink,\n paddingTop: 4 * u,\n transform: `scale(${1 + 0.06 * land})`,\n transformOrigin: \"left center\",\n }}\n >\n {shown}\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10 * u,\n fontFamily: antonio,\n fontWeight: 500,\n fontSize: 24 * u,\n letterSpacing: \"0.16em\",\n textTransform: \"uppercase\",\n color: c.dim,\n }}\n >\n {s.label}\n <div\n style={{\n width: 8 * u,\n height: 8 * u,\n background: p >= 1 ? accent : c.rule,\n }}\n />\n </div>\n </div>\n );\n })}\n\n {/* Light sweep across the face. */}\n <div\n style={{\n position: \"absolute\",\n top: -cardH * 0.2,\n height: cardH * 1.4,\n left: sweep * cardW - cardW * 0.35,\n width: cardW * 0.7,\n transform: \"skewX(-18deg)\",\n background:\n \"linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 46%, rgba(255,255,255,0.75) 50%, rgba(255,255,255,0.5) 54%, rgba(255,255,255,0) 100%)\",\n opacity: sweep > -0.6 && sweep < 1.6 ? 0.85 : 0,\n }}\n />\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n theme: {\n type: \"enum\",\n default: \"dark\",\n variants: {\n dark: {},\n light: {},\n },\n description: \"Theme\",\n },\n accent: {\n type: \"color\",\n default: \"#3B5BFD\",\n description: \"Accent\",\n },\n title: {\n type: \"text-content\",\n default: \"MVP\",\n description: \"Title\",\n },\n kicker: {\n type: \"text-content\",\n default: \"Most valuable player\",\n description: \"Kicker\",\n },\n event: {\n type: \"text-content\",\n default: \"Grand final 2026\",\n description: \"Event\",\n },\n role: {\n type: \"text-content\",\n default: \"Carry\",\n description: \"Role\",\n },\n number: {\n type: \"text-content\",\n default: \"01\",\n description: \"Number\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"theme\",\"accent\",\"title\",\"kicker\",\"event\",\"role\",\"number\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n theme: \"dark\",\n accent: \"#3B5BFD\",\n title: \"MVP\",\n kicker: \"Most valuable player\",\n event: \"Grand final 2026\",\n role: \"Carry\",\n number: \"01\",\n speed: 1,\n};\n\ntype MvpCardElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MvpCardBase>;\n\nconst MvpCardInner = forwardRef<\n HTMLDivElement,\n MvpCardElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<MvpCard>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <MvpCardBase\n {...(componentProps as unknown as ComponentProps<typeof MvpCardBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MvpCard = Interactive.withSchema({\n Component: MvpCardInner,\n componentName: \"<MvpCard>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n",
"durationInFrames": 62,
"installationMode": "component-owned-sequence"
},
"durationInFrames": 62
}