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": "Ink Bloom",
"initialProps": null,
"slug": "ink-bloom",
"sourceCode": "import { loadFont } from \"@remotion/google-fonts/Fraunces\";\nimport { loadFont as loadManrope } from \"@remotion/google-fonts/Manrope\";\nimport React, { useId } from \"react\";\nimport { AbsoluteFill, Easing, interpolate, interpolateColors, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nconst { fontFamily: serif } = loadFont(\"normal\", {\n weights: [\"400\"],\n subsets: [\"latin\"],\n});\nconst manrope = loadManrope(\"normal\", {\n weights: [\"500\", \"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 InkBloomProps {\n /** Replaces the remocn logo in the lockup the ink settles into; `name` is set beside it. */\n logo?: React.ReactNode;\n name?: string;\n accent?: string;\n /** Playback multiplier. */\n speed?: number;\n /** Light = off-white paper with near-black ink (default); dark = light ink on black. */\n theme?: \"light\" | \"dark\";\n /** Changes the shape of the bloom. */\n seed?: number;\n}\n\nconst EASE_IO = Easing.bezier(0.65, 0, 0.35, 1);\nconst EASE_OUT = Easing.bezier(0.22, 1, 0.36, 1);\nconst CLAMP = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n} as const;\n\n// gradients.sh \"mist\" palette: bg #040407, [#f4d9ff, #a77bff, #3b2a9e, #120d33].\n// It is a gradient map on the ink's density: thin veils one end, dense cores the other.\nconst THEMES = {\n light: {\n bg: \"#F5F4F0\",\n ink: \"#14161B\",\n map: [\"#c9b0ff\", \"#a77bff\", \"#5a44c4\", \"#3b2a9e\", \"#120d33\", \"#120d33\"],\n mapThin: [\"#d9c6ff\", \"#b994ff\", \"#8a66f0\", \"#6a4fd6\", \"#4b37b0\", \"#3b2a9e\"],\n fg: \"#121214\",\n blend: \"multiply\" as const,\n vignette: \"rgba(110,100,85,0.12)\",\n grain: 0.05,\n },\n dark: {\n bg: \"#040407\",\n ink: \"#E9E7E1\",\n map: [\"#2a1f78\", \"#3b2a9e\", \"#7a5ae6\", \"#a77bff\", \"#f4d9ff\", \"#fbf2ff\"],\n mapThin: [\"#2a1f78\", \"#3b2a9e\", \"#6a4fd6\", \"#8a66f0\", \"#a77bff\", \"#c9a8ff\"],\n fg: \"#F3F2EF\",\n blend: \"screen\" as const,\n vignette: \"rgba(0,0,0,0.6)\",\n grain: 0.06,\n },\n} as const;\n\n/** Frame the drop meets the water. */\nconst IMPACT = 13;\n/** How far the vortex ring sinks, as a share of the frame height. */\nconst SINK = 0.33;\n\nfunction hash(n: number) {\n const x = Math.sin(n * 127.1 + 311.7) * 43758.5453;\n return x - Math.floor(x);\n}\n\nconst sat = (age: number, tau: number) => 1 - Math.exp(-Math.max(0, age) / tau);\n\ninterface Puff {\n x: number;\n y: number;\n r: number;\n o: number;\n /** Second ink: a thread of accent carried in the vortex cores. */\n accent?: boolean;\n /** Billow edge: darker at the rim, so overlapping puffs read as rolled sheets. */\n rim?: boolean;\n}\n\n/**\n * The bloom as soft puffs: a sinking vortex ring (two curling lobes joined by\n * a thin band), the wake it leaves, smaller plumes that peel off the lobes,\n * and a faint veil. Every motion decays exponentially, so the ink slows and\n * settles on its own; the filter supplies all the fine structure.\n */\nfunction bloom(age: number, ox: number, oy: number, h: number, seed: number) {\n const u = h / 720;\n const puffs: Puff[] = [];\n if (age < 0) return puffs;\n const H = (n: number) => hash(n + seed * 97.13);\n\n const sinkAt = (a: number) => oy + SINK * h * sat(a, 24);\n const ringAt = (a: number) => (8 + 290 * sat(a, 34)) * u;\n const cy = sinkAt(age);\n const cx = ox + 16 * u * sat(age, 40);\n const R = ringAt(age);\n const lobeR = (6 + 118 * sat(age, 30)) * u;\n const dilute = Math.min(1, 0.55 + 16 / (8 + age));\n const turn = 2.8 * sat(age, 26) + 0.005 * age;\n\n for (const side of [-1, 1]) {\n // a slightly tilted, uneven ring reads as fluid rather than a mirror image\n const lx = cx + side * R * (1 + side * 0.06);\n const ly = cy - side * 14 * u * sat(age, 30);\n const lr = lobeR * (1 - side * 0.1);\n for (let j = 0; j < 36; j++) {\n const k = side * 1000 + j;\n const edge = j >= 12;\n const rho = lr * (edge ? 0.62 + 0.38 * H(k) : 0.5 * Math.sqrt(H(k)));\n const phi = H(k + 0.5) * Math.PI * 2 - side * turn * (1.35 - rho / lr);\n out(puffs, {\n x: lx + Math.cos(phi) * rho,\n y: ly + Math.sin(phi) * rho * 0.8,\n r: lr * (edge ? 0.22 + 0.22 * H(k + 0.25) : 0.45 + 0.2 * H(k + 0.25)),\n o: (edge ? 0.34 : 0.3) * dilute,\n rim: false,\n accent: j % 5 === 1 && rho < lr * 0.7,\n });\n }\n }\n // the thin band joining the lobes: front and back of the ring\n for (let j = 0; j < 14; j++) {\n const th = (j / 14) * Math.PI * 2 + H(300 + j) * 0.3;\n out(puffs, {\n x: cx + Math.cos(th) * R * 0.9,\n y: cy + Math.sin(th) * R * 0.13 + lobeR * 0.12,\n r: lobeR * (0.22 + 0.12 * H(320 + j)),\n o: 0.2 * dilute,\n accent: j % 7 === 2,\n });\n }\n // the wake: a thin swaying column from the entry point down to the ring\n for (let j = 0; j < 20; j++) {\n const f = j / 19;\n const sway = Math.sin(f * 4.5 + H(400) * 6 + age * 0.018) * 12 * u * f;\n out(puffs, {\n x: ox + sway + (H(410 + j) - 0.5) * 5 * u,\n y: oy + (cy - oy) * (0.02 + 0.88 * f),\n r: (4 + 9 * f + 7 * sat(age, 60)) * u,\n o: 0.32 * (1 - f * 0.3) * Math.min(1, age / 4),\n });\n }\n // secondary plumes peel off the underside of each lobe and sink\n for (const side of [-1, 1]) {\n for (let m = 0; m < 4; m++) {\n const k = 5000 + side * 500 + m * 37;\n const a0 = 16 + m * 7 + H(k) * 6;\n const la = age - a0;\n if (la <= 0) continue;\n const sx = cx + side * (ringAt(a0) + (m - 1.2) * 26 * u);\n const sy = sinkAt(a0) + lobeR * 0.4;\n const ang = ((90 - side * (8 + m * 22 + H(k + 1) * 12)) * Math.PI) / 180;\n const reach = (130 + 120 * H(k + 2)) * u * (m === 3 ? 0.6 : 1);\n const d = reach * sat(la, 24);\n const grow = Math.min(1, la / 24);\n const curve = (H(k + 3) - 0.5) * 0.6;\n let hx = sx;\n let hy = sy;\n for (let q = 1; q <= 8; q++) {\n const f = q / 8;\n const a = ang + curve * f;\n hx = sx + Math.cos(a) * d * f;\n hy = sy + Math.sin(a) * d * f;\n out(puffs, {\n x: hx,\n y: hy,\n r: (4 + 10 * f * grow) * u,\n o: 0.24 * Math.min(1, la / 6),\n });\n }\n // a small mushroom head\n const headR = (8 + 22 * grow) * u;\n for (let q = 0; q < 6; q++) {\n const th = (q / 6) * Math.PI * 2 + H(k + 10 + q) + la * 0.02 * side;\n out(puffs, {\n x: hx + Math.cos(th) * headR * 0.75,\n y: hy + Math.sin(th) * headR * 0.45,\n r: headR * (0.4 + 0.3 * H(k + 20 + q)),\n o: 0.28 * Math.min(1, la / 8),\n accent: m === 1 && q < 2,\n });\n }\n }\n }\n // veil: big, faint, slowly spreading\n for (let j = 0; j < 12; j++) {\n const th = H(700 + j) * Math.PI * 2;\n const spread = (60 + 260 * H(710 + j)) * u * sat(age, 50);\n out(puffs, {\n x: cx + Math.cos(th) * spread * 1.4,\n y: cy + Math.sin(th) * spread * 0.55 - 10 * u,\n r: (30 + 90 * sat(age, 45) + 40 * H(720 + j)) * u,\n o: 0.08 * Math.min(1, age / 10),\n });\n }\n return puffs;\n}\n\nfunction out(list: Puff[], p: Puff) {\n list.push(p);\n}\n\nfunction Grain({ opacity }: { opacity: number }) {\n const id = `g${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n return (\n <svg\n width=\"100%\"\n height=\"100%\"\n style={{ position: \"absolute\", inset: 0, opacity }}\n aria-hidden\n >\n <filter id={id}>\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency=\"0.85\"\n numOctaves={2}\n seed={7}\n stitchTiles=\"stitch\"\n />\n <feColorMatrix values=\"0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0.9 0\" />\n </filter>\n <rect width=\"100%\" height=\"100%\" filter={`url(#${id})`} />\n </svg>\n );\n}\n\nexport function InkBloom({\n logo,\n name = \"remocn\",\n accent = \"#3B5BFD\",\n speed = 1,\n theme = \"light\",\n seed = 3,\n}: InkBloomProps) {\n const t = useCurrentFrame() * speed;\n const { width, height } = useVideoConfig();\n const u = height / 720;\n const pal = THEMES[theme];\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n\n const ox = width / 2;\n const oy = height * 0.17;\n const age = t - IMPACT;\n const puffs = bloom(age, ox, oy, height, seed);\n\n // The noise field evolves: seeds cross-fade, features grow as the ink diffuses.\n // Shapes move through a fixed field, which is what makes the plumes billow.\n const mixA = 0.5 + 0.5 * Math.sin(t / 26);\n const mixB = 0.5 + 0.5 * Math.cos(t / 33);\n const bfLow = (0.0058 - 0.0016 * sat(age, 70)) / u;\n const bfTex = (0.009 - 0.002 * sat(age, 70)) / u;\n const warp = (60 + 40 * sat(age, 40)) * u;\n\n // resolve: the cloud thins while the lockup condenses from the same turbulence\n const thin = interpolate(t, [92, 150], [0, 1], {\n ...CLAMP,\n easing: EASE_IO,\n });\n const cloudO = 1 - thin * 0.6;\n const envBlur = (3 + 3 * sat(age, 60) + thin * 5) * u;\n const veinK = 0.85;\n const fray = (26 + 14 * sat(age, 40)) * u;\n const resolve = interpolate(t, [100, 150], [0, 1], {\n ...CLAMP,\n easing: EASE_OUT,\n });\n const lockWarp = (1 - resolve) * 110 * u;\n const lockBlur = (1 - resolve) ** 1.5 * 10 * u;\n\n // the drop: accelerates in from above with a short trail of ghosts\n const fall = interpolate(t, [0, IMPACT], [0, 1], CLAMP);\n const dropY = interpolate(fall ** 1.7, [0, 1], [10 * u, oy]);\n const stretch = fall * 2;\n const dropShow = t < IMPACT + 1;\n\n const soft = `ink${id}`;\n const softA = `inkA${id}`;\n const rim = `rim${id}`;\n const body = `body${id}`;\n const cond = `cond${id}`;\n\n const markSize = 96 * u;\n const lockY = oy + SINK * height * 0.98;\n\n // as the cloud thins, the map slides toward the saturated middle of the palette\n const inkMap = pal.map.map((c, i) =>\n interpolateColors(thin, [0, 1], [c, pal.mapThin[i]]),\n );\n const ramp = (stops: string[], ch: number) =>\n stops\n .map((c) => {\n const m = c.match(/[\\d.]+/g) ?? [\"0\", \"0\", \"0\"];\n return (Number(m[ch]) / 255).toFixed(3);\n })\n .join(\" \");\n const inkFilter = (fid: string, mapped: boolean) => (\n <filter\n id={fid}\n filterUnits=\"userSpaceOnUse\"\n x={0}\n y={0}\n width={width}\n height={height}\n colorInterpolationFilters=\"sRGB\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={bfLow}\n numOctaves={2}\n seed={seed}\n result=\"l1\"\n />\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={bfLow * 1.21}\n numOctaves={2}\n seed={seed + 17}\n result=\"l2\"\n />\n <feComposite\n in=\"l1\"\n in2=\"l2\"\n operator=\"arithmetic\"\n k2={mixA}\n k3={1 - mixA}\n result=\"low\"\n />\n {/* the puffs, rolled by a big smooth swirl, become a soft volume */}\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"low\"\n scale={warp}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n result=\"swirl\"\n />\n <feGaussianBlur in=\"swirl\" stdDeviation={envBlur} result=\"envSoft\" />\n {/* creases of turbulence noise are the filaments inside the volume */}\n <feTurbulence\n type=\"turbulence\"\n baseFrequency={bfTex}\n numOctaves={4}\n seed={seed + 41}\n result=\"t1\"\n />\n <feTurbulence\n type=\"turbulence\"\n baseFrequency={bfTex * 0.9}\n numOctaves={4}\n seed={seed + 59}\n result=\"t2\"\n />\n <feComposite\n in=\"t1\"\n in2=\"t2\"\n operator=\"arithmetic\"\n k2={mixB}\n k3={1 - mixB}\n result=\"tex\"\n />\n <feDisplacementMap\n in=\"tex\"\n in2=\"low\"\n scale={warp}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n result=\"texw\"\n />\n {/* fray the volume's edges along the same creases */}\n <feDisplacementMap\n in=\"envSoft\"\n in2=\"texw\"\n scale={fray}\n xChannelSelector=\"R\"\n yChannelSelector=\"R\"\n result=\"env\"\n />\n <feColorMatrix\n in=\"texw\"\n values=\"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 -3 0 0 0 1.3\"\n result=\"veins\"\n />\n <feComposite\n in=\"env\"\n in2=\"veins\"\n operator=\"arithmetic\"\n k1={veinK}\n k2={1 - veinK * 0.62}\n result=\"ink\"\n />\n {mapped ? (\n <>\n {/* gradient map: density (alpha) picks the colour from the palette */}\n <feColorMatrix\n in=\"ink\"\n values=\"0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 1\"\n result=\"dens\"\n />\n <feComponentTransfer in=\"dens\" result=\"mapped\">\n <feFuncR type=\"table\" tableValues={ramp(inkMap, 0)} />\n <feFuncG type=\"table\" tableValues={ramp(inkMap, 1)} />\n <feFuncB type=\"table\" tableValues={ramp(inkMap, 2)} />\n </feComponentTransfer>\n <feComposite in=\"mapped\" in2=\"ink\" operator=\"in\" />\n </>\n ) : null}\n </filter>\n );\n\n return (\n <AbsoluteFill style={{ background: pal.bg, overflow: \"hidden\" }}>\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <defs>\n <radialGradient id={soft}>\n <stop offset=\"0%\" stopColor={pal.ink} stopOpacity={1} />\n <stop offset=\"50%\" stopColor={pal.ink} stopOpacity={0.6} />\n <stop offset=\"100%\" stopColor={pal.ink} stopOpacity={0} />\n </radialGradient>\n <radialGradient id={rim}>\n <stop offset=\"0%\" stopColor={pal.ink} stopOpacity={0.1} />\n <stop offset=\"60%\" stopColor={pal.ink} stopOpacity={0.28} />\n <stop offset=\"86%\" stopColor={pal.ink} stopOpacity={0.75} />\n <stop offset=\"100%\" stopColor={pal.ink} stopOpacity={0} />\n </radialGradient>\n <radialGradient id={softA}>\n <stop offset=\"0%\" stopColor={accent} stopOpacity={1} />\n <stop offset=\"50%\" stopColor={accent} stopOpacity={0.55} />\n <stop offset=\"100%\" stopColor={accent} stopOpacity={0} />\n </radialGradient>\n {/*\n ink = soft envelope (the puffs, blurred, swirled by low noise)\n x billowing density texture (fractal noise as alpha)\n */}\n {inkFilter(body, true)}\n {inkFilter(`${body}a`, false)}\n <filter\n id={cond}\n x=\"-30%\"\n y=\"-80%\"\n width=\"160%\"\n height=\"260%\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={0.014 / u}\n numOctaves={3}\n seed={seed + 5}\n result=\"n\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"n\"\n scale={lockWarp}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n result=\"d\"\n />\n <feGaussianBlur in=\"d\" stdDeviation={lockBlur} />\n </filter>\n </defs>\n\n <g filter={`url(#${body}a)`} opacity={cloudO * 0.9}>\n {puffs\n .filter((p) => p.accent)\n .map((p, i) => (\n <circle\n key={i}\n cx={p.x}\n cy={p.y}\n r={p.r * 0.9}\n fill={`url(#${softA})`}\n opacity={Math.min(1, p.o * 1.25)}\n />\n ))}\n </g>\n <g filter={`url(#${body})`} opacity={cloudO}>\n {puffs.map((p, i) => (\n <circle\n key={i}\n cx={p.x}\n cy={p.y}\n r={p.r}\n fill={`url(#${p.rim ? rim : soft})`}\n opacity={Math.min(1, p.o * 1.7)}\n />\n ))}\n </g>\n\n {/* the falling drop */}\n {dropShow && (\n <g transform={`translate(${ox} ${dropY}) scale(${1.45 * u})`}>\n {[3, 2, 1].map((g) => (\n <ellipse\n key={g}\n cx={0}\n cy={-g * stretch * 8}\n rx={5}\n ry={6 + stretch * 3}\n fill={pal.map[4]}\n opacity={0.07 * (4 - g) * fall}\n />\n ))}\n <path\n d={`M0 ${-(13 + stretch * 6)} C2 -6 6.5 -2 6.5 2.5 A6.5 6.5 0 0 1 -6.5 2.5 C-6.5 -2 -2 -6 0 ${-(13 + stretch * 6)}Z`}\n fill={pal.map[4]}\n />\n </g>\n )}\n </svg>\n\n {/* the lockup condenses out of the turbulence */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: lockY - markSize / 2,\n height: markSize,\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\",\n gap: 14 * u,\n opacity: interpolate(resolve, [0, 0.3, 1], [0, 0.75, 1]),\n filter: resolve < 1 ? `url(#${cond})` : undefined,\n transform: `scale(${0.985 + resolve * 0.015})`,\n }}\n >\n {logo ? (\n <>\n {logo}\n <div\n style={{\n fontFamily: serif,\n fontWeight: 400,\n fontSize: 92 * u,\n lineHeight: 1,\n letterSpacing: \"-0.03em\",\n color: pal.fg,\n }}\n >\n {name}\n </div>\n </>\n ) : (\n <RemocnLogo fontSize={112 * u} color={pal.fg} />\n )}\n </div>\n\n <AbsoluteFill\n style={{\n background: `radial-gradient(ellipse 80% 75% at 50% 50%, transparent 50%, ${pal.vignette} 100%)`,\n }}\n />\n <Grain opacity={pal.grain} />\n </AbsoluteFill>\n );\n}",
"durationInFrames": 150,
"installationMode": "wrapped"
},
"durationInFrames": 150
}