Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

fix: rewrite interactivity components. fix container dimensions

kapishdima2c10185eceab
diff --git a/lib/customizer-config.ts b/lib/customizer-config.ts
index ca13bcc5..52a1b923 100644
--- a/lib/customizer-config.ts
+++ b/lib/customizer-config.ts
@@ -40,6 +40,14 @@ export interface ComponentConfig {
* type allows `undefined`.
*/
controls: InteractivitySchema;
+ /**
+ * Element bounding box in composition pixels (1920×1080 space) for the
+ * Studio element payload. Sized to the rendered content at default props,
+ * with headroom for the animation's travel. Omit for full-frame components
+ * (backgrounds, shaders, filters, transitions) — they keep a `null` box
+ * and fill the composition.
+ */
+ dimensions?: { width: number; height: number };
durationInFrames: number;
fps: number;
compositionWidth: number;
diff --git a/registry-artifacts/animated-bar-chart.json b/registry-artifacts/animated-bar-chart.json
index bd672a89..99d769ae 100644
--- a/registry-artifacts/animated-bar-chart.json
+++ b/registry-artifacts/animated-bar-chart.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/animated-bar-chart/index.tsx",
- "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedBarChart({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n transform: `scaleY(${scaleY})`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedBarChart({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n scale: `1 ${scaleY}`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/animated-bar-chart.tsx"
}
diff --git a/registry-artifacts/ascii-dissolve.json b/registry-artifacts/ascii-dissolve.json
index 83a9b1f9..4f154746 100644
--- a/registry-artifacts/ascii-dissolve.json
+++ b/registry-artifacts/ascii-dissolve.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/ascii-dissolve/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport React from \"react\";\nimport {\n AbsoluteFill,\n continueRender,\n delayRender,\n Easing,\n interpolate,\n random,\n useVideoConfig,\n} from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// ---------------------------------------------------------------------------\n// ascii-dissolve — the frame becomes plain text. The outgoing scene fades as\n// a fullscreen field of monospace glyphs rises over it: a deterministic\n// noise field drives each cell through a density ramp (\" .:-=+*#%@\"), so the\n// cover reads as living ASCII. It holds fully opaque long enough to be READ\n// as text, then the cells drop back down the ramp to space while the\n// incoming scene resolves beneath.\n//\n// Text mode (enterText): the outgoing scene blurs out under the rising\n// field; the incoming headline is never previewed as ascii — the field\n// dissolves cell by cell (per-cell staggered, never a flat plane) while\n// the real text fades in over it. `enterStyle` picks what happens AROUND\n// the arriving text:\n// \"fade\" — plain: staggered dissolve everywhere, text fades in.\n// \"clearing\" — the dissolve order is biased by distance to the text:\n// cells near the headline vanish first, the field opens a\n// granular cavity around it.\n// \"halo\" — a smooth radial attenuation grows around the text: near\n// cells slide down the ramp into thin glyphs, a soft dark\n// well forms behind the headline.\n// \"wave\" — one density impulse rides outward from the text: cells\n// on the wavefront jump up the ramp for a beat, then the\n// front leaves cleared field behind it.\n// \"focus\" — the field defocuses: it blurs and dims while the sharp\n// text resolves — a depth-of-field handoff.\n// \"lime-echo\" — on landing, a sparse ring of accent-colored glyphs\n// flashes once around the headline and settles.\n//\n// Fully deterministic: per-cell jitter comes from remotion's seeded random,\n// the flow from fixed sinusoids over progress, the letterform masks from a\n// one-time offscreen-canvas sample of the loaded fonts.\n// ---------------------------------------------------------------------------\n\nexport type AsciiTextSpec = {\n /** The incoming headline (used for timing and the zone styles). */\n text: string;\n /** Must match the scene's rendered text exactly. */\n fontSize: number;\n /** Concrete family list for canvas sampling (CSS vars won't resolve). */\n fontFamily: string;\n /** Default 400. */\n fontWeight?: number;\n /** Letter-spacing in em, if the scene's text carries one. Default 0. */\n letterSpacingEm?: number;\n /** Glyph color of the ASCII letterform. Default ink. */\n color?: string;\n /** Vertical offset from frame center, px. Default 0. */\n offsetY?: number;\n};\n\nexport type AsciiEnterStyle =\n | \"fade\"\n | \"clearing\"\n | \"halo\"\n | \"wave\"\n | \"focus\"\n | \"lime-echo\";\n\nexport type AsciiDissolveProps = {\n /** Row height of one glyph cell in px. Default 22 (use ~14 in text mode). */\n cellSize?: number;\n /** Glyph color. Default translucent ink. */\n colorFront?: string;\n /** Canvas behind the glyphs during the hold. Default near-black. */\n colorBack?: string;\n /** Optional second color for a sparse scattering of accent cells. */\n accentColor?: string;\n /** Share of cells rendered in the accent color, 0..1. Default 0.05. */\n accentDensity?: number;\n /** Density ramp, lightest → densest. Default \" .:-=+*#%@\". */\n ramp?: string;\n /** Monospace stack for the field. */\n fontFamily?: string;\n /** Text mode: the incoming headline (used for timing and as the zone). */\n enterText?: AsciiTextSpec;\n /** What happens around the arriving text. Default \"fade\". */\n enterStyle?: AsciiEnterStyle;\n /** Progress window over which the outgoing scene fades out. */\n exitFade?: [number, number];\n /** Progress window over which the incoming scene resolves. */\n enterFade?: [number, number];\n};\n\n// Per-cell stagger: global window progress g plus jitter j → this cell's\n// local progress. spread controls how far cells drift apart.\nconst stagger = (g: number, j: number, spread = 0.55) =>\n Math.max(0, Math.min(1, (g - j * spread) / (1 - spread)));\n\n// The field's mono advance, measured at the size the <pre> renders.\nconst measureAdvance = (fontFamily: string, fontSize: number): number => {\n const fallback = fontSize * 0.6;\n if (typeof document === \"undefined\") return fallback;\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return fallback;\n ctx.font = `400 ${fontSize}px ${fontFamily}`;\n const w = ctx.measureText(\"0\").width;\n return w > 0 ? w : fallback;\n};\n\n// Sample the headline's letterforms: draw the text once on an offscreen\n// canvas at 2× cell resolution and grade each cell by subsample coverage\n// (0..4). Edge cells get mid-ramp glyphs, core cells the densest — the\n// grading anti-aliases the letter contours, so strokes thinner than a cell\n// still read as continuous letters.\nconst buildTextMask = (\n spec: AsciiTextSpec,\n width: number,\n height: number,\n cols: number,\n rows: number,\n advance: number,\n cellH: number,\n): Uint8Array | null => {\n if (typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = cols * 2;\n canvas.height = rows * 2;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n if (!ctx) return null;\n ctx.setTransform(2 / advance, 0, 0, 2 / cellH, 0, 0);\n ctx.font = `${spec.fontWeight ?? 400} ${spec.fontSize}px ${spec.fontFamily}`;\n const spacing = (spec.letterSpacingEm ?? 0) * spec.fontSize;\n if (spacing !== 0) {\n (\n ctx as CanvasRenderingContext2D & { letterSpacing?: string }\n ).letterSpacing = `${spacing}px`;\n }\n ctx.textAlign = \"center\";\n // Canvas \"middle\" baseline is computed from the em square and lands\n // visibly ABOVE where a flex-centered DOM span puts the same text. Rebuild\n // the DOM's math instead: a flex-centered span (line-height normal) puts\n // its baseline at H/2 + (ascent - descent)/2, with ascent/descent taken\n // from the font's own metrics.\n ctx.textBaseline = \"alphabetic\";\n ctx.fillStyle = \"#fff\";\n const metrics = ctx.measureText(spec.text);\n const ascent = metrics.fontBoundingBoxAscent ?? spec.fontSize * 0.8;\n const descent = metrics.fontBoundingBoxDescent ?? spec.fontSize * 0.2;\n const baselineY = height / 2 + (ascent - descent) / 2 + (spec.offsetY ?? 0);\n ctx.fillText(spec.text, width / 2, baselineY);\n const data = ctx.getImageData(0, 0, cols * 2, rows * 2).data;\n const mask = new Uint8Array(cols * rows);\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n let hits = 0;\n if (data[(y * 2 * cols * 2 + x * 2) * 4 + 3] > 100) hits++;\n if (data[(y * 2 * cols * 2 + x * 2 + 1) * 4 + 3] > 100) hits++;\n if (data[((y * 2 + 1) * cols * 2 + x * 2) * 4 + 3] > 100) hits++;\n if (data[((y * 2 + 1) * cols * 2 + x * 2 + 1) * 4 + 3] > 100) hits++;\n mask[y * cols + x] = hits;\n }\n }\n return mask;\n};\n\nconst AsciiDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<AsciiDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n cellSize = 22,\n colorFront = \"rgba(242,242,242,0.6)\",\n colorBack = \"#0d0d10\",\n accentColor,\n accentDensity = 0.05,\n ramp = \" .:-=+*#%@\",\n fontFamily = \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n enterText,\n enterStyle = \"fade\",\n exitFade,\n enterFade,\n } = passedProps;\n const { width, height } = useVideoConfig();\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const textMode = enterText !== undefined;\n\n // The outgoing scene blurs out under the rising field.\n const exitWindow = exitFade ?? [0.14, 0.3];\n // The real text fades in while the field dissolves cell by cell.\n const enterWindow = enterFade ?? (textMode ? [0.6, 0.8] : [0.62, 0.8]);\n\n // The masks and the mono advance must be measured with the REAL webfonts.\n // The component can mount while they are still loading (a fallback font\n // would bake wrong metrics into the memoized masks and shift the letterform\n // off the scene's text) — so gate on document.fonts and hold the render.\n const [fontsReady, setFontsReady] = React.useState(\n () => typeof document === \"undefined\" || document.fonts.status === \"loaded\",\n );\n React.useEffect(() => {\n if (fontsReady || typeof document === \"undefined\") return;\n const handle = delayRender(\"ascii-dissolve: waiting for fonts\");\n let alive = true;\n document.fonts.ready.then(() => {\n if (alive) setFontsReady(true);\n continueRender(handle);\n });\n return () => {\n alive = false;\n continueRender(handle);\n };\n }, [fontsReady]);\n\n const fontSize = cellSize * 0.86;\n // biome-ignore lint/correctness/useExhaustiveDependencies: fontsReady is an intentional extra dep — remeasure the mono advance once the real webfonts load\n const advance = React.useMemo(\n () => measureAdvance(fontFamily, fontSize),\n [fontFamily, fontSize, fontsReady],\n );\n const cols = Math.ceil(width / advance);\n const rows = Math.ceil(height / cellSize) + 1;\n\n // The zone styles need to know where the incoming text sits — a capsule\n // around its center line, derived from the letterform mask's bounds. The\n // mask itself is never displayed.\n const zoneStyles: AsciiEnterStyle[] = [\n \"clearing\",\n \"halo\",\n \"wave\",\n \"lime-echo\",\n ];\n const needZone = enterText !== undefined && zoneStyles.includes(enterStyle);\n const enterMask = React.useMemo(\n () =>\n enterText && needZone && fontsReady\n ? buildTextMask(enterText, width, height, cols, rows, advance, cellSize)\n : null,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n enterText,\n needZone,\n fontsReady,\n width,\n height,\n cols,\n rows,\n advance,\n cellSize,\n ],\n );\n const enterZone = React.useMemo(() => {\n if (enterMask === null) return null;\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n if (enterMask[y * cols + x] > 0) {\n if (x < minX) minX = x;\n if (x > maxX) maxX = x;\n if (y < minY) minY = y;\n if (y > maxY) maxY = y;\n }\n }\n }\n if (maxX < minX) return null;\n return {\n x0: minX * advance,\n x1: (maxX + 1) * advance,\n cy: ((minY + maxY + 1) / 2) * cellSize,\n halfH: ((maxY - minY + 1) / 2) * cellSize,\n };\n }, [enterMask, cols, rows, advance, cellSize]);\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, exitWindow, [1, 0], clampOpts),\n filter: `blur(${interpolate(p, [exitWindow[0], exitWindow[1] + 0.06], [0, 8], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n // -------------------------------------------------------------------------\n // Envelopes.\n // -------------------------------------------------------------------------\n // Generic mode keeps the original flat envelopes; text mode staggers the\n // rise and the dissolve per cell instead, so nothing moves as one plane.\n const coverage = textMode\n ? 1\n : interpolate(p, [0.06, 0.28, 0.6, 0.9], [0, 1, 1, 0], clampOpts);\n const fieldOpacity = textMode\n ? 1\n : interpolate(p, [0.04, 0.2, 0.66, 0.94], [0, 1, 1, 0], clampOpts);\n const panelOpacity = textMode\n ? interpolate(p, [0.06, 0.24, 0.55, 0.75], [0, 1, 1, 0], clampOpts)\n : fieldOpacity;\n\n // Text-mode phase clocks. The outgoing scene blurs out as the field\n // rises; the field boils, then dissolves cell by cell while the real\n // text fades in.\n const riseG = interpolate(p, [0.04, 0.3], [0, 1], clampOpts);\n const dissolveG = interpolate(\n p,\n enterStyle === \"clearing\" ? [0.52, 0.85] : [0.5, 0.82],\n [0, 1],\n clampOpts,\n );\n\n // Style clocks for the arriving text's surroundings.\n const haloG = interpolate(p, [0.52, 0.74], [0, 1], clampOpts);\n const waveT = interpolate(p, [0.56, 0.94], [0, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.quad),\n });\n const waveR = waveT * 860; // the impulse front, px from the text capsule\n const echoFlash = interpolate(p, [0.56, 0.64, 0.82], [0, 0.9, 0], clampOpts);\n const focusBlur = interpolate(p, [0.55, 0.9], [0, 4], clampOpts);\n const focusFade = interpolate(p, [0.62, 0.94], [1, 0], clampOpts);\n\n const cx = cols / 2;\n const cy = rows / 2;\n const t = p * 5;\n const rampLen = ramp.length;\n\n const mainRows: string[] = [];\n const accentRows: string[] = [];\n const echoRows: string[] = [];\n const fieldAlive = textMode ? p < 0.999 : fieldOpacity > 0.001;\n\n if (fieldAlive) {\n for (let y = 0; y < rows; y++) {\n let mainRow = \"\";\n let accentRow = \"\";\n let echoRow = \"\";\n for (let x = 0; x < cols; x++) {\n // A slow sinusoid flow plus per-cell jitter — organic, but textual.\n const base =\n 0.5 +\n (Math.sin(x * 0.33 + t * 1.7) +\n Math.sin(y * 0.51 - t * 1.2) +\n Math.sin((x * 0.5 + y) * 0.24 + t * 0.9) +\n Math.sin(Math.hypot(x - cx, (y - cy) * 1.8) * 0.42 - t * 2.1)) /\n 8;\n const jitter = random(`ascii-${x}-${y}`);\n\n // Distance to the incoming text's capsule, for the zone styles —\n // and the plain circular distance from its center, for the wave.\n let dist = Infinity;\n let distC = Infinity;\n let s = 0; // proximity, 1 at the text's center line → 0 far away\n if (enterZone !== null) {\n const px = (x + 0.5) * advance;\n const py = (y + 0.5) * cellSize;\n const nx = Math.min(Math.max(px, enterZone.x0), enterZone.x1);\n dist = Math.hypot(px - nx, py - enterZone.cy);\n distC = Math.hypot(\n px - (enterZone.x0 + enterZone.x1) / 2,\n py - enterZone.cy,\n );\n s = Math.max(0, 1 - dist / (enterZone.halfH + 64));\n }\n\n let cellCoverage: number;\n if (!textMode) {\n cellCoverage = coverage;\n } else if (enterStyle === \"clearing\" && enterZone !== null) {\n // Dissolve order biased by proximity: cells near the headline\n // vanish first, a granular cavity opens outward.\n const order = (1 - s) * 0.6 + random(`ascii-d-${x}-${y}`) * 0.4;\n const gone = Math.max(\n 0,\n Math.min(1, (dissolveG * 1.35 - order) / 0.3),\n );\n cellCoverage = stagger(riseG, jitter) * (1 - gone);\n } else if (enterStyle === \"wave\" && enterZone !== null) {\n // The impulse front — a CIRCLE from the text's center — clears\n // the field behind it.\n const passed = Math.max(0, Math.min(1, (waveR - distC) / 55));\n cellCoverage = stagger(riseG, jitter) * (1 - passed);\n } else {\n cellCoverage =\n stagger(riseG, jitter) *\n (1 - stagger(dissolveG, random(`ascii-d-${x}-${y}`)));\n }\n\n let d = Math.max(\n 0,\n Math.min(\n 0.999,\n (base * 0.72 + jitter * 0.28) * cellCoverage * 1.2 - 0.08,\n ),\n );\n if (enterStyle === \"halo\" && enterZone !== null) {\n // A smooth radial attenuation: near cells slide down the ramp.\n d *= 1 - haloG * s;\n }\n if (enterStyle === \"wave\" && enterZone !== null && waveT > 0) {\n // Cells on the circular wavefront jump up the ramp for a beat.\n const bump = Math.exp(-(((distC - waveR) / 55) ** 2));\n d = Math.min(0.999, d + bump * 0.5);\n }\n const ch = ramp[Math.floor(d * rampLen)] ?? \" \";\n const isAccent =\n accentColor !== undefined &&\n random(`ascii-a-${x}-${y}`) < accentDensity;\n mainRow += isAccent ? \" \" : ch;\n accentRow += isAccent ? ch : \" \";\n\n // The lime echo: a sparse ring of accent glyphs around the headline.\n if (\n enterStyle === \"lime-echo\" &&\n enterZone !== null &&\n echoFlash > 0.01 &&\n dist > 8 &&\n dist < 84 &&\n ch !== \" \" &&\n random(`ascii-e-${x}-${y}`) < 0.5\n ) {\n echoRow += ch;\n } else {\n echoRow += \" \";\n }\n }\n mainRows.push(mainRow);\n accentRows.push(accentRow);\n echoRows.push(echoRow);\n }\n }\n\n // The blur must hit exactly 0 by p = 1: the entering presentation stays\n // mounted at p = 1 for the whole scene, so any residue would soften the\n // incoming scene permanently. In text mode the incoming scene resolves\n // with NO transform at all — it must sit pixel-exact under the letterform.\n const enterBlur = textMode\n ? 0\n : interpolate(\n p,\n [enterWindow[0], Math.min(1, enterWindow[1] + 0.05)],\n [10, 0],\n clampOpts,\n );\n const childStyle: React.CSSProperties = textMode\n ? { opacity: interpolate(p, enterWindow, [0, 1], clampOpts) }\n : {\n opacity: interpolate(p, enterWindow, [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [enterWindow[0], 1], [1.04, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: enterBlur > 0.01 ? `blur(${enterBlur}px)` : undefined,\n };\n\n const preStyle: React.CSSProperties = {\n margin: 0,\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n whiteSpace: \"pre\",\n fontFamily,\n fontSize,\n lineHeight: `${cellSize}px`,\n color: colorFront,\n };\n\n const renderLayer = (\n layerRows: string[],\n color: string,\n layerOpacity: number,\n ) =>\n layerOpacity > 0.001 ? (\n <pre style={{ ...preStyle, color, opacity: layerOpacity }}>\n {layerRows.join(\"\\n\")}\n </pre>\n ) : null;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n {fieldAlive ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <AbsoluteFill\n style={{ background: colorBack, opacity: panelOpacity }}\n />\n <AbsoluteFill\n style={\n enterStyle === \"focus\" && textMode\n ? {\n opacity: focusFade,\n filter:\n focusBlur > 0.01 ? `blur(${focusBlur}px)` : undefined,\n }\n : undefined\n }\n >\n {renderLayer(mainRows, colorFront, fieldOpacity)}\n {accentColor !== undefined\n ? renderLayer(accentRows, accentColor, fieldOpacity)\n : null}\n </AbsoluteFill>\n {enterStyle === \"lime-echo\"\n ? renderLayer(echoRows, accentColor ?? \"#C3E88D\", echoFlash)\n : null}\n </AbsoluteFill>\n ) : null}\n </AbsoluteFill>\n );\n};\n\nexport function asciiDissolve(\n props: AsciiDissolveProps = {},\n): TransitionPresentation<AsciiDissolveProps> {\n return {\n component: AsciiDissolvePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport React from \"react\";\nimport {\n AbsoluteFill,\n continueRender,\n delayRender,\n Easing,\n interpolate,\n random,\n useVideoConfig,\n} from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// ---------------------------------------------------------------------------\n// ascii-dissolve — the frame becomes plain text. The outgoing scene fades as\n// a fullscreen field of monospace glyphs rises over it: a deterministic\n// noise field drives each cell through a density ramp (\" .:-=+*#%@\"), so the\n// cover reads as living ASCII. It holds fully opaque long enough to be READ\n// as text, then the cells drop back down the ramp to space while the\n// incoming scene resolves beneath.\n//\n// Text mode (enterText): the outgoing scene blurs out under the rising\n// field; the incoming headline is never previewed as ascii — the field\n// dissolves cell by cell (per-cell staggered, never a flat plane) while\n// the real text fades in over it. `enterStyle` picks what happens AROUND\n// the arriving text:\n// \"fade\" — plain: staggered dissolve everywhere, text fades in.\n// \"clearing\" — the dissolve order is biased by distance to the text:\n// cells near the headline vanish first, the field opens a\n// granular cavity around it.\n// \"halo\" — a smooth radial attenuation grows around the text: near\n// cells slide down the ramp into thin glyphs, a soft dark\n// well forms behind the headline.\n// \"wave\" — one density impulse rides outward from the text: cells\n// on the wavefront jump up the ramp for a beat, then the\n// front leaves cleared field behind it.\n// \"focus\" — the field defocuses: it blurs and dims while the sharp\n// text resolves — a depth-of-field handoff.\n// \"lime-echo\" — on landing, a sparse ring of accent-colored glyphs\n// flashes once around the headline and settles.\n//\n// Fully deterministic: per-cell jitter comes from remotion's seeded random,\n// the flow from fixed sinusoids over progress, the letterform masks from a\n// one-time offscreen-canvas sample of the loaded fonts.\n// ---------------------------------------------------------------------------\n\nexport type AsciiTextSpec = {\n /** The incoming headline (used for timing and the zone styles). */\n text: string;\n /** Must match the scene's rendered text exactly. */\n fontSize: number;\n /** Concrete family list for canvas sampling (CSS vars won't resolve). */\n fontFamily: string;\n /** Default 400. */\n fontWeight?: number;\n /** Letter-spacing in em, if the scene's text carries one. Default 0. */\n letterSpacingEm?: number;\n /** Glyph color of the ASCII letterform. Default ink. */\n color?: string;\n /** Vertical offset from frame center, px. Default 0. */\n offsetY?: number;\n};\n\nexport type AsciiEnterStyle =\n | \"fade\"\n | \"clearing\"\n | \"halo\"\n | \"wave\"\n | \"focus\"\n | \"lime-echo\";\n\nexport type AsciiDissolveProps = {\n /** Row height of one glyph cell in px. Default 22 (use ~14 in text mode). */\n cellSize?: number;\n /** Glyph color. Default translucent ink. */\n colorFront?: string;\n /** Canvas behind the glyphs during the hold. Default near-black. */\n colorBack?: string;\n /** Optional second color for a sparse scattering of accent cells. */\n accentColor?: string;\n /** Share of cells rendered in the accent color, 0..1. Default 0.05. */\n accentDensity?: number;\n /** Density ramp, lightest → densest. Default \" .:-=+*#%@\". */\n ramp?: string;\n /** Monospace stack for the field. */\n fontFamily?: string;\n /** Text mode: the incoming headline (used for timing and as the zone). */\n enterText?: AsciiTextSpec;\n /** What happens around the arriving text. Default \"fade\". */\n enterStyle?: AsciiEnterStyle;\n /** Progress window over which the outgoing scene fades out. */\n exitFade?: [number, number];\n /** Progress window over which the incoming scene resolves. */\n enterFade?: [number, number];\n};\n\n// Per-cell stagger: global window progress g plus jitter j → this cell's\n// local progress. spread controls how far cells drift apart.\nconst stagger = (g: number, j: number, spread = 0.55) =>\n Math.max(0, Math.min(1, (g - j * spread) / (1 - spread)));\n\n// The field's mono advance, measured at the size the <pre> renders.\nconst measureAdvance = (fontFamily: string, fontSize: number): number => {\n const fallback = fontSize * 0.6;\n if (typeof document === \"undefined\") return fallback;\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return fallback;\n ctx.font = `400 ${fontSize}px ${fontFamily}`;\n const w = ctx.measureText(\"0\").width;\n return w > 0 ? w : fallback;\n};\n\n// Sample the headline's letterforms: draw the text once on an offscreen\n// canvas at 2× cell resolution and grade each cell by subsample coverage\n// (0..4). Edge cells get mid-ramp glyphs, core cells the densest — the\n// grading anti-aliases the letter contours, so strokes thinner than a cell\n// still read as continuous letters.\nconst buildTextMask = (\n spec: AsciiTextSpec,\n width: number,\n height: number,\n cols: number,\n rows: number,\n advance: number,\n cellH: number,\n): Uint8Array | null => {\n if (typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = cols * 2;\n canvas.height = rows * 2;\n const ctx = canvas.getContext(\"2d\", { willReadFrequently: true });\n if (!ctx) return null;\n ctx.setTransform(2 / advance, 0, 0, 2 / cellH, 0, 0);\n ctx.font = `${spec.fontWeight ?? 400} ${spec.fontSize}px ${spec.fontFamily}`;\n const spacing = (spec.letterSpacingEm ?? 0) * spec.fontSize;\n if (spacing !== 0) {\n (\n ctx as CanvasRenderingContext2D & { letterSpacing?: string }\n ).letterSpacing = `${spacing}px`;\n }\n ctx.textAlign = \"center\";\n // Canvas \"middle\" baseline is computed from the em square and lands\n // visibly ABOVE where a flex-centered DOM span puts the same text. Rebuild\n // the DOM's math instead: a flex-centered span (line-height normal) puts\n // its baseline at H/2 + (ascent - descent)/2, with ascent/descent taken\n // from the font's own metrics.\n ctx.textBaseline = \"alphabetic\";\n ctx.fillStyle = \"#fff\";\n const metrics = ctx.measureText(spec.text);\n const ascent = metrics.fontBoundingBoxAscent ?? spec.fontSize * 0.8;\n const descent = metrics.fontBoundingBoxDescent ?? spec.fontSize * 0.2;\n const baselineY = height / 2 + (ascent - descent) / 2 + (spec.offsetY ?? 0);\n ctx.fillText(spec.text, width / 2, baselineY);\n const data = ctx.getImageData(0, 0, cols * 2, rows * 2).data;\n const mask = new Uint8Array(cols * rows);\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n let hits = 0;\n if (data[(y * 2 * cols * 2 + x * 2) * 4 + 3] > 100) hits++;\n if (data[(y * 2 * cols * 2 + x * 2 + 1) * 4 + 3] > 100) hits++;\n if (data[((y * 2 + 1) * cols * 2 + x * 2) * 4 + 3] > 100) hits++;\n if (data[((y * 2 + 1) * cols * 2 + x * 2 + 1) * 4 + 3] > 100) hits++;\n mask[y * cols + x] = hits;\n }\n }\n return mask;\n};\n\nconst AsciiDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<AsciiDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n cellSize = 22,\n colorFront = \"rgba(242,242,242,0.6)\",\n colorBack = \"#0d0d10\",\n accentColor,\n accentDensity = 0.05,\n ramp = \" .:-=+*#%@\",\n fontFamily = \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n enterText,\n enterStyle = \"fade\",\n exitFade,\n enterFade,\n } = passedProps;\n const { width, height } = useVideoConfig();\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const textMode = enterText !== undefined;\n\n // The outgoing scene blurs out under the rising field.\n const exitWindow = exitFade ?? [0.14, 0.3];\n // The real text fades in while the field dissolves cell by cell.\n const enterWindow = enterFade ?? (textMode ? [0.6, 0.8] : [0.62, 0.8]);\n\n // The masks and the mono advance must be measured with the REAL webfonts.\n // The component can mount while they are still loading (a fallback font\n // would bake wrong metrics into the memoized masks and shift the letterform\n // off the scene's text) — so gate on document.fonts and hold the render.\n const [fontsReady, setFontsReady] = React.useState(\n () => typeof document === \"undefined\" || document.fonts.status === \"loaded\",\n );\n React.useEffect(() => {\n if (fontsReady || typeof document === \"undefined\") return;\n const handle = delayRender(\"ascii-dissolve: waiting for fonts\");\n let alive = true;\n document.fonts.ready.then(() => {\n if (alive) setFontsReady(true);\n continueRender(handle);\n });\n return () => {\n alive = false;\n continueRender(handle);\n };\n }, [fontsReady]);\n\n const fontSize = cellSize * 0.86;\n // biome-ignore lint/correctness/useExhaustiveDependencies: fontsReady is an intentional extra dep — remeasure the mono advance once the real webfonts load\n const advance = React.useMemo(\n () => measureAdvance(fontFamily, fontSize),\n [fontFamily, fontSize, fontsReady],\n );\n const cols = Math.ceil(width / advance);\n const rows = Math.ceil(height / cellSize) + 1;\n\n // The zone styles need to know where the incoming text sits — a capsule\n // around its center line, derived from the letterform mask's bounds. The\n // mask itself is never displayed.\n const zoneStyles: AsciiEnterStyle[] = [\n \"clearing\",\n \"halo\",\n \"wave\",\n \"lime-echo\",\n ];\n const needZone = enterText !== undefined && zoneStyles.includes(enterStyle);\n const enterMask = React.useMemo(\n () =>\n enterText && needZone && fontsReady\n ? buildTextMask(enterText, width, height, cols, rows, advance, cellSize)\n : null,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n enterText,\n needZone,\n fontsReady,\n width,\n height,\n cols,\n rows,\n advance,\n cellSize,\n ],\n );\n const enterZone = React.useMemo(() => {\n if (enterMask === null) return null;\n let minX = Infinity;\n let maxX = -Infinity;\n let minY = Infinity;\n let maxY = -Infinity;\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n if (enterMask[y * cols + x] > 0) {\n if (x < minX) minX = x;\n if (x > maxX) maxX = x;\n if (y < minY) minY = y;\n if (y > maxY) maxY = y;\n }\n }\n }\n if (maxX < minX) return null;\n return {\n x0: minX * advance,\n x1: (maxX + 1) * advance,\n cy: ((minY + maxY + 1) / 2) * cellSize,\n halfH: ((maxY - minY + 1) / 2) * cellSize,\n };\n }, [enterMask, cols, rows, advance, cellSize]);\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, exitWindow, [1, 0], clampOpts),\n filter: `blur(${interpolate(p, [exitWindow[0], exitWindow[1] + 0.06], [0, 8], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n // -------------------------------------------------------------------------\n // Envelopes.\n // -------------------------------------------------------------------------\n // Generic mode keeps the original flat envelopes; text mode staggers the\n // rise and the dissolve per cell instead, so nothing moves as one plane.\n const coverage = textMode\n ? 1\n : interpolate(p, [0.06, 0.28, 0.6, 0.9], [0, 1, 1, 0], clampOpts);\n const fieldOpacity = textMode\n ? 1\n : interpolate(p, [0.04, 0.2, 0.66, 0.94], [0, 1, 1, 0], clampOpts);\n const panelOpacity = textMode\n ? interpolate(p, [0.06, 0.24, 0.55, 0.75], [0, 1, 1, 0], clampOpts)\n : fieldOpacity;\n\n // Text-mode phase clocks. The outgoing scene blurs out as the field\n // rises; the field boils, then dissolves cell by cell while the real\n // text fades in.\n const riseG = interpolate(p, [0.04, 0.3], [0, 1], clampOpts);\n const dissolveG = interpolate(\n p,\n enterStyle === \"clearing\" ? [0.52, 0.85] : [0.5, 0.82],\n [0, 1],\n clampOpts,\n );\n\n // Style clocks for the arriving text's surroundings.\n const haloG = interpolate(p, [0.52, 0.74], [0, 1], clampOpts);\n const waveT = interpolate(p, [0.56, 0.94], [0, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.quad),\n });\n const waveR = waveT * 860; // the impulse front, px from the text capsule\n const echoFlash = interpolate(p, [0.56, 0.64, 0.82], [0, 0.9, 0], clampOpts);\n const focusBlur = interpolate(p, [0.55, 0.9], [0, 4], clampOpts);\n const focusFade = interpolate(p, [0.62, 0.94], [1, 0], clampOpts);\n\n const cx = cols / 2;\n const cy = rows / 2;\n const t = p * 5;\n const rampLen = ramp.length;\n\n const mainRows: string[] = [];\n const accentRows: string[] = [];\n const echoRows: string[] = [];\n const fieldAlive = textMode ? p < 0.999 : fieldOpacity > 0.001;\n\n if (fieldAlive) {\n for (let y = 0; y < rows; y++) {\n let mainRow = \"\";\n let accentRow = \"\";\n let echoRow = \"\";\n for (let x = 0; x < cols; x++) {\n // A slow sinusoid flow plus per-cell jitter — organic, but textual.\n const base =\n 0.5 +\n (Math.sin(x * 0.33 + t * 1.7) +\n Math.sin(y * 0.51 - t * 1.2) +\n Math.sin((x * 0.5 + y) * 0.24 + t * 0.9) +\n Math.sin(Math.hypot(x - cx, (y - cy) * 1.8) * 0.42 - t * 2.1)) /\n 8;\n const jitter = random(`ascii-${x}-${y}`);\n\n // Distance to the incoming text's capsule, for the zone styles —\n // and the plain circular distance from its center, for the wave.\n let dist = Infinity;\n let distC = Infinity;\n let s = 0; // proximity, 1 at the text's center line → 0 far away\n if (enterZone !== null) {\n const px = (x + 0.5) * advance;\n const py = (y + 0.5) * cellSize;\n const nx = Math.min(Math.max(px, enterZone.x0), enterZone.x1);\n dist = Math.hypot(px - nx, py - enterZone.cy);\n distC = Math.hypot(\n px - (enterZone.x0 + enterZone.x1) / 2,\n py - enterZone.cy,\n );\n s = Math.max(0, 1 - dist / (enterZone.halfH + 64));\n }\n\n let cellCoverage: number;\n if (!textMode) {\n cellCoverage = coverage;\n } else if (enterStyle === \"clearing\" && enterZone !== null) {\n // Dissolve order biased by proximity: cells near the headline\n // vanish first, a granular cavity opens outward.\n const order = (1 - s) * 0.6 + random(`ascii-d-${x}-${y}`) * 0.4;\n const gone = Math.max(\n 0,\n Math.min(1, (dissolveG * 1.35 - order) / 0.3),\n );\n cellCoverage = stagger(riseG, jitter) * (1 - gone);\n } else if (enterStyle === \"wave\" && enterZone !== null) {\n // The impulse front — a CIRCLE from the text's center — clears\n // the field behind it.\n const passed = Math.max(0, Math.min(1, (waveR - distC) / 55));\n cellCoverage = stagger(riseG, jitter) * (1 - passed);\n } else {\n cellCoverage =\n stagger(riseG, jitter) *\n (1 - stagger(dissolveG, random(`ascii-d-${x}-${y}`)));\n }\n\n let d = Math.max(\n 0,\n Math.min(\n 0.999,\n (base * 0.72 + jitter * 0.28) * cellCoverage * 1.2 - 0.08,\n ),\n );\n if (enterStyle === \"halo\" && enterZone !== null) {\n // A smooth radial attenuation: near cells slide down the ramp.\n d *= 1 - haloG * s;\n }\n if (enterStyle === \"wave\" && enterZone !== null && waveT > 0) {\n // Cells on the circular wavefront jump up the ramp for a beat.\n const bump = Math.exp(-(((distC - waveR) / 55) ** 2));\n d = Math.min(0.999, d + bump * 0.5);\n }\n const ch = ramp[Math.floor(d * rampLen)] ?? \" \";\n const isAccent =\n accentColor !== undefined &&\n random(`ascii-a-${x}-${y}`) < accentDensity;\n mainRow += isAccent ? \" \" : ch;\n accentRow += isAccent ? ch : \" \";\n\n // The lime echo: a sparse ring of accent glyphs around the headline.\n if (\n enterStyle === \"lime-echo\" &&\n enterZone !== null &&\n echoFlash > 0.01 &&\n dist > 8 &&\n dist < 84 &&\n ch !== \" \" &&\n random(`ascii-e-${x}-${y}`) < 0.5\n ) {\n echoRow += ch;\n } else {\n echoRow += \" \";\n }\n }\n mainRows.push(mainRow);\n accentRows.push(accentRow);\n echoRows.push(echoRow);\n }\n }\n\n // The blur must hit exactly 0 by p = 1: the entering presentation stays\n // mounted at p = 1 for the whole scene, so any residue would soften the\n // incoming scene permanently. In text mode the incoming scene resolves\n // with NO transform at all — it must sit pixel-exact under the letterform.\n const enterBlur = textMode\n ? 0\n : interpolate(\n p,\n [enterWindow[0], Math.min(1, enterWindow[1] + 0.05)],\n [10, 0],\n clampOpts,\n );\n const childStyle: React.CSSProperties = textMode\n ? { opacity: interpolate(p, enterWindow, [0, 1], clampOpts) }\n : {\n opacity: interpolate(p, enterWindow, [0, 1], clampOpts),\n scale: `${interpolate(p, [enterWindow[0], 1], [1.04, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })}`,\n filter: enterBlur > 0.01 ? `blur(${enterBlur}px)` : undefined,\n };\n\n const preStyle: React.CSSProperties = {\n margin: 0,\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n whiteSpace: \"pre\",\n fontFamily,\n fontSize,\n lineHeight: `${cellSize}px`,\n color: colorFront,\n };\n\n const renderLayer = (\n layerRows: string[],\n color: string,\n layerOpacity: number,\n ) =>\n layerOpacity > 0.001 ? (\n <pre style={{ ...preStyle, color, opacity: layerOpacity }}>\n {layerRows.join(\"\\n\")}\n </pre>\n ) : null;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n {fieldAlive ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <AbsoluteFill\n style={{ background: colorBack, opacity: panelOpacity }}\n />\n <AbsoluteFill\n style={\n enterStyle === \"focus\" && textMode\n ? {\n opacity: focusFade,\n filter:\n focusBlur > 0.01 ? `blur(${focusBlur}px)` : undefined,\n }\n : undefined\n }\n >\n {renderLayer(mainRows, colorFront, fieldOpacity)}\n {accentColor !== undefined\n ? renderLayer(accentRows, accentColor, fieldOpacity)\n : null}\n </AbsoluteFill>\n {enterStyle === \"lime-echo\"\n ? renderLayer(echoRows, accentColor ?? \"#C3E88D\", echoFlash)\n : null}\n </AbsoluteFill>\n ) : null}\n </AbsoluteFill>\n );\n};\n\nexport function asciiDissolve(\n props: AsciiDissolveProps = {},\n): TransitionPresentation<AsciiDissolveProps> {\n return {\n component: AsciiDissolvePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/ascii-dissolve.tsx"
}
diff --git a/registry-artifacts/blur-out-up.json b/registry-artifacts/blur-out-up.json
index 3db0941b..8fb82657 100644
--- a/registry-artifacts/blur-out-up.json
+++ b/registry-artifacts/blur-out-up.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/blur-out-up/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BlurOutUp({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const enterTravel = 6;\n const exitDur = 14;\n const exitTravelFrom = 8;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterTravel], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -14],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BlurOutUp({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const enterTravel = 6;\n const exitDur = 14;\n const exitTravelFrom = 8;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterTravel], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -14],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/blur-out-up.tsx"
}
diff --git a/registry-artifacts/bottom-up-letters.json b/registry-artifacts/bottom-up-letters.json
index 2303f13c..ad9286d6 100644
--- a/registry-artifacts/bottom-up-letters.json
+++ b/registry-artifacts/bottom-up-letters.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/bottom-up-letters/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BottomUpLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BottomUpLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/bottom-up-letters.tsx"
}
diff --git a/registry-artifacts/caret-wipe.json b/registry-artifacts/caret-wipe.json
index 176f66c4..465efeae 100644
--- a/registry-artifacts/caret-wipe.json
+++ b/registry-artifacts/caret-wipe.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/caret-wipe/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type CaretWipeProps = {\n /** Sweep direction. `right` types the screen left→right; `left` reverses it. */\n direction?: \"left\" | \"right\";\n /** The caret's color — the remocn lime by default. */\n caretColor?: string;\n /** Caret bar width in px. */\n caretWidth?: number;\n /** Caret bar height as a fraction of frame height (0–1), vertically centered. */\n caretHeight?: number;\n};\n\n// ---------------------------------------------------------------------------\n// caret-wipe — a typographic scene transition.\n//\n// A single tall caret (the remocn text cursor) sweeps across the frame in one\n// eased pass. The caret IS the wipe boundary: the region it has PASSED shows\n// the incoming scene (freshly \"typed in\" — it settles down and un-blurs just\n// behind the caret), while the region it has NOT reached still shows the\n// outgoing scene (being \"backspaced\" — it lifts and blurs as it's consumed).\n//\n// Both scenes share whatever backdrop sits behind the TransitionSeries, so the\n// complementary clips never expose a seam. Pure frame-driven interpolate — no\n// CSS keyframes — so it seeks correctly and renders identically every time.\n// ---------------------------------------------------------------------------\nconst CaretWipePresentation: React.FC<\n TransitionPresentationComponentProps<CaretWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n direction = \"right\",\n caretColor = \"#C3E88D\",\n caretWidth = 3,\n caretHeight = 0.5,\n } = passedProps;\n\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const goingRight = direction === \"right\";\n\n // Eased sweep so the caret decelerates as it lands the last column.\n const eased = interpolate(p, [0, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.65, 0, 0.35, 1),\n });\n // Caret position as a percent of frame width; the wipe boundary.\n const caretX = goingRight ? eased * 100 : (1 - eased) * 100;\n\n if (!entering) {\n // Outgoing: keep only the column the caret hasn't reached yet, and let it\n // lift + blur as it's consumed (backspaced).\n const keep = goingRight\n ? `inset(0 0 0 ${caretX}%)` // keep the right band [caretX, 100]\n : `inset(0 ${100 - caretX}% 0 0)`; // keep the left band [0, caretX]\n return (\n <AbsoluteFill\n style={{\n clipPath: keep,\n WebkitClipPath: keep,\n transform: `translateY(${interpolate(p, [0, 1], [0, -6], clampOpts)}px)`,\n filter: `blur(${interpolate(p, [0.1, 1], [0, 4], clampOpts)}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n }\n\n // Incoming: reveal only the column the caret has already passed, and let it\n // settle down + sharpen just behind the caret (typed in).\n const reveal = goingRight\n ? `inset(0 ${100 - caretX}% 0 0)` // reveal the left band [0, caretX]\n : `inset(0 0 0 ${caretX}%)`; // reveal the right band [caretX, 100]\n\n // The caret fades in at the very start and out at the very end so it never\n // pops on/off at the transition's frame edges.\n const caretOpacity = interpolate(\n p,\n [0, 0.08, 0.92, 1],\n [0, 1, 1, 0],\n clampOpts,\n );\n\n return (\n <AbsoluteFill>\n {/* Freshly typed content, clipped to the passed column. */}\n <AbsoluteFill\n style={{\n clipPath: reveal,\n WebkitClipPath: reveal,\n transform: `translateY(${interpolate(p, [0, 1], [3, 0], clampOpts)}px)`,\n filter: `blur(${interpolate(p, [0, 0.8], [2, 0], clampOpts)}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n\n {/* The caret — drawn on top, unclipped, only in the entering pass so it\n appears exactly once. */}\n <AbsoluteFill style={{ pointerEvents: \"none\", opacity: caretOpacity }}>\n <div\n style={{\n position: \"absolute\",\n left: `${caretX}%`,\n top: `${(1 - caretHeight) * 50}%`,\n height: `${caretHeight * 100}%`,\n width: caretWidth,\n transform: \"translateX(-50%)\",\n background: caretColor,\n borderRadius: caretWidth,\n boxShadow: `0 0 18px ${caretColor}, 0 0 6px ${caretColor}`,\n }}\n />\n </AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function caretWipe(\n props: CaretWipeProps = {},\n): TransitionPresentation<CaretWipeProps> {\n return {\n component: CaretWipePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type CaretWipeProps = {\n /** Sweep direction. `right` types the screen left→right; `left` reverses it. */\n direction?: \"left\" | \"right\";\n /** The caret's color — the remocn lime by default. */\n caretColor?: string;\n /** Caret bar width in px. */\n caretWidth?: number;\n /** Caret bar height as a fraction of frame height (0–1), vertically centered. */\n caretHeight?: number;\n};\n\n// ---------------------------------------------------------------------------\n// caret-wipe — a typographic scene transition.\n//\n// A single tall caret (the remocn text cursor) sweeps across the frame in one\n// eased pass. The caret IS the wipe boundary: the region it has PASSED shows\n// the incoming scene (freshly \"typed in\" — it settles down and un-blurs just\n// behind the caret), while the region it has NOT reached still shows the\n// outgoing scene (being \"backspaced\" — it lifts and blurs as it's consumed).\n//\n// Both scenes share whatever backdrop sits behind the TransitionSeries, so the\n// complementary clips never expose a seam. Pure frame-driven interpolate — no\n// CSS keyframes — so it seeks correctly and renders identically every time.\n// ---------------------------------------------------------------------------\nconst CaretWipePresentation: React.FC<\n TransitionPresentationComponentProps<CaretWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n direction = \"right\",\n caretColor = \"#C3E88D\",\n caretWidth = 3,\n caretHeight = 0.5,\n } = passedProps;\n\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const goingRight = direction === \"right\";\n\n // Eased sweep so the caret decelerates as it lands the last column.\n const eased = interpolate(p, [0, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.65, 0, 0.35, 1),\n });\n // Caret position as a percent of frame width; the wipe boundary.\n const caretX = goingRight ? eased * 100 : (1 - eased) * 100;\n\n if (!entering) {\n // Outgoing: keep only the column the caret hasn't reached yet, and let it\n // lift + blur as it's consumed (backspaced).\n const keep = goingRight\n ? `inset(0 0 0 ${caretX}%)` // keep the right band [caretX, 100]\n : `inset(0 ${100 - caretX}% 0 0)`; // keep the left band [0, caretX]\n return (\n <AbsoluteFill\n style={{\n clipPath: keep,\n WebkitClipPath: keep,\n translate: `0 ${interpolate(p, [0, 1], [0, -6], clampOpts)}px`,\n filter: `blur(${interpolate(p, [0.1, 1], [0, 4], clampOpts)}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n }\n\n // Incoming: reveal only the column the caret has already passed, and let it\n // settle down + sharpen just behind the caret (typed in).\n const reveal = goingRight\n ? `inset(0 ${100 - caretX}% 0 0)` // reveal the left band [0, caretX]\n : `inset(0 0 0 ${caretX}%)`; // reveal the right band [caretX, 100]\n\n // The caret fades in at the very start and out at the very end so it never\n // pops on/off at the transition's frame edges.\n const caretOpacity = interpolate(\n p,\n [0, 0.08, 0.92, 1],\n [0, 1, 1, 0],\n clampOpts,\n );\n\n return (\n <AbsoluteFill>\n {/* Freshly typed content, clipped to the passed column. */}\n <AbsoluteFill\n style={{\n clipPath: reveal,\n WebkitClipPath: reveal,\n translate: `0 ${interpolate(p, [0, 1], [3, 0], clampOpts)}px`,\n filter: `blur(${interpolate(p, [0, 0.8], [2, 0], clampOpts)}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n\n {/* The caret — drawn on top, unclipped, only in the entering pass so it\n appears exactly once. */}\n <AbsoluteFill style={{ pointerEvents: \"none\", opacity: caretOpacity }}>\n <div\n style={{\n position: \"absolute\",\n left: `${caretX}%`,\n top: `${(1 - caretHeight) * 50}%`,\n height: `${caretHeight * 100}%`,\n width: caretWidth,\n translate: \"-50%\",\n background: caretColor,\n borderRadius: caretWidth,\n boxShadow: `0 0 18px ${caretColor}, 0 0 6px ${caretColor}`,\n }}\n />\n </AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function caretWipe(\n props: CaretWipeProps = {},\n): TransitionPresentation<CaretWipeProps> {\n return {\n component: CaretWipePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/caret-wipe.tsx"
}
diff --git a/registry-artifacts/chat-gpt.json b/registry-artifacts/chat-gpt.json
index 986a9227..7b857705 100644
--- a/registry-artifacts/chat-gpt.json
+++ b/registry-artifacts/chat-gpt.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/chat-gpt/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface ChatGptProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n inputBg: string;\n inputBorder: string;\n fg: string;\n fgMuted: string;\n chipBorder: string;\n chipFg: string;\n sendBg: string;\n sendArrow: string;\n iconColor: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n inputBg: \"#FFFFFF\",\n inputBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#E3E3E3\",\n chipFg: \"#5D5D5D\",\n sendBg: \"#0D0D0D\",\n sendArrow: \"#FFFFFF\",\n iconColor: \"#5D5D5D\",\n },\n dark: {\n page: \"#212121\",\n inputBg: \"#303030\",\n inputBorder: \"#454545\",\n fg: \"#ECECEC\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#454545\",\n chipFg: \"#C5C5C5\",\n sendBg: \"#FFFFFF\",\n sendArrow: \"#0D0D0D\",\n iconColor: \"#C5C5C5\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ImageIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Create an image</title>\n <rect\n x={3}\n y={4}\n width={18}\n height={16}\n rx={3}\n stroke={color}\n strokeWidth={1.7}\n />\n <circle cx={8.5} cy={9} r={1.6} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M5 18l5-5 4 4 2-2 3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PencilIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Write or edit</title>\n <path\n d=\"M4 20h4L19 9a2.1 2.1 0 00-3-3L5 17v3z\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M14 7l3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction GlobeIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Look something up</title>\n <circle cx={12} cy={12} r={9} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M3 12h18M12 3c2.5 2.5 2.5 15 0 18M12 3c-2.5 2.5-2.5 15 0 18\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction SuggestionChip({\n label,\n border,\n color,\n icon,\n}: {\n label: string;\n border: string;\n color: string;\n icon: React.ReactNode;\n}) {\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 16px\",\n borderRadius: 20,\n border: `1px solid ${border}`,\n color,\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n }}\n >\n {icon}\n <span>{label}</span>\n </div>\n );\n}\n\nexport function ChatGpt({\n greeting = \"What's on your mind today?\",\n placeholder = \"Ask anything\",\n prompt = \"Make a sunset over a calm ocean\",\n accentColor = \"#2F6FED\",\n speed = 1,\n}: ChatGptProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const pillFade = fadeUpAt(frame * speed, [10, 26]);\n const chipsFade = fadeUpAt(frame * speed, [16, 32]);\n\n const pillWidth = 820;\n const pillLeft = (refW - pillWidth) / 2;\n const pillTop = 300;\n const pillHeight = 64;\n const morphSize = 44;\n\n const chipsOpacity = chipsFade.opacity * (1 - morph);\n const chipsShift = chipsFade.translateY + 8 * morph;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 196,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 40,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: pillLeft,\n top: pillTop,\n width: pillWidth,\n height: pillHeight,\n background: t.inputBg,\n border: `1px solid ${t.inputBorder}`,\n borderRadius: 32,\n boxShadow: \"0 8px 30px -14px rgba(13,13,13,0.14)\",\n opacity: pillFade.opacity,\n transform: `translateY(${pillFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 20,\n paddingRight: 12,\n boxSizing: \"border-box\",\n }}\n >\n <PlusIcon size={24} color={t.fg} />\n\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n marginLeft: 14,\n fontFamily: SANS_FAMILY,\n fontSize: 19,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 40,\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <MicIcon size={22} color={t.iconColor} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: accentColor,\n opacity: 1 - morph,\n transform: `scale(${1 - 0.1 * morph})`,\n }}\n >\n <WaveformIcon size={22} color=\"#FFFFFF\" />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: t.sendBg,\n opacity: morph,\n transform: `scale(${0.8 + 0.2 * morph})`,\n }}\n >\n <ArrowUpIcon size={22} color={t.sendArrow} />\n </div>\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: pillTop + pillHeight + 24,\n width: refW,\n display: \"flex\",\n justifyContent: \"center\",\n gap: 12,\n opacity: chipsOpacity,\n transform: `translateY(${chipsShift}px)`,\n }}\n >\n <SuggestionChip\n label=\"Create an image\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<ImageIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Write or edit\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<PencilIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Look something up\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<GlobeIcon size={18} color={t.chipFg} />}\n />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface ChatGptProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n inputBg: string;\n inputBorder: string;\n fg: string;\n fgMuted: string;\n chipBorder: string;\n chipFg: string;\n sendBg: string;\n sendArrow: string;\n iconColor: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n inputBg: \"#FFFFFF\",\n inputBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#E3E3E3\",\n chipFg: \"#5D5D5D\",\n sendBg: \"#0D0D0D\",\n sendArrow: \"#FFFFFF\",\n iconColor: \"#5D5D5D\",\n },\n dark: {\n page: \"#212121\",\n inputBg: \"#303030\",\n inputBorder: \"#454545\",\n fg: \"#ECECEC\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#454545\",\n chipFg: \"#C5C5C5\",\n sendBg: \"#FFFFFF\",\n sendArrow: \"#0D0D0D\",\n iconColor: \"#C5C5C5\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ImageIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Create an image</title>\n <rect\n x={3}\n y={4}\n width={18}\n height={16}\n rx={3}\n stroke={color}\n strokeWidth={1.7}\n />\n <circle cx={8.5} cy={9} r={1.6} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M5 18l5-5 4 4 2-2 3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PencilIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Write or edit</title>\n <path\n d=\"M4 20h4L19 9a2.1 2.1 0 00-3-3L5 17v3z\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M14 7l3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction GlobeIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Look something up</title>\n <circle cx={12} cy={12} r={9} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M3 12h18M12 3c2.5 2.5 2.5 15 0 18M12 3c-2.5 2.5-2.5 15 0 18\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction SuggestionChip({\n label,\n border,\n color,\n icon,\n}: {\n label: string;\n border: string;\n color: string;\n icon: React.ReactNode;\n}) {\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 16px\",\n borderRadius: 20,\n border: `1px solid ${border}`,\n color,\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n }}\n >\n {icon}\n <span>{label}</span>\n </div>\n );\n}\n\nexport function ChatGpt({\n greeting = \"What's on your mind today?\",\n placeholder = \"Ask anything\",\n prompt = \"Make a sunset over a calm ocean\",\n accentColor = \"#2F6FED\",\n speed = 1,\n}: ChatGptProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const pillFade = fadeUpAt(frame * speed, [10, 26]);\n const chipsFade = fadeUpAt(frame * speed, [16, 32]);\n\n const pillWidth = 820;\n const pillLeft = (refW - pillWidth) / 2;\n const pillTop = 300;\n const pillHeight = 64;\n const morphSize = 44;\n\n const chipsOpacity = chipsFade.opacity * (1 - morph);\n const chipsShift = chipsFade.translateY + 8 * morph;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 196,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 40,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n translate: `0 ${headingFade.translateY + intro.translateY * 0.4}px`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: pillLeft,\n top: pillTop,\n width: pillWidth,\n height: pillHeight,\n background: t.inputBg,\n border: `1px solid ${t.inputBorder}`,\n borderRadius: 32,\n boxShadow: \"0 8px 30px -14px rgba(13,13,13,0.14)\",\n opacity: pillFade.opacity,\n translate: `0 ${pillFade.translateY + intro.translateY * 0.6}px`,\n scale: `${intro.scale}`,\n transformOrigin: \"center top\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 20,\n paddingRight: 12,\n boxSizing: \"border-box\",\n }}\n >\n <PlusIcon size={24} color={t.fg} />\n\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n marginLeft: 14,\n fontFamily: SANS_FAMILY,\n fontSize: 19,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 40,\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <MicIcon size={22} color={t.iconColor} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: accentColor,\n opacity: 1 - morph,\n scale: `${1 - 0.1 * morph}`,\n }}\n >\n <WaveformIcon size={22} color=\"#FFFFFF\" />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: t.sendBg,\n opacity: morph,\n scale: `${0.8 + 0.2 * morph}`,\n }}\n >\n <ArrowUpIcon size={22} color={t.sendArrow} />\n </div>\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: pillTop + pillHeight + 24,\n width: refW,\n display: \"flex\",\n justifyContent: \"center\",\n gap: 12,\n opacity: chipsOpacity,\n translate: `0 ${chipsShift}px`,\n }}\n >\n <SuggestionChip\n label=\"Create an image\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<ImageIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Write or edit\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<PencilIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Look something up\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<GlobeIcon size={18} color={t.chipFg} />}\n />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/chat-gpt.tsx"
}
diff --git a/registry-artifacts/chat-to-preview-layout.json b/registry-artifacts/chat-to-preview-layout.json
index 444c480b..632dd167 100644
--- a/registry-artifacts/chat-to-preview-layout.json
+++ b/registry-artifacts/chat-to-preview-layout.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/chat-to-preview-layout/index.tsx",
- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nexport function ChatToPreviewLayout({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n transform: `translateX(${previewTx}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nexport function ChatToPreviewLayout({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n translate: `${previewTx}px`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/chat-to-preview-layout.tsx"
}
diff --git a/registry-artifacts/claude-chat.json b/registry-artifacts/claude-chat.json
index ab1113de..743a47a9 100644
--- a/registry-artifacts/claude-chat.json
+++ b/registry-artifacts/claude-chat.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/claude-chat/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont as loadBodyFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadBodyFont();\n\nexport interface ClaudeChatProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n modelTier?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n placeholder: string;\n iconBtnBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#F5F4EF\",\n cardBg: \"#FFFFFF\",\n cardBorder: \"#E8E5DD\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n placeholder: \"#A3A097\",\n iconBtnBorder: \"#E0DDD4\",\n },\n dark: {\n page: \"#262624\",\n cardBg: \"#1F1E1D\",\n cardBorder: \"#3A3936\",\n fg: \"#F0EEE6\",\n fgMuted: \"#9B9892\",\n placeholder: \"#73726C\",\n iconBtnBorder: \"#3A3936\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nexport function introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nexport function fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction ChevronDown({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction SendIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V5M12 5l-6 6M12 5l6 6\"\n stroke=\"#FFFFFF\"\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IconButton({\n size,\n border,\n children,\n}: {\n size: number;\n border: string;\n children: React.ReactNode;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `1px solid ${border}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport function ClaudeChat({\n placeholder = \"Try: draft an email · summarize a doc · plan your week\",\n prompt = \"Draft a launch tweet for our new release\",\n modelName = \"Opus 4.8\",\n modelTier = \"Max\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeChatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const cardFade = fadeUpAt(frame * speed, [6, 22]);\n\n const cardWidth = 860;\n const cardLeft = (refW - cardWidth) / 2;\n const iconBtnSize = 36;\n const morphSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: 300,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n boxShadow: \"0 8px 30px -12px rgba(31,30,29,0.12)\",\n opacity: cardFade.opacity,\n transform: `translateY(${cardFade.translateY + intro.translateY}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n padding: \"26px 28px\",\n minHeight: 58,\n fontFamily: SANS_FAMILY,\n fontSize: 21,\n lineHeight: 1.3,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n {showText ? (\n <span style={{ color: t.fg }}>\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n transform: \"translateY(3px)\",\n }}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.placeholder,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n transform: \"translateY(3px)\",\n }}\n />\n <span style={{ marginLeft: 2 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"14px 18px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <PlusIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n }}\n >\n {modelTier}\n </span>\n <ChevronDown size={16} color={t.fgMuted} />\n </div>\n\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <MicIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n border: `1px solid ${t.iconBtnBorder}`,\n opacity: 1 - morph,\n transform: `scale(${1 - 0.1 * morph})`,\n }}\n >\n <WaveformIcon size={22} color={t.fg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: 10,\n background: accentColor,\n opacity: morph,\n transform: `scale(${0.8 + 0.2 * morph})`,\n }}\n >\n <SendIcon size={22} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont as loadBodyFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadBodyFont();\n\nexport interface ClaudeChatProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n modelTier?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n placeholder: string;\n iconBtnBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#F5F4EF\",\n cardBg: \"#FFFFFF\",\n cardBorder: \"#E8E5DD\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n placeholder: \"#A3A097\",\n iconBtnBorder: \"#E0DDD4\",\n },\n dark: {\n page: \"#262624\",\n cardBg: \"#1F1E1D\",\n cardBorder: \"#3A3936\",\n fg: \"#F0EEE6\",\n fgMuted: \"#9B9892\",\n placeholder: \"#73726C\",\n iconBtnBorder: \"#3A3936\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nexport function introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nexport function fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction ChevronDown({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction SendIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V5M12 5l-6 6M12 5l6 6\"\n stroke=\"#FFFFFF\"\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IconButton({\n size,\n border,\n children,\n}: {\n size: number;\n border: string;\n children: React.ReactNode;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `1px solid ${border}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport function ClaudeChat({\n placeholder = \"Try: draft an email · summarize a doc · plan your week\",\n prompt = \"Draft a launch tweet for our new release\",\n modelName = \"Opus 4.8\",\n modelTier = \"Max\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeChatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const cardFade = fadeUpAt(frame * speed, [6, 22]);\n\n const cardWidth = 860;\n const cardLeft = (refW - cardWidth) / 2;\n const iconBtnSize = 36;\n const morphSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: 300,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n boxShadow: \"0 8px 30px -12px rgba(31,30,29,0.12)\",\n opacity: cardFade.opacity,\n translate: `0 ${cardFade.translateY + intro.translateY}px`,\n scale: `${intro.scale}`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n padding: \"26px 28px\",\n minHeight: 58,\n fontFamily: SANS_FAMILY,\n fontSize: 21,\n lineHeight: 1.3,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n {showText ? (\n <span style={{ color: t.fg }}>\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n translate: \"0 3px\",\n }}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.placeholder,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n translate: \"0 3px\",\n }}\n />\n <span style={{ marginLeft: 2 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"14px 18px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <PlusIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n }}\n >\n {modelTier}\n </span>\n <ChevronDown size={16} color={t.fgMuted} />\n </div>\n\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <MicIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n border: `1px solid ${t.iconBtnBorder}`,\n opacity: 1 - morph,\n scale: `${1 - 0.1 * morph}`,\n }}\n >\n <WaveformIcon size={22} color={t.fg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: 10,\n background: accentColor,\n opacity: morph,\n scale: `${0.8 + 0.2 * morph}`,\n }}\n >\n <SendIcon size={22} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/claude-chat.tsx"
}
diff --git a/registry-artifacts/claude-code.json b/registry-artifacts/claude-code.json
index d1d535c5..21e1d87a 100644
--- a/registry-artifacts/claude-code.json
+++ b/registry-artifacts/claude-code.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/claude-code/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: MONO_FAMILY } = loadFont();\n\nexport interface ClaudeCodeProps {\n title?: string;\n userName?: string;\n model?: string;\n cwd?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n windowBar: string;\n windowBody: string;\n fg: string;\n fgMuted: string;\n fgDim: string;\n boxBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#E8E5DD\",\n windowBar: \"#D8D3CA\",\n windowBody: \"#FBFAF7\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n fgDim: \"#A3A097\",\n boxBorder: \"#D97757\",\n },\n dark: {\n page: \"#2B2A28\",\n windowBar: \"#3A3633\",\n windowBody: \"#1B1A18\",\n fg: \"#E8E5DD\",\n fgMuted: \"#8A857C\",\n fgDim: \"#6B6660\",\n boxBorder: \"#D97757\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 18;\n\nexport const WHATS_NEW: string[] = [\n \"/agents to create subagents\",\n \"/security-review for review agent\",\n \"ctrl+b to background bashes\",\n];\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction Mascot({ accent, size = 96 }: { accent: string; size?: number }) {\n return (\n <svg\n height={size}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Claude Code</title>\n <path\n clipRule=\"evenodd\"\n d=\"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z\"\n fill={accent}\n fillRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ClaudeCode({\n title = \"Claude Code v2.0.0\",\n userName = \"Meaghan\",\n model = \"Opus 4.8 • Max 20x\",\n cwd = \"/users/meaghan/code/apps\",\n placeholder = 'Try \"edit <filepath> to ...\"',\n prompt = \"edit src/theme.ts to add a dark mode toggle\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const showText = tw.count > 0;\n\n const intro = introBounceIn(frame * speed, fps);\n const leftFade = fadeUpAt(frame * speed, [6, 22]);\n const rightFade = fadeUpAt(frame * speed, [12, 30]);\n const promptFade = fadeUpAt(frame * speed, [18, 36]);\n\n const border = accentColor;\n\n const winLeft = 90;\n const winTop = 40;\n const winWidth = 1100;\n const winHeight = 620;\n const barHeight = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: winLeft,\n top: winTop,\n width: winWidth,\n height: winHeight,\n background: t.windowBody,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 24px 60px -20px rgba(0,0,0,0.6)\",\n opacity: intro.scale,\n transform: `translateY(${intro.translateY}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n height: barHeight,\n background: t.windowBar,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n paddingLeft: 16,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FF5F57\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FEBC2E\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#28C840\",\n }}\n />\n </div>\n\n <div\n style={{\n flex: 1,\n position: \"relative\",\n padding: 28,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n border: `1px dashed ${border}`,\n borderRadius: 6,\n padding: \"28px 24px 24px\",\n opacity: leftFade.opacity,\n transform: `translateY(${leftFade.translateY}px)`,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n top: -11,\n left: 22,\n padding: \"0 10px\",\n background: t.windowBody,\n color: accentColor,\n fontFamily: MONO_FAMILY,\n fontSize: 16,\n fontWeight: 700,\n }}\n >\n {title}\n </span>\n\n <div style={{ display: \"flex\", flexDirection: \"row\" }}>\n <div\n style={{\n width: \"42%\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: 16,\n paddingRight: 24,\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n color: t.fg,\n }}\n >\n Welcome back {userName}!\n </div>\n <div style={{ alignSelf: \"center\" }}>\n <Mascot accent={accentColor} />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {model}\n </div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {cwd}\n </div>\n </div>\n </div>\n\n <div\n style={{\n width: \"58%\",\n borderLeft: `1px dashed ${border}`,\n paddingLeft: 24,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n opacity: rightFade.opacity,\n transform: `translateY(${rightFade.translateY}px)`,\n }}\n >\n <div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n fontWeight: 700,\n color: accentColor,\n marginBottom: 10,\n }}\n >\n What's new\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n }}\n >\n {WHATS_NEW.map((line) => (\n <div\n key={line}\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fg,\n }}\n >\n {line}\n </div>\n ))}\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fgDim,\n }}\n >\n ... /help for more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div style={{ height: 32 }} />\n\n <div\n style={{\n opacity: promptFade.opacity,\n transform: `translateY(${promptFade.translateY}px)`,\n }}\n >\n <div\n style={{\n height: 1,\n background: t.fgDim,\n opacity: 0.4,\n marginBottom: 16,\n }}\n />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 17,\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ color: t.fgMuted }}>{\"> \"}</span>\n {showText ? (\n <span\n style={{\n position: \"relative\",\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {tw.text}\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </span>\n ) : (\n <span\n style={{\n position: \"relative\",\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n />\n </span>\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: MONO_FAMILY } = loadFont();\n\nexport interface ClaudeCodeProps {\n title?: string;\n userName?: string;\n model?: string;\n cwd?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n windowBar: string;\n windowBody: string;\n fg: string;\n fgMuted: string;\n fgDim: string;\n boxBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#E8E5DD\",\n windowBar: \"#D8D3CA\",\n windowBody: \"#FBFAF7\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n fgDim: \"#A3A097\",\n boxBorder: \"#D97757\",\n },\n dark: {\n page: \"#2B2A28\",\n windowBar: \"#3A3633\",\n windowBody: \"#1B1A18\",\n fg: \"#E8E5DD\",\n fgMuted: \"#8A857C\",\n fgDim: \"#6B6660\",\n boxBorder: \"#D97757\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 18;\n\nexport const WHATS_NEW: string[] = [\n \"/agents to create subagents\",\n \"/security-review for review agent\",\n \"ctrl+b to background bashes\",\n];\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction Mascot({ accent, size = 96 }: { accent: string; size?: number }) {\n return (\n <svg\n height={size}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Claude Code</title>\n <path\n clipRule=\"evenodd\"\n d=\"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z\"\n fill={accent}\n fillRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ClaudeCode({\n title = \"Claude Code v2.0.0\",\n userName = \"Meaghan\",\n model = \"Opus 4.8 • Max 20x\",\n cwd = \"/users/meaghan/code/apps\",\n placeholder = 'Try \"edit <filepath> to ...\"',\n prompt = \"edit src/theme.ts to add a dark mode toggle\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const showText = tw.count > 0;\n\n const intro = introBounceIn(frame * speed, fps);\n const leftFade = fadeUpAt(frame * speed, [6, 22]);\n const rightFade = fadeUpAt(frame * speed, [12, 30]);\n const promptFade = fadeUpAt(frame * speed, [18, 36]);\n\n const border = accentColor;\n\n const winLeft = 90;\n const winTop = 40;\n const winWidth = 1100;\n const winHeight = 620;\n const barHeight = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: winLeft,\n top: winTop,\n width: winWidth,\n height: winHeight,\n background: t.windowBody,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 24px 60px -20px rgba(0,0,0,0.6)\",\n opacity: intro.scale,\n translate: `0 ${intro.translateY}px`,\n scale: `${intro.scale}`,\n transformOrigin: \"center top\",\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n height: barHeight,\n background: t.windowBar,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n paddingLeft: 16,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FF5F57\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FEBC2E\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#28C840\",\n }}\n />\n </div>\n\n <div\n style={{\n flex: 1,\n position: \"relative\",\n padding: 28,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n border: `1px dashed ${border}`,\n borderRadius: 6,\n padding: \"28px 24px 24px\",\n opacity: leftFade.opacity,\n translate: `0 ${leftFade.translateY}px`,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n top: -11,\n left: 22,\n padding: \"0 10px\",\n background: t.windowBody,\n color: accentColor,\n fontFamily: MONO_FAMILY,\n fontSize: 16,\n fontWeight: 700,\n }}\n >\n {title}\n </span>\n\n <div style={{ display: \"flex\", flexDirection: \"row\" }}>\n <div\n style={{\n width: \"42%\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: 16,\n paddingRight: 24,\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n color: t.fg,\n }}\n >\n Welcome back {userName}!\n </div>\n <div style={{ alignSelf: \"center\" }}>\n <Mascot accent={accentColor} />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {model}\n </div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {cwd}\n </div>\n </div>\n </div>\n\n <div\n style={{\n width: \"58%\",\n borderLeft: `1px dashed ${border}`,\n paddingLeft: 24,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n opacity: rightFade.opacity,\n translate: `0 ${rightFade.translateY}px`,\n }}\n >\n <div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n fontWeight: 700,\n color: accentColor,\n marginBottom: 10,\n }}\n >\n What's new\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n }}\n >\n {WHATS_NEW.map((line) => (\n <div\n key={line}\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fg,\n }}\n >\n {line}\n </div>\n ))}\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fgDim,\n }}\n >\n ... /help for more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div style={{ height: 32 }} />\n\n <div\n style={{\n opacity: promptFade.opacity,\n translate: `0 ${promptFade.translateY}px`,\n }}\n >\n <div\n style={{\n height: 1,\n background: t.fgDim,\n opacity: 0.4,\n marginBottom: 16,\n }}\n />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 17,\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ color: t.fgMuted }}>{\"> \"}</span>\n {showText ? (\n <span\n style={{\n position: \"relative\",\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {tw.text}\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </span>\n ) : (\n <span\n style={{\n position: \"relative\",\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n />\n </span>\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/claude-code.tsx"
}
diff --git a/registry-artifacts/confetti.json b/registry-artifacts/confetti.json
index ca74a6f0..cdd1f8b0 100644
--- a/registry-artifacts/confetti.json
+++ b/registry-artifacts/confetti.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/confetti/index.tsx",
- "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\nexport interface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nexport function mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nexport function makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nexport function particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nexport function Confetti({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\nexport interface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nexport function mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nexport function makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nexport function particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nexport function Confetti({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n translate: \"-50% -50%\",\n rotate: `${rot}rad`,\n scale: `${flutter} 1`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/confetti.tsx"
}
diff --git a/registry-artifacts/crumple-toss.json b/registry-artifacts/crumple-toss.json
index 80c1075a..bceadee1 100644
--- a/registry-artifacts/crumple-toss.json
+++ b/registry-artifacts/crumple-toss.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/crumple-toss/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useCurrentFrame } from \"remotion\";\nimport { DEFAULT_STEP, hashRange, qstep } from \"@/lib/remocn/stop-motion\";\n\nconst GRAVITY = 0.9;\nconst FLIGHT_SHRINK = 0.5;\nconst EXIT_OPACITY = 0.4;\n\nconst FOLD_TILT = 46;\nconst WAD_REACH = 0.27;\nconst WAD_SPREAD = 0.07;\nconst ANGLE_JITTER = 0.22;\nconst SCALE_SPREAD = 0.25;\nconst DEFAULT_RANDOMNESS = 0.6;\nconst DEFAULT_LAYERS = 2;\nconst LAYER_TILT_FLOOR = 0.45;\nconst FACET_SIZE = 0.5;\nconst FACET_CAP = 0.5;\n\nconst TONE_PATTERN = [0, 1, 3, 1, 0, 2, 1, 2, 0];\n\nconst TONES = [\n { lit: \"rgba(255,255,255,0.66)\", dark: \"rgba(255,255,255,0.18)\" },\n { lit: \"rgba(255,255,255,0.30)\", dark: \"rgba(38,36,44,0.10)\" },\n { lit: \"rgba(255,255,255,0.08)\", dark: \"rgba(38,36,44,0.20)\" },\n { lit: \"rgba(38,36,44,0.06)\", dark: \"rgba(38,36,44,0.30)\" },\n];\n\nconst LIGHT_ANGLE = -55;\nconst CREASE_BLEND = 9;\n\nexport type CrumplePhase = \"idle\" | \"crumple\" | \"toss\" | \"gone\";\n\nexport type CrumplePose = {\n phase: CrumplePhase;\n crush: number;\n scale: number;\n rotate: number;\n x: number;\n y: number;\n opacity: number;\n};\n\nexport type CrumpleSegment = {\n clip: [number, number][];\n origin: [number, number];\n dx: number;\n dy: number;\n scale: number;\n rotate: number;\n tone: number;\n crease: number;\n};\n\nexport type CrumpleTossTiming = {\n at: number;\n crumpleSteps?: number;\n tossSteps?: number;\n direction?: number;\n distance?: number;\n spin?: number;\n crushTo?: number;\n seed?: string;\n step?: number;\n};\n\nconst rayToEdge = (\n angle: number,\n halfWidth: number,\n halfHeight: number,\n): [number, number] => {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const t = Math.min(\n halfWidth / (Math.abs(cos) || 1e-9),\n halfHeight / (Math.abs(sin) || 1e-9),\n );\n return [cos * t, sin * t];\n};\n\nconst normalize = (angle: number) => {\n const turn = Math.PI * 2;\n return ((angle % turn) + turn) % turn;\n};\n\nconst shrinkToward = (\n [x, y]: [number, number],\n factor: number,\n): [number, number] => [x * factor, y * factor];\n\nconst averageOf = (points: [number, number][]): [number, number] => [\n points.reduce((sum, p) => sum + p[0], 0) / points.length,\n points.reduce((sum, p) => sum + p[1], 0) / points.length,\n];\n\nexport function crumpleSegments(args: {\n width: number;\n height: number;\n segments?: number;\n layers?: number;\n crushTo?: number;\n randomness?: number;\n seed?: string;\n}): CrumpleSegment[] {\n const count = Math.max(3, Math.round(args.segments ?? 9));\n const layers = Math.max(1, Math.round(args.layers ?? DEFAULT_LAYERS));\n const crushTo = args.crushTo ?? 0.34;\n const chaos = Math.min(1, Math.max(0, args.randomness ?? DEFAULT_RANDOMNESS));\n const seed = args.seed ?? \"toss\";\n const halfWidth = args.width / 2;\n const halfHeight = args.height / 2;\n const wad = Math.min(args.width, args.height) * crushTo;\n\n const angles = Array.from(\n { length: count },\n (_, i) =>\n (i / count) * Math.PI * 2 +\n hashRange(`${seed}:ang${i}`, -ANGLE_JITTER, ANGLE_JITTER) * chaos,\n );\n\n const corners: [number, number][] = [\n [halfWidth, halfHeight],\n [-halfWidth, halfHeight],\n [-halfWidth, -halfHeight],\n [halfWidth, -halfHeight],\n ];\n\n const toPercent = ([x, y]: [number, number]): [number, number] => [\n ((x + halfWidth) / args.width) * 100,\n ((y + halfHeight) / args.height) * 100,\n ];\n\n const panels: CrumpleSegment[] = [];\n\n angles.forEach((angle, i) => {\n const nextAngle =\n angles[(i + 1) % count] + (i === count - 1 ? Math.PI * 2 : 0);\n const from = rayToEdge(angle, halfWidth, halfHeight);\n const to = rayToEdge(nextAngle, halfWidth, halfHeight);\n\n const span = normalize(nextAngle - angle);\n const between = corners\n .map((corner): [[number, number], number] => [\n corner,\n normalize(Math.atan2(corner[1], corner[0]) - angle),\n ])\n .filter(([, spanned]) => spanned > 0 && spanned < span)\n .sort((a, b) => a[1] - b[1])\n .map(([corner]) => corner);\n\n const rim: [number, number][] = [from, ...between, to];\n\n for (let layer = 0; layer < layers; layer++) {\n const inner = layer / layers;\n const outer = (layer + 1) / layers;\n const depth = (layer + 1) / layers;\n const shape: [number, number][] =\n layer === 0\n ? [[0, 0], ...rim.map((point) => shrinkToward(point, outer))]\n : [\n ...rim.map((point) => shrinkToward(point, outer)),\n ...[...rim].reverse().map((point) => shrinkToward(point, inner)),\n ];\n\n const centroid = averageOf(shape);\n const extent =\n Math.max(\n ...shape.map((point) =>\n Math.hypot(point[0] - centroid[0], point[1] - centroid[1]),\n ),\n ) || 1;\n const key = `${seed}:${i}:${layer}`;\n\n const reach =\n wad *\n (WAD_REACH * depth +\n hashRange(`${key}:reach`, -WAD_SPREAD, WAD_SPREAD) * chaos * depth);\n const heading = Math.atan2(centroid[1], centroid[0]);\n\n panels.push({\n clip: shape.map(toPercent),\n origin: toPercent(centroid),\n dx: Math.cos(heading) * reach - centroid[0],\n dy: Math.sin(heading) * reach - centroid[1],\n scale:\n Math.min(FACET_CAP, (wad * FACET_SIZE) / extent) *\n (1 + hashRange(`${key}:size`, -SCALE_SPREAD, SCALE_SPREAD) * chaos),\n rotate:\n chaos === 0\n ? 0\n : hashRange(`${seed}:tilt${i}`, -FOLD_TILT, FOLD_TILT) *\n chaos *\n (LAYER_TILT_FLOOR + (1 - LAYER_TILT_FLOOR) * depth),\n tone: Math.min(\n TONES.length - 1,\n TONE_PATTERN[panels.length % TONE_PATTERN.length] +\n Math.ceil((1 - depth) * 2),\n ),\n crease: 0.5 + hashRange(`${key}:crease`, -0.2, 0.2) * chaos,\n });\n }\n });\n\n return panels;\n}\n\nexport function creaseShading(\n piece: Pick<CrumpleSegment, \"tone\" | \"rotate\" | \"crease\">,\n crush: number,\n): string {\n const tone = TONES[piece.tone];\n const fold = piece.crease * 100;\n const lit = Math.max(0, fold - CREASE_BLEND).toFixed(1);\n const dark = Math.min(100, fold + CREASE_BLEND).toFixed(1);\n const angle = (LIGHT_ANGLE - piece.rotate * crush).toFixed(1);\n return `linear-gradient(${angle}deg, ${tone.lit} 0%, ${tone.lit} ${lit}%, ${tone.dark} ${dark}%, ${tone.dark} 100%)`;\n}\n\nexport function crumpleTossLanding(options?: {\n direction?: number;\n distance?: number;\n}): { x: number; y: number } {\n const distance = options?.distance ?? 900;\n const radians = ((options?.direction ?? -35) * Math.PI) / 180;\n return {\n x: distance * Math.cos(radians),\n y: distance * Math.sin(radians) + GRAVITY * distance,\n };\n}\n\nexport function crumpleTossPose(\n args: CrumpleTossTiming & { frame: number },\n): CrumplePose {\n const crumpleSteps = args.crumpleSteps ?? 4;\n const tossSteps = args.tossSteps ?? 5;\n const direction = args.direction ?? -35;\n const distance = args.distance ?? 900;\n const spin = args.spin ?? 220;\n const step = args.step ?? DEFAULT_STEP;\n\n if (args.frame < args.at) {\n return {\n phase: \"idle\",\n crush: 0,\n scale: 1,\n rotate: 0,\n x: 0,\n y: 0,\n opacity: 1,\n };\n }\n\n const pose = qstep(args.frame - args.at, step);\n\n if (pose < crumpleSteps) {\n return {\n phase: \"crumple\",\n crush: (pose + 1) / crumpleSteps,\n scale: 1,\n rotate: 0,\n x: 0,\n y: 0,\n opacity: 1,\n };\n }\n\n if (pose < crumpleSteps + tossSteps) {\n const t = (pose - crumpleSteps + 1) / tossSteps;\n const radians = (direction * Math.PI) / 180;\n return {\n phase: \"toss\",\n crush: 1,\n scale: 1 - FLIGHT_SHRINK * t,\n rotate: spin * t,\n x: distance * Math.cos(radians) * t,\n y: distance * Math.sin(radians) * t + GRAVITY * distance * t * t,\n opacity: t === 1 ? EXIT_OPACITY : 1,\n };\n }\n\n return {\n phase: \"gone\",\n crush: 1,\n scale: 0,\n rotate: 0,\n x: 0,\n y: 0,\n opacity: 0,\n };\n}\n\nexport interface CrumpleTossProps extends CrumpleTossTiming {\n children: React.ReactNode;\n width: number;\n height: number;\n segments?: number;\n layers?: number;\n randomness?: number;\n}\n\nexport function CrumpleToss({\n children,\n width,\n height,\n segments,\n layers,\n randomness,\n ...timing\n}: CrumpleTossProps) {\n const frame = useCurrentFrame();\n const pose = crumpleTossPose({ frame, ...timing });\n if (pose.phase === \"gone\") return null;\n\n const pieces = crumpleSegments({\n width,\n height,\n segments,\n layers,\n randomness,\n crushTo: timing.crushTo,\n seed: timing.seed,\n });\n const c = pose.crush;\n\n return (\n <div\n style={{\n position: \"relative\",\n width,\n height,\n transformOrigin: \"center\",\n opacity: pose.opacity,\n transform: `translate(${pose.x}px, ${pose.y}px) rotate(${pose.rotate}deg) scale(${pose.scale})`,\n }}\n >\n {pieces.map((piece, i) => (\n <div\n key={`piece:${i}`}\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `polygon(${piece.clip.map(([x, y]) => `${x}% ${y}%`).join(\", \")})`,\n transformOrigin: `${piece.origin[0]}% ${piece.origin[1]}%`,\n transform: `translate(${piece.dx * c}px, ${piece.dy * c}px) rotate(${piece.rotate * c}deg) scale(${1 + (piece.scale - 1) * c})`,\n filter:\n c > 0\n ? `drop-shadow(0 0 ${0.6 * c}px rgba(38,36,44,0.55))`\n : undefined,\n }}\n >\n <div style={{ position: \"absolute\", inset: 0 }}>{children}</div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: creaseShading(piece, c),\n opacity: c,\n }}\n />\n </div>\n ))}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useCurrentFrame } from \"remotion\";\nimport { DEFAULT_STEP, hashRange, qstep } from \"@/lib/remocn/stop-motion\";\n\nconst GRAVITY = 0.9;\nconst FLIGHT_SHRINK = 0.5;\nconst EXIT_OPACITY = 0.4;\n\nconst FOLD_TILT = 46;\nconst WAD_REACH = 0.27;\nconst WAD_SPREAD = 0.07;\nconst ANGLE_JITTER = 0.22;\nconst SCALE_SPREAD = 0.25;\nconst DEFAULT_RANDOMNESS = 0.6;\nconst DEFAULT_LAYERS = 2;\nconst LAYER_TILT_FLOOR = 0.45;\nconst FACET_SIZE = 0.5;\nconst FACET_CAP = 0.5;\n\nconst TONE_PATTERN = [0, 1, 3, 1, 0, 2, 1, 2, 0];\n\nconst TONES = [\n { lit: \"rgba(255,255,255,0.66)\", dark: \"rgba(255,255,255,0.18)\" },\n { lit: \"rgba(255,255,255,0.30)\", dark: \"rgba(38,36,44,0.10)\" },\n { lit: \"rgba(255,255,255,0.08)\", dark: \"rgba(38,36,44,0.20)\" },\n { lit: \"rgba(38,36,44,0.06)\", dark: \"rgba(38,36,44,0.30)\" },\n];\n\nconst LIGHT_ANGLE = -55;\nconst CREASE_BLEND = 9;\n\nexport type CrumplePhase = \"idle\" | \"crumple\" | \"toss\" | \"gone\";\n\nexport type CrumplePose = {\n phase: CrumplePhase;\n crush: number;\n scale: number;\n rotate: number;\n x: number;\n y: number;\n opacity: number;\n};\n\nexport type CrumpleSegment = {\n clip: [number, number][];\n origin: [number, number];\n dx: number;\n dy: number;\n scale: number;\n rotate: number;\n tone: number;\n crease: number;\n};\n\nexport type CrumpleTossTiming = {\n at: number;\n crumpleSteps?: number;\n tossSteps?: number;\n direction?: number;\n distance?: number;\n spin?: number;\n crushTo?: number;\n seed?: string;\n step?: number;\n};\n\nconst rayToEdge = (\n angle: number,\n halfWidth: number,\n halfHeight: number,\n): [number, number] => {\n const cos = Math.cos(angle);\n const sin = Math.sin(angle);\n const t = Math.min(\n halfWidth / (Math.abs(cos) || 1e-9),\n halfHeight / (Math.abs(sin) || 1e-9),\n );\n return [cos * t, sin * t];\n};\n\nconst normalize = (angle: number) => {\n const turn = Math.PI * 2;\n return ((angle % turn) + turn) % turn;\n};\n\nconst shrinkToward = (\n [x, y]: [number, number],\n factor: number,\n): [number, number] => [x * factor, y * factor];\n\nconst averageOf = (points: [number, number][]): [number, number] => [\n points.reduce((sum, p) => sum + p[0], 0) / points.length,\n points.reduce((sum, p) => sum + p[1], 0) / points.length,\n];\n\nexport function crumpleSegments(args: {\n width: number;\n height: number;\n segments?: number;\n layers?: number;\n crushTo?: number;\n randomness?: number;\n seed?: string;\n}): CrumpleSegment[] {\n const count = Math.max(3, Math.round(args.segments ?? 9));\n const layers = Math.max(1, Math.round(args.layers ?? DEFAULT_LAYERS));\n const crushTo = args.crushTo ?? 0.34;\n const chaos = Math.min(1, Math.max(0, args.randomness ?? DEFAULT_RANDOMNESS));\n const seed = args.seed ?? \"toss\";\n const halfWidth = args.width / 2;\n const halfHeight = args.height / 2;\n const wad = Math.min(args.width, args.height) * crushTo;\n\n const angles = Array.from(\n { length: count },\n (_, i) =>\n (i / count) * Math.PI * 2 +\n hashRange(`${seed}:ang${i}`, -ANGLE_JITTER, ANGLE_JITTER) * chaos,\n );\n\n const corners: [number, number][] = [\n [halfWidth, halfHeight],\n [-halfWidth, halfHeight],\n [-halfWidth, -halfHeight],\n [halfWidth, -halfHeight],\n ];\n\n const toPercent = ([x, y]: [number, number]): [number, number] => [\n ((x + halfWidth) / args.width) * 100,\n ((y + halfHeight) / args.height) * 100,\n ];\n\n const panels: CrumpleSegment[] = [];\n\n angles.forEach((angle, i) => {\n const nextAngle =\n angles[(i + 1) % count] + (i === count - 1 ? Math.PI * 2 : 0);\n const from = rayToEdge(angle, halfWidth, halfHeight);\n const to = rayToEdge(nextAngle, halfWidth, halfHeight);\n\n const span = normalize(nextAngle - angle);\n const between = corners\n .map((corner): [[number, number], number] => [\n corner,\n normalize(Math.atan2(corner[1], corner[0]) - angle),\n ])\n .filter(([, spanned]) => spanned > 0 && spanned < span)\n .sort((a, b) => a[1] - b[1])\n .map(([corner]) => corner);\n\n const rim: [number, number][] = [from, ...between, to];\n\n for (let layer = 0; layer < layers; layer++) {\n const inner = layer / layers;\n const outer = (layer + 1) / layers;\n const depth = (layer + 1) / layers;\n const shape: [number, number][] =\n layer === 0\n ? [[0, 0], ...rim.map((point) => shrinkToward(point, outer))]\n : [\n ...rim.map((point) => shrinkToward(point, outer)),\n ...[...rim].reverse().map((point) => shrinkToward(point, inner)),\n ];\n\n const centroid = averageOf(shape);\n const extent =\n Math.max(\n ...shape.map((point) =>\n Math.hypot(point[0] - centroid[0], point[1] - centroid[1]),\n ),\n ) || 1;\n const key = `${seed}:${i}:${layer}`;\n\n const reach =\n wad *\n (WAD_REACH * depth +\n hashRange(`${key}:reach`, -WAD_SPREAD, WAD_SPREAD) * chaos * depth);\n const heading = Math.atan2(centroid[1], centroid[0]);\n\n panels.push({\n clip: shape.map(toPercent),\n origin: toPercent(centroid),\n dx: Math.cos(heading) * reach - centroid[0],\n dy: Math.sin(heading) * reach - centroid[1],\n scale:\n Math.min(FACET_CAP, (wad * FACET_SIZE) / extent) *\n (1 + hashRange(`${key}:size`, -SCALE_SPREAD, SCALE_SPREAD) * chaos),\n rotate:\n chaos === 0\n ? 0\n : hashRange(`${seed}:tilt${i}`, -FOLD_TILT, FOLD_TILT) *\n chaos *\n (LAYER_TILT_FLOOR + (1 - LAYER_TILT_FLOOR) * depth),\n tone: Math.min(\n TONES.length - 1,\n TONE_PATTERN[panels.length % TONE_PATTERN.length] +\n Math.ceil((1 - depth) * 2),\n ),\n crease: 0.5 + hashRange(`${key}:crease`, -0.2, 0.2) * chaos,\n });\n }\n });\n\n return panels;\n}\n\nexport function creaseShading(\n piece: Pick<CrumpleSegment, \"tone\" | \"rotate\" | \"crease\">,\n crush: number,\n): string {\n const tone = TONES[piece.tone];\n const fold = piece.crease * 100;\n const lit = Math.max(0, fold - CREASE_BLEND).toFixed(1);\n const dark = Math.min(100, fold + CREASE_BLEND).toFixed(1);\n const angle = (LIGHT_ANGLE - piece.rotate * crush).toFixed(1);\n return `linear-gradient(${angle}deg, ${tone.lit} 0%, ${tone.lit} ${lit}%, ${tone.dark} ${dark}%, ${tone.dark} 100%)`;\n}\n\nexport function crumpleTossLanding(options?: {\n direction?: number;\n distance?: number;\n}): { x: number; y: number } {\n const distance = options?.distance ?? 900;\n const radians = ((options?.direction ?? -35) * Math.PI) / 180;\n return {\n x: distance * Math.cos(radians),\n y: distance * Math.sin(radians) + GRAVITY * distance,\n };\n}\n\nexport function crumpleTossPose(\n args: CrumpleTossTiming & { frame: number },\n): CrumplePose {\n const crumpleSteps = args.crumpleSteps ?? 4;\n const tossSteps = args.tossSteps ?? 5;\n const direction = args.direction ?? -35;\n const distance = args.distance ?? 900;\n const spin = args.spin ?? 220;\n const step = args.step ?? DEFAULT_STEP;\n\n if (args.frame < args.at) {\n return {\n phase: \"idle\",\n crush: 0,\n scale: 1,\n rotate: 0,\n x: 0,\n y: 0,\n opacity: 1,\n };\n }\n\n const pose = qstep(args.frame - args.at, step);\n\n if (pose < crumpleSteps) {\n return {\n phase: \"crumple\",\n crush: (pose + 1) / crumpleSteps,\n scale: 1,\n rotate: 0,\n x: 0,\n y: 0,\n opacity: 1,\n };\n }\n\n if (pose < crumpleSteps + tossSteps) {\n const t = (pose - crumpleSteps + 1) / tossSteps;\n const radians = (direction * Math.PI) / 180;\n return {\n phase: \"toss\",\n crush: 1,\n scale: 1 - FLIGHT_SHRINK * t,\n rotate: spin * t,\n x: distance * Math.cos(radians) * t,\n y: distance * Math.sin(radians) * t + GRAVITY * distance * t * t,\n opacity: t === 1 ? EXIT_OPACITY : 1,\n };\n }\n\n return {\n phase: \"gone\",\n crush: 1,\n scale: 0,\n rotate: 0,\n x: 0,\n y: 0,\n opacity: 0,\n };\n}\n\nexport interface CrumpleTossProps extends CrumpleTossTiming {\n children: React.ReactNode;\n width: number;\n height: number;\n segments?: number;\n layers?: number;\n randomness?: number;\n}\n\nexport function CrumpleToss({\n children,\n width,\n height,\n segments,\n layers,\n randomness,\n ...timing\n}: CrumpleTossProps) {\n const frame = useCurrentFrame();\n const pose = crumpleTossPose({ frame, ...timing });\n if (pose.phase === \"gone\") return null;\n\n const pieces = crumpleSegments({\n width,\n height,\n segments,\n layers,\n randomness,\n crushTo: timing.crushTo,\n seed: timing.seed,\n });\n const c = pose.crush;\n\n return (\n <div\n style={{\n position: \"relative\",\n width,\n height,\n transformOrigin: \"center\",\n opacity: pose.opacity,\n translate: `${pose.x}px ${pose.y}px`,\n rotate: `${pose.rotate}deg`,\n scale: `${pose.scale}`,\n }}\n >\n {pieces.map((piece, i) => (\n <div\n key={`piece:${i}`}\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `polygon(${piece.clip.map(([x, y]) => `${x}% ${y}%`).join(\", \")})`,\n transformOrigin: `${piece.origin[0]}% ${piece.origin[1]}%`,\n translate: `${piece.dx * c}px ${piece.dy * c}px`,\n rotate: `${piece.rotate * c}deg`,\n scale: `${1 + (piece.scale - 1) * c}`,\n filter:\n c > 0\n ? `drop-shadow(0 0 ${0.6 * c}px rgba(38,36,44,0.55))`\n : undefined,\n }}\n >\n <div style={{ position: \"absolute\", inset: 0 }}>{children}</div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: creaseShading(piece, c),\n opacity: c,\n }}\n />\n </div>\n ))}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/crumple-toss.tsx"
}
diff --git a/registry-artifacts/displacement.json b/registry-artifacts/displacement.json
index b080e7cf..899350c0 100644
--- a/registry-artifacts/displacement.json
+++ b/registry-artifacts/displacement.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/displacement/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type DisplacementProps = {\n grid?: number;\n cellAspect?: number;\n shift?: number;\n aberration?: number;\n grain?: number;\n stagger?: number;\n};\n\nconst DEFAULTS = {\n grid: 60,\n cellAspect: 1,\n shift: 1,\n aberration: 1,\n grain: 0.5,\n stagger: 0.45,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform vec2 u_cells;\nuniform float u_shift;\nuniform float u_aberration;\nuniform float u_grain;\nuniform float u_stagger;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvoid main() {\n vec2 cell = floor(v_uv * u_cells);\n float h1 = hash(cell);\n float h2 = hash(cell + 7.3);\n float h3 = hash(cell + 13.1);\n\n float delay = h3 * u_stagger;\n float phase =\n clamp((u_progress - delay) / max(1.0 - u_stagger, 0.1), 0.0, 1.0);\n float shear = sin(phase * PI);\n\n vec2 aim = vec2((h1 - 0.5) * 2.0, (h2 - 0.5) * 0.7);\n vec2 dir = aim / max(length(aim), 0.0001);\n vec2 slide = dir * shear * u_shift * 1.4;\n vec2 off = slide / u_cells;\n vec2 fringe = off * u_aberration * 0.35;\n\n float swap = smoothstep(0.34, 0.66, phase);\n\n vec4 mid = mix(\n texture(u_from, v_uv - off),\n texture(u_to, v_uv - off),\n swap\n );\n float red = mix(\n texture(u_from, v_uv - off - fringe).r,\n texture(u_to, v_uv - off - fringe).r,\n swap\n );\n float blue = mix(\n texture(u_from, v_uv - off + fringe).b,\n texture(u_to, v_uv - off + fringe).b,\n swap\n );\n\n vec4 col = vec4(red, mid.g, blue, mid.a);\n\n float tick = floor(u_progress * 30.0);\n float speck =\n hash(floor(v_uv * vec2(u_aspect, 1.0) * 460.0) + tick * 1.7) - 0.5;\n col.rgb += vec3(speck * u_grain * shear * 0.5) * col.a;\n col.rgb *= 1.0 - 0.12 * shear;\n\n outColor = col;\n}`;\n\nconst shader = makeSceneShader<DisplacementProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, passedProps }) => {\n const {\n grid = DEFAULTS.grid,\n cellAspect = DEFAULTS.cellAspect,\n shift = DEFAULTS.shift,\n aberration = DEFAULTS.aberration,\n grain = DEFAULTS.grain,\n stagger = DEFAULTS.stagger,\n } = passedProps;\n const across = Math.max(grid, 4);\n const ratio = Math.max(cellAspect, 0.25);\n gl.uniform2f(\n uniform(\"u_cells\"),\n across,\n Math.max((across * ratio * height) / width, 2),\n );\n gl.uniform1f(uniform(\"u_shift\"), shift);\n gl.uniform1f(uniform(\"u_aberration\"), aberration);\n gl.uniform1f(uniform(\"u_grain\"), grain);\n gl.uniform1f(uniform(\"u_stagger\"), Math.min(Math.max(stagger, 0), 0.85));\n },\n);\n\nconst DisplacementFallback: React.FC<\n TransitionPresentationComponentProps<DisplacementProps>\n> = ({ children, presentationProgress, presentationDirection }) => {\n const p = presentationProgress;\n const entering = presentationDirection === \"entering\";\n const t = entering ? p : 1 - p;\n const settle = Math.min(1, Math.max(0, (t - 0.3) / 0.4));\n const jolt = Math.max(0, Math.sin(t * Math.PI)) * 10;\n\n return (\n <AbsoluteFill\n style={{\n opacity: settle,\n transform: `translateX(${entering ? jolt : -jolt}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<DisplacementProps>({\n shader,\n fallback: DisplacementFallback,\n});\n\nexport function displacement(\n props: DisplacementProps = {},\n): TransitionPresentation<DisplacementProps> {\n return presentation(props);\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type DisplacementProps = {\n grid?: number;\n cellAspect?: number;\n shift?: number;\n aberration?: number;\n grain?: number;\n stagger?: number;\n};\n\nconst DEFAULTS = {\n grid: 60,\n cellAspect: 1,\n shift: 1,\n aberration: 1,\n grain: 0.5,\n stagger: 0.45,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform vec2 u_cells;\nuniform float u_shift;\nuniform float u_aberration;\nuniform float u_grain;\nuniform float u_stagger;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvoid main() {\n vec2 cell = floor(v_uv * u_cells);\n float h1 = hash(cell);\n float h2 = hash(cell + 7.3);\n float h3 = hash(cell + 13.1);\n\n float delay = h3 * u_stagger;\n float phase =\n clamp((u_progress - delay) / max(1.0 - u_stagger, 0.1), 0.0, 1.0);\n float shear = sin(phase * PI);\n\n vec2 aim = vec2((h1 - 0.5) * 2.0, (h2 - 0.5) * 0.7);\n vec2 dir = aim / max(length(aim), 0.0001);\n vec2 slide = dir * shear * u_shift * 1.4;\n vec2 off = slide / u_cells;\n vec2 fringe = off * u_aberration * 0.35;\n\n float swap = smoothstep(0.34, 0.66, phase);\n\n vec4 mid = mix(\n texture(u_from, v_uv - off),\n texture(u_to, v_uv - off),\n swap\n );\n float red = mix(\n texture(u_from, v_uv - off - fringe).r,\n texture(u_to, v_uv - off - fringe).r,\n swap\n );\n float blue = mix(\n texture(u_from, v_uv - off + fringe).b,\n texture(u_to, v_uv - off + fringe).b,\n swap\n );\n\n vec4 col = vec4(red, mid.g, blue, mid.a);\n\n float tick = floor(u_progress * 30.0);\n float speck =\n hash(floor(v_uv * vec2(u_aspect, 1.0) * 460.0) + tick * 1.7) - 0.5;\n col.rgb += vec3(speck * u_grain * shear * 0.5) * col.a;\n col.rgb *= 1.0 - 0.12 * shear;\n\n outColor = col;\n}`;\n\nconst shader = makeSceneShader<DisplacementProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, passedProps }) => {\n const {\n grid = DEFAULTS.grid,\n cellAspect = DEFAULTS.cellAspect,\n shift = DEFAULTS.shift,\n aberration = DEFAULTS.aberration,\n grain = DEFAULTS.grain,\n stagger = DEFAULTS.stagger,\n } = passedProps;\n const across = Math.max(grid, 4);\n const ratio = Math.max(cellAspect, 0.25);\n gl.uniform2f(\n uniform(\"u_cells\"),\n across,\n Math.max((across * ratio * height) / width, 2),\n );\n gl.uniform1f(uniform(\"u_shift\"), shift);\n gl.uniform1f(uniform(\"u_aberration\"), aberration);\n gl.uniform1f(uniform(\"u_grain\"), grain);\n gl.uniform1f(uniform(\"u_stagger\"), Math.min(Math.max(stagger, 0), 0.85));\n },\n);\n\nconst DisplacementFallback: React.FC<\n TransitionPresentationComponentProps<DisplacementProps>\n> = ({ children, presentationProgress, presentationDirection }) => {\n const p = presentationProgress;\n const entering = presentationDirection === \"entering\";\n const t = entering ? p : 1 - p;\n const settle = Math.min(1, Math.max(0, (t - 0.3) / 0.4));\n const jolt = Math.max(0, Math.sin(t * Math.PI)) * 10;\n\n return (\n <AbsoluteFill\n style={{\n opacity: settle,\n translate: `${entering ? jolt : -jolt}px`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<DisplacementProps>({\n shader,\n fallback: DisplacementFallback,\n});\n\nexport function displacement(\n props: DisplacementProps = {},\n): TransitionPresentation<DisplacementProps> {\n return presentation(props);\n}\n",
"type": "registry:component",
"target": "components/remocn/displacement.tsx"
}
diff --git a/registry-artifacts/drift.json b/registry-artifacts/drift.json
index 1a4ead4e..31ea575c 100644
--- a/registry-artifacts/drift.json
+++ b/registry-artifacts/drift.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/drift/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface DriftProps {\n children: React.ReactNode;\n grow?: number;\n}\n\nexport function Drift({ children, grow = 0.035 }: DriftProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);\n return (\n <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n {children}\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface DriftProps {\n children: React.ReactNode;\n grow?: number;\n}\n\nexport function Drift({ children, grow = 0.035 }: DriftProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);\n return (\n <AbsoluteFill style={{ scale: `${scale}` }}>\n {children}\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/drift.tsx"
}
diff --git a/registry-artifacts/ecosystem-constellation.json b/registry-artifacts/ecosystem-constellation.json
index 9c97e315..6254a12a 100644
--- a/registry-artifacts/ecosystem-constellation.json
+++ b/registry-artifacts/ecosystem-constellation.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/ecosystem-constellation/index.tsx",
- "content": "\"use client\";\n\nimport type { ComponentType } from \"react\";\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nexport function EcosystemConstellation({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n transform: `scale(${centerScale})`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${s.satScale})`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ComponentType } from \"react\";\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nexport function EcosystemConstellation({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n scale: `${centerScale}`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n scale: `${s.satScale}`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/ecosystem-constellation.tsx"
}
diff --git a/registry-artifacts/elements/animated-bar-chart.json b/registry-artifacts/elements/animated-bar-chart.json
index 188f2d97..02dce19f 100644
--- a/registry-artifacts/elements/animated-bar-chart.json
+++ b/registry-artifacts/elements/animated-bar-chart.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 1000,
+ "height": 500
+ },
"displayName": "Animated Bar Chart",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "animated-bar-chart",
- "sourceCode": "import { Interactive, Sequence, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nfunction AnimatedBarChartBase({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n transform: `scaleY(${scaleY})`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n barColor: {\n type: \"color\",\n default: \"#0ea5e9\",\n description: \"Bar color\",\n },\n gap: {\n type: \"number\",\n min: 0,\n max: 80,\n step: 2,\n default: 16,\n description: \"Gap\",\n hiddenFromList: false,\n },\n staggerFrames: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 6,\n description: \"Stagger frames\",\n hiddenFromList: false,\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([\"barColor\",\"gap\",\"staggerFrames\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n barColor: \"#0ea5e9\",\n gap: 16,\n staggerFrames: 6,\n speed: 1,\n};\n\ntype AnimatedBarChartElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AnimatedBarChartBase>;\n\nconst AnimatedBarChartInner = forwardRef<\n HTMLDivElement,\n AnimatedBarChartElementProps & { 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 ?? \"<AnimatedBarChart>\"}\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 <AnimatedBarChartBase\n {...(componentProps as unknown as ComponentProps<typeof AnimatedBarChartBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AnimatedBarChart = Interactive.withSchema({\n Component: AnimatedBarChartInner,\n componentName: \"<AnimatedBarChart>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nfunction AnimatedBarChartBase({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n scale: `1 ${scaleY}`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n barColor: {\n type: \"color\",\n default: \"#0ea5e9\",\n description: \"Bar color\",\n },\n gap: {\n type: \"number\",\n min: 0,\n max: 80,\n step: 2,\n default: 16,\n description: \"Gap\",\n hiddenFromList: false,\n },\n staggerFrames: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 6,\n description: \"Stagger frames\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 1000,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 500,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"barColor\",\"gap\",\"staggerFrames\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n barColor: \"#0ea5e9\",\n gap: 16,\n staggerFrames: 6,\n speed: 1,\n};\n\ntype AnimatedBarChartElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof AnimatedBarChartBase>;\n\nconst AnimatedBarChartInner = forwardRef<\n HTMLDivElement,\n AnimatedBarChartElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 1000, height = 500, ...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 ?? \"<AnimatedBarChart>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <AnimatedBarChartBase\n {...(componentProps as unknown as ComponentProps<typeof AnimatedBarChartBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const AnimatedBarChart = Interactive.withSchema({\n Component: AnimatedBarChartInner,\n componentName: \"<AnimatedBarChart>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/animated-line-chart.json b/registry-artifacts/elements/animated-line-chart.json
index f11aa95b..6bc8e631 100644
--- a/registry-artifacts/elements/animated-line-chart.json
+++ b/registry-artifacts/elements/animated-line-chart.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 1000,
+ "height": 500
+ },
"displayName": "Animated Line Chart",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "animated-line-chart",
- "sourceCode": "import { Interactive, Sequence, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface AnimatedLineChartProps {\n data?: number[];\n width?: number;\n height?: number;\n strokeColor?: string;\n strokeWidth?: number;\n gridColor?: string;\n showDot?: boolean;\n speed?: number;\n className?: string;\n}\n\nfunction AnimatedLineChartBase({\n data = [12, 19, 8, 15, 22, 18, 28, 25, 32],\n width = 1000,\n height = 500,\n strokeColor = \"#22c55e\",\n strokeWidth = 4,\n gridColor = \"#27272a\",\n showDot = true,\n speed = 1,\n className,\n}: AnimatedLineChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const padding = 60;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n\n const points = data.map((value, index) => {\n const x = padding + (index / (data.length - 1)) * innerWidth;\n const y = padding + innerHeight - ((value - min) / range) * innerHeight;\n return { x, y };\n });\n\n // Analytical path length: sum of segment distances\n let pathLength = 0;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n pathLength += Math.sqrt(dx * dx + dy * dy);\n }\n\n const d = points\n .map((p, i) => `${i === 0 ? \"M\" : \"L\"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)\n .join(\" \");\n\n // Spring-driven progress: smooth, no bounce. Matches the \"smooth\" preset\n // from remotion-best-practices/timing.md.\n const progress = spring({\n frame,\n fps,\n durationInFrames: Math.round(durationInFrames * 0.85),\n config: { damping: 200 },\n });\n\n const dashOffset = pathLength * (1 - progress);\n\n // Find dot position along the path at current progress\n const targetLen = pathLength * progress;\n let traveled = 0;\n let dotX = points[0].x;\n let dotY = points[0].y;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const segLen = Math.sqrt(dx * dx + dy * dy);\n if (traveled + segLen >= targetLen) {\n const t = (targetLen - traveled) / segLen;\n dotX = points[i - 1].x + dx * t;\n dotY = points[i - 1].y + dy * t;\n break;\n }\n traveled += segLen;\n dotX = points[i].x;\n dotY = points[i].y;\n }\n\n const gridRows = 4;\n const gridCols = data.length - 1;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n >\n {/* Horizontal grid */}\n {Array.from({ length: gridRows + 1 }).map((_, i) => {\n const y = padding + (i / gridRows) * innerHeight;\n return (\n <line\n key={`h-${i}`}\n x1={padding}\n x2={padding + innerWidth}\n y1={y}\n y2={y}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Vertical grid */}\n {Array.from({ length: gridCols + 1 }).map((_, i) => {\n const x = padding + (i / gridCols) * innerWidth;\n return (\n <line\n key={`v-${i}`}\n x1={x}\n x2={x}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Axis */}\n <line\n x1={padding}\n x2={padding}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={padding + innerHeight}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n\n {/* Animated line */}\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={pathLength}\n strokeDashoffset={dashOffset}\n style={{\n filter: `drop-shadow(0 0 12px ${strokeColor}55)`,\n }}\n />\n\n {showDot && progress > 0 && progress < 1 && (\n <circle\n cx={dotX}\n cy={dotY}\n r={strokeWidth * 2}\n fill={strokeColor}\n style={{\n filter: `drop-shadow(0 0 8px ${strokeColor})`,\n }}\n />\n )}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n strokeColor: {\n type: \"color\",\n default: \"#22c55e\",\n description: \"Stroke color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 16,\n step: 1,\n default: 4,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n gridColor: {\n type: \"color\",\n default: \"#27272a\",\n description: \"Grid color\",\n },\n showDot: {\n type: \"boolean\",\n default: true,\n description: \"Show leading dot\",\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([\"strokeColor\",\"strokeWidth\",\"gridColor\",\"showDot\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n strokeColor: \"#22c55e\",\n strokeWidth: 4,\n gridColor: \"#27272a\",\n showDot: true,\n speed: 1,\n};\n\ntype AnimatedLineChartElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AnimatedLineChartBase>;\n\nconst AnimatedLineChartInner = forwardRef<\n HTMLDivElement,\n AnimatedLineChartElementProps & { 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 ?? \"<AnimatedLineChart>\"}\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 <AnimatedLineChartBase\n {...(componentProps as unknown as ComponentProps<typeof AnimatedLineChartBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AnimatedLineChart = Interactive.withSchema({\n Component: AnimatedLineChartInner,\n componentName: \"<AnimatedLineChart>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface AnimatedLineChartProps {\n data?: number[];\n width?: number;\n height?: number;\n strokeColor?: string;\n strokeWidth?: number;\n gridColor?: string;\n showDot?: boolean;\n speed?: number;\n className?: string;\n}\n\nfunction AnimatedLineChartBase({\n data = [12, 19, 8, 15, 22, 18, 28, 25, 32],\n width = 1000,\n height = 500,\n strokeColor = \"#22c55e\",\n strokeWidth = 4,\n gridColor = \"#27272a\",\n showDot = true,\n speed = 1,\n className,\n}: AnimatedLineChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const padding = 60;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n\n const points = data.map((value, index) => {\n const x = padding + (index / (data.length - 1)) * innerWidth;\n const y = padding + innerHeight - ((value - min) / range) * innerHeight;\n return { x, y };\n });\n\n // Analytical path length: sum of segment distances\n let pathLength = 0;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n pathLength += Math.sqrt(dx * dx + dy * dy);\n }\n\n const d = points\n .map((p, i) => `${i === 0 ? \"M\" : \"L\"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)\n .join(\" \");\n\n // Spring-driven progress: smooth, no bounce. Matches the \"smooth\" preset\n // from remotion-best-practices/timing.md.\n const progress = spring({\n frame,\n fps,\n durationInFrames: Math.round(durationInFrames * 0.85),\n config: { damping: 200 },\n });\n\n const dashOffset = pathLength * (1 - progress);\n\n // Find dot position along the path at current progress\n const targetLen = pathLength * progress;\n let traveled = 0;\n let dotX = points[0].x;\n let dotY = points[0].y;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const segLen = Math.sqrt(dx * dx + dy * dy);\n if (traveled + segLen >= targetLen) {\n const t = (targetLen - traveled) / segLen;\n dotX = points[i - 1].x + dx * t;\n dotY = points[i - 1].y + dy * t;\n break;\n }\n traveled += segLen;\n dotX = points[i].x;\n dotY = points[i].y;\n }\n\n const gridRows = 4;\n const gridCols = data.length - 1;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n >\n {/* Horizontal grid */}\n {Array.from({ length: gridRows + 1 }).map((_, i) => {\n const y = padding + (i / gridRows) * innerHeight;\n return (\n <line\n key={`h-${i}`}\n x1={padding}\n x2={padding + innerWidth}\n y1={y}\n y2={y}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Vertical grid */}\n {Array.from({ length: gridCols + 1 }).map((_, i) => {\n const x = padding + (i / gridCols) * innerWidth;\n return (\n <line\n key={`v-${i}`}\n x1={x}\n x2={x}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Axis */}\n <line\n x1={padding}\n x2={padding}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={padding + innerHeight}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n\n {/* Animated line */}\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={pathLength}\n strokeDashoffset={dashOffset}\n style={{\n filter: `drop-shadow(0 0 12px ${strokeColor}55)`,\n }}\n />\n\n {showDot && progress > 0 && progress < 1 && (\n <circle\n cx={dotX}\n cy={dotY}\n r={strokeWidth * 2}\n fill={strokeColor}\n style={{\n filter: `drop-shadow(0 0 8px ${strokeColor})`,\n }}\n />\n )}\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n strokeColor: {\n type: \"color\",\n default: \"#22c55e\",\n description: \"Stroke color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 16,\n step: 1,\n default: 4,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n gridColor: {\n type: \"color\",\n default: \"#27272a\",\n description: \"Grid color\",\n },\n showDot: {\n type: \"boolean\",\n default: true,\n description: \"Show leading dot\",\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 width: {\n type: \"number\",\n default: 1000,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 500,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"strokeColor\",\"strokeWidth\",\"gridColor\",\"showDot\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n strokeColor: \"#22c55e\",\n strokeWidth: 4,\n gridColor: \"#27272a\",\n showDot: true,\n speed: 1,\n};\n\ntype AnimatedLineChartElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof AnimatedLineChartBase>;\n\nconst AnimatedLineChartInner = forwardRef<\n HTMLDivElement,\n AnimatedLineChartElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 1000, height = 500, ...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 ?? \"<AnimatedLineChart>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <AnimatedLineChartBase\n {...(componentProps as unknown as ComponentProps<typeof AnimatedLineChartBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const AnimatedLineChart = Interactive.withSchema({\n Component: AnimatedLineChartInner,\n componentName: \"<AnimatedLineChart>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/blur-out-up.json b/registry-artifacts/elements/blur-out-up.json
index c59e9c0d..7169284e 100644
--- a/registry-artifacts/elements/blur-out-up.json
+++ b/registry-artifacts/elements/blur-out-up.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 720,
+ "height": 100
+ },
"displayName": "Blur Out Up",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "blur-out-up",
- "sourceCode": "import { 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\ninterface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction BlurOutUpBase({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const enterTravel = 6;\n const exitDur = 14;\n const exitTravelFrom = 8;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterTravel], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -14],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Clear in, airy out.\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 8,\n step: 1,\n default: 1,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"staggerDelay\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Clear in, airy out.\",\n staggerDelay: 1,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype BlurOutUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BlurOutUpBase>;\n\nconst BlurOutUpInner = forwardRef<\n HTMLDivElement,\n BlurOutUpElementProps & { 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 ?? \"<BlurOutUp>\"}\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 <BlurOutUpBase\n {...(componentProps as unknown as ComponentProps<typeof BlurOutUpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BlurOutUp = Interactive.withSchema({\n Component: BlurOutUpInner,\n componentName: \"<BlurOutUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { 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\ninterface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction BlurOutUpBase({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const enterTravel = 6;\n const exitDur = 14;\n const exitTravelFrom = 8;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterTravel], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -14],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Clear in, airy out.\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 8,\n step: 1,\n default: 1,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 720,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Clear in, airy out.\",\n staggerDelay: 1,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype BlurOutUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof BlurOutUpBase>;\n\nconst BlurOutUpInner = forwardRef<\n HTMLDivElement,\n BlurOutUpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 720, height = 100, ...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 ?? \"<BlurOutUp>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <BlurOutUpBase\n {...(componentProps as unknown as ComponentProps<typeof BlurOutUpBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const BlurOutUp = Interactive.withSchema({\n Component: BlurOutUpInner,\n componentName: \"<BlurOutUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/bottom-up-letters.json b/registry-artifacts/elements/bottom-up-letters.json
index 590b1492..6a556dfe 100644
--- a/registry-artifacts/elements/bottom-up-letters.json
+++ b/registry-artifacts/elements/bottom-up-letters.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 190,
+ "height": 100
+ },
"displayName": "Bottom-Up Letters",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "bottom-up-letters",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction BottomUpLettersBase({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Shift\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 46,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Shift\",\n staggerDelay: 3,\n distance: 46,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype BottomUpLettersElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BottomUpLettersBase>;\n\nconst BottomUpLettersInner = forwardRef<\n HTMLDivElement,\n BottomUpLettersElementProps & { 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 ?? \"<BottomUpLetters>\"}\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 <BottomUpLettersBase\n {...(componentProps as unknown as ComponentProps<typeof BottomUpLettersBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BottomUpLetters = Interactive.withSchema({\n Component: BottomUpLettersInner,\n componentName: \"<BottomUpLetters>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction BottomUpLettersBase({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Shift\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 46,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 190,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Shift\",\n staggerDelay: 3,\n distance: 46,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype BottomUpLettersElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof BottomUpLettersBase>;\n\nconst BottomUpLettersInner = forwardRef<\n HTMLDivElement,\n BottomUpLettersElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 190, height = 100, ...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 ?? \"<BottomUpLetters>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <BottomUpLettersBase\n {...(componentProps as unknown as ComponentProps<typeof BottomUpLettersBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const BottomUpLetters = Interactive.withSchema({\n Component: BottomUpLettersInner,\n componentName: \"<BottomUpLetters>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/chat-to-preview-layout.json b/registry-artifacts/elements/chat-to-preview-layout.json
index c8727747..4165bbb9 100644
--- a/registry-artifacts/elements/chat-to-preview-layout.json
+++ b/registry-artifacts/elements/chat-to-preview-layout.json
@@ -8,7 +8,7 @@
"durationInFrames": 120,
"installationMode": "component-owned-sequence",
"slug": "chat-to-preview-layout",
- "sourceCode": "import { forwardRef, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nfunction ChatToPreviewLayoutBase({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n transform: `translateX(${previewTx}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n startChatRatio: {\n type: \"number\",\n min: 0.1,\n max: 0.9,\n step: 0.05,\n default: 0.5,\n description: \"Start chat ratio\",\n hiddenFromList: false,\n },\n endChatRatio: {\n type: \"number\",\n min: 0.05,\n max: 0.9,\n step: 0.05,\n default: 0.25,\n description: \"End chat ratio\",\n hiddenFromList: false,\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([\"startChatRatio\",\"endChatRatio\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n startChatRatio: 0.5,\n endChatRatio: 0.25,\n speed: 1,\n};\n\ntype ChatToPreviewLayoutElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChatToPreviewLayoutBase>;\n\nconst ChatToPreviewLayoutInner = forwardRef<\n HTMLDivElement,\n ChatToPreviewLayoutElementProps & { 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 ?? \"<ChatToPreviewLayout>\"}\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 <ChatToPreviewLayoutBase\n {...(componentProps as unknown as ComponentProps<typeof ChatToPreviewLayoutBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChatToPreviewLayout = Interactive.withSchema({\n Component: ChatToPreviewLayoutInner,\n componentName: \"<ChatToPreviewLayout>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { forwardRef, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nfunction ChatToPreviewLayoutBase({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n translate: `${previewTx}px`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n startChatRatio: {\n type: \"number\",\n min: 0.1,\n max: 0.9,\n step: 0.05,\n default: 0.5,\n description: \"Start chat ratio\",\n hiddenFromList: false,\n },\n endChatRatio: {\n type: \"number\",\n min: 0.05,\n max: 0.9,\n step: 0.05,\n default: 0.25,\n description: \"End chat ratio\",\n hiddenFromList: false,\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([\"startChatRatio\",\"endChatRatio\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n startChatRatio: 0.5,\n endChatRatio: 0.25,\n speed: 1,\n};\n\ntype ChatToPreviewLayoutElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChatToPreviewLayoutBase>;\n\nconst ChatToPreviewLayoutInner = forwardRef<\n HTMLDivElement,\n ChatToPreviewLayoutElementProps & { 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 ?? \"<ChatToPreviewLayout>\"}\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 <ChatToPreviewLayoutBase\n {...(componentProps as unknown as ComponentProps<typeof ChatToPreviewLayoutBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChatToPreviewLayout = Interactive.withSchema({\n Component: ChatToPreviewLayoutInner,\n componentName: \"<ChatToPreviewLayout>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 120
}
diff --git a/registry-artifacts/elements/confetti.json b/registry-artifacts/elements/confetti.json
index 1bb5ba5b..4c2077bf 100644
--- a/registry-artifacts/elements/confetti.json
+++ b/registry-artifacts/elements/confetti.json
@@ -8,7 +8,7 @@
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "confetti",
- "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\ninterface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nfunction mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nfunction makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nfunction particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nfunction ConfettiBase({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n particleCount: {\n type: \"number\",\n min: 10,\n max: 400,\n step: 10,\n default: 140,\n description: \"Particles\",\n hiddenFromList: false,\n },\n power: {\n type: \"number\",\n min: 4,\n max: 40,\n step: 1,\n default: 17,\n description: \"Power\",\n hiddenFromList: false,\n },\n gravity: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 0.45,\n description: \"Gravity\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 13,\n description: \"Size\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n min: 1,\n step: 1,\n default: 1,\n description: \"Seed\",\n hiddenFromList: false,\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([\"particleCount\",\"power\",\"gravity\",\"size\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n particleCount: 140,\n power: 17,\n gravity: 0.45,\n size: 13,\n seed: 1,\n speed: 1,\n};\n\ntype ConfettiElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ConfettiBase>;\n\nconst ConfettiInner = forwardRef<\n HTMLDivElement,\n ConfettiElementProps & { 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 ?? \"<Confetti>\"}\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 <ConfettiBase\n {...(componentProps as unknown as ComponentProps<typeof ConfettiBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Confetti = Interactive.withSchema({\n Component: ConfettiInner,\n componentName: \"<Confetti>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\ninterface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nfunction mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nfunction makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nfunction particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nfunction ConfettiBase({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n translate: \"-50% -50%\",\n rotate: `${rot}rad`,\n scale: `${flutter} 1`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n particleCount: {\n type: \"number\",\n min: 10,\n max: 400,\n step: 10,\n default: 140,\n description: \"Particles\",\n hiddenFromList: false,\n },\n power: {\n type: \"number\",\n min: 4,\n max: 40,\n step: 1,\n default: 17,\n description: \"Power\",\n hiddenFromList: false,\n },\n gravity: {\n type: \"number\",\n min: 0,\n max: 1.5,\n step: 0.05,\n default: 0.45,\n description: \"Gravity\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 13,\n description: \"Size\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n min: 1,\n step: 1,\n default: 1,\n description: \"Seed\",\n hiddenFromList: false,\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([\"particleCount\",\"power\",\"gravity\",\"size\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n particleCount: 140,\n power: 17,\n gravity: 0.45,\n size: 13,\n seed: 1,\n speed: 1,\n};\n\ntype ConfettiElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ConfettiBase>;\n\nconst ConfettiInner = forwardRef<\n HTMLDivElement,\n ConfettiElementProps & { 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 ?? \"<Confetti>\"}\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 <ConfettiBase\n {...(componentProps as unknown as ComponentProps<typeof ConfettiBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Confetti = Interactive.withSchema({\n Component: ConfettiInner,\n componentName: \"<Confetti>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/drift.json b/registry-artifacts/elements/drift.json
index 725726eb..f87e37c0 100644
--- a/registry-artifacts/elements/drift.json
+++ b/registry-artifacts/elements/drift.json
@@ -8,7 +8,7 @@
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "drift",
- "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface DriftProps {\n children: React.ReactNode;\n grow?: number;\n}\n\nfunction DriftBase({ children, grow = 0.035 }: DriftProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);\n return (\n <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n {children}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n grow: {\n type: \"number\",\n min: -0.1,\n max: 0.15,\n step: 0.005,\n default: 0.035,\n description: \"Grow\",\n hiddenFromList: false,\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([\"grow\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n grow: 0.035,\n speed: 1,\n};\n\ntype DriftElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DriftBase>;\n\nconst DriftInner = forwardRef<\n HTMLDivElement,\n DriftElementProps & { 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 ?? \"<Drift>\"}\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 <DriftBase\n {...(componentProps as unknown as ComponentProps<typeof DriftBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Drift = Interactive.withSchema({\n Component: DriftInner,\n componentName: \"<Drift>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface DriftProps {\n children: React.ReactNode;\n grow?: number;\n}\n\nfunction DriftBase({ children, grow = 0.035 }: DriftProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);\n return (\n <AbsoluteFill style={{ scale: `${scale}` }}>\n {children}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n grow: {\n type: \"number\",\n min: -0.1,\n max: 0.15,\n step: 0.005,\n default: 0.035,\n description: \"Grow\",\n hiddenFromList: false,\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([\"grow\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n grow: 0.035,\n speed: 1,\n};\n\ntype DriftElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DriftBase>;\n\nconst DriftInner = forwardRef<\n HTMLDivElement,\n DriftElementProps & { 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 ?? \"<Drift>\"}\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 <DriftBase\n {...(componentProps as unknown as ComponentProps<typeof DriftBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Drift = Interactive.withSchema({\n Component: DriftInner,\n componentName: \"<Drift>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/ecosystem-constellation.json b/registry-artifacts/elements/ecosystem-constellation.json
index be2d2989..af404af2 100644
--- a/registry-artifacts/elements/ecosystem-constellation.json
+++ b/registry-artifacts/elements/ecosystem-constellation.json
@@ -8,7 +8,7 @@
"durationInFrames": 240,
"installationMode": "component-owned-sequence",
"slug": "ecosystem-constellation",
- "sourceCode": "import { forwardRef, useImperativeHandle, useRef, type ComponentProps, type ComponentType } from \"react\";\nimport { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nfunction EcosystemConstellationBase({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n transform: `scale(${centerScale})`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${s.satScale})`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n satelliteCount: {\n type: \"number\",\n min: 3,\n max: 8,\n step: 1,\n default: 6,\n description: \"Satellite count\",\n hiddenFromList: false,\n },\n centerLabel: {\n type: \"text-content\",\n default: \"V\",\n description: \"Center label\",\n },\n accentColor: {\n type: \"color\",\n default: \"#a855f7\",\n description: \"Accent color\",\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([\"satelliteCount\",\"centerLabel\",\"accentColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n satelliteCount: 6,\n centerLabel: \"V\",\n accentColor: \"#a855f7\",\n speed: 1,\n};\n\ntype EcosystemConstellationElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EcosystemConstellationBase>;\n\nconst EcosystemConstellationInner = forwardRef<\n HTMLDivElement,\n EcosystemConstellationElementProps & { 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 ?? \"<EcosystemConstellation>\"}\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 <EcosystemConstellationBase\n {...(componentProps as unknown as ComponentProps<typeof EcosystemConstellationBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EcosystemConstellation = Interactive.withSchema({\n Component: EcosystemConstellationInner,\n componentName: \"<EcosystemConstellation>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { forwardRef, useImperativeHandle, useRef, type ComponentProps, type ComponentType } from \"react\";\nimport { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nfunction EcosystemConstellationBase({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n scale: `${centerScale}`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n scale: `${s.satScale}`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n satelliteCount: {\n type: \"number\",\n min: 3,\n max: 8,\n step: 1,\n default: 6,\n description: \"Satellite count\",\n hiddenFromList: false,\n },\n centerLabel: {\n type: \"text-content\",\n default: \"V\",\n description: \"Center label\",\n },\n accentColor: {\n type: \"color\",\n default: \"#a855f7\",\n description: \"Accent color\",\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([\"satelliteCount\",\"centerLabel\",\"accentColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n satelliteCount: 6,\n centerLabel: \"V\",\n accentColor: \"#a855f7\",\n speed: 1,\n};\n\ntype EcosystemConstellationElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EcosystemConstellationBase>;\n\nconst EcosystemConstellationInner = forwardRef<\n HTMLDivElement,\n EcosystemConstellationElementProps & { 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 ?? \"<EcosystemConstellation>\"}\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 <EcosystemConstellationBase\n {...(componentProps as unknown as ComponentProps<typeof EcosystemConstellationBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EcosystemConstellation = Interactive.withSchema({\n Component: EcosystemConstellationInner,\n componentName: \"<EcosystemConstellation>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 240
}
diff --git a/registry-artifacts/elements/fade-through.json b/registry-artifacts/elements/fade-through.json
index 39f3608f..390127f5 100644
--- a/registry-artifacts/elements/fade-through.json
+++ b/registry-artifacts/elements/fade-through.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 640,
+ "height": 100
+ },
"displayName": "Fade Through",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "fade-through",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface FadeThroughProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction FadeThroughBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FadeThroughProps) {\n const frame = useCurrentFrame() * speed;\n\n const exitDur = 8;\n const enterDur = 13;\n const overlapF = 1;\n const microDelayF = 2;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toY = interpolate(local, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `translateY(${fromY}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `translateY(${toY}px) scale(${toScale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Calm transitions.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Fade through content.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Calm transitions.\",\n toText: \"Fade through content.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype FadeThroughElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FadeThroughBase>;\n\nconst FadeThroughInner = forwardRef<\n HTMLDivElement,\n FadeThroughElementProps & { 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 ?? \"<FadeThrough>\"}\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 <FadeThroughBase\n {...(componentProps as unknown as ComponentProps<typeof FadeThroughBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FadeThrough = Interactive.withSchema({\n Component: FadeThroughInner,\n componentName: \"<FadeThrough>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface FadeThroughProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction FadeThroughBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FadeThroughProps) {\n const frame = useCurrentFrame() * speed;\n\n const exitDur = 8;\n const enterDur = 13;\n const overlapF = 1;\n const microDelayF = 2;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toY = interpolate(local, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n translate: `0 ${fromY}px`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n translate: `0 ${toY}px`,\n scale: `${toScale}`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Calm transitions.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Fade through content.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 640,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Calm transitions.\",\n toText: \"Fade through content.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype FadeThroughElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof FadeThroughBase>;\n\nconst FadeThroughInner = forwardRef<\n HTMLDivElement,\n FadeThroughElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 640, height = 100, ...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 ?? \"<FadeThrough>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <FadeThroughBase\n {...(componentProps as unknown as ComponentProps<typeof FadeThroughBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const FadeThrough = Interactive.withSchema({\n Component: FadeThroughInner,\n componentName: \"<FadeThrough>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/focus-blur-resolve.json b/registry-artifacts/elements/focus-blur-resolve.json
index 882195b1..04d4a403 100644
--- a/registry-artifacts/elements/focus-blur-resolve.json
+++ b/registry-artifacts/elements/focus-blur-resolve.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 870,
+ "height": 100
+ },
"displayName": "Focus Blur Resolve",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "focus-blur-resolve",
- "sourceCode": "import { 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\ninterface FocusBlurResolveProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction FocusBlurResolveBase({\n text,\n blur = 14,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FocusBlurResolveProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDur = 23;\n const exitDur = 16;\n const exitStart = Math.max(enterDur, durationInFrames - exitDur);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDur], [14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(frame, [0, enterDur], [blur, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(frame, [exitStart, durationInFrames], [0, 10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blurVal = blurEnter + blurExit;\n\n const scale = interpolate(frame, [0, enterDur], [1.01, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Focus resolves clearly.\",\n description: \"Text\",\n },\n blur: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 14,\n description: \"Blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"blur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Focus resolves clearly.\",\n blur: 14,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype FocusBlurResolveElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FocusBlurResolveBase>;\n\nconst FocusBlurResolveInner = forwardRef<\n HTMLDivElement,\n FocusBlurResolveElementProps & { 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 ?? \"<FocusBlurResolve>\"}\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 <FocusBlurResolveBase\n {...(componentProps as unknown as ComponentProps<typeof FocusBlurResolveBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FocusBlurResolve = Interactive.withSchema({\n Component: FocusBlurResolveInner,\n componentName: \"<FocusBlurResolve>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { 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\ninterface FocusBlurResolveProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction FocusBlurResolveBase({\n text,\n blur = 14,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FocusBlurResolveProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDur = 23;\n const exitDur = 16;\n const exitStart = Math.max(enterDur, durationInFrames - exitDur);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDur], [14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(frame, [0, enterDur], [blur, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(frame, [exitStart, durationInFrames], [0, 10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blurVal = blurEnter + blurExit;\n\n const scale = interpolate(frame, [0, enterDur], [1.01, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n translate: `0 ${y}px`,\n scale: `${scale}`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Focus resolves clearly.\",\n description: \"Text\",\n },\n blur: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 14,\n description: \"Blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 870,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"blur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Focus resolves clearly.\",\n blur: 14,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype FocusBlurResolveElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof FocusBlurResolveBase>;\n\nconst FocusBlurResolveInner = forwardRef<\n HTMLDivElement,\n FocusBlurResolveElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 870, height = 100, ...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 ?? \"<FocusBlurResolve>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <FocusBlurResolveBase\n {...(componentProps as unknown as ComponentProps<typeof FocusBlurResolveBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const FocusBlurResolve = Interactive.withSchema({\n Component: FocusBlurResolveInner,\n componentName: \"<FocusBlurResolve>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-activity.json b/registry-artifacts/elements/icon-activity.json
index 9ac7bf92..2fac8ca4 100644
--- a/registry-artifacts/elements/icon-activity.json
+++ b/registry-artifacts/elements/icon-activity.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Activity",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-activity",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PULSE_PATH =\n \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nfunction ActivityIconBase({\n animation = \"both\",\n loop = true,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const beat = acting\n ? interpolate(\n actionProgress,\n [0, 0.1, 0.18, 0.28, 0.38, 1],\n [1, 1.07, 1, 1.05, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const pulse = drawnPathProps(PULSE_PATH, acting ? 1 : drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PULSE_PATH}\n strokeDasharray={pulse.strokeDasharray}\n strokeDashoffset={pulse.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ActivityIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ActivityIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ActivityIconBase>;\n\nconst ActivityIconInner = forwardRef<\n HTMLDivElement,\n ActivityIconElementProps & { 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 ?? \"<ActivityIcon>\"}\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 <ActivityIconBase\n {...(componentProps as unknown as ComponentProps<typeof ActivityIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ActivityIcon = Interactive.withSchema({\n Component: ActivityIconInner,\n componentName: \"<ActivityIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PULSE_PATH =\n \"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nfunction ActivityIconBase({\n animation = \"both\",\n loop = true,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const beat = acting\n ? interpolate(\n actionProgress,\n [0, 0.1, 0.18, 0.28, 0.38, 1],\n [1, 1.07, 1, 1.05, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const pulse = drawnPathProps(PULSE_PATH, acting ? 1 : drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PULSE_PATH}\n strokeDasharray={pulse.strokeDasharray}\n strokeDashoffset={pulse.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ActivityIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ActivityIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ActivityIconBase>;\n\nconst ActivityIconInner = forwardRef<\n HTMLDivElement,\n ActivityIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ActivityIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ActivityIconBase\n {...(componentProps as unknown as ComponentProps<typeof ActivityIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ActivityIcon = Interactive.withSchema({\n Component: ActivityIconInner,\n componentName: \"<ActivityIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-alert-triangle.json b/registry-artifacts/elements/icon-alert-triangle.json
index 9463a186..e05576c1 100644
--- a/registry-artifacts/elements/icon-alert-triangle.json
+++ b/registry-artifacts/elements/icon-alert-triangle.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Alert Triangle",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-alert-triangle",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\";\nconst STEM_PATH = \"M12 9v4\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction AlertTriangleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.85, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const blinkOpacity = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.25, 1, 0.25, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const stemSquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.85, 1, 0.85, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n <g opacity={blinkOpacity}>\n <g\n transform={`translate(12 13) scale(1 ${stemSquash}) translate(-12 -13)`}\n >\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n </g>\n <g transform={`translate(12 17) scale(${dotPop}) translate(-12 -17)`}>\n <path d={DOT_PATH} />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AlertTriangleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TRIANGLE_PATH} />\n <path d={STEM_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AlertTriangleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AlertTriangleIconBase>;\n\nconst AlertTriangleIconInner = forwardRef<\n HTMLDivElement,\n AlertTriangleIconElementProps & { 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 ?? \"<AlertTriangleIcon>\"}\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 <AlertTriangleIconBase\n {...(componentProps as unknown as ComponentProps<typeof AlertTriangleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AlertTriangleIcon = Interactive.withSchema({\n Component: AlertTriangleIconInner,\n componentName: \"<AlertTriangleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\";\nconst STEM_PATH = \"M12 9v4\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction AlertTriangleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.85, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const blinkOpacity = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.25, 1, 0.25, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const stemSquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 0.85, 1, 0.85, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n <g opacity={blinkOpacity}>\n <g\n transform={`translate(12 13) scale(1 ${stemSquash}) translate(-12 -13)`}\n >\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n </g>\n <g transform={`translate(12 17) scale(${dotPop}) translate(-12 -17)`}>\n <path d={DOT_PATH} />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AlertTriangleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TRIANGLE_PATH} />\n <path d={STEM_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AlertTriangleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof AlertTriangleIconBase>;\n\nconst AlertTriangleIconInner = forwardRef<\n HTMLDivElement,\n AlertTriangleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<AlertTriangleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <AlertTriangleIconBase\n {...(componentProps as unknown as ComponentProps<typeof AlertTriangleIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const AlertTriangleIcon = Interactive.withSchema({\n Component: AlertTriangleIconInner,\n componentName: \"<AlertTriangleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-arrow-down.json b/registry-artifacts/elements/icon-arrow-down.json
index fbfcb888..7ab7448b 100644
--- a/registry-artifacts/elements/icon-arrow-down.json
+++ b/registry-artifacts/elements/icon-arrow-down.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Arrow Down",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-arrow-down",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 5v14\";\nconst HEAD_PATH = \"m19 12-7 7-7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowDownIconBase>;\n\nconst ArrowDownIconInner = forwardRef<\n HTMLDivElement,\n ArrowDownIconElementProps & { 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 ?? \"<ArrowDownIcon>\"}\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 <ArrowDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowDownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowDownIcon = Interactive.withSchema({\n Component: ArrowDownIconInner,\n componentName: \"<ArrowDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 5v14\";\nconst HEAD_PATH = \"m19 12-7 7-7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ArrowDownIconBase>;\n\nconst ArrowDownIconInner = forwardRef<\n HTMLDivElement,\n ArrowDownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ArrowDownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ArrowDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowDownIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowDownIcon = Interactive.withSchema({\n Component: ArrowDownIconInner,\n componentName: \"<ArrowDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-arrow-left.json b/registry-artifacts/elements/icon-arrow-left.json
index 5e584682..322afe87 100644
--- a/registry-artifacts/elements/icon-arrow-left.json
+++ b/registry-artifacts/elements/icon-arrow-left.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Arrow Left",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-arrow-left",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M19 12H5\";\nconst HEAD_PATH = \"m12 19-7-7 7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowLeftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowLeftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowLeftIconBase>;\n\nconst ArrowLeftIconInner = forwardRef<\n HTMLDivElement,\n ArrowLeftIconElementProps & { 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 ?? \"<ArrowLeftIcon>\"}\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 <ArrowLeftIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowLeftIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowLeftIcon = Interactive.withSchema({\n Component: ArrowLeftIconInner,\n componentName: \"<ArrowLeftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M19 12H5\";\nconst HEAD_PATH = \"m12 19-7-7 7-7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowLeftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowLeftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ArrowLeftIconBase>;\n\nconst ArrowLeftIconInner = forwardRef<\n HTMLDivElement,\n ArrowLeftIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ArrowLeftIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ArrowLeftIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowLeftIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowLeftIcon = Interactive.withSchema({\n Component: ArrowLeftIconInner,\n componentName: \"<ArrowLeftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-arrow-right.json b/registry-artifacts/elements/icon-arrow-right.json
index 3452f3a1..b4ca1e45 100644
--- a/registry-artifacts/elements/icon-arrow-right.json
+++ b/registry-artifacts/elements/icon-arrow-right.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Arrow Right",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-arrow-right",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M5 12h14\";\nconst HEAD_PATH = \"m12 5 7 7-7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowRightIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowRightIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowRightIconBase>;\n\nconst ArrowRightIconInner = forwardRef<\n HTMLDivElement,\n ArrowRightIconElementProps & { 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 ?? \"<ArrowRightIcon>\"}\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 <ArrowRightIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowRightIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowRightIcon = Interactive.withSchema({\n Component: ArrowRightIconInner,\n componentName: \"<ArrowRightIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M5 12h14\";\nconst HEAD_PATH = \"m12 5 7 7-7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowRightIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeX = 6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudgeX} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowRightIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ArrowRightIconBase>;\n\nconst ArrowRightIconInner = forwardRef<\n HTMLDivElement,\n ArrowRightIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ArrowRightIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ArrowRightIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowRightIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowRightIcon = Interactive.withSchema({\n Component: ArrowRightIconInner,\n componentName: \"<ArrowRightIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-arrow-up.json b/registry-artifacts/elements/icon-arrow-up.json
index 610fcf2c..97092853 100644
--- a/registry-artifacts/elements/icon-arrow-up.json
+++ b/registry-artifacts/elements/icon-arrow-up.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Arrow Up",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-arrow-up",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 19V5\";\nconst HEAD_PATH = \"m5 12 7-7 7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ArrowUpIconBase>;\n\nconst ArrowUpIconInner = forwardRef<\n HTMLDivElement,\n ArrowUpIconElementProps & { 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 ?? \"<ArrowUpIcon>\"}\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 <ArrowUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowUpIcon = Interactive.withSchema({\n Component: ArrowUpIconInner,\n componentName: \"<ArrowUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHAFT_PATH = \"M12 19V5\";\nconst HEAD_PATH = \"m5 12 7-7 7 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction ArrowUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const shaftProgress = interpolate(linearDraw, [0, 0.66], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const outward = interpolate(actionProgress, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(2.2)),\n });\n const settle = interpolate(actionProgress, [0.5, 1], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const nudgeY = -6 * (actionProgress < 0.5 ? outward : settle);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${nudgeY})`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ArrowUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ArrowUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ArrowUpIconBase>;\n\nconst ArrowUpIconInner = forwardRef<\n HTMLDivElement,\n ArrowUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ArrowUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ArrowUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ArrowUpIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ArrowUpIcon = Interactive.withSchema({\n Component: ArrowUpIconInner,\n componentName: \"<ArrowUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-at-sign.json b/registry-artifacts/elements/icon-at-sign.json
index 3c08e845..fdf47b79 100644
--- a/registry-artifacts/elements/icon-at-sign.json
+++ b/registry-artifacts/elements/icon-at-sign.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "At Sign",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-at-sign",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\nconst SWOOSH_PATH = \"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction AtSignIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const circleDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const swooshDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circlePop = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swooshProgress = acting ? 1 : swooshDraw;\n const circleProgress = acting ? 1 : circleDraw;\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const swoosh = drawnPathProps(SWOOSH_PATH, swooshProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - circlePop)} ${CENTER * (1 - circlePop)}) scale(${circlePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </g>\n <path\n d={SWOOSH_PATH}\n strokeDasharray={swoosh.strokeDasharray}\n strokeDashoffset={swoosh.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction AtSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d={SWOOSH_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AtSignIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AtSignIconBase>;\n\nconst AtSignIconInner = forwardRef<\n HTMLDivElement,\n AtSignIconElementProps & { 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 ?? \"<AtSignIcon>\"}\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 <AtSignIconBase\n {...(componentProps as unknown as ComponentProps<typeof AtSignIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AtSignIcon = Interactive.withSchema({\n Component: AtSignIconInner,\n componentName: \"<AtSignIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\nconst SWOOSH_PATH = \"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction AtSignIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const circleDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const swooshDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circlePop = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swooshProgress = acting ? 1 : swooshDraw;\n const circleProgress = acting ? 1 : circleDraw;\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const swoosh = drawnPathProps(SWOOSH_PATH, swooshProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - circlePop)} ${CENTER * (1 - circlePop)}) scale(${circlePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </g>\n <path\n d={SWOOSH_PATH}\n strokeDasharray={swoosh.strokeDasharray}\n strokeDashoffset={swoosh.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction AtSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d={SWOOSH_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AtSignIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof AtSignIconBase>;\n\nconst AtSignIconInner = forwardRef<\n HTMLDivElement,\n AtSignIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<AtSignIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <AtSignIconBase\n {...(componentProps as unknown as ComponentProps<typeof AtSignIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const AtSignIcon = Interactive.withSchema({\n Component: AtSignIconInner,\n componentName: \"<AtSignIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-award.json b/registry-artifacts/elements/icon-award.json
index 9640de61..5abc672b 100644
--- a/registry-artifacts/elements/icon-award.json
+++ b/registry-artifacts/elements/icon-award.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Award",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-award",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MEDAL_PATH = \"M12 2a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RIBBON_PATH =\n \"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\";\n\nconst MEDAL_CX = 12;\nconst MEDAL_CY = 8;\nconst PIVOT_X = 12;\nconst PIVOT_Y = 2;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction AwardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ribbonDraw = acting\n ? interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.35, 0.55, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swing = acting\n ? interpolate(\n actionProgress,\n [0.35, 0.5, 0.65, 0.8, 1],\n [0, 4, -3, 1.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const medal = drawnPathProps(MEDAL_PATH, acting ? 1 : drawProgress);\n const ribbon = drawnPathProps(RIBBON_PATH, ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${MEDAL_CX * (1 - pop)} ${MEDAL_CY * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={RIBBON_PATH}\n strokeDasharray={ribbon.strokeDasharray}\n strokeDashoffset={ribbon.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={MEDAL_PATH}\n strokeDasharray={medal.strokeDasharray}\n strokeDashoffset={medal.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\" />\n <circle cx=\"12\" cy=\"8\" r=\"6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AwardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AwardIconBase>;\n\nconst AwardIconInner = forwardRef<\n HTMLDivElement,\n AwardIconElementProps & { 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 ?? \"<AwardIcon>\"}\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 <AwardIconBase\n {...(componentProps as unknown as ComponentProps<typeof AwardIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AwardIcon = Interactive.withSchema({\n Component: AwardIconInner,\n componentName: \"<AwardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MEDAL_PATH = \"M12 2a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RIBBON_PATH =\n \"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\";\n\nconst MEDAL_CX = 12;\nconst MEDAL_CY = 8;\nconst PIVOT_X = 12;\nconst PIVOT_Y = 2;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction AwardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ribbonDraw = acting\n ? interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.35, 0.55, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const swing = acting\n ? interpolate(\n actionProgress,\n [0.35, 0.5, 0.65, 0.8, 1],\n [0, 4, -3, 1.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const medal = drawnPathProps(MEDAL_PATH, acting ? 1 : drawProgress);\n const ribbon = drawnPathProps(RIBBON_PATH, ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${MEDAL_CX * (1 - pop)} ${MEDAL_CY * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={RIBBON_PATH}\n strokeDasharray={ribbon.strokeDasharray}\n strokeDashoffset={ribbon.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={MEDAL_PATH}\n strokeDasharray={medal.strokeDasharray}\n strokeDashoffset={medal.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction AwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526\" />\n <circle cx=\"12\" cy=\"8\" r=\"6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype AwardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof AwardIconBase>;\n\nconst AwardIconInner = forwardRef<\n HTMLDivElement,\n AwardIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<AwardIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <AwardIconBase\n {...(componentProps as unknown as ComponentProps<typeof AwardIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const AwardIcon = Interactive.withSchema({\n Component: AwardIconInner,\n componentName: \"<AwardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-bar-chart-3.json b/registry-artifacts/elements/icon-bar-chart-3.json
index e1243a5f..d197d61b 100644
--- a/registry-artifacts/elements/icon-bar-chart-3.json
+++ b/registry-artifacts/elements/icon-bar-chart-3.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Bar Chart 3",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-bar-chart-3",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst AXIS_PATH = \"M3 3v16a2 2 0 0 0 2 2h16\";\nconst BARS = [\"M8 17V14\", \"M13 17V5\", \"M18 17V9\"];\nconst BASE_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction BarChart3IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const axis = drawnPathProps(AXIS_PATH, drawProgress);\n\n const bars = BARS.map((d, i) => {\n const start = i * 0.22;\n const grow = interpolate(\n actionProgress,\n [start, start + 0.3, start + 0.42],\n [0, 1.08, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n },\n );\n const scaleY = animation === \"draw\" ? 1 : acting ? grow : 0;\n return { d, scaleY };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={AXIS_PATH}\n strokeDasharray={axis.strokeDasharray}\n strokeDashoffset={axis.strokeDashoffset}\n />\n {bars.map((bar) => (\n <g\n key={bar.d}\n transform={`translate(0 ${BASE_Y * (1 - bar.scaleY)}) scale(1 ${bar.scaleY})`}\n >\n <path d={bar.d} />\n </g>\n ))}\n </svg>\n );\n}\n\nfunction BarChart3IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={AXIS_PATH} />\n <path d=\"M18 17V9\" />\n <path d=\"M13 17V5\" />\n <path d=\"M8 17v-3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BarChart3IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BarChart3IconBase>;\n\nconst BarChart3IconInner = forwardRef<\n HTMLDivElement,\n BarChart3IconElementProps & { 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 ?? \"<BarChart3Icon>\"}\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 <BarChart3IconBase\n {...(componentProps as unknown as ComponentProps<typeof BarChart3IconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BarChart3Icon = Interactive.withSchema({\n Component: BarChart3IconInner,\n componentName: \"<BarChart3Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst AXIS_PATH = \"M3 3v16a2 2 0 0 0 2 2h16\";\nconst BARS = [\"M8 17V14\", \"M13 17V5\", \"M18 17V9\"];\nconst BASE_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction BarChart3IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const axis = drawnPathProps(AXIS_PATH, drawProgress);\n\n const bars = BARS.map((d, i) => {\n const start = i * 0.22;\n const grow = interpolate(\n actionProgress,\n [start, start + 0.3, start + 0.42],\n [0, 1.08, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n },\n );\n const scaleY = animation === \"draw\" ? 1 : acting ? grow : 0;\n return { d, scaleY };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={AXIS_PATH}\n strokeDasharray={axis.strokeDasharray}\n strokeDashoffset={axis.strokeDashoffset}\n />\n {bars.map((bar) => (\n <g\n key={bar.d}\n transform={`translate(0 ${BASE_Y * (1 - bar.scaleY)}) scale(1 ${bar.scaleY})`}\n >\n <path d={bar.d} />\n </g>\n ))}\n </svg>\n );\n}\n\nfunction BarChart3IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={AXIS_PATH} />\n <path d=\"M18 17V9\" />\n <path d=\"M13 17V5\" />\n <path d=\"M8 17v-3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BarChart3IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof BarChart3IconBase>;\n\nconst BarChart3IconInner = forwardRef<\n HTMLDivElement,\n BarChart3IconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<BarChart3Icon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <BarChart3IconBase\n {...(componentProps as unknown as ComponentProps<typeof BarChart3IconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const BarChart3Icon = Interactive.withSchema({\n Component: BarChart3IconInner,\n componentName: \"<BarChart3Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-bell.json b/registry-artifacts/elements/icon-bell.json
index ced6f902..b56d2c47 100644
--- a/registry-artifacts/elements/icon-bell.json
+++ b/registry-artifacts/elements/icon-bell.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Bell",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-bell",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\";\nconst CLAPPER_PATH = \"M10.268 21a2 2 0 0 0 3.464 0\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction BellIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const clapperProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const clapper = drawnPathProps(CLAPPER_PATH, clapperProgress);\n\n const ring = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [0, 14, -11, 7, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} 12 2)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={CLAPPER_PATH}\n strokeDasharray={clapper.strokeDasharray}\n strokeDashoffset={clapper.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BellIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={CLAPPER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BellIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BellIconBase>;\n\nconst BellIconInner = forwardRef<\n HTMLDivElement,\n BellIconElementProps & { 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 ?? \"<BellIcon>\"}\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 <BellIconBase\n {...(componentProps as unknown as ComponentProps<typeof BellIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BellIcon = Interactive.withSchema({\n Component: BellIconInner,\n componentName: \"<BellIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326\";\nconst CLAPPER_PATH = \"M10.268 21a2 2 0 0 0 3.464 0\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction BellIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const clapperProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const clapper = drawnPathProps(CLAPPER_PATH, clapperProgress);\n\n const ring = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [0, 14, -11, 7, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} 12 2)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={CLAPPER_PATH}\n strokeDasharray={clapper.strokeDasharray}\n strokeDashoffset={clapper.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BellIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={CLAPPER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BellIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof BellIconBase>;\n\nconst BellIconInner = forwardRef<\n HTMLDivElement,\n BellIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<BellIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <BellIconBase\n {...(componentProps as unknown as ComponentProps<typeof BellIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const BellIcon = Interactive.withSchema({\n Component: BellIconInner,\n componentName: \"<BellIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-bookmark.json b/registry-artifacts/elements/icon-bookmark.json
index 971d1996..d4ed27d3 100644
--- a/registry-artifacts/elements/icon-bookmark.json
+++ b/registry-artifacts/elements/icon-bookmark.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Bookmark",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-bookmark",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOOKMARK_PATH =\n \"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction BookmarkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.6, 1], [-3, 0.5, -0.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(BOOKMARK_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} 12 3) translate(0 ${drop})`}>\n <path\n d={BOOKMARK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BookmarkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOOKMARK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BookmarkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BookmarkIconBase>;\n\nconst BookmarkIconInner = forwardRef<\n HTMLDivElement,\n BookmarkIconElementProps & { 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 ?? \"<BookmarkIcon>\"}\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 <BookmarkIconBase\n {...(componentProps as unknown as ComponentProps<typeof BookmarkIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BookmarkIcon = Interactive.withSchema({\n Component: BookmarkIconInner,\n componentName: \"<BookmarkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOOKMARK_PATH =\n \"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction BookmarkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.6, 1], [-3, 0.5, -0.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(BOOKMARK_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} 12 3) translate(0 ${drop})`}>\n <path\n d={BOOKMARK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction BookmarkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOOKMARK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype BookmarkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof BookmarkIconBase>;\n\nconst BookmarkIconInner = forwardRef<\n HTMLDivElement,\n BookmarkIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<BookmarkIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <BookmarkIconBase\n {...(componentProps as unknown as ComponentProps<typeof BookmarkIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const BookmarkIcon = Interactive.withSchema({\n Component: BookmarkIconInner,\n componentName: \"<BookmarkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-calendar.json b/registry-artifacts/elements/icon-calendar.json
index 9a093007..9f42abbc 100644
--- a/registry-artifacts/elements/icon-calendar.json
+++ b/registry-artifacts/elements/icon-calendar.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Calendar",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-calendar",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 4H19A2 2 0 0 1 21 6V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V6A2 2 0 0 1 5 4Z\";\nconst RING1_PATH = \"M8 2v4\";\nconst RING2_PATH = \"M16 2v4\";\nconst RULE_PATH = \"M3 10H21\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction CalendarIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const frameDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ringsDraw = interpolate(linearDraw, [0.4, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ruleDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const ring1Dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const ring2Dip = acting\n ? interpolate(actionProgress, [0.1, 0.35, 0.6], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, acting ? 1 : frameDraw);\n const ring1 = drawnPathProps(RING1_PATH, acting ? 1 : ringsDraw);\n const ring2 = drawnPathProps(RING2_PATH, acting ? 1 : ringsDraw);\n const rule = drawnPathProps(RULE_PATH, acting ? 1 : ruleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${ring1Dip})`}>\n <path\n d={RING1_PATH}\n strokeDasharray={ring1.strokeDasharray}\n strokeDashoffset={ring1.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${ring2Dip})`}>\n <path\n d={RING2_PATH}\n strokeDasharray={ring2.strokeDasharray}\n strokeDashoffset={ring2.strokeDashoffset}\n />\n </g>\n <path\n d={RULE_PATH}\n strokeDasharray={rule.strokeDasharray}\n strokeDashoffset={rule.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CalendarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CalendarIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CalendarIconBase>;\n\nconst CalendarIconInner = forwardRef<\n HTMLDivElement,\n CalendarIconElementProps & { 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 ?? \"<CalendarIcon>\"}\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 <CalendarIconBase\n {...(componentProps as unknown as ComponentProps<typeof CalendarIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CalendarIcon = Interactive.withSchema({\n Component: CalendarIconInner,\n componentName: \"<CalendarIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 4H19A2 2 0 0 1 21 6V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V6A2 2 0 0 1 5 4Z\";\nconst RING1_PATH = \"M8 2v4\";\nconst RING2_PATH = \"M16 2v4\";\nconst RULE_PATH = \"M3 10H21\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction CalendarIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const frameDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ringsDraw = interpolate(linearDraw, [0.4, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ruleDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const ring1Dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const ring2Dip = acting\n ? interpolate(actionProgress, [0.1, 0.35, 0.6], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, acting ? 1 : frameDraw);\n const ring1 = drawnPathProps(RING1_PATH, acting ? 1 : ringsDraw);\n const ring2 = drawnPathProps(RING2_PATH, acting ? 1 : ringsDraw);\n const rule = drawnPathProps(RULE_PATH, acting ? 1 : ruleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${ring1Dip})`}>\n <path\n d={RING1_PATH}\n strokeDasharray={ring1.strokeDasharray}\n strokeDashoffset={ring1.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${ring2Dip})`}>\n <path\n d={RING2_PATH}\n strokeDasharray={ring2.strokeDasharray}\n strokeDashoffset={ring2.strokeDashoffset}\n />\n </g>\n <path\n d={RULE_PATH}\n strokeDasharray={rule.strokeDasharray}\n strokeDashoffset={rule.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CalendarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M8 2v4\" />\n <path d=\"M16 2v4\" />\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"4\" rx=\"2\" />\n <path d=\"M3 10h18\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CalendarIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CalendarIconBase>;\n\nconst CalendarIconInner = forwardRef<\n HTMLDivElement,\n CalendarIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CalendarIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CalendarIconBase\n {...(componentProps as unknown as ComponentProps<typeof CalendarIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CalendarIcon = Interactive.withSchema({\n Component: CalendarIconInner,\n componentName: \"<CalendarIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-camera.json b/registry-artifacts/elements/icon-camera.json
index edc6e72d..c20e2f71 100644
--- a/registry-artifacts/elements/icon-camera.json
+++ b/registry-artifacts/elements/icon-camera.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Camera",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-camera",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z\";\nconst LENS_PATH =\n \"M12 10 A3 3 0 0 1 15 13 A3 3 0 0 1 12 16 A3 3 0 0 1 9 13 A3 3 0 0 1 12 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CameraIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.444, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const shutter = acting\n ? interpolate(\n actionProgress,\n [0, 0.28, 0.56, 0.78, 1],\n [1, 0.55, 1.08, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lensTransform = `translate(${12 * (1 - shutter)} ${13 * (1 - shutter)}) scale(${shutter})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={lensTransform}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CameraIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <circle cx=\"12\" cy=\"13\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CameraIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CameraIconBase>;\n\nconst CameraIconInner = forwardRef<\n HTMLDivElement,\n CameraIconElementProps & { 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 ?? \"<CameraIcon>\"}\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 <CameraIconBase\n {...(componentProps as unknown as ComponentProps<typeof CameraIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CameraIcon = Interactive.withSchema({\n Component: CameraIconInner,\n componentName: \"<CameraIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z\";\nconst LENS_PATH =\n \"M12 10 A3 3 0 0 1 15 13 A3 3 0 0 1 12 16 A3 3 0 0 1 9 13 A3 3 0 0 1 12 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CameraIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.444, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const shutter = acting\n ? interpolate(\n actionProgress,\n [0, 0.28, 0.56, 0.78, 1],\n [1, 0.55, 1.08, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lensTransform = `translate(${12 * (1 - shutter)} ${13 * (1 - shutter)}) scale(${shutter})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={lensTransform}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CameraIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <circle cx=\"12\" cy=\"13\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CameraIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CameraIconBase>;\n\nconst CameraIconInner = forwardRef<\n HTMLDivElement,\n CameraIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CameraIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CameraIconBase\n {...(componentProps as unknown as ComponentProps<typeof CameraIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CameraIcon = Interactive.withSchema({\n Component: CameraIconInner,\n componentName: \"<CameraIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-check-circle.json b/registry-artifacts/elements/icon-check-circle.json
index 7b61daf8..b066d8bb 100644
--- a/registry-artifacts/elements/icon-check-circle.json
+++ b/registry-artifacts/elements/icon-check-circle.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Check Circle",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-check-circle",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst CHECK_PATH = \"M9 12 11 14 15 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CheckCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const checkProgress = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const check = drawnPathProps(CHECK_PATH, checkProgress);\n\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={CHECK_PATH}\n strokeDasharray={check.strokeDasharray}\n strokeDashoffset={check.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CHECK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CheckCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CheckCircleIconBase>;\n\nconst CheckCircleIconInner = forwardRef<\n HTMLDivElement,\n CheckCircleIconElementProps & { 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 ?? \"<CheckCircleIcon>\"}\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 <CheckCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof CheckCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CheckCircleIcon = Interactive.withSchema({\n Component: CheckCircleIconInner,\n componentName: \"<CheckCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst CHECK_PATH = \"M9 12 11 14 15 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CheckCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const checkProgress = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const check = drawnPathProps(CHECK_PATH, checkProgress);\n\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={CHECK_PATH}\n strokeDasharray={check.strokeDasharray}\n strokeDashoffset={check.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CHECK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CheckCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CheckCircleIconBase>;\n\nconst CheckCircleIconInner = forwardRef<\n HTMLDivElement,\n CheckCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CheckCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CheckCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof CheckCircleIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CheckCircleIcon = Interactive.withSchema({\n Component: CheckCircleIconInner,\n componentName: \"<CheckCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-check.json b/registry-artifacts/elements/icon-check.json
index 1595a0f0..eadabccb 100644
--- a/registry-artifacts/elements/icon-check.json
+++ b/registry-artifacts/elements/icon-check.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Check",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-check",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHECK_PATH = \"M4 12 9 17 20 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CheckIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHECK_PATH, drawProgress);\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const rotate = interpolate(actionProgress, [0, 0.5], [-4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.18 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={CHECK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHECK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CheckIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CheckIconBase>;\n\nconst CheckIconInner = forwardRef<\n HTMLDivElement,\n CheckIconElementProps & { 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 ?? \"<CheckIcon>\"}\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 <CheckIconBase\n {...(componentProps as unknown as ComponentProps<typeof CheckIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CheckIcon = Interactive.withSchema({\n Component: CheckIconInner,\n componentName: \"<CheckIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHECK_PATH = \"M4 12 9 17 20 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction CheckIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHECK_PATH, drawProgress);\n const pop = interpolate(actionProgress, [0, 0.4, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const rotate = interpolate(actionProgress, [0, 0.5], [-4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.18 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={CHECK_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CheckIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHECK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CheckIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CheckIconBase>;\n\nconst CheckIconInner = forwardRef<\n HTMLDivElement,\n CheckIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CheckIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CheckIconBase\n {...(componentProps as unknown as ComponentProps<typeof CheckIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CheckIcon = Interactive.withSchema({\n Component: CheckIconInner,\n componentName: \"<CheckIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-chevron-down.json b/registry-artifacts/elements/icon-chevron-down.json
index 66311665..a3fcb8a4 100644
--- a/registry-artifacts/elements/icon-chevron-down.json
+++ b/registry-artifacts/elements/icon-chevron-down.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Chevron Down",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-chevron-down",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M6 9 12 15 18 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronDownIconBase>;\n\nconst ChevronDownIconInner = forwardRef<\n HTMLDivElement,\n ChevronDownIconElementProps & { 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 ?? \"<ChevronDownIcon>\"}\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 <ChevronDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronDownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronDownIcon = Interactive.withSchema({\n Component: ChevronDownIconInner,\n componentName: \"<ChevronDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M6 9 12 15 18 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ChevronDownIconBase>;\n\nconst ChevronDownIconInner = forwardRef<\n HTMLDivElement,\n ChevronDownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ChevronDownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ChevronDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronDownIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronDownIcon = Interactive.withSchema({\n Component: ChevronDownIconInner,\n componentName: \"<ChevronDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-chevron-left.json b/registry-artifacts/elements/icon-chevron-left.json
index 60ff67e1..4ecbb13b 100644
--- a/registry-artifacts/elements/icon-chevron-left.json
+++ b/registry-artifacts/elements/icon-chevron-left.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Chevron Left",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-chevron-left",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M15 18 9 12 15 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronLeftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronLeftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronLeftIconBase>;\n\nconst ChevronLeftIconInner = forwardRef<\n HTMLDivElement,\n ChevronLeftIconElementProps & { 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 ?? \"<ChevronLeftIcon>\"}\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 <ChevronLeftIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronLeftIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronLeftIcon = Interactive.withSchema({\n Component: ChevronLeftIconInner,\n componentName: \"<ChevronLeftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M15 18 9 12 15 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronLeftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronLeftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronLeftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ChevronLeftIconBase>;\n\nconst ChevronLeftIconInner = forwardRef<\n HTMLDivElement,\n ChevronLeftIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ChevronLeftIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ChevronLeftIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronLeftIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronLeftIcon = Interactive.withSchema({\n Component: ChevronLeftIconInner,\n componentName: \"<ChevronLeftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-chevron-right.json b/registry-artifacts/elements/icon-chevron-right.json
index 3b13412a..730b179d 100644
--- a/registry-artifacts/elements/icon-chevron-right.json
+++ b/registry-artifacts/elements/icon-chevron-right.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Chevron Right",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-chevron-right",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M9 18 15 12 9 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronRightIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronRightIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronRightIconBase>;\n\nconst ChevronRightIconInner = forwardRef<\n HTMLDivElement,\n ChevronRightIconElementProps & { 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 ?? \"<ChevronRightIcon>\"}\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 <ChevronRightIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronRightIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronRightIcon = Interactive.withSchema({\n Component: ChevronRightIconInner,\n componentName: \"<ChevronRightIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M9 18 15 12 9 6\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronRightIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, 4, 0, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronRightIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronRightIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ChevronRightIconBase>;\n\nconst ChevronRightIconInner = forwardRef<\n HTMLDivElement,\n ChevronRightIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ChevronRightIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ChevronRightIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronRightIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronRightIcon = Interactive.withSchema({\n Component: ChevronRightIconInner,\n componentName: \"<ChevronRightIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-chevron-up.json b/registry-artifacts/elements/icon-chevron-up.json
index 016af269..bc7e2a55 100644
--- a/registry-artifacts/elements/icon-chevron-up.json
+++ b/registry-artifacts/elements/icon-chevron-up.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Chevron Up",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-chevron-up",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M18 15 12 9 6 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ChevronUpIconBase>;\n\nconst ChevronUpIconInner = forwardRef<\n HTMLDivElement,\n ChevronUpIconElementProps & { 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 ?? \"<ChevronUpIcon>\"}\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 <ChevronUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronUpIcon = Interactive.withSchema({\n Component: ChevronUpIconInner,\n componentName: \"<ChevronUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M18 15 12 9 6 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction ChevronUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(CHEVRON_PATH, drawProgress);\n const nudge = interpolate(\n actionProgress,\n [0, 0.22, 0.45, 0.68, 1],\n [0, -4, 0, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={CHEVRON_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ChevronUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CHEVRON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ChevronUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ChevronUpIconBase>;\n\nconst ChevronUpIconInner = forwardRef<\n HTMLDivElement,\n ChevronUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ChevronUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ChevronUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ChevronUpIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ChevronUpIcon = Interactive.withSchema({\n Component: ChevronUpIconInner,\n componentName: \"<ChevronUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-clock.json b/registry-artifacts/elements/icon-clock.json
index ced4fa81..086c25ee 100644
--- a/registry-artifacts/elements/icon-clock.json
+++ b/registry-artifacts/elements/icon-clock.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Clock",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-clock",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FACE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst HANDS_PATH = \"M12 6v6l4 2\";\nconst MINUTE_PATH = \"M12 6V12\";\nconst HOUR_PATH = \"M12 12 16 14\";\n\nconst CENTER = 12;\nconst STEPS = 4;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction ClockIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const faceDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scaled = actionProgress * STEPS;\n const stepIndex = Math.floor(scaled);\n const frac = scaled - stepIndex;\n const eased = interpolate(frac, [0, 0.55, 1], [0, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tick = acting ? ((stepIndex + eased) / STEPS) * 360 : 0;\n\n const face = drawnPathProps(FACE_PATH, acting ? 1 : faceDraw);\n const minute = drawnPathProps(MINUTE_PATH, acting ? 1 : handsDraw);\n const hour = drawnPathProps(HOUR_PATH, acting ? 1 : handsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FACE_PATH}\n strokeDasharray={face.strokeDasharray}\n strokeDashoffset={face.strokeDashoffset}\n />\n <path\n d={HOUR_PATH}\n strokeDasharray={hour.strokeDasharray}\n strokeDashoffset={hour.strokeDashoffset}\n />\n <g transform={`rotate(${tick} ${CENTER} ${CENTER})`}>\n <path\n d={MINUTE_PATH}\n strokeDasharray={minute.strokeDasharray}\n strokeDashoffset={minute.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ClockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={HANDS_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ClockIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ClockIconBase>;\n\nconst ClockIconInner = forwardRef<\n HTMLDivElement,\n ClockIconElementProps & { 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 ?? \"<ClockIcon>\"}\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 <ClockIconBase\n {...(componentProps as unknown as ComponentProps<typeof ClockIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ClockIcon = Interactive.withSchema({\n Component: ClockIconInner,\n componentName: \"<ClockIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FACE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst HANDS_PATH = \"M12 6v6l4 2\";\nconst MINUTE_PATH = \"M12 6V12\";\nconst HOUR_PATH = \"M12 12 16 14\";\n\nconst CENTER = 12;\nconst STEPS = 4;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction ClockIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const faceDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scaled = actionProgress * STEPS;\n const stepIndex = Math.floor(scaled);\n const frac = scaled - stepIndex;\n const eased = interpolate(frac, [0, 0.55, 1], [0, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tick = acting ? ((stepIndex + eased) / STEPS) * 360 : 0;\n\n const face = drawnPathProps(FACE_PATH, acting ? 1 : faceDraw);\n const minute = drawnPathProps(MINUTE_PATH, acting ? 1 : handsDraw);\n const hour = drawnPathProps(HOUR_PATH, acting ? 1 : handsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FACE_PATH}\n strokeDasharray={face.strokeDasharray}\n strokeDashoffset={face.strokeDashoffset}\n />\n <path\n d={HOUR_PATH}\n strokeDasharray={hour.strokeDasharray}\n strokeDashoffset={hour.strokeDashoffset}\n />\n <g transform={`rotate(${tick} ${CENTER} ${CENTER})`}>\n <path\n d={MINUTE_PATH}\n strokeDasharray={minute.strokeDasharray}\n strokeDashoffset={minute.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ClockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={HANDS_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ClockIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ClockIconBase>;\n\nconst ClockIconInner = forwardRef<\n HTMLDivElement,\n ClockIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ClockIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ClockIconBase\n {...(componentProps as unknown as ComponentProps<typeof ClockIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ClockIcon = Interactive.withSchema({\n Component: ClockIconInner,\n componentName: \"<ClockIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-cloud.json b/registry-artifacts/elements/icon-cloud.json
index 746010f4..932e1004 100644
--- a/registry-artifacts/elements/icon-cloud.json
+++ b/registry-artifacts/elements/icon-cloud.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Cloud",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-cloud",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CLOUD_PATH = \"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction CloudIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const float = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 0.8, 1], [0, -2, 0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const cloud = drawnPathProps(CLOUD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${float}px) scale(${scale})`,\n }}\n >\n <path\n d={CLOUD_PATH}\n strokeDasharray={cloud.strokeDasharray}\n strokeDashoffset={cloud.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CloudIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CLOUD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CloudIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CloudIconBase>;\n\nconst CloudIconInner = forwardRef<\n HTMLDivElement,\n CloudIconElementProps & { 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 ?? \"<CloudIcon>\"}\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 <CloudIconBase\n {...(componentProps as unknown as ComponentProps<typeof CloudIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CloudIcon = Interactive.withSchema({\n Component: CloudIconInner,\n componentName: \"<CloudIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CLOUD_PATH = \"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction CloudIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const float = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 0.8, 1], [0, -2, 0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const cloud = drawnPathProps(CLOUD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${float}px) scale(${scale})`,\n }}\n >\n <path\n d={CLOUD_PATH}\n strokeDasharray={cloud.strokeDasharray}\n strokeDashoffset={cloud.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction CloudIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CLOUD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CloudIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CloudIconBase>;\n\nconst CloudIconInner = forwardRef<\n HTMLDivElement,\n CloudIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CloudIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CloudIconBase\n {...(componentProps as unknown as ComponentProps<typeof CloudIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CloudIcon = Interactive.withSchema({\n Component: CloudIconInner,\n componentName: \"<CloudIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-code.json b/registry-artifacts/elements/icon-code.json
index 5b4f7c7f..24e4f3e5 100644
--- a/registry-artifacts/elements/icon-code.json
+++ b/registry-artifacts/elements/icon-code.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Code",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-code",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RIGHT_PATH = \"M16 18 22 12 16 6\";\nconst LEFT_PATH = \"M8 6 2 12 8 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction CodeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const open = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, 2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const right = drawnPathProps(RIGHT_PATH, drawProgress);\n const left = drawnPathProps(LEFT_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${open} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-open} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CodeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CodeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CodeIconBase>;\n\nconst CodeIconInner = forwardRef<\n HTMLDivElement,\n CodeIconElementProps & { 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 ?? \"<CodeIcon>\"}\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 <CodeIconBase\n {...(componentProps as unknown as ComponentProps<typeof CodeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CodeIcon = Interactive.withSchema({\n Component: CodeIconInner,\n componentName: \"<CodeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RIGHT_PATH = \"M16 18 22 12 16 6\";\nconst LEFT_PATH = \"M8 6 2 12 8 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction CodeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const open = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, 2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.7, 1], [1, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const right = drawnPathProps(RIGHT_PATH, drawProgress);\n const left = drawnPathProps(LEFT_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${open} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-open} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CodeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 18 6-6-6-6\" />\n <path d=\"m8 6-6 6 6 6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CodeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CodeIconBase>;\n\nconst CodeIconInner = forwardRef<\n HTMLDivElement,\n CodeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CodeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CodeIconBase\n {...(componentProps as unknown as ComponentProps<typeof CodeIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CodeIcon = Interactive.withSchema({\n Component: CodeIconInner,\n componentName: \"<CodeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-copy.json b/registry-artifacts/elements/icon-copy.json
index c8147a03..c170be85 100644
--- a/registry-artifacts/elements/icon-copy.json
+++ b/registry-artifacts/elements/icon-copy.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Copy",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-copy",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BACK_PATH = \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\";\nconst FRONT_PATH =\n \"M10 8H20A2 2 0 0 1 22 10V20A2 2 0 0 1 20 22H10A2 2 0 0 1 8 20V10A2 2 0 0 1 10 8Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction CopyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const backProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const frontProgress = interpolate(linearDraw, [0.286, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const back = drawnPathProps(BACK_PATH, backProgress);\n const front = drawnPathProps(FRONT_PATH, frontProgress);\n\n const offset = interpolate(\n actionProgress,\n [0, 0.35, 0.65, 1],\n [0, -2, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BACK_PATH}\n strokeDasharray={back.strokeDasharray}\n strokeDashoffset={back.strokeDashoffset}\n />\n <g transform={`translate(${offset} ${offset})`}>\n <path\n d={FRONT_PATH}\n strokeDasharray={front.strokeDasharray}\n strokeDashoffset={front.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CopyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d={BACK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CopyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CopyIconBase>;\n\nconst CopyIconInner = forwardRef<\n HTMLDivElement,\n CopyIconElementProps & { 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 ?? \"<CopyIcon>\"}\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 <CopyIconBase\n {...(componentProps as unknown as ComponentProps<typeof CopyIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CopyIcon = Interactive.withSchema({\n Component: CopyIconInner,\n componentName: \"<CopyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BACK_PATH = \"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2\";\nconst FRONT_PATH =\n \"M10 8H20A2 2 0 0 1 22 10V20A2 2 0 0 1 20 22H10A2 2 0 0 1 8 20V10A2 2 0 0 1 10 8Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction CopyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const backProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const frontProgress = interpolate(linearDraw, [0.286, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const back = drawnPathProps(BACK_PATH, backProgress);\n const front = drawnPathProps(FRONT_PATH, frontProgress);\n\n const offset = interpolate(\n actionProgress,\n [0, 0.35, 0.65, 1],\n [0, -2, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BACK_PATH}\n strokeDasharray={back.strokeDasharray}\n strokeDashoffset={back.strokeDashoffset}\n />\n <g transform={`translate(${offset} ${offset})`}>\n <path\n d={FRONT_PATH}\n strokeDasharray={front.strokeDasharray}\n strokeDashoffset={front.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CopyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"14\" x=\"8\" y=\"8\" rx=\"2\" ry=\"2\" />\n <path d={BACK_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CopyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CopyIconBase>;\n\nconst CopyIconInner = forwardRef<\n HTMLDivElement,\n CopyIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CopyIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CopyIconBase\n {...(componentProps as unknown as ComponentProps<typeof CopyIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CopyIcon = Interactive.withSchema({\n Component: CopyIconInner,\n componentName: \"<CopyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-credit-card.json b/registry-artifacts/elements/icon-credit-card.json
index 33257a24..2cd87f68 100644
--- a/registry-artifacts/elements/icon-credit-card.json
+++ b/registry-artifacts/elements/icon-credit-card.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Credit Card",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-credit-card",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CARD_PATH =\n \"M4 5H20A2 2 0 0 1 22 7V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17V7A2 2 0 0 1 4 5Z\";\nconst STRIPE_PATH = \"M2 10H22\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 19;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction CreditCardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const swipe = interpolate(actionProgress, [0.1, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const tilt = acting\n ? interpolate(actionProgress, [0.4, 0.6, 1], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const stripeProgress = animation === \"draw\" ? 1 : acting ? swipe : 0;\n\n const card = drawnPathProps(CARD_PATH, drawProgress);\n const stripe = drawnPathProps(STRIPE_PATH, stripeProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CARD_PATH}\n strokeDasharray={card.strokeDasharray}\n strokeDashoffset={card.strokeDashoffset}\n />\n <path\n d={STRIPE_PATH}\n strokeDasharray={stripe.strokeDasharray}\n strokeDashoffset={stripe.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CreditCardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CreditCardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CreditCardIconBase>;\n\nconst CreditCardIconInner = forwardRef<\n HTMLDivElement,\n CreditCardIconElementProps & { 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 ?? \"<CreditCardIcon>\"}\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 <CreditCardIconBase\n {...(componentProps as unknown as ComponentProps<typeof CreditCardIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CreditCardIcon = Interactive.withSchema({\n Component: CreditCardIconInner,\n componentName: \"<CreditCardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CARD_PATH =\n \"M4 5H20A2 2 0 0 1 22 7V17A2 2 0 0 1 20 19H4A2 2 0 0 1 2 17V7A2 2 0 0 1 4 5Z\";\nconst STRIPE_PATH = \"M2 10H22\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 19;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction CreditCardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const swipe = interpolate(actionProgress, [0.1, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const tilt = acting\n ? interpolate(actionProgress, [0.4, 0.6, 1], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const stripeProgress = animation === \"draw\" ? 1 : acting ? swipe : 0;\n\n const card = drawnPathProps(CARD_PATH, drawProgress);\n const stripe = drawnPathProps(STRIPE_PATH, stripeProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CARD_PATH}\n strokeDasharray={card.strokeDasharray}\n strokeDashoffset={card.strokeDashoffset}\n />\n <path\n d={STRIPE_PATH}\n strokeDasharray={stripe.strokeDasharray}\n strokeDashoffset={stripe.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CreditCardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"5\" rx=\"2\" />\n <line x1=\"2\" x2=\"22\" y1=\"10\" y2=\"10\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CreditCardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CreditCardIconBase>;\n\nconst CreditCardIconInner = forwardRef<\n HTMLDivElement,\n CreditCardIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CreditCardIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CreditCardIconBase\n {...(componentProps as unknown as ComponentProps<typeof CreditCardIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CreditCardIcon = Interactive.withSchema({\n Component: CreditCardIconInner,\n componentName: \"<CreditCardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-crown.json b/registry-artifacts/elements/icon-crown.json
index 925cc0d7..0896f89a 100644
--- a/registry-artifacts/elements/icon-crown.json
+++ b/registry-artifacts/elements/icon-crown.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Crown",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-crown",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CROWN_PATH =\n \"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\";\nconst BAND_PATH = \"M5 21h14\";\n\nconst BASE_X = 12;\nconst BASE_Y = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction CrownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const crownDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const descend = acting\n ? interpolate(actionProgress, [0, 0.22, 0.55], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.55, 0.7], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const rock = acting\n ? interpolate(\n actionProgress,\n [0.55, 0.68, 0.82, 0.94, 1],\n [0, 2, -1.5, 0.8, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const crown = drawnPathProps(CROWN_PATH, acting ? 1 : crownDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const actionTransform = `translate(0 ${descend}) rotate(${rock} ${BASE_X} ${BASE_Y}) translate(${BASE_X * (1 - pop)} ${BASE_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={actionTransform}>\n <path\n d={CROWN_PATH}\n strokeDasharray={crown.strokeDasharray}\n strokeDashoffset={crown.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CrownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CrownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof CrownIconBase>;\n\nconst CrownIconInner = forwardRef<\n HTMLDivElement,\n CrownIconElementProps & { 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 ?? \"<CrownIcon>\"}\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 <CrownIconBase\n {...(componentProps as unknown as ComponentProps<typeof CrownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const CrownIcon = Interactive.withSchema({\n Component: CrownIconInner,\n componentName: \"<CrownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CROWN_PATH =\n \"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\";\nconst BAND_PATH = \"M5 21h14\";\n\nconst BASE_X = 12;\nconst BASE_Y = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction CrownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const crownDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const descend = acting\n ? interpolate(actionProgress, [0, 0.22, 0.55], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.4, 0.55, 0.7], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const rock = acting\n ? interpolate(\n actionProgress,\n [0.55, 0.68, 0.82, 0.94, 1],\n [0, 2, -1.5, 0.8, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 0;\n\n const crown = drawnPathProps(CROWN_PATH, acting ? 1 : crownDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const actionTransform = `translate(0 ${descend}) rotate(${rock} ${BASE_X} ${BASE_Y}) translate(${BASE_X * (1 - pop)} ${BASE_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={actionTransform}>\n <path\n d={CROWN_PATH}\n strokeDasharray={crown.strokeDasharray}\n strokeDashoffset={crown.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction CrownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\" />\n <path d=\"M5 21h14\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype CrownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CrownIconBase>;\n\nconst CrownIconInner = forwardRef<\n HTMLDivElement,\n CrownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<CrownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CrownIconBase\n {...(componentProps as unknown as ComponentProps<typeof CrownIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CrownIcon = Interactive.withSchema({\n Component: CrownIconInner,\n componentName: \"<CrownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-database.json b/registry-artifacts/elements/icon-database.json
index aedebc92..2e4f3900 100644
--- a/registry-artifacts/elements/icon-database.json
+++ b/registry-artifacts/elements/icon-database.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Database",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-database",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISC_PATH = \"M3 5A9 3 0 0 0 21 5A9 3 0 0 0 3 5Z\";\nconst BODY_PATH = \"M3 5V19A9 3 0 0 0 21 19V5\";\nconst MID_PATH = \"M3 12A9 3 0 0 0 21 12\";\n\nconst DISC_CX = 12;\nconst DISC_CY = 5;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction DatabaseIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const discDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bodyDraw = interpolate(linearDraw, [0.35, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const discPop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const midDip = acting\n ? interpolate(actionProgress, [0.25, 0.5, 0.8], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disc = drawnPathProps(DISC_PATH, acting ? 1 : discDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const mid = drawnPathProps(MID_PATH, acting ? 1 : midDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const discTransform = `translate(${DISC_CX * (1 - discPop)} ${DISC_CY * (1 - discPop)}) scale(${discPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${midDip})`}>\n <path\n d={MID_PATH}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n </g>\n <g transform={discTransform}>\n <path\n d={DISC_PATH}\n strokeDasharray={disc.strokeDasharray}\n strokeDashoffset={disc.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DatabaseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DatabaseIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DatabaseIconBase>;\n\nconst DatabaseIconInner = forwardRef<\n HTMLDivElement,\n DatabaseIconElementProps & { 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 ?? \"<DatabaseIcon>\"}\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 <DatabaseIconBase\n {...(componentProps as unknown as ComponentProps<typeof DatabaseIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DatabaseIcon = Interactive.withSchema({\n Component: DatabaseIconInner,\n componentName: \"<DatabaseIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISC_PATH = \"M3 5A9 3 0 0 0 21 5A9 3 0 0 0 3 5Z\";\nconst BODY_PATH = \"M3 5V19A9 3 0 0 0 21 19V5\";\nconst MID_PATH = \"M3 12A9 3 0 0 0 21 12\";\n\nconst DISC_CX = 12;\nconst DISC_CY = 5;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction DatabaseIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const discDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bodyDraw = interpolate(linearDraw, [0.35, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const discPop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const midDip = acting\n ? interpolate(actionProgress, [0.25, 0.5, 0.8], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disc = drawnPathProps(DISC_PATH, acting ? 1 : discDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const mid = drawnPathProps(MID_PATH, acting ? 1 : midDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const discTransform = `translate(${DISC_CX * (1 - discPop)} ${DISC_CY * (1 - discPop)}) scale(${discPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${midDip})`}>\n <path\n d={MID_PATH}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n </g>\n <g transform={discTransform}>\n <path\n d={DISC_PATH}\n strokeDasharray={disc.strokeDasharray}\n strokeDashoffset={disc.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DatabaseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <ellipse cx=\"12\" cy=\"5\" rx=\"9\" ry=\"3\" />\n <path d=\"M3 5V19A9 3 0 0 0 21 19V5\" />\n <path d=\"M3 12A9 3 0 0 0 21 12\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DatabaseIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof DatabaseIconBase>;\n\nconst DatabaseIconInner = forwardRef<\n HTMLDivElement,\n DatabaseIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<DatabaseIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <DatabaseIconBase\n {...(componentProps as unknown as ComponentProps<typeof DatabaseIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const DatabaseIcon = Interactive.withSchema({\n Component: DatabaseIconInner,\n componentName: \"<DatabaseIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-dollar-sign.json b/registry-artifacts/elements/icon-dollar-sign.json
index a1a54a90..0cfada6c 100644
--- a/registry-artifacts/elements/icon-dollar-sign.json
+++ b/registry-artifacts/elements/icon-dollar-sign.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Dollar Sign",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-dollar-sign",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BAR_PATH = \"M12 2V22\";\nconst S_PATH = \"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction DollarSignIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const barDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sDraw = interpolate(linearDraw, [0.3, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const stretch = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bar = drawnPathProps(BAR_PATH, acting ? 1 : barDraw);\n const s = drawnPathProps(S_PATH, acting ? 1 : sDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const stretchTransform = `translate(0 ${BASE_Y * (1 - stretch)}) scale(1 ${stretch})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={stretchTransform}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n <path\n d={S_PATH}\n strokeDasharray={s.strokeDasharray}\n strokeDashoffset={s.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DollarSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" x2=\"12\" y1=\"2\" y2=\"22\" />\n <path d={S_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DollarSignIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DollarSignIconBase>;\n\nconst DollarSignIconInner = forwardRef<\n HTMLDivElement,\n DollarSignIconElementProps & { 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 ?? \"<DollarSignIcon>\"}\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 <DollarSignIconBase\n {...(componentProps as unknown as ComponentProps<typeof DollarSignIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DollarSignIcon = Interactive.withSchema({\n Component: DollarSignIconInner,\n componentName: \"<DollarSignIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BAR_PATH = \"M12 2V22\";\nconst S_PATH = \"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction DollarSignIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const barDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sDraw = interpolate(linearDraw, [0.3, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const stretch = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bar = drawnPathProps(BAR_PATH, acting ? 1 : barDraw);\n const s = drawnPathProps(S_PATH, acting ? 1 : sDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const stretchTransform = `translate(0 ${BASE_Y * (1 - stretch)}) scale(1 ${stretch})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={stretchTransform}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n <path\n d={S_PATH}\n strokeDasharray={s.strokeDasharray}\n strokeDashoffset={s.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DollarSignIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"12\" x2=\"12\" y1=\"2\" y2=\"22\" />\n <path d={S_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DollarSignIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof DollarSignIconBase>;\n\nconst DollarSignIconInner = forwardRef<\n HTMLDivElement,\n DollarSignIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<DollarSignIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <DollarSignIconBase\n {...(componentProps as unknown as ComponentProps<typeof DollarSignIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const DollarSignIcon = Interactive.withSchema({\n Component: DollarSignIconInner,\n componentName: \"<DollarSignIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-download.json b/registry-artifacts/elements/icon-download.json
index 2c910dfc..e85fe86c 100644
--- a/registry-artifacts/elements/icon-download.json
+++ b/registry-artifacts/elements/icon-download.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Download",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-download",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 3V15\";\nconst SHAFT_STATIC = \"M12 15V3\";\nconst HEAD_PATH = \"M7 10 12 15 17 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction DownloadIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const dropY = interpolate(actionProgress, [0, 0.25, 0.65, 1], [0, -4, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.5, 0.65, 0.8, 1],\n [1, 1, 0.94, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${dropY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DownloadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={TRAY_STATIC} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DownloadIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DownloadIconBase>;\n\nconst DownloadIconInner = forwardRef<\n HTMLDivElement,\n DownloadIconElementProps & { 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 ?? \"<DownloadIcon>\"}\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 <DownloadIconBase\n {...(componentProps as unknown as ComponentProps<typeof DownloadIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DownloadIcon = Interactive.withSchema({\n Component: DownloadIconInner,\n componentName: \"<DownloadIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 3V15\";\nconst SHAFT_STATIC = \"M12 15V3\";\nconst HEAD_PATH = \"M7 10 12 15 17 10\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction DownloadIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const dropY = interpolate(actionProgress, [0, 0.25, 0.65, 1], [0, -4, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.5, 0.65, 0.8, 1],\n [1, 1, 0.94, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${dropY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction DownloadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={TRAY_STATIC} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype DownloadIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof DownloadIconBase>;\n\nconst DownloadIconInner = forwardRef<\n HTMLDivElement,\n DownloadIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<DownloadIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <DownloadIconBase\n {...(componentProps as unknown as ComponentProps<typeof DownloadIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const DownloadIcon = Interactive.withSchema({\n Component: DownloadIconInner,\n componentName: \"<DownloadIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-external-link.json b/registry-artifacts/elements/icon-external-link.json
index a12c618f..2a5df021 100644
--- a/registry-artifacts/elements/icon-external-link.json
+++ b/registry-artifacts/elements/icon-external-link.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "External Link",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-external-link",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\";\nconst SHAFT_PATH = \"M10 14 21 3\";\nconst HEAD_PATH = \"M15 3h6v6\";\n\nconst ARROW_CX = 15.5;\nconst ARROW_CY = 8.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction ExternalLinkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boxProgress = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftProgress = interpolate(linearDraw, [0.5, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const box = drawnPathProps(BOX_PATH, boxProgress);\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const dart = interpolate(actionProgress, [0, 0.4, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tx = 3 * dart;\n const ty = -3 * dart;\n const arrowScale = 1 + 0.05 * dart;\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <g\n transform={`translate(${tx} ${ty}) translate(${ARROW_CX} ${ARROW_CY}) scale(${arrowScale}) translate(${-ARROW_CX} ${-ARROW_CY})`}\n >\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ExternalLinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ExternalLinkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ExternalLinkIconBase>;\n\nconst ExternalLinkIconInner = forwardRef<\n HTMLDivElement,\n ExternalLinkIconElementProps & { 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 ?? \"<ExternalLinkIcon>\"}\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 <ExternalLinkIconBase\n {...(componentProps as unknown as ComponentProps<typeof ExternalLinkIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ExternalLinkIcon = Interactive.withSchema({\n Component: ExternalLinkIconInner,\n componentName: \"<ExternalLinkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6\";\nconst SHAFT_PATH = \"M10 14 21 3\";\nconst HEAD_PATH = \"M15 3h6v6\";\n\nconst ARROW_CX = 15.5;\nconst ARROW_CY = 8.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction ExternalLinkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boxProgress = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftProgress = interpolate(linearDraw, [0.5, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const headProgress = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const box = drawnPathProps(BOX_PATH, boxProgress);\n const shaft = drawnPathProps(SHAFT_PATH, shaftProgress);\n const head = drawnPathProps(HEAD_PATH, headProgress);\n\n const dart = interpolate(actionProgress, [0, 0.4, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const tx = 3 * dart;\n const ty = -3 * dart;\n const arrowScale = 1 + 0.05 * dart;\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <g\n transform={`translate(${tx} ${ty}) translate(${ARROW_CX} ${ARROW_CY}) scale(${arrowScale}) translate(${-ARROW_CX} ${-ARROW_CY})`}\n >\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ExternalLinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={SHAFT_PATH} />\n <path d={HEAD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ExternalLinkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ExternalLinkIconBase>;\n\nconst ExternalLinkIconInner = forwardRef<\n HTMLDivElement,\n ExternalLinkIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ExternalLinkIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ExternalLinkIconBase\n {...(componentProps as unknown as ComponentProps<typeof ExternalLinkIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ExternalLinkIcon = Interactive.withSchema({\n Component: ExternalLinkIconInner,\n componentName: \"<ExternalLinkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-eye-off.json b/registry-artifacts/elements/icon-eye-off.json
index 3c63ee7d..bb212999 100644
--- a/registry-artifacts/elements/icon-eye-off.json
+++ b/registry-artifacts/elements/icon-eye-off.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Eye Off",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-eye-off",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAG1_PATH =\n \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\";\nconst FRAG2_PATH = \"M14.084 14.158a3 3 0 0 1-4.242-4.242\";\nconst FRAG3_PATH =\n \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\";\nconst SLASH_PATH = \"M2 2 22 22\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst FRAGMENTS = [\n { path: FRAG1_PATH, drawWindow: [0, 0.69] },\n { path: FRAG2_PATH, drawWindow: [0.19, 0.88] },\n { path: FRAG3_PATH, drawWindow: [0.375, 1] },\n] as const;\n\nfunction EyeOffIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slashProgress = acting\n ? interpolate(actionProgress, [0, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const fragOpacity = acting\n ? interpolate(actionProgress, [0.09, 0.5, 1], [1, 0.35, 0.6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const slash = drawnPathProps(SLASH_PATH, slashProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g opacity={fragOpacity}>\n {FRAGMENTS.map((frag) => {\n const drawn = acting\n ? 1\n : interpolate(linearDraw, [...frag.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(frag.path, drawn);\n return (\n <path\n key={frag.path}\n d={frag.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n );\n })}\n </g>\n <path\n d={SLASH_PATH}\n strokeDasharray={slash.strokeDasharray}\n strokeDashoffset={slash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction EyeOffIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FRAG1_PATH} />\n <path d={FRAG2_PATH} />\n <path d={FRAG3_PATH} />\n <path d={SLASH_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype EyeOffIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EyeOffIconBase>;\n\nconst EyeOffIconInner = forwardRef<\n HTMLDivElement,\n EyeOffIconElementProps & { 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 ?? \"<EyeOffIcon>\"}\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 <EyeOffIconBase\n {...(componentProps as unknown as ComponentProps<typeof EyeOffIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EyeOffIcon = Interactive.withSchema({\n Component: EyeOffIconInner,\n componentName: \"<EyeOffIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAG1_PATH =\n \"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49\";\nconst FRAG2_PATH = \"M14.084 14.158a3 3 0 0 1-4.242-4.242\";\nconst FRAG3_PATH =\n \"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143\";\nconst SLASH_PATH = \"M2 2 22 22\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst FRAGMENTS = [\n { path: FRAG1_PATH, drawWindow: [0, 0.69] },\n { path: FRAG2_PATH, drawWindow: [0.19, 0.88] },\n { path: FRAG3_PATH, drawWindow: [0.375, 1] },\n] as const;\n\nfunction EyeOffIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slashProgress = acting\n ? interpolate(actionProgress, [0, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const fragOpacity = acting\n ? interpolate(actionProgress, [0.09, 0.5, 1], [1, 0.35, 0.6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const slash = drawnPathProps(SLASH_PATH, slashProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g opacity={fragOpacity}>\n {FRAGMENTS.map((frag) => {\n const drawn = acting\n ? 1\n : interpolate(linearDraw, [...frag.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(frag.path, drawn);\n return (\n <path\n key={frag.path}\n d={frag.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n );\n })}\n </g>\n <path\n d={SLASH_PATH}\n strokeDasharray={slash.strokeDasharray}\n strokeDashoffset={slash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction EyeOffIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FRAG1_PATH} />\n <path d={FRAG2_PATH} />\n <path d={FRAG3_PATH} />\n <path d={SLASH_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype EyeOffIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof EyeOffIconBase>;\n\nconst EyeOffIconInner = forwardRef<\n HTMLDivElement,\n EyeOffIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<EyeOffIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <EyeOffIconBase\n {...(componentProps as unknown as ComponentProps<typeof EyeOffIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const EyeOffIcon = Interactive.withSchema({\n Component: EyeOffIconInner,\n componentName: \"<EyeOffIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-eye.json b/registry-artifacts/elements/icon-eye.json
index e26698d7..4ed42de3 100644
--- a/registry-artifacts/elements/icon-eye.json
+++ b/registry-artifacts/elements/icon-eye.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Eye",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-eye",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst OUTLINE_PATH =\n \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\";\nconst PUPIL_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction EyeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outlineDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pupilDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const blink = acting\n ? interpolate(actionProgress, [0, 0.27, 0.55], [1, 0.4, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const pupilPop =\n acting && actionProgress >= 0.55\n ? interpolate(actionProgress, [0.55, 0.77, 1], [0.8, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const outline = drawnPathProps(OUTLINE_PATH, outlineDraw);\n const pupil = drawnPathProps(PUPIL_PATH, pupilDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const pupilTransform = `translate(${12 * (1 - pupilPop)} ${12 * (1 - pupilPop)}) scale(${pupilPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale}) scaleY(${blink})`,\n }}\n >\n <path\n d={OUTLINE_PATH}\n strokeDasharray={outline.strokeDasharray}\n strokeDashoffset={outline.strokeDashoffset}\n />\n <g transform={pupilTransform}>\n <path\n d={PUPIL_PATH}\n strokeDasharray={pupil.strokeDasharray}\n strokeDashoffset={pupil.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction EyeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={OUTLINE_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype EyeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof EyeIconBase>;\n\nconst EyeIconInner = forwardRef<\n HTMLDivElement,\n EyeIconElementProps & { 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 ?? \"<EyeIcon>\"}\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 <EyeIconBase\n {...(componentProps as unknown as ComponentProps<typeof EyeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const EyeIcon = Interactive.withSchema({\n Component: EyeIconInner,\n componentName: \"<EyeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst OUTLINE_PATH =\n \"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0\";\nconst PUPIL_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction EyeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outlineDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pupilDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const blink = acting\n ? interpolate(actionProgress, [0, 0.27, 0.55], [1, 0.4, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const pupilPop =\n acting && actionProgress >= 0.55\n ? interpolate(actionProgress, [0.55, 0.77, 1], [0.8, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const outline = drawnPathProps(OUTLINE_PATH, outlineDraw);\n const pupil = drawnPathProps(PUPIL_PATH, pupilDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const pupilTransform = `translate(${12 * (1 - pupilPop)} ${12 * (1 - pupilPop)}) scale(${pupilPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale}) scaleY(${blink})`,\n }}\n >\n <path\n d={OUTLINE_PATH}\n strokeDasharray={outline.strokeDasharray}\n strokeDashoffset={outline.strokeDashoffset}\n />\n <g transform={pupilTransform}>\n <path\n d={PUPIL_PATH}\n strokeDasharray={pupil.strokeDasharray}\n strokeDashoffset={pupil.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction EyeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={OUTLINE_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype EyeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof EyeIconBase>;\n\nconst EyeIconInner = forwardRef<\n HTMLDivElement,\n EyeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<EyeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <EyeIconBase\n {...(componentProps as unknown as ComponentProps<typeof EyeIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const EyeIcon = Interactive.withSchema({\n Component: EyeIconInner,\n componentName: \"<EyeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-file-text.json b/registry-artifacts/elements/icon-file-text.json
index 11589db8..6c4c9faf 100644
--- a/registry-artifacts/elements/icon-file-text.json
+++ b/registry-artifacts/elements/icon-file-text.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "File Text",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-file-text",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PAGE_PATH =\n \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\";\nconst FOLD_PATH = \"M14 2v5a1 1 0 0 0 1 1h5\";\nconst LINE1_PATH = \"M8 9H10\";\nconst LINE2_PATH = \"M8 13H16\";\nconst LINE3_PATH = \"M8 17H16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction FileTextIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pageDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const foldDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const line1Type = interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line2Type = interpolate(actionProgress, [0.3, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line3Type = interpolate(actionProgress, [0.55, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n\n const line1Progress = animation === \"draw\" ? 1 : acting ? line1Type : 0;\n const line2Progress = animation === \"draw\" ? 1 : acting ? line2Type : 0;\n const line3Progress = animation === \"draw\" ? 1 : acting ? line3Type : 0;\n\n const page = drawnPathProps(PAGE_PATH, acting ? 1 : pageDraw);\n const fold = drawnPathProps(FOLD_PATH, acting ? 1 : foldDraw);\n const line1 = drawnPathProps(LINE1_PATH, line1Progress);\n const line2 = drawnPathProps(LINE2_PATH, line2Progress);\n const line3 = drawnPathProps(LINE3_PATH, line3Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PAGE_PATH}\n strokeDasharray={page.strokeDasharray}\n strokeDashoffset={page.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n <path\n d={LINE1_PATH}\n strokeDasharray={line1.strokeDasharray}\n strokeDashoffset={line1.strokeDashoffset}\n />\n <path\n d={LINE2_PATH}\n strokeDasharray={line2.strokeDasharray}\n strokeDashoffset={line2.strokeDashoffset}\n />\n <path\n d={LINE3_PATH}\n strokeDasharray={line3.strokeDasharray}\n strokeDashoffset={line3.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction FileTextIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PAGE_PATH} />\n <path d={FOLD_PATH} />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FileTextIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FileTextIconBase>;\n\nconst FileTextIconInner = forwardRef<\n HTMLDivElement,\n FileTextIconElementProps & { 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 ?? \"<FileTextIcon>\"}\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 <FileTextIconBase\n {...(componentProps as unknown as ComponentProps<typeof FileTextIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FileTextIcon = Interactive.withSchema({\n Component: FileTextIconInner,\n componentName: \"<FileTextIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PAGE_PATH =\n \"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z\";\nconst FOLD_PATH = \"M14 2v5a1 1 0 0 0 1 1h5\";\nconst LINE1_PATH = \"M8 9H10\";\nconst LINE2_PATH = \"M8 13H16\";\nconst LINE3_PATH = \"M8 17H16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction FileTextIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pageDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const foldDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const line1Type = interpolate(actionProgress, [0.05, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line2Type = interpolate(actionProgress, [0.3, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n const line3Type = interpolate(actionProgress, [0.55, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.linear,\n });\n\n const line1Progress = animation === \"draw\" ? 1 : acting ? line1Type : 0;\n const line2Progress = animation === \"draw\" ? 1 : acting ? line2Type : 0;\n const line3Progress = animation === \"draw\" ? 1 : acting ? line3Type : 0;\n\n const page = drawnPathProps(PAGE_PATH, acting ? 1 : pageDraw);\n const fold = drawnPathProps(FOLD_PATH, acting ? 1 : foldDraw);\n const line1 = drawnPathProps(LINE1_PATH, line1Progress);\n const line2 = drawnPathProps(LINE2_PATH, line2Progress);\n const line3 = drawnPathProps(LINE3_PATH, line3Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={PAGE_PATH}\n strokeDasharray={page.strokeDasharray}\n strokeDashoffset={page.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n <path\n d={LINE1_PATH}\n strokeDasharray={line1.strokeDasharray}\n strokeDashoffset={line1.strokeDashoffset}\n />\n <path\n d={LINE2_PATH}\n strokeDasharray={line2.strokeDasharray}\n strokeDashoffset={line2.strokeDashoffset}\n />\n <path\n d={LINE3_PATH}\n strokeDasharray={line3.strokeDasharray}\n strokeDashoffset={line3.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction FileTextIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PAGE_PATH} />\n <path d={FOLD_PATH} />\n <path d=\"M10 9H8\" />\n <path d=\"M16 13H8\" />\n <path d=\"M16 17H8\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FileTextIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof FileTextIconBase>;\n\nconst FileTextIconInner = forwardRef<\n HTMLDivElement,\n FileTextIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<FileTextIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <FileTextIconBase\n {...(componentProps as unknown as ComponentProps<typeof FileTextIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const FileTextIcon = Interactive.withSchema({\n Component: FileTextIconInner,\n componentName: \"<FileTextIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-filter.json b/registry-artifacts/elements/icon-filter.json
index fcfb206e..947caf08 100644
--- a/registry-artifacts/elements/icon-filter.json
+++ b/registry-artifacts/elements/icon-filter.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Filter",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-filter",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FUNNEL_PATH =\n \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction FilterIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, -5, 5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(FUNNEL_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 12 3) translate(0 ${dip})`}>\n <path\n d={FUNNEL_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FilterIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FUNNEL_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FilterIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FilterIconBase>;\n\nconst FilterIconInner = forwardRef<\n HTMLDivElement,\n FilterIconElementProps & { 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 ?? \"<FilterIcon>\"}\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 <FilterIconBase\n {...(componentProps as unknown as ComponentProps<typeof FilterIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FilterIcon = Interactive.withSchema({\n Component: FilterIconInner,\n componentName: \"<FilterIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FUNNEL_PATH =\n \"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction FilterIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, -5, 5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6, 1], [0, 1, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const dash = drawnPathProps(FUNNEL_PATH, drawProgress);\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 12 3) translate(0 ${dip})`}>\n <path\n d={FUNNEL_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FilterIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FUNNEL_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FilterIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof FilterIconBase>;\n\nconst FilterIconInner = forwardRef<\n HTMLDivElement,\n FilterIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<FilterIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <FilterIconBase\n {...(componentProps as unknown as ComponentProps<typeof FilterIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const FilterIcon = Interactive.withSchema({\n Component: FilterIconInner,\n componentName: \"<FilterIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-flame.json b/registry-artifacts/elements/icon-flame.json
index 2c2cb275..ecf6aabb 100644
--- a/registry-artifacts/elements/icon-flame.json
+++ b/registry-artifacts/elements/icon-flame.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Flame",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-flame",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAME_PATH =\n \"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction FlameIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const flameProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.85, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flame = drawnPathProps(FLAME_PATH, flameProgress);\n\n const flickerEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scaleY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [1, 1.06, 0.97, 1.04, 1],\n flickerEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, 2, -1, 0],\n flickerEase,\n );\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${entrance})`,\n }}\n >\n <g\n transform={`translate(12 22) scale(1 ${scaleY}) skewX(${skew}) translate(-12 -22)`}\n >\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FlameIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAME_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FlameIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FlameIconBase>;\n\nconst FlameIconInner = forwardRef<\n HTMLDivElement,\n FlameIconElementProps & { 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 ?? \"<FlameIcon>\"}\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 <FlameIconBase\n {...(componentProps as unknown as ComponentProps<typeof FlameIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FlameIcon = Interactive.withSchema({\n Component: FlameIconInner,\n componentName: \"<FlameIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAME_PATH =\n \"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction FlameIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const flameProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.85, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flame = drawnPathProps(FLAME_PATH, flameProgress);\n\n const flickerEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scaleY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [1, 1.06, 0.97, 1.04, 1],\n flickerEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, 2, -1, 0],\n flickerEase,\n );\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${entrance})`,\n }}\n >\n <g\n transform={`translate(12 22) scale(1 ${scaleY}) skewX(${skew}) translate(-12 -22)`}\n >\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FlameIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAME_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FlameIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof FlameIconBase>;\n\nconst FlameIconInner = forwardRef<\n HTMLDivElement,\n FlameIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<FlameIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <FlameIconBase\n {...(componentProps as unknown as ComponentProps<typeof FlameIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const FlameIcon = Interactive.withSchema({\n Component: FlameIconInner,\n componentName: \"<FlameIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-folder.json b/registry-artifacts/elements/icon-folder.json
index f5656065..653578db 100644
--- a/registry-artifacts/elements/icon-folder.json
+++ b/registry-artifacts/elements/icon-folder.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Folder",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-folder",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FOLDER_PATH =\n \"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\";\n\nconst PIVOT_X = 4;\nconst PIVOT_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction FolderIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const peek = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const folder = drawnPathProps(FOLDER_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${peek} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={FOLDER_PATH}\n strokeDasharray={folder.strokeDasharray}\n strokeDashoffset={folder.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FolderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FOLDER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FolderIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FolderIconBase>;\n\nconst FolderIconInner = forwardRef<\n HTMLDivElement,\n FolderIconElementProps & { 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 ?? \"<FolderIcon>\"}\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 <FolderIconBase\n {...(componentProps as unknown as ComponentProps<typeof FolderIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FolderIcon = Interactive.withSchema({\n Component: FolderIconInner,\n componentName: \"<FolderIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FOLDER_PATH =\n \"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z\";\n\nconst PIVOT_X = 4;\nconst PIVOT_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction FolderIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const peek = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const folder = drawnPathProps(FOLDER_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${peek} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={FOLDER_PATH}\n strokeDasharray={folder.strokeDasharray}\n strokeDashoffset={folder.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction FolderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FOLDER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype FolderIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof FolderIconBase>;\n\nconst FolderIconInner = forwardRef<\n HTMLDivElement,\n FolderIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<FolderIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <FolderIconBase\n {...(componentProps as unknown as ComponentProps<typeof FolderIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const FolderIcon = Interactive.withSchema({\n Component: FolderIconInner,\n componentName: \"<FolderIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-gem.json b/registry-artifacts/elements/icon-gem.json
index 12e2f224..f63140d2 100644
--- a/registry-artifacts/elements/icon-gem.json
+++ b/registry-artifacts/elements/icon-gem.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Gem",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-gem",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STONE_PATH =\n \"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\";\nconst VCUT_PATH = \"M10.5 3 8 9l4 13 4-13-2.5-6\";\nconst BAND_PATH = \"M2 9h20\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction GemIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const stoneDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vcutDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 1], [1, 1.06, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shimmer = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.45, 0.65, 0.85, 1],\n [1, 0.7, 1, 0.78, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 1;\n\n const stone = drawnPathProps(STONE_PATH, acting ? 1 : stoneDraw);\n const vcut = drawnPathProps(VCUT_PATH, acting ? 1 : vcutDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={STONE_PATH}\n strokeDasharray={stone.strokeDasharray}\n strokeDashoffset={stone.strokeDashoffset}\n />\n <g opacity={shimmer}>\n <path\n d={VCUT_PATH}\n strokeDasharray={vcut.strokeDasharray}\n strokeDashoffset={vcut.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction GemIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10.5 3 8 9l4 13 4-13-2.5-6\" />\n <path d=\"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GemIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GemIconBase>;\n\nconst GemIconInner = forwardRef<\n HTMLDivElement,\n GemIconElementProps & { 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 ?? \"<GemIcon>\"}\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 <GemIconBase\n {...(componentProps as unknown as ComponentProps<typeof GemIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GemIcon = Interactive.withSchema({\n Component: GemIconInner,\n componentName: \"<GemIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STONE_PATH =\n \"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\";\nconst VCUT_PATH = \"M10.5 3 8 9l4 13 4-13-2.5-6\";\nconst BAND_PATH = \"M2 9h20\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction GemIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const stoneDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vcutDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const bandDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.35, 0.6, 1], [1, 1.06, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shimmer = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.45, 0.65, 0.85, 1],\n [1, 0.7, 1, 0.78, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n },\n )\n : 1;\n\n const stone = drawnPathProps(STONE_PATH, acting ? 1 : stoneDraw);\n const vcut = drawnPathProps(VCUT_PATH, acting ? 1 : vcutDraw);\n const band = drawnPathProps(BAND_PATH, acting ? 1 : bandDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={popTransform}>\n <path\n d={STONE_PATH}\n strokeDasharray={stone.strokeDasharray}\n strokeDashoffset={stone.strokeDashoffset}\n />\n <g opacity={shimmer}>\n <path\n d={VCUT_PATH}\n strokeDasharray={vcut.strokeDasharray}\n strokeDashoffset={vcut.strokeDashoffset}\n />\n <path\n d={BAND_PATH}\n strokeDasharray={band.strokeDasharray}\n strokeDashoffset={band.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction GemIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10.5 3 8 9l4 13 4-13-2.5-6\" />\n <path d=\"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z\" />\n <path d=\"M2 9h20\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GemIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof GemIconBase>;\n\nconst GemIconInner = forwardRef<\n HTMLDivElement,\n GemIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<GemIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <GemIconBase\n {...(componentProps as unknown as ComponentProps<typeof GemIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const GemIcon = Interactive.withSchema({\n Component: GemIconInner,\n componentName: \"<GemIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-gift.json b/registry-artifacts/elements/icon-gift.json
index 1ac7fc7b..c43b9748 100644
--- a/registry-artifacts/elements/icon-gift.json
+++ b/registry-artifacts/elements/icon-gift.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Gift",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-gift",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8\";\nconst LID_PATH =\n \"M4 7H20A1 1 0 0 1 21 8V10A1 1 0 0 1 20 11H4A1 1 0 0 1 3 10V8A1 1 0 0 1 4 7Z\";\nconst CENTER_TOP_PATH = \"M12 7V11\";\nconst CENTER_BOTTOM_PATH = \"M12 11V21\";\nconst BOW_PATH =\n \"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5\";\n\nconst LID_CX = 12;\nconst LID_CY = 9;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction GiftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidDraw = interpolate(linearDraw, [0.35, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ribbonDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lidLift = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidTilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidPop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const lid = drawnPathProps(LID_PATH, acting ? 1 : lidDraw);\n const centerTop = drawnPathProps(CENTER_TOP_PATH, acting ? 1 : ribbonDraw);\n const centerBottom = drawnPathProps(\n CENTER_BOTTOM_PATH,\n acting ? 1 : ribbonDraw,\n );\n const bow = drawnPathProps(BOW_PATH, acting ? 1 : ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lidTransform = `translate(0 ${lidLift}) rotate(${lidTilt} ${LID_CX} ${LID_CY}) translate(${LID_CX * (1 - lidPop)} ${LID_CY * (1 - lidPop)}) scale(${lidPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_BOTTOM_PATH}\n strokeDasharray={centerBottom.strokeDasharray}\n strokeDashoffset={centerBottom.strokeDashoffset}\n />\n <g transform={lidTransform}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={CENTER_TOP_PATH}\n strokeDasharray={centerTop.strokeDasharray}\n strokeDashoffset={centerTop.strokeDashoffset}\n />\n <path\n d={BOW_PATH}\n strokeDasharray={bow.strokeDasharray}\n strokeDashoffset={bow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GiftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 7v14\" />\n <path d={BOX_PATH} />\n <path d={BOW_PATH} />\n <rect x=\"3\" y=\"7\" width=\"18\" height=\"4\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GiftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GiftIconBase>;\n\nconst GiftIconInner = forwardRef<\n HTMLDivElement,\n GiftIconElementProps & { 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 ?? \"<GiftIcon>\"}\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 <GiftIconBase\n {...(componentProps as unknown as ComponentProps<typeof GiftIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GiftIcon = Interactive.withSchema({\n Component: GiftIconInner,\n componentName: \"<GiftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH = \"M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8\";\nconst LID_PATH =\n \"M4 7H20A1 1 0 0 1 21 8V10A1 1 0 0 1 20 11H4A1 1 0 0 1 3 10V8A1 1 0 0 1 4 7Z\";\nconst CENTER_TOP_PATH = \"M12 7V11\";\nconst CENTER_BOTTOM_PATH = \"M12 11V21\";\nconst BOW_PATH =\n \"M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5\";\n\nconst LID_CX = 12;\nconst LID_CY = 9;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction GiftIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidDraw = interpolate(linearDraw, [0.35, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const ribbonDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lidLift = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidTilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.65], [0, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const lidPop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const lid = drawnPathProps(LID_PATH, acting ? 1 : lidDraw);\n const centerTop = drawnPathProps(CENTER_TOP_PATH, acting ? 1 : ribbonDraw);\n const centerBottom = drawnPathProps(\n CENTER_BOTTOM_PATH,\n acting ? 1 : ribbonDraw,\n );\n const bow = drawnPathProps(BOW_PATH, acting ? 1 : ribbonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const lidTransform = `translate(0 ${lidLift}) rotate(${lidTilt} ${LID_CX} ${LID_CY}) translate(${LID_CX * (1 - lidPop)} ${LID_CY * (1 - lidPop)}) scale(${lidPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_BOTTOM_PATH}\n strokeDasharray={centerBottom.strokeDasharray}\n strokeDashoffset={centerBottom.strokeDashoffset}\n />\n <g transform={lidTransform}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={CENTER_TOP_PATH}\n strokeDasharray={centerTop.strokeDasharray}\n strokeDashoffset={centerTop.strokeDashoffset}\n />\n <path\n d={BOW_PATH}\n strokeDasharray={bow.strokeDasharray}\n strokeDashoffset={bow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GiftIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 7v14\" />\n <path d={BOX_PATH} />\n <path d={BOW_PATH} />\n <rect x=\"3\" y=\"7\" width=\"18\" height=\"4\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GiftIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof GiftIconBase>;\n\nconst GiftIconInner = forwardRef<\n HTMLDivElement,\n GiftIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<GiftIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <GiftIconBase\n {...(componentProps as unknown as ComponentProps<typeof GiftIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const GiftIcon = Interactive.withSchema({\n Component: GiftIconInner,\n componentName: \"<GiftIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-globe.json b/registry-artifacts/elements/icon-globe.json
index 5eecdb9a..e27c07aa 100644
--- a/registry-artifacts/elements/icon-globe.json
+++ b/registry-artifacts/elements/icon-globe.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Globe",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-globe",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPHERE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst MERIDIAN_PATH = \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\";\nconst EQUATOR_PATH = \"M2 12H22\";\n\nconst AXIS_X = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction GlobeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const sphereDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const linesDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const spinX = acting ? Math.cos(actionProgress * Math.PI * 2) : 1;\n\n const sphere = drawnPathProps(SPHERE_PATH, acting ? 1 : sphereDraw);\n const meridian = drawnPathProps(MERIDIAN_PATH, acting ? 1 : linesDraw);\n const equator = drawnPathProps(EQUATOR_PATH, acting ? 1 : linesDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const spinTransform = `translate(${AXIS_X * (1 - spinX)} 0) scale(${spinX} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={spinTransform}>\n <path\n d={SPHERE_PATH}\n strokeDasharray={sphere.strokeDasharray}\n strokeDashoffset={sphere.strokeDashoffset}\n />\n <path\n d={EQUATOR_PATH}\n strokeDasharray={equator.strokeDasharray}\n strokeDashoffset={equator.strokeDashoffset}\n />\n <path\n d={MERIDIAN_PATH}\n strokeDasharray={meridian.strokeDasharray}\n strokeDashoffset={meridian.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GlobeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={MERIDIAN_PATH} />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GlobeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GlobeIconBase>;\n\nconst GlobeIconInner = forwardRef<\n HTMLDivElement,\n GlobeIconElementProps & { 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 ?? \"<GlobeIcon>\"}\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 <GlobeIconBase\n {...(componentProps as unknown as ComponentProps<typeof GlobeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GlobeIcon = Interactive.withSchema({\n Component: GlobeIconInner,\n componentName: \"<GlobeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPHERE_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst MERIDIAN_PATH = \"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20\";\nconst EQUATOR_PATH = \"M2 12H22\";\n\nconst AXIS_X = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction GlobeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const sphereDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const linesDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const spinX = acting ? Math.cos(actionProgress * Math.PI * 2) : 1;\n\n const sphere = drawnPathProps(SPHERE_PATH, acting ? 1 : sphereDraw);\n const meridian = drawnPathProps(MERIDIAN_PATH, acting ? 1 : linesDraw);\n const equator = drawnPathProps(EQUATOR_PATH, acting ? 1 : linesDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const spinTransform = `translate(${AXIS_X * (1 - spinX)} 0) scale(${spinX} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={spinTransform}>\n <path\n d={SPHERE_PATH}\n strokeDasharray={sphere.strokeDasharray}\n strokeDashoffset={sphere.strokeDashoffset}\n />\n <path\n d={EQUATOR_PATH}\n strokeDasharray={equator.strokeDasharray}\n strokeDashoffset={equator.strokeDashoffset}\n />\n <path\n d={MERIDIAN_PATH}\n strokeDasharray={meridian.strokeDasharray}\n strokeDashoffset={meridian.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction GlobeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={MERIDIAN_PATH} />\n <path d=\"M2 12h20\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype GlobeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof GlobeIconBase>;\n\nconst GlobeIconInner = forwardRef<\n HTMLDivElement,\n GlobeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<GlobeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <GlobeIconBase\n {...(componentProps as unknown as ComponentProps<typeof GlobeIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const GlobeIcon = Interactive.withSchema({\n Component: GlobeIconInner,\n componentName: \"<GlobeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-heart.json b/registry-artifacts/elements/icon-heart.json
index 96c74a04..a906fb85 100644
--- a/registry-artifacts/elements/icon-heart.json
+++ b/registry-artifacts/elements/icon-heart.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Heart",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-heart",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEART_PATH =\n \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction HeartIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const heartProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const heart = drawnPathProps(HEART_PATH, heartProgress);\n\n const beat = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [1, 1.16, 1, 1.1, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEART_PATH}\n strokeDasharray={heart.strokeDasharray}\n strokeDashoffset={heart.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HeartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEART_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HeartIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HeartIconBase>;\n\nconst HeartIconInner = forwardRef<\n HTMLDivElement,\n HeartIconElementProps & { 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 ?? \"<HeartIcon>\"}\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 <HeartIconBase\n {...(componentProps as unknown as ComponentProps<typeof HeartIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HeartIcon = Interactive.withSchema({\n Component: HeartIconInner,\n componentName: \"<HeartIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEART_PATH =\n \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction HeartIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const heartProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const heart = drawnPathProps(HEART_PATH, heartProgress);\n\n const beat = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8, 1],\n [1, 1.16, 1, 1.1, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n\n const scale = (0.85 + 0.15 * scaleIn) * beat;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEART_PATH}\n strokeDasharray={heart.strokeDasharray}\n strokeDashoffset={heart.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HeartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEART_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HeartIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof HeartIconBase>;\n\nconst HeartIconInner = forwardRef<\n HTMLDivElement,\n HeartIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<HeartIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <HeartIconBase\n {...(componentProps as unknown as ComponentProps<typeof HeartIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const HeartIcon = Interactive.withSchema({\n Component: HeartIconInner,\n componentName: \"<HeartIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-help-circle.json b/registry-artifacts/elements/icon-help-circle.json
index d52913e7..8c56da34 100644
--- a/registry-artifacts/elements/icon-help-circle.json
+++ b/registry-artifacts/elements/icon-help-circle.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Help Circle",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-help-circle",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst CURVE_PATH = \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 8;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction HelpCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ringDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curveDraw = interpolate(linearDraw, [0.4, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotDraw = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, 6, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const ring = drawnPathProps(RING_PATH, acting ? 1 : ringDraw);\n const curve = drawnPathProps(CURVE_PATH, acting ? 1 : curveDraw);\n const dot = drawnPathProps(DOT_PATH, acting ? 1 : dotDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CURVE_PATH}\n strokeDasharray={curve.strokeDasharray}\n strokeDashoffset={curve.strokeDashoffset}\n />\n <path\n d={DOT_PATH}\n strokeDasharray={dot.strokeDasharray}\n strokeDashoffset={dot.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction HelpCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CURVE_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HelpCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HelpCircleIconBase>;\n\nconst HelpCircleIconInner = forwardRef<\n HTMLDivElement,\n HelpCircleIconElementProps & { 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 ?? \"<HelpCircleIcon>\"}\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 <HelpCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof HelpCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HelpCircleIcon = Interactive.withSchema({\n Component: HelpCircleIconInner,\n componentName: \"<HelpCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst CURVE_PATH = \"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3\";\nconst DOT_PATH = \"M12 17h.01\";\n\nconst PIVOT_X = 12;\nconst PIVOT_Y = 8;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction HelpCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ringDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curveDraw = interpolate(linearDraw, [0.4, 0.85], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotDraw = interpolate(linearDraw, [0.75, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, 6, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const ring = drawnPathProps(RING_PATH, acting ? 1 : ringDraw);\n const curve = drawnPathProps(CURVE_PATH, acting ? 1 : curveDraw);\n const dot = drawnPathProps(DOT_PATH, acting ? 1 : dotDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <g transform={`rotate(${tilt} ${PIVOT_X} ${PIVOT_Y})`}>\n <path\n d={CURVE_PATH}\n strokeDasharray={curve.strokeDasharray}\n strokeDashoffset={curve.strokeDashoffset}\n />\n <path\n d={DOT_PATH}\n strokeDasharray={dot.strokeDasharray}\n strokeDashoffset={dot.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction HelpCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={CURVE_PATH} />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HelpCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof HelpCircleIconBase>;\n\nconst HelpCircleIconInner = forwardRef<\n HTMLDivElement,\n HelpCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<HelpCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <HelpCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof HelpCircleIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const HelpCircleIcon = Interactive.withSchema({\n Component: HelpCircleIconInner,\n componentName: \"<HelpCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-home.json b/registry-artifacts/elements/icon-home.json
index 06a00552..b5142aeb 100644
--- a/registry-artifacts/elements/icon-home.json
+++ b/registry-artifacts/elements/icon-home.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Home",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-home",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\";\nconst HOUSE_PATH =\n \"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction HomeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(actionProgress, [0.1, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const doorProgress = animation === \"draw\" ? 1 : acting ? doorDraw : 0;\n\n const house = drawnPathProps(HOUSE_PATH, drawProgress);\n const door = drawnPathProps(DOOR_PATH, doorProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HOUSE_PATH}\n strokeDasharray={house.strokeDasharray}\n strokeDashoffset={house.strokeDashoffset}\n />\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HomeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DOOR_PATH} />\n <path d={HOUSE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HomeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof HomeIconBase>;\n\nconst HomeIconInner = forwardRef<\n HTMLDivElement,\n HomeIconElementProps & { 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 ?? \"<HomeIcon>\"}\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 <HomeIconBase\n {...(componentProps as unknown as ComponentProps<typeof HomeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const HomeIcon = Interactive.withSchema({\n Component: HomeIconInner,\n componentName: \"<HomeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8\";\nconst HOUSE_PATH =\n \"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction HomeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(actionProgress, [0.1, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const doorProgress = animation === \"draw\" ? 1 : acting ? doorDraw : 0;\n\n const house = drawnPathProps(HOUSE_PATH, drawProgress);\n const door = drawnPathProps(DOOR_PATH, doorProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HOUSE_PATH}\n strokeDasharray={house.strokeDasharray}\n strokeDashoffset={house.strokeDashoffset}\n />\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction HomeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DOOR_PATH} />\n <path d={HOUSE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype HomeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof HomeIconBase>;\n\nconst HomeIconInner = forwardRef<\n HTMLDivElement,\n HomeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<HomeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <HomeIconBase\n {...(componentProps as unknown as ComponentProps<typeof HomeIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const HomeIcon = Interactive.withSchema({\n Component: HomeIconInner,\n componentName: \"<HomeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-image.json b/registry-artifacts/elements/icon-image.json
index 6e129b78..ff0c6d38 100644
--- a/registry-artifacts/elements/icon-image.json
+++ b/registry-artifacts/elements/icon-image.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Image",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-image",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z\";\nconst SUN_PATH =\n \"M9 7 A2 2 0 0 1 11 9 A2 2 0 0 1 9 11 A2 2 0 0 1 7 9 A2 2 0 0 1 9 7\";\nconst MOUNTAIN_PATH = \"M6 21 15.086 11.914A2 2 0 0 1 17.914 11.914L21 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction ImageIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const frameDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sunDraw = interpolate(linearDraw, [0.444, 0.778], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const mountainDraw = interpolate(linearDraw, [0.556, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const mountainProgress = acting\n ? interpolate(actionProgress, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : mountainDraw;\n const sunShiftY = acting\n ? interpolate(actionProgress, [0, 0.6, 0.9], [1, -0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const sunOpacity = acting\n ? interpolate(actionProgress, [0, 0.5], [0.6, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, frameDraw);\n const sun = drawnPathProps(SUN_PATH, acting ? 1 : sunDraw);\n const mountain = drawnPathProps(MOUNTAIN_PATH, mountainProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${sunShiftY})`} opacity={sunOpacity}>\n <path\n d={SUN_PATH}\n strokeDasharray={sun.strokeDasharray}\n strokeDashoffset={sun.strokeDashoffset}\n />\n </g>\n <path\n d={MOUNTAIN_PATH}\n strokeDasharray={mountain.strokeDasharray}\n strokeDashoffset={mountain.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ImageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ImageIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ImageIconBase>;\n\nconst ImageIconInner = forwardRef<\n HTMLDivElement,\n ImageIconElementProps & { 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 ?? \"<ImageIcon>\"}\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 <ImageIconBase\n {...(componentProps as unknown as ComponentProps<typeof ImageIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ImageIcon = Interactive.withSchema({\n Component: ImageIconInner,\n componentName: \"<ImageIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FRAME_PATH =\n \"M5 3H19A2 2 0 0 1 21 5V19A2 2 0 0 1 19 21H5A2 2 0 0 1 3 19V5A2 2 0 0 1 5 3Z\";\nconst SUN_PATH =\n \"M9 7 A2 2 0 0 1 11 9 A2 2 0 0 1 9 11 A2 2 0 0 1 7 9 A2 2 0 0 1 9 7\";\nconst MOUNTAIN_PATH = \"M6 21 15.086 11.914A2 2 0 0 1 17.914 11.914L21 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction ImageIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const frameDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const sunDraw = interpolate(linearDraw, [0.444, 0.778], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const mountainDraw = interpolate(linearDraw, [0.556, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const mountainProgress = acting\n ? interpolate(actionProgress, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : mountainDraw;\n const sunShiftY = acting\n ? interpolate(actionProgress, [0, 0.6, 0.9], [1, -0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const sunOpacity = acting\n ? interpolate(actionProgress, [0, 0.5], [0.6, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const frame = drawnPathProps(FRAME_PATH, frameDraw);\n const sun = drawnPathProps(SUN_PATH, acting ? 1 : sunDraw);\n const mountain = drawnPathProps(MOUNTAIN_PATH, mountainProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={FRAME_PATH}\n strokeDasharray={frame.strokeDasharray}\n strokeDashoffset={frame.strokeDashoffset}\n />\n <g transform={`translate(0 ${sunShiftY})`} opacity={sunOpacity}>\n <path\n d={SUN_PATH}\n strokeDasharray={sun.strokeDasharray}\n strokeDashoffset={sun.strokeDashoffset}\n />\n </g>\n <path\n d={MOUNTAIN_PATH}\n strokeDasharray={mountain.strokeDasharray}\n strokeDashoffset={mountain.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction ImageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"18\" x=\"3\" y=\"3\" rx=\"2\" ry=\"2\" />\n <circle cx=\"9\" cy=\"9\" r=\"2\" />\n <path d=\"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ImageIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ImageIconBase>;\n\nconst ImageIconInner = forwardRef<\n HTMLDivElement,\n ImageIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ImageIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ImageIconBase\n {...(componentProps as unknown as ComponentProps<typeof ImageIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ImageIcon = Interactive.withSchema({\n Component: ImageIconInner,\n componentName: \"<ImageIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-inbox.json b/registry-artifacts/elements/icon-inbox.json
index 859c6f39..061043f9 100644
--- a/registry-artifacts/elements/icon-inbox.json
+++ b/registry-artifacts/elements/icon-inbox.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Inbox",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-inbox",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_PATH =\n \"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\";\nconst LIP_PATH = \"M22 12H16L14 15H10L8 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction InboxIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trayDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lipDraw = interpolate(linearDraw, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.55, 1], [0, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.03, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const tray = drawnPathProps(TRAY_PATH, acting ? 1 : trayDraw);\n const lip = drawnPathProps(LIP_PATH, acting ? 1 : lipDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale})`,\n }}\n >\n <path\n d={TRAY_PATH}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n <path\n d={LIP_PATH}\n strokeDasharray={lip.strokeDasharray}\n strokeDashoffset={lip.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction InboxIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d={TRAY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype InboxIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InboxIconBase>;\n\nconst InboxIconInner = forwardRef<\n HTMLDivElement,\n InboxIconElementProps & { 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 ?? \"<InboxIcon>\"}\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 <InboxIconBase\n {...(componentProps as unknown as ComponentProps<typeof InboxIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InboxIcon = Interactive.withSchema({\n Component: InboxIconInner,\n componentName: \"<InboxIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_PATH =\n \"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z\";\nconst LIP_PATH = \"M22 12H16L14 15H10L8 12H2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction InboxIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trayDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lipDraw = interpolate(linearDraw, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const dip = acting\n ? interpolate(actionProgress, [0, 0.25, 0.55, 1], [0, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.03, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const tray = drawnPathProps(TRAY_PATH, acting ? 1 : trayDraw);\n const lip = drawnPathProps(LIP_PATH, acting ? 1 : lipDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale})`,\n }}\n >\n <path\n d={TRAY_PATH}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n <path\n d={LIP_PATH}\n strokeDasharray={lip.strokeDasharray}\n strokeDashoffset={lip.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction InboxIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <polyline points=\"22 12 16 12 14 15 10 15 8 12 2 12\" />\n <path d={TRAY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype InboxIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof InboxIconBase>;\n\nconst InboxIconInner = forwardRef<\n HTMLDivElement,\n InboxIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<InboxIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <InboxIconBase\n {...(componentProps as unknown as ComponentProps<typeof InboxIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const InboxIcon = Interactive.withSchema({\n Component: InboxIconInner,\n componentName: \"<InboxIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-info.json b/registry-artifacts/elements/icon-info.json
index 6bfba2b2..1e639322 100644
--- a/registry-artifacts/elements/icon-info.json
+++ b/registry-artifacts/elements/icon-info.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Info",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-info",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst STEM_PATH = \"M12 12v4\";\nconst DOT_PATH = \"M12 8h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction InfoIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.5, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const bob = interpolate(actionProgress, [0, 0.5, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n <g\n transform={`translate(0 ${bob}) translate(12 8) scale(${dotPop}) translate(-12 -8)`}\n >\n <path d={DOT_PATH} />\n </g>\n </svg>\n );\n}\n\nfunction InfoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype InfoIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfoIconBase>;\n\nconst InfoIconInner = forwardRef<\n HTMLDivElement,\n InfoIconElementProps & { 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 ?? \"<InfoIcon>\"}\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 <InfoIconBase\n {...(componentProps as unknown as ComponentProps<typeof InfoIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfoIcon = Interactive.withSchema({\n Component: InfoIconInner,\n componentName: \"<InfoIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\";\nconst STEM_PATH = \"M12 12v4\";\nconst DOT_PATH = \"M12 8h.01\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction InfoIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const stemProgress = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dotPop = interpolate(linearDraw, [0.5, 0.65], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const stem = drawnPathProps(STEM_PATH, stemProgress);\n\n const bob = interpolate(actionProgress, [0, 0.5, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={STEM_PATH}\n strokeDasharray={stem.strokeDasharray}\n strokeDashoffset={stem.strokeDashoffset}\n />\n <g\n transform={`translate(0 ${bob}) translate(12 8) scale(${dotPop}) translate(-12 -8)`}\n >\n <path d={DOT_PATH} />\n </g>\n </svg>\n );\n}\n\nfunction InfoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d={DOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype InfoIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof InfoIconBase>;\n\nconst InfoIconInner = forwardRef<\n HTMLDivElement,\n InfoIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<InfoIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <InfoIconBase\n {...(componentProps as unknown as ComponentProps<typeof InfoIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const InfoIcon = Interactive.withSchema({\n Component: InfoIconInner,\n componentName: \"<InfoIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-key.json b/registry-artifacts/elements/icon-key.json
index 858e2dc8..3d8eb2c0 100644
--- a/registry-artifacts/elements/icon-key.json
+++ b/registry-artifacts/elements/icon-key.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Key",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-key",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M7.5 10 A5.5 5.5 0 0 1 13 15.5 A5.5 5.5 0 0 1 7.5 21 A5.5 5.5 0 0 1 2 15.5 A5.5 5.5 0 0 1 7.5 10\";\nconst SHAFT_PATH = \"M21 2 11.4 11.6\";\nconst TEETH_PATH =\n \"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction KeyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const teethDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const turn = acting\n ? interpolate(actionProgress, [0, 0.5, 0.64, 0.9, 1], [0, -25, -25, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const teeth = drawnPathProps(TEETH_PATH, teethDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${turn} 7.5 15.5)`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={TEETH_PATH}\n strokeDasharray={teeth.strokeDasharray}\n strokeDashoffset={teeth.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction KeyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TEETH_PATH} />\n <path d={SHAFT_PATH} />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype KeyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof KeyIconBase>;\n\nconst KeyIconInner = forwardRef<\n HTMLDivElement,\n KeyIconElementProps & { 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 ?? \"<KeyIcon>\"}\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 <KeyIconBase\n {...(componentProps as unknown as ComponentProps<typeof KeyIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const KeyIcon = Interactive.withSchema({\n Component: KeyIconInner,\n componentName: \"<KeyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M7.5 10 A5.5 5.5 0 0 1 13 15.5 A5.5 5.5 0 0 1 7.5 21 A5.5 5.5 0 0 1 2 15.5 A5.5 5.5 0 0 1 7.5 10\";\nconst SHAFT_PATH = \"M21 2 11.4 11.6\";\nconst TEETH_PATH =\n \"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction KeyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const teethDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const turn = acting\n ? interpolate(actionProgress, [0, 0.5, 0.64, 0.9, 1], [0, -25, -25, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const teeth = drawnPathProps(TEETH_PATH, teethDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${turn} 7.5 15.5)`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={TEETH_PATH}\n strokeDasharray={teeth.strokeDasharray}\n strokeDashoffset={teeth.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction KeyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TEETH_PATH} />\n <path d={SHAFT_PATH} />\n <circle cx=\"7.5\" cy=\"15.5\" r=\"5.5\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype KeyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof KeyIconBase>;\n\nconst KeyIconInner = forwardRef<\n HTMLDivElement,\n KeyIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<KeyIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <KeyIconBase\n {...(componentProps as unknown as ComponentProps<typeof KeyIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const KeyIcon = Interactive.withSchema({\n Component: KeyIconInner,\n componentName: \"<KeyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-layout-grid.json b/registry-artifacts/elements/icon-layout-grid.json
index 39b80ba2..fb81a6ca 100644
--- a/registry-artifacts/elements/icon-layout-grid.json
+++ b/registry-artifacts/elements/icon-layout-grid.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Layout Grid",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-layout-grid",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH =\n \"M4 3H9A1 1 0 0 1 10 4V9A1 1 0 0 1 9 10H4A1 1 0 0 1 3 9V4A1 1 0 0 1 4 3Z\";\nconst TR_PATH =\n \"M15 3H20A1 1 0 0 1 21 4V9A1 1 0 0 1 20 10H15A1 1 0 0 1 14 9V4A1 1 0 0 1 15 3Z\";\nconst BR_PATH =\n \"M15 14H20A1 1 0 0 1 21 15V20A1 1 0 0 1 20 21H15A1 1 0 0 1 14 20V15A1 1 0 0 1 15 14Z\";\nconst BL_PATH =\n \"M4 14H9A1 1 0 0 1 10 15V20A1 1 0 0 1 9 21H4A1 1 0 0 1 3 20V15A1 1 0 0 1 4 14Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nconst TILES = [\n { path: TL_PATH, cx: 6.5, cy: 6.5, drawWindow: [0, 0.4], stagger: 0 },\n { path: TR_PATH, cx: 17.5, cy: 6.5, drawWindow: [0.2, 0.6], stagger: 0.23 },\n { path: BR_PATH, cx: 17.5, cy: 17.5, drawWindow: [0.4, 0.8], stagger: 0.46 },\n { path: BL_PATH, cx: 6.5, cy: 17.5, drawWindow: [0.6, 1], stagger: 0.69 },\n] as const;\n\nfunction LayoutGridIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {TILES.map((tile) => {\n const drawn = interpolate(linearDraw, [...tile.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(tile.path, drawn);\n const pop =\n acting && actionProgress >= tile.stagger\n ? interpolate(\n actionProgress,\n [tile.stagger, tile.stagger + 0.25, tile.stagger + 0.5],\n [0.85, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const tx = tile.cx * (1 - pop);\n const ty = tile.cy * (1 - pop);\n return (\n <g key={tile.path} transform={`translate(${tx} ${ty}) scale(${pop})`}>\n <path\n d={tile.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction LayoutGridIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LayoutGridIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LayoutGridIconBase>;\n\nconst LayoutGridIconInner = forwardRef<\n HTMLDivElement,\n LayoutGridIconElementProps & { 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 ?? \"<LayoutGridIcon>\"}\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 <LayoutGridIconBase\n {...(componentProps as unknown as ComponentProps<typeof LayoutGridIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LayoutGridIcon = Interactive.withSchema({\n Component: LayoutGridIconInner,\n componentName: \"<LayoutGridIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH =\n \"M4 3H9A1 1 0 0 1 10 4V9A1 1 0 0 1 9 10H4A1 1 0 0 1 3 9V4A1 1 0 0 1 4 3Z\";\nconst TR_PATH =\n \"M15 3H20A1 1 0 0 1 21 4V9A1 1 0 0 1 20 10H15A1 1 0 0 1 14 9V4A1 1 0 0 1 15 3Z\";\nconst BR_PATH =\n \"M15 14H20A1 1 0 0 1 21 15V20A1 1 0 0 1 20 21H15A1 1 0 0 1 14 20V15A1 1 0 0 1 15 14Z\";\nconst BL_PATH =\n \"M4 14H9A1 1 0 0 1 10 15V20A1 1 0 0 1 9 21H4A1 1 0 0 1 3 20V15A1 1 0 0 1 4 14Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nconst TILES = [\n { path: TL_PATH, cx: 6.5, cy: 6.5, drawWindow: [0, 0.4], stagger: 0 },\n { path: TR_PATH, cx: 17.5, cy: 6.5, drawWindow: [0.2, 0.6], stagger: 0.23 },\n { path: BR_PATH, cx: 17.5, cy: 17.5, drawWindow: [0.4, 0.8], stagger: 0.46 },\n { path: BL_PATH, cx: 6.5, cy: 17.5, drawWindow: [0.6, 1], stagger: 0.69 },\n] as const;\n\nfunction LayoutGridIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {TILES.map((tile) => {\n const drawn = interpolate(linearDraw, [...tile.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(tile.path, drawn);\n const pop =\n acting && actionProgress >= tile.stagger\n ? interpolate(\n actionProgress,\n [tile.stagger, tile.stagger + 0.25, tile.stagger + 0.5],\n [0.85, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const tx = tile.cx * (1 - pop);\n const ty = tile.cy * (1 - pop);\n return (\n <g key={tile.path} transform={`translate(${tx} ${ty}) scale(${pop})`}>\n <path\n d={tile.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction LayoutGridIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"3\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"14\" y=\"14\" rx=\"1\" />\n <rect width=\"7\" height=\"7\" x=\"3\" y=\"14\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LayoutGridIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof LayoutGridIconBase>;\n\nconst LayoutGridIconInner = forwardRef<\n HTMLDivElement,\n LayoutGridIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<LayoutGridIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <LayoutGridIconBase\n {...(componentProps as unknown as ComponentProps<typeof LayoutGridIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const LayoutGridIcon = Interactive.withSchema({\n Component: LayoutGridIconInner,\n componentName: \"<LayoutGridIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-link.json b/registry-artifacts/elements/icon-link.json
index 01d6fec0..327b62fe 100644
--- a/registry-artifacts/elements/icon-link.json
+++ b/registry-artifacts/elements/icon-link.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Link",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-link",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\";\nconst BOTTOM_PATH =\n \"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction LinkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pull = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75], [0, 1.06, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const top = drawnPathProps(TOP_PATH, drawProgress);\n const bottom = drawnPathProps(BOTTOM_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${pull} ${-pull})`}>\n <path\n d={TOP_PATH}\n strokeDasharray={top.strokeDasharray}\n strokeDashoffset={top.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pull} ${pull})`}>\n <path\n d={BOTTOM_PATH}\n strokeDasharray={bottom.strokeDasharray}\n strokeDashoffset={bottom.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={BOTTOM_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LinkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LinkIconBase>;\n\nconst LinkIconInner = forwardRef<\n HTMLDivElement,\n LinkIconElementProps & { 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 ?? \"<LinkIcon>\"}\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 <LinkIconBase\n {...(componentProps as unknown as ComponentProps<typeof LinkIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LinkIcon = Interactive.withSchema({\n Component: LinkIconInner,\n componentName: \"<LinkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\";\nconst BOTTOM_PATH =\n \"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction LinkIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pull = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75], [0, 1.06, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.6, 0.78, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const top = drawnPathProps(TOP_PATH, drawProgress);\n const bottom = drawnPathProps(BOTTOM_PATH, drawProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${pull} ${-pull})`}>\n <path\n d={TOP_PATH}\n strokeDasharray={top.strokeDasharray}\n strokeDashoffset={top.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pull} ${pull})`}>\n <path\n d={BOTTOM_PATH}\n strokeDasharray={bottom.strokeDasharray}\n strokeDashoffset={bottom.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LinkIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={BOTTOM_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LinkIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof LinkIconBase>;\n\nconst LinkIconInner = forwardRef<\n HTMLDivElement,\n LinkIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<LinkIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <LinkIconBase\n {...(componentProps as unknown as ComponentProps<typeof LinkIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const LinkIcon = Interactive.withSchema({\n Component: LinkIconInner,\n componentName: \"<LinkIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-loader.json b/registry-artifacts/elements/icon-loader.json
index c9f85e23..b72de460 100644
--- a/registry-artifacts/elements/icon-loader.json
+++ b/registry-artifacts/elements/icon-loader.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Loader",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-loader",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_PATH = \"M21 12a9 9 0 1 1-6.219-8.56\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction LoaderIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const arc = drawnPathProps(ARC_PATH, arcProgress);\n const rotate = (cycleIndex + actionProgress) * 360;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${entrance})`,\n }}\n >\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction LoaderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LoaderIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LoaderIconBase>;\n\nconst LoaderIconInner = forwardRef<\n HTMLDivElement,\n LoaderIconElementProps & { 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 ?? \"<LoaderIcon>\"}\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 <LoaderIconBase\n {...(componentProps as unknown as ComponentProps<typeof LoaderIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LoaderIcon = Interactive.withSchema({\n Component: LoaderIconInner,\n componentName: \"<LoaderIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_PATH = \"M21 12a9 9 0 1 1-6.219-8.56\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: true,\n} as const;\n\nfunction LoaderIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, actionProgress, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const entrance = interpolate(linearDraw, [0, 1], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const arc = drawnPathProps(ARC_PATH, arcProgress);\n const rotate = (cycleIndex + actionProgress) * 360;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${entrance})`,\n }}\n >\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction LoaderIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LoaderIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof LoaderIconBase>;\n\nconst LoaderIconInner = forwardRef<\n HTMLDivElement,\n LoaderIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<LoaderIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <LoaderIconBase\n {...(componentProps as unknown as ComponentProps<typeof LoaderIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const LoaderIcon = Interactive.withSchema({\n Component: LoaderIconInner,\n componentName: \"<LoaderIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-lock.json b/registry-artifacts/elements/icon-lock.json
index d8be388f..cd70ed5e 100644
--- a/registry-artifacts/elements/icon-lock.json
+++ b/registry-artifacts/elements/icon-lock.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Lock",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-lock",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M5 11H19A2 2 0 0 1 21 13V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V13A2 2 0 0 1 5 11Z\";\nconst SHACKLE_PATH = \"M7 11V7a5 5 0 0 1 10 0v4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction LockIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shackleDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.7, 0.85, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const shackle = drawnPathProps(SHACKLE_PATH, shackleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${lift})`}>\n <path\n d={SHACKLE_PATH}\n strokeDasharray={shackle.strokeDasharray}\n strokeDashoffset={shackle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d={SHACKLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LockIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LockIconBase>;\n\nconst LockIconInner = forwardRef<\n HTMLDivElement,\n LockIconElementProps & { 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 ?? \"<LockIcon>\"}\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 <LockIconBase\n {...(componentProps as unknown as ComponentProps<typeof LockIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LockIcon = Interactive.withSchema({\n Component: LockIconInner,\n componentName: \"<LockIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M5 11H19A2 2 0 0 1 21 13V20A2 2 0 0 1 19 22H5A2 2 0 0 1 3 20V13A2 2 0 0 1 5 11Z\";\nconst SHACKLE_PATH = \"M7 11V7a5 5 0 0 1 10 0v4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction LockIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shackleDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const lift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, -2.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0.7, 0.85, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const shackle = drawnPathProps(SHACKLE_PATH, shackleDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`translate(0 ${lift})`}>\n <path\n d={SHACKLE_PATH}\n strokeDasharray={shackle.strokeDasharray}\n strokeDashoffset={shackle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LockIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"18\" height=\"11\" x=\"3\" y=\"11\" rx=\"2\" ry=\"2\" />\n <path d={SHACKLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LockIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof LockIconBase>;\n\nconst LockIconInner = forwardRef<\n HTMLDivElement,\n LockIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<LockIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <LockIconBase\n {...(componentProps as unknown as ComponentProps<typeof LockIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const LockIcon = Interactive.withSchema({\n Component: LockIconInner,\n componentName: \"<LockIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-log-out.json b/registry-artifacts/elements/icon-log-out.json
index 1528f3a1..3f2878af 100644
--- a/registry-artifacts/elements/icon-log-out.json
+++ b/registry-artifacts/elements/icon-log-out.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Log Out",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-log-out",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\";\nconst SHAFT_PATH = \"M21 12H9\";\nconst HEAD_PATH = \"M16 17 21 12 16 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction LogOutIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const exit = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45, 0.68, 1], [0, 4, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const door = drawnPathProps(DOOR_PATH, doorDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const head = drawnPathProps(HEAD_PATH, headDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n <g transform={`translate(${exit} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LogOutIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEAD_PATH} />\n <path d={SHAFT_PATH} />\n <path d={DOOR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LogOutIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LogOutIconBase>;\n\nconst LogOutIconInner = forwardRef<\n HTMLDivElement,\n LogOutIconElementProps & { 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 ?? \"<LogOutIcon>\"}\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 <LogOutIconBase\n {...(componentProps as unknown as ComponentProps<typeof LogOutIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LogOutIcon = Interactive.withSchema({\n Component: LogOutIconInner,\n componentName: \"<LogOutIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DOOR_PATH = \"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4\";\nconst SHAFT_PATH = \"M21 12H9\";\nconst HEAD_PATH = \"M16 17 21 12 16 7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction LogOutIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const doorDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shaftDraw = interpolate(linearDraw, [0.375, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const headDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const exit = acting\n ? interpolate(actionProgress, [0, 0.22, 0.45, 0.68, 1], [0, 4, 0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const door = drawnPathProps(DOOR_PATH, doorDraw);\n const shaft = drawnPathProps(SHAFT_PATH, shaftDraw);\n const head = drawnPathProps(HEAD_PATH, headDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DOOR_PATH}\n strokeDasharray={door.strokeDasharray}\n strokeDashoffset={door.strokeDashoffset}\n />\n <g transform={`translate(${exit} 0)`}>\n <path\n d={SHAFT_PATH}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction LogOutIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HEAD_PATH} />\n <path d={SHAFT_PATH} />\n <path d={DOOR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype LogOutIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof LogOutIconBase>;\n\nconst LogOutIconInner = forwardRef<\n HTMLDivElement,\n LogOutIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<LogOutIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <LogOutIconBase\n {...(componentProps as unknown as ComponentProps<typeof LogOutIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const LogOutIcon = Interactive.withSchema({\n Component: LogOutIconInner,\n componentName: \"<LogOutIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-mail.json b/registry-artifacts/elements/icon-mail.json
index 4b41b817..d4b03c68 100644
--- a/registry-artifacts/elements/icon-mail.json
+++ b/registry-artifacts/elements/icon-mail.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Mail",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-mail",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 4H20A2 2 0 0 1 22 6V18A2 2 0 0 1 20 20H4A2 2 0 0 1 2 18V6A2 2 0 0 1 4 4Z\";\nconst FLAP_PATH = \"M22 7 13.009 12.727a2 2 0 0 1-2.009 0L2 7\";\nconst FLAP_RIGHT_PATH = \"M22 7 13.009 12.727\";\nconst FLAP_LEFT_PATH = \"M2 7 11 12.727\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MailIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flapProgress = acting ? 1 : flapDraw;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bob = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const flapRight = drawnPathProps(FLAP_RIGHT_PATH, flapProgress);\n const flapLeft = drawnPathProps(FLAP_LEFT_PATH, flapProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${bob}px) scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_RIGHT_PATH}\n strokeDasharray={flapRight.strokeDasharray}\n strokeDashoffset={flapRight.strokeDashoffset}\n />\n <path\n d={FLAP_LEFT_PATH}\n strokeDasharray={flapLeft.strokeDasharray}\n strokeDashoffset={flapLeft.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MailIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MailIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MailIconBase>;\n\nconst MailIconInner = forwardRef<\n HTMLDivElement,\n MailIconElementProps & { 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 ?? \"<MailIcon>\"}\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 <MailIconBase\n {...(componentProps as unknown as ComponentProps<typeof MailIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MailIcon = Interactive.withSchema({\n Component: MailIconInner,\n componentName: \"<MailIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 4H20A2 2 0 0 1 22 6V18A2 2 0 0 1 20 20H4A2 2 0 0 1 2 18V6A2 2 0 0 1 4 4Z\";\nconst FLAP_PATH = \"M22 7 13.009 12.727a2 2 0 0 1-2.009 0L2 7\";\nconst FLAP_RIGHT_PATH = \"M22 7 13.009 12.727\";\nconst FLAP_LEFT_PATH = \"M2 7 11 12.727\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MailIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const flapProgress = acting ? 1 : flapDraw;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bob = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const flapRight = drawnPathProps(FLAP_RIGHT_PATH, flapProgress);\n const flapLeft = drawnPathProps(FLAP_LEFT_PATH, flapProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${bob}px) scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_RIGHT_PATH}\n strokeDasharray={flapRight.strokeDasharray}\n strokeDashoffset={flapRight.strokeDashoffset}\n />\n <path\n d={FLAP_LEFT_PATH}\n strokeDasharray={flapLeft.strokeDasharray}\n strokeDashoffset={flapLeft.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MailIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <rect x=\"2\" y=\"4\" width=\"20\" height=\"16\" rx=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MailIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MailIconBase>;\n\nconst MailIconInner = forwardRef<\n HTMLDivElement,\n MailIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MailIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MailIconBase\n {...(componentProps as unknown as ComponentProps<typeof MailIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MailIcon = Interactive.withSchema({\n Component: MailIconInner,\n componentName: \"<MailIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-maximize.json b/registry-artifacts/elements/icon-maximize.json
index 0a1c04d6..716c1972 100644
--- a/registry-artifacts/elements/icon-maximize.json
+++ b/registry-artifacts/elements/icon-maximize.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Maximize",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-maximize",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH = \"M8 3H5a2 2 0 0 0-2 2v3\";\nconst TR_PATH = \"M21 8V5a2 2 0 0 0-2-2h-3\";\nconst BL_PATH = \"M3 16v3a2 2 0 0 0 2 2h3\";\nconst BR_PATH = \"M16 21h3a2 2 0 0 0 2-2v-3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nconst BRACKETS = [\n { path: TL_PATH, dx: -1, dy: -1 },\n { path: TR_PATH, dx: 1, dy: -1 },\n { path: BL_PATH, dx: -1, dy: 1 },\n { path: BR_PATH, dx: 1, dy: 1 },\n] as const;\n\nfunction MaximizeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n const expand = acting\n ? interpolate(actionProgress, [0, 0.42, 1], [0, 1.77, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BRACKETS.map((bracket) => {\n const dash = drawnPathProps(bracket.path, drawProgress);\n return (\n <g\n key={bracket.path}\n transform={`translate(${bracket.dx * expand} ${bracket.dy * expand})`}\n >\n <path\n d={bracket.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MaximizeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TL_PATH} />\n <path d={TR_PATH} />\n <path d={BL_PATH} />\n <path d={BR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MaximizeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MaximizeIconBase>;\n\nconst MaximizeIconInner = forwardRef<\n HTMLDivElement,\n MaximizeIconElementProps & { 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 ?? \"<MaximizeIcon>\"}\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 <MaximizeIconBase\n {...(componentProps as unknown as ComponentProps<typeof MaximizeIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MaximizeIcon = Interactive.withSchema({\n Component: MaximizeIconInner,\n componentName: \"<MaximizeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TL_PATH = \"M8 3H5a2 2 0 0 0-2 2v3\";\nconst TR_PATH = \"M21 8V5a2 2 0 0 0-2-2h-3\";\nconst BL_PATH = \"M3 16v3a2 2 0 0 0 2 2h3\";\nconst BR_PATH = \"M16 21h3a2 2 0 0 0 2-2v-3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nconst BRACKETS = [\n { path: TL_PATH, dx: -1, dy: -1 },\n { path: TR_PATH, dx: 1, dy: -1 },\n { path: BL_PATH, dx: -1, dy: 1 },\n { path: BR_PATH, dx: 1, dy: 1 },\n] as const;\n\nfunction MaximizeIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n const expand = acting\n ? interpolate(actionProgress, [0, 0.42, 1], [0, 1.77, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BRACKETS.map((bracket) => {\n const dash = drawnPathProps(bracket.path, drawProgress);\n return (\n <g\n key={bracket.path}\n transform={`translate(${bracket.dx * expand} ${bracket.dy * expand})`}\n >\n <path\n d={bracket.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MaximizeIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TL_PATH} />\n <path d={TR_PATH} />\n <path d={BL_PATH} />\n <path d={BR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MaximizeIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MaximizeIconBase>;\n\nconst MaximizeIconInner = forwardRef<\n HTMLDivElement,\n MaximizeIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MaximizeIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MaximizeIconBase\n {...(componentProps as unknown as ComponentProps<typeof MaximizeIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MaximizeIcon = Interactive.withSchema({\n Component: MaximizeIconInner,\n componentName: \"<MaximizeIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-menu.json b/registry-artifacts/elements/icon-menu.json
index b69e9d1b..92601274 100644
--- a/registry-artifacts/elements/icon-menu.json
+++ b/registry-artifacts/elements/icon-menu.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Menu",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-menu",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M4 5 20 5\";\nconst MID_PATH = \"M4 12 20 12\";\nconst BOT_PATH = \"M4 19 20 19\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nconst BARS = [\n { path: TOP_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { path: MID_PATH, drawWindow: [0.25, 0.75], stagger: 0.18 },\n { path: BOT_PATH, drawWindow: [0.5, 1], stagger: 0.36 },\n] as const;\n\nfunction MenuIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BARS.map((bar) => {\n const drawn = interpolate(linearDraw, [...bar.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(bar.path, drawn);\n const slide = acting\n ? interpolate(\n actionProgress,\n [bar.stagger, bar.stagger + 0.3, bar.stagger + 0.55],\n [-3, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n return (\n <g key={bar.path} transform={`translate(${slide} 0)`}>\n <path\n d={bar.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MenuIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={MID_PATH} />\n <path d={BOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MenuIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MenuIconBase>;\n\nconst MenuIconInner = forwardRef<\n HTMLDivElement,\n MenuIconElementProps & { 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 ?? \"<MenuIcon>\"}\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 <MenuIconBase\n {...(componentProps as unknown as ComponentProps<typeof MenuIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MenuIcon = Interactive.withSchema({\n Component: MenuIconInner,\n componentName: \"<MenuIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TOP_PATH = \"M4 5 20 5\";\nconst MID_PATH = \"M4 12 20 12\";\nconst BOT_PATH = \"M4 19 20 19\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nconst BARS = [\n { path: TOP_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { path: MID_PATH, drawWindow: [0.25, 0.75], stagger: 0.18 },\n { path: BOT_PATH, drawWindow: [0.5, 1], stagger: 0.36 },\n] as const;\n\nfunction MenuIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {BARS.map((bar) => {\n const drawn = interpolate(linearDraw, [...bar.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(bar.path, drawn);\n const slide = acting\n ? interpolate(\n actionProgress,\n [bar.stagger, bar.stagger + 0.3, bar.stagger + 0.55],\n [-3, 2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n return (\n <g key={bar.path} transform={`translate(${slide} 0)`}>\n <path\n d={bar.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MenuIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TOP_PATH} />\n <path d={MID_PATH} />\n <path d={BOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MenuIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MenuIconBase>;\n\nconst MenuIconInner = forwardRef<\n HTMLDivElement,\n MenuIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MenuIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MenuIconBase\n {...(componentProps as unknown as ComponentProps<typeof MenuIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MenuIcon = Interactive.withSchema({\n Component: MenuIconInner,\n componentName: \"<MenuIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-message-circle.json b/registry-artifacts/elements/icon-message-circle.json
index 52201841..6b243e7f 100644
--- a/registry-artifacts/elements/icon-message-circle.json
+++ b/registry-artifacts/elements/icon-message-circle.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Message Circle",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-message-circle",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BUBBLE_PATH =\n \"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\";\n\nconst TAIL_X = 4;\nconst TAIL_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction MessageCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const inflate = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.9, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bubble = drawnPathProps(BUBBLE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const inflateTransform = `translate(${TAIL_X * (1 - inflate)} ${TAIL_Y * (1 - inflate)}) scale(${inflate})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={inflateTransform}>\n <path\n d={BUBBLE_PATH}\n strokeDasharray={bubble.strokeDasharray}\n strokeDashoffset={bubble.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MessageCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BUBBLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MessageCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MessageCircleIconBase>;\n\nconst MessageCircleIconInner = forwardRef<\n HTMLDivElement,\n MessageCircleIconElementProps & { 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 ?? \"<MessageCircleIcon>\"}\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 <MessageCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof MessageCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MessageCircleIcon = Interactive.withSchema({\n Component: MessageCircleIconInner,\n componentName: \"<MessageCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BUBBLE_PATH =\n \"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719\";\n\nconst TAIL_X = 4;\nconst TAIL_Y = 20;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction MessageCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const inflate = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.9, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const bubble = drawnPathProps(BUBBLE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const inflateTransform = `translate(${TAIL_X * (1 - inflate)} ${TAIL_Y * (1 - inflate)}) scale(${inflate})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={inflateTransform}>\n <path\n d={BUBBLE_PATH}\n strokeDasharray={bubble.strokeDasharray}\n strokeDashoffset={bubble.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MessageCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BUBBLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MessageCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MessageCircleIconBase>;\n\nconst MessageCircleIconInner = forwardRef<\n HTMLDivElement,\n MessageCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MessageCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MessageCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof MessageCircleIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MessageCircleIcon = Interactive.withSchema({\n Component: MessageCircleIconInner,\n componentName: \"<MessageCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-mic.json b/registry-artifacts/elements/icon-mic.json
index 6a557dc3..3d8b90fb 100644
--- a/registry-artifacts/elements/icon-mic.json
+++ b/registry-artifacts/elements/icon-mic.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Mic",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-mic",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CAPSULE_PATH =\n \"M12 2A3 3 0 0 1 15 5V12A3 3 0 0 1 12 15A3 3 0 0 1 9 12V5A3 3 0 0 1 12 2Z\";\nconst ARC_PATH = \"M19 10v2a7 7 0 0 1-14 0v-2\";\nconst STAND_PATH = \"M12 19v3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MicIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const capsuleDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arcDraw = interpolate(linearDraw, [0.375, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const standDraw = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const capsuleScaleY = acting\n ? interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.5, 0.65, 0.8, 1],\n [1, 0.94, 1.04, 1, 0.97, 1.02, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const capsule = drawnPathProps(CAPSULE_PATH, capsuleDraw);\n const arc = drawnPathProps(ARC_PATH, arcDraw);\n const stand = drawnPathProps(STAND_PATH, standDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const capsuleTransform = `translate(0 ${8.5 * (1 - capsuleScaleY)}) scale(1 ${capsuleScaleY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={capsuleTransform}>\n <path\n d={CAPSULE_PATH}\n strokeDasharray={capsule.strokeDasharray}\n strokeDashoffset={capsule.strokeDashoffset}\n />\n </g>\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n <path\n d={STAND_PATH}\n strokeDasharray={stand.strokeDasharray}\n strokeDashoffset={stand.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MicIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAND_PATH} />\n <path d={ARC_PATH} />\n <rect x=\"9\" y=\"2\" width=\"6\" height=\"13\" rx=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MicIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MicIconBase>;\n\nconst MicIconInner = forwardRef<\n HTMLDivElement,\n MicIconElementProps & { 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 ?? \"<MicIcon>\"}\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 <MicIconBase\n {...(componentProps as unknown as ComponentProps<typeof MicIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MicIcon = Interactive.withSchema({\n Component: MicIconInner,\n componentName: \"<MicIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CAPSULE_PATH =\n \"M12 2A3 3 0 0 1 15 5V12A3 3 0 0 1 12 15A3 3 0 0 1 9 12V5A3 3 0 0 1 12 2Z\";\nconst ARC_PATH = \"M19 10v2a7 7 0 0 1-14 0v-2\";\nconst STAND_PATH = \"M12 19v3\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MicIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const capsuleDraw = interpolate(linearDraw, [0, 0.625], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arcDraw = interpolate(linearDraw, [0.375, 0.875], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const standDraw = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const capsuleScaleY = acting\n ? interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.5, 0.65, 0.8, 1],\n [1, 0.94, 1.04, 1, 0.97, 1.02, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const capsule = drawnPathProps(CAPSULE_PATH, capsuleDraw);\n const arc = drawnPathProps(ARC_PATH, arcDraw);\n const stand = drawnPathProps(STAND_PATH, standDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const capsuleTransform = `translate(0 ${8.5 * (1 - capsuleScaleY)}) scale(1 ${capsuleScaleY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={capsuleTransform}>\n <path\n d={CAPSULE_PATH}\n strokeDasharray={capsule.strokeDasharray}\n strokeDashoffset={capsule.strokeDashoffset}\n />\n </g>\n <path\n d={ARC_PATH}\n strokeDasharray={arc.strokeDasharray}\n strokeDashoffset={arc.strokeDashoffset}\n />\n <path\n d={STAND_PATH}\n strokeDasharray={stand.strokeDasharray}\n strokeDashoffset={stand.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MicIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAND_PATH} />\n <path d={ARC_PATH} />\n <rect x=\"9\" y=\"2\" width=\"6\" height=\"13\" rx=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MicIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MicIconBase>;\n\nconst MicIconInner = forwardRef<\n HTMLDivElement,\n MicIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MicIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MicIconBase\n {...(componentProps as unknown as ComponentProps<typeof MicIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MicIcon = Interactive.withSchema({\n Component: MicIconInner,\n componentName: \"<MicIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-monitor.json b/registry-artifacts/elements/icon-monitor.json
index c209262b..2c615b92 100644
--- a/registry-artifacts/elements/icon-monitor.json
+++ b/registry-artifacts/elements/icon-monitor.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Monitor",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-monitor",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SCREEN_PATH =\n \"M4 3H20A2 2 0 0 1 22 5V15A2 2 0 0 1 20 17H4A2 2 0 0 1 2 15V5A2 2 0 0 1 4 3Z\";\nconst BASE_PATH = \"M8 21H16\";\nconst NECK_PATH = \"M12 17V21\";\n\nconst SCREEN_CY = 10;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction MonitorIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const standDraw = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const screenDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const screenYScale = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.92, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.02, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const screen = drawnPathProps(SCREEN_PATH, acting ? 1 : screenDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : standDraw);\n const neck = drawnPathProps(NECK_PATH, acting ? 1 : standDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n const screenTransform = `translate(0 ${SCREEN_CY * (1 - screenYScale)}) scale(1 ${screenYScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={screenTransform}>\n <path\n d={SCREEN_PATH}\n strokeDasharray={screen.strokeDasharray}\n strokeDashoffset={screen.strokeDashoffset}\n />\n </g>\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n <path\n d={NECK_PATH}\n strokeDasharray={neck.strokeDasharray}\n strokeDashoffset={neck.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MonitorIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"3\" rx=\"2\" />\n <line x1=\"8\" x2=\"16\" y1=\"21\" y2=\"21\" />\n <line x1=\"12\" x2=\"12\" y1=\"17\" y2=\"21\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MonitorIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MonitorIconBase>;\n\nconst MonitorIconInner = forwardRef<\n HTMLDivElement,\n MonitorIconElementProps & { 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 ?? \"<MonitorIcon>\"}\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 <MonitorIconBase\n {...(componentProps as unknown as ComponentProps<typeof MonitorIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MonitorIcon = Interactive.withSchema({\n Component: MonitorIconInner,\n componentName: \"<MonitorIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SCREEN_PATH =\n \"M4 3H20A2 2 0 0 1 22 5V15A2 2 0 0 1 20 17H4A2 2 0 0 1 2 15V5A2 2 0 0 1 4 3Z\";\nconst BASE_PATH = \"M8 21H16\";\nconst NECK_PATH = \"M12 17V21\";\n\nconst SCREEN_CY = 10;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction MonitorIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const standDraw = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const screenDraw = interpolate(linearDraw, [0.35, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const screenYScale = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0.92, 1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const pop = acting\n ? interpolate(actionProgress, [0.5, 0.7, 1], [1, 1.02, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const screen = drawnPathProps(SCREEN_PATH, acting ? 1 : screenDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : standDraw);\n const neck = drawnPathProps(NECK_PATH, acting ? 1 : standDraw);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n const screenTransform = `translate(0 ${SCREEN_CY * (1 - screenYScale)}) scale(1 ${screenYScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={screenTransform}>\n <path\n d={SCREEN_PATH}\n strokeDasharray={screen.strokeDasharray}\n strokeDashoffset={screen.strokeDashoffset}\n />\n </g>\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n <path\n d={NECK_PATH}\n strokeDasharray={neck.strokeDasharray}\n strokeDashoffset={neck.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction MonitorIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"20\" height=\"14\" x=\"2\" y=\"3\" rx=\"2\" />\n <line x1=\"8\" x2=\"16\" y1=\"21\" y2=\"21\" />\n <line x1=\"12\" x2=\"12\" y1=\"17\" y2=\"21\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MonitorIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MonitorIconBase>;\n\nconst MonitorIconInner = forwardRef<\n HTMLDivElement,\n MonitorIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MonitorIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MonitorIconBase\n {...(componentProps as unknown as ComponentProps<typeof MonitorIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MonitorIcon = Interactive.withSchema({\n Component: MonitorIconInner,\n componentName: \"<MonitorIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-moon.json b/registry-artifacts/elements/icon-moon.json
index 3180753d..4bcc74cd 100644
--- a/registry-artifacts/elements/icon-moon.json
+++ b/registry-artifacts/elements/icon-moon.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Moon",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-moon",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MOON_PATH =\n \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MoonIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const settle = acting\n ? interpolate(actionProgress, [0, 0.2, 0.5, 0.78, 1], [0, -16, 9, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const moon = drawnPathProps(MOON_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${settle} ${CENTER} ${CENTER})`}>\n <path\n d={MOON_PATH}\n strokeDasharray={moon.strokeDasharray}\n strokeDashoffset={moon.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MoonIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MOON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MoonIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MoonIconBase>;\n\nconst MoonIconInner = forwardRef<\n HTMLDivElement,\n MoonIconElementProps & { 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 ?? \"<MoonIcon>\"}\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 <MoonIconBase\n {...(componentProps as unknown as ComponentProps<typeof MoonIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MoonIcon = Interactive.withSchema({\n Component: MoonIconInner,\n componentName: \"<MoonIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MOON_PATH =\n \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction MoonIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const settle = acting\n ? interpolate(actionProgress, [0, 0.2, 0.5, 0.78, 1], [0, -16, 9, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const moon = drawnPathProps(MOON_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${settle} ${CENTER} ${CENTER})`}>\n <path\n d={MOON_PATH}\n strokeDasharray={moon.strokeDasharray}\n strokeDashoffset={moon.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction MoonIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MOON_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MoonIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MoonIconBase>;\n\nconst MoonIconInner = forwardRef<\n HTMLDivElement,\n MoonIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MoonIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MoonIconBase\n {...(componentProps as unknown as ComponentProps<typeof MoonIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MoonIcon = Interactive.withSchema({\n Component: MoonIconInner,\n componentName: \"<MoonIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-more-horizontal.json b/registry-artifacts/elements/icon-more-horizontal.json
index c5dbdc49..20538802 100644
--- a/registry-artifacts/elements/icon-more-horizontal.json
+++ b/registry-artifacts/elements/icon-more-horizontal.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "More Horizontal",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-more-horizontal",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M5 11 A1 1 0 0 1 6 12 A1 1 0 0 1 5 13 A1 1 0 0 1 4 12 A1 1 0 0 1 5 11\";\nconst CENTER_PATH =\n \"M12 11 A1 1 0 0 1 13 12 A1 1 0 0 1 12 13 A1 1 0 0 1 11 12 A1 1 0 0 1 12 11\";\nconst RIGHT_PATH =\n \"M19 11 A1 1 0 0 1 20 12 A1 1 0 0 1 19 13 A1 1 0 0 1 18 12 A1 1 0 0 1 19 11\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst DOTS = [\n { cx: 5, path: LEFT_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { cx: 12, path: CENTER_PATH, drawWindow: [0.25, 0.75], stagger: 0.27 },\n { cx: 19, path: RIGHT_PATH, drawWindow: [0.5, 1], stagger: 0.54 },\n] as const;\n\nfunction MoreHorizontalIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {DOTS.map((dot) => {\n const drawn = interpolate(linearDraw, [...dot.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(dot.path, drawn);\n const dotScale = 0.6 + 0.4 * drawn;\n const lift = acting\n ? interpolate(\n actionProgress,\n [dot.stagger, dot.stagger + 0.2, dot.stagger + 0.4],\n [0, -3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n const tx = dot.cx * (1 - dotScale);\n const ty = 12 * (1 - dotScale) + lift;\n return (\n <g\n key={dot.cx}\n transform={`translate(${tx} ${ty}) scale(${dotScale})`}\n >\n <path\n d={dot.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MoreHorizontalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MoreHorizontalIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MoreHorizontalIconBase>;\n\nconst MoreHorizontalIconInner = forwardRef<\n HTMLDivElement,\n MoreHorizontalIconElementProps & { 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 ?? \"<MoreHorizontalIcon>\"}\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 <MoreHorizontalIconBase\n {...(componentProps as unknown as ComponentProps<typeof MoreHorizontalIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MoreHorizontalIcon = Interactive.withSchema({\n Component: MoreHorizontalIconInner,\n componentName: \"<MoreHorizontalIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M5 11 A1 1 0 0 1 6 12 A1 1 0 0 1 5 13 A1 1 0 0 1 4 12 A1 1 0 0 1 5 11\";\nconst CENTER_PATH =\n \"M12 11 A1 1 0 0 1 13 12 A1 1 0 0 1 12 13 A1 1 0 0 1 11 12 A1 1 0 0 1 12 11\";\nconst RIGHT_PATH =\n \"M19 11 A1 1 0 0 1 20 12 A1 1 0 0 1 19 13 A1 1 0 0 1 18 12 A1 1 0 0 1 19 11\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nconst DOTS = [\n { cx: 5, path: LEFT_PATH, drawWindow: [0, 0.5], stagger: 0 },\n { cx: 12, path: CENTER_PATH, drawWindow: [0.25, 0.75], stagger: 0.27 },\n { cx: 19, path: RIGHT_PATH, drawWindow: [0.5, 1], stagger: 0.54 },\n] as const;\n\nfunction MoreHorizontalIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {DOTS.map((dot) => {\n const drawn = interpolate(linearDraw, [...dot.drawWindow], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const dash = drawnPathProps(dot.path, drawn);\n const dotScale = 0.6 + 0.4 * drawn;\n const lift = acting\n ? interpolate(\n actionProgress,\n [dot.stagger, dot.stagger + 0.2, dot.stagger + 0.4],\n [0, -3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n const tx = dot.cx * (1 - dotScale);\n const ty = 12 * (1 - dotScale) + lift;\n return (\n <g\n key={dot.cx}\n transform={`translate(${tx} ${ty}) scale(${dotScale})`}\n >\n <path\n d={dot.path}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </g>\n );\n })}\n </svg>\n );\n}\n\nfunction MoreHorizontalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"5\" cy=\"12\" r=\"1\" />\n <circle cx=\"12\" cy=\"12\" r=\"1\" />\n <circle cx=\"19\" cy=\"12\" r=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype MoreHorizontalIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MoreHorizontalIconBase>;\n\nconst MoreHorizontalIconInner = forwardRef<\n HTMLDivElement,\n MoreHorizontalIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<MoreHorizontalIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MoreHorizontalIconBase\n {...(componentProps as unknown as ComponentProps<typeof MoreHorizontalIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MoreHorizontalIcon = Interactive.withSchema({\n Component: MoreHorizontalIconInner,\n componentName: \"<MoreHorizontalIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-package.json b/registry-artifacts/elements/icon-package.json
index a1391727..a48490ed 100644
--- a/registry-artifacts/elements/icon-package.json
+++ b/registry-artifacts/elements/icon-package.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Package",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-package",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH =\n \"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\";\nconst CENTER_PATH = \"M12 22V12\";\nconst EDGE_PATH = \"M7.5 4.27 16.5 9.42\";\nconst SEAM_PATH = \"M3.29 7 12 12 20.71 7\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction PackageIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const edgesDraw = interpolate(linearDraw, [0.45, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const seamDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const squashY = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.7, 1],\n [1, 0.95, 1.04, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const center = drawnPathProps(CENTER_PATH, acting ? 1 : edgesDraw);\n const edge = drawnPathProps(EDGE_PATH, acting ? 1 : edgesDraw);\n const seam = drawnPathProps(SEAM_PATH, acting ? 1 : seamDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const bodyTransform = `translate(0 ${drop + BASE_Y * (1 - squashY)}) scale(1 ${squashY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={bodyTransform}>\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_PATH}\n strokeDasharray={center.strokeDasharray}\n strokeDashoffset={center.strokeDashoffset}\n />\n <path\n d={EDGE_PATH}\n strokeDasharray={edge.strokeDasharray}\n strokeDashoffset={edge.strokeDashoffset}\n />\n <path\n d={SEAM_PATH}\n strokeDasharray={seam.strokeDasharray}\n strokeDashoffset={seam.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PackageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={CENTER_PATH} />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PackageIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PackageIconBase>;\n\nconst PackageIconInner = forwardRef<\n HTMLDivElement,\n PackageIconElementProps & { 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 ?? \"<PackageIcon>\"}\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 <PackageIconBase\n {...(componentProps as unknown as ComponentProps<typeof PackageIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PackageIcon = Interactive.withSchema({\n Component: PackageIconInner,\n componentName: \"<PackageIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BOX_PATH =\n \"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z\";\nconst CENTER_PATH = \"M12 22V12\";\nconst EDGE_PATH = \"M7.5 4.27 16.5 9.42\";\nconst SEAM_PATH = \"M3.29 7 12 12 20.71 7\";\n\nconst BASE_Y = 22;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction PackageIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const boxDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const edgesDraw = interpolate(linearDraw, [0.45, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const seamDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const drop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const squashY = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.7, 1],\n [1, 0.95, 1.04, 1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n const box = drawnPathProps(BOX_PATH, acting ? 1 : boxDraw);\n const center = drawnPathProps(CENTER_PATH, acting ? 1 : edgesDraw);\n const edge = drawnPathProps(EDGE_PATH, acting ? 1 : edgesDraw);\n const seam = drawnPathProps(SEAM_PATH, acting ? 1 : seamDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const bodyTransform = `translate(0 ${drop + BASE_Y * (1 - squashY)}) scale(1 ${squashY})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={bodyTransform}>\n <path\n d={BOX_PATH}\n strokeDasharray={box.strokeDasharray}\n strokeDashoffset={box.strokeDashoffset}\n />\n <path\n d={CENTER_PATH}\n strokeDasharray={center.strokeDasharray}\n strokeDashoffset={center.strokeDashoffset}\n />\n <path\n d={EDGE_PATH}\n strokeDasharray={edge.strokeDasharray}\n strokeDashoffset={edge.strokeDashoffset}\n />\n <path\n d={SEAM_PATH}\n strokeDasharray={seam.strokeDasharray}\n strokeDashoffset={seam.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PackageIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BOX_PATH} />\n <path d={CENTER_PATH} />\n <polyline points=\"3.29 7 12 12 20.71 7\" />\n <path d=\"m7.5 4.27 9 5.15\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PackageIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PackageIconBase>;\n\nconst PackageIconInner = forwardRef<\n HTMLDivElement,\n PackageIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PackageIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PackageIconBase\n {...(componentProps as unknown as ComponentProps<typeof PackageIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PackageIcon = Interactive.withSchema({\n Component: PackageIconInner,\n componentName: \"<PackageIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-party-popper.json b/registry-artifacts/elements/icon-party-popper.json
index c3f138f7..82835b71 100644
--- a/registry-artifacts/elements/icon-party-popper.json
+++ b/registry-artifacts/elements/icon-party-popper.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Party Popper",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-party-popper",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CONE_MAIN = \"M5.8 11.3 2 22l10.7-3.79\";\nconst CONE_CURL =\n \"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\";\n\nconst CONFETTI = [\n {\n d: \"M11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7\",\n cx: 10,\n cy: 4.5,\n dx: 0.22,\n dy: -0.98,\n },\n { d: \"M4 3h.01\", cx: 4, cy: 3, dx: -0.64, dy: -0.77 },\n { d: \"M15 2h.01\", cx: 15, cy: 2, dx: 0.65, dy: -0.76 },\n {\n d: \"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10\",\n cx: 18,\n cy: 6,\n dx: 0.95,\n dy: -0.32,\n },\n {\n d: \"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17\",\n cx: 19,\n cy: 14,\n dx: 0.89,\n dy: 0.45,\n },\n { d: \"M22 8h.01\", cx: 22, cy: 8, dx: 1, dy: -0.08 },\n { d: \"M22 20h.01\", cx: 22, cy: 20, dx: 0.76, dy: 0.65 },\n] as const;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction PartyPopperIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curlProgress = interpolate(linearDraw, [0.4, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const main = drawnPathProps(CONE_MAIN, mainProgress);\n const curl = drawnPathProps(CONE_CURL, curlProgress);\n\n const recoil = interpolate(actionProgress, [0, 0.35, 1], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${recoil} 2 22)`}>\n <path\n d={CONE_MAIN}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n <path\n d={CONE_CURL}\n strokeDasharray={curl.strokeDasharray}\n strokeDashoffset={curl.strokeDashoffset}\n />\n </g>\n {CONFETTI.map((piece, index) => {\n const pieceFrame = actionFrame - index * 2;\n const burst =\n pieceFrame <= 0\n ? 0\n : spring({\n frame: pieceFrame,\n fps,\n config: { damping: 12, stiffness: 170, mass: 0.7 },\n durationInFrames: 20,\n });\n const dist = 3 * burst;\n const opacity = interpolate(burst, [0, 0.15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <path\n key={index}\n d={piece.d}\n opacity={opacity}\n transform={`translate(${piece.dx * dist} ${piece.dy * dist}) translate(${piece.cx} ${piece.cy}) scale(${burst}) translate(${-piece.cx} ${-piece.cy})`}\n />\n );\n })}\n </svg>\n );\n}\n\nfunction PartyPopperIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CONE_MAIN} />\n <path d={CONE_CURL} />\n {CONFETTI.map((piece, index) => (\n <path key={index} d={piece.d} />\n ))}\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PartyPopperIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PartyPopperIconBase>;\n\nconst PartyPopperIconInner = forwardRef<\n HTMLDivElement,\n PartyPopperIconElementProps & { 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 ?? \"<PartyPopperIcon>\"}\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 <PartyPopperIconBase\n {...(componentProps as unknown as ComponentProps<typeof PartyPopperIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PartyPopperIcon = Interactive.withSchema({\n Component: PartyPopperIconInner,\n componentName: \"<PartyPopperIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CONE_MAIN = \"M5.8 11.3 2 22l10.7-3.79\";\nconst CONE_CURL =\n \"M11 13c1.93 1.93 2.83 4.17 2 5-.83.83-3.07-.07-5-2-1.93-1.93-2.83-4.17-2-5 .83-.83 3.07.07 5 2Z\";\n\nconst CONFETTI = [\n {\n d: \"M11 2 .33.82c.34.86-.2 1.82-1.11 1.98C9.52 4.9 9 5.52 9 6.23V7\",\n cx: 10,\n cy: 4.5,\n dx: 0.22,\n dy: -0.98,\n },\n { d: \"M4 3h.01\", cx: 4, cy: 3, dx: -0.64, dy: -0.77 },\n { d: \"M15 2h.01\", cx: 15, cy: 2, dx: 0.65, dy: -0.76 },\n {\n d: \"m22 2-2.24.75a2.9 2.9 0 0 0-1.96 3.12c.1.86-.57 1.63-1.45 1.63h-.38c-.86 0-1.6.6-1.76 1.44L14 10\",\n cx: 18,\n cy: 6,\n dx: 0.95,\n dy: -0.32,\n },\n {\n d: \"m22 13-.82-.33c-.86-.34-1.82.2-1.98 1.11c-.11.7-.72 1.22-1.43 1.22H17\",\n cx: 19,\n cy: 14,\n dx: 0.89,\n dy: 0.45,\n },\n { d: \"M22 8h.01\", cx: 22, cy: 8, dx: 1, dy: -0.08 },\n { d: \"M22 20h.01\", cx: 22, cy: 20, dx: 0.76, dy: 0.65 },\n] as const;\n\nconst TIMINGS = {\n drawDurationInFrames: 12,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction PartyPopperIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const curlProgress = interpolate(linearDraw, [0.4, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const main = drawnPathProps(CONE_MAIN, mainProgress);\n const curl = drawnPathProps(CONE_CURL, curlProgress);\n\n const recoil = interpolate(actionProgress, [0, 0.35, 1], [0, -6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${recoil} 2 22)`}>\n <path\n d={CONE_MAIN}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n <path\n d={CONE_CURL}\n strokeDasharray={curl.strokeDasharray}\n strokeDashoffset={curl.strokeDashoffset}\n />\n </g>\n {CONFETTI.map((piece, index) => {\n const pieceFrame = actionFrame - index * 2;\n const burst =\n pieceFrame <= 0\n ? 0\n : spring({\n frame: pieceFrame,\n fps,\n config: { damping: 12, stiffness: 170, mass: 0.7 },\n durationInFrames: 20,\n });\n const dist = 3 * burst;\n const opacity = interpolate(burst, [0, 0.15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <path\n key={index}\n d={piece.d}\n opacity={opacity}\n transform={`translate(${piece.dx * dist} ${piece.dy * dist}) translate(${piece.cx} ${piece.cy}) scale(${burst}) translate(${-piece.cx} ${-piece.cy})`}\n />\n );\n })}\n </svg>\n );\n}\n\nfunction PartyPopperIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={CONE_MAIN} />\n <path d={CONE_CURL} />\n {CONFETTI.map((piece, index) => (\n <path key={index} d={piece.d} />\n ))}\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PartyPopperIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PartyPopperIconBase>;\n\nconst PartyPopperIconInner = forwardRef<\n HTMLDivElement,\n PartyPopperIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PartyPopperIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PartyPopperIconBase\n {...(componentProps as unknown as ComponentProps<typeof PartyPopperIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PartyPopperIcon = Interactive.withSchema({\n Component: PartyPopperIconInner,\n componentName: \"<PartyPopperIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-pause.json b/registry-artifacts/elements/icon-pause.json
index 370167d0..c63fbffe 100644
--- a/registry-artifacts/elements/icon-pause.json
+++ b/registry-artifacts/elements/icon-pause.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Pause",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-pause",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M6 21A1 1 0 0 1 5 20V4A1 1 0 0 1 6 3H9A1 1 0 0 1 10 4V20A1 1 0 0 1 9 21H6Z\";\nconst RIGHT_PATH =\n \"M18 21A1 1 0 0 0 19 20V4A1 1 0 0 0 18 3H15A1 1 0 0 0 14 4V20A1 1 0 0 0 15 21H18Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction PauseIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const leftProgress = interpolate(linearDraw, [0, 0.88], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightProgress = interpolate(linearDraw, [0.12, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const left = drawnPathProps(LEFT_PATH, leftProgress);\n const right = drawnPathProps(RIGHT_PATH, rightProgress);\n\n const pinch = interpolate(actionProgress, [0, 0.45, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const squash = interpolate(actionProgress, [0, 0.45, 1], [1, 0.94, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scaleX(${scale}) scaleY(${scale * squash})`,\n }}\n >\n <g transform={`translate(${pinch} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pinch} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PauseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PauseIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PauseIconBase>;\n\nconst PauseIconInner = forwardRef<\n HTMLDivElement,\n PauseIconElementProps & { 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 ?? \"<PauseIcon>\"}\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 <PauseIconBase\n {...(componentProps as unknown as ComponentProps<typeof PauseIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PauseIcon = Interactive.withSchema({\n Component: PauseIconInner,\n componentName: \"<PauseIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_PATH =\n \"M6 21A1 1 0 0 1 5 20V4A1 1 0 0 1 6 3H9A1 1 0 0 1 10 4V20A1 1 0 0 1 9 21H6Z\";\nconst RIGHT_PATH =\n \"M18 21A1 1 0 0 0 19 20V4A1 1 0 0 0 18 3H15A1 1 0 0 0 14 4V20A1 1 0 0 0 15 21H18Z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction PauseIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const leftProgress = interpolate(linearDraw, [0, 0.88], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightProgress = interpolate(linearDraw, [0.12, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const left = drawnPathProps(LEFT_PATH, leftProgress);\n const right = drawnPathProps(RIGHT_PATH, rightProgress);\n\n const pinch = interpolate(actionProgress, [0, 0.45, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const squash = interpolate(actionProgress, [0, 0.45, 1], [1, 0.94, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scaleX(${scale}) scaleY(${scale * squash})`,\n }}\n >\n <g transform={`translate(${pinch} 0)`}>\n <path\n d={LEFT_PATH}\n strokeDasharray={left.strokeDasharray}\n strokeDashoffset={left.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${-pinch} 0)`}>\n <path\n d={RIGHT_PATH}\n strokeDasharray={right.strokeDasharray}\n strokeDashoffset={right.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PauseIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect x=\"14\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n <rect x=\"5\" y=\"3\" width=\"5\" height=\"18\" rx=\"1\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PauseIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PauseIconBase>;\n\nconst PauseIconInner = forwardRef<\n HTMLDivElement,\n PauseIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PauseIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PauseIconBase\n {...(componentProps as unknown as ComponentProps<typeof PauseIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PauseIcon = Interactive.withSchema({\n Component: PauseIconInner,\n componentName: \"<PauseIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-pencil.json b/registry-artifacts/elements/icon-pencil.json
index 2f1318b6..12d3d787 100644
--- a/registry-artifacts/elements/icon-pencil.json
+++ b/registry-artifacts/elements/icon-pencil.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Pencil",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-pencil",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\";\nconst TIP_PATH = \"M15 5 19 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction PencilIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const tipDraw = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -6, 4, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const nudge = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, 1, -0.5, 0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const tip = drawnPathProps(TIP_PATH, tipDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 3 21) translate(${nudge} 0)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={TIP_PATH}\n strokeDasharray={tip.strokeDasharray}\n strokeDashoffset={tip.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PencilIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={TIP_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PencilIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PencilIconBase>;\n\nconst PencilIconInner = forwardRef<\n HTMLDivElement,\n PencilIconElementProps & { 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 ?? \"<PencilIcon>\"}\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 <PencilIconBase\n {...(componentProps as unknown as ComponentProps<typeof PencilIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PencilIcon = Interactive.withSchema({\n Component: PencilIconInner,\n componentName: \"<PencilIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z\";\nconst TIP_PATH = \"M15 5 19 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction PencilIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const tipDraw = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const rotate = acting\n ? interpolate(actionProgress, [0, 0.25, 0.5, 0.75, 1], [0, -6, 4, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const nudge = acting\n ? interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, 1, -0.5, 0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const tip = drawnPathProps(TIP_PATH, tipDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 3 21) translate(${nudge} 0)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={TIP_PATH}\n strokeDasharray={tip.strokeDasharray}\n strokeDashoffset={tip.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PencilIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BODY_PATH} />\n <path d={TIP_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PencilIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PencilIconBase>;\n\nconst PencilIconInner = forwardRef<\n HTMLDivElement,\n PencilIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PencilIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PencilIconBase\n {...(componentProps as unknown as ComponentProps<typeof PencilIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PencilIcon = Interactive.withSchema({\n Component: PencilIconInner,\n componentName: \"<PencilIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-phone.json b/registry-artifacts/elements/icon-phone.json
index 0b704ed7..922044e2 100644
--- a/registry-artifacts/elements/icon-phone.json
+++ b/registry-artifacts/elements/icon-phone.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Phone",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-phone",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PHONE_PATH =\n \"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction PhoneIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ring = acting\n ? interpolate(\n actionProgress,\n [0, 0.18, 0.4, 0.62, 0.82, 1],\n [0, 10, -8, 5, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const phone = drawnPathProps(PHONE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} ${CENTER} ${CENTER})`}>\n <path\n d={PHONE_PATH}\n strokeDasharray={phone.strokeDasharray}\n strokeDashoffset={phone.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PhoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PHONE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PhoneIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PhoneIconBase>;\n\nconst PhoneIconInner = forwardRef<\n HTMLDivElement,\n PhoneIconElementProps & { 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 ?? \"<PhoneIcon>\"}\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 <PhoneIconBase\n {...(componentProps as unknown as ComponentProps<typeof PhoneIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PhoneIcon = Interactive.withSchema({\n Component: PhoneIconInner,\n componentName: \"<PhoneIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PHONE_PATH =\n \"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 28,\n loop: false,\n} as const;\n\nfunction PhoneIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const ring = acting\n ? interpolate(\n actionProgress,\n [0, 0.18, 0.4, 0.62, 0.82, 1],\n [0, 10, -8, 5, -2, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const phone = drawnPathProps(PHONE_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${ring} ${CENTER} ${CENTER})`}>\n <path\n d={PHONE_PATH}\n strokeDasharray={phone.strokeDasharray}\n strokeDashoffset={phone.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction PhoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PHONE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PhoneIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PhoneIconBase>;\n\nconst PhoneIconInner = forwardRef<\n HTMLDivElement,\n PhoneIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PhoneIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PhoneIconBase\n {...(componentProps as unknown as ComponentProps<typeof PhoneIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PhoneIcon = Interactive.withSchema({\n Component: PhoneIconInner,\n componentName: \"<PhoneIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-play.json b/registry-artifacts/elements/icon-play.json
index 3e91af50..562167cf 100644
--- a/registry-artifacts/elements/icon-play.json
+++ b/registry-artifacts/elements/icon-play.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Play",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-play",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLAY_PATH =\n \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction PlayIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(PLAY_PATH, drawProgress);\n const press = interpolate(\n actionProgress,\n [0, 0.33, 0.66, 1],\n [1, 0.92, 1.1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const nudge = interpolate(actionProgress, [0.33, 0.66, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * press;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={PLAY_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlayIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLAY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlayIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PlayIconBase>;\n\nconst PlayIconInner = forwardRef<\n HTMLDivElement,\n PlayIconElementProps & { 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 ?? \"<PlayIcon>\"}\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 <PlayIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlayIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PlayIcon = Interactive.withSchema({\n Component: PlayIconInner,\n componentName: \"<PlayIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLAY_PATH =\n \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction PlayIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const dash = drawnPathProps(PLAY_PATH, drawProgress);\n const press = interpolate(\n actionProgress,\n [0, 0.33, 0.66, 1],\n [1, 0.92, 1.1, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const nudge = interpolate(actionProgress, [0.33, 0.66, 1], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * press;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${nudge}px) scale(${scale})`,\n }}\n >\n <path\n d={PLAY_PATH}\n strokeDasharray={dash.strokeDasharray}\n strokeDashoffset={dash.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlayIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLAY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlayIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PlayIconBase>;\n\nconst PlayIconInner = forwardRef<\n HTMLDivElement,\n PlayIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PlayIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PlayIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlayIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PlayIcon = Interactive.withSchema({\n Component: PlayIconInner,\n componentName: \"<PlayIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-plus-circle.json b/registry-artifacts/elements/icon-plus-circle.json
index a425de12..82925bae 100644
--- a/registry-artifacts/elements/icon-plus-circle.json
+++ b/registry-artifacts/elements/icon-plus-circle.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Plus Circle",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-plus-circle",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst H_PATH = \"M8 12h8\";\nconst V_PATH = \"M12 8v8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction PlusCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const hDraw = interpolate(actionProgress, [0.1, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vDraw = interpolate(actionProgress, [0.25, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const hProgress = animation === \"draw\" ? 1 : acting ? hDraw : 0;\n const vProgress = animation === \"draw\" ? 1 : acting ? vDraw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const h = drawnPathProps(H_PATH, hProgress);\n const v = drawnPathProps(V_PATH, vProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={H_PATH}\n strokeDasharray={h.strokeDasharray}\n strokeDashoffset={h.strokeDashoffset}\n />\n <path\n d={V_PATH}\n strokeDasharray={v.strokeDasharray}\n strokeDashoffset={v.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={H_PATH} />\n <path d={V_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlusCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PlusCircleIconBase>;\n\nconst PlusCircleIconInner = forwardRef<\n HTMLDivElement,\n PlusCircleIconElementProps & { 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 ?? \"<PlusCircleIcon>\"}\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 <PlusCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlusCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PlusCircleIcon = Interactive.withSchema({\n Component: PlusCircleIconInner,\n componentName: \"<PlusCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst H_PATH = \"M8 12h8\";\nconst V_PATH = \"M12 8v8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction PlusCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const hDraw = interpolate(actionProgress, [0.1, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const vDraw = interpolate(actionProgress, [0.25, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const pop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.06, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const hProgress = animation === \"draw\" ? 1 : acting ? hDraw : 0;\n const vProgress = animation === \"draw\" ? 1 : acting ? vDraw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const h = drawnPathProps(H_PATH, hProgress);\n const v = drawnPathProps(V_PATH, vProgress);\n\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={H_PATH}\n strokeDasharray={h.strokeDasharray}\n strokeDashoffset={h.strokeDashoffset}\n />\n <path\n d={V_PATH}\n strokeDasharray={v.strokeDasharray}\n strokeDashoffset={v.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={H_PATH} />\n <path d={V_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlusCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PlusCircleIconBase>;\n\nconst PlusCircleIconInner = forwardRef<\n HTMLDivElement,\n PlusCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PlusCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PlusCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlusCircleIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PlusCircleIcon = Interactive.withSchema({\n Component: PlusCircleIconInner,\n componentName: \"<PlusCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-plus.json b/registry-artifacts/elements/icon-plus.json
index 90dc4c09..3dfe9f03 100644
--- a/registry-artifacts/elements/icon-plus.json
+++ b/registry-artifacts/elements/icon-plus.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Plus",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-plus",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HORIZONTAL_PATH = \"M5 12h14\";\nconst VERTICAL_PATH = \"M12 5v14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction PlusIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const horizontalProgress = interpolate(linearDraw, [0, 0.571], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const verticalProgress = interpolate(linearDraw, [0.286, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const horizontal = drawnPathProps(HORIZONTAL_PATH, horizontalProgress);\n const vertical = drawnPathProps(VERTICAL_PATH, verticalProgress);\n\n const rotate =\n 90 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 130, mass: 0.8 },\n durationInFrames: 16,\n });\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.15 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={HORIZONTAL_PATH}\n strokeDasharray={horizontal.strokeDasharray}\n strokeDashoffset={horizontal.strokeDashoffset}\n />\n <path\n d={VERTICAL_PATH}\n strokeDasharray={vertical.strokeDasharray}\n strokeDashoffset={vertical.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HORIZONTAL_PATH} />\n <path d={VERTICAL_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlusIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PlusIconBase>;\n\nconst PlusIconInner = forwardRef<\n HTMLDivElement,\n PlusIconElementProps & { 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 ?? \"<PlusIcon>\"}\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 <PlusIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlusIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PlusIcon = Interactive.withSchema({\n Component: PlusIconInner,\n componentName: \"<PlusIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HORIZONTAL_PATH = \"M5 12h14\";\nconst VERTICAL_PATH = \"M12 5v14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 16,\n loop: false,\n} as const;\n\nfunction PlusIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const horizontalProgress = interpolate(linearDraw, [0, 0.571], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const verticalProgress = interpolate(linearDraw, [0.286, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const horizontal = drawnPathProps(HORIZONTAL_PATH, horizontalProgress);\n const vertical = drawnPathProps(VERTICAL_PATH, verticalProgress);\n\n const rotate =\n 90 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 130, mass: 0.8 },\n durationInFrames: 16,\n });\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.15 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={HORIZONTAL_PATH}\n strokeDasharray={horizontal.strokeDasharray}\n strokeDashoffset={horizontal.strokeDashoffset}\n />\n <path\n d={VERTICAL_PATH}\n strokeDasharray={vertical.strokeDasharray}\n strokeDashoffset={vertical.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction PlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HORIZONTAL_PATH} />\n <path d={VERTICAL_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype PlusIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PlusIconBase>;\n\nconst PlusIconInner = forwardRef<\n HTMLDivElement,\n PlusIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<PlusIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PlusIconBase\n {...(componentProps as unknown as ComponentProps<typeof PlusIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PlusIcon = Interactive.withSchema({\n Component: PlusIconInner,\n componentName: \"<PlusIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-refresh-cw.json b/registry-artifacts/elements/icon-refresh-cw.json
index 9582e114..5b4685cd 100644
--- a/registry-artifacts/elements/icon-refresh-cw.json
+++ b/registry-artifacts/elements/icon-refresh-cw.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Refresh Cw",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-refresh-cw",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_TOP = \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\";\nconst ARROW_TOP = \"M21 3v5h-5\";\nconst ARC_BOTTOM = \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\";\nconst ARROW_BOTTOM = \"M8 16H3v5\";\n\nconst SPIN_EASE = Easing.bezier(0.45, 0, 0.25, 1);\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 55,\n loop: true,\n} as const;\n\nfunction RefreshCwIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowTopPop = interpolate(linearDraw, [0.6, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const arrowBottomPop = interpolate(linearDraw, [0.76, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const arcTop = drawnPathProps(ARC_TOP, arcProgress);\n const arcBottom = drawnPathProps(ARC_BOTTOM, arcProgress);\n\n const resolvedLoop = loop ?? TIMINGS.loop;\n const rotate = resolvedLoop\n ? cycleIndex * 360 +\n interpolate(actionFrame, [0, 44], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: SPIN_EASE,\n })\n : 360 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 44,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={ARC_TOP}\n strokeDasharray={arcTop.strokeDasharray}\n strokeDashoffset={arcTop.strokeDashoffset}\n />\n <path\n d={ARC_BOTTOM}\n strokeDasharray={arcBottom.strokeDasharray}\n strokeDashoffset={arcBottom.strokeDashoffset}\n />\n <g transform={`translate(21 8) scale(${arrowTopPop}) translate(-21 -8)`}>\n <path d={ARROW_TOP} />\n </g>\n <g\n transform={`translate(3 16) scale(${arrowBottomPop}) translate(-3 -16)`}\n >\n <path d={ARROW_BOTTOM} />\n </g>\n </svg>\n );\n}\n\nfunction RefreshCwIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_TOP} />\n <path d={ARROW_TOP} />\n <path d={ARC_BOTTOM} />\n <path d={ARROW_BOTTOM} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype RefreshCwIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RefreshCwIconBase>;\n\nconst RefreshCwIconInner = forwardRef<\n HTMLDivElement,\n RefreshCwIconElementProps & { 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 ?? \"<RefreshCwIcon>\"}\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 <RefreshCwIconBase\n {...(componentProps as unknown as ComponentProps<typeof RefreshCwIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RefreshCwIcon = Interactive.withSchema({\n Component: RefreshCwIconInner,\n componentName: \"<RefreshCwIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ARC_TOP = \"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8\";\nconst ARROW_TOP = \"M21 3v5h-5\";\nconst ARC_BOTTOM = \"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16\";\nconst ARROW_BOTTOM = \"M8 16H3v5\";\n\nconst SPIN_EASE = Easing.bezier(0.45, 0, 0.25, 1);\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 55,\n loop: true,\n} as const;\n\nfunction RefreshCwIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, cycleIndex } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const arcProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowTopPop = interpolate(linearDraw, [0.6, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const arrowBottomPop = interpolate(linearDraw, [0.76, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const arcTop = drawnPathProps(ARC_TOP, arcProgress);\n const arcBottom = drawnPathProps(ARC_BOTTOM, arcProgress);\n\n const resolvedLoop = loop ?? TIMINGS.loop;\n const rotate = resolvedLoop\n ? cycleIndex * 360 +\n interpolate(actionFrame, [0, 44], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: SPIN_EASE,\n })\n : 360 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 44,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={ARC_TOP}\n strokeDasharray={arcTop.strokeDasharray}\n strokeDashoffset={arcTop.strokeDashoffset}\n />\n <path\n d={ARC_BOTTOM}\n strokeDasharray={arcBottom.strokeDasharray}\n strokeDashoffset={arcBottom.strokeDashoffset}\n />\n <g transform={`translate(21 8) scale(${arrowTopPop}) translate(-21 -8)`}>\n <path d={ARROW_TOP} />\n </g>\n <g\n transform={`translate(3 16) scale(${arrowBottomPop}) translate(-3 -16)`}\n >\n <path d={ARROW_BOTTOM} />\n </g>\n </svg>\n );\n}\n\nfunction RefreshCwIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ARC_TOP} />\n <path d={ARROW_TOP} />\n <path d={ARC_BOTTOM} />\n <path d={ARROW_BOTTOM} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype RefreshCwIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof RefreshCwIconBase>;\n\nconst RefreshCwIconInner = forwardRef<\n HTMLDivElement,\n RefreshCwIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<RefreshCwIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <RefreshCwIconBase\n {...(componentProps as unknown as ComponentProps<typeof RefreshCwIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const RefreshCwIcon = Interactive.withSchema({\n Component: RefreshCwIconInner,\n componentName: \"<RefreshCwIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-rocket.json b/registry-artifacts/elements/icon-rocket.json
index ccf5ffa4..6f436afe 100644
--- a/registry-artifacts/elements/icon-rocket.json
+++ b/registry-artifacts/elements/icon-rocket.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Rocket",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-rocket",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\";\nconst FIN_RIGHT_PATH = \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\";\nconst FIN_LEFT_PATH = \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\";\nconst FLAME_PATH =\n \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction RocketIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const finsDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flameDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const flicker = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 1.2, 1, 1.18, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const finRight = drawnPathProps(FIN_RIGHT_PATH, acting ? 1 : finsDraw);\n const finLeft = drawnPathProps(FIN_LEFT_PATH, acting ? 1 : finsDraw);\n const flame = drawnPathProps(FLAME_PATH, acting ? 1 : flameDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const flameTransform = `translate(${4.5 * (1 - flicker)} ${18 * (1 - flicker)}) scale(${flicker})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${rise}) rotate(${tilt} 8 20)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FIN_RIGHT_PATH}\n strokeDasharray={finRight.strokeDasharray}\n strokeDashoffset={finRight.strokeDashoffset}\n />\n <path\n d={FIN_LEFT_PATH}\n strokeDasharray={finLeft.strokeDasharray}\n strokeDashoffset={finLeft.strokeDashoffset}\n />\n <g transform={flameTransform}>\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction RocketIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype RocketIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RocketIconBase>;\n\nconst RocketIconInner = forwardRef<\n HTMLDivElement,\n RocketIconElementProps & { 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 ?? \"<RocketIcon>\"}\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 <RocketIconBase\n {...(componentProps as unknown as ComponentProps<typeof RocketIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RocketIcon = Interactive.withSchema({\n Component: RocketIconInner,\n componentName: \"<RocketIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\";\nconst FIN_RIGHT_PATH = \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\";\nconst FIN_LEFT_PATH = \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\";\nconst FLAME_PATH =\n \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction RocketIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.67], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const finsDraw = interpolate(linearDraw, [0.44, 0.89], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flameDraw = interpolate(linearDraw, [0.67, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const flicker = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.4, 0.6, 0.8],\n [1, 1.2, 1, 1.18, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const finRight = drawnPathProps(FIN_RIGHT_PATH, acting ? 1 : finsDraw);\n const finLeft = drawnPathProps(FIN_LEFT_PATH, acting ? 1 : finsDraw);\n const flame = drawnPathProps(FLAME_PATH, acting ? 1 : flameDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const flameTransform = `translate(${4.5 * (1 - flicker)} ${18 * (1 - flicker)}) scale(${flicker})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${rise}) rotate(${tilt} 8 20)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FIN_RIGHT_PATH}\n strokeDasharray={finRight.strokeDasharray}\n strokeDashoffset={finRight.strokeDashoffset}\n />\n <path\n d={FIN_LEFT_PATH}\n strokeDasharray={finLeft.strokeDasharray}\n strokeDashoffset={finLeft.strokeDashoffset}\n />\n <g transform={flameTransform}>\n <path\n d={FLAME_PATH}\n strokeDasharray={flame.strokeDasharray}\n strokeDashoffset={flame.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction RocketIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" />\n <path d=\"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09\" />\n <path d=\"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z\" />\n <path d=\"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype RocketIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof RocketIconBase>;\n\nconst RocketIconInner = forwardRef<\n HTMLDivElement,\n RocketIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<RocketIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <RocketIconBase\n {...(componentProps as unknown as ComponentProps<typeof RocketIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const RocketIcon = Interactive.withSchema({\n Component: RocketIconInner,\n componentName: \"<RocketIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-save.json b/registry-artifacts/elements/icon-save.json
index ed33c800..d9eaf21d 100644
--- a/registry-artifacts/elements/icon-save.json
+++ b/registry-artifacts/elements/icon-save.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Save",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-save",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISK_PATH =\n \"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\";\nconst LABEL_PATH = \"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\";\nconst SLOT_PATH = \"M7 3v4a1 1 0 0 0 1 1h7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction SaveIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const diskDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const labelDraw = interpolate(linearDraw, [0.444, 0.889], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slotDraw = interpolate(linearDraw, [0.667, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const slotProgress = acting\n ? interpolate(actionProgress, [0.25, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : slotDraw;\n\n const squash = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [1, 0.92, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [0, -1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disk = drawnPathProps(DISK_PATH, diskDraw);\n const label = drawnPathProps(LABEL_PATH, labelDraw);\n const slot = drawnPathProps(SLOT_PATH, slotProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale}) scaleY(${squash})`,\n }}\n >\n <path\n d={DISK_PATH}\n strokeDasharray={disk.strokeDasharray}\n strokeDashoffset={disk.strokeDashoffset}\n />\n <path\n d={LABEL_PATH}\n strokeDasharray={label.strokeDasharray}\n strokeDashoffset={label.strokeDashoffset}\n />\n <path\n d={SLOT_PATH}\n strokeDasharray={slot.strokeDasharray}\n strokeDashoffset={slot.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SaveIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DISK_PATH} />\n <path d={LABEL_PATH} />\n <path d={SLOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SaveIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SaveIconBase>;\n\nconst SaveIconInner = forwardRef<\n HTMLDivElement,\n SaveIconElementProps & { 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 ?? \"<SaveIcon>\"}\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 <SaveIconBase\n {...(componentProps as unknown as ComponentProps<typeof SaveIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SaveIcon = Interactive.withSchema({\n Component: SaveIconInner,\n componentName: \"<SaveIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DISK_PATH =\n \"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z\";\nconst LABEL_PATH = \"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7\";\nconst SLOT_PATH = \"M7 3v4a1 1 0 0 0 1 1h7\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction SaveIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const diskDraw = interpolate(linearDraw, [0, 0.667], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const labelDraw = interpolate(linearDraw, [0.444, 0.889], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slotDraw = interpolate(linearDraw, [0.667, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const slotProgress = acting\n ? interpolate(actionProgress, [0.25, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : slotDraw;\n\n const squash = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [1, 0.92, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const dip = acting\n ? interpolate(actionProgress, [0, 0.3, 0.6], [0, -1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const disk = drawnPathProps(DISK_PATH, diskDraw);\n const label = drawnPathProps(LABEL_PATH, labelDraw);\n const slot = drawnPathProps(SLOT_PATH, slotProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateY(${dip}px) scale(${scale}) scaleY(${squash})`,\n }}\n >\n <path\n d={DISK_PATH}\n strokeDasharray={disk.strokeDasharray}\n strokeDashoffset={disk.strokeDashoffset}\n />\n <path\n d={LABEL_PATH}\n strokeDasharray={label.strokeDasharray}\n strokeDashoffset={label.strokeDashoffset}\n />\n <path\n d={SLOT_PATH}\n strokeDasharray={slot.strokeDasharray}\n strokeDashoffset={slot.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SaveIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={DISK_PATH} />\n <path d={LABEL_PATH} />\n <path d={SLOT_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SaveIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SaveIconBase>;\n\nconst SaveIconInner = forwardRef<\n HTMLDivElement,\n SaveIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SaveIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SaveIconBase\n {...(componentProps as unknown as ComponentProps<typeof SaveIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SaveIcon = Interactive.withSchema({\n Component: SaveIconInner,\n componentName: \"<SaveIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-search.json b/registry-artifacts/elements/icon-search.json
index 9d091e55..7b056fa7 100644
--- a/registry-artifacts/elements/icon-search.json
+++ b/registry-artifacts/elements/icon-search.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Search",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-search",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M11 3 A8 8 0 0 1 19 11 A8 8 0 0 1 11 19 A8 8 0 0 1 3 11 A8 8 0 0 1 11 3\";\nconst HANDLE_DRAW = \"M16.66 16.66 21 21\";\nconst HANDLE_STATIC = \"m21 21-4.34-4.34\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: false,\n} as const;\n\nfunction SearchIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const handleProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const handle = drawnPathProps(HANDLE_DRAW, handleProgress);\n\n const scanEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scanX = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -3, 3, -1, 0],\n scanEase,\n );\n const scanY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, -1, 2, 0],\n scanEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${scanX} ${scanY})`}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={HANDLE_DRAW}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SearchIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d={HANDLE_STATIC} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SearchIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SearchIconBase>;\n\nconst SearchIconInner = forwardRef<\n HTMLDivElement,\n SearchIconElementProps & { 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 ?? \"<SearchIcon>\"}\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 <SearchIconBase\n {...(componentProps as unknown as ComponentProps<typeof SearchIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SearchIcon = Interactive.withSchema({\n Component: SearchIconInner,\n componentName: \"<SearchIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CIRCLE_PATH =\n \"M11 3 A8 8 0 0 1 19 11 A8 8 0 0 1 11 19 A8 8 0 0 1 3 11 A8 8 0 0 1 11 3\";\nconst HANDLE_DRAW = \"M16.66 16.66 21 21\";\nconst HANDLE_STATIC = \"m21 21-4.34-4.34\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 40,\n loop: false,\n} as const;\n\nfunction SearchIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const circleProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const handleProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n const handle = drawnPathProps(HANDLE_DRAW, handleProgress);\n\n const scanEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n } as const;\n const scanX = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -3, 3, -1, 0],\n scanEase,\n );\n const scanY = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -2, -1, 2, 0],\n scanEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${scanX} ${scanY})`}>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n <path\n d={HANDLE_DRAW}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SearchIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"11\" cy=\"11\" r=\"8\" />\n <path d={HANDLE_STATIC} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SearchIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SearchIconBase>;\n\nconst SearchIconInner = forwardRef<\n HTMLDivElement,\n SearchIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SearchIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SearchIconBase\n {...(componentProps as unknown as ComponentProps<typeof SearchIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SearchIcon = Interactive.withSchema({\n Component: SearchIconInner,\n componentName: \"<SearchIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-send.json b/registry-artifacts/elements/icon-send.json
index 6ee6ecdb..52b457b3 100644
--- a/registry-artifacts/elements/icon-send.json
+++ b/registry-artifacts/elements/icon-send.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Send",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-send",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLANE_PATH =\n \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\";\nconst FOLD_PATH = \"m21.854 2.147-10.94 10.939\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction SendIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const planeProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const foldProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const plane = drawnPathProps(PLANE_PATH, planeProgress);\n const fold = drawnPathProps(FOLD_PATH, foldProgress);\n\n const dartEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const tx = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, -1.5, 5, 0],\n dartEase,\n );\n const ty = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 1, -4, 0],\n dartEase,\n );\n const rot = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 2, -12, 0],\n dartEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${tx} ${ty}) rotate(${rot} 12 12)`}>\n <path\n d={PLANE_PATH}\n strokeDasharray={plane.strokeDasharray}\n strokeDashoffset={plane.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SendIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLANE_PATH} />\n <path d={FOLD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SendIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SendIconBase>;\n\nconst SendIconInner = forwardRef<\n HTMLDivElement,\n SendIconElementProps & { 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 ?? \"<SendIcon>\"}\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 <SendIconBase\n {...(componentProps as unknown as ComponentProps<typeof SendIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SendIcon = Interactive.withSchema({\n Component: SendIconInner,\n componentName: \"<SendIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst PLANE_PATH =\n \"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\";\nconst FOLD_PATH = \"m21.854 2.147-10.94 10.939\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction SendIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const planeProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const foldProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const plane = drawnPathProps(PLANE_PATH, planeProgress);\n const fold = drawnPathProps(FOLD_PATH, foldProgress);\n\n const dartEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const tx = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, -1.5, 5, 0],\n dartEase,\n );\n const ty = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 1, -4, 0],\n dartEase,\n );\n const rot = interpolate(\n actionProgress,\n [0, 0.18, 0.5, 1],\n [0, 2, -12, 0],\n dartEase,\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${tx} ${ty}) rotate(${rot} 12 12)`}>\n <path\n d={PLANE_PATH}\n strokeDasharray={plane.strokeDasharray}\n strokeDashoffset={plane.strokeDashoffset}\n />\n <path\n d={FOLD_PATH}\n strokeDasharray={fold.strokeDasharray}\n strokeDashoffset={fold.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SendIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={PLANE_PATH} />\n <path d={FOLD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SendIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SendIconBase>;\n\nconst SendIconInner = forwardRef<\n HTMLDivElement,\n SendIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SendIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SendIconBase\n {...(componentProps as unknown as ComponentProps<typeof SendIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SendIcon = Interactive.withSchema({\n Component: SendIconInner,\n componentName: \"<SendIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-settings.json b/registry-artifacts/elements/icon-settings.json
index 0bf64493..1d2d1819 100644
--- a/registry-artifacts/elements/icon-settings.json
+++ b/registry-artifacts/elements/icon-settings.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Settings",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-settings",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst GEAR_PATH =\n \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\";\nconst CIRCLE_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction SettingsIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const gearProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const circleProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const gear = drawnPathProps(GEAR_PATH, gearProgress);\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n\n const gearRotate =\n 60 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 26,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${gearRotate} 12 12)`}>\n <path\n d={GEAR_PATH}\n strokeDasharray={gear.strokeDasharray}\n strokeDashoffset={gear.strokeDashoffset}\n />\n </g>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SettingsIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={GEAR_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SettingsIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SettingsIconBase>;\n\nconst SettingsIconInner = forwardRef<\n HTMLDivElement,\n SettingsIconElementProps & { 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 ?? \"<SettingsIcon>\"}\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 <SettingsIconBase\n {...(componentProps as unknown as ComponentProps<typeof SettingsIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SettingsIcon = Interactive.withSchema({\n Component: SettingsIconInner,\n componentName: \"<SettingsIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst GEAR_PATH =\n \"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915\";\nconst CIRCLE_PATH =\n \"M12 9 A3 3 0 0 1 15 12 A3 3 0 0 1 12 15 A3 3 0 0 1 9 12 A3 3 0 0 1 12 9\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction SettingsIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const gearProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const circleProgress = interpolate(linearDraw, [0.625, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const gear = drawnPathProps(GEAR_PATH, gearProgress);\n const circle = drawnPathProps(CIRCLE_PATH, circleProgress);\n\n const gearRotate =\n 60 *\n spring({\n frame: actionFrame,\n fps,\n config: { damping: 14, stiffness: 120, mass: 0.9 },\n durationInFrames: 26,\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${gearRotate} 12 12)`}>\n <path\n d={GEAR_PATH}\n strokeDasharray={gear.strokeDasharray}\n strokeDashoffset={gear.strokeDashoffset}\n />\n </g>\n <path\n d={CIRCLE_PATH}\n strokeDasharray={circle.strokeDasharray}\n strokeDashoffset={circle.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction SettingsIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={GEAR_PATH} />\n <circle cx=\"12\" cy=\"12\" r=\"3\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SettingsIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SettingsIconBase>;\n\nconst SettingsIconInner = forwardRef<\n HTMLDivElement,\n SettingsIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SettingsIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SettingsIconBase\n {...(componentProps as unknown as ComponentProps<typeof SettingsIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SettingsIcon = Interactive.withSchema({\n Component: SettingsIconInner,\n componentName: \"<SettingsIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-share-2.json b/registry-artifacts/elements/icon-share-2.json
index bd0a13fc..e316a9a6 100644
--- a/registry-artifacts/elements/icon-share-2.json
+++ b/registry-artifacts/elements/icon-share-2.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Share 2",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-share-2",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_NODE_PATH =\n \"M6 9 A3 3 0 0 1 9 12 A3 3 0 0 1 6 15 A3 3 0 0 1 3 12 A3 3 0 0 1 6 9\";\nconst TOP_NODE_PATH =\n \"M18 2 A3 3 0 0 1 21 5 A3 3 0 0 1 18 8 A3 3 0 0 1 15 5 A3 3 0 0 1 18 2\";\nconst BOTTOM_NODE_PATH =\n \"M18 16 A3 3 0 0 1 21 19 A3 3 0 0 1 18 22 A3 3 0 0 1 15 19 A3 3 0 0 1 18 16\";\nconst TOP_LINE_PATH = \"M8.59 10.49 15.41 6.51\";\nconst BOTTOM_LINE_PATH = \"M8.59 13.51 15.42 17.49\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction Share2IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const leftNodeDraw = interpolate(linearDraw, [0, 0.44], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const connectorDraw = interpolate(linearDraw, [0.33, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightNodeDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const topLineProgress = acting\n ? interpolate(actionProgress, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n const bottomLineProgress = acting\n ? interpolate(actionProgress, [0.15, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n\n const topPop = acting\n ? interpolate(actionProgress, [0.3, 0.45, 0.65], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bottomPop = acting\n ? interpolate(actionProgress, [0.45, 0.6, 0.8], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const leftNode = drawnPathProps(LEFT_NODE_PATH, leftNodeDraw);\n const topLine = drawnPathProps(TOP_LINE_PATH, topLineProgress);\n const bottomLine = drawnPathProps(BOTTOM_LINE_PATH, bottomLineProgress);\n const topNode = drawnPathProps(TOP_NODE_PATH, rightNodeDraw);\n const bottomNode = drawnPathProps(BOTTOM_NODE_PATH, rightNodeDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const topTransform = `translate(${18 * (1 - topPop)} ${5 * (1 - topPop)}) scale(${topPop})`;\n const bottomTransform = `translate(${18 * (1 - bottomPop)} ${19 * (1 - bottomPop)}) scale(${bottomPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={LEFT_NODE_PATH}\n strokeDasharray={leftNode.strokeDasharray}\n strokeDashoffset={leftNode.strokeDashoffset}\n />\n <path\n d={TOP_LINE_PATH}\n strokeDasharray={topLine.strokeDasharray}\n strokeDashoffset={topLine.strokeDashoffset}\n />\n <path\n d={BOTTOM_LINE_PATH}\n strokeDasharray={bottomLine.strokeDasharray}\n strokeDashoffset={bottomLine.strokeDashoffset}\n />\n <g transform={topTransform}>\n <path\n d={TOP_NODE_PATH}\n strokeDasharray={topNode.strokeDasharray}\n strokeDashoffset={topNode.strokeDashoffset}\n />\n </g>\n <g transform={bottomTransform}>\n <path\n d={BOTTOM_NODE_PATH}\n strokeDasharray={bottomNode.strokeDasharray}\n strokeDashoffset={bottomNode.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Share2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype Share2IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof Share2IconBase>;\n\nconst Share2IconInner = forwardRef<\n HTMLDivElement,\n Share2IconElementProps & { 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 ?? \"<Share2Icon>\"}\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 <Share2IconBase\n {...(componentProps as unknown as ComponentProps<typeof Share2IconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Share2Icon = Interactive.withSchema({\n Component: Share2IconInner,\n componentName: \"<Share2Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst LEFT_NODE_PATH =\n \"M6 9 A3 3 0 0 1 9 12 A3 3 0 0 1 6 15 A3 3 0 0 1 3 12 A3 3 0 0 1 6 9\";\nconst TOP_NODE_PATH =\n \"M18 2 A3 3 0 0 1 21 5 A3 3 0 0 1 18 8 A3 3 0 0 1 15 5 A3 3 0 0 1 18 2\";\nconst BOTTOM_NODE_PATH =\n \"M18 16 A3 3 0 0 1 21 19 A3 3 0 0 1 18 22 A3 3 0 0 1 15 19 A3 3 0 0 1 18 16\";\nconst TOP_LINE_PATH = \"M8.59 10.49 15.41 6.51\";\nconst BOTTOM_LINE_PATH = \"M8.59 13.51 15.42 17.49\";\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction Share2IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const leftNodeDraw = interpolate(linearDraw, [0, 0.44], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const connectorDraw = interpolate(linearDraw, [0.33, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const rightNodeDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const topLineProgress = acting\n ? interpolate(actionProgress, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n const bottomLineProgress = acting\n ? interpolate(actionProgress, [0.15, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : connectorDraw;\n\n const topPop = acting\n ? interpolate(actionProgress, [0.3, 0.45, 0.65], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const bottomPop = acting\n ? interpolate(actionProgress, [0.45, 0.6, 0.8], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const leftNode = drawnPathProps(LEFT_NODE_PATH, leftNodeDraw);\n const topLine = drawnPathProps(TOP_LINE_PATH, topLineProgress);\n const bottomLine = drawnPathProps(BOTTOM_LINE_PATH, bottomLineProgress);\n const topNode = drawnPathProps(TOP_NODE_PATH, rightNodeDraw);\n const bottomNode = drawnPathProps(BOTTOM_NODE_PATH, rightNodeDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const topTransform = `translate(${18 * (1 - topPop)} ${5 * (1 - topPop)}) scale(${topPop})`;\n const bottomTransform = `translate(${18 * (1 - bottomPop)} ${19 * (1 - bottomPop)}) scale(${bottomPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={LEFT_NODE_PATH}\n strokeDasharray={leftNode.strokeDasharray}\n strokeDashoffset={leftNode.strokeDashoffset}\n />\n <path\n d={TOP_LINE_PATH}\n strokeDasharray={topLine.strokeDasharray}\n strokeDashoffset={topLine.strokeDashoffset}\n />\n <path\n d={BOTTOM_LINE_PATH}\n strokeDasharray={bottomLine.strokeDasharray}\n strokeDashoffset={bottomLine.strokeDashoffset}\n />\n <g transform={topTransform}>\n <path\n d={TOP_NODE_PATH}\n strokeDasharray={topNode.strokeDasharray}\n strokeDashoffset={topNode.strokeDashoffset}\n />\n </g>\n <g transform={bottomTransform}>\n <path\n d={BOTTOM_NODE_PATH}\n strokeDasharray={bottomNode.strokeDasharray}\n strokeDashoffset={bottomNode.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Share2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"18\" cy=\"5\" r=\"3\" />\n <circle cx=\"6\" cy=\"12\" r=\"3\" />\n <circle cx=\"18\" cy=\"19\" r=\"3\" />\n <line x1=\"8.59\" x2=\"15.42\" y1=\"13.51\" y2=\"17.49\" />\n <line x1=\"15.41\" x2=\"8.59\" y1=\"6.51\" y2=\"10.49\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype Share2IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof Share2IconBase>;\n\nconst Share2IconInner = forwardRef<\n HTMLDivElement,\n Share2IconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<Share2Icon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <Share2IconBase\n {...(componentProps as unknown as ComponentProps<typeof Share2IconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const Share2Icon = Interactive.withSchema({\n Component: Share2IconInner,\n componentName: \"<Share2Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-shield.json b/registry-artifacts/elements/icon-shield.json
index 62c1472b..97548b26 100644
--- a/registry-artifacts/elements/icon-shield.json
+++ b/registry-artifacts/elements/icon-shield.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Shield",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-shield",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHIELD_PATH =\n \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction ShieldIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const brace = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const lean = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shield = drawnPathProps(SHIELD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`rotate(${lean} ${CENTER} ${CENTER}) translate(${CENTER * (1 - brace)} ${CENTER * (1 - brace)}) scale(${brace})`}\n >\n <path\n d={SHIELD_PATH}\n strokeDasharray={shield.strokeDasharray}\n strokeDashoffset={shield.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ShieldIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHIELD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ShieldIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShieldIconBase>;\n\nconst ShieldIconInner = forwardRef<\n HTMLDivElement,\n ShieldIconElementProps & { 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 ?? \"<ShieldIcon>\"}\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 <ShieldIconBase\n {...(componentProps as unknown as ComponentProps<typeof ShieldIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShieldIcon = Interactive.withSchema({\n Component: ShieldIconInner,\n componentName: \"<ShieldIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SHIELD_PATH =\n \"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction ShieldIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const brace = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 1;\n const lean = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shield = drawnPathProps(SHIELD_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`rotate(${lean} ${CENTER} ${CENTER}) translate(${CENTER * (1 - brace)} ${CENTER * (1 - brace)}) scale(${brace})`}\n >\n <path\n d={SHIELD_PATH}\n strokeDasharray={shield.strokeDasharray}\n strokeDashoffset={shield.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ShieldIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHIELD_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ShieldIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ShieldIconBase>;\n\nconst ShieldIconInner = forwardRef<\n HTMLDivElement,\n ShieldIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ShieldIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ShieldIconBase\n {...(componentProps as unknown as ComponentProps<typeof ShieldIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ShieldIcon = Interactive.withSchema({\n Component: ShieldIconInner,\n componentName: \"<ShieldIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-shopping-cart.json b/registry-artifacts/elements/icon-shopping-cart.json
index c731bc8b..b2251abf 100644
--- a/registry-artifacts/elements/icon-shopping-cart.json
+++ b/registry-artifacts/elements/icon-shopping-cart.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Shopping Cart",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-shopping-cart",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\";\nconst BACK_WHEEL_PATH = \"M8 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\nconst FRONT_WHEEL_PATH = \"M19 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\n\nconst BACK_CX = 8;\nconst FRONT_CX = 19;\nconst WHEEL_CY = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction ShoppingCartIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const wheelsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rollX = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const backPop = acting\n ? interpolate(actionProgress, [0.5, 0.65, 0.85], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const frontPop = acting\n ? interpolate(actionProgress, [0.6, 0.75, 0.95], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const backWheel = drawnPathProps(BACK_WHEEL_PATH, acting ? 1 : wheelsDraw);\n const frontWheel = drawnPathProps(FRONT_WHEEL_PATH, acting ? 1 : wheelsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const backTransform = `translate(${BACK_CX * (1 - backPop)} ${WHEEL_CY * (1 - backPop)}) scale(${backPop})`;\n const frontTransform = `translate(${FRONT_CX * (1 - frontPop)} ${WHEEL_CY * (1 - frontPop)}) scale(${frontPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${rollX} 0) rotate(${tilt} 12 12)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={backTransform}>\n <path\n d={BACK_WHEEL_PATH}\n strokeDasharray={backWheel.strokeDasharray}\n strokeDashoffset={backWheel.strokeDashoffset}\n />\n </g>\n <g transform={frontTransform}>\n <path\n d={FRONT_WHEEL_PATH}\n strokeDasharray={frontWheel.strokeDasharray}\n strokeDashoffset={frontWheel.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction ShoppingCartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"21\" r=\"1\" />\n <circle cx=\"19\" cy=\"21\" r=\"1\" />\n <path d={BODY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ShoppingCartIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShoppingCartIconBase>;\n\nconst ShoppingCartIconInner = forwardRef<\n HTMLDivElement,\n ShoppingCartIconElementProps & { 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 ?? \"<ShoppingCartIcon>\"}\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 <ShoppingCartIconBase\n {...(componentProps as unknown as ComponentProps<typeof ShoppingCartIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShoppingCartIcon = Interactive.withSchema({\n Component: ShoppingCartIconInner,\n componentName: \"<ShoppingCartIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12\";\nconst BACK_WHEEL_PATH = \"M8 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\nconst FRONT_WHEEL_PATH = \"M19 20a1 1 0 1 0 0 2 1 1 0 1 0 0-2Z\";\n\nconst BACK_CX = 8;\nconst FRONT_CX = 19;\nconst WHEEL_CY = 21;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction ShoppingCartIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const wheelsDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const rollX = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, 4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const tilt = acting\n ? interpolate(actionProgress, [0, 0.4, 0.7], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const backPop = acting\n ? interpolate(actionProgress, [0.5, 0.65, 0.85], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const frontPop = acting\n ? interpolate(actionProgress, [0.6, 0.75, 0.95], [1, 1.2, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const backWheel = drawnPathProps(BACK_WHEEL_PATH, acting ? 1 : wheelsDraw);\n const frontWheel = drawnPathProps(FRONT_WHEEL_PATH, acting ? 1 : wheelsDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const backTransform = `translate(${BACK_CX * (1 - backPop)} ${WHEEL_CY * (1 - backPop)}) scale(${backPop})`;\n const frontTransform = `translate(${FRONT_CX * (1 - frontPop)} ${WHEEL_CY * (1 - frontPop)}) scale(${frontPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${rollX} 0) rotate(${tilt} 12 12)`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={backTransform}>\n <path\n d={BACK_WHEEL_PATH}\n strokeDasharray={backWheel.strokeDasharray}\n strokeDashoffset={backWheel.strokeDashoffset}\n />\n </g>\n <g transform={frontTransform}>\n <path\n d={FRONT_WHEEL_PATH}\n strokeDasharray={frontWheel.strokeDasharray}\n strokeDashoffset={frontWheel.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction ShoppingCartIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"8\" cy=\"21\" r=\"1\" />\n <circle cx=\"19\" cy=\"21\" r=\"1\" />\n <path d={BODY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ShoppingCartIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ShoppingCartIconBase>;\n\nconst ShoppingCartIconInner = forwardRef<\n HTMLDivElement,\n ShoppingCartIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ShoppingCartIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ShoppingCartIconBase\n {...(componentProps as unknown as ComponentProps<typeof ShoppingCartIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ShoppingCartIcon = Interactive.withSchema({\n Component: ShoppingCartIconInner,\n componentName: \"<ShoppingCartIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-skip-forward.json b/registry-artifacts/elements/icon-skip-forward.json
index 11e33110..4a695ef5 100644
--- a/registry-artifacts/elements/icon-skip-forward.json
+++ b/registry-artifacts/elements/icon-skip-forward.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Skip Forward",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-skip-forward",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z\";\nconst BAR_PATH = \"M21 4v16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction SkipForwardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const barProgress = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const bar = drawnPathProps(BAR_PATH, barProgress);\n\n const dash = interpolate(\n actionProgress,\n [0, 0.2, 0.6, 0.82, 1],\n [0, -1.2, 2, -0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const squeeze = interpolate(actionProgress, [0.45, 0.6, 0.78], [1, 0.96, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const shove = interpolate(actionProgress, [0.55, 0.62, 1], [0, 0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(${dash} 0) scale(${squeeze} 1)`}\n style={{ transformOrigin: \"16px 12px\" }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${shove} 0)`}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SkipForwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BAR_PATH} />\n <path d={TRIANGLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SkipForwardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SkipForwardIconBase>;\n\nconst SkipForwardIconInner = forwardRef<\n HTMLDivElement,\n SkipForwardIconElementProps & { 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 ?? \"<SkipForwardIcon>\"}\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 <SkipForwardIconBase\n {...(componentProps as unknown as ComponentProps<typeof SkipForwardIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SkipForwardIcon = Interactive.withSchema({\n Component: SkipForwardIconInner,\n componentName: \"<SkipForwardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRIANGLE_PATH =\n \"M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z\";\nconst BAR_PATH = \"M21 4v16\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction SkipForwardIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const triangleProgress = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const barProgress = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const triangle = drawnPathProps(TRIANGLE_PATH, triangleProgress);\n const bar = drawnPathProps(BAR_PATH, barProgress);\n\n const dash = interpolate(\n actionProgress,\n [0, 0.2, 0.6, 0.82, 1],\n [0, -1.2, 2, -0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n );\n const squeeze = interpolate(actionProgress, [0.45, 0.6, 0.78], [1, 0.96, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const shove = interpolate(actionProgress, [0.55, 0.62, 1], [0, 0.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(${dash} 0) scale(${squeeze} 1)`}\n style={{ transformOrigin: \"16px 12px\" }}\n >\n <path\n d={TRIANGLE_PATH}\n strokeDasharray={triangle.strokeDasharray}\n strokeDashoffset={triangle.strokeDashoffset}\n />\n </g>\n <g transform={`translate(${shove} 0)`}>\n <path\n d={BAR_PATH}\n strokeDasharray={bar.strokeDasharray}\n strokeDashoffset={bar.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SkipForwardIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={BAR_PATH} />\n <path d={TRIANGLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SkipForwardIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SkipForwardIconBase>;\n\nconst SkipForwardIconInner = forwardRef<\n HTMLDivElement,\n SkipForwardIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SkipForwardIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SkipForwardIconBase\n {...(componentProps as unknown as ComponentProps<typeof SkipForwardIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SkipForwardIcon = Interactive.withSchema({\n Component: SkipForwardIconInner,\n componentName: \"<SkipForwardIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-smartphone.json b/registry-artifacts/elements/icon-smartphone.json
index 37384986..ab1b1909 100644
--- a/registry-artifacts/elements/icon-smartphone.json
+++ b/registry-artifacts/elements/icon-smartphone.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Smartphone",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-smartphone",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M7 2H17A2 2 0 0 1 19 4V20A2 2 0 0 1 17 22H7A2 2 0 0 1 5 20V4A2 2 0 0 1 7 2Z\";\nconst BUTTON_PATH = \"M12 18h.01\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction SmartphoneIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buzz = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.45, 0.7, 0.9, 1],\n [0, 3, -3, 2, -1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${buzz} ${CENTER} ${CENTER})`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SmartphoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"20\" x=\"5\" y=\"2\" rx=\"2\" ry=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SmartphoneIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SmartphoneIconBase>;\n\nconst SmartphoneIconInner = forwardRef<\n HTMLDivElement,\n SmartphoneIconElementProps & { 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 ?? \"<SmartphoneIcon>\"}\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 <SmartphoneIconBase\n {...(componentProps as unknown as ComponentProps<typeof SmartphoneIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SmartphoneIcon = Interactive.withSchema({\n Component: SmartphoneIconInner,\n componentName: \"<SmartphoneIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M7 2H17A2 2 0 0 1 19 4V20A2 2 0 0 1 17 22H7A2 2 0 0 1 5 20V4A2 2 0 0 1 7 2Z\";\nconst BUTTON_PATH = \"M12 18h.01\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction SmartphoneIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buzz = acting\n ? interpolate(\n actionProgress,\n [0, 0.2, 0.45, 0.7, 0.9, 1],\n [0, 3, -3, 2, -1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${buzz} ${CENTER} ${CENTER})`}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SmartphoneIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <rect width=\"14\" height=\"20\" x=\"5\" y=\"2\" rx=\"2\" ry=\"2\" />\n <path d=\"M12 18h.01\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SmartphoneIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SmartphoneIconBase>;\n\nconst SmartphoneIconInner = forwardRef<\n HTMLDivElement,\n SmartphoneIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SmartphoneIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SmartphoneIconBase\n {...(componentProps as unknown as ComponentProps<typeof SmartphoneIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SmartphoneIcon = Interactive.withSchema({\n Component: SmartphoneIconInner,\n componentName: \"<SmartphoneIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-sparkles.json b/registry-artifacts/elements/icon-sparkles.json
index 1c766dc5..d5f3acf8 100644
--- a/registry-artifacts/elements/icon-sparkles.json
+++ b/registry-artifacts/elements/icon-sparkles.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Sparkles",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-sparkles",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MAIN_PATH =\n \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\";\nconst ACCENT_TR_V = \"M20 2v4\";\nconst ACCENT_TR_H = \"M22 4h-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nfunction SparklesIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const popTR = interpolate(linearDraw, [0.55, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const popBL = interpolate(linearDraw, [0.857, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const main = drawnPathProps(MAIN_PATH, mainProgress);\n\n const mainPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 0.7, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallOpacity = interpolate(actionProgress, [0, 0.5, 1], [1, 0.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const trScale = popTR * smallPulse;\n const blScale = popBL * smallPulse;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(12 12) scale(${mainPulse}) translate(-12 -12)`}>\n <path\n d={MAIN_PATH}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(20 4) scale(${trScale}) translate(-20 -4)`}\n >\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(4 20) scale(${blScale}) translate(-4 -20)`}\n >\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </g>\n </svg>\n );\n}\n\nfunction SparklesIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MAIN_PATH} />\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SparklesIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SparklesIconBase>;\n\nconst SparklesIconInner = forwardRef<\n HTMLDivElement,\n SparklesIconElementProps & { 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 ?? \"<SparklesIcon>\"}\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 <SparklesIconBase\n {...(componentProps as unknown as ComponentProps<typeof SparklesIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SparklesIcon = Interactive.withSchema({\n Component: SparklesIconInner,\n componentName: \"<SparklesIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst MAIN_PATH =\n \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\";\nconst ACCENT_TR_V = \"M20 2v4\";\nconst ACCENT_TR_H = \"M22 4h-4\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 45,\n loop: true,\n} as const;\n\nfunction SparklesIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const mainProgress = interpolate(linearDraw, [0, 0.857], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const popTR = interpolate(linearDraw, [0.55, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n const popBL = interpolate(linearDraw, [0.857, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.back(1.8)),\n });\n\n const main = drawnPathProps(MAIN_PATH, mainProgress);\n\n const mainPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallPulse = interpolate(actionProgress, [0, 0.5, 1], [1, 0.7, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const smallOpacity = interpolate(actionProgress, [0, 0.5, 1], [1, 0.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const trScale = popTR * smallPulse;\n const blScale = popBL * smallPulse;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(12 12) scale(${mainPulse}) translate(-12 -12)`}>\n <path\n d={MAIN_PATH}\n strokeDasharray={main.strokeDasharray}\n strokeDashoffset={main.strokeDashoffset}\n />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(20 4) scale(${trScale}) translate(-20 -4)`}\n >\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n </g>\n <g\n opacity={smallOpacity}\n transform={`translate(4 20) scale(${blScale}) translate(-4 -20)`}\n >\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </g>\n </svg>\n );\n}\n\nfunction SparklesIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={MAIN_PATH} />\n <path d={ACCENT_TR_V} />\n <path d={ACCENT_TR_H} />\n <circle cx=\"4\" cy=\"20\" r=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: true,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: true,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SparklesIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SparklesIconBase>;\n\nconst SparklesIconInner = forwardRef<\n HTMLDivElement,\n SparklesIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SparklesIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SparklesIconBase\n {...(componentProps as unknown as ComponentProps<typeof SparklesIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SparklesIcon = Interactive.withSchema({\n Component: SparklesIconInner,\n componentName: \"<SparklesIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-star.json b/registry-artifacts/elements/icon-star.json
index eb61d957..5c05034e 100644
--- a/registry-artifacts/elements/icon-star.json
+++ b/registry-artifacts/elements/icon-star.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Star",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-star",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STAR_PATH =\n \"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction StarIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const starProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const star = drawnPathProps(STAR_PATH, starProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 12, stiffness: 140, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -8 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={STAR_PATH}\n strokeDasharray={star.strokeDasharray}\n strokeDashoffset={star.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction StarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype StarIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof StarIconBase>;\n\nconst StarIconInner = forwardRef<\n HTMLDivElement,\n StarIconElementProps & { 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 ?? \"<StarIcon>\"}\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 <StarIconBase\n {...(componentProps as unknown as ComponentProps<typeof StarIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const StarIcon = Interactive.withSchema({\n Component: StarIconInner,\n componentName: \"<StarIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst STAR_PATH =\n \"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction StarIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const starProgress = interpolate(linearDraw, [0, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const star = drawnPathProps(STAR_PATH, starProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 12, stiffness: 140, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -8 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * (1 + 0.12 * pop);\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={STAR_PATH}\n strokeDasharray={star.strokeDasharray}\n strokeDashoffset={star.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction StarIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={STAR_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype StarIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof StarIconBase>;\n\nconst StarIconInner = forwardRef<\n HTMLDivElement,\n StarIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<StarIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <StarIconBase\n {...(componentProps as unknown as ComponentProps<typeof StarIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const StarIcon = Interactive.withSchema({\n Component: StarIconInner,\n componentName: \"<StarIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-sun.json b/registry-artifacts/elements/icon-sun.json
index cf146910..486d05b0 100644
--- a/registry-artifacts/elements/icon-sun.json
+++ b/registry-artifacts/elements/icon-sun.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Sun",
"durationInFrames": 85,
"installationMode": "component-owned-sequence",
"slug": "icon-sun",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CORE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\n\nconst RAYS = [\n \"M12 4 12 2\",\n \"M17.66 6.34 19.07 4.93\",\n \"M20 12 22 12\",\n \"M17.66 17.66 19.07 19.07\",\n \"M12 20 12 22\",\n \"M6.34 17.66 4.93 19.07\",\n \"M4 12 2 12\",\n \"M6.34 6.34 4.93 4.93\",\n];\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction SunIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const corePop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const core = drawnPathProps(CORE_PATH, drawProgress);\n\n const rays = RAYS.map((d, i) => {\n const start = i * 0.07;\n const rayFan = interpolate(actionProgress, [start, start + 0.28], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const progress = animation === \"draw\" ? 1 : acting ? rayFan : 0;\n return { d, ...drawnPathProps(d, progress) };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const coreTransform = `translate(${CENTER * (1 - corePop)} ${CENTER * (1 - corePop)}) scale(${corePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {rays.map((ray) => (\n <path\n key={ray.d}\n d={ray.d}\n strokeDasharray={ray.strokeDasharray}\n strokeDashoffset={ray.strokeDashoffset}\n />\n ))}\n <g transform={coreTransform}>\n <path\n d={CORE_PATH}\n strokeDasharray={core.strokeDasharray}\n strokeDashoffset={core.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SunIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SunIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SunIconBase>;\n\nconst SunIconInner = forwardRef<\n HTMLDivElement,\n SunIconElementProps & { 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 ?? \"<SunIcon>\"}\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 <SunIconBase\n {...(componentProps as unknown as ComponentProps<typeof SunIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SunIcon = Interactive.withSchema({\n Component: SunIconInner,\n componentName: \"<SunIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CORE_PATH = \"M12 8a4 4 0 1 0 0 8 4 4 0 1 0 0-8Z\";\n\nconst RAYS = [\n \"M12 4 12 2\",\n \"M17.66 6.34 19.07 4.93\",\n \"M20 12 22 12\",\n \"M17.66 17.66 19.07 19.07\",\n \"M12 20 12 22\",\n \"M6.34 17.66 4.93 19.07\",\n \"M4 12 2 12\",\n \"M6.34 6.34 4.93 4.93\",\n];\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 30,\n loop: false,\n} as const;\n\nfunction SunIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const corePop = acting\n ? interpolate(actionProgress, [0.55, 0.75, 1], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const core = drawnPathProps(CORE_PATH, drawProgress);\n\n const rays = RAYS.map((d, i) => {\n const start = i * 0.07;\n const rayFan = interpolate(actionProgress, [start, start + 0.28], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const progress = animation === \"draw\" ? 1 : acting ? rayFan : 0;\n return { d, ...drawnPathProps(d, progress) };\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n const coreTransform = `translate(${CENTER * (1 - corePop)} ${CENTER * (1 - corePop)}) scale(${corePop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n {rays.map((ray) => (\n <path\n key={ray.d}\n d={ray.d}\n strokeDasharray={ray.strokeDasharray}\n strokeDashoffset={ray.strokeDashoffset}\n />\n ))}\n <g transform={coreTransform}>\n <path\n d={CORE_PATH}\n strokeDasharray={core.strokeDasharray}\n strokeDashoffset={core.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction SunIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"4\" />\n <path d=\"M12 2v2\" />\n <path d=\"M12 20v2\" />\n <path d=\"m4.93 4.93 1.41 1.41\" />\n <path d=\"m17.66 17.66 1.41 1.41\" />\n <path d=\"M2 12h2\" />\n <path d=\"M20 12h2\" />\n <path d=\"m6.34 17.66-1.41 1.41\" />\n <path d=\"m19.07 4.93-1.41 1.41\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype SunIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SunIconBase>;\n\nconst SunIconInner = forwardRef<\n HTMLDivElement,\n SunIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<SunIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SunIconBase\n {...(componentProps as unknown as ComponentProps<typeof SunIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SunIcon = Interactive.withSchema({\n Component: SunIconInner,\n componentName: \"<SunIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 85
}
diff --git a/registry-artifacts/elements/icon-tag.json b/registry-artifacts/elements/icon-tag.json
index 89861426..2fd8452d 100644
--- a/registry-artifacts/elements/icon-tag.json
+++ b/registry-artifacts/elements/icon-tag.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Tag",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-tag",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TAG_PATH =\n \"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\";\n\nconst HOLE_X = 7.5;\nconst HOLE_Y = 7.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction TagIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const holeScale = acting\n ? 1\n : interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const swing = acting\n ? interpolate(actionProgress, [0, 0.2, 0.45, 0.7, 1], [0, 8, -6, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const tag = drawnPathProps(TAG_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const holeTransform = `translate(${HOLE_X * (1 - holeScale)} ${HOLE_Y * (1 - holeScale)}) scale(${holeScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${HOLE_X} ${HOLE_Y})`}>\n <path\n d={TAG_PATH}\n strokeDasharray={tag.strokeDasharray}\n strokeDashoffset={tag.strokeDashoffset}\n />\n <g transform={holeTransform}>\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TagIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TAG_PATH} />\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TagIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TagIconBase>;\n\nconst TagIconInner = forwardRef<\n HTMLDivElement,\n TagIconElementProps & { 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 ?? \"<TagIcon>\"}\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 <TagIconBase\n {...(componentProps as unknown as ComponentProps<typeof TagIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TagIcon = Interactive.withSchema({\n Component: TagIconInner,\n componentName: \"<TagIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TAG_PATH =\n \"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z\";\n\nconst HOLE_X = 7.5;\nconst HOLE_Y = 7.5;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction TagIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const holeScale = acting\n ? 1\n : interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const swing = acting\n ? interpolate(actionProgress, [0, 0.2, 0.45, 0.7, 1], [0, 8, -6, 3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n\n const tag = drawnPathProps(TAG_PATH, drawProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const holeTransform = `translate(${HOLE_X * (1 - holeScale)} ${HOLE_Y * (1 - holeScale)}) scale(${holeScale})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${swing} ${HOLE_X} ${HOLE_Y})`}>\n <path\n d={TAG_PATH}\n strokeDasharray={tag.strokeDasharray}\n strokeDashoffset={tag.strokeDashoffset}\n />\n <g transform={holeTransform}>\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TagIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={TAG_PATH} />\n <circle cx=\"7.5\" cy=\"7.5\" r=\"0.5\" fill={color} stroke=\"none\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TagIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TagIconBase>;\n\nconst TagIconInner = forwardRef<\n HTMLDivElement,\n TagIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TagIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TagIconBase\n {...(componentProps as unknown as ComponentProps<typeof TagIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TagIcon = Interactive.withSchema({\n Component: TagIconInner,\n componentName: \"<TagIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-target.json b/registry-artifacts/elements/icon-target.json
index c2f94703..32fd20d5 100644
--- a/registry-artifacts/elements/icon-target.json
+++ b/registry-artifacts/elements/icon-target.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Target",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-target",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_OUTER = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst RING_MID = \"M12 6a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RING_INNER = \"M12 10a2 2 0 1 0 0 4 2 2 0 1 0 0-4Z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TargetIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outerDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.28, 0.83], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.6], [1, 1.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.6, 0.68, 0.78, 0.88, 1],\n [0, 0.6, -0.6, 0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const outer = drawnPathProps(RING_OUTER, acting ? 1 : outerDraw);\n const mid = drawnPathProps(RING_MID, acting ? 1 : midDraw);\n const inner = drawnPathProps(RING_INNER, acting ? 1 : innerDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${shake} 0)`}>\n <path\n d={RING_OUTER}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n <path\n d={RING_MID}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={RING_INNER}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TargetIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TargetIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TargetIconBase>;\n\nconst TargetIconInner = forwardRef<\n HTMLDivElement,\n TargetIconElementProps & { 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 ?? \"<TargetIcon>\"}\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 <TargetIconBase\n {...(componentProps as unknown as ComponentProps<typeof TargetIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TargetIcon = Interactive.withSchema({\n Component: TargetIconInner,\n componentName: \"<TargetIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_OUTER = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst RING_MID = \"M12 6a6 6 0 1 0 0 12 6 6 0 1 0 0-12Z\";\nconst RING_INNER = \"M12 10a2 2 0 1 0 0 4 2 2 0 1 0 0-4Z\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TargetIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const outerDraw = interpolate(linearDraw, [0, 0.55], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const midDraw = interpolate(linearDraw, [0.28, 0.83], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.6], [1, 1.5, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.6, 0.68, 0.78, 0.88, 1],\n [0, 0.6, -0.6, 0.3, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const outer = drawnPathProps(RING_OUTER, acting ? 1 : outerDraw);\n const mid = drawnPathProps(RING_MID, acting ? 1 : midDraw);\n const inner = drawnPathProps(RING_INNER, acting ? 1 : innerDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${shake} 0)`}>\n <path\n d={RING_OUTER}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n <path\n d={RING_MID}\n strokeDasharray={mid.strokeDasharray}\n strokeDashoffset={mid.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={RING_INNER}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n </g>\n </svg>\n );\n}\n\nfunction TargetIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <circle cx=\"12\" cy=\"12\" r=\"6\" />\n <circle cx=\"12\" cy=\"12\" r=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TargetIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TargetIconBase>;\n\nconst TargetIconInner = forwardRef<\n HTMLDivElement,\n TargetIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TargetIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TargetIconBase\n {...(componentProps as unknown as ComponentProps<typeof TargetIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TargetIcon = Interactive.withSchema({\n Component: TargetIconInner,\n componentName: \"<TargetIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-terminal.json b/registry-artifacts/elements/icon-terminal.json
index 34adeaf7..56ac6e41 100644
--- a/registry-artifacts/elements/icon-terminal.json
+++ b/registry-artifacts/elements/icon-terminal.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Terminal",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-terminal",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M4 17 10 11 4 5\";\nconst CURSOR_PATH = \"M12 19H20\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 32,\n loop: false,\n} as const;\n\nfunction TerminalIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const chevronDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cursorDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const nudge = acting\n ? interpolate(actionProgress, [0, 0.15, 0.35], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const cursorOpacity = acting\n ? interpolate(\n actionProgress,\n [0.3, 0.42, 0.54, 0.66, 0.78],\n [1, 0, 1, 0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n )\n : 1;\n\n const chevron = drawnPathProps(CHEVRON_PATH, acting ? 1 : chevronDraw);\n const cursor = drawnPathProps(CURSOR_PATH, acting ? 1 : cursorDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudge} 0)`}>\n <path\n d={CHEVRON_PATH}\n strokeDasharray={chevron.strokeDasharray}\n strokeDashoffset={chevron.strokeDashoffset}\n />\n </g>\n <path\n d={CURSOR_PATH}\n strokeDasharray={cursor.strokeDasharray}\n strokeDashoffset={cursor.strokeDashoffset}\n opacity={cursorOpacity}\n />\n </svg>\n );\n}\n\nfunction TerminalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TerminalIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TerminalIconBase>;\n\nconst TerminalIconInner = forwardRef<\n HTMLDivElement,\n TerminalIconElementProps & { 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 ?? \"<TerminalIcon>\"}\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 <TerminalIconBase\n {...(componentProps as unknown as ComponentProps<typeof TerminalIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TerminalIcon = Interactive.withSchema({\n Component: TerminalIconInner,\n componentName: \"<TerminalIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CHEVRON_PATH = \"M4 17 10 11 4 5\";\nconst CURSOR_PATH = \"M12 19H20\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 32,\n loop: false,\n} as const;\n\nfunction TerminalIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const chevronDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cursorDraw = interpolate(linearDraw, [0.55, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const nudge = acting\n ? interpolate(actionProgress, [0, 0.15, 0.35], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const cursorOpacity = acting\n ? interpolate(\n actionProgress,\n [0.3, 0.42, 0.54, 0.66, 0.78],\n [1, 0, 1, 0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n )\n : 1;\n\n const chevron = drawnPathProps(CHEVRON_PATH, acting ? 1 : chevronDraw);\n const cursor = drawnPathProps(CURSOR_PATH, acting ? 1 : cursorDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${nudge} 0)`}>\n <path\n d={CHEVRON_PATH}\n strokeDasharray={chevron.strokeDasharray}\n strokeDashoffset={chevron.strokeDashoffset}\n />\n </g>\n <path\n d={CURSOR_PATH}\n strokeDasharray={cursor.strokeDasharray}\n strokeDashoffset={cursor.strokeDashoffset}\n opacity={cursorOpacity}\n />\n </svg>\n );\n}\n\nfunction TerminalIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 19h8\" />\n <path d=\"m4 17 6-6-6-6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TerminalIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TerminalIconBase>;\n\nconst TerminalIconInner = forwardRef<\n HTMLDivElement,\n TerminalIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TerminalIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TerminalIconBase\n {...(componentProps as unknown as ComponentProps<typeof TerminalIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TerminalIcon = Interactive.withSchema({\n Component: TerminalIconInner,\n componentName: \"<TerminalIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-thumbs-up.json b/registry-artifacts/elements/icon-thumbs-up.json
index 275f1978..a5864344 100644
--- a/registry-artifacts/elements/icon-thumbs-up.json
+++ b/registry-artifacts/elements/icon-thumbs-up.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Thumbs Up",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-thumbs-up",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HAND_PATH =\n \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\";\nconst CUFF_PATH = \"M7 10v12\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction ThumbsUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const handProgress = interpolate(linearDraw, [0.25, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cuffProgress = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const hand = drawnPathProps(HAND_PATH, handProgress);\n const cuff = drawnPathProps(CUFF_PATH, cuffProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 11, stiffness: 150, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -18 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 4 22)`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n <path\n d={CUFF_PATH}\n strokeDasharray={cuff.strokeDasharray}\n strokeDashoffset={cuff.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ThumbsUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HAND_PATH} />\n <path d={CUFF_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ThumbsUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ThumbsUpIconBase>;\n\nconst ThumbsUpIconInner = forwardRef<\n HTMLDivElement,\n ThumbsUpIconElementProps & { 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 ?? \"<ThumbsUpIcon>\"}\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 <ThumbsUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ThumbsUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ThumbsUpIcon = Interactive.withSchema({\n Component: ThumbsUpIconInner,\n componentName: \"<ThumbsUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HAND_PATH =\n \"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z\";\nconst CUFF_PATH = \"M7 10v12\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction ThumbsUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionFrame, actionProgress } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n const { fps } = useVideoConfig();\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const handProgress = interpolate(linearDraw, [0.25, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const cuffProgress = interpolate(linearDraw, [0, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const hand = drawnPathProps(HAND_PATH, handProgress);\n const cuff = drawnPathProps(CUFF_PATH, cuffProgress);\n\n const settle = spring({\n frame: actionFrame,\n fps,\n config: { damping: 11, stiffness: 150, mass: 0.8 },\n durationInFrames: 18,\n });\n const rotate = -18 * (1 - settle);\n const pop = interpolate(actionProgress, [0, 0.5, 1], [1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`rotate(${rotate} 4 22)`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n <path\n d={CUFF_PATH}\n strokeDasharray={cuff.strokeDasharray}\n strokeDashoffset={cuff.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ThumbsUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={HAND_PATH} />\n <path d={CUFF_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ThumbsUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ThumbsUpIconBase>;\n\nconst ThumbsUpIconInner = forwardRef<\n HTMLDivElement,\n ThumbsUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ThumbsUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ThumbsUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof ThumbsUpIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ThumbsUpIcon = Interactive.withSchema({\n Component: ThumbsUpIconInner,\n componentName: \"<ThumbsUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-timer.json b/registry-artifacts/elements/icon-timer.json
index 39ac4a0e..4a4fd427 100644
--- a/registry-artifacts/elements/icon-timer.json
+++ b/registry-artifacts/elements/icon-timer.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Timer",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "icon-timer",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DIAL_PATH = \"M12 6a8 8 0 1 0 0 16 8 8 0 1 0 0-16Z\";\nconst BUTTON_PATH = \"M10 2H14\";\nconst HAND_PATH = \"M12 14 15 11\";\n\nconst DIAL_CX = 12;\nconst DIAL_CY = 14;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 48,\n loop: false,\n} as const;\n\nfunction TimerIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const dialDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.45, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buttonDip = acting\n ? interpolate(actionProgress, [0, 0.15, 0.3], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const handSweep = acting\n ? interpolate(actionProgress, [0.3, 1], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n })\n : 0;\n\n const dial = drawnPathProps(DIAL_PATH, acting ? 1 : dialDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n const hand = drawnPathProps(HAND_PATH, acting ? 1 : handDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DIAL_PATH}\n strokeDasharray={dial.strokeDasharray}\n strokeDashoffset={dial.strokeDashoffset}\n />\n <g transform={`translate(0 ${buttonDip})`}>\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n <g transform={`rotate(${handSweep} ${DIAL_CX} ${DIAL_CY})`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TimerIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TimerIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TimerIconBase>;\n\nconst TimerIconInner = forwardRef<\n HTMLDivElement,\n TimerIconElementProps & { 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 ?? \"<TimerIcon>\"}\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 <TimerIconBase\n {...(componentProps as unknown as ComponentProps<typeof TimerIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TimerIcon = Interactive.withSchema({\n Component: TimerIconInner,\n componentName: \"<TimerIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst DIAL_PATH = \"M12 6a8 8 0 1 0 0 16 8 8 0 1 0 0-16Z\";\nconst BUTTON_PATH = \"M10 2H14\";\nconst HAND_PATH = \"M12 14 15 11\";\n\nconst DIAL_CX = 12;\nconst DIAL_CY = 14;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 48,\n loop: false,\n} as const;\n\nfunction TimerIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const dialDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const buttonDraw = interpolate(linearDraw, [0.45, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const handDraw = interpolate(linearDraw, [0.7, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const buttonDip = acting\n ? interpolate(actionProgress, [0, 0.15, 0.3], [0, 1.5, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const handSweep = acting\n ? interpolate(actionProgress, [0.3, 1], [0, 360], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n })\n : 0;\n\n const dial = drawnPathProps(DIAL_PATH, acting ? 1 : dialDraw);\n const button = drawnPathProps(BUTTON_PATH, acting ? 1 : buttonDraw);\n const hand = drawnPathProps(HAND_PATH, acting ? 1 : handDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={DIAL_PATH}\n strokeDasharray={dial.strokeDasharray}\n strokeDashoffset={dial.strokeDashoffset}\n />\n <g transform={`translate(0 ${buttonDip})`}>\n <path\n d={BUTTON_PATH}\n strokeDasharray={button.strokeDasharray}\n strokeDashoffset={button.strokeDashoffset}\n />\n </g>\n <g transform={`rotate(${handSweep} ${DIAL_CX} ${DIAL_CY})`}>\n <path\n d={HAND_PATH}\n strokeDasharray={hand.strokeDasharray}\n strokeDashoffset={hand.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TimerIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <line x1=\"10\" x2=\"14\" y1=\"2\" y2=\"2\" />\n <line x1=\"12\" x2=\"15\" y1=\"14\" y2=\"11\" />\n <circle cx=\"12\" cy=\"14\" r=\"8\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TimerIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TimerIconBase>;\n\nconst TimerIconInner = forwardRef<\n HTMLDivElement,\n TimerIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TimerIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TimerIconBase\n {...(componentProps as unknown as ComponentProps<typeof TimerIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TimerIcon = Interactive.withSchema({\n Component: TimerIconInner,\n componentName: \"<TimerIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/icon-trash.json b/registry-artifacts/elements/icon-trash.json
index c6f4efc3..c64df927 100644
--- a/registry-artifacts/elements/icon-trash.json
+++ b/registry-artifacts/elements/icon-trash.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Trash",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-trash",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH = \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\";\nconst INNER1_PATH = \"M10 11v6\";\nconst INNER2_PATH = \"M14 11v6\";\nconst LID_PATH = \"M3 6h18\";\nconst HANDLE_PATH = \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TrashIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const innerProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const inner1 = drawnPathProps(INNER1_PATH, innerProgress);\n const inner2 = drawnPathProps(INNER2_PATH, innerProgress);\n const lid = drawnPathProps(LID_PATH, lidProgress);\n const handle = drawnPathProps(HANDLE_PATH, lidProgress);\n\n const lidRotate = interpolate(actionProgress, [0, 0.4, 1], [0, -14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const lidLift = interpolate(actionProgress, [0, 0.4, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={INNER1_PATH}\n strokeDasharray={inner1.strokeDasharray}\n strokeDashoffset={inner1.strokeDashoffset}\n />\n <path\n d={INNER2_PATH}\n strokeDasharray={inner2.strokeDasharray}\n strokeDashoffset={inner2.strokeDashoffset}\n />\n <g transform={`translate(0 ${lidLift}) rotate(${lidRotate} 3 6)`}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={HANDLE_PATH}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrashIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={INNER1_PATH} />\n <path d={INNER2_PATH} />\n <path d={BODY_PATH} />\n <path d={LID_PATH} />\n <path d={HANDLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrashIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrashIconBase>;\n\nconst TrashIconInner = forwardRef<\n HTMLDivElement,\n TrashIconElementProps & { 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 ?? \"<TrashIcon>\"}\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 <TrashIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrashIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrashIcon = Interactive.withSchema({\n Component: TrashIconInner,\n componentName: \"<TrashIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH = \"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6\";\nconst INNER1_PATH = \"M10 11v6\";\nconst INNER2_PATH = \"M14 11v6\";\nconst LID_PATH = \"M3 6h18\";\nconst HANDLE_PATH = \"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TrashIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const innerProgress = interpolate(linearDraw, [0.571, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lidProgress = interpolate(linearDraw, [0.714, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const body = drawnPathProps(BODY_PATH, bodyProgress);\n const inner1 = drawnPathProps(INNER1_PATH, innerProgress);\n const inner2 = drawnPathProps(INNER2_PATH, innerProgress);\n const lid = drawnPathProps(LID_PATH, lidProgress);\n const handle = drawnPathProps(HANDLE_PATH, lidProgress);\n\n const lidRotate = interpolate(actionProgress, [0, 0.4, 1], [0, -14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const lidLift = interpolate(actionProgress, [0, 0.4, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={INNER1_PATH}\n strokeDasharray={inner1.strokeDasharray}\n strokeDashoffset={inner1.strokeDashoffset}\n />\n <path\n d={INNER2_PATH}\n strokeDasharray={inner2.strokeDasharray}\n strokeDashoffset={inner2.strokeDashoffset}\n />\n <g transform={`translate(0 ${lidLift}) rotate(${lidRotate} 3 6)`}>\n <path\n d={LID_PATH}\n strokeDasharray={lid.strokeDasharray}\n strokeDashoffset={lid.strokeDashoffset}\n />\n <path\n d={HANDLE_PATH}\n strokeDasharray={handle.strokeDasharray}\n strokeDashoffset={handle.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrashIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={INNER1_PATH} />\n <path d={INNER2_PATH} />\n <path d={BODY_PATH} />\n <path d={LID_PATH} />\n <path d={HANDLE_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrashIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TrashIconBase>;\n\nconst TrashIconInner = forwardRef<\n HTMLDivElement,\n TrashIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TrashIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TrashIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrashIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TrashIcon = Interactive.withSchema({\n Component: TrashIconInner,\n componentName: \"<TrashIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-trending-down.json b/registry-artifacts/elements/icon-trending-down.json
index 7669f8c6..f2cf4044 100644
--- a/registry-artifacts/elements/icon-trending-down.json
+++ b/registry-artifacts/elements/icon-trending-down.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Trending Down",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-trending-down",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 7 8.5 13.5 13.5 8.5 22 17\";\nconst ARROW_PATH = \"M16 17H22V11\";\n\nconst LOW_X = 22;\nconst LOW_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction TrendingDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const drop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${LOW_X * (1 - pop)} ${LOW_Y * (1 - pop) + drop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 17h6v-6\" />\n <path d=\"m22 17-8.5-8.5-5 5L2 7\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrendingDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrendingDownIconBase>;\n\nconst TrendingDownIconInner = forwardRef<\n HTMLDivElement,\n TrendingDownIconElementProps & { 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 ?? \"<TrendingDownIcon>\"}\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 <TrendingDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrendingDownIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrendingDownIcon = Interactive.withSchema({\n Component: TrendingDownIconInner,\n componentName: \"<TrendingDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 7 8.5 13.5 13.5 8.5 22 17\";\nconst ARROW_PATH = \"M16 17H22V11\";\n\nconst LOW_X = 22;\nconst LOW_Y = 17;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction TrendingDownIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.15, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const drop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${LOW_X * (1 - pop)} ${LOW_Y * (1 - pop) + drop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingDownIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 17h6v-6\" />\n <path d=\"m22 17-8.5-8.5-5 5L2 7\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrendingDownIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TrendingDownIconBase>;\n\nconst TrendingDownIconInner = forwardRef<\n HTMLDivElement,\n TrendingDownIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TrendingDownIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TrendingDownIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrendingDownIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TrendingDownIcon = Interactive.withSchema({\n Component: TrendingDownIconInner,\n componentName: \"<TrendingDownIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-trending-up.json b/registry-artifacts/elements/icon-trending-up.json
index 43befd1a..01d8bd58 100644
--- a/registry-artifacts/elements/icon-trending-up.json
+++ b/registry-artifacts/elements/icon-trending-up.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Trending Up",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-trending-up",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 17 8.5 10.5 13.5 15.5 22 7\";\nconst ARROW_PATH = \"M16 7H22V13\";\n\nconst PEAK_X = 22;\nconst PEAK_Y = 7;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction TrendingUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${PEAK_X * (1 - pop)} ${PEAK_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 7h6v6\" />\n <path d=\"m22 7-8.5 8.5-5-5L2 17\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrendingUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrendingUpIconBase>;\n\nconst TrendingUpIconInner = forwardRef<\n HTMLDivElement,\n TrendingUpIconElementProps & { 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 ?? \"<TrendingUpIcon>\"}\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 <TrendingUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrendingUpIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrendingUpIcon = Interactive.withSchema({\n Component: TrendingUpIconInner,\n componentName: \"<TrendingUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TREND_PATH = \"M2 17 8.5 10.5 13.5 15.5 22 7\";\nconst ARROW_PATH = \"M16 7H22V13\";\n\nconst PEAK_X = 22;\nconst PEAK_Y = 7;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction TrendingUpIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const trendDraw = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const arrowDraw = interpolate(linearDraw, [0.65, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0.1, 0.45, 1], [1, 1.25, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const trend = drawnPathProps(TREND_PATH, acting ? 1 : trendDraw);\n const arrow = drawnPathProps(ARROW_PATH, acting ? 1 : arrowDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const popTransform = `translate(${PEAK_X * (1 - pop)} ${PEAK_Y * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={TREND_PATH}\n strokeDasharray={trend.strokeDasharray}\n strokeDashoffset={trend.strokeDashoffset}\n />\n <g transform={popTransform}>\n <path\n d={ARROW_PATH}\n strokeDasharray={arrow.strokeDasharray}\n strokeDashoffset={arrow.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrendingUpIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M16 7h6v6\" />\n <path d=\"m22 7-8.5 8.5-5-5L2 17\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrendingUpIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TrendingUpIconBase>;\n\nconst TrendingUpIconInner = forwardRef<\n HTMLDivElement,\n TrendingUpIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TrendingUpIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TrendingUpIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrendingUpIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TrendingUpIcon = Interactive.withSchema({\n Component: TrendingUpIconInner,\n componentName: \"<TrendingUpIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-trophy.json b/registry-artifacts/elements/icon-trophy.json
index e735c833..74537564 100644
--- a/registry-artifacts/elements/icon-trophy.json
+++ b/registry-artifacts/elements/icon-trophy.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Trophy",
"durationInFrames": 85,
"installationMode": "component-owned-sequence",
"slug": "icon-trophy",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CUP_PATH = \"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\";\nconst LEG_LEFT_PATH = \"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\";\nconst LEG_RIGHT_PATH =\n \"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\";\nconst BASE_PATH = \"M4 22h16\";\nconst HANDLE_LEFT_PATH = \"M6 9H4.5a1 1 0 0 1 0-5H6\";\nconst HANDLE_RIGHT_PATH = \"M18 9h1.5a1 1 0 0 0 0-5H18\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TrophyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const cupDraw = interpolate(linearDraw, [0, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const legDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hop = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75, 1], [1, 1.08, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const handleDraw = acting\n ? interpolate(actionProgress, [0.1, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const cup = drawnPathProps(CUP_PATH, acting ? 1 : cupDraw);\n const legLeft = drawnPathProps(LEG_LEFT_PATH, acting ? 1 : legDraw);\n const legRight = drawnPathProps(LEG_RIGHT_PATH, acting ? 1 : legDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : legDraw);\n const handleLeft = drawnPathProps(HANDLE_LEFT_PATH, handleDraw);\n const handleRight = drawnPathProps(HANDLE_RIGHT_PATH, handleDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const hoistTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop) + hop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={hoistTransform}>\n <path\n d={HANDLE_LEFT_PATH}\n strokeDasharray={handleLeft.strokeDasharray}\n strokeDashoffset={handleLeft.strokeDashoffset}\n />\n <path\n d={HANDLE_RIGHT_PATH}\n strokeDasharray={handleRight.strokeDasharray}\n strokeDashoffset={handleRight.strokeDashoffset}\n />\n <path\n d={CUP_PATH}\n strokeDasharray={cup.strokeDasharray}\n strokeDashoffset={cup.strokeDashoffset}\n />\n <path\n d={LEG_LEFT_PATH}\n strokeDasharray={legLeft.strokeDasharray}\n strokeDashoffset={legLeft.strokeDashoffset}\n />\n <path\n d={LEG_RIGHT_PATH}\n strokeDasharray={legRight.strokeDasharray}\n strokeDashoffset={legRight.strokeDashoffset}\n />\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrophyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\" />\n <path d=\"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\" />\n <path d=\"M18 9h1.5a1 1 0 0 0 0-5H18\" />\n <path d=\"M4 22h16\" />\n <path d=\"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\" />\n <path d=\"M6 9H4.5a1 1 0 0 1 0-5H6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrophyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrophyIconBase>;\n\nconst TrophyIconInner = forwardRef<\n HTMLDivElement,\n TrophyIconElementProps & { 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 ?? \"<TrophyIcon>\"}\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 <TrophyIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrophyIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrophyIcon = Interactive.withSchema({\n Component: TrophyIconInner,\n componentName: \"<TrophyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst CUP_PATH = \"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\";\nconst LEG_LEFT_PATH = \"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\";\nconst LEG_RIGHT_PATH =\n \"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\";\nconst BASE_PATH = \"M4 22h16\";\nconst HANDLE_LEFT_PATH = \"M6 9H4.5a1 1 0 0 1 0-5H6\";\nconst HANDLE_RIGHT_PATH = \"M18 9h1.5a1 1 0 0 0 0-5H18\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 18,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction TrophyIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const cupDraw = interpolate(linearDraw, [0, 0.78], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const legDraw = interpolate(linearDraw, [0.56, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hop = acting\n ? interpolate(actionProgress, [0, 0.4, 1], [0, -3, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const pop = acting\n ? interpolate(actionProgress, [0, 0.4, 0.75, 1], [1, 1.08, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const handleDraw = acting\n ? interpolate(actionProgress, [0.1, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const cup = drawnPathProps(CUP_PATH, acting ? 1 : cupDraw);\n const legLeft = drawnPathProps(LEG_LEFT_PATH, acting ? 1 : legDraw);\n const legRight = drawnPathProps(LEG_RIGHT_PATH, acting ? 1 : legDraw);\n const base = drawnPathProps(BASE_PATH, acting ? 1 : legDraw);\n const handleLeft = drawnPathProps(HANDLE_LEFT_PATH, handleDraw);\n const handleRight = drawnPathProps(HANDLE_RIGHT_PATH, handleDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const hoistTransform = `translate(${CENTER * (1 - pop)} ${CENTER * (1 - pop) + hop}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={hoistTransform}>\n <path\n d={HANDLE_LEFT_PATH}\n strokeDasharray={handleLeft.strokeDasharray}\n strokeDashoffset={handleLeft.strokeDashoffset}\n />\n <path\n d={HANDLE_RIGHT_PATH}\n strokeDasharray={handleRight.strokeDasharray}\n strokeDashoffset={handleRight.strokeDashoffset}\n />\n <path\n d={CUP_PATH}\n strokeDasharray={cup.strokeDasharray}\n strokeDashoffset={cup.strokeDashoffset}\n />\n <path\n d={LEG_LEFT_PATH}\n strokeDasharray={legLeft.strokeDasharray}\n strokeDashoffset={legLeft.strokeDashoffset}\n />\n <path\n d={LEG_RIGHT_PATH}\n strokeDasharray={legRight.strokeDasharray}\n strokeDashoffset={legRight.strokeDashoffset}\n />\n <path\n d={BASE_PATH}\n strokeDasharray={base.strokeDasharray}\n strokeDashoffset={base.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction TrophyIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978\" />\n <path d=\"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978\" />\n <path d=\"M18 9h1.5a1 1 0 0 0 0-5H18\" />\n <path d=\"M4 22h16\" />\n <path d=\"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z\" />\n <path d=\"M6 9H4.5a1 1 0 0 1 0-5H6\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype TrophyIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TrophyIconBase>;\n\nconst TrophyIconInner = forwardRef<\n HTMLDivElement,\n TrophyIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<TrophyIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TrophyIconBase\n {...(componentProps as unknown as ComponentProps<typeof TrophyIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TrophyIcon = Interactive.withSchema({\n Component: TrophyIconInner,\n componentName: \"<TrophyIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 85
}
diff --git a/registry-artifacts/elements/icon-upload.json b/registry-artifacts/elements/icon-upload.json
index 354cff48..aa7ddab9 100644
--- a/registry-artifacts/elements/icon-upload.json
+++ b/registry-artifacts/elements/icon-upload.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Upload",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-upload",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 15V3\";\nconst SHAFT_STATIC = \"M12 3v12\";\nconst HEAD_PATH = \"M17 8 12 3 7 8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction UploadIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const launchY = interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, -5, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 1],\n [1, 0.96, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${launchY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UploadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={HEAD_PATH} />\n <path d={TRAY_STATIC} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UploadIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UploadIconBase>;\n\nconst UploadIconInner = forwardRef<\n HTMLDivElement,\n UploadIconElementProps & { 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 ?? \"<UploadIcon>\"}\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 <UploadIconBase\n {...(componentProps as unknown as ComponentProps<typeof UploadIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UploadIcon = Interactive.withSchema({\n Component: UploadIconInner,\n componentName: \"<UploadIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst TRAY_DRAW = \"M3 15v4a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-4\";\nconst TRAY_STATIC = \"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\";\nconst SHAFT_DRAW = \"M12 15V3\";\nconst SHAFT_STATIC = \"M12 3v12\";\nconst HEAD_PATH = \"M17 8 12 3 7 8\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction UploadIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const trayProgress = interpolate(linearDraw, [0, 0.714], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const arrowProgress = interpolate(linearDraw, [0.429, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const arrowOpacity = interpolate(linearDraw, [0.429, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tray = drawnPathProps(TRAY_DRAW, trayProgress);\n const shaft = drawnPathProps(SHAFT_DRAW, arrowProgress);\n const head = drawnPathProps(HEAD_PATH, arrowProgress);\n\n const launchY = interpolate(actionProgress, [0, 0.4, 0.7, 1], [0, -5, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const traySquash = interpolate(\n actionProgress,\n [0, 0.2, 0.4, 1],\n [1, 0.96, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n transform={`translate(12 21) scale(1 ${traySquash}) translate(-12 -21)`}\n >\n <path\n d={TRAY_DRAW}\n strokeDasharray={tray.strokeDasharray}\n strokeDashoffset={tray.strokeDashoffset}\n />\n </g>\n <g opacity={arrowOpacity} transform={`translate(0 ${launchY})`}>\n <path\n d={SHAFT_DRAW}\n strokeDasharray={shaft.strokeDasharray}\n strokeDashoffset={shaft.strokeDashoffset}\n />\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UploadIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHAFT_STATIC} />\n <path d={HEAD_PATH} />\n <path d={TRAY_STATIC} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UploadIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof UploadIconBase>;\n\nconst UploadIconInner = forwardRef<\n HTMLDivElement,\n UploadIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<UploadIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <UploadIconBase\n {...(componentProps as unknown as ComponentProps<typeof UploadIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const UploadIcon = Interactive.withSchema({\n Component: UploadIconInner,\n componentName: \"<UploadIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-user-plus.json b/registry-artifacts/elements/icon-user-plus.json
index a7129ce2..9d911eed 100644
--- a/registry-artifacts/elements/icon-user-plus.json
+++ b/registry-artifacts/elements/icon-user-plus.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "User Plus",
"durationInFrames": 75,
"installationMode": "component-owned-sequence",
"slug": "icon-user-plus",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst PLUS_H_PATH = \"M22 11 16 11\";\nconst PLUS_V_PATH = \"M19 8 19 14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction UserPlusIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hProgress = acting\n ? interpolate(actionProgress, [0.08, 0.31], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const vProgress = acting\n ? interpolate(actionProgress, [0.19, 0.42], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const plusPop = acting\n ? interpolate(actionProgress, [0.42, 0.65, 1], [1, 1.3, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n const plusH = drawnPathProps(PLUS_H_PATH, hProgress);\n const plusV = drawnPathProps(PLUS_V_PATH, vProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const plusTransform = `translate(${19 * (1 - plusPop)} ${11 * (1 - plusPop)}) scale(${plusPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n <g transform={plusTransform}>\n <path\n d={PLUS_H_PATH}\n strokeDasharray={plusH.strokeDasharray}\n strokeDashoffset={plusH.strokeDashoffset}\n />\n <path\n d={PLUS_V_PATH}\n strokeDasharray={plusV.strokeDasharray}\n strokeDashoffset={plusV.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserPlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <line x1=\"19\" x2=\"19\" y1=\"8\" y2=\"14\" />\n <line x1=\"22\" x2=\"16\" y1=\"11\" y2=\"11\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UserPlusIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UserPlusIconBase>;\n\nconst UserPlusIconInner = forwardRef<\n HTMLDivElement,\n UserPlusIconElementProps & { 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 ?? \"<UserPlusIcon>\"}\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 <UserPlusIconBase\n {...(componentProps as unknown as ComponentProps<typeof UserPlusIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UserPlusIcon = Interactive.withSchema({\n Component: UserPlusIconInner,\n componentName: \"<UserPlusIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst PLUS_H_PATH = \"M22 11 16 11\";\nconst PLUS_V_PATH = \"M19 8 19 14\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 26,\n loop: false,\n} as const;\n\nfunction UserPlusIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const hProgress = acting\n ? interpolate(actionProgress, [0.08, 0.31], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const vProgress = acting\n ? interpolate(actionProgress, [0.19, 0.42], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const plusPop = acting\n ? interpolate(actionProgress, [0.42, 0.65, 1], [1, 1.3, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n const plusH = drawnPathProps(PLUS_H_PATH, hProgress);\n const plusV = drawnPathProps(PLUS_V_PATH, vProgress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const plusTransform = `translate(${19 * (1 - plusPop)} ${11 * (1 - plusPop)}) scale(${plusPop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n <g transform={plusTransform}>\n <path\n d={PLUS_H_PATH}\n strokeDasharray={plusH.strokeDasharray}\n strokeDashoffset={plusH.strokeDashoffset}\n />\n <path\n d={PLUS_V_PATH}\n strokeDasharray={plusV.strokeDasharray}\n strokeDashoffset={plusV.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserPlusIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n <line x1=\"19\" x2=\"19\" y1=\"8\" y2=\"14\" />\n <line x1=\"22\" x2=\"16\" y1=\"11\" y2=\"11\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UserPlusIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof UserPlusIconBase>;\n\nconst UserPlusIconInner = forwardRef<\n HTMLDivElement,\n UserPlusIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<UserPlusIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <UserPlusIconBase\n {...(componentProps as unknown as ComponentProps<typeof UserPlusIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const UserPlusIcon = Interactive.withSchema({\n Component: UserPlusIconInner,\n componentName: \"<UserPlusIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 75
}
diff --git a/registry-artifacts/elements/icon-user.json b/registry-artifacts/elements/icon-user.json
index 42a6c380..514dc1ea 100644
--- a/registry-artifacts/elements/icon-user.json
+++ b/registry-artifacts/elements/icon-user.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "User",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-user",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M12 3 A4 4 0 0 1 16 7 A4 4 0 0 1 12 11 A4 4 0 0 1 8 7 A4 4 0 0 1 12 3\";\nconst SHOULDERS_PATH = \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction UserIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const headDip = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const shoulderRise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${headDip})`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${shoulderRise})`}>\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UserIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UserIconBase>;\n\nconst UserIconInner = forwardRef<\n HTMLDivElement,\n UserIconElementProps & { 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 ?? \"<UserIcon>\"}\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 <UserIconBase\n {...(componentProps as unknown as ComponentProps<typeof UserIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UserIcon = Interactive.withSchema({\n Component: UserIconInner,\n componentName: \"<UserIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M12 3 A4 4 0 0 1 16 7 A4 4 0 0 1 12 11 A4 4 0 0 1 8 7 A4 4 0 0 1 12 3\";\nconst SHOULDERS_PATH = \"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction UserIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const headDip = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, 1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n const shoulderRise = acting\n ? interpolate(actionProgress, [0, 0.45, 1], [0, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(0 ${headDip})`}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n </g>\n <g transform={`translate(0 ${shoulderRise})`}>\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UserIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <circle cx=\"12\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UserIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof UserIconBase>;\n\nconst UserIconInner = forwardRef<\n HTMLDivElement,\n UserIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<UserIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <UserIconBase\n {...(componentProps as unknown as ComponentProps<typeof UserIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const UserIcon = Interactive.withSchema({\n Component: UserIconInner,\n componentName: \"<UserIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-users.json b/registry-artifacts/elements/icon-users.json
index 8f944775..81392835 100644
--- a/registry-artifacts/elements/icon-users.json
+++ b/registry-artifacts/elements/icon-users.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Users",
"durationInFrames": 80,
"installationMode": "component-owned-sequence",
"slug": "icon-users",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst BACK_HEAD_PATH = \"M16 3.128a4 4 0 0 1 0 7.744\";\nconst BACK_SHOULDERS_PATH = \"M22 21v-2a4 4 0 0 0-3-3.87\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction UsersIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.42], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const backOpacity = acting\n ? interpolate(actionProgress, [0.33, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const backSlide = acting\n ? interpolate(actionProgress, [0.33, 1], [-2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : -2;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const frontTransform = `translate(${9 * (1 - pop)} ${12 * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${backSlide} 0)`} opacity={backOpacity}>\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n </g>\n <g transform={frontTransform}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UsersIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UsersIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof UsersIconBase>;\n\nconst UsersIconInner = forwardRef<\n HTMLDivElement,\n UsersIconElementProps & { 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 ?? \"<UsersIcon>\"}\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 <UsersIconBase\n {...(componentProps as unknown as ComponentProps<typeof UsersIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const UsersIcon = Interactive.withSchema({\n Component: UsersIconInner,\n componentName: \"<UsersIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst HEAD_PATH =\n \"M9 3 A4 4 0 0 1 13 7 A4 4 0 0 1 9 11 A4 4 0 0 1 5 7 A4 4 0 0 1 9 3\";\nconst SHOULDERS_PATH = \"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2\";\nconst BACK_HEAD_PATH = \"M16 3.128a4 4 0 0 1 0 7.744\";\nconst BACK_SHOULDERS_PATH = \"M22 21v-2a4 4 0 0 0-3-3.87\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 24,\n loop: false,\n} as const;\n\nfunction UsersIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const headDraw = interpolate(linearDraw, [0, 0.71], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shouldersDraw = interpolate(linearDraw, [0.43, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const pop = acting\n ? interpolate(actionProgress, [0, 0.25, 0.42], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n const backOpacity = acting\n ? interpolate(actionProgress, [0.33, 0.9], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const backSlide = acting\n ? interpolate(actionProgress, [0.33, 1], [-2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : -2;\n\n const head = drawnPathProps(HEAD_PATH, headDraw);\n const shoulders = drawnPathProps(SHOULDERS_PATH, shouldersDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const frontTransform = `translate(${9 * (1 - pop)} ${12 * (1 - pop)}) scale(${pop})`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={`translate(${backSlide} 0)`} opacity={backOpacity}>\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n </g>\n <g transform={frontTransform}>\n <path\n d={HEAD_PATH}\n strokeDasharray={head.strokeDasharray}\n strokeDashoffset={head.strokeDashoffset}\n />\n <path\n d={SHOULDERS_PATH}\n strokeDasharray={shoulders.strokeDasharray}\n strokeDashoffset={shoulders.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction UsersIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SHOULDERS_PATH} />\n <path d={BACK_HEAD_PATH} />\n <path d={BACK_SHOULDERS_PATH} />\n <circle cx=\"9\" cy=\"7\" r=\"4\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype UsersIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof UsersIconBase>;\n\nconst UsersIconInner = forwardRef<\n HTMLDivElement,\n UsersIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<UsersIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <UsersIconBase\n {...(componentProps as unknown as ComponentProps<typeof UsersIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const UsersIcon = Interactive.withSchema({\n Component: UsersIconInner,\n componentName: \"<UsersIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 80
}
diff --git a/registry-artifacts/elements/icon-video.json b/registry-artifacts/elements/icon-video.json
index c17a22f9..8837bb19 100644
--- a/registry-artifacts/elements/icon-video.json
+++ b/registry-artifacts/elements/icon-video.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Video",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-video",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 6H14A2 2 0 0 1 16 8V16A2 2 0 0 1 14 18H4A2 2 0 0 1 2 16V8A2 2 0 0 1 4 6Z\";\nconst LENS_PATH =\n \"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction VideoIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pan = acting\n ? interpolate(actionProgress, [0, 0.5, 0.75, 1], [0, 8, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`rotate(${pan} 16 11.75)`}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction VideoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={LENS_PATH} />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype VideoIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VideoIconBase>;\n\nconst VideoIconInner = forwardRef<\n HTMLDivElement,\n VideoIconElementProps & { 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 ?? \"<VideoIcon>\"}\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 <VideoIconBase\n {...(componentProps as unknown as ComponentProps<typeof VideoIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VideoIcon = Interactive.withSchema({\n Component: VideoIconInner,\n componentName: \"<VideoIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst BODY_PATH =\n \"M4 6H14A2 2 0 0 1 16 8V16A2 2 0 0 1 14 18H4A2 2 0 0 1 2 16V8A2 2 0 0 1 4 6Z\";\nconst LENS_PATH =\n \"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5\";\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction VideoIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.75], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const lensDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const pan = acting\n ? interpolate(actionProgress, [0, 0.5, 0.75, 1], [0, 8, -1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 0;\n\n const body = drawnPathProps(BODY_PATH, bodyDraw);\n const lens = drawnPathProps(LENS_PATH, lensDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={`rotate(${pan} 16 11.75)`}>\n <path\n d={LENS_PATH}\n strokeDasharray={lens.strokeDasharray}\n strokeDashoffset={lens.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction VideoIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={LENS_PATH} />\n <rect x=\"2\" y=\"6\" width=\"14\" height=\"12\" rx=\"2\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype VideoIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof VideoIconBase>;\n\nconst VideoIconInner = forwardRef<\n HTMLDivElement,\n VideoIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<VideoIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <VideoIconBase\n {...(componentProps as unknown as ComponentProps<typeof VideoIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const VideoIcon = Interactive.withSchema({\n Component: VideoIconInner,\n componentName: \"<VideoIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-volume-2.json b/registry-artifacts/elements/icon-volume-2.json
index f8e4c3de..0b237b25 100644
--- a/registry-artifacts/elements/icon-volume-2.json
+++ b/registry-artifacts/elements/icon-volume-2.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Volume 2",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-volume-2",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst INNER_PATH = \"M16 9a5 5 0 0 1 0 6\";\nconst OUTER_PATH = \"M19.364 18.364a9 9 0 0 0 0-12.728\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction Volume2IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.4, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const outerDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const innerProgress = acting ? 1 : innerDraw;\n const outerProgress = acting ? 1 : outerDraw;\n\n const innerShift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const innerGrow = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const outerShift = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const outerGrow = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const body = drawnPathProps(SPEAKER_PATH, bodyDraw);\n const inner = drawnPathProps(INNER_PATH, innerProgress);\n const outer = drawnPathProps(OUTER_PATH, outerProgress);\n\n const innerTransform = `translate(${11 * (1 - innerGrow) + innerShift} ${12 * (1 - innerGrow)}) scale(${innerGrow})`;\n const outerTransform = `translate(${11 * (1 - outerGrow) + outerShift} ${12 * (1 - outerGrow)}) scale(${outerGrow})`;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={innerTransform}>\n <path\n d={INNER_PATH}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n <g transform={outerTransform}>\n <path\n d={OUTER_PATH}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Volume2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <path d={INNER_PATH} />\n <path d={OUTER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype Volume2IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof Volume2IconBase>;\n\nconst Volume2IconInner = forwardRef<\n HTMLDivElement,\n Volume2IconElementProps & { 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 ?? \"<Volume2Icon>\"}\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 <Volume2IconBase\n {...(componentProps as unknown as ComponentProps<typeof Volume2IconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Volume2Icon = Interactive.withSchema({\n Component: Volume2IconInner,\n componentName: \"<Volume2Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst INNER_PATH = \"M16 9a5 5 0 0 1 0 6\";\nconst OUTER_PATH = \"M19.364 18.364a9 9 0 0 0 0-12.728\";\n\nconst TIMINGS = {\n drawDurationInFrames: 20,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction Volume2IconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const bodyDraw = interpolate(linearDraw, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const innerDraw = interpolate(linearDraw, [0.4, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const outerDraw = interpolate(linearDraw, [0.6, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const innerProgress = acting ? 1 : innerDraw;\n const outerProgress = acting ? 1 : outerDraw;\n\n const innerShift = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const innerGrow = acting\n ? interpolate(actionProgress, [0, 0.35, 0.7], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const outerShift = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [0, 2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0;\n const outerGrow = acting\n ? interpolate(actionProgress, [0.12, 0.47, 0.82], [1, 1.08, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const body = drawnPathProps(SPEAKER_PATH, bodyDraw);\n const inner = drawnPathProps(INNER_PATH, innerProgress);\n const outer = drawnPathProps(OUTER_PATH, outerProgress);\n\n const innerTransform = `translate(${11 * (1 - innerGrow) + innerShift} ${12 * (1 - innerGrow)}) scale(${innerGrow})`;\n const outerTransform = `translate(${11 * (1 - outerGrow) + outerShift} ${12 * (1 - outerGrow)}) scale(${outerGrow})`;\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <g transform={innerTransform}>\n <path\n d={INNER_PATH}\n strokeDasharray={inner.strokeDasharray}\n strokeDashoffset={inner.strokeDashoffset}\n />\n </g>\n <g transform={outerTransform}>\n <path\n d={OUTER_PATH}\n strokeDasharray={outer.strokeDasharray}\n strokeDashoffset={outer.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction Volume2IconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <path d={INNER_PATH} />\n <path d={OUTER_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype Volume2IconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof Volume2IconBase>;\n\nconst Volume2IconInner = forwardRef<\n HTMLDivElement,\n Volume2IconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<Volume2Icon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <Volume2IconBase\n {...(componentProps as unknown as ComponentProps<typeof Volume2IconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const Volume2Icon = Interactive.withSchema({\n Component: Volume2IconInner,\n componentName: \"<Volume2Icon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-volume-x.json b/registry-artifacts/elements/icon-volume-x.json
index 325c00b3..2f28aa80 100644
--- a/registry-artifacts/elements/icon-volume-x.json
+++ b/registry-artifacts/elements/icon-volume-x.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Volume X",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-volume-x",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst X1_PATH = \"M22 9 16 15\";\nconst X2_PATH = \"M16 9 22 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction VolumeXIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const x1Progress = acting\n ? interpolate(actionProgress, [0.09, 0.32], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const x2Progress = acting\n ? interpolate(actionProgress, [0.23, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.45, 0.55, 0.65, 0.75, 0.85, 1],\n [0, 2, -1.5, 1, -0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const body = drawnPathProps(SPEAKER_PATH, drawProgress);\n const x1 = drawnPathProps(X1_PATH, x1Progress);\n const x2 = drawnPathProps(X2_PATH, x2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={X1_PATH}\n strokeDasharray={x1.strokeDasharray}\n strokeDashoffset={x1.strokeDashoffset}\n />\n <path\n d={X2_PATH}\n strokeDasharray={x2.strokeDasharray}\n strokeDashoffset={x2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction VolumeXIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype VolumeXIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VolumeXIconBase>;\n\nconst VolumeXIconInner = forwardRef<\n HTMLDivElement,\n VolumeXIconElementProps & { 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 ?? \"<VolumeXIcon>\"}\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 <VolumeXIconBase\n {...(componentProps as unknown as ComponentProps<typeof VolumeXIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VolumeXIcon = Interactive.withSchema({\n Component: VolumeXIconInner,\n componentName: \"<VolumeXIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst SPEAKER_PATH =\n \"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z\";\nconst X1_PATH = \"M22 9 16 15\";\nconst X2_PATH = \"M16 9 22 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 22,\n loop: false,\n} as const;\n\nfunction VolumeXIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const x1Progress = acting\n ? interpolate(actionProgress, [0.09, 0.32], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n const x2Progress = acting\n ? interpolate(actionProgress, [0.23, 0.45], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n })\n : 0;\n\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.45, 0.55, 0.65, 0.75, 0.85, 1],\n [0, 2, -1.5, 1, -0.5, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : 0;\n\n const body = drawnPathProps(SPEAKER_PATH, drawProgress);\n const x1 = drawnPathProps(X1_PATH, x1Progress);\n const x2 = drawnPathProps(X2_PATH, x2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={SPEAKER_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={X1_PATH}\n strokeDasharray={x1.strokeDasharray}\n strokeDashoffset={x1.strokeDashoffset}\n />\n <path\n d={X2_PATH}\n strokeDasharray={x2.strokeDasharray}\n strokeDashoffset={x2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction VolumeXIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={SPEAKER_PATH} />\n <line x1=\"22\" x2=\"16\" y1=\"9\" y2=\"15\" />\n <line x1=\"16\" x2=\"22\" y1=\"9\" y2=\"15\" />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype VolumeXIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof VolumeXIconBase>;\n\nconst VolumeXIconInner = forwardRef<\n HTMLDivElement,\n VolumeXIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<VolumeXIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <VolumeXIconBase\n {...(componentProps as unknown as ComponentProps<typeof VolumeXIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const VolumeXIcon = Interactive.withSchema({\n Component: VolumeXIconInner,\n componentName: \"<VolumeXIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-wallet.json b/registry-artifacts/elements/icon-wallet.json
index 974aacf9..f2f8a7c7 100644
--- a/registry-artifacts/elements/icon-wallet.json
+++ b/registry-artifacts/elements/icon-wallet.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Wallet",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-wallet",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAP_PATH =\n \"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\";\nconst BODY_PATH = \"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction WalletIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const fatten = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const flap = drawnPathProps(FLAP_PATH, acting ? 1 : flapDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const fattenTransform = `translate(${CENTER * (1 - fatten)} 0) scale(${fatten} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={fattenTransform}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_PATH}\n strokeDasharray={flap.strokeDasharray}\n strokeDashoffset={flap.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction WalletIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <path d={BODY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype WalletIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof WalletIconBase>;\n\nconst WalletIconInner = forwardRef<\n HTMLDivElement,\n WalletIconElementProps & { 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 ?? \"<WalletIcon>\"}\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 <WalletIconBase\n {...(componentProps as unknown as ComponentProps<typeof WalletIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const WalletIcon = Interactive.withSchema({\n Component: WalletIconInner,\n componentName: \"<WalletIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FLAP_PATH =\n \"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1\";\nconst BODY_PATH = \"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4\";\n\nconst CENTER = 12;\n\nconst TIMINGS = {\n drawDurationInFrames: 16,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction WalletIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const bodyDraw = interpolate(linearDraw, [0, 0.7], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const flapDraw = interpolate(linearDraw, [0.5, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const fatten = acting\n ? interpolate(actionProgress, [0.1, 0.5, 1], [1, 1.05, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n })\n : 1;\n\n const flap = drawnPathProps(FLAP_PATH, acting ? 1 : flapDraw);\n const body = drawnPathProps(BODY_PATH, acting ? 1 : bodyDraw);\n\n const scale = 0.85 + 0.15 * scaleIn;\n const fattenTransform = `translate(${CENTER * (1 - fatten)} 0) scale(${fatten} 1)`;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g transform={fattenTransform}>\n <path\n d={BODY_PATH}\n strokeDasharray={body.strokeDasharray}\n strokeDashoffset={body.strokeDashoffset}\n />\n <path\n d={FLAP_PATH}\n strokeDasharray={flap.strokeDasharray}\n strokeDashoffset={flap.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction WalletIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FLAP_PATH} />\n <path d={BODY_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype WalletIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof WalletIconBase>;\n\nconst WalletIconInner = forwardRef<\n HTMLDivElement,\n WalletIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<WalletIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <WalletIconBase\n {...(componentProps as unknown as ComponentProps<typeof WalletIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const WalletIcon = Interactive.withSchema({\n Component: WalletIconInner,\n componentName: \"<WalletIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-x-circle.json b/registry-artifacts/elements/icon-x-circle.json
index d4f56780..924c6ddd 100644
--- a/registry-artifacts/elements/icon-x-circle.json
+++ b/registry-artifacts/elements/icon-x-circle.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "X Circle",
"durationInFrames": 70,
"installationMode": "component-owned-sequence",
"slug": "icon-x-circle",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst SLASH1_PATH = \"M15 9 9 15\";\nconst SLASH2_PATH = \"M9 9 15 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction XCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slash1Draw = interpolate(actionProgress, [0.1, 0.35], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slash2Draw = interpolate(actionProgress, [0.25, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.5, 0.62, 0.74, 0.86, 1],\n [0, 2, -2, 1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const slash1Progress = animation === \"draw\" ? 1 : acting ? slash1Draw : 0;\n const slash2Progress = animation === \"draw\" ? 1 : acting ? slash2Draw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const slash1 = drawnPathProps(SLASH1_PATH, slash1Progress);\n const slash2 = drawnPathProps(SLASH2_PATH, slash2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={SLASH1_PATH}\n strokeDasharray={slash1.strokeDasharray}\n strokeDashoffset={slash1.strokeDashoffset}\n />\n <path\n d={SLASH2_PATH}\n strokeDasharray={slash2.strokeDasharray}\n strokeDashoffset={slash2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={SLASH1_PATH} />\n <path d={SLASH2_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype XCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof XCircleIconBase>;\n\nconst XCircleIconInner = forwardRef<\n HTMLDivElement,\n XCircleIconElementProps & { 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 ?? \"<XCircleIcon>\"}\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 <XCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof XCircleIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const XCircleIcon = Interactive.withSchema({\n Component: XCircleIconInner,\n componentName: \"<XCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst RING_PATH = \"M12 2a10 10 0 1 0 0 20 10 10 0 1 0 0-20Z\";\nconst SLASH1_PATH = \"M15 9 9 15\";\nconst SLASH2_PATH = \"M9 9 15 15\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 20,\n loop: false,\n} as const;\n\nfunction XCircleIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress, actionFrame } =\n useIconAnimation({ animation, loop, speed }, TIMINGS);\n\n const acting = animation !== \"draw\" && actionFrame >= 0;\n\n const slash1Draw = interpolate(actionProgress, [0.1, 0.35], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const slash2Draw = interpolate(actionProgress, [0.25, 0.5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n const shake = acting\n ? interpolate(\n actionProgress,\n [0.5, 0.62, 0.74, 0.86, 1],\n [0, 2, -2, 1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n },\n )\n : 0;\n\n const slash1Progress = animation === \"draw\" ? 1 : acting ? slash1Draw : 0;\n const slash2Progress = animation === \"draw\" ? 1 : acting ? slash2Draw : 0;\n\n const ring = drawnPathProps(RING_PATH, drawProgress);\n const slash1 = drawnPathProps(SLASH1_PATH, slash1Progress);\n const slash2 = drawnPathProps(SLASH2_PATH, slash2Progress);\n\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `translateX(${shake}px) scale(${scale})`,\n }}\n >\n <path\n d={RING_PATH}\n strokeDasharray={ring.strokeDasharray}\n strokeDashoffset={ring.strokeDashoffset}\n />\n <path\n d={SLASH1_PATH}\n strokeDasharray={slash1.strokeDasharray}\n strokeDashoffset={slash1.strokeDashoffset}\n />\n <path\n d={SLASH2_PATH}\n strokeDasharray={slash2.strokeDasharray}\n strokeDashoffset={slash2.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XCircleIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d={SLASH1_PATH} />\n <path d={SLASH2_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype XCircleIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof XCircleIconBase>;\n\nconst XCircleIconInner = forwardRef<\n HTMLDivElement,\n XCircleIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<XCircleIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <XCircleIconBase\n {...(componentProps as unknown as ComponentProps<typeof XCircleIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const XCircleIcon = Interactive.withSchema({\n Component: XCircleIconInner,\n componentName: \"<XCircleIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 70
}
diff --git a/registry-artifacts/elements/icon-x.json b/registry-artifacts/elements/icon-x.json
index 5f50eb07..1cbb21be 100644
--- a/registry-artifacts/elements/icon-x.json
+++ b/registry-artifacts/elements/icon-x.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "X",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-x",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FIRST_PATH = \"M18 6 6 18\";\nconst SECOND_PATH = \"M6 6 18 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction XIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const firstProgress = interpolate(linearDraw, [0, 0.57], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const secondProgress = interpolate(linearDraw, [0.29, 0.86], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const first = drawnPathProps(FIRST_PATH, firstProgress);\n const second = drawnPathProps(SECOND_PATH, secondProgress);\n\n const rotate = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -8, 6, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={FIRST_PATH}\n strokeDasharray={first.strokeDasharray}\n strokeDashoffset={first.strokeDashoffset}\n />\n <path\n d={SECOND_PATH}\n strokeDasharray={second.strokeDasharray}\n strokeDashoffset={second.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FIRST_PATH} />\n <path d={SECOND_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype XIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof XIconBase>;\n\nconst XIconInner = forwardRef<\n HTMLDivElement,\n XIconElementProps & { 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 ?? \"<XIcon>\"}\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 <XIconBase\n {...(componentProps as unknown as ComponentProps<typeof XIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const XIcon = Interactive.withSchema({\n Component: XIconInner,\n componentName: \"<XIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst FIRST_PATH = \"M18 6 6 18\";\nconst SECOND_PATH = \"M6 6 18 18\";\n\nconst TIMINGS = {\n drawDurationInFrames: 14,\n actionDelayInFrames: 2,\n actionDurationInFrames: 18,\n loop: false,\n} as const;\n\nfunction XIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const firstProgress = interpolate(linearDraw, [0, 0.57], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const secondProgress = interpolate(linearDraw, [0.29, 0.86], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n\n const first = drawnPathProps(FIRST_PATH, firstProgress);\n const second = drawnPathProps(SECOND_PATH, secondProgress);\n\n const rotate = interpolate(\n actionProgress,\n [0, 0.25, 0.5, 0.75, 1],\n [0, -8, 6, -3, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const scale = 0.85 + 0.15 * scaleIn;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `rotate(${rotate}deg) scale(${scale})`,\n }}\n >\n <path\n d={FIRST_PATH}\n strokeDasharray={first.strokeDasharray}\n strokeDashoffset={first.strokeDashoffset}\n />\n <path\n d={SECOND_PATH}\n strokeDasharray={second.strokeDasharray}\n strokeDashoffset={second.strokeDashoffset}\n />\n </svg>\n );\n}\n\nfunction XIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={FIRST_PATH} />\n <path d={SECOND_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype XIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof XIconBase>;\n\nconst XIconInner = forwardRef<\n HTMLDivElement,\n XIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<XIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <XIconBase\n {...(componentProps as unknown as ComponentProps<typeof XIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const XIcon = Interactive.withSchema({\n Component: XIconInner,\n componentName: \"<XIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/icon-zap.json b/registry-artifacts/elements/icon-zap.json
index 7a74b000..d5683539 100644
--- a/registry-artifacts/elements/icon-zap.json
+++ b/registry-artifacts/elements/icon-zap.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 48,
+ "height": 48
+ },
"displayName": "Zap",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "icon-zap",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ZAP_PATH =\n \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 14,\n loop: false,\n} as const;\n\nfunction ZapIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boltProgress = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const bolt = drawnPathProps(ZAP_PATH, boltProgress);\n\n const flash = interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.45, 0.6, 1],\n [1, 0.3, 1, 0.3, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const pop = interpolate(actionProgress, [0, 0.3, 0.6, 1], [1, 1.1, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const strikeEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const strikeX = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, 1.5, -3, 0],\n strikeEase,\n );\n const strikeY = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, -2, 4, 0],\n strikeEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 0.7, 1],\n [0, -4, 9, -2, 0],\n strikeEase,\n );\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n opacity={flash}\n transform={`translate(${strikeX} ${strikeY}) translate(12 12) skewX(${skew}) translate(-12 -12)`}\n >\n <path\n d={ZAP_PATH}\n strokeDasharray={bolt.strokeDasharray}\n strokeDashoffset={bolt.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ZapIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ZAP_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ZapIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ZapIconBase>;\n\nconst ZapIconInner = forwardRef<\n HTMLDivElement,\n ZapIconElementProps & { 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 ?? \"<ZapIcon>\"}\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 <ZapIconBase\n {...(componentProps as unknown as ComponentProps<typeof ZapIconBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ZapIcon = Interactive.withSchema({\n Component: ZapIconInner,\n componentName: \"<ZapIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { evolvePath } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface IconAnimationProps {\n animation?: \"draw\" | \"action\" | \"both\";\n loop?: boolean;\n speed?: number;\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}\n\ninterface IconTimings {\n drawDurationInFrames?: number;\n actionDelayInFrames?: number;\n actionDurationInFrames?: number;\n loop?: boolean;\n}\n\ninterface IconTimeline {\n drawProgress: number;\n scaleIn: number;\n actionFrame: number;\n actionProgress: number;\n cycleIndex: number;\n}\n\nfunction clamp01(t: number): number {\n return t < 0 ? 0 : t > 1 ? 1 : t;\n}\n\nfunction easeOut(t: number): number {\n return 1 - (1 - t) ** 3;\n}\n\nfunction iconTimeline(\n frame: number,\n fps: number,\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const animation = props.animation ?? \"both\";\n const loop = props.loop ?? timings.loop ?? false;\n const drawDuration = timings.drawDurationInFrames ?? 14;\n const actionDelay = timings.actionDelayInFrames ?? 2;\n const actionDuration = timings.actionDurationInFrames ?? 20;\n\n const drawProgress =\n animation === \"action\"\n ? 1\n : easeOut(clamp01(drawDuration > 0 ? frame / drawDuration : 1));\n\n const scaleIn = clamp01(\n spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 220, mass: 0.7 },\n durationInFrames: Math.max(1, drawDuration),\n }),\n );\n\n const actionStart = animation === \"action\" ? 0 : drawDuration + actionDelay;\n const sinceStart = frame - actionStart;\n\n if (animation === \"draw\" || sinceStart < 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 0,\n cycleIndex: 0,\n };\n }\n\n if (actionDuration <= 0) {\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: 1,\n cycleIndex: 0,\n };\n }\n\n if (loop) {\n const cycleIndex = Math.floor(sinceStart / actionDuration);\n const local = sinceStart - cycleIndex * actionDuration;\n return {\n drawProgress,\n scaleIn,\n actionFrame: local,\n actionProgress: local / actionDuration,\n cycleIndex,\n };\n }\n\n return {\n drawProgress,\n scaleIn,\n actionFrame: sinceStart,\n actionProgress: clamp01(sinceStart / actionDuration),\n cycleIndex: 0,\n };\n}\n\nfunction useIconAnimation(\n props: IconAnimationProps,\n timings: IconTimings,\n): IconTimeline {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const speed = props.speed ?? 1;\n return iconTimeline(frame * speed, fps, props, timings);\n}\n\nfunction staggeredProgress(\n progress: number,\n index: number,\n count: number,\n overlap = 0.5,\n): number {\n if (count <= 1) return clamp01(progress);\n const o = clamp01(overlap);\n const width = 1 / (count - (count - 1) * o);\n const start = index * width * (1 - o);\n return clamp01((progress - start) / width);\n}\n\nfunction drawnPathProps(\n d: string,\n progress: number,\n): { strokeDasharray: string; strokeDashoffset: number } {\n return evolvePath(clamp01(progress), d);\n}\n\nconst ZAP_PATH =\n \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\";\n\nconst TIMINGS = {\n drawDurationInFrames: 10,\n actionDelayInFrames: 2,\n actionDurationInFrames: 14,\n loop: false,\n} as const;\n\nfunction ZapIconBase({\n animation = \"both\",\n loop,\n speed,\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: IconAnimationProps) {\n const { drawProgress, scaleIn, actionProgress } = useIconAnimation(\n { animation, loop, speed },\n TIMINGS,\n );\n\n const linearDraw = 1 - (1 - drawProgress) ** (1 / 3);\n\n const boltProgress = interpolate(linearDraw, [0, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n });\n\n const bolt = drawnPathProps(ZAP_PATH, boltProgress);\n\n const flash = interpolate(\n actionProgress,\n [0, 0.15, 0.3, 0.45, 0.6, 1],\n [1, 0.3, 1, 0.3, 1, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const pop = interpolate(actionProgress, [0, 0.3, 0.6, 1], [1, 1.1, 1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const strikeEase = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.quad),\n } as const;\n const strikeX = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, 1.5, -3, 0],\n strikeEase,\n );\n const strikeY = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 1],\n [0, -2, 4, 0],\n strikeEase,\n );\n const skew = interpolate(\n actionProgress,\n [0, 0.15, 0.4, 0.7, 1],\n [0, -4, 9, -2, 0],\n strikeEase,\n );\n const scale = (0.85 + 0.15 * scaleIn) * pop;\n\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n overflow: \"visible\",\n transformOrigin: \"center\",\n transform: `scale(${scale})`,\n }}\n >\n <g\n opacity={flash}\n transform={`translate(${strikeX} ${strikeY}) translate(12 12) skewX(${skew}) translate(-12 -12)`}\n >\n <path\n d={ZAP_PATH}\n strokeDasharray={bolt.strokeDasharray}\n strokeDashoffset={bolt.strokeDashoffset}\n />\n </g>\n </svg>\n );\n}\n\nfunction ZapIconStatic({\n size = 48,\n color = \"currentColor\",\n strokeWidth = 2,\n className,\n}: {\n size?: number;\n color?: string;\n strokeWidth?: number;\n className?: string;\n}) {\n return (\n <svg\n className={className}\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d={ZAP_PATH} />\n </svg>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n animation: {\n type: \"enum\",\n default: \"both\",\n variants: {\n draw: {},\n action: {},\n both: {},\n },\n description: \"Animation\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop\",\n },\n size: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 4,\n default: 48,\n description: \"Size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n strokeWidth: {\n type: \"number\",\n min: 1,\n max: 3,\n step: 0.25,\n default: 2,\n description: \"Stroke width\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 48,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"animation\",\"loop\",\"size\",\"color\",\"strokeWidth\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n animation: \"both\",\n loop: false,\n size: 48,\n color: \"#171717\",\n strokeWidth: 2,\n speed: 1,\n};\n\ntype ZapIconElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ZapIconBase>;\n\nconst ZapIconInner = forwardRef<\n HTMLDivElement,\n ZapIconElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 48, height = 48, ...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 ?? \"<ZapIcon>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ZapIconBase\n {...(componentProps as unknown as ComponentProps<typeof ZapIconBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ZapIcon = Interactive.withSchema({\n Component: ZapIconInner,\n componentName: \"<ZapIcon>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/infinite-bento-pan.json b/registry-artifacts/elements/infinite-bento-pan.json
index 52b1e8ae..867e2879 100644
--- a/registry-artifacts/elements/infinite-bento-pan.json
+++ b/registry-artifacts/elements/infinite-bento-pan.json
@@ -8,7 +8,7 @@
"durationInFrames": 300,
"installationMode": "component-owned-sequence",
"slug": "infinite-bento-pan",
- "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nfunction InfiniteBentoPanBase({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n transform: `translate(${-px}px, ${-py}px)`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n panSpeed: {\n type: \"number\",\n min: 0.25,\n max: 3,\n step: 0.25,\n default: 1,\n description: \"Pan speed\",\n hiddenFromList: false,\n },\n accentColor: {\n type: \"color\",\n default: \"#7c3aed\",\n description: \"Accent color\",\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([\"panSpeed\",\"accentColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n panSpeed: 1,\n accentColor: \"#7c3aed\",\n speed: 1,\n};\n\ntype InfiniteBentoPanElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfiniteBentoPanBase>;\n\nconst InfiniteBentoPanInner = forwardRef<\n HTMLDivElement,\n InfiniteBentoPanElementProps & { 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 ?? \"<InfiniteBentoPan>\"}\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 <InfiniteBentoPanBase\n {...(componentProps as unknown as ComponentProps<typeof InfiniteBentoPanBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfiniteBentoPan = Interactive.withSchema({\n Component: InfiniteBentoPanInner,\n componentName: \"<InfiniteBentoPan>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nfunction InfiniteBentoPanBase({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n translate: `${-px}px ${-py}px`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n panSpeed: {\n type: \"number\",\n min: 0.25,\n max: 3,\n step: 0.25,\n default: 1,\n description: \"Pan speed\",\n hiddenFromList: false,\n },\n accentColor: {\n type: \"color\",\n default: \"#7c3aed\",\n description: \"Accent color\",\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([\"panSpeed\",\"accentColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n panSpeed: 1,\n accentColor: \"#7c3aed\",\n speed: 1,\n};\n\ntype InfiniteBentoPanElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfiniteBentoPanBase>;\n\nconst InfiniteBentoPanInner = forwardRef<\n HTMLDivElement,\n InfiniteBentoPanElementProps & { 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 ?? \"<InfiniteBentoPan>\"}\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 <InfiniteBentoPanBase\n {...(componentProps as unknown as ComponentProps<typeof InfiniteBentoPanBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfiniteBentoPan = Interactive.withSchema({\n Component: InfiniteBentoPanInner,\n componentName: \"<InfiniteBentoPan>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 300
}
diff --git a/registry-artifacts/elements/infinite-marquee.json b/registry-artifacts/elements/infinite-marquee.json
index 3ff55226..62ab99c4 100644
--- a/registry-artifacts/elements/infinite-marquee.json
+++ b/registry-artifacts/elements/infinite-marquee.json
@@ -8,7 +8,7 @@
"durationInFrames": 180,
"installationMode": "component-owned-sequence",
"slug": "infinite-marquee",
- "sourceCode": "import { Interactive, Sequence, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nfunction InfiniteMarqueeBase({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"ship · build · animate · \",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 240,\n step: 1,\n default: 120,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n pixelsPerFrame: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 4,\n description: \"Pixels / frame\",\n hiddenFromList: false,\n },\n stroke: {\n type: \"boolean\",\n default: false,\n description: \"Stroke\",\n },\n strokeColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Stroke color\",\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([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"pixelsPerFrame\",\"stroke\",\"strokeColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"ship · build · animate · \",\n fontSize: 120,\n color: \"#171717\",\n fontWeight: \"700\",\n pixelsPerFrame: 4,\n stroke: false,\n strokeColor: \"#171717\",\n speed: 1,\n};\n\ntype InfiniteMarqueeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfiniteMarqueeBase>;\n\nconst InfiniteMarqueeInner = forwardRef<\n HTMLDivElement,\n InfiniteMarqueeElementProps & { 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 ?? \"<InfiniteMarquee>\"}\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 <InfiniteMarqueeBase\n {...(componentProps as unknown as ComponentProps<typeof InfiniteMarqueeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfiniteMarquee = Interactive.withSchema({\n Component: InfiniteMarqueeInner,\n componentName: \"<InfiniteMarquee>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nfunction InfiniteMarqueeBase({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n translate: `${offset}px`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"ship · build · animate · \",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 240,\n step: 1,\n default: 120,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n pixelsPerFrame: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 4,\n description: \"Pixels / frame\",\n hiddenFromList: false,\n },\n stroke: {\n type: \"boolean\",\n default: false,\n description: \"Stroke\",\n },\n strokeColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Stroke color\",\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([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"pixelsPerFrame\",\"stroke\",\"strokeColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"ship · build · animate · \",\n fontSize: 120,\n color: \"#171717\",\n fontWeight: \"700\",\n pixelsPerFrame: 4,\n stroke: false,\n strokeColor: \"#171717\",\n speed: 1,\n};\n\ntype InfiniteMarqueeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InfiniteMarqueeBase>;\n\nconst InfiniteMarqueeInner = forwardRef<\n HTMLDivElement,\n InfiniteMarqueeElementProps & { 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 ?? \"<InfiniteMarquee>\"}\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 <InfiniteMarqueeBase\n {...(componentProps as unknown as ComponentProps<typeof InfiniteMarqueeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InfiniteMarquee = Interactive.withSchema({\n Component: InfiniteMarqueeInner,\n componentName: \"<InfiniteMarquee>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 180
}
diff --git a/registry-artifacts/elements/inline-highlight.json b/registry-artifacts/elements/inline-highlight.json
index ba8eadf5..1afd3b7d 100644
--- a/registry-artifacts/elements/inline-highlight.json
+++ b/registry-artifacts/elements/inline-highlight.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 640,
+ "height": 100
+ },
"displayName": "Inline Highlight",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "inline-highlight",
- "sourceCode": "import { Interactive, Sequence, interpolate, interpolateColors, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InlineHighlightProps {\n before: string;\n highlight: string;\n after?: string;\n baseColor?: string;\n highlightColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction InlineHighlightBase({\n before,\n highlight,\n after = \"\",\n baseColor = \"#171717\",\n highlightColor = \"#ff5e3a\",\n fontSize = 48,\n fontWeight = 600,\n speed = 1,\n className,\n}: InlineHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const progress = interpolate(\n frame,\n [durationInFrames * 0.2, durationInFrames * 0.7],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const color = interpolateColors(\n progress,\n [0, 1],\n [baseColor, highlightColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ color }}>{highlight}</span>\n {after}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n before: {\n type: \"text-content\",\n default: \"Ship faster with \",\n description: \"Before\",\n },\n highlight: {\n type: \"text-content\",\n default: \"remocn\",\n description: \"Highlight\",\n },\n after: {\n type: \"text-content\",\n default: \".\",\n description: \"After\",\n },\n baseColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Base color\",\n },\n highlightColor: {\n type: \"color\",\n default: \"#ff5e3a\",\n description: \"Highlight color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"before\",\"highlight\",\"after\",\"baseColor\",\"highlightColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n before: \"Ship faster with \",\n highlight: \"remocn\",\n after: \".\",\n baseColor: \"#171717\",\n highlightColor: \"#ff5e3a\",\n fontSize: 72,\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype InlineHighlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InlineHighlightBase>;\n\nconst InlineHighlightInner = forwardRef<\n HTMLDivElement,\n InlineHighlightElementProps & { 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 ?? \"<InlineHighlight>\"}\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 <InlineHighlightBase\n {...(componentProps as unknown as ComponentProps<typeof InlineHighlightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const InlineHighlight = Interactive.withSchema({\n Component: InlineHighlightInner,\n componentName: \"<InlineHighlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, interpolateColors, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface InlineHighlightProps {\n before: string;\n highlight: string;\n after?: string;\n baseColor?: string;\n highlightColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction InlineHighlightBase({\n before,\n highlight,\n after = \"\",\n baseColor = \"#171717\",\n highlightColor = \"#ff5e3a\",\n fontSize = 48,\n fontWeight = 600,\n speed = 1,\n className,\n}: InlineHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const progress = interpolate(\n frame,\n [durationInFrames * 0.2, durationInFrames * 0.7],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const color = interpolateColors(\n progress,\n [0, 1],\n [baseColor, highlightColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ color }}>{highlight}</span>\n {after}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n before: {\n type: \"text-content\",\n default: \"Ship faster with \",\n description: \"Before\",\n },\n highlight: {\n type: \"text-content\",\n default: \"remocn\",\n description: \"Highlight\",\n },\n after: {\n type: \"text-content\",\n default: \".\",\n description: \"After\",\n },\n baseColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Base color\",\n },\n highlightColor: {\n type: \"color\",\n default: \"#ff5e3a\",\n description: \"Highlight color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 640,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"before\",\"highlight\",\"after\",\"baseColor\",\"highlightColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n before: \"Ship faster with \",\n highlight: \"remocn\",\n after: \".\",\n baseColor: \"#171717\",\n highlightColor: \"#ff5e3a\",\n fontSize: 72,\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype InlineHighlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof InlineHighlightBase>;\n\nconst InlineHighlightInner = forwardRef<\n HTMLDivElement,\n InlineHighlightElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 640, height = 100, ...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 ?? \"<InlineHighlight>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <InlineHighlightBase\n {...(componentProps as unknown as ComponentProps<typeof InlineHighlightBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const InlineHighlight = Interactive.withSchema({\n Component: InlineHighlightInner,\n componentName: \"<InlineHighlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/kinetic-center-build.json b/registry-artifacts/elements/kinetic-center-build.json
index 9b354fd8..c1a70955 100644
--- a/registry-artifacts/elements/kinetic-center-build.json
+++ b/registry-artifacts/elements/kinetic-center-build.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 600,
+ "height": 100
+ },
"displayName": "Kinetic Center Build",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "kinetic-center-build",
- "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface KineticCenterBuildProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst MEASURE_FONT =\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif';\n\nfunction measureWidths(\n words: string[],\n fontSize: number,\n fontWeight: number,\n): number[] {\n if (typeof document === \"undefined\") {\n return words.map((w) => w.length * fontSize * 0.55);\n }\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return words.map((w) => w.length * fontSize * 0.55);\n ctx.font = `${fontWeight} ${fontSize}px ${MEASURE_FONT}`;\n return words.map((w) => ctx.measureText(w).width);\n}\n\nfunction KineticCenterBuildBase({\n text,\n entryOffset = 88,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: KineticCenterBuildProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const widths = useMemo(\n () => measureWidths(words, fontSize, fontWeight),\n [words, fontSize, fontWeight],\n );\n\n const gap = 10;\n const firstDur = 10;\n const pushDur = 13;\n const travelDur = 7;\n const entryScale = 0.992;\n const entryBlur = 3.5;\n const reflowBlur = 0.8;\n const firstWordY = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= words.length; k++) {\n let total = gap * (k - 1);\n for (let j = 0; j < k; j++) total += widths[j];\n let cursor = -total / 2;\n const xs: number[] = [];\n for (let j = 0; j < k; j++) {\n xs.push(cursor + widths[j] / 2);\n cursor += widths[j] + gap;\n }\n out.push(xs);\n }\n return out;\n }, [words, widths]);\n\n const n = words.length;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetX = positionsAt[j][j];\n const xFrom = j === 0 ? 0 : targetX + entryOffset;\n\n let x = targetX;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n let y = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n x = xFrom;\n scale = entryScale;\n blur = entryBlur;\n y = j === 0 ? firstWordY : 0;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n x = interpolate(frame, travelRange, [xFrom, targetX], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n y =\n j === 0\n ? interpolate(frame, travelRange, [firstWordY, 0], opts)\n : 0;\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromX = positionsAt[w - 1][j];\n const toX = positionsAt[w][j];\n if (frame >= pushEnd) {\n x = toX;\n } else if (frame >= pushStart) {\n x = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromX, toX],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n x = fromX;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(${x}px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Words push left.\",\n description: \"Text\",\n },\n entryOffset: {\n type: \"number\",\n min: 20,\n max: 160,\n step: 1,\n default: 88,\n description: \"Entry offset\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"entryOffset\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Words push left.\",\n entryOffset: 88,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype KineticCenterBuildElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof KineticCenterBuildBase>;\n\nconst KineticCenterBuildInner = forwardRef<\n HTMLDivElement,\n KineticCenterBuildElementProps & { 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 ?? \"<KineticCenterBuild>\"}\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 <KineticCenterBuildBase\n {...(componentProps as unknown as ComponentProps<typeof KineticCenterBuildBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const KineticCenterBuild = Interactive.withSchema({\n Component: KineticCenterBuildInner,\n componentName: \"<KineticCenterBuild>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface KineticCenterBuildProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst MEASURE_FONT =\n '-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif';\n\nfunction measureWidths(\n words: string[],\n fontSize: number,\n fontWeight: number,\n): number[] {\n if (typeof document === \"undefined\") {\n return words.map((w) => w.length * fontSize * 0.55);\n }\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return words.map((w) => w.length * fontSize * 0.55);\n ctx.font = `${fontWeight} ${fontSize}px ${MEASURE_FONT}`;\n return words.map((w) => ctx.measureText(w).width);\n}\n\nfunction KineticCenterBuildBase({\n text,\n entryOffset = 88,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: KineticCenterBuildProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const widths = useMemo(\n () => measureWidths(words, fontSize, fontWeight),\n [words, fontSize, fontWeight],\n );\n\n const gap = 10;\n const firstDur = 10;\n const pushDur = 13;\n const travelDur = 7;\n const entryScale = 0.992;\n const entryBlur = 3.5;\n const reflowBlur = 0.8;\n const firstWordY = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= words.length; k++) {\n let total = gap * (k - 1);\n for (let j = 0; j < k; j++) total += widths[j];\n let cursor = -total / 2;\n const xs: number[] = [];\n for (let j = 0; j < k; j++) {\n xs.push(cursor + widths[j] / 2);\n cursor += widths[j] + gap;\n }\n out.push(xs);\n }\n return out;\n }, [words, widths]);\n\n const n = words.length;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetX = positionsAt[j][j];\n const xFrom = j === 0 ? 0 : targetX + entryOffset;\n\n let x = targetX;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n let y = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n x = xFrom;\n scale = entryScale;\n blur = entryBlur;\n y = j === 0 ? firstWordY : 0;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n x = interpolate(frame, travelRange, [xFrom, targetX], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n y =\n j === 0\n ? interpolate(frame, travelRange, [firstWordY, 0], opts)\n : 0;\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromX = positionsAt[w - 1][j];\n const toX = positionsAt[w][j];\n if (frame >= pushEnd) {\n x = toX;\n } else if (frame >= pushStart) {\n x = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromX, toX],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n x = fromX;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(${x}px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Words push left.\",\n description: \"Text\",\n },\n entryOffset: {\n type: \"number\",\n min: 20,\n max: 160,\n step: 1,\n default: 88,\n description: \"Entry offset\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 600,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"entryOffset\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Words push left.\",\n entryOffset: 88,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype KineticCenterBuildElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof KineticCenterBuildBase>;\n\nconst KineticCenterBuildInner = forwardRef<\n HTMLDivElement,\n KineticCenterBuildElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 600, height = 100, ...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 ?? \"<KineticCenterBuild>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <KineticCenterBuildBase\n {...(componentProps as unknown as ComponentProps<typeof KineticCenterBuildBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const KineticCenterBuild = Interactive.withSchema({\n Component: KineticCenterBuildInner,\n componentName: \"<KineticCenterBuild>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/line-by-line-slide.json b/registry-artifacts/elements/line-by-line-slide.json
index d4174d93..133acd64 100644
--- a/registry-artifacts/elements/line-by-line-slide.json
+++ b/registry-artifacts/elements/line-by-line-slide.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 600,
+ "height": 200
+ },
"displayName": "Line-by-Line Slide",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "line-by-line-slide",
- "sourceCode": "import { 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\ninterface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction LineByLineSlideBase({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const enterTravel = 14;\n const exitDur = 18;\n const exitTravelFrom = 8;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, distance],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n transform: `translateX(${x}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Think different.\\nDo more.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 160,\n step: 1,\n default: 48,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Think different.\\nDo more.\",\n distance: 48,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype LineByLineSlideElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LineByLineSlideBase>;\n\nconst LineByLineSlideInner = forwardRef<\n HTMLDivElement,\n LineByLineSlideElementProps & { 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 ?? \"<LineByLineSlide>\"}\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 <LineByLineSlideBase\n {...(componentProps as unknown as ComponentProps<typeof LineByLineSlideBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LineByLineSlide = Interactive.withSchema({\n Component: LineByLineSlideInner,\n componentName: \"<LineByLineSlide>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { 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\ninterface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction LineByLineSlideBase({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const enterTravel = 14;\n const exitDur = 18;\n const exitTravelFrom = 8;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, distance],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n translate: `${x}px`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Think different.\\nDo more.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 160,\n step: 1,\n default: 48,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 600,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 200,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Think different.\\nDo more.\",\n distance: 48,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype LineByLineSlideElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof LineByLineSlideBase>;\n\nconst LineByLineSlideInner = forwardRef<\n HTMLDivElement,\n LineByLineSlideElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 600, height = 200, ...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 ?? \"<LineByLineSlide>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <LineByLineSlideBase\n {...(componentProps as unknown as ComponentProps<typeof LineByLineSlideBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const LineByLineSlide = Interactive.withSchema({\n Component: LineByLineSlideInner,\n componentName: \"<LineByLineSlide>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/marker-highlight.json b/registry-artifacts/elements/marker-highlight.json
index 0044bad7..85a5e811 100644
--- a/registry-artifacts/elements/marker-highlight.json
+++ b/registry-artifacts/elements/marker-highlight.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 340,
+ "height": 100
+ },
"displayName": "Marker Highlight",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "marker-highlight",
- "sourceCode": "import { Interactive, Sequence, interpolate, interpolateColors, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MarkerHighlightProps {\n before?: string;\n highlight: string;\n after?: string;\n markerColor?: string;\n baseColor?: string;\n highlightedTextColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MarkerHighlightBase({\n before = \"\",\n highlight,\n after = \"\",\n markerColor = \"#facc15\",\n baseColor = \"#171717\",\n highlightedTextColor = \"#171717\",\n fontSize = 72,\n fontWeight = 600,\n speed = 1,\n className,\n}: MarkerHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const markerScale = spring({\n frame: frame - 15,\n fps,\n config: { damping: 14 },\n });\n\n const textColor = interpolateColors(\n interpolate(markerScale, [0.5, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n [0, 1],\n [baseColor, highlightedTextColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ position: \"relative\", display: \"inline-block\" }}>\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n inset: \"0 -0.1em\",\n background: markerColor,\n transformOrigin: \"left center\",\n transform: `scaleX(${markerScale})`,\n zIndex: 0,\n }}\n />\n <span style={{ position: \"relative\", zIndex: 1, color: textColor }}>\n {highlight}\n </span>\n </span>\n {after}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n before: {\n type: \"text-content\",\n default: \"Made for \",\n description: \"Before\",\n },\n highlight: {\n type: \"text-content\",\n default: \"builders\",\n description: \"Highlight\",\n },\n after: {\n type: \"text-content\",\n default: \".\",\n description: \"After\",\n },\n markerColor: {\n type: \"color\",\n default: \"#facc15\",\n description: \"Marker color\",\n },\n baseColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Base color\",\n },\n highlightedTextColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Highlighted text color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"before\",\"highlight\",\"after\",\"markerColor\",\"baseColor\",\"highlightedTextColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n before: \"Made for \",\n highlight: \"builders\",\n after: \".\",\n markerColor: \"#facc15\",\n baseColor: \"#171717\",\n highlightedTextColor: \"#171717\",\n fontSize: 72,\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MarkerHighlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MarkerHighlightBase>;\n\nconst MarkerHighlightInner = forwardRef<\n HTMLDivElement,\n MarkerHighlightElementProps & { 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 ?? \"<MarkerHighlight>\"}\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 <MarkerHighlightBase\n {...(componentProps as unknown as ComponentProps<typeof MarkerHighlightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MarkerHighlight = Interactive.withSchema({\n Component: MarkerHighlightInner,\n componentName: \"<MarkerHighlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, interpolateColors, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MarkerHighlightProps {\n before?: string;\n highlight: string;\n after?: string;\n markerColor?: string;\n baseColor?: string;\n highlightedTextColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MarkerHighlightBase({\n before = \"\",\n highlight,\n after = \"\",\n markerColor = \"#facc15\",\n baseColor = \"#171717\",\n highlightedTextColor = \"#171717\",\n fontSize = 72,\n fontWeight = 600,\n speed = 1,\n className,\n}: MarkerHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const markerScale = spring({\n frame: frame - 15,\n fps,\n config: { damping: 14 },\n });\n\n const textColor = interpolateColors(\n interpolate(markerScale, [0.5, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n [0, 1],\n [baseColor, highlightedTextColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ position: \"relative\", display: \"inline-block\" }}>\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n inset: \"0 -0.1em\",\n background: markerColor,\n transformOrigin: \"left center\",\n scale: `${markerScale} 1`,\n zIndex: 0,\n }}\n />\n <span style={{ position: \"relative\", zIndex: 1, color: textColor }}>\n {highlight}\n </span>\n </span>\n {after}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n before: {\n type: \"text-content\",\n default: \"Made for \",\n description: \"Before\",\n },\n highlight: {\n type: \"text-content\",\n default: \"builders\",\n description: \"Highlight\",\n },\n after: {\n type: \"text-content\",\n default: \".\",\n description: \"After\",\n },\n markerColor: {\n type: \"color\",\n default: \"#facc15\",\n description: \"Marker color\",\n },\n baseColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Base color\",\n },\n highlightedTextColor: {\n type: \"color\",\n default: \"#171717\",\n description: \"Highlighted text color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 340,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"before\",\"highlight\",\"after\",\"markerColor\",\"baseColor\",\"highlightedTextColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n before: \"Made for \",\n highlight: \"builders\",\n after: \".\",\n markerColor: \"#facc15\",\n baseColor: \"#171717\",\n highlightedTextColor: \"#171717\",\n fontSize: 72,\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MarkerHighlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MarkerHighlightBase>;\n\nconst MarkerHighlightInner = forwardRef<\n HTMLDivElement,\n MarkerHighlightElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 340, height = 100, ...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 ?? \"<MarkerHighlight>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MarkerHighlightBase\n {...(componentProps as unknown as ComponentProps<typeof MarkerHighlightBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MarkerHighlight = Interactive.withSchema({\n Component: MarkerHighlightInner,\n componentName: \"<MarkerHighlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/mask-reveal-up.json b/registry-artifacts/elements/mask-reveal-up.json
index d5ac8aa5..886ec035 100644
--- a/registry-artifacts/elements/mask-reveal-up.json
+++ b/registry-artifacts/elements/mask-reveal-up.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 640,
+ "height": 200
+ },
"displayName": "Mask Reveal Up",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "mask-reveal-up",
- "sourceCode": "import { 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\ninterface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MaskRevealUpBase({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const enterTravel = 11;\n const exitDur = 16;\n const exitTravelFrom = 8;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -22],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Designed to move.\\nBuilt to focus.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 30,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Designed to move.\\nBuilt to focus.\",\n distance: 30,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MaskRevealUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MaskRevealUpBase>;\n\nconst MaskRevealUpInner = forwardRef<\n HTMLDivElement,\n MaskRevealUpElementProps & { 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 ?? \"<MaskRevealUp>\"}\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 <MaskRevealUpBase\n {...(componentProps as unknown as ComponentProps<typeof MaskRevealUpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MaskRevealUp = Interactive.withSchema({\n Component: MaskRevealUpInner,\n componentName: \"<MaskRevealUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { 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\ninterface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MaskRevealUpBase({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const enterTravel = 11;\n const exitDur = 16;\n const exitTravelFrom = 8;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -22],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n translate: `0 ${y}px`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Designed to move.\\nBuilt to focus.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 30,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 640,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 200,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Designed to move.\\nBuilt to focus.\",\n distance: 30,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MaskRevealUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MaskRevealUpBase>;\n\nconst MaskRevealUpInner = forwardRef<\n HTMLDivElement,\n MaskRevealUpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 640, height = 200, ...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 ?? \"<MaskRevealUp>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MaskRevealUpBase\n {...(componentProps as unknown as ComponentProps<typeof MaskRevealUpBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MaskRevealUp = Interactive.withSchema({\n Component: MaskRevealUpInner,\n componentName: \"<MaskRevealUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/matrix-decode.json b/registry-artifacts/elements/matrix-decode.json
index f4dcb521..005e77a1 100644
--- a/registry-artifacts/elements/matrix-decode.json
+++ b/registry-artifacts/elements/matrix-decode.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 340,
+ "height": 100
+ },
"displayName": "Matrix Decode",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "matrix-decode",
- "sourceCode": "import { Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MatrixDecodeProps {\n text: string;\n charset?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n revealDuration?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MatrixDecodeBase({\n text,\n charset = \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize = 72,\n color = \"#22c55e\",\n fontWeight = 600,\n revealDuration = 60,\n speed = 1,\n className,\n}: MatrixDecodeProps) {\n const frame = useCurrentFrame() * speed;\n // useVideoConfig kept for consistency with sibling primitives\n useVideoConfig();\n\n let output = \"\";\n for (let i = 0; i < text.length; i++) {\n const revealFrame = (i / Math.max(text.length, 1)) * revealDuration;\n if (text[i] === \" \") {\n output += \" \";\n } else if (frame >= revealFrame) {\n output += text[i];\n } else {\n const r = random(`${i}-${Math.floor(frame / 2)}`);\n const ch = charset[Math.floor(r * charset.length)];\n output += ch;\n }\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"0.05em\",\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {output}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"DECRYPTED\",\n description: \"Text\",\n },\n charset: {\n type: \"text-content\",\n default: \"!@#$%^&*()_+-=<>?/\\\\|\",\n description: \"Charset\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#22c55e\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n revealDuration: {\n type: \"number\",\n min: 10,\n max: 240,\n step: 1,\n default: 60,\n description: \"Reveal duration\",\n hiddenFromList: false,\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([\"text\",\"charset\",\"fontSize\",\"color\",\"fontWeight\",\"revealDuration\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"DECRYPTED\",\n charset: \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize: 72,\n color: \"#22c55e\",\n fontWeight: \"600\",\n revealDuration: 60,\n speed: 1,\n};\n\ntype MatrixDecodeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MatrixDecodeBase>;\n\nconst MatrixDecodeInner = forwardRef<\n HTMLDivElement,\n MatrixDecodeElementProps & { 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 ?? \"<MatrixDecode>\"}\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 <MatrixDecodeBase\n {...(componentProps as unknown as ComponentProps<typeof MatrixDecodeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MatrixDecode = Interactive.withSchema({\n Component: MatrixDecodeInner,\n componentName: \"<MatrixDecode>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MatrixDecodeProps {\n text: string;\n charset?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n revealDuration?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MatrixDecodeBase({\n text,\n charset = \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize = 72,\n color = \"#22c55e\",\n fontWeight = 600,\n revealDuration = 60,\n speed = 1,\n className,\n}: MatrixDecodeProps) {\n const frame = useCurrentFrame() * speed;\n // useVideoConfig kept for consistency with sibling primitives\n useVideoConfig();\n\n let output = \"\";\n for (let i = 0; i < text.length; i++) {\n const revealFrame = (i / Math.max(text.length, 1)) * revealDuration;\n if (text[i] === \" \") {\n output += \" \";\n } else if (frame >= revealFrame) {\n output += text[i];\n } else {\n const r = random(`${i}-${Math.floor(frame / 2)}`);\n const ch = charset[Math.floor(r * charset.length)];\n output += ch;\n }\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"0.05em\",\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {output}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"DECRYPTED\",\n description: \"Text\",\n },\n charset: {\n type: \"text-content\",\n default: \"!@#$%^&*()_+-=<>?/\\\\|\",\n description: \"Charset\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#22c55e\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n revealDuration: {\n type: \"number\",\n min: 10,\n max: 240,\n step: 1,\n default: 60,\n description: \"Reveal duration\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 340,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"charset\",\"fontSize\",\"color\",\"fontWeight\",\"revealDuration\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"DECRYPTED\",\n charset: \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize: 72,\n color: \"#22c55e\",\n fontWeight: \"600\",\n revealDuration: 60,\n speed: 1,\n};\n\ntype MatrixDecodeElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MatrixDecodeBase>;\n\nconst MatrixDecodeInner = forwardRef<\n HTMLDivElement,\n MatrixDecodeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 340, height = 100, ...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 ?? \"<MatrixDecode>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MatrixDecodeBase\n {...(componentProps as unknown as ComponentProps<typeof MatrixDecodeBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MatrixDecode = Interactive.withSchema({\n Component: MatrixDecodeInner,\n componentName: \"<MatrixDecode>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/micro-scale-fade.json b/registry-artifacts/elements/micro-scale-fade.json
index 04fc301d..910fe75c 100644
--- a/registry-artifacts/elements/micro-scale-fade.json
+++ b/registry-artifacts/elements/micro-scale-fade.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 680,
+ "height": 100
+ },
"displayName": "Micro Scale Fade",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "micro-scale-fade",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MicroScaleFadeProps {\n text: string;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MicroScaleFadeBase({\n text,\n scaleFrom = 0.96,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MicroScaleFadeProps) {\n const frame = useCurrentFrame() * speed;\n const easing = Easing.bezier(0.32, 0.72, 0, 1);\n\n const opacity = interpolate(frame, [0, 18], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const scale = interpolate(frame, [0, 18], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Welcome to motion.\",\n description: \"Text\",\n },\n scaleFrom: {\n type: \"number\",\n min: 0.8,\n max: 1,\n step: 0.01,\n default: 0.96,\n description: \"Scale from\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"scaleFrom\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Welcome to motion.\",\n scaleFrom: 0.96,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MicroScaleFadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof MicroScaleFadeBase>;\n\nconst MicroScaleFadeInner = forwardRef<\n HTMLDivElement,\n MicroScaleFadeElementProps & { 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 ?? \"<MicroScaleFade>\"}\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 <MicroScaleFadeBase\n {...(componentProps as unknown as ComponentProps<typeof MicroScaleFadeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const MicroScaleFade = Interactive.withSchema({\n Component: MicroScaleFadeInner,\n componentName: \"<MicroScaleFade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface MicroScaleFadeProps {\n text: string;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction MicroScaleFadeBase({\n text,\n scaleFrom = 0.96,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MicroScaleFadeProps) {\n const frame = useCurrentFrame() * speed;\n const easing = Easing.bezier(0.32, 0.72, 0, 1);\n\n const opacity = interpolate(frame, [0, 18], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const scale = interpolate(frame, [0, 18], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n scale: `${scale}`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Welcome to motion.\",\n description: \"Text\",\n },\n scaleFrom: {\n type: \"number\",\n min: 0.8,\n max: 1,\n step: 0.01,\n default: 0.96,\n description: \"Scale from\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 680,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"scaleFrom\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Welcome to motion.\",\n scaleFrom: 0.96,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype MicroScaleFadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof MicroScaleFadeBase>;\n\nconst MicroScaleFadeInner = forwardRef<\n HTMLDivElement,\n MicroScaleFadeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 680, height = 100, ...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 ?? \"<MicroScaleFade>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <MicroScaleFadeBase\n {...(componentProps as unknown as ComponentProps<typeof MicroScaleFadeBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const MicroScaleFade = Interactive.withSchema({\n Component: MicroScaleFadeInner,\n componentName: \"<MicroScaleFade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/per-character-rise.json b/registry-artifacts/elements/per-character-rise.json
index 8fe86f16..998bae18 100644
--- a/registry-artifacts/elements/per-character-rise.json
+++ b/registry-artifacts/elements/per-character-rise.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 570,
+ "height": 100
+ },
"displayName": "Per Character Rise",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "per-character-rise",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction PerCharacterRiseBase({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const charTravelFrames = 10;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const travelEasing = Easing.bezier(0.2, 0.8, 0.6, 0.85);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"One more thing.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 32,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"One more thing.\",\n distance: 32,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype PerCharacterRiseElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerCharacterRiseBase>;\n\nconst PerCharacterRiseInner = forwardRef<\n HTMLDivElement,\n PerCharacterRiseElementProps & { 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 ?? \"<PerCharacterRise>\"}\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 <PerCharacterRiseBase\n {...(componentProps as unknown as ComponentProps<typeof PerCharacterRiseBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerCharacterRise = Interactive.withSchema({\n Component: PerCharacterRiseInner,\n componentName: \"<PerCharacterRise>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction PerCharacterRiseBase({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const charTravelFrames = 10;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const travelEasing = Easing.bezier(0.2, 0.8, 0.6, 0.85);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"One more thing.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 32,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 570,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"One more thing.\",\n distance: 32,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype PerCharacterRiseElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PerCharacterRiseBase>;\n\nconst PerCharacterRiseInner = forwardRef<\n HTMLDivElement,\n PerCharacterRiseElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 570, height = 100, ...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 ?? \"<PerCharacterRise>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PerCharacterRiseBase\n {...(componentProps as unknown as ComponentProps<typeof PerCharacterRiseBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PerCharacterRise = Interactive.withSchema({\n Component: PerCharacterRiseInner,\n componentName: \"<PerCharacterRise>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/per-word-crossfade.json b/registry-artifacts/elements/per-word-crossfade.json
index b9cae01b..24cf8df7 100644
--- a/registry-artifacts/elements/per-word-crossfade.json
+++ b/registry-artifacts/elements/per-word-crossfade.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 720,
+ "height": 100
+ },
"displayName": "Per-Word Crossfade",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "per-word-crossfade",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerWordCrossfadeProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction PerWordCrossfadeBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerWordCrossfadeProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 21;\n const enterTravel = 5;\n const exitDur = 15;\n const exitTravelFrom = 6;\n const enterStagger = 2;\n const exitStagger = 1;\n const overlapF = 5;\n const microDelayF = 2;\n\n const enterEasing = Easing.bezier(0.16, 1, 0.3, 1);\n const exitEasing = Easing.bezier(0.7, 0, 0.84, 0);\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const y = interpolate(local, [exitTravelFrom, exitDur], [0, -6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const y = interpolate(local, [0, enterTravel], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Beautifully simple.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Designed for focus.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Beautifully simple.\",\n toText: \"Designed for focus.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype PerWordCrossfadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerWordCrossfadeBase>;\n\nconst PerWordCrossfadeInner = forwardRef<\n HTMLDivElement,\n PerWordCrossfadeElementProps & { 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 ?? \"<PerWordCrossfade>\"}\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 <PerWordCrossfadeBase\n {...(componentProps as unknown as ComponentProps<typeof PerWordCrossfadeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerWordCrossfade = Interactive.withSchema({\n Component: PerWordCrossfadeInner,\n componentName: \"<PerWordCrossfade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerWordCrossfadeProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction PerWordCrossfadeBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerWordCrossfadeProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 21;\n const enterTravel = 5;\n const exitDur = 15;\n const exitTravelFrom = 6;\n const enterStagger = 2;\n const exitStagger = 1;\n const overlapF = 5;\n const microDelayF = 2;\n\n const enterEasing = Easing.bezier(0.16, 1, 0.3, 1);\n const exitEasing = Easing.bezier(0.7, 0, 0.84, 0);\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const y = interpolate(local, [exitTravelFrom, exitDur], [0, -6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const y = interpolate(local, [0, enterTravel], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Beautifully simple.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Designed for focus.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 720,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Beautifully simple.\",\n toText: \"Designed for focus.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype PerWordCrossfadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof PerWordCrossfadeBase>;\n\nconst PerWordCrossfadeInner = forwardRef<\n HTMLDivElement,\n PerWordCrossfadeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 720, height = 100, ...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 ?? \"<PerWordCrossfade>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <PerWordCrossfadeBase\n {...(componentProps as unknown as ComponentProps<typeof PerWordCrossfadeBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const PerWordCrossfade = Interactive.withSchema({\n Component: PerWordCrossfadeInner,\n componentName: \"<PerWordCrossfade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/perspective-marquee.json b/registry-artifacts/elements/perspective-marquee.json
index 81f6fece..a5a8dd48 100644
--- a/registry-artifacts/elements/perspective-marquee.json
+++ b/registry-artifacts/elements/perspective-marquee.json
@@ -8,7 +8,7 @@
"durationInFrames": 240,
"installationMode": "component-owned-sequence",
"slug": "perspective-marquee",
- "sourceCode": "import { Interactive, Sequence, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nfunction PerspectiveMarqueeBase({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fontSize: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 2,\n default: 84,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#fafafa\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n pixelsPerFrame: {\n type: \"number\",\n min: 0.25,\n max: 10,\n step: 0.25,\n default: 2,\n description: \"Pixels / frame\",\n hiddenFromList: false,\n },\n rotateY: {\n type: \"number\",\n min: -60,\n max: 60,\n step: 1,\n default: -28,\n description: \"Rotate Y (deg)\",\n hiddenFromList: false,\n },\n rotateX: {\n type: \"number\",\n min: -30,\n max: 30,\n step: 1,\n default: 8,\n description: \"Rotate X (deg)\",\n hiddenFromList: false,\n },\n perspective: {\n type: \"number\",\n min: 400,\n max: 3000,\n step: 50,\n default: 1200,\n description: \"Perspective\",\n hiddenFromList: false,\n },\n fadeColor: {\n type: \"color\",\n default: \"#050505\",\n description: \"Fade color\",\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([\"fontSize\",\"color\",\"fontWeight\",\"pixelsPerFrame\",\"rotateY\",\"rotateX\",\"perspective\",\"fadeColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fontSize: 84,\n color: \"#fafafa\",\n fontWeight: \"700\",\n pixelsPerFrame: 2,\n rotateY: -28,\n rotateX: 8,\n perspective: 1200,\n fadeColor: \"#050505\",\n speed: 1,\n};\n\ntype PerspectiveMarqueeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerspectiveMarqueeBase>;\n\nconst PerspectiveMarqueeInner = forwardRef<\n HTMLDivElement,\n PerspectiveMarqueeElementProps & { 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 ?? \"<PerspectiveMarquee>\"}\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 <PerspectiveMarqueeBase\n {...(componentProps as unknown as ComponentProps<typeof PerspectiveMarqueeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerspectiveMarquee = Interactive.withSchema({\n Component: PerspectiveMarqueeInner,\n componentName: \"<PerspectiveMarquee>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nfunction PerspectiveMarqueeBase({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n translate: `${offset}px`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fontSize: {\n type: \"number\",\n min: 24,\n max: 200,\n step: 2,\n default: 84,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#fafafa\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n pixelsPerFrame: {\n type: \"number\",\n min: 0.25,\n max: 10,\n step: 0.25,\n default: 2,\n description: \"Pixels / frame\",\n hiddenFromList: false,\n },\n rotateY: {\n type: \"number\",\n min: -60,\n max: 60,\n step: 1,\n default: -28,\n description: \"Rotate Y (deg)\",\n hiddenFromList: false,\n },\n rotateX: {\n type: \"number\",\n min: -30,\n max: 30,\n step: 1,\n default: 8,\n description: \"Rotate X (deg)\",\n hiddenFromList: false,\n },\n perspective: {\n type: \"number\",\n min: 400,\n max: 3000,\n step: 50,\n default: 1200,\n description: \"Perspective\",\n hiddenFromList: false,\n },\n fadeColor: {\n type: \"color\",\n default: \"#050505\",\n description: \"Fade color\",\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([\"fontSize\",\"color\",\"fontWeight\",\"pixelsPerFrame\",\"rotateY\",\"rotateX\",\"perspective\",\"fadeColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fontSize: 84,\n color: \"#fafafa\",\n fontWeight: \"700\",\n pixelsPerFrame: 2,\n rotateY: -28,\n rotateX: 8,\n perspective: 1200,\n fadeColor: \"#050505\",\n speed: 1,\n};\n\ntype PerspectiveMarqueeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerspectiveMarqueeBase>;\n\nconst PerspectiveMarqueeInner = forwardRef<\n HTMLDivElement,\n PerspectiveMarqueeElementProps & { 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 ?? \"<PerspectiveMarquee>\"}\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 <PerspectiveMarqueeBase\n {...(componentProps as unknown as ComponentProps<typeof PerspectiveMarqueeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerspectiveMarquee = Interactive.withSchema({\n Component: PerspectiveMarqueeInner,\n componentName: \"<PerspectiveMarquee>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 240
}
diff --git a/registry-artifacts/elements/perspective-squeeze.json b/registry-artifacts/elements/perspective-squeeze.json
index e1f12a61..802594a3 100644
--- a/registry-artifacts/elements/perspective-squeeze.json
+++ b/registry-artifacts/elements/perspective-squeeze.json
@@ -8,7 +8,7 @@
"durationInFrames": 225,
"installationMode": "component-owned-sequence",
"slug": "perspective-squeeze",
- "sourceCode": "import { 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\ntype Corners = [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n];\n\ninterface PerspectiveSqueezeProps {\n className?: string;\n width?: number;\n height?: number;\n blockWidth?: number;\n blockHeight?: number;\n lowerBlockPosition?: [number, number];\n upperBlockPosition?: [number, number];\n cornersRest?: Corners;\n cornerKeyframes?: number[];\n upperCornersMid?: Corners;\n upperCornersEnd?: Corners;\n lowerCornersMid?: Corners;\n lowerCornersEnd?: Corners;\n upperText?: string;\n lowerText?: string;\n upperFontFamily?: string;\n lowerFontFamily?: string;\n upperFontSize?: number;\n lowerFontSize?: number;\n capRatio?: number;\n lineGap?: number;\n scaleKeyframes?: number[];\n lowerScaleY?: number[];\n upperScaleY?: number[];\n fill?: string;\n}\n\nfunction cornerPinMatrix(src: Corners, dst: Corners): string {\n const a: number[][] = [];\n const rhs: number[] = [];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = src[i];\n const [u, v] = dst[i];\n a.push([x, y, 1, 0, 0, 0, -u * x, -u * y]);\n rhs.push(u);\n a.push([0, 0, 0, x, y, 1, -v * x, -v * y]);\n rhs.push(v);\n }\n\n const n = 8;\n for (let col = 0; col < n; col++) {\n let pivot = col;\n for (let r = col + 1; r < n; r++) {\n if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;\n }\n [a[col], a[pivot]] = [a[pivot], a[col]];\n [rhs[col], rhs[pivot]] = [rhs[pivot], rhs[col]];\n\n const d = a[col][col];\n if (Math.abs(d) < 1e-12) continue;\n for (let c = col; c < n; c++) a[col][c] /= d;\n rhs[col] /= d;\n\n for (let r = 0; r < n; r++) {\n if (r === col) continue;\n const f = a[r][col];\n if (f === 0) continue;\n for (let c = col; c < n; c++) a[r][c] -= f * a[col][c];\n rhs[r] -= f * rhs[col];\n }\n }\n\n const [m0, m1, m2, m3, m4, m5, m6, m7] = rhs;\n return `matrix3d(${m0}, ${m3}, 0, ${m6}, ${m1}, ${m4}, 0, ${m7}, 0, 0, 1, 0, ${m2}, ${m5}, 0, 1)`;\n}\n\nfunction lerpCorners(from: Corners, to: Corners, t: number): Corners {\n return from.map((p, i) => [\n p[0] + (to[i][0] - p[0]) * t,\n p[1] + (to[i][1] - p[1]) * t,\n ]) as Corners;\n}\n\nfunction PerspectiveSqueezeBase({\n className,\n width = 1920,\n height = 1080,\n blockWidth = 990,\n blockHeight = 546,\n lowerBlockPosition = [960, 860],\n upperBlockPosition = [960, 314],\n cornersRest = [\n [0, 0],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n cornerKeyframes = [0, 45, 70],\n upperCornersMid = [\n [0, -326],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n upperCornersEnd = [\n [0, 352],\n [990, -428],\n [460, 546],\n [990, 546],\n ],\n lowerCornersMid = [\n [0, 0],\n [990, 0],\n [0, 225],\n [990, 546],\n ],\n lowerCornersEnd = [\n [0, 0],\n [990, 0],\n [0, 897],\n [990, 116],\n ],\n upperText = \"REMOCN\",\n lowerText = \"BEST\",\n upperFontFamily = \"sans-serif\",\n lowerFontFamily = \"sans-serif\",\n upperFontSize = 603,\n lowerFontSize = 124,\n capRatio = 0.65,\n lineGap = 50,\n scaleKeyframes = [0, 60, 118, 161, 196, 225],\n lowerScaleY = [100, 384.8, 270, 330, 150, 100],\n upperScaleY = [100, 35.8, 64, 45, 110, 100],\n fill = \"#ffffff\",\n}: PerspectiveSqueezeProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const stageScale = Math.min(compWidth / width, compHeight / height);\n\n const squishEase = Easing.bezier(0.6, 0, 0.4, 1);\n\n const scaleAt = (track: number[]) =>\n interpolate(frame, scaleKeyframes, track, {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: squishEase,\n }) / 100;\n\n const cornersAt = (mid: Corners, end: Corners): Corners => {\n const [k0, k1, k2] = cornerKeyframes;\n if (frame <= k0) return cornersRest;\n if (frame >= k2) return end;\n if (frame <= k1) {\n return lerpCorners(\n cornersRest,\n mid,\n squishEase((frame - k0) / Math.max(k1 - k0, 1)),\n );\n }\n return lerpCorners(\n mid,\n end,\n squishEase((frame - k1) / Math.max(k2 - k1, 1)),\n );\n };\n\n const upperScale = scaleAt(upperScaleY);\n const lowerScale = scaleAt(lowerScaleY);\n\n const upperBoxHeight = upperFontSize * capRatio * upperScale;\n const lowerBoxHeight = lowerFontSize * capRatio * lowerScale;\n const stackTop =\n (blockHeight - (upperBoxHeight + lineGap + lowerBoxHeight)) / 2;\n const upperBaseline = stackTop + upperBoxHeight;\n const lowerBaseline = upperBaseline + lineGap + lowerBoxHeight;\n\n const line = (\n text: string,\n family: string,\n size: number,\n baseline: number,\n scale: number,\n ) => (\n <text\n x={0}\n y={baseline}\n textLength={blockWidth}\n lengthAdjust=\"spacingAndGlyphs\"\n fontFamily={family}\n fontSize={size}\n fontWeight={800}\n fill={fill}\n transform={`matrix(1, 0, 0, ${scale}, 0, ${baseline * (1 - scale)})`}\n >\n {text}\n </text>\n );\n\n const block = (corners: Corners, position: [number, number]) => (\n <div\n style={{\n position: \"absolute\",\n left: position[0] - blockWidth / 2,\n top: position[1] - blockHeight / 2,\n width: blockWidth,\n height: blockHeight,\n transformOrigin: \"0 0\",\n transform: cornerPinMatrix(cornersRest, corners),\n }}\n >\n <svg\n width={blockWidth}\n height={blockHeight}\n viewBox={`0 0 ${blockWidth} ${blockHeight}`}\n style={{ display: \"block\", overflow: \"hidden\" }}\n >\n {line(\n upperText,\n upperFontFamily,\n upperFontSize,\n upperBaseline,\n upperScale,\n )}\n {line(\n lowerText,\n lowerFontFamily,\n lowerFontSize,\n lowerBaseline,\n lowerScale,\n )}\n </svg>\n </div>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (compWidth - width * stageScale) / 2,\n top: (compHeight - height * stageScale) / 2,\n width,\n height,\n transform: `scale(${stageScale})`,\n transformOrigin: \"0 0\",\n }}\n >\n {block(cornersAt(upperCornersMid, upperCornersEnd), upperBlockPosition)}\n {block(cornersAt(lowerCornersMid, lowerCornersEnd), lowerBlockPosition)}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n upperText: {\n type: \"text-content\",\n default: \"REMOCN\",\n description: \"Upper line\",\n },\n lowerText: {\n type: \"text-content\",\n default: \"BEST\",\n description: \"Lower line\",\n },\n fill: {\n type: \"color\",\n default: \"#f2f2f2\",\n description: \"Fill\",\n },\n upperFontFamily: {\n type: \"text-content\",\n default: \"Impact, 'Arial Narrow', sans-serif\",\n description: \"Upper font\",\n },\n lowerFontFamily: {\n type: \"text-content\",\n default: \"Impact, 'Arial Narrow', sans-serif\",\n description: \"Lower font\",\n },\n lineGap: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 2,\n default: 50,\n description: \"Line gap\",\n hiddenFromList: false,\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([\"upperText\",\"lowerText\",\"fill\",\"upperFontFamily\",\"lowerFontFamily\",\"lineGap\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n upperText: \"REMOCN\",\n lowerText: \"BEST\",\n fill: \"#f2f2f2\",\n upperFontFamily: \"Impact, 'Arial Narrow', sans-serif\",\n lowerFontFamily: \"Impact, 'Arial Narrow', sans-serif\",\n lineGap: 50,\n speed: 1,\n};\n\ntype PerspectiveSqueezeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerspectiveSqueezeBase>;\n\nconst PerspectiveSqueezeInner = forwardRef<\n HTMLDivElement,\n PerspectiveSqueezeElementProps & { 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 ?? \"<PerspectiveSqueeze>\"}\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 <PerspectiveSqueezeBase\n {...(componentProps as unknown as ComponentProps<typeof PerspectiveSqueezeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerspectiveSqueeze = Interactive.withSchema({\n Component: PerspectiveSqueezeInner,\n componentName: \"<PerspectiveSqueeze>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { 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\ntype Corners = [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n];\n\ninterface PerspectiveSqueezeProps {\n className?: string;\n width?: number;\n height?: number;\n blockWidth?: number;\n blockHeight?: number;\n lowerBlockPosition?: [number, number];\n upperBlockPosition?: [number, number];\n cornersRest?: Corners;\n cornerKeyframes?: number[];\n upperCornersMid?: Corners;\n upperCornersEnd?: Corners;\n lowerCornersMid?: Corners;\n lowerCornersEnd?: Corners;\n upperText?: string;\n lowerText?: string;\n upperFontFamily?: string;\n lowerFontFamily?: string;\n upperFontSize?: number;\n lowerFontSize?: number;\n capRatio?: number;\n lineGap?: number;\n scaleKeyframes?: number[];\n lowerScaleY?: number[];\n upperScaleY?: number[];\n fill?: string;\n}\n\nfunction cornerPinMatrix(src: Corners, dst: Corners): string {\n const a: number[][] = [];\n const rhs: number[] = [];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = src[i];\n const [u, v] = dst[i];\n a.push([x, y, 1, 0, 0, 0, -u * x, -u * y]);\n rhs.push(u);\n a.push([0, 0, 0, x, y, 1, -v * x, -v * y]);\n rhs.push(v);\n }\n\n const n = 8;\n for (let col = 0; col < n; col++) {\n let pivot = col;\n for (let r = col + 1; r < n; r++) {\n if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;\n }\n [a[col], a[pivot]] = [a[pivot], a[col]];\n [rhs[col], rhs[pivot]] = [rhs[pivot], rhs[col]];\n\n const d = a[col][col];\n if (Math.abs(d) < 1e-12) continue;\n for (let c = col; c < n; c++) a[col][c] /= d;\n rhs[col] /= d;\n\n for (let r = 0; r < n; r++) {\n if (r === col) continue;\n const f = a[r][col];\n if (f === 0) continue;\n for (let c = col; c < n; c++) a[r][c] -= f * a[col][c];\n rhs[r] -= f * rhs[col];\n }\n }\n\n const [m0, m1, m2, m3, m4, m5, m6, m7] = rhs;\n return `matrix3d(${m0}, ${m3}, 0, ${m6}, ${m1}, ${m4}, 0, ${m7}, 0, 0, 1, 0, ${m2}, ${m5}, 0, 1)`;\n}\n\nfunction lerpCorners(from: Corners, to: Corners, t: number): Corners {\n return from.map((p, i) => [\n p[0] + (to[i][0] - p[0]) * t,\n p[1] + (to[i][1] - p[1]) * t,\n ]) as Corners;\n}\n\nfunction PerspectiveSqueezeBase({\n className,\n width = 1920,\n height = 1080,\n blockWidth = 990,\n blockHeight = 546,\n lowerBlockPosition = [960, 860],\n upperBlockPosition = [960, 314],\n cornersRest = [\n [0, 0],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n cornerKeyframes = [0, 45, 70],\n upperCornersMid = [\n [0, -326],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n upperCornersEnd = [\n [0, 352],\n [990, -428],\n [460, 546],\n [990, 546],\n ],\n lowerCornersMid = [\n [0, 0],\n [990, 0],\n [0, 225],\n [990, 546],\n ],\n lowerCornersEnd = [\n [0, 0],\n [990, 0],\n [0, 897],\n [990, 116],\n ],\n upperText = \"REMOCN\",\n lowerText = \"BEST\",\n upperFontFamily = \"sans-serif\",\n lowerFontFamily = \"sans-serif\",\n upperFontSize = 603,\n lowerFontSize = 124,\n capRatio = 0.65,\n lineGap = 50,\n scaleKeyframes = [0, 60, 118, 161, 196, 225],\n lowerScaleY = [100, 384.8, 270, 330, 150, 100],\n upperScaleY = [100, 35.8, 64, 45, 110, 100],\n fill = \"#ffffff\",\n}: PerspectiveSqueezeProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const stageScale = Math.min(compWidth / width, compHeight / height);\n\n const squishEase = Easing.bezier(0.6, 0, 0.4, 1);\n\n const scaleAt = (track: number[]) =>\n interpolate(frame, scaleKeyframes, track, {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: squishEase,\n }) / 100;\n\n const cornersAt = (mid: Corners, end: Corners): Corners => {\n const [k0, k1, k2] = cornerKeyframes;\n if (frame <= k0) return cornersRest;\n if (frame >= k2) return end;\n if (frame <= k1) {\n return lerpCorners(\n cornersRest,\n mid,\n squishEase((frame - k0) / Math.max(k1 - k0, 1)),\n );\n }\n return lerpCorners(\n mid,\n end,\n squishEase((frame - k1) / Math.max(k2 - k1, 1)),\n );\n };\n\n const upperScale = scaleAt(upperScaleY);\n const lowerScale = scaleAt(lowerScaleY);\n\n const upperBoxHeight = upperFontSize * capRatio * upperScale;\n const lowerBoxHeight = lowerFontSize * capRatio * lowerScale;\n const stackTop =\n (blockHeight - (upperBoxHeight + lineGap + lowerBoxHeight)) / 2;\n const upperBaseline = stackTop + upperBoxHeight;\n const lowerBaseline = upperBaseline + lineGap + lowerBoxHeight;\n\n const line = (\n text: string,\n family: string,\n size: number,\n baseline: number,\n scale: number,\n ) => (\n <text\n x={0}\n y={baseline}\n textLength={blockWidth}\n lengthAdjust=\"spacingAndGlyphs\"\n fontFamily={family}\n fontSize={size}\n fontWeight={800}\n fill={fill}\n transform={`matrix(1, 0, 0, ${scale}, 0, ${baseline * (1 - scale)})`}\n >\n {text}\n </text>\n );\n\n const block = (corners: Corners, position: [number, number]) => (\n <div\n style={{\n position: \"absolute\",\n left: position[0] - blockWidth / 2,\n top: position[1] - blockHeight / 2,\n width: blockWidth,\n height: blockHeight,\n transformOrigin: \"0 0\",\n transform: cornerPinMatrix(cornersRest, corners),\n }}\n >\n <svg\n width={blockWidth}\n height={blockHeight}\n viewBox={`0 0 ${blockWidth} ${blockHeight}`}\n style={{ display: \"block\", overflow: \"hidden\" }}\n >\n {line(\n upperText,\n upperFontFamily,\n upperFontSize,\n upperBaseline,\n upperScale,\n )}\n {line(\n lowerText,\n lowerFontFamily,\n lowerFontSize,\n lowerBaseline,\n lowerScale,\n )}\n </svg>\n </div>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (compWidth - width * stageScale) / 2,\n top: (compHeight - height * stageScale) / 2,\n width,\n height,\n scale: `${stageScale}`,\n transformOrigin: \"0 0\",\n }}\n >\n {block(cornersAt(upperCornersMid, upperCornersEnd), upperBlockPosition)}\n {block(cornersAt(lowerCornersMid, lowerCornersEnd), lowerBlockPosition)}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n upperText: {\n type: \"text-content\",\n default: \"REMOCN\",\n description: \"Upper line\",\n },\n lowerText: {\n type: \"text-content\",\n default: \"BEST\",\n description: \"Lower line\",\n },\n fill: {\n type: \"color\",\n default: \"#f2f2f2\",\n description: \"Fill\",\n },\n upperFontFamily: {\n type: \"text-content\",\n default: \"Impact, 'Arial Narrow', sans-serif\",\n description: \"Upper font\",\n },\n lowerFontFamily: {\n type: \"text-content\",\n default: \"Impact, 'Arial Narrow', sans-serif\",\n description: \"Lower font\",\n },\n lineGap: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 2,\n default: 50,\n description: \"Line gap\",\n hiddenFromList: false,\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([\"upperText\",\"lowerText\",\"fill\",\"upperFontFamily\",\"lowerFontFamily\",\"lineGap\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n upperText: \"REMOCN\",\n lowerText: \"BEST\",\n fill: \"#f2f2f2\",\n upperFontFamily: \"Impact, 'Arial Narrow', sans-serif\",\n lowerFontFamily: \"Impact, 'Arial Narrow', sans-serif\",\n lineGap: 50,\n speed: 1,\n};\n\ntype PerspectiveSqueezeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PerspectiveSqueezeBase>;\n\nconst PerspectiveSqueezeInner = forwardRef<\n HTMLDivElement,\n PerspectiveSqueezeElementProps & { 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 ?? \"<PerspectiveSqueeze>\"}\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 <PerspectiveSqueezeBase\n {...(componentProps as unknown as ComponentProps<typeof PerspectiveSqueezeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PerspectiveSqueeze = Interactive.withSchema({\n Component: PerspectiveSqueezeInner,\n componentName: \"<PerspectiveSqueeze>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 225
}
diff --git a/registry-artifacts/elements/reel.json b/registry-artifacts/elements/reel.json
index d4fe767b..a530023d 100644
--- a/registry-artifacts/elements/reel.json
+++ b/registry-artifacts/elements/reel.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 1180,
+ "height": 676
+ },
"displayName": "Reel",
"durationInFrames": 160,
"installationMode": "component-owned-sequence",
"slug": "reel",
- "sourceCode": "import { AbsoluteFill, Easing, Img, 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 clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst EASE_OUT = Easing.out(Easing.cubic);\n\ntype ReelProps = {\n images: string[];\n width?: number;\n height?: number;\n radius?: number;\n step?: number;\n reveal?: number;\n objectPosition?: string;\n background?: string;\n};\n\nfunction ReelBase({\n images,\n width = 1180,\n height = 676,\n radius = 16,\n step = 20,\n reveal = 13,\n objectPosition = \"top\",\n background = \"#050506\",\n}: ReelProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const left = (compWidth - width) / 2;\n const top = (compHeight - height) / 2;\n\n return (\n <AbsoluteFill>\n {images.map((src, i) => {\n const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {\n ...clamp,\n easing: EASE_OUT,\n });\n if (p <= 0) return null;\n const inset = (1 - p) * 50;\n const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left,\n top,\n width,\n height,\n zIndex: i,\n clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n background,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.6)\",\n willChange: \"clip-path\",\n }}\n >\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n objectPosition,\n transform: `scale(${imgScale})`,\n willChange: \"transform\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n width: {\n type: \"number\",\n min: 600,\n max: 1280,\n step: 20,\n default: 1180,\n description: \"Card width\",\n hiddenFromList: false,\n },\n height: {\n type: \"number\",\n min: 360,\n max: 720,\n step: 4,\n default: 676,\n description: \"Card height\",\n hiddenFromList: false,\n },\n radius: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 16,\n description: \"Corner radius\",\n hiddenFromList: false,\n },\n step: {\n type: \"number\",\n min: 6,\n max: 40,\n step: 1,\n default: 20,\n description: \"Frames / image\",\n hiddenFromList: false,\n },\n reveal: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 13,\n description: \"Reveal frames\",\n hiddenFromList: false,\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([\"width\",\"height\",\"radius\",\"step\",\"reveal\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n width: 1180,\n height: 676,\n radius: 16,\n step: 20,\n reveal: 13,\n speed: 1,\n};\n\ntype ReelElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ReelBase>;\n\nconst ReelInner = forwardRef<\n HTMLDivElement,\n ReelElementProps & { 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 ?? \"<Reel>\"}\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 <ReelBase\n {...(componentProps as unknown as ComponentProps<typeof ReelBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Reel = Interactive.withSchema({\n Component: ReelInner,\n componentName: \"<Reel>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { AbsoluteFill, Easing, Img, 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 clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst EASE_OUT = Easing.out(Easing.cubic);\n\ntype ReelProps = {\n images: string[];\n width?: number;\n height?: number;\n radius?: number;\n step?: number;\n reveal?: number;\n objectPosition?: string;\n background?: string;\n};\n\nfunction ReelBase({\n images,\n width = 1180,\n height = 676,\n radius = 16,\n step = 20,\n reveal = 13,\n objectPosition = \"top\",\n background = \"#050506\",\n}: ReelProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const left = (compWidth - width) / 2;\n const top = (compHeight - height) / 2;\n\n return (\n <AbsoluteFill>\n {images.map((src, i) => {\n const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {\n ...clamp,\n easing: EASE_OUT,\n });\n if (p <= 0) return null;\n const inset = (1 - p) * 50;\n const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left,\n top,\n width,\n height,\n zIndex: i,\n clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n background,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.6)\",\n willChange: \"clip-path\",\n }}\n >\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n objectPosition,\n scale: `${imgScale}`,\n willChange: \"transform\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n width: {\n type: \"number\",\n min: 600,\n max: 1280,\n step: 20,\n default: 1180,\n description: \"Card width\",\n hiddenFromList: false,\n },\n height: {\n type: \"number\",\n min: 360,\n max: 720,\n step: 4,\n default: 676,\n description: \"Card height\",\n hiddenFromList: false,\n },\n radius: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 16,\n description: \"Corner radius\",\n hiddenFromList: false,\n },\n step: {\n type: \"number\",\n min: 6,\n max: 40,\n step: 1,\n default: 20,\n description: \"Frames / image\",\n hiddenFromList: false,\n },\n reveal: {\n type: \"number\",\n min: 4,\n max: 30,\n step: 1,\n default: 13,\n description: \"Reveal frames\",\n hiddenFromList: false,\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([\"width\",\"height\",\"radius\",\"step\",\"reveal\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n width: 1180,\n height: 676,\n radius: 16,\n step: 20,\n reveal: 13,\n speed: 1,\n};\n\ntype ReelElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ReelBase>;\n\nconst ReelInner = forwardRef<\n HTMLDivElement,\n ReelElementProps & { 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 ?? \"<Reel>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: 1180,\n height: 676,\n ...style,\n }}\n >\n <ReelBase\n {...(componentProps as unknown as ComponentProps<typeof ReelBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const Reel = Interactive.withSchema({\n Component: ReelInner,\n componentName: \"<Reel>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 160
}
diff --git a/registry-artifacts/elements/rgb-glitch-text.json b/registry-artifacts/elements/rgb-glitch-text.json
index 9cb568a7..a2bc8f12 100644
--- a/registry-artifacts/elements/rgb-glitch-text.json
+++ b/registry-artifacts/elements/rgb-glitch-text.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 300,
+ "height": 130
+ },
"displayName": "RGB Glitch Text",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "rgb-glitch-text",
- "sourceCode": "import { Interactive, Sequence, random, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface RGBGlitchTextProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n glitchAt?: number;\n glitchDuration?: number;\n intensity?: number;\n seed?: string;\n speed?: number;\n className?: string;\n}\n\nfunction RGBGlitchTextBase({\n text,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n glitchAt = 20,\n glitchDuration = 8,\n intensity = 6,\n seed = \"glitch\",\n speed = 1,\n className,\n}: RGBGlitchTextProps) {\n const frame = useCurrentFrame() * speed;\n\n const isGlitching = frame >= glitchAt && frame < glitchAt + glitchDuration;\n\n const offset = (axisSeed: string, scale: number) =>\n (random(`${seed}-${axisSeed}-${frame}`) * 2 - 1) * scale;\n\n const rX = isGlitching ? offset(\"r-x\", intensity) : 0;\n const rY = isGlitching ? offset(\"r-y\", intensity * 0.4) : 0;\n const gX = isGlitching ? offset(\"g-x\", intensity) : 0;\n const gY = isGlitching ? offset(\"g-y\", intensity * 0.4) : 0;\n const bX = isGlitching ? offset(\"b-x\", intensity) : 0;\n const bY = isGlitching ? offset(\"b-y\", intensity * 0.4) : 0;\n\n const copyOpacity = isGlitching ? 1 : 0;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n mixBlendMode: \"multiply\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#fafafa\",\n }}\n >\n <div\n className={className}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <span\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#ff0040\",\n opacity: copyOpacity,\n transform: `translateX(${rX}px) translateY(${rY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#00ff80\",\n opacity: copyOpacity,\n transform: `translateX(${gX}px) translateY(${gY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#0080ff\",\n opacity: copyOpacity,\n transform: `translateX(${bX}px) translateY(${bY}px)`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"GLITCH\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n glitchAt: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 20,\n description: \"Glitch at (frame)\",\n hiddenFromList: false,\n },\n glitchDuration: {\n type: \"number\",\n min: 1,\n max: 60,\n step: 1,\n default: 8,\n description: \"Glitch duration\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 6,\n description: \"Intensity (px)\",\n hiddenFromList: false,\n },\n seed: {\n type: \"text-content\",\n default: \"glitch\",\n description: \"Seed\",\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([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"glitchAt\",\"glitchDuration\",\"intensity\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"GLITCH\",\n fontSize: 96,\n color: \"#171717\",\n fontWeight: \"700\",\n glitchAt: 20,\n glitchDuration: 8,\n intensity: 6,\n seed: \"glitch\",\n speed: 1,\n};\n\ntype RGBGlitchTextElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RGBGlitchTextBase>;\n\nconst RGBGlitchTextInner = forwardRef<\n HTMLDivElement,\n RGBGlitchTextElementProps & { 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 ?? \"<RGBGlitchText>\"}\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 <RGBGlitchTextBase\n {...(componentProps as unknown as ComponentProps<typeof RGBGlitchTextBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RGBGlitchText = Interactive.withSchema({\n Component: RGBGlitchTextInner,\n componentName: \"<RGBGlitchText>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, random, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface RGBGlitchTextProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n glitchAt?: number;\n glitchDuration?: number;\n intensity?: number;\n seed?: string;\n speed?: number;\n className?: string;\n}\n\nfunction RGBGlitchTextBase({\n text,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n glitchAt = 20,\n glitchDuration = 8,\n intensity = 6,\n seed = \"glitch\",\n speed = 1,\n className,\n}: RGBGlitchTextProps) {\n const frame = useCurrentFrame() * speed;\n\n const isGlitching = frame >= glitchAt && frame < glitchAt + glitchDuration;\n\n const offset = (axisSeed: string, scale: number) =>\n (random(`${seed}-${axisSeed}-${frame}`) * 2 - 1) * scale;\n\n const rX = isGlitching ? offset(\"r-x\", intensity) : 0;\n const rY = isGlitching ? offset(\"r-y\", intensity * 0.4) : 0;\n const gX = isGlitching ? offset(\"g-x\", intensity) : 0;\n const gY = isGlitching ? offset(\"g-y\", intensity * 0.4) : 0;\n const bX = isGlitching ? offset(\"b-x\", intensity) : 0;\n const bY = isGlitching ? offset(\"b-y\", intensity * 0.4) : 0;\n\n const copyOpacity = isGlitching ? 1 : 0;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n mixBlendMode: \"multiply\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#fafafa\",\n }}\n >\n <div\n className={className}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <span\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#ff0040\",\n opacity: copyOpacity,\n translate: `${rX}px ${rY}px`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#00ff80\",\n opacity: copyOpacity,\n translate: `${gX}px ${gY}px`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#0080ff\",\n opacity: copyOpacity,\n translate: `${bX}px ${bY}px`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"GLITCH\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n glitchAt: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 20,\n description: \"Glitch at (frame)\",\n hiddenFromList: false,\n },\n glitchDuration: {\n type: \"number\",\n min: 1,\n max: 60,\n step: 1,\n default: 8,\n description: \"Glitch duration\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 6,\n description: \"Intensity (px)\",\n hiddenFromList: false,\n },\n seed: {\n type: \"text-content\",\n default: \"glitch\",\n description: \"Seed\",\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 width: {\n type: \"number\",\n default: 300,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 130,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"glitchAt\",\"glitchDuration\",\"intensity\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"GLITCH\",\n fontSize: 96,\n color: \"#171717\",\n fontWeight: \"700\",\n glitchAt: 20,\n glitchDuration: 8,\n intensity: 6,\n seed: \"glitch\",\n speed: 1,\n};\n\ntype RGBGlitchTextElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof RGBGlitchTextBase>;\n\nconst RGBGlitchTextInner = forwardRef<\n HTMLDivElement,\n RGBGlitchTextElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 300, height = 130, ...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 ?? \"<RGBGlitchText>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <RGBGlitchTextBase\n {...(componentProps as unknown as ComponentProps<typeof RGBGlitchTextBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const RGBGlitchText = Interactive.withSchema({\n Component: RGBGlitchTextInner,\n componentName: \"<RGBGlitchText>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/rolling-number.json b/registry-artifacts/elements/rolling-number.json
index fb5ff061..03c18bb9 100644
--- a/registry-artifacts/elements/rolling-number.json
+++ b/registry-artifacts/elements/rolling-number.json
@@ -8,12 +8,15 @@
"version": null
}
],
- "dimensions": null,
+ "dimensions": {
+ "width": 380,
+ "height": 140
+ },
"displayName": "Rolling Number",
"durationInFrames": 150,
"installationMode": "wrapped",
"slug": "rolling-number",
- "sourceCode": "import { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport { AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport React from \"react\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}"
+ "sourceCode": "import { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport { AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport React from \"react\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n translate: `0 ${(1 - reveal) * fontSize * REVEAL_RISE_EM}px`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n translate: `0 ${-value * cellHeight}px`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}"
},
"durationInFrames": 150
}
diff --git a/registry-artifacts/elements/rolodex-flip.json b/registry-artifacts/elements/rolodex-flip.json
index 160ab987..90660886 100644
--- a/registry-artifacts/elements/rolodex-flip.json
+++ b/registry-artifacts/elements/rolodex-flip.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 220,
+ "height": 60
+ },
"displayName": "Rolodex Flip",
"durationInFrames": 110,
"installationMode": "component-owned-sequence",
"slug": "rolodex-flip",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ninterface RolodexFlipProps {\n items: string[];\n from?: number;\n interval?: number;\n flipDuration?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction RolodexFlipBase({\n items,\n from = 0,\n interval = 20,\n flipDuration = 10,\n className,\n style,\n}: RolodexFlipProps) {\n const frame = useCurrentFrame();\n const sizer = items.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n perspective: 420,\n verticalAlign: \"bottom\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {items.map((item, i) => {\n const inStart = from + (i - 1) * interval + flipDuration / 2;\n const outStart = from + i * interval;\n\n let rotate = 0;\n let y = 0;\n let opacity = 1;\n\n if (i > 0) {\n const pIn = interpolate(\n frame,\n [inStart, inStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.out(Easing.cubic) },\n );\n rotate = (1 - pIn) * -85;\n y = (1 - pIn) * 20;\n opacity = pIn;\n }\n if (i < items.length - 1) {\n const pOut = interpolate(\n frame,\n [outStart, outStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.in(Easing.cubic) },\n );\n rotate += pOut * 85;\n y -= pOut * 20;\n opacity *= 1 - pOut;\n }\n if (opacity <= 0.001) return null;\n\n return (\n <span\n key={`${i}-${item}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px) rotateX(${rotate}deg)`,\n transformOrigin: \"50% 50%\",\n backfaceVisibility: \"hidden\",\n }}\n >\n {item}\n </span>\n );\n })}\n </span>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n interval: {\n type: \"number\",\n min: 10,\n max: 40,\n step: 2,\n default: 20,\n description: \"Interval\",\n hiddenFromList: false,\n },\n flipDuration: {\n type: \"number\",\n min: 4,\n max: 20,\n step: 1,\n default: 10,\n description: \"Flip duration\",\n hiddenFromList: false,\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([\"interval\",\"flipDuration\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n interval: 20,\n flipDuration: 10,\n speed: 1,\n};\n\ntype RolodexFlipElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RolodexFlipBase>;\n\nconst RolodexFlipInner = forwardRef<\n HTMLDivElement,\n RolodexFlipElementProps & { 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 ?? \"<RolodexFlip>\"}\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 <RolodexFlipBase\n {...(componentProps as unknown as ComponentProps<typeof RolodexFlipBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RolodexFlip = Interactive.withSchema({\n Component: RolodexFlipInner,\n componentName: \"<RolodexFlip>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ninterface RolodexFlipProps {\n items: string[];\n from?: number;\n interval?: number;\n flipDuration?: number;\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction RolodexFlipBase({\n items,\n from = 0,\n interval = 20,\n flipDuration = 10,\n className,\n style,\n}: RolodexFlipProps) {\n const frame = useCurrentFrame();\n const sizer = items.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n perspective: 420,\n verticalAlign: \"bottom\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {items.map((item, i) => {\n const inStart = from + (i - 1) * interval + flipDuration / 2;\n const outStart = from + i * interval;\n\n let rotate = 0;\n let y = 0;\n let opacity = 1;\n\n if (i > 0) {\n const pIn = interpolate(\n frame,\n [inStart, inStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.out(Easing.cubic) },\n );\n rotate = (1 - pIn) * -85;\n y = (1 - pIn) * 20;\n opacity = pIn;\n }\n if (i < items.length - 1) {\n const pOut = interpolate(\n frame,\n [outStart, outStart + flipDuration],\n [0, 1],\n { ...clampOpts, easing: Easing.in(Easing.cubic) },\n );\n rotate += pOut * 85;\n y -= pOut * 20;\n opacity *= 1 - pOut;\n }\n if (opacity <= 0.001) return null;\n\n return (\n <span\n key={`${i}-${item}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px) rotateX(${rotate}deg)`,\n transformOrigin: \"50% 50%\",\n backfaceVisibility: \"hidden\",\n }}\n >\n {item}\n </span>\n );\n })}\n </span>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n interval: {\n type: \"number\",\n min: 10,\n max: 40,\n step: 2,\n default: 20,\n description: \"Interval\",\n hiddenFromList: false,\n },\n flipDuration: {\n type: \"number\",\n min: 4,\n max: 20,\n step: 1,\n default: 10,\n description: \"Flip duration\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 220,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 60,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"interval\",\"flipDuration\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n interval: 20,\n flipDuration: 10,\n speed: 1,\n};\n\ntype RolodexFlipElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof RolodexFlipBase>;\n\nconst RolodexFlipInner = forwardRef<\n HTMLDivElement,\n RolodexFlipElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 220, height = 60, ...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 ?? \"<RolodexFlip>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <RolodexFlipBase\n {...(componentProps as unknown as ComponentProps<typeof RolodexFlipBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const RolodexFlip = Interactive.withSchema({\n Component: RolodexFlipInner,\n componentName: \"<RolodexFlip>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 110
}
diff --git a/registry-artifacts/elements/scale-down-fade.json b/registry-artifacts/elements/scale-down-fade.json
index 979d41e8..fcb55da0 100644
--- a/registry-artifacts/elements/scale-down-fade.json
+++ b/registry-artifacts/elements/scale-down-fade.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 600,
+ "height": 100
+ },
"displayName": "Scale Down Fade",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "scale-down-fade",
- "sourceCode": "import { 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\ninterface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ScaleDownFadeBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Quietly refined.\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Quietly refined.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ScaleDownFadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ScaleDownFadeBase>;\n\nconst ScaleDownFadeInner = forwardRef<\n HTMLDivElement,\n ScaleDownFadeElementProps & { 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 ?? \"<ScaleDownFade>\"}\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 <ScaleDownFadeBase\n {...(componentProps as unknown as ComponentProps<typeof ScaleDownFadeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ScaleDownFade = Interactive.withSchema({\n Component: ScaleDownFadeInner,\n componentName: \"<ScaleDownFade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { 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\ninterface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ScaleDownFadeBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n translate: `0 ${y}px`,\n scale: `${scale}`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Quietly refined.\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 600,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Quietly refined.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ScaleDownFadeElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ScaleDownFadeBase>;\n\nconst ScaleDownFadeInner = forwardRef<\n HTMLDivElement,\n ScaleDownFadeElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 600, height = 100, ...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 ?? \"<ScaleDownFade>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ScaleDownFadeBase\n {...(componentProps as unknown as ComponentProps<typeof ScaleDownFadeBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ScaleDownFade = Interactive.withSchema({\n Component: ScaleDownFadeInner,\n componentName: \"<ScaleDownFade>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/shared-axis-y.json b/registry-artifacts/elements/shared-axis-y.json
index fed48bda..64fe18ba 100644
--- a/registry-artifacts/elements/shared-axis-y.json
+++ b/registry-artifacts/elements/shared-axis-y.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 720,
+ "height": 100
+ },
"displayName": "Shared Axis Y",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "shared-axis-y",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SharedAxisYProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SharedAxisYBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisYProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 5;\n const exitDur = 4;\n const enterStagger = 2;\n const exitStagger = 2;\n const overlapF = 0;\n const microDelayF = 1;\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Layered navigation.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Hierarchy made clear.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Layered navigation.\",\n toText: \"Hierarchy made clear.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SharedAxisYElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SharedAxisYBase>;\n\nconst SharedAxisYInner = forwardRef<\n HTMLDivElement,\n SharedAxisYElementProps & { 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 ?? \"<SharedAxisY>\"}\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 <SharedAxisYBase\n {...(componentProps as unknown as ComponentProps<typeof SharedAxisYBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SharedAxisY = Interactive.withSchema({\n Component: SharedAxisYInner,\n componentName: \"<SharedAxisY>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SharedAxisYProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SharedAxisYBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisYProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 5;\n const exitDur = 4;\n const enterStagger = 2;\n const exitStagger = 2;\n const overlapF = 0;\n const microDelayF = 1;\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Layered navigation.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Hierarchy made clear.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 720,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Layered navigation.\",\n toText: \"Hierarchy made clear.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SharedAxisYElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SharedAxisYBase>;\n\nconst SharedAxisYInner = forwardRef<\n HTMLDivElement,\n SharedAxisYElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 720, height = 100, ...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 ?? \"<SharedAxisY>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SharedAxisYBase\n {...(componentProps as unknown as ComponentProps<typeof SharedAxisYBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SharedAxisY = Interactive.withSchema({\n Component: SharedAxisYInner,\n componentName: \"<SharedAxisY>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/shared-axis-z.json b/registry-artifacts/elements/shared-axis-z.json
index e21f624a..6c666e1a 100644
--- a/registry-artifacts/elements/shared-axis-z.json
+++ b/registry-artifacts/elements/shared-axis-z.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 870,
+ "height": 100
+ },
"displayName": "Shared Axis Z",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "shared-axis-z",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SharedAxisZProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SharedAxisZBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisZProps) {\n const frame = useCurrentFrame() * speed;\n\n const enterDur = 16;\n const exitDur = 11;\n const overlapF = 3;\n const microDelayF = 1;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toBlur = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `scale(${fromScale})`,\n filter: `blur(${fromBlur}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `scale(${toScale})`,\n filter: `blur(${toBlur}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Zooming between states.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Elevate and settle.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Zooming between states.\",\n toText: \"Elevate and settle.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SharedAxisZElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SharedAxisZBase>;\n\nconst SharedAxisZInner = forwardRef<\n HTMLDivElement,\n SharedAxisZElementProps & { 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 ?? \"<SharedAxisZ>\"}\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 <SharedAxisZBase\n {...(componentProps as unknown as ComponentProps<typeof SharedAxisZBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SharedAxisZ = Interactive.withSchema({\n Component: SharedAxisZInner,\n componentName: \"<SharedAxisZ>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SharedAxisZProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SharedAxisZBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisZProps) {\n const frame = useCurrentFrame() * speed;\n\n const enterDur = 16;\n const exitDur = 11;\n const overlapF = 3;\n const microDelayF = 1;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toBlur = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n scale: `${fromScale}`,\n filter: `blur(${fromBlur}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n scale: `${toScale}`,\n filter: `blur(${toBlur}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Zooming between states.\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"Elevate and settle.\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 870,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Zooming between states.\",\n toText: \"Elevate and settle.\",\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SharedAxisZElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SharedAxisZBase>;\n\nconst SharedAxisZInner = forwardRef<\n HTMLDivElement,\n SharedAxisZElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 870, height = 100, ...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 ?? \"<SharedAxisZ>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SharedAxisZBase\n {...(componentProps as unknown as ComponentProps<typeof SharedAxisZBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SharedAxisZ = Interactive.withSchema({\n Component: SharedAxisZInner,\n componentName: \"<SharedAxisZ>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/shimmer-sweep.json b/registry-artifacts/elements/shimmer-sweep.json
index 2849d8f4..b62ccf19 100644
--- a/registry-artifacts/elements/shimmer-sweep.json
+++ b/registry-artifacts/elements/shimmer-sweep.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 500,
+ "height": 130
+ },
"displayName": "Shimmer Sweep",
"durationInFrames": 120,
"installationMode": "component-owned-sequence",
"slug": "shimmer-sweep",
- "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ShimmerSweepProps {\n text: string;\n baseColor?: string;\n shineColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ShimmerSweepBase({\n text,\n baseColor = \"#3f3f46\",\n shineColor = \"#fafafa\",\n fontSize = 96,\n fontWeight = 700,\n speed = 1,\n className,\n}: ShimmerSweepProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const position = interpolate(\n frame,\n [0, durationInFrames * 0.8],\n [200, -100],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n margin: 0,\n lineHeight: 1,\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div style={{ position: \"relative\", display: \"inline-block\" }}>\n <span style={{ ...textStyle, color: baseColor }}>{text}</span>\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(110deg, transparent 30%, ${shineColor} 50%, transparent 70%)`,\n backgroundSize: \"200% 100%\",\n backgroundPosition: `${position}% 50%`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Generating\",\n description: \"Text\",\n },\n baseColor: {\n type: \"color\",\n default: \"#3f3f46\",\n description: \"Base color\",\n },\n shineColor: {\n type: \"color\",\n default: \"#fafafa\",\n description: \"Shine color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"baseColor\",\"shineColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Generating\",\n baseColor: \"#3f3f46\",\n shineColor: \"#fafafa\",\n fontSize: 96,\n fontWeight: \"700\",\n speed: 1,\n};\n\ntype ShimmerSweepElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShimmerSweepBase>;\n\nconst ShimmerSweepInner = forwardRef<\n HTMLDivElement,\n ShimmerSweepElementProps & { 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 ?? \"<ShimmerSweep>\"}\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 <ShimmerSweepBase\n {...(componentProps as unknown as ComponentProps<typeof ShimmerSweepBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShimmerSweep = Interactive.withSchema({\n Component: ShimmerSweepInner,\n componentName: \"<ShimmerSweep>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ShimmerSweepProps {\n text: string;\n baseColor?: string;\n shineColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ShimmerSweepBase({\n text,\n baseColor = \"#3f3f46\",\n shineColor = \"#fafafa\",\n fontSize = 96,\n fontWeight = 700,\n speed = 1,\n className,\n}: ShimmerSweepProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const position = interpolate(\n frame,\n [0, durationInFrames * 0.8],\n [200, -100],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n margin: 0,\n lineHeight: 1,\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div style={{ position: \"relative\", display: \"inline-block\" }}>\n <span style={{ ...textStyle, color: baseColor }}>{text}</span>\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(110deg, transparent 30%, ${shineColor} 50%, transparent 70%)`,\n backgroundSize: \"200% 100%\",\n backgroundPosition: `${position}% 50%`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Generating\",\n description: \"Text\",\n },\n baseColor: {\n type: \"color\",\n default: \"#3f3f46\",\n description: \"Base color\",\n },\n shineColor: {\n type: \"color\",\n default: \"#fafafa\",\n description: \"Shine color\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 500,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 130,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"baseColor\",\"shineColor\",\"fontSize\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Generating\",\n baseColor: \"#3f3f46\",\n shineColor: \"#fafafa\",\n fontSize: 96,\n fontWeight: \"700\",\n speed: 1,\n};\n\ntype ShimmerSweepElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ShimmerSweepBase>;\n\nconst ShimmerSweepInner = forwardRef<\n HTMLDivElement,\n ShimmerSweepElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 500, height = 130, ...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 ?? \"<ShimmerSweep>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ShimmerSweepBase\n {...(componentProps as unknown as ComponentProps<typeof ShimmerSweepBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ShimmerSweep = Interactive.withSchema({\n Component: ShimmerSweepInner,\n componentName: \"<ShimmerSweep>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 120
}
diff --git a/registry-artifacts/elements/short-slide-down.json b/registry-artifacts/elements/short-slide-down.json
index 1aaea595..62e8576f 100644
--- a/registry-artifacts/elements/short-slide-down.json
+++ b/registry-artifacts/elements/short-slide-down.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 640,
+ "height": 100
+ },
"displayName": "Short Slide Down",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "short-slide-down",
- "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShortSlideDownProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction ShortSlideDownBase({\n text,\n entryOffset = 28,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideDownProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const n = words.length;\n\n const lineGap = 12;\n const rowHeight = fontSize;\n const firstDur = 11;\n const pushDur = 15;\n const travelDur = 8;\n const entryScale = 0.992;\n const entryBlur = 2.4;\n const reflowBlur = 0.7;\n const firstWordY = -14;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= n; k++) {\n const total = rowHeight * k + lineGap * (k - 1);\n const start = -total / 2 + rowHeight / 2;\n const ys: number[] = [];\n for (let j = 0; j < k; j++) ys.push(start + j * (rowHeight + lineGap));\n out.push(ys);\n }\n return out;\n }, [n, rowHeight]);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetY = positionsAt[j][j];\n const yFrom = j === 0 ? firstWordY : targetY - entryOffset;\n\n let y = targetY;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n y = yFrom;\n scale = entryScale;\n blur = entryBlur;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n y = interpolate(frame, travelRange, [yFrom, targetY], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromY = positionsAt[w - 1][j];\n const toY = positionsAt[w][j];\n if (frame >= pushEnd) {\n y = toY;\n } else if (frame >= pushStart) {\n y = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromY, toY],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n y = fromY;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(0px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Build from above.\",\n description: \"Text\",\n },\n entryOffset: {\n type: \"number\",\n min: 8,\n max: 80,\n step: 1,\n default: 28,\n description: \"Entry offset\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"entryOffset\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Build from above.\",\n entryOffset: 28,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ShortSlideDownElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShortSlideDownBase>;\n\nconst ShortSlideDownInner = forwardRef<\n HTMLDivElement,\n ShortSlideDownElementProps & { 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 ?? \"<ShortSlideDown>\"}\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 <ShortSlideDownBase\n {...(componentProps as unknown as ComponentProps<typeof ShortSlideDownBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShortSlideDown = Interactive.withSchema({\n Component: ShortSlideDownInner,\n componentName: \"<ShortSlideDown>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface ShortSlideDownProps {\n text: string;\n entryOffset?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction ShortSlideDownBase({\n text,\n entryOffset = 28,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideDownProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = useMemo(() => text.split(\" \"), [text]);\n const n = words.length;\n\n const lineGap = 12;\n const rowHeight = fontSize;\n const firstDur = 11;\n const pushDur = 15;\n const travelDur = 8;\n const entryScale = 0.992;\n const entryBlur = 2.4;\n const reflowBlur = 0.7;\n const firstWordY = -14;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const positionsAt = useMemo(() => {\n const out: number[][] = [];\n for (let k = 1; k <= n; k++) {\n const total = rowHeight * k + lineGap * (k - 1);\n const start = -total / 2 + rowHeight / 2;\n const ys: number[] = [];\n for (let j = 0; j < k; j++) ys.push(start + j * (rowHeight + lineGap));\n out.push(ys);\n }\n return out;\n }, [n, rowHeight]);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n }}\n >\n {words.map((word, j) => {\n const entryStart = j === 0 ? 0 : firstDur + (j - 1) * pushDur;\n const entryEnd = entryStart + (j === 0 ? firstDur : pushDur);\n const targetY = positionsAt[j][j];\n const yFrom = j === 0 ? firstWordY : targetY - entryOffset;\n\n let y = targetY;\n let opacity = 1;\n let scale = 1;\n let blur = 0;\n\n if (frame < entryStart) {\n opacity = 0;\n y = yFrom;\n scale = entryScale;\n blur = entryBlur;\n } else if (frame <= entryEnd) {\n const range: [number, number] = [entryStart, entryEnd];\n const travelRange: [number, number] = [\n entryStart,\n Math.min(entryStart + travelDur, entryEnd),\n ];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n easing,\n };\n y = interpolate(frame, travelRange, [yFrom, targetY], opts);\n opacity = interpolate(frame, range, [0, 1], opts);\n scale = interpolate(frame, range, [entryScale, 1], opts);\n blur = interpolate(frame, range, [entryBlur, 0], opts);\n } else {\n for (let w = j + 1; w < n; w++) {\n const pushStart = firstDur + (w - 1) * pushDur;\n const pushEnd = pushStart + pushDur;\n const fromY = positionsAt[w - 1][j];\n const toY = positionsAt[w][j];\n if (frame >= pushEnd) {\n y = toY;\n } else if (frame >= pushStart) {\n y = interpolate(\n frame,\n [pushStart, Math.min(pushStart + travelDur, pushEnd)],\n [fromY, toY],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n blur = interpolate(\n frame,\n [pushStart, (pushStart + pushEnd) / 2, pushEnd],\n [0, reflowBlur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n break;\n } else {\n y = fromY;\n break;\n }\n }\n }\n\n return (\n <span\n key={j}\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n whiteSpace: \"nowrap\",\n backfaceVisibility: \"hidden\",\n transform: `translate(-50%, -50%) translate3d(0px, ${y}px, 0) scale(${scale})`,\n filter: `blur(${blur}px)`,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Build from above.\",\n description: \"Text\",\n },\n entryOffset: {\n type: \"number\",\n min: 8,\n max: 80,\n step: 1,\n default: 28,\n description: \"Entry offset\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 640,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"entryOffset\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Build from above.\",\n entryOffset: 28,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ShortSlideDownElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ShortSlideDownBase>;\n\nconst ShortSlideDownInner = forwardRef<\n HTMLDivElement,\n ShortSlideDownElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 640, height = 100, ...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 ?? \"<ShortSlideDown>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ShortSlideDownBase\n {...(componentProps as unknown as ComponentProps<typeof ShortSlideDownBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ShortSlideDown = Interactive.withSchema({\n Component: ShortSlideDownInner,\n componentName: \"<ShortSlideDown>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/short-slide-right.json b/registry-artifacts/elements/short-slide-right.json
index 43e9e611..8d74b097 100644
--- a/registry-artifacts/elements/short-slide-right.json
+++ b/registry-artifacts/elements/short-slide-right.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 640,
+ "height": 100
+ },
"displayName": "Short Slide Right",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "short-slide-right",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ShortSlideRightBase({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const travelDur = 8;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, travelDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transform: `translateX(${x}px)`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Move with intent.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 24,\n description: \"Distance\",\n hiddenFromList: false,\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"distance\",\"staggerDelay\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Move with intent.\",\n distance: 24,\n staggerDelay: 3,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ShortSlideRightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ShortSlideRightBase>;\n\nconst ShortSlideRightInner = forwardRef<\n HTMLDivElement,\n ShortSlideRightElementProps & { 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 ?? \"<ShortSlideRight>\"}\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 <ShortSlideRightBase\n {...(componentProps as unknown as ComponentProps<typeof ShortSlideRightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ShortSlideRight = Interactive.withSchema({\n Component: ShortSlideRightInner,\n componentName: \"<ShortSlideRight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction ShortSlideRightBase({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const travelDur = 8;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, travelDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n translate: `${x}px`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Move with intent.\",\n description: \"Text\",\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 24,\n description: \"Distance\",\n hiddenFromList: false,\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 640,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"distance\",\"staggerDelay\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Move with intent.\",\n distance: 24,\n staggerDelay: 3,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype ShortSlideRightElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ShortSlideRightBase>;\n\nconst ShortSlideRightInner = forwardRef<\n HTMLDivElement,\n ShortSlideRightElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 640, height = 100, ...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 ?? \"<ShortSlideRight>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ShortSlideRightBase\n {...(componentProps as unknown as ComponentProps<typeof ShortSlideRightBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ShortSlideRight = Interactive.withSchema({\n Component: ShortSlideRightInner,\n componentName: \"<ShortSlideRight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/simulated-cursor.json b/registry-artifacts/elements/simulated-cursor.json
index a602cd0a..e6f6ec73 100644
--- a/registry-artifacts/elements/simulated-cursor.json
+++ b/registry-artifacts/elements/simulated-cursor.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 890,
+ "height": 450
+ },
"displayName": "Simulated Cursor",
"durationInFrames": 150,
"installationMode": "component-owned-sequence",
"slug": "simulated-cursor",
- "sourceCode": "import { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\ninterface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nfunction SimulatedCursorBase({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n transform: `scale(${clickScale})`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Color\",\n },\n size: {\n type: \"number\",\n min: 12,\n max: 96,\n step: 1,\n default: 32,\n description: \"Size\",\n hiddenFromList: false,\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([\"color\",\"size\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#ffffff\",\n size: 32,\n speed: 1,\n};\n\ntype SimulatedCursorElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SimulatedCursorBase>;\n\nconst SimulatedCursorInner = forwardRef<\n HTMLDivElement,\n SimulatedCursorElementProps & { 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 ?? \"<SimulatedCursor>\"}\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 <SimulatedCursorBase\n {...(componentProps as unknown as ComponentProps<typeof SimulatedCursorBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SimulatedCursor = Interactive.withSchema({\n Component: SimulatedCursorInner,\n componentName: \"<SimulatedCursor>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\ninterface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nfunction SimulatedCursorBase({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n scale: `${clickScale}`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Color\",\n },\n size: {\n type: \"number\",\n min: 12,\n max: 96,\n step: 1,\n default: 32,\n description: \"Size\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 890,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 450,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"color\",\"size\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#ffffff\",\n size: 32,\n speed: 1,\n};\n\ntype SimulatedCursorElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SimulatedCursorBase>;\n\nconst SimulatedCursorInner = forwardRef<\n HTMLDivElement,\n SimulatedCursorElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 890, height = 450, ...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 ?? \"<SimulatedCursor>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SimulatedCursorBase\n {...(componentProps as unknown as ComponentProps<typeof SimulatedCursorBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SimulatedCursor = Interactive.withSchema({\n Component: SimulatedCursorInner,\n componentName: \"<SimulatedCursor>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 150
}
diff --git a/registry-artifacts/elements/slot-machine-roll.json b/registry-artifacts/elements/slot-machine-roll.json
index c3089d44..e9ea0a45 100644
--- a/registry-artifacts/elements/slot-machine-roll.json
+++ b/registry-artifacts/elements/slot-machine-roll.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 190,
+ "height": 170
+ },
"displayName": "Slot Machine Roll",
"durationInFrames": 90,
"installationMode": "wrapped",
"slug": "slot-machine-roll",
- "sourceCode": "import { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SlotMachineRollProps {\n from?: string;\n to?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SlotMachineRoll({\n from = \"$99\",\n to = \"$199\",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: SlotMachineRollProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const len = Math.max(from.length, to.length);\n const paddedFrom = from.padStart(len, \" \");\n const paddedTo = to.padStart(len, \" \");\n\n const columns = [];\n for (let i = 0; i < len; i++) {\n const raw = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 14 },\n });\n const t = Math.max(0, Math.min(1, raw));\n columns.push(\n <span\n key={i}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: \"1.1em\",\n lineHeight: \"1.1em\",\n verticalAlign: \"top\",\n width: \"0.7em\",\n textAlign: \"center\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-t * fontSize * 1.1}px)`,\n }}\n >\n <span>{paddedFrom[i]}</span>\n <span>{paddedTo[i]}</span>\n </span>\n </span>,\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n lineHeight: 1.1,\n }}\n >\n {columns}\n </span>\n </div>\n );\n}"
+ "sourceCode": "import { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SlotMachineRollProps {\n from?: string;\n to?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SlotMachineRoll({\n from = \"$99\",\n to = \"$199\",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: SlotMachineRollProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const len = Math.max(from.length, to.length);\n const paddedFrom = from.padStart(len, \" \");\n const paddedTo = to.padStart(len, \" \");\n\n const columns = [];\n for (let i = 0; i < len; i++) {\n const raw = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 14 },\n });\n const t = Math.max(0, Math.min(1, raw));\n columns.push(\n <span\n key={i}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: \"1.1em\",\n lineHeight: \"1.1em\",\n verticalAlign: \"top\",\n width: \"0.7em\",\n textAlign: \"center\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n translate: `0 ${-t * fontSize * 1.1}px`,\n }}\n >\n <span>{paddedFrom[i]}</span>\n <span>{paddedTo[i]}</span>\n </span>\n </span>,\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n lineHeight: 1.1,\n }}\n >\n {columns}\n </span>\n </div>\n );\n}"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/soft-blur-in.json b/registry-artifacts/elements/soft-blur-in.json
index efdc41d8..248a08b4 100644
--- a/registry-artifacts/elements/soft-blur-in.json
+++ b/registry-artifacts/elements/soft-blur-in.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 600,
+ "height": 100
+ },
"displayName": "Soft Blur In",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "soft-blur-in",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SoftBlurInBase({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const charTravelFrames = 9;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Think different.\",\n description: \"Text\",\n },\n blur: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 12,\n description: \"Blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"blur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Think different.\",\n blur: 12,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SoftBlurInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SoftBlurInBase>;\n\nconst SoftBlurInInner = forwardRef<\n HTMLDivElement,\n SoftBlurInElementProps & { 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 ?? \"<SoftBlurIn>\"}\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 <SoftBlurInBase\n {...(componentProps as unknown as ComponentProps<typeof SoftBlurInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SoftBlurIn = Interactive.withSchema({\n Component: SoftBlurInInner,\n componentName: \"<SoftBlurIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SoftBlurInBase({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const charTravelFrames = 9;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Think different.\",\n description: \"Text\",\n },\n blur: {\n type: \"number\",\n min: 1,\n max: 30,\n step: 1,\n default: 12,\n description: \"Blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 600,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"blur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Think different.\",\n blur: 12,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SoftBlurInElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SoftBlurInBase>;\n\nconst SoftBlurInInner = forwardRef<\n HTMLDivElement,\n SoftBlurInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 600, height = 100, ...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 ?? \"<SoftBlurIn>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SoftBlurInBase\n {...(componentProps as unknown as ComponentProps<typeof SoftBlurInBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SoftBlurIn = Interactive.withSchema({\n Component: SoftBlurInInner,\n componentName: \"<SoftBlurIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/spring-scale-in.json b/registry-artifacts/elements/spring-scale-in.json
index 26439a3c..f6c835c8 100644
--- a/registry-artifacts/elements/spring-scale-in.json
+++ b/registry-artifacts/elements/spring-scale-in.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 720,
+ "height": 100
+ },
"displayName": "Spring Scale In",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "spring-scale-in",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SpringScaleInBase({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Fast. Crisp. Fluid.\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n scaleFrom: {\n type: \"number\",\n min: 0.1,\n max: 1,\n step: 0.05,\n default: 0.7,\n description: \"Scale from\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"staggerDelay\",\"scaleFrom\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Fast. Crisp. Fluid.\",\n staggerDelay: 3,\n scaleFrom: 0.7,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SpringScaleInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SpringScaleInBase>;\n\nconst SpringScaleInInner = forwardRef<\n HTMLDivElement,\n SpringScaleInElementProps & { 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 ?? \"<SpringScaleIn>\"}\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 <SpringScaleInBase\n {...(componentProps as unknown as ComponentProps<typeof SpringScaleInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SpringScaleIn = Interactive.withSchema({\n Component: SpringScaleInInner,\n componentName: \"<SpringScaleIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction SpringScaleInBase({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n scale: `${scale}`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Fast. Crisp. Fluid.\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n scaleFrom: {\n type: \"number\",\n min: 0.1,\n max: 1,\n step: 0.05,\n default: 0.7,\n description: \"Scale from\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 720,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"scaleFrom\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Fast. Crisp. Fluid.\",\n staggerDelay: 3,\n scaleFrom: 0.7,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype SpringScaleInElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SpringScaleInBase>;\n\nconst SpringScaleInInner = forwardRef<\n HTMLDivElement,\n SpringScaleInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 720, height = 100, ...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 ?? \"<SpringScaleIn>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SpringScaleInBase\n {...(componentProps as unknown as ComponentProps<typeof SpringScaleInBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SpringScaleIn = Interactive.withSchema({\n Component: SpringScaleInInner,\n componentName: \"<SpringScaleIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/staggered-fade-up.json b/registry-artifacts/elements/staggered-fade-up.json
index 2fd11949..a57e39ef 100644
--- a/registry-artifacts/elements/staggered-fade-up.json
+++ b/registry-artifacts/elements/staggered-fade-up.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 870,
+ "height": 100
+ },
"displayName": "Staggered Fade Up",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "staggered-fade-up",
- "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface StaggeredFadeUpProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction StaggeredFadeUpBase({\n text,\n staggerDelay = 4,\n distance = 20,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StaggeredFadeUpProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const y = interpolate(local, [0, 12], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Ship faster with remocn\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 4,\n description: \"Stagger delay\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 20,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Ship faster with remocn\",\n staggerDelay: 4,\n distance: 20,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype StaggeredFadeUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof StaggeredFadeUpBase>;\n\nconst StaggeredFadeUpInner = forwardRef<\n HTMLDivElement,\n StaggeredFadeUpElementProps & { 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 ?? \"<StaggeredFadeUp>\"}\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 <StaggeredFadeUpBase\n {...(componentProps as unknown as ComponentProps<typeof StaggeredFadeUpBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const StaggeredFadeUp = Interactive.withSchema({\n Component: StaggeredFadeUpInner,\n componentName: \"<StaggeredFadeUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface StaggeredFadeUpProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction StaggeredFadeUpBase({\n text,\n staggerDelay = 4,\n distance = 20,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StaggeredFadeUpProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const y = interpolate(local, [0, 12], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Ship faster with remocn\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 0,\n max: 30,\n step: 1,\n default: 4,\n description: \"Stagger delay\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 20,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 870,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Ship faster with remocn\",\n staggerDelay: 4,\n distance: 20,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype StaggeredFadeUpElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof StaggeredFadeUpBase>;\n\nconst StaggeredFadeUpInner = forwardRef<\n HTMLDivElement,\n StaggeredFadeUpElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 870, height = 100, ...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 ?? \"<StaggeredFadeUp>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <StaggeredFadeUpBase\n {...(componentProps as unknown as ComponentProps<typeof StaggeredFadeUpBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const StaggeredFadeUp = Interactive.withSchema({\n Component: StaggeredFadeUpInner,\n componentName: \"<StaggeredFadeUp>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/strikethrough-replace.json b/registry-artifacts/elements/strikethrough-replace.json
index 24884d0f..89a3737e 100644
--- a/registry-artifacts/elements/strikethrough-replace.json
+++ b/registry-artifacts/elements/strikethrough-replace.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 300,
+ "height": 130
+ },
"displayName": "Strikethrough Replace",
"durationInFrames": 120,
"installationMode": "wrapped",
"slug": "strikethrough-replace",
- "sourceCode": "import { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface StrikethroughReplaceProps {\n from: string;\n to: string;\n lineColor?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StrikethroughReplace({\n from,\n to,\n lineColor = \"#ff5e3a\",\n fontSize = 48,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StrikethroughReplaceProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Phases:\n // 0 .. 40% -> draw strikethrough across `from`\n // 40% .. 60% -> fade out `from`, fade in `to`\n // 60% .. 100% -> hold\n const strikeEnd = durationInFrames * 0.4;\n const fadeStart = durationInFrames * 0.4;\n const fadeEnd = durationInFrames * 0.6;\n\n const linePct = interpolate(frame, [0, strikeEnd], [0, 100], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const fromOpacity = interpolate(frame, [fadeStart, fadeEnd], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const toOpacity = interpolate(frame, [fadeStart, fadeEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const toY = interpolate(frame, [fadeStart, fadeEnd], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {/* from text with strikethrough line */}\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n opacity: fromOpacity,\n }}\n >\n {from}\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n height: Math.max(2, Math.round(fontSize * 0.08)),\n width: `${linePct}%`,\n background: lineColor,\n transform: \"translateY(-50%)\",\n borderRadius: 2,\n }}\n />\n </span>\n\n {/* to text */}\n <span\n className={className}\n style={{\n ...textStyle,\n opacity: toOpacity,\n transform: `translateY(${toY}px)`,\n }}\n >\n {to}\n </span>\n </div>\n </div>\n );\n}"
+ "sourceCode": "import { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface StrikethroughReplaceProps {\n from: string;\n to: string;\n lineColor?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StrikethroughReplace({\n from,\n to,\n lineColor = \"#ff5e3a\",\n fontSize = 48,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StrikethroughReplaceProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Phases:\n // 0 .. 40% -> draw strikethrough across `from`\n // 40% .. 60% -> fade out `from`, fade in `to`\n // 60% .. 100% -> hold\n const strikeEnd = durationInFrames * 0.4;\n const fadeStart = durationInFrames * 0.4;\n const fadeEnd = durationInFrames * 0.6;\n\n const linePct = interpolate(frame, [0, strikeEnd], [0, 100], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const fromOpacity = interpolate(frame, [fadeStart, fadeEnd], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const toOpacity = interpolate(frame, [fadeStart, fadeEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const toY = interpolate(frame, [fadeStart, fadeEnd], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {/* from text with strikethrough line */}\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n opacity: fromOpacity,\n }}\n >\n {from}\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n height: Math.max(2, Math.round(fontSize * 0.08)),\n width: `${linePct}%`,\n background: lineColor,\n translate: \"0 -50%\",\n borderRadius: 2,\n }}\n />\n </span>\n\n {/* to text */}\n <span\n className={className}\n style={{\n ...textStyle,\n opacity: toOpacity,\n translate: `0 ${toY}px`,\n }}\n >\n {to}\n </span>\n </div>\n </div>\n );\n}"
},
"durationInFrames": 120
}
diff --git a/registry-artifacts/elements/sustained-glitch.json b/registry-artifacts/elements/sustained-glitch.json
index 7bcc92bd..35fe3d48 100644
--- a/registry-artifacts/elements/sustained-glitch.json
+++ b/registry-artifacts/elements/sustained-glitch.json
@@ -13,7 +13,7 @@
"durationInFrames": 120,
"installationMode": "component-owned-sequence",
"slug": "sustained-glitch",
- "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype SustainedGlitchProps = {\n intensity?: number;\n frequency?: number;\n slices?: number;\n seed?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_intensity;\nuniform float u_frequency;\nuniform float u_slices;\nuniform float u_seed;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(vec2 uv, float split) {\n vec4 center = texture(u_scene, uv);\n float r = texture(u_scene, fract(vec2(uv.x + split, uv.y))).r;\n float b = texture(u_scene, fract(vec2(uv.x - split, uv.y))).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float slotLength = max(30.0 / max(u_frequency, 0.1), 4.0);\n float slot = floor(u_frame / slotLength);\n float local = u_frame - slot * slotLength;\n\n float burstLength = 2.0 + floor(hash(vec2(slot, u_seed + 2.0)) * 4.0);\n float start =\n floor(hash(vec2(slot, u_seed + 1.0)) * max(slotLength - burstLength, 1.0));\n float fires = step(0.25, hash(vec2(slot, u_seed + 3.0)));\n\n float age = local - start;\n float live = fires * step(0.0, age) * step(age, burstLength - 1.0);\n float energy =\n max(u_intensity, 0.0) * live * (1.0 - age / burstLength);\n\n if (energy <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n\n float clock = mod(u_frame, 512.0) + u_seed;\n float row = floor(v_uv.y * max(u_slices, 2.0));\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.28 * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(1.0 - 0.45 * min(energy, 1.0), hash(block + clock * 7.3));\n vec2 jump =\n vec2(\n hash(block + clock * 3.1 + 5.0) - 0.5,\n hash(block + clock * 9.7 + 11.0) - 0.5\n ) *\n vec2(0.62, 0.34) *\n corrupt;\n\n vec2 uv = fract(v_uv + vec2(sliceShift, 0.0) + jump);\n float split = 0.02 * energy * (0.35 + abs(amount));\n\n vec4 color = sampleSplit(uv, split);\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = vec4(clamp(color.rgb, 0.0, 1.0), color.a);\n}`;\n\nconst shader = makeFilterShader<SustainedGlitchProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_frequency\"), frequency);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_seed\"), seed);\n },\n);\n\nfunction burstEnergy(\n frame: number,\n intensity: number,\n frequency: number,\n seed: number,\n): number {\n const slotLength = Math.max(30 / Math.max(frequency, 0.1), 4);\n const slot = Math.floor(frame / slotLength);\n const local = frame - slot * slotLength;\n\n const burstLength = 2 + Math.floor(random(`glitch-len-${seed}-${slot}`) * 4);\n const start = Math.floor(\n random(`glitch-start-${seed}-${slot}`) *\n Math.max(slotLength - burstLength, 1),\n );\n if (random(`glitch-fire-${seed}-${slot}`) < 0.25) return 0;\n\n const age = local - start;\n if (age < 0 || age > burstLength - 1) return 0;\n return Math.max(intensity, 0) * (1 - age / burstLength);\n}\n\nconst SustainedGlitchFallback: React.FC<\n SustainedGlitchProps & CanvasFilterProps\n> = ({\n children,\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n}) => {\n const frame = useCurrentFrame();\n const energy = burstEnergy(frame, intensity, frequency, seed);\n\n if (energy <= 0) {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shift =\n (random(`glitch-shift-${seed}-${frame}-${band}`) - 0.5) * 46 * energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n transform: `translateX(${shift}px)`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity:\n 0.18 *\n energy *\n random(`glitch-tint-${seed}-${frame}-${band}`),\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nconst SustainedGlitchBase = makeCanvasFilter<SustainedGlitchProps>({\n shader,\n fallback: SustainedGlitchFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n intensity: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n frequency: {\n type: \"number\",\n min: 0.1,\n max: 6,\n step: 0.1,\n default: 1,\n description: \"Frequency\",\n hiddenFromList: false,\n },\n slices: {\n type: \"number\",\n min: 6,\n max: 48,\n step: 1,\n default: 24,\n description: \"Slices\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 1,\n description: \"Seed\",\n hiddenFromList: false,\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([\"intensity\",\"frequency\",\"slices\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n speed: 1,\n};\n\ntype SustainedGlitchElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SustainedGlitchBase>;\n\nconst SustainedGlitchInner = forwardRef<\n HTMLDivElement,\n SustainedGlitchElementProps & { 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 ?? \"<SustainedGlitch>\"}\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 <SustainedGlitchBase\n {...(componentProps as unknown as ComponentProps<typeof SustainedGlitchBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SustainedGlitch = Interactive.withSchema({\n Component: SustainedGlitchInner,\n componentName: \"<SustainedGlitch>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype SustainedGlitchProps = {\n intensity?: number;\n frequency?: number;\n slices?: number;\n seed?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_intensity;\nuniform float u_frequency;\nuniform float u_slices;\nuniform float u_seed;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(vec2 uv, float split) {\n vec4 center = texture(u_scene, uv);\n float r = texture(u_scene, fract(vec2(uv.x + split, uv.y))).r;\n float b = texture(u_scene, fract(vec2(uv.x - split, uv.y))).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float slotLength = max(30.0 / max(u_frequency, 0.1), 4.0);\n float slot = floor(u_frame / slotLength);\n float local = u_frame - slot * slotLength;\n\n float burstLength = 2.0 + floor(hash(vec2(slot, u_seed + 2.0)) * 4.0);\n float start =\n floor(hash(vec2(slot, u_seed + 1.0)) * max(slotLength - burstLength, 1.0));\n float fires = step(0.25, hash(vec2(slot, u_seed + 3.0)));\n\n float age = local - start;\n float live = fires * step(0.0, age) * step(age, burstLength - 1.0);\n float energy =\n max(u_intensity, 0.0) * live * (1.0 - age / burstLength);\n\n if (energy <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n\n float clock = mod(u_frame, 512.0) + u_seed;\n float row = floor(v_uv.y * max(u_slices, 2.0));\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.28 * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(1.0 - 0.45 * min(energy, 1.0), hash(block + clock * 7.3));\n vec2 jump =\n vec2(\n hash(block + clock * 3.1 + 5.0) - 0.5,\n hash(block + clock * 9.7 + 11.0) - 0.5\n ) *\n vec2(0.62, 0.34) *\n corrupt;\n\n vec2 uv = fract(v_uv + vec2(sliceShift, 0.0) + jump);\n float split = 0.02 * energy * (0.35 + abs(amount));\n\n vec4 color = sampleSplit(uv, split);\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = vec4(clamp(color.rgb, 0.0, 1.0), color.a);\n}`;\n\nconst shader = makeFilterShader<SustainedGlitchProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_frequency\"), frequency);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_seed\"), seed);\n },\n);\n\nfunction burstEnergy(\n frame: number,\n intensity: number,\n frequency: number,\n seed: number,\n): number {\n const slotLength = Math.max(30 / Math.max(frequency, 0.1), 4);\n const slot = Math.floor(frame / slotLength);\n const local = frame - slot * slotLength;\n\n const burstLength = 2 + Math.floor(random(`glitch-len-${seed}-${slot}`) * 4);\n const start = Math.floor(\n random(`glitch-start-${seed}-${slot}`) *\n Math.max(slotLength - burstLength, 1),\n );\n if (random(`glitch-fire-${seed}-${slot}`) < 0.25) return 0;\n\n const age = local - start;\n if (age < 0 || age > burstLength - 1) return 0;\n return Math.max(intensity, 0) * (1 - age / burstLength);\n}\n\nconst SustainedGlitchFallback: React.FC<\n SustainedGlitchProps & CanvasFilterProps\n> = ({\n children,\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n}) => {\n const frame = useCurrentFrame();\n const energy = burstEnergy(frame, intensity, frequency, seed);\n\n if (energy <= 0) {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shift =\n (random(`glitch-shift-${seed}-${frame}-${band}`) - 0.5) * 46 * energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n translate: `${shift}px`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity:\n 0.18 *\n energy *\n random(`glitch-tint-${seed}-${frame}-${band}`),\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nconst SustainedGlitchBase = makeCanvasFilter<SustainedGlitchProps>({\n shader,\n fallback: SustainedGlitchFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n intensity: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n frequency: {\n type: \"number\",\n min: 0.1,\n max: 6,\n step: 0.1,\n default: 1,\n description: \"Frequency\",\n hiddenFromList: false,\n },\n slices: {\n type: \"number\",\n min: 6,\n max: 48,\n step: 1,\n default: 24,\n description: \"Slices\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 1,\n description: \"Seed\",\n hiddenFromList: false,\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([\"intensity\",\"frequency\",\"slices\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n speed: 1,\n};\n\ntype SustainedGlitchElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SustainedGlitchBase>;\n\nconst SustainedGlitchInner = forwardRef<\n HTMLDivElement,\n SustainedGlitchElementProps & { 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 ?? \"<SustainedGlitch>\"}\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 <SustainedGlitchBase\n {...(componentProps as unknown as ComponentProps<typeof SustainedGlitchBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SustainedGlitch = Interactive.withSchema({\n Component: SustainedGlitchInner,\n componentName: \"<SustainedGlitch>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 120
}
diff --git a/registry-artifacts/elements/terminal-simulator.json b/registry-artifacts/elements/terminal-simulator.json
index f864c749..eb0ec6ab 100644
--- a/registry-artifacts/elements/terminal-simulator.json
+++ b/registry-artifacts/elements/terminal-simulator.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 900,
+ "height": 480
+ },
"displayName": "Terminal Simulator",
"durationInFrames": 240,
"installationMode": "component-owned-sequence",
"slug": "terminal-simulator",
- "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\ninterface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\ninterface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nfunction TerminalSimulatorBase({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n transform: `translateY(${translateY}px)`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n prompt: {\n type: \"text-content\",\n default: \"$\",\n description: \"Prompt\",\n },\n title: {\n type: \"text-content\",\n default: \"~/projects/remocn\",\n description: \"Title\",\n },\n background: {\n type: \"color\",\n default: \"#0a0a0a\",\n description: \"Background\",\n },\n chromeColor: {\n type: \"color\",\n default: \"#1a1a1a\",\n description: \"Chrome color\",\n },\n fontSize: {\n type: \"number\",\n min: 10,\n max: 32,\n step: 1,\n default: 18,\n description: \"Font size\",\n hiddenFromList: false,\n },\n charsPerFrame: {\n type: \"number\",\n min: 0.25,\n max: 6,\n step: 0.25,\n default: 1,\n description: \"Chars / frame\",\n hiddenFromList: false,\n },\n chunkSize: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 1,\n description: \"Chunk size\",\n hiddenFromList: false,\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([\"prompt\",\"title\",\"background\",\"chromeColor\",\"fontSize\",\"charsPerFrame\",\"chunkSize\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n prompt: \"$\",\n title: \"~/projects/remocn\",\n background: \"#0a0a0a\",\n chromeColor: \"#1a1a1a\",\n fontSize: 18,\n charsPerFrame: 1,\n chunkSize: 1,\n speed: 1,\n};\n\ntype TerminalSimulatorElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TerminalSimulatorBase>;\n\nconst TerminalSimulatorInner = forwardRef<\n HTMLDivElement,\n TerminalSimulatorElementProps & { 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 ?? \"<TerminalSimulator>\"}\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 <TerminalSimulatorBase\n {...(componentProps as unknown as ComponentProps<typeof TerminalSimulatorBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TerminalSimulator = Interactive.withSchema({\n Component: TerminalSimulatorInner,\n componentName: \"<TerminalSimulator>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\ninterface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\ninterface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nfunction TerminalSimulatorBase({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n translate: `0 ${translateY}px`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n prompt: {\n type: \"text-content\",\n default: \"$\",\n description: \"Prompt\",\n },\n title: {\n type: \"text-content\",\n default: \"~/projects/remocn\",\n description: \"Title\",\n },\n background: {\n type: \"color\",\n default: \"#0a0a0a\",\n description: \"Background\",\n },\n chromeColor: {\n type: \"color\",\n default: \"#1a1a1a\",\n description: \"Chrome color\",\n },\n fontSize: {\n type: \"number\",\n min: 10,\n max: 32,\n step: 1,\n default: 18,\n description: \"Font size\",\n hiddenFromList: false,\n },\n charsPerFrame: {\n type: \"number\",\n min: 0.25,\n max: 6,\n step: 0.25,\n default: 1,\n description: \"Chars / frame\",\n hiddenFromList: false,\n },\n chunkSize: {\n type: \"number\",\n min: 1,\n max: 20,\n step: 1,\n default: 1,\n description: \"Chunk size\",\n hiddenFromList: false,\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 width: {\n type: \"number\",\n default: 900,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 480,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"prompt\",\"title\",\"background\",\"chromeColor\",\"fontSize\",\"charsPerFrame\",\"chunkSize\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n prompt: \"$\",\n title: \"~/projects/remocn\",\n background: \"#0a0a0a\",\n chromeColor: \"#1a1a1a\",\n fontSize: 18,\n charsPerFrame: 1,\n chunkSize: 1,\n speed: 1,\n};\n\ntype TerminalSimulatorElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TerminalSimulatorBase>;\n\nconst TerminalSimulatorInner = forwardRef<\n HTMLDivElement,\n TerminalSimulatorElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 900, height = 480, ...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 ?? \"<TerminalSimulator>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TerminalSimulatorBase\n {...(componentProps as unknown as ComponentProps<typeof TerminalSimulatorBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TerminalSimulator = Interactive.withSchema({\n Component: TerminalSimulatorInner,\n componentName: \"<TerminalSimulator>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 240
}
diff --git a/registry-artifacts/elements/top-down-letters.json b/registry-artifacts/elements/top-down-letters.json
index 005b89c3..a8c3060e 100644
--- a/registry-artifacts/elements/top-down-letters.json
+++ b/registry-artifacts/elements/top-down-letters.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 230,
+ "height": 100
+ },
"displayName": "Top-Down Letters",
"durationInFrames": 60,
"installationMode": "component-owned-sequence",
"slug": "top-down-letters",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction TopDownLettersBase({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Signal\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 46,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Signal\",\n staggerDelay: 3,\n distance: 46,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype TopDownLettersElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TopDownLettersBase>;\n\nconst TopDownLettersInner = forwardRef<\n HTMLDivElement,\n TopDownLettersElementProps & { 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 ?? \"<TopDownLetters>\"}\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 <TopDownLettersBase\n {...(componentProps as unknown as ComponentProps<typeof TopDownLettersBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TopDownLetters = Interactive.withSchema({\n Component: TopDownLettersInner,\n componentName: \"<TopDownLetters>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction TopDownLettersBase({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Signal\",\n description: \"Text\",\n },\n staggerDelay: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 3,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 0,\n max: 120,\n step: 1,\n default: 46,\n description: \"Distance\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"600\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 230,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 100,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"staggerDelay\",\"distance\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Signal\",\n staggerDelay: 3,\n distance: 46,\n fontSize: 72,\n color: \"#171717\",\n fontWeight: \"600\",\n speed: 1,\n};\n\ntype TopDownLettersElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TopDownLettersBase>;\n\nconst TopDownLettersInner = forwardRef<\n HTMLDivElement,\n TopDownLettersElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 230, height = 100, ...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 ?? \"<TopDownLetters>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TopDownLettersBase\n {...(componentProps as unknown as ComponentProps<typeof TopDownLettersBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TopDownLetters = Interactive.withSchema({\n Component: TopDownLettersInner,\n componentName: \"<TopDownLetters>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 60
}
diff --git a/registry-artifacts/elements/tracking-in.json b/registry-artifacts/elements/tracking-in.json
index 5ffaafaa..bac9fe14 100644
--- a/registry-artifacts/elements/tracking-in.json
+++ b/registry-artifacts/elements/tracking-in.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 550,
+ "height": 130
+ },
"displayName": "Tracking In",
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "tracking-in",
- "sourceCode": "import { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface TrackingInProps {\n text: string;\n startTracking?: number;\n startBlur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction TrackingInBase({\n text,\n startTracking = 0.5,\n startBlur = 12,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: TrackingInProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const t = spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 90 },\n });\n\n const letterSpacing = `${interpolate(t, [0, 1], [startTracking, -0.03])}em`;\n const blurAmount = interpolate(t, [0, 1], [startBlur, 0]);\n const opacity = interpolate(frame, [0, 15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing,\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"tracking in\",\n description: \"Text\",\n },\n startTracking: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.5,\n description: \"Start tracking (em)\",\n hiddenFromList: false,\n },\n startBlur: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 12,\n description: \"Start blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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([\"text\",\"startTracking\",\"startBlur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"tracking in\",\n startTracking: 0.5,\n startBlur: 12,\n fontSize: 96,\n color: \"#171717\",\n fontWeight: \"700\",\n speed: 1,\n};\n\ntype TrackingInElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TrackingInBase>;\n\nconst TrackingInInner = forwardRef<\n HTMLDivElement,\n TrackingInElementProps & { 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 ?? \"<TrackingIn>\"}\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 <TrackingInBase\n {...(componentProps as unknown as ComponentProps<typeof TrackingInBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TrackingIn = Interactive.withSchema({\n Component: TrackingInInner,\n componentName: \"<TrackingIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface TrackingInProps {\n text: string;\n startTracking?: number;\n startBlur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nfunction TrackingInBase({\n text,\n startTracking = 0.5,\n startBlur = 12,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: TrackingInProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const t = spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 90 },\n });\n\n const letterSpacing = `${interpolate(t, [0, 1], [startTracking, -0.03])}em`;\n const blurAmount = interpolate(t, [0, 1], [startBlur, 0]);\n const opacity = interpolate(frame, [0, 15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing,\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"tracking in\",\n description: \"Text\",\n },\n startTracking: {\n type: \"number\",\n min: 0,\n max: 2,\n step: 0.05,\n default: 0.5,\n description: \"Start tracking (em)\",\n hiddenFromList: false,\n },\n startBlur: {\n type: \"number\",\n min: 0,\n max: 40,\n step: 1,\n default: 12,\n description: \"Start blur\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 200,\n step: 1,\n default: 96,\n description: \"Font size\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"700\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\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 width: {\n type: \"number\",\n default: 550,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 130,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"startTracking\",\"startBlur\",\"fontSize\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"tracking in\",\n startTracking: 0.5,\n startBlur: 12,\n fontSize: 96,\n color: \"#171717\",\n fontWeight: \"700\",\n speed: 1,\n};\n\ntype TrackingInElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof TrackingInBase>;\n\nconst TrackingInInner = forwardRef<\n HTMLDivElement,\n TrackingInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 550, height = 130, ...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 ?? \"<TrackingIn>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <TrackingInBase\n {...(componentProps as unknown as ComponentProps<typeof TrackingInBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const TrackingIn = Interactive.withSchema({\n Component: TrackingInInner,\n componentName: \"<TrackingIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/elements/tv-power-off.json b/registry-artifacts/elements/tv-power-off.json
index d7ada2e1..4fb7a2ef 100644
--- a/registry-artifacts/elements/tv-power-off.json
+++ b/registry-artifacts/elements/tv-power-off.json
@@ -13,7 +13,7 @@
"durationInFrames": 18,
"installationMode": "wrapped",
"slug": "tv-power-off",
- "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport React from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nexport type TvPowerOffProps = {\n durationInFrames?: number;\n delay?: number;\n gain?: number;\n afterglow?: number;\n phosphor?: string;\n};\n\nconst DEFAULTS = {\n durationInFrames: 18,\n delay: 0,\n gain: 1,\n afterglow: 1,\n phosphor: \"#d8ecff\",\n};\n\nconst COLLAPSE_END = 0.6;\nconst PINCH_END = 0.82;\nconst MIN_SQUASH = 0.0055;\nconst MIN_PINCH = 0.004;\nconst CONCENTRATION = 0.3;\nconst DECAY_CURVE = 2.6;\nconst BLACKOUT_IN = 0.06;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec2 u_resolution;\nuniform float u_aspect;\nuniform float u_progress;\nuniform float u_gain;\nuniform float u_afterglow;\nuniform vec3 u_phosphor;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 32;\nconst int COLUMN_TAPS = 8;\nconst float GOLDEN = 0.6180339887;\nconst float COLLAPSE_END = ${COLLAPSE_END.toFixed(4)};\nconst float PINCH_END = ${PINCH_END.toFixed(4)};\nconst float MIN_SQUASH = ${MIN_SQUASH.toFixed(5)};\nconst float MIN_PINCH = ${MIN_PINCH.toFixed(5)};\nconst float CONCENTRATION = ${CONCENTRATION.toFixed(4)};\nconst float DECAY_CURVE = ${DECAY_CURVE.toFixed(4)};\nconst float BLACKOUT_IN = ${BLACKOUT_IN.toFixed(4)};\n\nvoid main() {\n float p = u_progress;\n\n if (p <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n if (p >= 1.0) {\n outColor = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n\n float collapse = clamp(p / COLLAPSE_END, 0.0, 1.0);\n float pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0.0, 1.0);\n float decayed = clamp((p - PINCH_END) / (1.0 - PINCH_END), 0.0, 1.0);\n\n vec2 scale = vec2(pow(MIN_PINCH, pinch), pow(MIN_SQUASH, collapse));\n vec2 centered = (v_uv - 0.5) / scale + 0.5;\n vec2 span = 1.0 / (scale * u_resolution);\n\n vec3 sum = vec3(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n vec2 at = centered + vec2(\n (fract(fi * GOLDEN + 0.5) - 0.5) * span.x,\n ((fi + 0.5) / float(TAPS) - 0.5) * span.y\n );\n vec2 inside = step(vec2(0.0), at) * step(at, vec2(1.0));\n sum += texture(u_scene, at).rgb * inside.x * inside.y;\n }\n\n float concentrate = pow(1.0 / (scale.x * scale.y), CONCENTRATION);\n vec3 light =\n (sum / float(TAPS)) * (1.0 + (concentrate - 1.0) * max(u_gain, 0.0));\n\n float glow = max(u_afterglow, 0.0);\n float bleed = smoothstep(0.2, 0.8, collapse) * (1.0 - pinch) * glow;\n\n if (bleed > 0.0) {\n vec3 column = vec3(0.0);\n float cx = clamp(centered.x, 0.0, 1.0);\n for (int i = 0; i < COLUMN_TAPS; i++) {\n column +=\n texture(u_scene, vec2(cx, (float(i) + 0.5) / float(COLUMN_TAPS))).rgb;\n }\n column /= float(COLUMN_TAPS);\n\n float dy = v_uv.y - 0.5;\n float reach = 0.02 + 0.03 * collapse;\n light +=\n column *\n mix(vec3(1.0), u_phosphor, 0.65) *\n exp(-(dy * dy) / (reach * reach)) *\n bleed *\n 0.9;\n }\n\n if (pinch > 0.0) {\n vec2 d = (v_uv - 0.5) * vec2(u_aspect, 1.0);\n float radius = max(0.045 * glow, 0.0005);\n light +=\n u_phosphor *\n exp(-dot(d, d) / (radius * radius)) *\n smoothstep(0.0, 0.5, pinch) *\n 1.15;\n }\n\n light *= pow(max(1.0 - decayed, 0.0001), DECAY_CURVE);\n\n float blackout = smoothstep(0.0, BLACKOUT_IN, p);\n outColor = vec4(\n clamp(light, 0.0, 1.0),\n mix(texture(u_scene, v_uv).a, 1.0, blackout)\n );\n}`;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nfunction powerProgress(props: TvPowerOffProps, frame: number): number {\n const {\n durationInFrames = DEFAULTS.durationInFrames,\n delay = DEFAULTS.delay,\n } = props;\n return clamp((frame - delay) / Math.max(1, durationInFrames), 0, 1);\n}\n\nconst shader = makeFilterShader<TvPowerOffProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, frame, passedProps }) => {\n const {\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = passedProps;\n gl.uniform1f(uniform(\"u_progress\"), powerProgress(passedProps, frame));\n gl.uniform2f(uniform(\"u_resolution\"), width, height);\n gl.uniform1f(uniform(\"u_gain\"), gain);\n gl.uniform1f(uniform(\"u_afterglow\"), afterglow);\n gl.uniform3fv(uniform(\"u_phosphor\"), toRgb(phosphor));\n },\n);\n\nconst TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (\n props,\n) => {\n const frame = useCurrentFrame();\n const {\n children,\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = props;\n\n const p = powerProgress(props, frame);\n const collapse = clamp(p / COLLAPSE_END, 0, 1);\n const pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0, 1);\n const decayed = clamp((p - PINCH_END) / (1 - PINCH_END), 0, 1);\n\n const squash = MIN_SQUASH ** collapse;\n const pinchX = MIN_PINCH ** pinch;\n const concentrate = (1 / (squash * pinchX)) ** CONCENTRATION;\n const fade = (1 - decayed) ** DECAY_CURVE;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n background: \"#000000\",\n opacity: clamp(p / BLACKOUT_IN, 0, 1),\n }}\n />\n <AbsoluteFill\n style={{\n transform: `scale(${pinchX}, ${squash})`,\n filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,\n opacity: fade,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: `radial-gradient(circle at 50% 50%, ${phosphor} 0%, transparent 55%)`,\n opacity: clamp(pinch * afterglow, 0, 1) * fade,\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const TvPowerOff = makeCanvasFilter<TvPowerOffProps>({\n shader,\n fallback: TvPowerOffFallback,\n});"
+ "sourceCode": "import { AbsoluteFill, isHtmlInCanvasSupported, useCurrentFrame, useDelayRender, useVideoConfig } from \"remotion\";\nimport React from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\nexport type TvPowerOffProps = {\n durationInFrames?: number;\n delay?: number;\n gain?: number;\n afterglow?: number;\n phosphor?: string;\n};\n\nconst DEFAULTS = {\n durationInFrames: 18,\n delay: 0,\n gain: 1,\n afterglow: 1,\n phosphor: \"#d8ecff\",\n};\n\nconst COLLAPSE_END = 0.6;\nconst PINCH_END = 0.82;\nconst MIN_SQUASH = 0.0055;\nconst MIN_PINCH = 0.004;\nconst CONCENTRATION = 0.3;\nconst DECAY_CURVE = 2.6;\nconst BLACKOUT_IN = 0.06;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec2 u_resolution;\nuniform float u_aspect;\nuniform float u_progress;\nuniform float u_gain;\nuniform float u_afterglow;\nuniform vec3 u_phosphor;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 32;\nconst int COLUMN_TAPS = 8;\nconst float GOLDEN = 0.6180339887;\nconst float COLLAPSE_END = ${COLLAPSE_END.toFixed(4)};\nconst float PINCH_END = ${PINCH_END.toFixed(4)};\nconst float MIN_SQUASH = ${MIN_SQUASH.toFixed(5)};\nconst float MIN_PINCH = ${MIN_PINCH.toFixed(5)};\nconst float CONCENTRATION = ${CONCENTRATION.toFixed(4)};\nconst float DECAY_CURVE = ${DECAY_CURVE.toFixed(4)};\nconst float BLACKOUT_IN = ${BLACKOUT_IN.toFixed(4)};\n\nvoid main() {\n float p = u_progress;\n\n if (p <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n if (p >= 1.0) {\n outColor = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n\n float collapse = clamp(p / COLLAPSE_END, 0.0, 1.0);\n float pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0.0, 1.0);\n float decayed = clamp((p - PINCH_END) / (1.0 - PINCH_END), 0.0, 1.0);\n\n vec2 scale = vec2(pow(MIN_PINCH, pinch), pow(MIN_SQUASH, collapse));\n vec2 centered = (v_uv - 0.5) / scale + 0.5;\n vec2 span = 1.0 / (scale * u_resolution);\n\n vec3 sum = vec3(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n vec2 at = centered + vec2(\n (fract(fi * GOLDEN + 0.5) - 0.5) * span.x,\n ((fi + 0.5) / float(TAPS) - 0.5) * span.y\n );\n vec2 inside = step(vec2(0.0), at) * step(at, vec2(1.0));\n sum += texture(u_scene, at).rgb * inside.x * inside.y;\n }\n\n float concentrate = pow(1.0 / (scale.x * scale.y), CONCENTRATION);\n vec3 light =\n (sum / float(TAPS)) * (1.0 + (concentrate - 1.0) * max(u_gain, 0.0));\n\n float glow = max(u_afterglow, 0.0);\n float bleed = smoothstep(0.2, 0.8, collapse) * (1.0 - pinch) * glow;\n\n if (bleed > 0.0) {\n vec3 column = vec3(0.0);\n float cx = clamp(centered.x, 0.0, 1.0);\n for (int i = 0; i < COLUMN_TAPS; i++) {\n column +=\n texture(u_scene, vec2(cx, (float(i) + 0.5) / float(COLUMN_TAPS))).rgb;\n }\n column /= float(COLUMN_TAPS);\n\n float dy = v_uv.y - 0.5;\n float reach = 0.02 + 0.03 * collapse;\n light +=\n column *\n mix(vec3(1.0), u_phosphor, 0.65) *\n exp(-(dy * dy) / (reach * reach)) *\n bleed *\n 0.9;\n }\n\n if (pinch > 0.0) {\n vec2 d = (v_uv - 0.5) * vec2(u_aspect, 1.0);\n float radius = max(0.045 * glow, 0.0005);\n light +=\n u_phosphor *\n exp(-dot(d, d) / (radius * radius)) *\n smoothstep(0.0, 0.5, pinch) *\n 1.15;\n }\n\n light *= pow(max(1.0 - decayed, 0.0001), DECAY_CURVE);\n\n float blackout = smoothstep(0.0, BLACKOUT_IN, p);\n outColor = vec4(\n clamp(light, 0.0, 1.0),\n mix(texture(u_scene, v_uv).a, 1.0, blackout)\n );\n}`;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nfunction powerProgress(props: TvPowerOffProps, frame: number): number {\n const {\n durationInFrames = DEFAULTS.durationInFrames,\n delay = DEFAULTS.delay,\n } = props;\n return clamp((frame - delay) / Math.max(1, durationInFrames), 0, 1);\n}\n\nconst shader = makeFilterShader<TvPowerOffProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, frame, passedProps }) => {\n const {\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = passedProps;\n gl.uniform1f(uniform(\"u_progress\"), powerProgress(passedProps, frame));\n gl.uniform2f(uniform(\"u_resolution\"), width, height);\n gl.uniform1f(uniform(\"u_gain\"), gain);\n gl.uniform1f(uniform(\"u_afterglow\"), afterglow);\n gl.uniform3fv(uniform(\"u_phosphor\"), toRgb(phosphor));\n },\n);\n\nconst TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (\n props,\n) => {\n const frame = useCurrentFrame();\n const {\n children,\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = props;\n\n const p = powerProgress(props, frame);\n const collapse = clamp(p / COLLAPSE_END, 0, 1);\n const pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0, 1);\n const decayed = clamp((p - PINCH_END) / (1 - PINCH_END), 0, 1);\n\n const squash = MIN_SQUASH ** collapse;\n const pinchX = MIN_PINCH ** pinch;\n const concentrate = (1 / (squash * pinchX)) ** CONCENTRATION;\n const fade = (1 - decayed) ** DECAY_CURVE;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n background: \"#000000\",\n opacity: clamp(p / BLACKOUT_IN, 0, 1),\n }}\n />\n <AbsoluteFill\n style={{\n scale: `${pinchX} ${squash}`,\n filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,\n opacity: fade,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: `radial-gradient(circle at 50% 50%, ${phosphor} 0%, transparent 55%)`,\n opacity: clamp(pinch * afterglow, 0, 1) * fade,\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const TvPowerOff = makeCanvasFilter<TvPowerOffProps>({\n shader,\n fallback: TvPowerOffFallback,\n});"
},
"durationInFrames": 18
}
diff --git a/registry-artifacts/elements/value-swap.json b/registry-artifacts/elements/value-swap.json
index 55464800..04c7a1dd 100644
--- a/registry-artifacts/elements/value-swap.json
+++ b/registry-artifacts/elements/value-swap.json
@@ -3,12 +3,15 @@
"version": 1,
"element": {
"dependencies": [],
- "dimensions": null,
+ "dimensions": {
+ "width": 220,
+ "height": 70
+ },
"displayName": "Value Swap",
"durationInFrames": 100,
"installationMode": "component-owned-sequence",
"slug": "value-swap",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ninterface ValueSwapProps {\n values: string[];\n at: number | number[];\n duration?: number;\n distance?: number;\n direction?: \"up\" | \"down\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction ValueSwapBase({\n values,\n at,\n duration = 10,\n distance = 12,\n direction = \"up\",\n className,\n style,\n}: ValueSwapProps) {\n const frame = useCurrentFrame();\n const ats = Array.isArray(at) ? at : [at];\n const d = direction === \"down\" ? -distance : distance;\n const count = Math.min(values.length, ats.length + 1);\n const rendered = values.slice(0, count);\n const sizer = rendered.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n const swapP = (start: number) =>\n interpolate(frame, [start, start + duration], [0, 1], {\n ...clampOpts,\n easing: Easing.inOut(Easing.cubic),\n });\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {rendered.map((value, i) => {\n const pIn = i > 0 ? swapP(ats[i - 1]) : 1;\n const pOut = i < count - 1 ? swapP(ats[i]) : 0;\n const opacity = pIn * (1 - pOut);\n if (opacity <= 0.001) return null;\n const y = (1 - pIn) * d + pOut * -d;\n return (\n <span\n key={`${i}-${value}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {value}\n </span>\n );\n })}\n </span>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n duration: {\n type: \"number\",\n min: 4,\n max: 24,\n step: 1,\n default: 10,\n description: \"Duration\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 4,\n max: 32,\n step: 2,\n default: 12,\n description: \"Distance\",\n hiddenFromList: false,\n },\n direction: {\n type: \"enum\",\n default: \"up\",\n variants: {\n up: {},\n down: {},\n },\n description: \"Direction\",\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([\"duration\",\"distance\",\"direction\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n duration: 10,\n distance: 12,\n direction: \"up\",\n speed: 1,\n};\n\ntype ValueSwapElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ValueSwapBase>;\n\nconst ValueSwapInner = forwardRef<\n HTMLDivElement,\n ValueSwapElementProps & { 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 ?? \"<ValueSwap>\"}\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 <ValueSwapBase\n {...(componentProps as unknown as ComponentProps<typeof ValueSwapBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ValueSwap = Interactive.withSchema({\n Component: ValueSwapInner,\n componentName: \"<ValueSwap>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ninterface ValueSwapProps {\n values: string[];\n at: number | number[];\n duration?: number;\n distance?: number;\n direction?: \"up\" | \"down\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nfunction ValueSwapBase({\n values,\n at,\n duration = 10,\n distance = 12,\n direction = \"up\",\n className,\n style,\n}: ValueSwapProps) {\n const frame = useCurrentFrame();\n const ats = Array.isArray(at) ? at : [at];\n const d = direction === \"down\" ? -distance : distance;\n const count = Math.min(values.length, ats.length + 1);\n const rendered = values.slice(0, count);\n const sizer = rendered.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n const swapP = (start: number) =>\n interpolate(frame, [start, start + duration], [0, 1], {\n ...clampOpts,\n easing: Easing.inOut(Easing.cubic),\n });\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {rendered.map((value, i) => {\n const pIn = i > 0 ? swapP(ats[i - 1]) : 1;\n const pOut = i < count - 1 ? swapP(ats[i]) : 0;\n const opacity = pIn * (1 - pOut);\n if (opacity <= 0.001) return null;\n const y = (1 - pIn) * d + pOut * -d;\n return (\n <span\n key={`${i}-${value}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {value}\n </span>\n );\n })}\n </span>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n duration: {\n type: \"number\",\n min: 4,\n max: 24,\n step: 1,\n default: 10,\n description: \"Duration\",\n hiddenFromList: false,\n },\n distance: {\n type: \"number\",\n min: 4,\n max: 32,\n step: 2,\n default: 12,\n description: \"Distance\",\n hiddenFromList: false,\n },\n direction: {\n type: \"enum\",\n default: \"up\",\n variants: {\n up: {},\n down: {},\n },\n description: \"Direction\",\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 width: {\n type: \"number\",\n default: 220,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 70,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"duration\",\"distance\",\"direction\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n duration: 10,\n distance: 12,\n direction: \"up\",\n speed: 1,\n};\n\ntype ValueSwapElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof ValueSwapBase>;\n\nconst ValueSwapInner = forwardRef<\n HTMLDivElement,\n ValueSwapElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 220, height = 70, ...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 ?? \"<ValueSwap>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <ValueSwapBase\n {...(componentProps as unknown as ComponentProps<typeof ValueSwapBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const ValueSwap = Interactive.withSchema({\n Component: ValueSwapInner,\n componentName: \"<ValueSwap>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 100
}
diff --git a/registry-artifacts/elements/vhs-filter.json b/registry-artifacts/elements/vhs-filter.json
index 725242f6..fe7e53b9 100644
--- a/registry-artifacts/elements/vhs-filter.json
+++ b/registry-artifacts/elements/vhs-filter.json
@@ -13,7 +13,7 @@
"durationInFrames": 90,
"installationMode": "component-owned-sequence",
"slug": "vhs-filter",
- "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype VhsFilterProps = {\n bleed?: number;\n wobble?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_time;\nuniform float u_bleed;\nuniform float u_wobble;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float LINES = 486.0;\nconst int TAPS = 6;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat valueNoise(float x) {\n float i = floor(x);\n float f = fract(x);\n float a = hash(vec2(i, 7.0));\n float b = hash(vec2(i + 1.0, 7.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec3 rgb2yiq(vec3 c) {\n return vec3(\n dot(c, vec3(0.299, 0.587, 0.114)),\n dot(c, vec3(0.5959, -0.2746, -0.3213)),\n dot(c, vec3(0.2115, -0.5227, 0.3112))\n );\n}\n\nvec3 yiq2rgb(vec3 c) {\n return vec3(\n c.x + 0.956 * c.y + 0.619 * c.z,\n c.x - 0.272 * c.y - 0.647 * c.z,\n c.x - 1.106 * c.y + 1.703 * c.z\n );\n}\n\nvoid main() {\n float line = floor(v_uv.y * LINES);\n float clock = mod(u_frame, 64.0);\n\n float drift =\n sin(v_uv.y * 37.0 + u_time * 2.3) * 0.55 +\n sin(v_uv.y * 96.0 - u_time * 1.1) * 0.25;\n float jitter = valueNoise(line * 0.61 + u_time * 24.0) - 0.5;\n float wobble = (drift * 0.35 + jitter * 0.9) * 0.007 * u_wobble * u_intensity;\n\n float band = smoothstep(0.955, 0.994, v_uv.y);\n float tear = valueNoise(line * 2.7 + u_time * 43.0) - 0.5;\n float headSwitch = band * tear * 0.085 * u_intensity;\n\n vec2 uv = vec2(v_uv.x + wobble + headSwitch, v_uv.y);\n vec4 base = texture(u_scene, uv);\n float luma = rgb2yiq(base.rgb).x;\n\n float smear = u_bleed * 0.02 * u_intensity;\n vec2 chroma = vec2(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1);\n float weight = 1.0 - t * 0.72;\n vec3 tap = texture(u_scene, vec2(uv.x - smear * t, uv.y)).rgb;\n chroma += rgb2yiq(tap).yz * weight;\n total += weight;\n }\n\n vec3 color = yiq2rgb(vec3(luma, chroma / total));\n\n float scan = 0.94 + 0.06 * cos(v_uv.y * LINES * PI);\n color *= mix(1.0, scan, u_intensity);\n\n float grain =\n hash(vec2(v_uv.x * 640.0 + clock * 13.0, line + clock * 5.0)) - 0.5;\n color += grain * 0.07 * u_noise * u_intensity;\n\n color = mix(color, vec3(luma), band * 0.55 * u_intensity);\n color += band * (hash(vec2(line, clock * 3.0)) - 0.5) * 0.26 * u_intensity;\n\n outColor = vec4(clamp(color, 0.0, 1.0), base.a);\n}`;\n\nconst shader = makeFilterShader<VhsFilterProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform1f(uniform(\"u_bleed\"), bleed);\n gl.uniform1f(uniform(\"u_wobble\"), wobble);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({\n children,\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n}) => {\n const frame = useCurrentFrame();\n const shift =\n (random(`vhs-wobble-${frame}`) - 0.5) * 3.4 * wobble * intensity;\n const flicker =\n 1 + (random(`vhs-flicker-${frame}`) - 0.5) * 0.07 * noise * intensity;\n const smear = 3 + bleed * 5;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift}px)`,\n filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift - smear}px)`,\n filter: \"saturate(2.2) blur(1.4px)\",\n mixBlendMode: \"screen\",\n opacity: 0.24 * bleed * intensity,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px)\",\n opacity: intensity,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n insetInline: 0,\n bottom: 0,\n height: \"3.6%\",\n transform: `translateX(${shift * 3}px)`,\n background: `rgba(228, 228, 228, ${0.13 * intensity})`,\n mixBlendMode: \"screen\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nconst VhsFilterBase = makeCanvasFilter<VhsFilterProps>({\n shader,\n fallback: VhsFilterFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n bleed: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Chroma bleed\",\n hiddenFromList: false,\n },\n wobble: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Tape wobble\",\n hiddenFromList: false,\n },\n noise: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Noise\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\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([\"bleed\",\"wobble\",\"noise\",\"intensity\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n speed: 1,\n};\n\ntype VhsFilterElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VhsFilterBase>;\n\nconst VhsFilterInner = forwardRef<\n HTMLDivElement,\n VhsFilterElementProps & { 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 ?? \"<VhsFilter>\"}\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 <VhsFilterBase\n {...(componentProps as unknown as ComponentProps<typeof VhsFilterBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VhsFilter = Interactive.withSchema({\n Component: VhsFilterInner,\n componentName: \"<VhsFilter>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, isHtmlInCanvasSupported, random, useCurrentFrame, useDelayRender, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { type TransitionPresentation, type TransitionPresentationComponentProps } from \"@remotion/transitions\";\n\nconst QUAD = new Float32Array([-1, -1, 1, -1, -1, 1, 1, 1]);\n\nconst VERTEX_SHADER = `#version 300 es\nin vec2 a_pos;\nout vec2 v_uv;\nvoid main() {\n v_uv = vec2(a_pos.x * 0.5 + 0.5, 0.5 - a_pos.y * 0.5);\n gl_Position = vec4(a_pos, 0.0, 1.0);\n}`;\n\nconst LAYER: React.CSSProperties = {\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n};\n\nconst OUTPUT_LAYER: React.CSSProperties = { ...LAYER, pointerEvents: \"none\" };\n\nconst isCanvasTransitionSupported = (): boolean =>\n isHtmlInCanvasSupported();\n\nconst isCanvasFilterSupported = (): boolean => isHtmlInCanvasSupported();\n\ntype SceneShaderFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderDrawParams<Props> = {\n from: OffscreenCanvas | null;\n to: OffscreenCanvas | null;\n width: number;\n height: number;\n progress: number;\n passedProps: Props;\n};\n\ntype SceneShaderInstance<Props> = {\n draw: (params: SceneShaderDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneShader<Props> = (\n canvas: OffscreenCanvas,\n) => SceneShaderInstance<Props>;\n\ntype SceneFilterFrame<Props> = {\n gl: WebGL2RenderingContext;\n uniform: (name: string) => WebGLUniformLocation | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterDrawParams<Props> = {\n scene: OffscreenCanvas | null;\n width: number;\n height: number;\n frame: number;\n time: number;\n passedProps: Props;\n};\n\ntype SceneFilterInstance<Props> = {\n draw: (params: SceneFilterDrawParams<Props>) => void;\n clear: () => void;\n cleanup: () => void;\n};\n\ntype SceneFilter<Props> = (\n canvas: OffscreenCanvas,\n) => SceneFilterInstance<Props>;\n\nfunction compileShader(\n gl: WebGL2RenderingContext,\n source: string,\n type: GLenum,\n): WebGLShader {\n const shader = gl.createShader(type);\n if (!shader) {\n throw new Error(\"canvas-presentation: failed to create shader\");\n }\n gl.shaderSource(shader, source);\n gl.compileShader(shader);\n if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n const log = gl.getShaderInfoLog(shader);\n gl.deleteShader(shader);\n throw new Error(`canvas-presentation: failed to compile shader: ${log}`);\n }\n return shader;\n}\n\nfunction createProgram(\n gl: WebGL2RenderingContext,\n fragment: string,\n): WebGLProgram {\n const program = gl.createProgram();\n if (!program) {\n throw new Error(\"canvas-presentation: failed to create program\");\n }\n const vs = compileShader(gl, VERTEX_SHADER, gl.VERTEX_SHADER);\n const fs = compileShader(gl, fragment, gl.FRAGMENT_SHADER);\n gl.attachShader(program, vs);\n gl.attachShader(program, fs);\n gl.linkProgram(program);\n gl.deleteShader(vs);\n gl.deleteShader(fs);\n if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {\n const log = gl.getProgramInfoLog(program);\n gl.deleteProgram(program);\n throw new Error(`canvas-presentation: failed to link program: ${log}`);\n }\n return program;\n}\n\nfunction createSceneTexture(gl: WebGL2RenderingContext): WebGLTexture {\n const texture = gl.createTexture();\n if (!texture) {\n throw new Error(\"canvas-presentation: failed to create texture\");\n }\n gl.bindTexture(gl.TEXTURE_2D, texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n 1,\n 1,\n 0,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n new Uint8Array([0, 0, 0, 0]),\n );\n return texture;\n}\n\nfunction createQuadSurface(canvas: OffscreenCanvas, fragment: string) {\n const gl = canvas.getContext(\"webgl2\", { premultipliedAlpha: true });\n if (!gl) {\n throw new Error(\"canvas-presentation: WebGL2 is unavailable\");\n }\n\n const program = createProgram(gl, fragment);\n const vao = gl.createVertexArray();\n gl.bindVertexArray(vao);\n const buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, buffer);\n gl.bufferData(gl.ARRAY_BUFFER, QUAD, gl.STATIC_DRAW);\n const aPos = gl.getAttribLocation(program, \"a_pos\");\n gl.enableVertexAttribArray(aPos);\n gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0);\n\n const locations = new Map<string, WebGLUniformLocation | null>();\n const uniform = (name: string) => {\n const cached = locations.get(name);\n if (cached !== undefined) {\n return cached;\n }\n const location = gl.getUniformLocation(program, name);\n locations.set(name, location);\n return location;\n };\n\n const clear = () => {\n gl.clearColor(0, 0, 0, 0);\n gl.clear(gl.COLOR_BUFFER_BIT);\n };\n\n const textures: WebGLTexture[] = [];\n const createTexture = () => {\n const texture = createSceneTexture(gl);\n textures.push(texture);\n return texture;\n };\n\n const begin = (width: number, height: number) => {\n gl.viewport(0, 0, width, height);\n clear();\n gl.useProgram(program);\n gl.bindVertexArray(vao);\n };\n\n const bindScene = (\n image: OffscreenCanvas | null,\n texture: WebGLTexture,\n unit: number,\n name: string,\n ) => {\n gl.activeTexture(gl.TEXTURE0 + unit);\n gl.bindTexture(gl.TEXTURE_2D, texture);\n if (image) {\n gl.texImage2D(\n gl.TEXTURE_2D,\n 0,\n gl.RGBA,\n gl.RGBA,\n gl.UNSIGNED_BYTE,\n image,\n );\n }\n gl.uniform1i(uniform(name), unit);\n };\n\n const draw = () => gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n\n const cleanup = () => {\n gl.deleteProgram(program);\n for (const texture of textures) {\n gl.deleteTexture(texture);\n }\n gl.deleteBuffer(buffer);\n gl.deleteVertexArray(vao);\n };\n\n return {\n gl,\n uniform,\n clear,\n createTexture,\n begin,\n bindScene,\n draw,\n cleanup,\n };\n}\n\nfunction makeSceneShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneShaderFrame<Props>) => void,\n): SceneShader<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const fromTexture = surface.createTexture();\n const toTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ from, to, width, height, progress, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(from, fromTexture, 0, \"u_from\");\n surface.bindScene(to, toTexture, 1, \"u_to\");\n\n surface.gl.uniform1f(surface.uniform(\"u_progress\"), progress);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n progress,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nfunction makeFilterShader<Props extends Record<string, unknown>>(\n fragment: string,\n setUniforms?: (frame: SceneFilterFrame<Props>) => void,\n): SceneFilter<Props> {\n return (canvas) => {\n const surface = createQuadSurface(canvas, fragment);\n const sceneTexture = surface.createTexture();\n\n return {\n clear: surface.clear,\n cleanup: surface.cleanup,\n draw: ({ scene, width, height, frame, time, passedProps }) => {\n surface.begin(width, height);\n surface.bindScene(scene, sceneTexture, 0, \"u_scene\");\n\n surface.gl.uniform1f(surface.uniform(\"u_frame\"), frame);\n surface.gl.uniform1f(surface.uniform(\"u_time\"), time);\n surface.gl.uniform1f(surface.uniform(\"u_aspect\"), width / height);\n setUniforms?.({\n gl: surface.gl,\n uniform: surface.uniform,\n width,\n height,\n frame,\n time,\n passedProps,\n });\n\n surface.draw();\n },\n };\n };\n}\n\nconst transferred = new WeakMap<HTMLCanvasElement, OffscreenCanvas>();\n\nfunction takeOffscreen(canvas: HTMLCanvasElement): OffscreenCanvas {\n const existing = transferred.get(canvas);\n if (existing) {\n return existing;\n }\n const created = canvas.transferControlToOffscreen();\n transferred.set(canvas, created);\n return created;\n}\n\nfunction makeCanvasComponent<Props extends Record<string, unknown>>(\n shader: SceneShader<Props>,\n): React.FC<TransitionPresentationComponentProps<Props>> {\n return function CanvasScenePresentation({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n onElementImage,\n onUnmount,\n bothEnteringAndExiting,\n }) {\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneShaderInstance<Props> | null>(null);\n const passedPropsRef = React.useRef(passedProps);\n passedPropsRef.current = passedProps;\n const onElementImageRef = React.useRef(onElementImage);\n onElementImageRef.current = onElementImage;\n const onUnmountRef = React.useRef(onUnmount);\n onUnmountRef.current = onUnmount;\n\n const { delayRender, continueRender } = useDelayRender();\n const passThrough =\n bothEnteringAndExiting && presentationDirection === \"exiting\";\n\n const drawRef = React.useRef<\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => void\n >(() => undefined);\n drawRef.current = (prevImage, nextImage, progress) => {\n const instance = instanceRef.current;\n if (!instance) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: paint\");\n const to = prevImage;\n const from = nextImage;\n const width = from?.width ?? to?.width ?? 0;\n const height = from?.height ?? to?.height ?? 0;\n if (width === 0 || height === 0) {\n instance.clear();\n continueRender(handle);\n return;\n }\n instance.draw({\n from,\n to,\n width,\n height,\n progress: !to ? 0 : !from ? 1 : progress,\n passedProps: passedPropsRef.current,\n });\n continueRender(handle);\n };\n\n const draw = React.useCallback(\n (\n prevImage: OffscreenCanvas | null,\n nextImage: OffscreenCanvas | null,\n progress: number,\n ) => drawRef.current(prevImage, nextImage, progress),\n [],\n );\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [passThrough, shader]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n if (!scene || !capture || !context) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n onElementImageRef.current(capture, draw);\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, [passThrough, draw]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, [passThrough]);\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: presentationProgress is the intentional trigger — a new progress value is what schedules the next paint\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n layoutRef.current?.requestPaint?.();\n }, [passThrough, presentationProgress]);\n\n React.useLayoutEffect(() => {\n if (passThrough) {\n return;\n }\n return () => onUnmountRef.current();\n }, [passThrough]);\n\n if (passThrough) {\n return <>{children}</>;\n }\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasFilterProps = {\n children: React.ReactNode;\n};\n\nfunction makeFilterComponent<Props extends Record<string, unknown>>(\n shader: SceneFilter<Props>,\n): React.FC<Props & CanvasFilterProps> {\n return function CanvasSceneFilter(props) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const { delayRender, continueRender } = useDelayRender();\n\n const layoutRef = React.useRef<HTMLCanvasElement | null>(null);\n const outputRef = React.useRef<HTMLCanvasElement | null>(null);\n const captureRef = React.useRef<OffscreenCanvas | null>(null);\n const captureContextRef =\n React.useRef<OffscreenCanvasRenderingContext2D | null>(null);\n const outputSurfaceRef = React.useRef<OffscreenCanvas | null>(null);\n const instanceRef = React.useRef<SceneFilterInstance<Props> | null>(null);\n\n const passedPropsRef = React.useRef(props);\n passedPropsRef.current = props;\n const frameRef = React.useRef(frame);\n frameRef.current = frame;\n const timeRef = React.useRef(frame / fps);\n timeRef.current = frame / fps;\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n const output = outputRef.current;\n if (!layout || !output) {\n return;\n }\n const capture = takeOffscreen(layout);\n const context = capture.getContext(\"2d\");\n if (!context) {\n throw new Error(\"canvas-presentation: failed to acquire a 2D context\");\n }\n const surface = takeOffscreen(output);\n captureRef.current = capture;\n captureContextRef.current = context;\n outputSurfaceRef.current = surface;\n instanceRef.current = shader(surface);\n\n return () => {\n instanceRef.current?.cleanup();\n instanceRef.current = null;\n captureRef.current = null;\n captureContextRef.current = null;\n outputSurfaceRef.current = null;\n };\n }, [shader]);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n layout.layoutSubtree = true;\n const handlePaint = () => {\n const scene = layout.firstElementChild;\n const capture = captureRef.current;\n const context = captureContextRef.current;\n const instance = instanceRef.current;\n if (!scene || !capture || !context || !instance) {\n return;\n }\n const elementImage = layout.captureElementImage(scene);\n try {\n context.reset();\n context.drawElementImage(elementImage, 0, 0);\n } finally {\n elementImage.close();\n }\n if (capture.width === 0 || capture.height === 0) {\n instance.clear();\n return;\n }\n instance.draw({\n scene: capture,\n width: capture.width,\n height: capture.height,\n frame: frameRef.current,\n time: timeRef.current,\n passedProps: passedPropsRef.current,\n });\n };\n layout.addEventListener(\"paint\", handlePaint);\n return () => layout.removeEventListener(\"paint\", handlePaint);\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const observer = new ResizeObserver(([entry]) => {\n const capture = captureRef.current;\n const surface = outputSurfaceRef.current;\n if (!capture || !surface) {\n return;\n }\n const width = entry.devicePixelContentBoxSize[0].inlineSize;\n const height = entry.devicePixelContentBoxSize[0].blockSize;\n capture.width = width;\n capture.height = height;\n surface.width = width;\n surface.height = height;\n layout.requestPaint?.();\n });\n observer.observe(layout, { box: \"device-pixel-content-box\" });\n return () => observer.disconnect();\n }, []);\n\n React.useLayoutEffect(() => {\n const layout = layoutRef.current;\n if (!layout) {\n return;\n }\n const handle = delayRender(\"canvas-presentation: filter paint\");\n const settle = () => continueRender(handle);\n layout.addEventListener(\"paint\", settle, { once: true });\n layout.requestPaint?.();\n return () => {\n layout.removeEventListener(\"paint\", settle);\n continueRender(handle);\n };\n });\n\n return (\n <AbsoluteFill>\n <canvas ref={layoutRef} style={LAYER}>\n {props.children}\n </canvas>\n <canvas ref={outputRef} style={OUTPUT_LAYER} />\n </AbsoluteFill>\n );\n };\n}\n\ntype CanvasPresentationOptions<Props extends Record<string, unknown>> = {\n shader: SceneShader<Props>;\n fallback: React.FC<TransitionPresentationComponentProps<Props>>;\n};\n\nfunction makeCanvasPresentation<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasPresentationOptions<Props>): (\n props: Props,\n) => TransitionPresentation<Props> {\n const Canvas = makeCanvasComponent(shader);\n\n const Presentation: React.FC<TransitionPresentationComponentProps<Props>> = (\n props,\n ) =>\n isCanvasTransitionSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n\n return (props) => ({ component: Presentation, props });\n}\n\ntype CanvasFilterOptions<Props extends Record<string, unknown>> = {\n shader: SceneFilter<Props>;\n fallback: React.FC<Props & CanvasFilterProps>;\n};\n\nfunction makeCanvasFilter<Props extends Record<string, unknown>>({\n shader,\n fallback: Fallback,\n}: CanvasFilterOptions<Props>): React.FC<Props & CanvasFilterProps> {\n const Canvas = makeFilterComponent(shader);\n\n return function CanvasFilter(props) {\n return isCanvasFilterSupported() ? (\n <Canvas {...props} />\n ) : (\n <Fallback {...props} />\n );\n };\n}\n\ntype VhsFilterProps = {\n bleed?: number;\n wobble?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_time;\nuniform float u_bleed;\nuniform float u_wobble;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float LINES = 486.0;\nconst int TAPS = 6;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat valueNoise(float x) {\n float i = floor(x);\n float f = fract(x);\n float a = hash(vec2(i, 7.0));\n float b = hash(vec2(i + 1.0, 7.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec3 rgb2yiq(vec3 c) {\n return vec3(\n dot(c, vec3(0.299, 0.587, 0.114)),\n dot(c, vec3(0.5959, -0.2746, -0.3213)),\n dot(c, vec3(0.2115, -0.5227, 0.3112))\n );\n}\n\nvec3 yiq2rgb(vec3 c) {\n return vec3(\n c.x + 0.956 * c.y + 0.619 * c.z,\n c.x - 0.272 * c.y - 0.647 * c.z,\n c.x - 1.106 * c.y + 1.703 * c.z\n );\n}\n\nvoid main() {\n float line = floor(v_uv.y * LINES);\n float clock = mod(u_frame, 64.0);\n\n float drift =\n sin(v_uv.y * 37.0 + u_time * 2.3) * 0.55 +\n sin(v_uv.y * 96.0 - u_time * 1.1) * 0.25;\n float jitter = valueNoise(line * 0.61 + u_time * 24.0) - 0.5;\n float wobble = (drift * 0.35 + jitter * 0.9) * 0.007 * u_wobble * u_intensity;\n\n float band = smoothstep(0.955, 0.994, v_uv.y);\n float tear = valueNoise(line * 2.7 + u_time * 43.0) - 0.5;\n float headSwitch = band * tear * 0.085 * u_intensity;\n\n vec2 uv = vec2(v_uv.x + wobble + headSwitch, v_uv.y);\n vec4 base = texture(u_scene, uv);\n float luma = rgb2yiq(base.rgb).x;\n\n float smear = u_bleed * 0.02 * u_intensity;\n vec2 chroma = vec2(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1);\n float weight = 1.0 - t * 0.72;\n vec3 tap = texture(u_scene, vec2(uv.x - smear * t, uv.y)).rgb;\n chroma += rgb2yiq(tap).yz * weight;\n total += weight;\n }\n\n vec3 color = yiq2rgb(vec3(luma, chroma / total));\n\n float scan = 0.94 + 0.06 * cos(v_uv.y * LINES * PI);\n color *= mix(1.0, scan, u_intensity);\n\n float grain =\n hash(vec2(v_uv.x * 640.0 + clock * 13.0, line + clock * 5.0)) - 0.5;\n color += grain * 0.07 * u_noise * u_intensity;\n\n color = mix(color, vec3(luma), band * 0.55 * u_intensity);\n color += band * (hash(vec2(line, clock * 3.0)) - 0.5) * 0.26 * u_intensity;\n\n outColor = vec4(clamp(color, 0.0, 1.0), base.a);\n}`;\n\nconst shader = makeFilterShader<VhsFilterProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform1f(uniform(\"u_bleed\"), bleed);\n gl.uniform1f(uniform(\"u_wobble\"), wobble);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({\n children,\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n}) => {\n const frame = useCurrentFrame();\n const shift =\n (random(`vhs-wobble-${frame}`) - 0.5) * 3.4 * wobble * intensity;\n const flicker =\n 1 + (random(`vhs-flicker-${frame}`) - 0.5) * 0.07 * noise * intensity;\n const smear = 3 + bleed * 5;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n translate: `${shift}px`,\n filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n translate: `${shift - smear}px`,\n filter: \"saturate(2.2) blur(1.4px)\",\n mixBlendMode: \"screen\",\n opacity: 0.24 * bleed * intensity,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px)\",\n opacity: intensity,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n insetInline: 0,\n bottom: 0,\n height: \"3.6%\",\n translate: `${shift * 3}px`,\n background: `rgba(228, 228, 228, ${0.13 * intensity})`,\n mixBlendMode: \"screen\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nconst VhsFilterBase = makeCanvasFilter<VhsFilterProps>({\n shader,\n fallback: VhsFilterFallback,\n});\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n bleed: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Chroma bleed\",\n hiddenFromList: false,\n },\n wobble: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Tape wobble\",\n hiddenFromList: false,\n },\n noise: {\n type: \"number\",\n min: 0,\n max: 3,\n step: 0.1,\n default: 1,\n description: \"Noise\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n min: 0,\n max: 1,\n step: 0.05,\n default: 1,\n description: \"Intensity\",\n hiddenFromList: false,\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([\"bleed\",\"wobble\",\"noise\",\"intensity\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n speed: 1,\n};\n\ntype VhsFilterElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof VhsFilterBase>;\n\nconst VhsFilterInner = forwardRef<\n HTMLDivElement,\n VhsFilterElementProps & { 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 ?? \"<VhsFilter>\"}\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 <VhsFilterBase\n {...(componentProps as unknown as ComponentProps<typeof VhsFilterBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const VhsFilter = Interactive.withSchema({\n Component: VhsFilterInner,\n componentName: \"<VhsFilter>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 90
}
diff --git a/registry-artifacts/fade-through.json b/registry-artifacts/fade-through.json
index 25e49259..733a3cdc 100644
--- a/registry-artifacts/fade-through.json
+++ b/registry-artifacts/fade-through.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/fade-through/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface FadeThroughProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function FadeThrough({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FadeThroughProps) {\n const frame = useCurrentFrame() * speed;\n\n const exitDur = 8;\n const enterDur = 13;\n const overlapF = 1;\n const microDelayF = 2;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toY = interpolate(local, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `translateY(${fromY}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `translateY(${toY}px) scale(${toScale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface FadeThroughProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function FadeThrough({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FadeThroughProps) {\n const frame = useCurrentFrame() * speed;\n\n const exitDur = 8;\n const enterDur = 13;\n const overlapF = 1;\n const microDelayF = 2;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromY = interpolate(frame, [0, exitDur], [0, -4], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toY = interpolate(local, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.99, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const blurVal = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n translate: `0 ${fromY}px`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n translate: `0 ${toY}px`,\n scale: `${toScale}`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/fade-through.tsx"
}
diff --git a/registry-artifacts/focus-blur-resolve.json b/registry-artifacts/focus-blur-resolve.json
index e6f08724..f1502ab2 100644
--- a/registry-artifacts/focus-blur-resolve.json
+++ b/registry-artifacts/focus-blur-resolve.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/focus-blur-resolve/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface FocusBlurResolveProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function FocusBlurResolve({\n text,\n blur = 14,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FocusBlurResolveProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDur = 23;\n const exitDur = 16;\n const exitStart = Math.max(enterDur, durationInFrames - exitDur);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDur], [14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(frame, [0, enterDur], [blur, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(frame, [exitStart, durationInFrames], [0, 10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blurVal = blurEnter + blurExit;\n\n const scale = interpolate(frame, [0, enterDur], [1.01, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface FocusBlurResolveProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function FocusBlurResolve({\n text,\n blur = 14,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: FocusBlurResolveProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDur = 23;\n const exitDur = 16;\n const exitStart = Math.max(enterDur, durationInFrames - exitDur);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDur], [14, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(frame, [0, enterDur], [blur, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(frame, [exitStart, durationInFrames], [0, 10], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blurVal = blurEnter + blurExit;\n\n const scale = interpolate(frame, [0, enterDur], [1.01, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n translate: `0 ${y}px`,\n scale: `${scale}`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/focus-blur-resolve.tsx"
}
diff --git a/registry-artifacts/focus-pull.json b/registry-artifacts/focus-pull.json
index edce11bf..b028d500 100644
--- a/registry-artifacts/focus-pull.json
+++ b/registry-artifacts/focus-pull.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/focus-pull/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type FocusPullProps = {\n blur?: number;\n};\n\nconst FocusPullPresentation: React.FC<\n TransitionPresentationComponentProps<FocusPullProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { blur = 16 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.42, 0.68], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0, 0.6], [1, 1.05], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n })})`,\n filter: `blur(${interpolate(p, [0.05, 0.55], [0, blur], {\n ...clampOpts,\n easing: Easing.in(Easing.quad),\n })}px) brightness(${interpolate(p, [0.1, 0.55], [1, 1.3], clampOpts)})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.32, 0.52], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.35, 1], [0.97, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.35, 0.9], [blur, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.quad),\n })}px) brightness(${interpolate(p, [0.4, 0.85], [1.25, 1], clampOpts)})`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function focusPull(\n props: FocusPullProps = {},\n): TransitionPresentation<FocusPullProps> {\n return {\n component: FocusPullPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type FocusPullProps = {\n blur?: number;\n};\n\nconst FocusPullPresentation: React.FC<\n TransitionPresentationComponentProps<FocusPullProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { blur = 16 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.42, 0.68], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n scale: `${interpolate(p, [0, 0.6], [1, 1.05], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n })}`,\n filter: `blur(${interpolate(p, [0.05, 0.55], [0, blur], {\n ...clampOpts,\n easing: Easing.in(Easing.quad),\n })}px) brightness(${interpolate(p, [0.1, 0.55], [1, 1.3], clampOpts)})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.32, 0.52], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.35, 1], [0.97, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.35, 0.9], [blur, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.quad),\n })}px) brightness(${interpolate(p, [0.4, 0.85], [1.25, 1], clampOpts)})`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function focusPull(\n props: FocusPullProps = {},\n): TransitionPresentation<FocusPullProps> {\n return {\n component: FocusPullPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/focus-pull.tsx"
}
diff --git a/registry-artifacts/github-sponsors.json b/registry-artifacts/github-sponsors.json
index c0a04288..6fae0784 100644
--- a/registry-artifacts/github-sponsors.json
+++ b/registry-artifacts/github-sponsors.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/github-sponsors/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { memo, useMemo, useState } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { BlurOutUp } from \"@/components/remocn/blur-out-up\";\nimport { SoftBlurIn } from \"@/components/remocn/soft-blur-in\";\n\nexport interface Sponsor {\n login: string;\n avatarUrl: string;\n}\n\nexport interface GitHubSponsorsProps {\n account?: string;\n sponsors?: Sponsor[];\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n}\n\nexport const SAMPLE_SPONSORS: Sponsor[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n },\n {\n login: \"schacon\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/70?v=4\",\n },\n {\n login: \"rtomayko\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/5?v=4\",\n },\n {\n login: \"bmizerany\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/6?v=4\",\n },\n {\n login: \"atmos\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/38?v=4\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n },\n {\n login: \"macournoyer\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/15?v=4\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n },\n {\n login: \"uggedal\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/16?v=4\",\n },\n {\n login: \"anotherjesse\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/9?v=4\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n },\n {\n login: \"takeo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/22?v=4\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n },\n {\n login: \"kballard\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/7?v=4\",\n },\n {\n login: \"jnewland\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/12?v=4\",\n },\n {\n login: \"caged\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/13?v=4\",\n },\n { login: \"sr\", avatarUrl: \"https://avatars.githubusercontent.com/u/19?v=4\" },\n];\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\nconst HEART_PATH =\n \"M12.0001 4.52853C14.2745 2.23823 17.9866 2.23823 20.2611 4.52853C22.5784 6.86156 22.5784 10.667 20.2611 13.0001L12.0001 21.3199L3.73907 13.0001C1.42175 10.667 1.42175 6.86156 3.73907 4.52853C6.01353 2.23823 9.72563 2.23823 12.0001 4.52853Z\";\n\nconst REF_W = 1280;\nconst REF_H = 720;\nconst GRID_CX = 640;\nconst GRID_CY = 304;\nconst GRID_BOX_W = 900;\nconst GRID_BOX_H = 236;\nconst HEART_START_Y = 286;\nconst HEART_HEADER_Y = 120;\n\nconst DRAW_END = 40;\nconst PULSE_END = 62;\nconst HEART_DOCK_START = 52;\nconst HEART_DOCK_END = 84;\nconst AVATAR_START = 70;\nconst AVATAR_STEP = 3;\nconst AVATAR_DUR = 22;\nconst AVATAR_WINDOW = 56;\nconst THANK_START = 150;\nconst SUB_START = 166;\nconst CTA_START = 182;\nconst CTA_DUR = 22;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#161618\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport function gridColumns(\n count: number,\n boxW = GRID_BOX_W,\n boxH = GRID_BOX_H,\n): number {\n if (count <= 0) return 0;\n return Math.max(\n 1,\n Math.min(count, Math.round(Math.sqrt((count * boxW) / boxH))),\n );\n}\n\nexport function gridLayout(\n count: number,\n cols: number,\n cellW: number,\n cellH: number,\n cx = GRID_CX,\n cy = GRID_CY,\n): Point[] {\n if (count <= 0 || cols <= 0) return [];\n const rows = Math.ceil(count / cols);\n const out: Point[] = [];\n for (let i = 0; i < count; i++) {\n const r = Math.floor(i / cols);\n const c = i % cols;\n const rowCount = Math.min(cols, count - r * cols);\n const rowW = (rowCount - 1) * cellW;\n const x = cx - rowW / 2 + c * cellW;\n const totalH = (rows - 1) * cellH;\n const y = cy - totalH / 2 + r * cellH;\n out.push({ x, y });\n }\n return out;\n}\n\nexport function heartDrawProgress(frame: number, speed = 1): number {\n return interpolate(frame * speed, [0, DRAW_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n}\n\nexport function heartPulseScale(frame: number, speed = 1): number {\n return interpolate(\n frame * speed,\n [DRAW_END - 2, DRAW_END + 6, DRAW_END + 17, PULSE_END],\n [1, 0.9, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.ease),\n },\n );\n}\n\nfunction ramp(\n frame: number,\n speed: number,\n start: number,\n end: number,\n easing = Easing.bezier(0.22, 1, 0.36, 1),\n): number {\n return interpolate(frame * speed, [start, end], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n grayscale,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n grayscale: number;\n}) {\n const [errored, setErrored] = useState(false);\n const base = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n filter: `grayscale(${grayscale})`,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...base,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...base, objectFit: \"cover\" }}\n />\n );\n}\n\nconst SponsorNode = memo(function SponsorNode({\n sponsor,\n cell,\n progress,\n size,\n theme,\n}: {\n sponsor: Sponsor;\n cell: Point;\n progress: number;\n size: number;\n theme: Theme;\n}) {\n const y = (1 - progress) * 14;\n const blur = (1 - progress) * 10;\n\n return (\n <div\n style={{\n position: \"absolute\",\n left: cell.x,\n top: cell.y,\n transform: `translate(-50%, -50%) translateY(${y}px)`,\n opacity: progress,\n filter: `blur(${blur}px)`,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <Avatar\n login={sponsor.login}\n avatarUrl={sponsor.avatarUrl}\n size={size}\n theme={theme}\n grayscale={1 - progress}\n />\n </div>\n );\n});\n\nfunction HeartGlyph({\n size,\n accent,\n draw,\n fill,\n}: {\n size: number;\n accent: string;\n draw: number;\n fill: number;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n >\n <title>GitHub Sponsors</title>\n <path\n d={HEART_PATH}\n pathLength={1}\n fill={accent}\n fillOpacity={fill}\n stroke={accent}\n strokeWidth={1.4}\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n />\n </svg>\n );\n}\n\nexport function GitHubSponsors({\n account = \"remocn\",\n sponsors = SAMPLE_SPONSORS,\n accentColor = \"#db61a2\",\n speed = 1,\n theme = \"light\",\n}: GitHubSponsorsProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const stageScale = Math.min(width / REF_W, height / REF_H);\n\n const count = sponsors.length;\n const avatarStep =\n count > 1 ? Math.min(AVATAR_STEP, AVATAR_WINDOW / (count - 1)) : 0;\n const cols = gridColumns(count);\n const rows = Math.max(1, Math.ceil(count / Math.max(1, cols)));\n const cellW = GRID_BOX_W / Math.max(1, cols);\n const cellH = GRID_BOX_H / rows;\n const avatarSize = Math.min(84, Math.min(cellW, cellH) * 0.76);\n\n const cells = useMemo(\n () => gridLayout(count, cols, cellW, cellH),\n [count, cols, cellW, cellH],\n );\n\n const draw = heartDrawProgress(frame, speed);\n const fillO = ramp(frame, speed, DRAW_END - 8, PULSE_END, Easing.linear);\n const pulse = heartPulseScale(frame, speed);\n const dock = ramp(frame, speed, HEART_DOCK_START, HEART_DOCK_END);\n\n const heartBase = 168;\n const heartScale = (1 - 0.62 * dock) * pulse;\n const heartDy = (HEART_HEADER_Y - HEART_START_Y) * dock;\n\n const ctaProgress = ramp(frame, speed, CTA_START, CTA_START + CTA_DUR);\n const ctaBlur = (1 - ctaProgress) * 10;\n const ctaY = (1 - ctaProgress) * 12;\n const accountOpacity = ramp(\n frame,\n speed,\n CTA_START + 8,\n CTA_START + CTA_DUR + 8,\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: REF_W,\n height: REF_H,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n {sponsors.map((sponsor, i) => (\n <SponsorNode\n key={`node-${sponsor.login}-${i}`}\n sponsor={sponsor}\n cell={cells[i]}\n progress={ramp(\n frame,\n speed,\n AVATAR_START + i * avatarStep,\n AVATAR_START + i * avatarStep + AVATAR_DUR,\n )}\n size={avatarSize}\n theme={t}\n />\n ))}\n\n <div\n style={{\n position: \"absolute\",\n left: GRID_CX,\n top: HEART_START_Y,\n transform: `translate(-50%, -50%) translate(0px, ${heartDy}px) scale(${heartScale})`,\n width: heartBase,\n height: heartBase,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n willChange: \"transform\",\n }}\n >\n <HeartGlyph\n size={heartBase}\n accent={accentColor}\n draw={draw}\n fill={fillO}\n />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 444,\n width: REF_W,\n height: 84,\n }}\n >\n <Sequence from={Math.round(THANK_START / speed)} layout=\"none\">\n <SoftBlurIn\n text=\"Thank you\"\n fontSize={54}\n fontWeight={600}\n color={t.fg}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 532,\n width: REF_W,\n height: 36,\n }}\n >\n <Sequence from={Math.round(SUB_START / speed)} layout=\"none\">\n <BlurOutUp\n text={`Powered by ${count} sponsors`}\n fontSize={24}\n fontWeight={500}\n color={t.fgMuted}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 584,\n width: REF_W,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <div\n style={{\n transform: `translateY(${ctaY}px)`,\n opacity: ctaProgress,\n filter: `blur(${ctaBlur}px)`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"14px 26px\",\n borderRadius: 9999,\n background: accentColor,\n color: \"#ffffff\",\n fontSize: 24,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <HeartGlyph size={22} accent=\"#ffffff\" draw={1} fill={1} />\n Become a sponsor\n </div>\n <div\n style={{\n opacity: accountOpacity * 0.9,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n github.com/sponsors/{account}\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { memo, useMemo, useState } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { BlurOutUp } from \"@/components/remocn/blur-out-up\";\nimport { SoftBlurIn } from \"@/components/remocn/soft-blur-in\";\n\nexport interface Sponsor {\n login: string;\n avatarUrl: string;\n}\n\nexport interface GitHubSponsorsProps {\n account?: string;\n sponsors?: Sponsor[];\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n}\n\nexport const SAMPLE_SPONSORS: Sponsor[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n },\n {\n login: \"schacon\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/70?v=4\",\n },\n {\n login: \"rtomayko\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/5?v=4\",\n },\n {\n login: \"bmizerany\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/6?v=4\",\n },\n {\n login: \"atmos\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/38?v=4\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n },\n {\n login: \"macournoyer\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/15?v=4\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n },\n {\n login: \"uggedal\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/16?v=4\",\n },\n {\n login: \"anotherjesse\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/9?v=4\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n },\n {\n login: \"takeo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/22?v=4\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n },\n {\n login: \"kballard\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/7?v=4\",\n },\n {\n login: \"jnewland\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/12?v=4\",\n },\n {\n login: \"caged\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/13?v=4\",\n },\n { login: \"sr\", avatarUrl: \"https://avatars.githubusercontent.com/u/19?v=4\" },\n];\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\nconst HEART_PATH =\n \"M12.0001 4.52853C14.2745 2.23823 17.9866 2.23823 20.2611 4.52853C22.5784 6.86156 22.5784 10.667 20.2611 13.0001L12.0001 21.3199L3.73907 13.0001C1.42175 10.667 1.42175 6.86156 3.73907 4.52853C6.01353 2.23823 9.72563 2.23823 12.0001 4.52853Z\";\n\nconst REF_W = 1280;\nconst REF_H = 720;\nconst GRID_CX = 640;\nconst GRID_CY = 304;\nconst GRID_BOX_W = 900;\nconst GRID_BOX_H = 236;\nconst HEART_START_Y = 286;\nconst HEART_HEADER_Y = 120;\n\nconst DRAW_END = 40;\nconst PULSE_END = 62;\nconst HEART_DOCK_START = 52;\nconst HEART_DOCK_END = 84;\nconst AVATAR_START = 70;\nconst AVATAR_STEP = 3;\nconst AVATAR_DUR = 22;\nconst AVATAR_WINDOW = 56;\nconst THANK_START = 150;\nconst SUB_START = 166;\nconst CTA_START = 182;\nconst CTA_DUR = 22;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#161618\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport function gridColumns(\n count: number,\n boxW = GRID_BOX_W,\n boxH = GRID_BOX_H,\n): number {\n if (count <= 0) return 0;\n return Math.max(\n 1,\n Math.min(count, Math.round(Math.sqrt((count * boxW) / boxH))),\n );\n}\n\nexport function gridLayout(\n count: number,\n cols: number,\n cellW: number,\n cellH: number,\n cx = GRID_CX,\n cy = GRID_CY,\n): Point[] {\n if (count <= 0 || cols <= 0) return [];\n const rows = Math.ceil(count / cols);\n const out: Point[] = [];\n for (let i = 0; i < count; i++) {\n const r = Math.floor(i / cols);\n const c = i % cols;\n const rowCount = Math.min(cols, count - r * cols);\n const rowW = (rowCount - 1) * cellW;\n const x = cx - rowW / 2 + c * cellW;\n const totalH = (rows - 1) * cellH;\n const y = cy - totalH / 2 + r * cellH;\n out.push({ x, y });\n }\n return out;\n}\n\nexport function heartDrawProgress(frame: number, speed = 1): number {\n return interpolate(frame * speed, [0, DRAW_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n}\n\nexport function heartPulseScale(frame: number, speed = 1): number {\n return interpolate(\n frame * speed,\n [DRAW_END - 2, DRAW_END + 6, DRAW_END + 17, PULSE_END],\n [1, 0.9, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.ease),\n },\n );\n}\n\nfunction ramp(\n frame: number,\n speed: number,\n start: number,\n end: number,\n easing = Easing.bezier(0.22, 1, 0.36, 1),\n): number {\n return interpolate(frame * speed, [start, end], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n grayscale,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n grayscale: number;\n}) {\n const [errored, setErrored] = useState(false);\n const base = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n filter: `grayscale(${grayscale})`,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...base,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...base, objectFit: \"cover\" }}\n />\n );\n}\n\nconst SponsorNode = memo(function SponsorNode({\n sponsor,\n cell,\n progress,\n size,\n theme,\n}: {\n sponsor: Sponsor;\n cell: Point;\n progress: number;\n size: number;\n theme: Theme;\n}) {\n const y = (1 - progress) * 14;\n const blur = (1 - progress) * 10;\n\n return (\n <div\n style={{\n position: \"absolute\",\n left: cell.x,\n top: cell.y,\n translate: `-50% calc(-50% + ${y}px)`,\n opacity: progress,\n filter: `blur(${blur}px)`,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <Avatar\n login={sponsor.login}\n avatarUrl={sponsor.avatarUrl}\n size={size}\n theme={theme}\n grayscale={1 - progress}\n />\n </div>\n );\n});\n\nfunction HeartGlyph({\n size,\n accent,\n draw,\n fill,\n}: {\n size: number;\n accent: string;\n draw: number;\n fill: number;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n >\n <title>GitHub Sponsors</title>\n <path\n d={HEART_PATH}\n pathLength={1}\n fill={accent}\n fillOpacity={fill}\n stroke={accent}\n strokeWidth={1.4}\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n />\n </svg>\n );\n}\n\nexport function GitHubSponsors({\n account = \"remocn\",\n sponsors = SAMPLE_SPONSORS,\n accentColor = \"#db61a2\",\n speed = 1,\n theme = \"light\",\n}: GitHubSponsorsProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const stageScale = Math.min(width / REF_W, height / REF_H);\n\n const count = sponsors.length;\n const avatarStep =\n count > 1 ? Math.min(AVATAR_STEP, AVATAR_WINDOW / (count - 1)) : 0;\n const cols = gridColumns(count);\n const rows = Math.max(1, Math.ceil(count / Math.max(1, cols)));\n const cellW = GRID_BOX_W / Math.max(1, cols);\n const cellH = GRID_BOX_H / rows;\n const avatarSize = Math.min(84, Math.min(cellW, cellH) * 0.76);\n\n const cells = useMemo(\n () => gridLayout(count, cols, cellW, cellH),\n [count, cols, cellW, cellH],\n );\n\n const draw = heartDrawProgress(frame, speed);\n const fillO = ramp(frame, speed, DRAW_END - 8, PULSE_END, Easing.linear);\n const pulse = heartPulseScale(frame, speed);\n const dock = ramp(frame, speed, HEART_DOCK_START, HEART_DOCK_END);\n\n const heartBase = 168;\n const heartScale = (1 - 0.62 * dock) * pulse;\n const heartDy = (HEART_HEADER_Y - HEART_START_Y) * dock;\n\n const ctaProgress = ramp(frame, speed, CTA_START, CTA_START + CTA_DUR);\n const ctaBlur = (1 - ctaProgress) * 10;\n const ctaY = (1 - ctaProgress) * 12;\n const accountOpacity = ramp(\n frame,\n speed,\n CTA_START + 8,\n CTA_START + CTA_DUR + 8,\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: REF_W,\n height: REF_H,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n {sponsors.map((sponsor, i) => (\n <SponsorNode\n key={`node-${sponsor.login}-${i}`}\n sponsor={sponsor}\n cell={cells[i]}\n progress={ramp(\n frame,\n speed,\n AVATAR_START + i * avatarStep,\n AVATAR_START + i * avatarStep + AVATAR_DUR,\n )}\n size={avatarSize}\n theme={t}\n />\n ))}\n\n <div\n style={{\n position: \"absolute\",\n left: GRID_CX,\n top: HEART_START_Y,\n translate: `-50% calc(-50% + ${heartDy}px)`,\n scale: `${heartScale}`,\n width: heartBase,\n height: heartBase,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n willChange: \"transform\",\n }}\n >\n <HeartGlyph\n size={heartBase}\n accent={accentColor}\n draw={draw}\n fill={fillO}\n />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 444,\n width: REF_W,\n height: 84,\n }}\n >\n <Sequence from={Math.round(THANK_START / speed)} layout=\"none\">\n <SoftBlurIn\n text=\"Thank you\"\n fontSize={54}\n fontWeight={600}\n color={t.fg}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 532,\n width: REF_W,\n height: 36,\n }}\n >\n <Sequence from={Math.round(SUB_START / speed)} layout=\"none\">\n <BlurOutUp\n text={`Powered by ${count} sponsors`}\n fontSize={24}\n fontWeight={500}\n color={t.fgMuted}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 584,\n width: REF_W,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <div\n style={{\n translate: `0 ${ctaY}px`,\n opacity: ctaProgress,\n filter: `blur(${ctaBlur}px)`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"14px 26px\",\n borderRadius: 9999,\n background: accentColor,\n color: \"#ffffff\",\n fontSize: 24,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <HeartGlyph size={22} accent=\"#ffffff\" draw={1} fill={1} />\n Become a sponsor\n </div>\n <div\n style={{\n opacity: accountOpacity * 0.9,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n github.com/sponsors/{account}\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/github-sponsors.tsx"
}
diff --git a/registry-artifacts/github-stars.json b/registry-artifacts/github-stars.json
index 9dbd11a5..090aee2e 100644
--- a/registry-artifacts/github-stars.json
+++ b/registry-artifacts/github-stars.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/github-stars/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { format, parseISO } from \"date-fns\";\nimport { memo, useMemo, useState } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Odometer } from \"@/components/remocn/number-wheel\";\n\nexport interface Stargazer {\n login: string;\n avatarUrl: string;\n /** ISO date string, e.g. \"2021-03-04\" */\n starredAt: string;\n}\n\nexport interface GitHubStarsProps {\n repo?: string;\n totalStars?: number;\n stargazers?: Stargazer[];\n orientation?: \"horizontal\" | \"vertical\";\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n repoAvatarUrl?: string;\n}\n\n/**\n * Built-in mock stargazers so the composition renders immediately from defaults\n * (own-your-code: no external data needed after `shadcn add`). Real low-id GitHub\n * avatar URLs are CORS-ok, so the docs preview shows round photos.\n */\nexport const SAMPLE_STARGAZERS: Stargazer[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n];\n\n// Load fonts INSIDE the composition (via @remotion/google-fonts, which waits for\n// the font with delayRender before rendering frames). Server renders run in a\n// bare headless Chromium with no app CSS / `--font-*` vars, so without this the\n// MP4 falls back to the default sans-serif. Manrope for UI text, JetBrains Mono\n// for the numeric star counter (odometer).\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#111113\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/**\n * Clamp a stargazer list to at most `max` evenly-sampled keyframe rows while\n * always preserving the first and last entry. Safety net for callers that pass\n * a huge array straight into the composition.\n */\nexport function downsampleStargazers(\n stargazers: Stargazer[],\n max = 60,\n): Stargazer[] {\n const len = stargazers.length;\n if (len <= max) return stargazers;\n if (max <= 1) return len ? [stargazers[0]] : [];\n const out: Stargazer[] = [];\n for (let i = 0; i < max; i++) {\n out.push(stargazers[Math.round((i * (len - 1)) / (max - 1))]);\n }\n return out;\n}\n\nconst MAX_ELASTIC_OVERSHOOT = 0.0658; // Easing.elastic(1) peak−1 (true ≈0.0657267), rounded UP for use as a safety bound\nconst SCROLL_OVERSHOOT = 1 + MAX_ELASTIC_OVERSHOOT; // ≈1.0658\nconst MASK_SOLID_FRACTION = 0.88; // bottom fade mask is solid until 88% of viewport height\nconst COUNT_PORTION = 0.8;\n\n/** Monotonic counter ramp — mirrors the reference StarCount easing. Drives the\n * odometer, which must stay monotonic or the digit wheels roll backward. */\nexport function computeCounterProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n}\n\n/** Elastic scroll ramp — mirrors the reference avatar slide. NON-monotonic:\n * overshoots to ~SCROLL_OVERSHOOT near t≈0.63 and settles to exactly 1 at t=1.\n * Drives only scrollY (never the odometer). */\nexport function computeScrollProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(frame * speed, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.elastic(0.8),\n });\n}\n\n/** Empty rows appended below the last stargazer so the elastic recoil never\n * lifts real content off the mask-solid zone, revealing a void. Single source\n * of truth shared with isScrollContained so the two cannot drift. */\nexport function computeSpacerRows({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): number {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const needPx =\n MASK_SOLID_FRACTION * viewportH - N * rowH + SCROLL_OVERSHOOT * D;\n return Math.max(0, Math.ceil(needPx / rowH));\n}\n\n/** True when, at the elastic overshoot peak, content still fills the mask-solid\n * zone (no void revealed). True by construction given computeSpacerRows. */\nexport function isScrollContained({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): boolean {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const spacerPx =\n computeSpacerRows({ N, rowH, viewportH, visibleRows }) * rowH;\n return (\n N * rowH + spacerPx - SCROLL_OVERSHOOT * D >=\n MASK_SOLID_FRACTION * viewportH\n );\n}\n\n/** The running counter value for a given scroll progress. Locks at totalStars. */\nexport function getStarCount(\n scrollProgress: number,\n totalStars: number,\n): number {\n return Math.round(scrollProgress * totalStars);\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction StarGlyph({ size, fill }: { size: number; fill: string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n color={fill}\n fill={fill}\n stroke={fill}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <title>Stars</title>\n <path d=\"M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z\"></path>\n </svg>\n );\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\ninterface RowProps {\n stargazer: Stargazer;\n index: number;\n rowH: number;\n avatarSize: number;\n loginSize: number;\n dateLabel: string;\n accent: string;\n theme: Theme;\n isActive: boolean;\n settle: number;\n showSeparator: boolean;\n opacity: number;\n}\n\nconst Row = memo(function Row({\n stargazer,\n index,\n rowH,\n avatarSize,\n loginSize,\n dateLabel,\n accent,\n theme,\n isActive,\n settle,\n showSeparator,\n opacity,\n}: RowProps) {\n return (\n <div\n style={{\n position: \"relative\",\n height: rowH,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 24,\n paddingRight: 24,\n background: \"transparent\",\n opacity,\n boxSizing: \"border-box\",\n borderBottom:\n showSeparator && !isActive ? `1px solid ${theme.border}` : \"none\",\n }}\n >\n {isActive && (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: theme.bgSubtle,\n opacity: settle,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: 2,\n background: accent,\n opacity: settle,\n }}\n />\n </>\n )}\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n }}\n >\n <Avatar\n login={stargazer.login}\n avatarUrl={stargazer.avatarUrl}\n size={avatarSize}\n theme={theme}\n />\n <div style={{ marginLeft: 20, minWidth: 0, flex: 1 }}>\n <div\n style={{\n fontSize: loginSize,\n fontWeight: 600,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n lineHeight: 1.2,\n }}\n >\n {stargazer.login}\n </div>\n <div\n style={{\n fontSize: 18,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n {dateLabel}\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n color: theme.fgMuted,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n fontVariantNumeric: \"tabular-nums\",\n flexShrink: 0,\n }}\n >\n <StarGlyph size={20} fill={accent} />\n <span>#{index + 1}</span>\n </div>\n </div>\n </div>\n );\n});\n\n// --- Main composition ------------------------------------------------------\n\nexport function GitHubStars({\n repo = \"remotion-dev/remotion\",\n totalStars = 24813,\n stargazers = SAMPLE_STARGAZERS,\n orientation = \"horizontal\",\n accentColor = \"#ffbb00\",\n speed = 1,\n theme = \"light\",\n repoAvatarUrl,\n}: GitHubStarsProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n // Render at the native reference size for the orientation, then scale to fit\n // the actual canvas — keeps proportions at any resolution and letterboxes a\n // vertical layout cleanly inside a horizontal preview canvas.\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const rows = useMemo(() => downsampleStargazers(stargazers), [stargazers]);\n const N = rows.length;\n\n // Progress drivers: monotonic counter ramp + non-monotonic elastic scroll.\n const counterProgress = computeCounterProgress({\n frame,\n speed,\n durationInFrames,\n });\n const pScroll = computeScrollProgress({ frame, speed, durationInFrames });\n const p = Math.max(0, Math.min(1, (frame * speed) / durationInFrames));\n\n const current = counterProgress * totalStars;\n\n // List viewport geometry (in reference px).\n const rowH = isVertical ? 96 : 88;\n const avatarSize = isVertical ? 60 : 56;\n const loginSize = isVertical ? 30 : 28;\n const dateFormat = isVertical ? \"MMM yyyy\" : \"MMM d, yyyy\";\n const formattedRows = useMemo(\n () =>\n rows.map((sg) => {\n try {\n return { sg, dateLabel: format(parseISO(sg.starredAt), dateFormat) };\n } catch {\n return { sg, dateLabel: sg.starredAt };\n }\n }),\n [rows, dateFormat],\n );\n\n const viewport = isVertical\n ? { x: 48, y: 320, w: 624, h: 888, radius: 28 }\n : { x: 560, y: 60, w: 640, h: 600, radius: 24 };\n\n const visibleRows = Math.floor(viewport.h / rowH);\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const scrollY = -pScroll * D;\n\n const spacerRows = computeSpacerRows({\n N,\n rowH,\n viewportH: viewport.h,\n visibleRows,\n });\n const spacerPx = spacerRows * rowH;\n\n const settle = interpolate(p, [0.92, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Counter zone type scale.\n const counterSize = isVertical ? 96 : 120;\n const starSize = isVertical ? 56 : 64;\n const underlineMax = isVertical ? 200 : 240;\n const underlineWidth = counterProgress * underlineMax;\n\n const fadeH = Math.round(viewport.h * 0.12);\n\n const listViewport = (\n <div\n style={{\n position: \"absolute\",\n left: viewport.x,\n top: viewport.y,\n width: viewport.w,\n height: viewport.h,\n overflow: \"hidden\",\n borderRadius: viewport.radius,\n border: `1px solid ${t.border}`,\n background: t.bg,\n }}\n >\n <div\n style={{\n transform: `translateY(${scrollY}px)`,\n willChange: \"transform\",\n }}\n >\n {formattedRows.map(({ sg, dateLabel }, i) => (\n <Row\n key={`${sg.login}-${i}`}\n stargazer={sg}\n index={i}\n rowH={rowH}\n avatarSize={avatarSize}\n loginSize={loginSize}\n dateLabel={dateLabel}\n accent={accentColor}\n theme={t}\n isActive={i === N - 1}\n settle={i === N - 1 ? settle : 0}\n showSeparator={i < N - 1}\n opacity={1}\n />\n ))}\n {spacerPx > 0 && (\n <div style={{ height: spacerPx }} aria-hidden=\"true\" />\n )}\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to bottom, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to top, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n\n const underline = (\n <div\n style={{\n height: 4,\n width: underlineWidth,\n background: accentColor,\n borderRadius: 2,\n }}\n />\n );\n\n const repoOwner = repo.split(\"/\")[0] || repo;\n const repoAvatarSize = isVertical ? 28 : 32;\n const repoAvatarSrc =\n repoAvatarUrl ?? `https://unavatar.io/github/${repoOwner}`;\n\n const repoSlug = (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n maxWidth: isVertical ? 600 : 392,\n }}\n >\n <Avatar\n login={repoOwner}\n avatarUrl={repoAvatarSrc}\n size={repoAvatarSize}\n theme={t}\n />\n <div\n style={{\n fontSize: isVertical ? 20 : 24,\n fontWeight: 500,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {repo}\n </div>\n </div>\n );\n\n const counterZone = isVertical ? (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: refW,\n height: 300,\n paddingTop: 72,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 20 }}>\n <StarGlyph size={starSize} fill={accentColor} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n </div>\n {underline}\n {repoSlug}\n </div>\n ) : (\n <div\n style={{\n position: \"absolute\",\n left: 80,\n top: 0,\n width: 392,\n height: refH,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"flex-start\",\n }}\n >\n <StarGlyph size={starSize} fill={accentColor} />\n <div style={{ height: 20 }} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n <div style={{ height: 16 }} />\n {underline}\n <div style={{ height: 20 }} />\n\n {repoSlug}\n </div>\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n {counterZone}\n {listViewport}\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { format, parseISO } from \"date-fns\";\nimport { memo, useMemo, useState } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Odometer } from \"@/components/remocn/number-wheel\";\n\nexport interface Stargazer {\n login: string;\n avatarUrl: string;\n /** ISO date string, e.g. \"2021-03-04\" */\n starredAt: string;\n}\n\nexport interface GitHubStarsProps {\n repo?: string;\n totalStars?: number;\n stargazers?: Stargazer[];\n orientation?: \"horizontal\" | \"vertical\";\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n repoAvatarUrl?: string;\n}\n\n/**\n * Built-in mock stargazers so the composition renders immediately from defaults\n * (own-your-code: no external data needed after `shadcn add`). Real low-id GitHub\n * avatar URLs are CORS-ok, so the docs preview shows round photos.\n */\nexport const SAMPLE_STARGAZERS: Stargazer[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n];\n\n// Load fonts INSIDE the composition (via @remotion/google-fonts, which waits for\n// the font with delayRender before rendering frames). Server renders run in a\n// bare headless Chromium with no app CSS / `--font-*` vars, so without this the\n// MP4 falls back to the default sans-serif. Manrope for UI text, JetBrains Mono\n// for the numeric star counter (odometer).\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#111113\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/**\n * Clamp a stargazer list to at most `max` evenly-sampled keyframe rows while\n * always preserving the first and last entry. Safety net for callers that pass\n * a huge array straight into the composition.\n */\nexport function downsampleStargazers(\n stargazers: Stargazer[],\n max = 60,\n): Stargazer[] {\n const len = stargazers.length;\n if (len <= max) return stargazers;\n if (max <= 1) return len ? [stargazers[0]] : [];\n const out: Stargazer[] = [];\n for (let i = 0; i < max; i++) {\n out.push(stargazers[Math.round((i * (len - 1)) / (max - 1))]);\n }\n return out;\n}\n\nconst MAX_ELASTIC_OVERSHOOT = 0.0658; // Easing.elastic(1) peak−1 (true ≈0.0657267), rounded UP for use as a safety bound\nconst SCROLL_OVERSHOOT = 1 + MAX_ELASTIC_OVERSHOOT; // ≈1.0658\nconst MASK_SOLID_FRACTION = 0.88; // bottom fade mask is solid until 88% of viewport height\nconst COUNT_PORTION = 0.8;\n\n/** Monotonic counter ramp — mirrors the reference StarCount easing. Drives the\n * odometer, which must stay monotonic or the digit wheels roll backward. */\nexport function computeCounterProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n}\n\n/** Elastic scroll ramp — mirrors the reference avatar slide. NON-monotonic:\n * overshoots to ~SCROLL_OVERSHOOT near t≈0.63 and settles to exactly 1 at t=1.\n * Drives only scrollY (never the odometer). */\nexport function computeScrollProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(frame * speed, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.elastic(0.8),\n });\n}\n\n/** Empty rows appended below the last stargazer so the elastic recoil never\n * lifts real content off the mask-solid zone, revealing a void. Single source\n * of truth shared with isScrollContained so the two cannot drift. */\nexport function computeSpacerRows({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): number {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const needPx =\n MASK_SOLID_FRACTION * viewportH - N * rowH + SCROLL_OVERSHOOT * D;\n return Math.max(0, Math.ceil(needPx / rowH));\n}\n\n/** True when, at the elastic overshoot peak, content still fills the mask-solid\n * zone (no void revealed). True by construction given computeSpacerRows. */\nexport function isScrollContained({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): boolean {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const spacerPx =\n computeSpacerRows({ N, rowH, viewportH, visibleRows }) * rowH;\n return (\n N * rowH + spacerPx - SCROLL_OVERSHOOT * D >=\n MASK_SOLID_FRACTION * viewportH\n );\n}\n\n/** The running counter value for a given scroll progress. Locks at totalStars. */\nexport function getStarCount(\n scrollProgress: number,\n totalStars: number,\n): number {\n return Math.round(scrollProgress * totalStars);\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction StarGlyph({ size, fill }: { size: number; fill: string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n color={fill}\n fill={fill}\n stroke={fill}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <title>Stars</title>\n <path d=\"M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z\"></path>\n </svg>\n );\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\ninterface RowProps {\n stargazer: Stargazer;\n index: number;\n rowH: number;\n avatarSize: number;\n loginSize: number;\n dateLabel: string;\n accent: string;\n theme: Theme;\n isActive: boolean;\n settle: number;\n showSeparator: boolean;\n opacity: number;\n}\n\nconst Row = memo(function Row({\n stargazer,\n index,\n rowH,\n avatarSize,\n loginSize,\n dateLabel,\n accent,\n theme,\n isActive,\n settle,\n showSeparator,\n opacity,\n}: RowProps) {\n return (\n <div\n style={{\n position: \"relative\",\n height: rowH,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 24,\n paddingRight: 24,\n background: \"transparent\",\n opacity,\n boxSizing: \"border-box\",\n borderBottom:\n showSeparator && !isActive ? `1px solid ${theme.border}` : \"none\",\n }}\n >\n {isActive && (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: theme.bgSubtle,\n opacity: settle,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: 2,\n background: accent,\n opacity: settle,\n }}\n />\n </>\n )}\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n }}\n >\n <Avatar\n login={stargazer.login}\n avatarUrl={stargazer.avatarUrl}\n size={avatarSize}\n theme={theme}\n />\n <div style={{ marginLeft: 20, minWidth: 0, flex: 1 }}>\n <div\n style={{\n fontSize: loginSize,\n fontWeight: 600,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n lineHeight: 1.2,\n }}\n >\n {stargazer.login}\n </div>\n <div\n style={{\n fontSize: 18,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n {dateLabel}\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n color: theme.fgMuted,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n fontVariantNumeric: \"tabular-nums\",\n flexShrink: 0,\n }}\n >\n <StarGlyph size={20} fill={accent} />\n <span>#{index + 1}</span>\n </div>\n </div>\n </div>\n );\n});\n\n// --- Main composition ------------------------------------------------------\n\nexport function GitHubStars({\n repo = \"remotion-dev/remotion\",\n totalStars = 24813,\n stargazers = SAMPLE_STARGAZERS,\n orientation = \"horizontal\",\n accentColor = \"#ffbb00\",\n speed = 1,\n theme = \"light\",\n repoAvatarUrl,\n}: GitHubStarsProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n // Render at the native reference size for the orientation, then scale to fit\n // the actual canvas — keeps proportions at any resolution and letterboxes a\n // vertical layout cleanly inside a horizontal preview canvas.\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const rows = useMemo(() => downsampleStargazers(stargazers), [stargazers]);\n const N = rows.length;\n\n // Progress drivers: monotonic counter ramp + non-monotonic elastic scroll.\n const counterProgress = computeCounterProgress({\n frame,\n speed,\n durationInFrames,\n });\n const pScroll = computeScrollProgress({ frame, speed, durationInFrames });\n const p = Math.max(0, Math.min(1, (frame * speed) / durationInFrames));\n\n const current = counterProgress * totalStars;\n\n // List viewport geometry (in reference px).\n const rowH = isVertical ? 96 : 88;\n const avatarSize = isVertical ? 60 : 56;\n const loginSize = isVertical ? 30 : 28;\n const dateFormat = isVertical ? \"MMM yyyy\" : \"MMM d, yyyy\";\n const formattedRows = useMemo(\n () =>\n rows.map((sg) => {\n try {\n return { sg, dateLabel: format(parseISO(sg.starredAt), dateFormat) };\n } catch {\n return { sg, dateLabel: sg.starredAt };\n }\n }),\n [rows, dateFormat],\n );\n\n const viewport = isVertical\n ? { x: 48, y: 320, w: 624, h: 888, radius: 28 }\n : { x: 560, y: 60, w: 640, h: 600, radius: 24 };\n\n const visibleRows = Math.floor(viewport.h / rowH);\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const scrollY = -pScroll * D;\n\n const spacerRows = computeSpacerRows({\n N,\n rowH,\n viewportH: viewport.h,\n visibleRows,\n });\n const spacerPx = spacerRows * rowH;\n\n const settle = interpolate(p, [0.92, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Counter zone type scale.\n const counterSize = isVertical ? 96 : 120;\n const starSize = isVertical ? 56 : 64;\n const underlineMax = isVertical ? 200 : 240;\n const underlineWidth = counterProgress * underlineMax;\n\n const fadeH = Math.round(viewport.h * 0.12);\n\n const listViewport = (\n <div\n style={{\n position: \"absolute\",\n left: viewport.x,\n top: viewport.y,\n width: viewport.w,\n height: viewport.h,\n overflow: \"hidden\",\n borderRadius: viewport.radius,\n border: `1px solid ${t.border}`,\n background: t.bg,\n }}\n >\n <div\n style={{\n translate: `0 ${scrollY}px`,\n willChange: \"transform\",\n }}\n >\n {formattedRows.map(({ sg, dateLabel }, i) => (\n <Row\n key={`${sg.login}-${i}`}\n stargazer={sg}\n index={i}\n rowH={rowH}\n avatarSize={avatarSize}\n loginSize={loginSize}\n dateLabel={dateLabel}\n accent={accentColor}\n theme={t}\n isActive={i === N - 1}\n settle={i === N - 1 ? settle : 0}\n showSeparator={i < N - 1}\n opacity={1}\n />\n ))}\n {spacerPx > 0 && (\n <div style={{ height: spacerPx }} aria-hidden=\"true\" />\n )}\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to bottom, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to top, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n\n const underline = (\n <div\n style={{\n height: 4,\n width: underlineWidth,\n background: accentColor,\n borderRadius: 2,\n }}\n />\n );\n\n const repoOwner = repo.split(\"/\")[0] || repo;\n const repoAvatarSize = isVertical ? 28 : 32;\n const repoAvatarSrc =\n repoAvatarUrl ?? `https://unavatar.io/github/${repoOwner}`;\n\n const repoSlug = (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n maxWidth: isVertical ? 600 : 392,\n }}\n >\n <Avatar\n login={repoOwner}\n avatarUrl={repoAvatarSrc}\n size={repoAvatarSize}\n theme={t}\n />\n <div\n style={{\n fontSize: isVertical ? 20 : 24,\n fontWeight: 500,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {repo}\n </div>\n </div>\n );\n\n const counterZone = isVertical ? (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: refW,\n height: 300,\n paddingTop: 72,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 20 }}>\n <StarGlyph size={starSize} fill={accentColor} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n </div>\n {underline}\n {repoSlug}\n </div>\n ) : (\n <div\n style={{\n position: \"absolute\",\n left: 80,\n top: 0,\n width: 392,\n height: refH,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"flex-start\",\n }}\n >\n <StarGlyph size={starSize} fill={accentColor} />\n <div style={{ height: 20 }} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n <div style={{ height: 16 }} />\n {underline}\n <div style={{ height: 20 }} />\n\n {repoSlug}\n </div>\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n {counterZone}\n {listViewport}\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/github-stars.tsx"
}
diff --git a/registry-artifacts/glass-code-block.json b/registry-artifacts/glass-code-block.json
index 253e725d..0099eab9 100644
--- a/registry-artifacts/glass-code-block.json
+++ b/registry-artifacts/glass-code-block.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/glass-code-block/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, Sequence, useCurrentFrame } from \"remotion\";\n\nexport interface GlassCodeBlockProps {\n code?: string;\n title?: string;\n width?: number;\n height?: number;\n fontSize?: number;\n glassColor?: string;\n staggerFrames?: number;\n showTrafficLights?: boolean;\n aura?: boolean;\n speed?: number;\n className?: string;\n}\n\nconst FONT_MONO =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\";\n\nconst DEFAULT_CODE = `import { motion } from \"remotion\";\n\n// Generate a hero scene\nexport function Hero() {\n const frame = useCurrentFrame();\n const opacity = frame / 30;\n return <h1 style={{ opacity }}>Hello</h1>;\n}`;\n\n// Minimal regex tokenizer. NOT a real syntax highlighter — just enough to\n// give the eye color anchors. Order matters: comments → strings → keywords.\nconst KEYWORDS = new Set([\n \"import\",\n \"from\",\n \"export\",\n \"function\",\n \"const\",\n \"let\",\n \"var\",\n \"return\",\n \"if\",\n \"else\",\n \"for\",\n \"while\",\n \"new\",\n \"class\",\n \"extends\",\n \"default\",\n \"true\",\n \"false\",\n \"null\",\n \"undefined\",\n]);\n\ntype Token = {\n text: string;\n kind: \"code\" | \"comment\" | \"string\" | \"keyword\" | \"number\";\n};\n\nfunction tokenizeLine(line: string): Token[] {\n // Whole-line comment.\n const trimmed = line.trimStart();\n if (trimmed.startsWith(\"//\")) {\n return [{ text: line, kind: \"comment\" }];\n }\n\n const tokens: Token[] = [];\n // Split keeping delimiters: words, strings, numbers, everything else.\n const re = /(\"[^\"]*\"|'[^']*'|`[^`]*`|\\b\\d+\\b|\\b[A-Za-z_$][\\w$]*\\b|[^\\w\"']+)/g;\n let match: RegExpExecArray | null = re.exec(line);\n while (match !== null) {\n const t = match[0];\n const first = t[0];\n if (first === '\"' || first === \"'\" || first === \"`\") {\n tokens.push({ text: t, kind: \"string\" });\n } else if (/^\\d+$/.test(t)) {\n tokens.push({ text: t, kind: \"number\" });\n } else if (/^[A-Za-z_$][\\w$]*$/.test(t) && KEYWORDS.has(t)) {\n tokens.push({ text: t, kind: \"keyword\" });\n } else {\n tokens.push({ text: t, kind: \"code\" });\n }\n match = re.exec(line);\n }\n return tokens;\n}\n\nconst TOKEN_COLORS: Record<Token[\"kind\"], string> = {\n code: \"#e4e4e7\",\n comment: \"#52525b\",\n string: \"#86efac\",\n keyword: \"#c4b5fd\",\n number: \"#fcd34d\",\n};\n\nexport function GlassCodeBlock({\n code = DEFAULT_CODE,\n title = \"hero.tsx\",\n width = 760,\n height = 460,\n fontSize = 16,\n glassColor = \"rgba(10, 10, 10, 0.6)\",\n staggerFrames = 4,\n showTrafficLights = true,\n aura = false,\n speed = 1,\n className,\n}: GlassCodeBlockProps) {\n const lines = code.split(\"\\n\");\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {aura && <BackdropAura />}\n\n {/* 1px gradient ring acting as a microborder */}\n <div\n style={{\n position: \"relative\",\n padding: 1,\n borderRadius: 16,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 100%)\",\n width,\n height,\n boxShadow: \"0 50px 120px rgba(0,0,0,0.55)\",\n }}\n >\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n borderRadius: 15,\n background: glassColor,\n backdropFilter: \"blur(16px)\",\n WebkitBackdropFilter: \"blur(16px)\",\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: FONT_MONO,\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 16px\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {showTrafficLights && (\n <>\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n </>\n )}\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#a1a1aa\",\n fontSize: 12,\n letterSpacing: \"0.02em\",\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Code body */}\n <div\n style={{\n flex: 1,\n padding: \"20px 24px\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n fontSize,\n lineHeight: 1.55,\n }}\n >\n {lines.map((line, i) => (\n <Sequence\n key={i}\n from={Math.round((i * staggerFrames) / speed)}\n layout=\"none\"\n >\n <CodeLine line={line} index={i} fontSize={fontSize} />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.6,\n }}\n />\n );\n}\n\nfunction CodeLine({\n line,\n index,\n fontSize,\n}: {\n line: string;\n index: number;\n fontSize: number;\n}) {\n const frame = useCurrentFrame();\n const opacity = interpolate(frame, [0, 8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const ty = interpolate(frame, [0, 8], [4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tokens = tokenizeLine(line);\n // Render an empty line as a half-height spacer so blank lines still take\n // visual space without collapsing the gap.\n if (tokens.length === 0) {\n return <div style={{ height: fontSize * 0.8, opacity }} />;\n }\n return (\n <div\n style={{\n opacity,\n transform: `translateY(${ty}px)`,\n whiteSpace: \"pre\",\n display: \"flex\",\n gap: 0,\n }}\n >\n <span style={{ width: 28, color: \"#3f3f46\", userSelect: \"none\" }}>\n {String(index + 1).padStart(2, \" \")}\n </span>\n <span>\n {tokens.map((t, i) => (\n <span key={i} style={{ color: TOKEN_COLORS[t.kind] }}>\n {t.text}\n </span>\n ))}\n </span>\n </div>\n );\n}\n\nfunction BackdropAura() {\n // Slow, low-amplitude blob behind the glass so the backdrop blur has\n // perceptible content to refract.\n const frame = useCurrentFrame();\n const t = frame / 60;\n const x = 50 + Math.sin(t) * 20;\n const y = 50 + Math.cos(t * 0.7) * 15;\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `radial-gradient(circle at ${x}% ${y}%, rgba(56,189,248,0.22), transparent 50%), radial-gradient(circle at ${100 - x}% ${100 - y}%, rgba(168,85,247,0.18), transparent 55%)`,\n }}\n />\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, Sequence, useCurrentFrame } from \"remotion\";\n\nexport interface GlassCodeBlockProps {\n code?: string;\n title?: string;\n width?: number;\n height?: number;\n fontSize?: number;\n glassColor?: string;\n staggerFrames?: number;\n showTrafficLights?: boolean;\n aura?: boolean;\n speed?: number;\n className?: string;\n}\n\nconst FONT_MONO =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\";\n\nconst DEFAULT_CODE = `import { motion } from \"remotion\";\n\n// Generate a hero scene\nexport function Hero() {\n const frame = useCurrentFrame();\n const opacity = frame / 30;\n return <h1 style={{ opacity }}>Hello</h1>;\n}`;\n\n// Minimal regex tokenizer. NOT a real syntax highlighter — just enough to\n// give the eye color anchors. Order matters: comments → strings → keywords.\nconst KEYWORDS = new Set([\n \"import\",\n \"from\",\n \"export\",\n \"function\",\n \"const\",\n \"let\",\n \"var\",\n \"return\",\n \"if\",\n \"else\",\n \"for\",\n \"while\",\n \"new\",\n \"class\",\n \"extends\",\n \"default\",\n \"true\",\n \"false\",\n \"null\",\n \"undefined\",\n]);\n\ntype Token = {\n text: string;\n kind: \"code\" | \"comment\" | \"string\" | \"keyword\" | \"number\";\n};\n\nfunction tokenizeLine(line: string): Token[] {\n // Whole-line comment.\n const trimmed = line.trimStart();\n if (trimmed.startsWith(\"//\")) {\n return [{ text: line, kind: \"comment\" }];\n }\n\n const tokens: Token[] = [];\n // Split keeping delimiters: words, strings, numbers, everything else.\n const re = /(\"[^\"]*\"|'[^']*'|`[^`]*`|\\b\\d+\\b|\\b[A-Za-z_$][\\w$]*\\b|[^\\w\"']+)/g;\n let match: RegExpExecArray | null = re.exec(line);\n while (match !== null) {\n const t = match[0];\n const first = t[0];\n if (first === '\"' || first === \"'\" || first === \"`\") {\n tokens.push({ text: t, kind: \"string\" });\n } else if (/^\\d+$/.test(t)) {\n tokens.push({ text: t, kind: \"number\" });\n } else if (/^[A-Za-z_$][\\w$]*$/.test(t) && KEYWORDS.has(t)) {\n tokens.push({ text: t, kind: \"keyword\" });\n } else {\n tokens.push({ text: t, kind: \"code\" });\n }\n match = re.exec(line);\n }\n return tokens;\n}\n\nconst TOKEN_COLORS: Record<Token[\"kind\"], string> = {\n code: \"#e4e4e7\",\n comment: \"#52525b\",\n string: \"#86efac\",\n keyword: \"#c4b5fd\",\n number: \"#fcd34d\",\n};\n\nexport function GlassCodeBlock({\n code = DEFAULT_CODE,\n title = \"hero.tsx\",\n width = 760,\n height = 460,\n fontSize = 16,\n glassColor = \"rgba(10, 10, 10, 0.6)\",\n staggerFrames = 4,\n showTrafficLights = true,\n aura = false,\n speed = 1,\n className,\n}: GlassCodeBlockProps) {\n const lines = code.split(\"\\n\");\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {aura && <BackdropAura />}\n\n {/* 1px gradient ring acting as a microborder */}\n <div\n style={{\n position: \"relative\",\n padding: 1,\n borderRadius: 16,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 100%)\",\n width,\n height,\n boxShadow: \"0 50px 120px rgba(0,0,0,0.55)\",\n }}\n >\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n borderRadius: 15,\n background: glassColor,\n backdropFilter: \"blur(16px)\",\n WebkitBackdropFilter: \"blur(16px)\",\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: FONT_MONO,\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 16px\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {showTrafficLights && (\n <>\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n </>\n )}\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#a1a1aa\",\n fontSize: 12,\n letterSpacing: \"0.02em\",\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Code body */}\n <div\n style={{\n flex: 1,\n padding: \"20px 24px\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n fontSize,\n lineHeight: 1.55,\n }}\n >\n {lines.map((line, i) => (\n <Sequence\n key={i}\n from={Math.round((i * staggerFrames) / speed)}\n layout=\"none\"\n >\n <CodeLine line={line} index={i} fontSize={fontSize} />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.6,\n }}\n />\n );\n}\n\nfunction CodeLine({\n line,\n index,\n fontSize,\n}: {\n line: string;\n index: number;\n fontSize: number;\n}) {\n const frame = useCurrentFrame();\n const opacity = interpolate(frame, [0, 8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const ty = interpolate(frame, [0, 8], [4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tokens = tokenizeLine(line);\n // Render an empty line as a half-height spacer so blank lines still take\n // visual space without collapsing the gap.\n if (tokens.length === 0) {\n return <div style={{ height: fontSize * 0.8, opacity }} />;\n }\n return (\n <div\n style={{\n opacity,\n translate: `0 ${ty}px`,\n whiteSpace: \"pre\",\n display: \"flex\",\n gap: 0,\n }}\n >\n <span style={{ width: 28, color: \"#3f3f46\", userSelect: \"none\" }}>\n {String(index + 1).padStart(2, \" \")}\n </span>\n <span>\n {tokens.map((t, i) => (\n <span key={i} style={{ color: TOKEN_COLORS[t.kind] }}>\n {t.text}\n </span>\n ))}\n </span>\n </div>\n );\n}\n\nfunction BackdropAura() {\n // Slow, low-amplitude blob behind the glass so the backdrop blur has\n // perceptible content to refract.\n const frame = useCurrentFrame();\n const t = frame / 60;\n const x = 50 + Math.sin(t) * 20;\n const y = 50 + Math.cos(t * 0.7) * 15;\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `radial-gradient(circle at ${x}% ${y}%, rgba(56,189,248,0.22), transparent 50%), radial-gradient(circle at ${100 - x}% ${100 - y}%, rgba(168,85,247,0.18), transparent 55%)`,\n }}\n />\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/glass-code-block.tsx"
}
diff --git a/registry-artifacts/glass-code-walk.json b/registry-artifacts/glass-code-walk.json
index 89432d32..7241cc52 100644
--- a/registry-artifacts/glass-code-walk.json
+++ b/registry-artifacts/glass-code-walk.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/glass-code-walk/index.tsx",
- "content": "\"use client\";\n\nimport { AbsoluteFill, Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { GlassCodeBlock } from \"@/components/remocn/glass-code-block\";\n\nexport interface GlassCodeWalkProps {\n code?: string;\n title?: string;\n width?: number;\n height?: number;\n fontSize?: number;\n staggerFrames?: number;\n zoom?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst RING = 1;\nconst CHROME_HEIGHT = 40;\nconst BODY_PADDING_TOP = 20;\nconst BODY_PADDING_LEFT = 24;\nconst LINE_GAP = 4;\nconst ANCHOR_SCREEN_X = 110;\nconst TARGET_Y = 360;\nconst PULL_BACK_FRAMES = 24;\n\nconst DEFAULT_CODE = `import { AbsoluteFill } from \"remotion\";\nimport { Typewriter } from \"@/components/remocn\";\n\nexport function Intro() {\n return (\n <AbsoluteFill>\n <Typewriter text=\"Ship it\" />\n </AbsoluteFill>\n );\n}`;\n\nexport function GlassCodeWalk({\n code = DEFAULT_CODE,\n title = \"scene.tsx\",\n width = 880,\n height = 420,\n fontSize = 18,\n staggerFrames = 10,\n zoom = 2.6,\n speed = 1,\n className,\n}: GlassCodeWalkProps) {\n const frame = useCurrentFrame();\n\n const lines = code.split(\"\\n\");\n const lineCount = lines.length;\n\n const blockLeft = (STAGE_WIDTH - width) / 2;\n const blockTop = (STAGE_HEIGHT - height) / 2;\n const bodyTop = blockTop + RING + CHROME_HEIGHT + BODY_PADDING_TOP;\n\n const lineHeightOf = (line: string) =>\n line.trim() === \"\" ? fontSize * 0.8 : fontSize * 1.55;\n\n const lineCenters: number[] = [];\n let walk = bodyTop;\n for (const line of lines) {\n const h = lineHeightOf(line);\n lineCenters.push(walk + h / 2);\n walk += h + LINE_GAP;\n }\n\n const anchorWorldX = blockLeft + RING + BODY_PADDING_LEFT;\n const scanStagger = staggerFrames / speed;\n const scanEnd = (lineCount - 1) * scanStagger;\n\n const linePosition = interpolate(frame, [0, scanEnd], [0, lineCount - 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const lower = Math.floor(linePosition);\n const upper = Math.min(lower + 1, lineCount - 1);\n const trackedY =\n lineCenters[lower] +\n (lineCenters[upper] - lineCenters[lower]) * (linePosition - lower);\n\n const pinnedX = ANCHOR_SCREEN_X - zoom * anchorWorldX;\n const pinnedY = TARGET_Y - zoom * trackedY;\n\n const pullBack = interpolate(\n frame,\n [scanEnd, scanEnd + PULL_BACK_FRAMES / speed],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.cubic),\n },\n );\n\n const scale = zoom + pullBack * (1 - zoom);\n const tx = (1 - pullBack) * pinnedX;\n const ty = (1 - pullBack) * pinnedY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n transform: `translate(${tx}px, ${ty}px) scale(${scale})`,\n transformOrigin: \"0 0\",\n }}\n >\n <GlassCodeBlock\n code={code}\n title={title}\n width={width}\n height={height}\n fontSize={fontSize}\n staggerFrames={staggerFrames}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { AbsoluteFill, Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { GlassCodeBlock } from \"@/components/remocn/glass-code-block\";\n\nexport interface GlassCodeWalkProps {\n code?: string;\n title?: string;\n width?: number;\n height?: number;\n fontSize?: number;\n staggerFrames?: number;\n zoom?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst RING = 1;\nconst CHROME_HEIGHT = 40;\nconst BODY_PADDING_TOP = 20;\nconst BODY_PADDING_LEFT = 24;\nconst LINE_GAP = 4;\nconst ANCHOR_SCREEN_X = 110;\nconst TARGET_Y = 360;\nconst PULL_BACK_FRAMES = 24;\n\nconst DEFAULT_CODE = `import { AbsoluteFill } from \"remotion\";\nimport { Typewriter } from \"@/components/remocn\";\n\nexport function Intro() {\n return (\n <AbsoluteFill>\n <Typewriter text=\"Ship it\" />\n </AbsoluteFill>\n );\n}`;\n\nexport function GlassCodeWalk({\n code = DEFAULT_CODE,\n title = \"scene.tsx\",\n width = 880,\n height = 420,\n fontSize = 18,\n staggerFrames = 10,\n zoom = 2.6,\n speed = 1,\n className,\n}: GlassCodeWalkProps) {\n const frame = useCurrentFrame();\n\n const lines = code.split(\"\\n\");\n const lineCount = lines.length;\n\n const blockLeft = (STAGE_WIDTH - width) / 2;\n const blockTop = (STAGE_HEIGHT - height) / 2;\n const bodyTop = blockTop + RING + CHROME_HEIGHT + BODY_PADDING_TOP;\n\n const lineHeightOf = (line: string) =>\n line.trim() === \"\" ? fontSize * 0.8 : fontSize * 1.55;\n\n const lineCenters: number[] = [];\n let walk = bodyTop;\n for (const line of lines) {\n const h = lineHeightOf(line);\n lineCenters.push(walk + h / 2);\n walk += h + LINE_GAP;\n }\n\n const anchorWorldX = blockLeft + RING + BODY_PADDING_LEFT;\n const scanStagger = staggerFrames / speed;\n const scanEnd = (lineCount - 1) * scanStagger;\n\n const linePosition = interpolate(frame, [0, scanEnd], [0, lineCount - 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const lower = Math.floor(linePosition);\n const upper = Math.min(lower + 1, lineCount - 1);\n const trackedY =\n lineCenters[lower] +\n (lineCenters[upper] - lineCenters[lower]) * (linePosition - lower);\n\n const pinnedX = ANCHOR_SCREEN_X - zoom * anchorWorldX;\n const pinnedY = TARGET_Y - zoom * trackedY;\n\n const pullBack = interpolate(\n frame,\n [scanEnd, scanEnd + PULL_BACK_FRAMES / speed],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.cubic),\n },\n );\n\n const scale = zoom + pullBack * (1 - zoom);\n const tx = (1 - pullBack) * pinnedX;\n const ty = (1 - pullBack) * pinnedY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n translate: `${tx}px ${ty}px`,\n scale: `${scale}`,\n transformOrigin: \"0 0\",\n }}\n >\n <GlassCodeBlock\n code={code}\n title={title}\n width={width}\n height={height}\n fontSize={fontSize}\n staggerFrames={staggerFrames}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/glass-code-walk.tsx"
}
diff --git a/registry-artifacts/glitch-cut.json b/registry-artifacts/glitch-cut.json
index 9d2b8c05..fe3916fd 100644
--- a/registry-artifacts/glitch-cut.json
+++ b/registry-artifacts/glitch-cut.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/glitch-cut/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, random } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type GlitchCutProps = {\n intensity?: number;\n slices?: number;\n rgbSplit?: number;\n blockNoise?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n slices: 24,\n rgbSplit: 1,\n blockNoise: 0.6,\n};\n\nconst STEPS = 22;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_intensity;\nuniform float u_slices;\nuniform float u_rgb_split;\nuniform float u_block_noise;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float STEPS = ${STEPS}.0;\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(sampler2D tex, vec2 uv, float split) {\n vec4 center = texture(tex, uv);\n float r = texture(tex, vec2(uv.x + split, uv.y)).r;\n float b = texture(tex, vec2(uv.x - split, uv.y)).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float energy = pow(max(sin(u_progress * PI), 0.0), 0.7);\n float clock = floor(u_progress * STEPS);\n\n float row = floor(v_uv.y * u_slices);\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.3 * u_intensity * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(\n 1.0 - u_block_noise * 0.5 * energy,\n hash(block + clock * 7.3)\n );\n float blockShift =\n (hash(block + clock * 3.1 + 5.0) - 0.5) * 0.2 * u_intensity * corrupt;\n\n vec2 uv = vec2(fract(v_uv.x + sliceShift + blockShift), v_uv.y);\n float split = u_rgb_split * 0.018 * energy * (0.35 + abs(amount));\n\n float cut = 0.5 + (hash(vec2(row, 91.0)) - 0.5) * 0.32;\n float handed = step(cut, u_progress);\n\n vec4 from = sampleSplit(u_from, uv, split);\n vec4 to = sampleSplit(u_to, uv, split);\n vec4 color = mix(from, to, handed);\n vec4 leaked = mix(to, from, handed);\n\n float leak = corrupt * step(0.55, hash(block + clock * 11.0 + 13.0));\n color = mix(color, leaked, leak * 0.8);\n\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = color;\n}`;\n\nconst shader = makeSceneShader<GlitchCutProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n slices = DEFAULTS.slices,\n rgbSplit = DEFAULTS.rgbSplit,\n blockNoise = DEFAULTS.blockNoise,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_rgb_split\"), rgbSplit);\n gl.uniform1f(uniform(\"u_block_noise\"), blockNoise);\n },\n);\n\nconst bandCut = (band: number) =>\n 0.5 + (random(`glitch-cut-handoff-${band}`) - 0.5) * 0.32;\n\nconst GlitchCutFallback: React.FC<\n TransitionPresentationComponentProps<GlitchCutProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n intensity = DEFAULTS.intensity,\n slices = DEFAULTS.slices,\n rgbSplit = DEFAULTS.rgbSplit,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const energy = Math.max(0, Math.sin(p * Math.PI)) ** 0.7;\n\n if (energy < 0.002) {\n const settled = entering ? (p >= 0.5 ? 1 : 0) : p < 0.5 ? 1 : 0;\n return <AbsoluteFill style={{ opacity: settled }}>{children}</AbsoluteFill>;\n }\n\n const clock = Math.floor(p * STEPS);\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shown = p >= bandCut(band) ? entering : !entering;\n if (!shown) {\n return null;\n }\n const shift =\n (random(`glitch-cut-shift-${clock}-${band}`) - 0.5) *\n 52 *\n intensity *\n energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n const tintOpacity =\n rgbSplit * 0.2 * energy * random(`glitch-cut-tint-${clock}-${band}`);\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n transform: `translateX(${shift}px)`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity: tintOpacity,\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<GlitchCutProps>({\n shader,\n fallback: GlitchCutFallback,\n});\n\nexport function glitchCut(\n props: GlitchCutProps = {},\n): TransitionPresentation<GlitchCutProps> {\n return presentation(props);\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, random } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type GlitchCutProps = {\n intensity?: number;\n slices?: number;\n rgbSplit?: number;\n blockNoise?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n slices: 24,\n rgbSplit: 1,\n blockNoise: 0.6,\n};\n\nconst STEPS = 22;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_intensity;\nuniform float u_slices;\nuniform float u_rgb_split;\nuniform float u_block_noise;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float STEPS = ${STEPS}.0;\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(sampler2D tex, vec2 uv, float split) {\n vec4 center = texture(tex, uv);\n float r = texture(tex, vec2(uv.x + split, uv.y)).r;\n float b = texture(tex, vec2(uv.x - split, uv.y)).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float energy = pow(max(sin(u_progress * PI), 0.0), 0.7);\n float clock = floor(u_progress * STEPS);\n\n float row = floor(v_uv.y * u_slices);\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.3 * u_intensity * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(\n 1.0 - u_block_noise * 0.5 * energy,\n hash(block + clock * 7.3)\n );\n float blockShift =\n (hash(block + clock * 3.1 + 5.0) - 0.5) * 0.2 * u_intensity * corrupt;\n\n vec2 uv = vec2(fract(v_uv.x + sliceShift + blockShift), v_uv.y);\n float split = u_rgb_split * 0.018 * energy * (0.35 + abs(amount));\n\n float cut = 0.5 + (hash(vec2(row, 91.0)) - 0.5) * 0.32;\n float handed = step(cut, u_progress);\n\n vec4 from = sampleSplit(u_from, uv, split);\n vec4 to = sampleSplit(u_to, uv, split);\n vec4 color = mix(from, to, handed);\n vec4 leaked = mix(to, from, handed);\n\n float leak = corrupt * step(0.55, hash(block + clock * 11.0 + 13.0));\n color = mix(color, leaked, leak * 0.8);\n\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = color;\n}`;\n\nconst shader = makeSceneShader<GlitchCutProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n slices = DEFAULTS.slices,\n rgbSplit = DEFAULTS.rgbSplit,\n blockNoise = DEFAULTS.blockNoise,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_rgb_split\"), rgbSplit);\n gl.uniform1f(uniform(\"u_block_noise\"), blockNoise);\n },\n);\n\nconst bandCut = (band: number) =>\n 0.5 + (random(`glitch-cut-handoff-${band}`) - 0.5) * 0.32;\n\nconst GlitchCutFallback: React.FC<\n TransitionPresentationComponentProps<GlitchCutProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n intensity = DEFAULTS.intensity,\n slices = DEFAULTS.slices,\n rgbSplit = DEFAULTS.rgbSplit,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const energy = Math.max(0, Math.sin(p * Math.PI)) ** 0.7;\n\n if (energy < 0.002) {\n const settled = entering ? (p >= 0.5 ? 1 : 0) : p < 0.5 ? 1 : 0;\n return <AbsoluteFill style={{ opacity: settled }}>{children}</AbsoluteFill>;\n }\n\n const clock = Math.floor(p * STEPS);\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shown = p >= bandCut(band) ? entering : !entering;\n if (!shown) {\n return null;\n }\n const shift =\n (random(`glitch-cut-shift-${clock}-${band}`) - 0.5) *\n 52 *\n intensity *\n energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n const tintOpacity =\n rgbSplit * 0.2 * energy * random(`glitch-cut-tint-${clock}-${band}`);\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n translate: `${shift}px`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity: tintOpacity,\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<GlitchCutProps>({\n shader,\n fallback: GlitchCutFallback,\n});\n\nexport function glitchCut(\n props: GlitchCutProps = {},\n): TransitionPresentation<GlitchCutProps> {\n return presentation(props);\n}\n",
"type": "registry:component",
"target": "components/remocn/glitch-cut.tsx"
}
diff --git a/registry-artifacts/grain-dissolve.json b/registry-artifacts/grain-dissolve.json
index 38a0773c..f51316f3 100644
--- a/registry-artifacts/grain-dissolve.json
+++ b/registry-artifacts/grain-dissolve.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/grain-dissolve/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport {\n ShaderGrainGradient,\n type ShaderGrainGradientProps,\n} from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type GrainDissolveProps = {\n colors?: string[];\n colorBack?: string;\n shape?: NonNullable<ShaderGrainGradientProps[\"shape\"]>;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst GrainDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<GrainDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n shape = \"blob\",\n noise = 0.3,\n zoom = 2,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.14, 0.34], [1, 0], clampOpts),\n filter: `blur(${interpolate(p, [0.06, 0.34], [0, 10], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.26], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const intensity = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const softness = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = zoom * interpolate(p, [0, 1], [0.9, 1.15], clampOpts);\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.7, 0.86], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.7, 1], [1.05, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.7, 0.92], [10, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n colors={colors}\n colorBack={colorBack}\n shape={shape}\n noise={noise}\n intensity={intensity}\n softness={softness}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function grainDissolve(\n props: GrainDissolveProps = {},\n): TransitionPresentation<GrainDissolveProps> {\n return {\n component: GrainDissolvePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport {\n ShaderGrainGradient,\n type ShaderGrainGradientProps,\n} from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type GrainDissolveProps = {\n colors?: string[];\n colorBack?: string;\n shape?: NonNullable<ShaderGrainGradientProps[\"shape\"]>;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst GrainDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<GrainDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n shape = \"blob\",\n noise = 0.3,\n zoom = 2,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.14, 0.34], [1, 0], clampOpts),\n filter: `blur(${interpolate(p, [0.06, 0.34], [0, 10], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.26], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const intensity = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const softness = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = zoom * interpolate(p, [0, 1], [0.9, 1.15], clampOpts);\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.7, 0.86], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.7, 1], [1.05, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.7, 0.92], [10, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n colors={colors}\n colorBack={colorBack}\n shape={shape}\n noise={noise}\n intensity={intensity}\n softness={softness}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function grainDissolve(\n props: GrainDissolveProps = {},\n): TransitionPresentation<GrainDissolveProps> {\n return {\n component: GrainDissolvePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/grain-dissolve.tsx"
}
diff --git a/registry-artifacts/grid-wave.json b/registry-artifacts/grid-wave.json
index e337d2ad..ed8f9c41 100644
--- a/registry-artifacts/grid-wave.json
+++ b/registry-artifacts/grid-wave.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/grid-wave/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type GridWaveDirection = \"ripple\" | \"left\" | \"right\" | \"up\" | \"down\";\n\nexport type GridWaveProps = {\n tileSize?: number;\n waveWidth?: number;\n lift?: number;\n gap?: number;\n tint?: string;\n direction?: GridWaveDirection;\n};\n\nconst DEFAULTS = {\n tileSize: 90,\n waveWidth: 0.16,\n lift: 2,\n gap: 0.12,\n tint: \"#8fb4ff\",\n direction: \"ripple\" as GridWaveDirection,\n};\n\nconst AXES: Record<GridWaveDirection, [number, number]> = {\n ripple: [0, 0],\n left: [1, 0],\n right: [-1, 0],\n up: [0, -1],\n down: [0, 1],\n};\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) {\n return [0.56, 0.71, 1];\n }\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform vec2 u_grid;\nuniform float u_wave;\nuniform float u_lift;\nuniform float u_gap;\nuniform vec3 u_tint;\nuniform vec2 u_dir;\nuniform float u_radial;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat waveCoord(vec2 p) {\n vec2 off = (p - 0.5) * vec2(u_aspect, 1.0);\n float ring = length(off) / (0.5 * sqrt(u_aspect * u_aspect + 1.0));\n float sweep = clamp(dot(p - 0.5, u_dir) + 0.5, 0.0, 1.0);\n return mix(sweep, ring, u_radial);\n}\n\nvoid main() {\n float front = u_progress * (1.0 + 6.0 * u_wave) - 3.0 * u_wave;\n\n float selfPass =\n smoothstep(-u_wave * 0.4, u_wave * 0.4, front - waveCoord(v_uv));\n vec4 base = mix(texture(u_from, v_uv), texture(u_to, v_uv), selfPass);\n\n float edge = 0.5 - u_gap * 0.5;\n vec2 anchor = floor(v_uv * u_grid);\n\n vec4 face = vec4(0.0);\n float depth = -1.0;\n\n for (int oy = -1; oy <= 1; oy++) {\n for (int ox = -1; ox <= 1; ox++) {\n vec2 cell = anchor + vec2(float(ox), float(oy));\n vec2 centre = (cell + 0.5) / u_grid;\n\n float stagger = (hash(cell) - 0.5) * u_wave * 0.4;\n float w = front - waveCoord(centre) + stagger;\n float band = w / u_wave;\n float pulse = exp(-band * band);\n if (pulse <= depth) {\n continue;\n }\n\n float rise = pulse * u_lift;\n vec2 lean = centre - 0.5;\n lean = lean / max(length(lean), 0.0001) * rise * 0.15;\n float grow = 1.0 + rise * 0.5;\n\n vec2 q = (v_uv - centre) * u_grid;\n vec2 top = (q - lean) / grow;\n float onTop = max(abs(top.x), abs(top.y));\n float onFoot = max(abs(q.x), abs(q.y));\n bool lit = onTop <= edge;\n if (!lit && onFoot > edge) {\n continue;\n }\n depth = pulse;\n\n float pass = smoothstep(-u_wave * 0.4, u_wave * 0.4, w);\n vec2 local = lit ? top : clamp(top, -edge, edge);\n vec2 src = centre + local / u_grid;\n vec4 col = mix(texture(u_from, src), texture(u_to, src), pass);\n\n if (lit) {\n col.rgb = mix(col.rgb, u_tint, pulse * 0.12);\n col.rgb *= 1.0 + pulse * 0.06;\n } else {\n col.rgb = mix(col.rgb, u_tint, pulse * 0.06);\n col.rgb *= 1.0 - pulse * 0.24;\n }\n\n face = col;\n }\n }\n\n outColor = face + base * (1.0 - face.a);\n}`;\n\nconst shader = makeSceneShader<GridWaveProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, passedProps }) => {\n const {\n tileSize = DEFAULTS.tileSize,\n waveWidth = DEFAULTS.waveWidth,\n lift = DEFAULTS.lift,\n gap = DEFAULTS.gap,\n tint = DEFAULTS.tint,\n direction = DEFAULTS.direction,\n } = passedProps;\n const size = Math.max(tileSize, 8);\n const axis = AXES[direction] ?? AXES[DEFAULTS.direction];\n const rgb = hexToRgb(tint);\n gl.uniform2f(\n uniform(\"u_grid\"),\n Math.max(Math.round(width / size), 2),\n Math.max(Math.round(height / size), 2),\n );\n gl.uniform1f(uniform(\"u_wave\"), Math.max(waveWidth, 0.02));\n gl.uniform1f(uniform(\"u_lift\"), Math.max(lift, 0) * 0.35);\n gl.uniform1f(uniform(\"u_gap\"), Math.min(Math.max(gap, 0), 0.45));\n gl.uniform3f(uniform(\"u_tint\"), rgb[0], rgb[1], rgb[2]);\n gl.uniform2f(uniform(\"u_dir\"), axis[0], axis[1]);\n gl.uniform1f(uniform(\"u_radial\"), direction === \"ripple\" ? 1 : 0);\n },\n);\n\nconst GridWaveFallback: React.FC<\n TransitionPresentationComponentProps<GridWaveProps>\n> = ({ children, presentationProgress, presentationDirection }) => {\n const p = presentationProgress;\n\n if (presentationDirection === \"exiting\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const reveal = Math.min(1, Math.max(0, (p - 0.2) / 0.6));\n\n return (\n <AbsoluteFill\n style={{\n opacity: reveal,\n transform: `scale(${1.04 - reveal * 0.04})`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<GridWaveProps>({\n shader,\n fallback: GridWaveFallback,\n});\n\nexport function gridWave(\n props: GridWaveProps = {},\n): TransitionPresentation<GridWaveProps> {\n return presentation(props);\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n makeCanvasPresentation,\n makeSceneShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type GridWaveDirection = \"ripple\" | \"left\" | \"right\" | \"up\" | \"down\";\n\nexport type GridWaveProps = {\n tileSize?: number;\n waveWidth?: number;\n lift?: number;\n gap?: number;\n tint?: string;\n direction?: GridWaveDirection;\n};\n\nconst DEFAULTS = {\n tileSize: 90,\n waveWidth: 0.16,\n lift: 2,\n gap: 0.12,\n tint: \"#8fb4ff\",\n direction: \"ripple\" as GridWaveDirection,\n};\n\nconst AXES: Record<GridWaveDirection, [number, number]> = {\n ripple: [0, 0],\n left: [1, 0],\n right: [-1, 0],\n up: [0, -1],\n down: [0, 1],\n};\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) {\n return [0.56, 0.71, 1];\n }\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_from;\nuniform sampler2D u_to;\nuniform float u_progress;\nuniform float u_aspect;\nuniform vec2 u_grid;\nuniform float u_wave;\nuniform float u_lift;\nuniform float u_gap;\nuniform vec3 u_tint;\nuniform vec2 u_dir;\nuniform float u_radial;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat waveCoord(vec2 p) {\n vec2 off = (p - 0.5) * vec2(u_aspect, 1.0);\n float ring = length(off) / (0.5 * sqrt(u_aspect * u_aspect + 1.0));\n float sweep = clamp(dot(p - 0.5, u_dir) + 0.5, 0.0, 1.0);\n return mix(sweep, ring, u_radial);\n}\n\nvoid main() {\n float front = u_progress * (1.0 + 6.0 * u_wave) - 3.0 * u_wave;\n\n float selfPass =\n smoothstep(-u_wave * 0.4, u_wave * 0.4, front - waveCoord(v_uv));\n vec4 base = mix(texture(u_from, v_uv), texture(u_to, v_uv), selfPass);\n\n float edge = 0.5 - u_gap * 0.5;\n vec2 anchor = floor(v_uv * u_grid);\n\n vec4 face = vec4(0.0);\n float depth = -1.0;\n\n for (int oy = -1; oy <= 1; oy++) {\n for (int ox = -1; ox <= 1; ox++) {\n vec2 cell = anchor + vec2(float(ox), float(oy));\n vec2 centre = (cell + 0.5) / u_grid;\n\n float stagger = (hash(cell) - 0.5) * u_wave * 0.4;\n float w = front - waveCoord(centre) + stagger;\n float band = w / u_wave;\n float pulse = exp(-band * band);\n if (pulse <= depth) {\n continue;\n }\n\n float rise = pulse * u_lift;\n vec2 lean = centre - 0.5;\n lean = lean / max(length(lean), 0.0001) * rise * 0.15;\n float grow = 1.0 + rise * 0.5;\n\n vec2 q = (v_uv - centre) * u_grid;\n vec2 top = (q - lean) / grow;\n float onTop = max(abs(top.x), abs(top.y));\n float onFoot = max(abs(q.x), abs(q.y));\n bool lit = onTop <= edge;\n if (!lit && onFoot > edge) {\n continue;\n }\n depth = pulse;\n\n float pass = smoothstep(-u_wave * 0.4, u_wave * 0.4, w);\n vec2 local = lit ? top : clamp(top, -edge, edge);\n vec2 src = centre + local / u_grid;\n vec4 col = mix(texture(u_from, src), texture(u_to, src), pass);\n\n if (lit) {\n col.rgb = mix(col.rgb, u_tint, pulse * 0.12);\n col.rgb *= 1.0 + pulse * 0.06;\n } else {\n col.rgb = mix(col.rgb, u_tint, pulse * 0.06);\n col.rgb *= 1.0 - pulse * 0.24;\n }\n\n face = col;\n }\n }\n\n outColor = face + base * (1.0 - face.a);\n}`;\n\nconst shader = makeSceneShader<GridWaveProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, passedProps }) => {\n const {\n tileSize = DEFAULTS.tileSize,\n waveWidth = DEFAULTS.waveWidth,\n lift = DEFAULTS.lift,\n gap = DEFAULTS.gap,\n tint = DEFAULTS.tint,\n direction = DEFAULTS.direction,\n } = passedProps;\n const size = Math.max(tileSize, 8);\n const axis = AXES[direction] ?? AXES[DEFAULTS.direction];\n const rgb = hexToRgb(tint);\n gl.uniform2f(\n uniform(\"u_grid\"),\n Math.max(Math.round(width / size), 2),\n Math.max(Math.round(height / size), 2),\n );\n gl.uniform1f(uniform(\"u_wave\"), Math.max(waveWidth, 0.02));\n gl.uniform1f(uniform(\"u_lift\"), Math.max(lift, 0) * 0.35);\n gl.uniform1f(uniform(\"u_gap\"), Math.min(Math.max(gap, 0), 0.45));\n gl.uniform3f(uniform(\"u_tint\"), rgb[0], rgb[1], rgb[2]);\n gl.uniform2f(uniform(\"u_dir\"), axis[0], axis[1]);\n gl.uniform1f(uniform(\"u_radial\"), direction === \"ripple\" ? 1 : 0);\n },\n);\n\nconst GridWaveFallback: React.FC<\n TransitionPresentationComponentProps<GridWaveProps>\n> = ({ children, presentationProgress, presentationDirection }) => {\n const p = presentationProgress;\n\n if (presentationDirection === \"exiting\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const reveal = Math.min(1, Math.max(0, (p - 0.2) / 0.6));\n\n return (\n <AbsoluteFill\n style={{\n opacity: reveal,\n scale: `${1.04 - reveal * 0.04}`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nconst presentation = makeCanvasPresentation<GridWaveProps>({\n shader,\n fallback: GridWaveFallback,\n});\n\nexport function gridWave(\n props: GridWaveProps = {},\n): TransitionPresentation<GridWaveProps> {\n return presentation(props);\n}\n",
"type": "registry:component",
"target": "components/remocn/grid-wave.tsx"
}
diff --git a/registry-artifacts/hand-count.json b/registry-artifacts/hand-count.json
index 99c00123..13d355e6 100644
--- a/registry-artifacts/hand-count.json
+++ b/registry-artifacts/hand-count.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/hand-count/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Caveat\";\nimport { useCurrentFrame } from \"remotion\";\nimport {\n DEFAULT_STEP,\n hashRange,\n qstep,\n steppedRamp,\n} from \"@/lib/remocn/stop-motion\";\n\nconst { fontFamily: HAND_FAMILY } = loadFont(\"normal\", {\n subsets: [\"latin\"],\n weights: [\"400\", \"500\", \"600\", \"700\"],\n});\n\nconst easeOutCubic = (t: number) => 1 - (1 - t) ** 3;\n\nconst easeInOutCubic = (t: number) =>\n t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2;\n\nconst DEFAULT_DURATION_STEPS = 18;\n\nexport type HandCountEase = \"in-out\" | \"out\" | \"linear\";\n\nconst EASES: Record<HandCountEase, (t: number) => number> = {\n \"in-out\": easeInOutCubic,\n out: easeOutCubic,\n linear: (t: number) => t,\n};\n\nexport type HandCountTiming = {\n delay?: number;\n durationSteps?: number;\n step?: number;\n};\n\nexport function handCountDuration(options?: HandCountTiming): number {\n const delay = options?.delay ?? 0;\n const durationSteps = options?.durationSteps ?? DEFAULT_DURATION_STEPS;\n const step = options?.step ?? DEFAULT_STEP;\n const end = delay + durationSteps * step;\n return Math.ceil(end / step) * step;\n}\n\nexport function handCountValue(\n args: HandCountTiming & {\n frame: number;\n to: number;\n from?: number;\n ease?: HandCountEase;\n },\n): number {\n const from = args.from ?? 0;\n const delay = args.delay ?? 0;\n const durationSteps = args.durationSteps ?? DEFAULT_DURATION_STEPS;\n const step = args.step ?? DEFAULT_STEP;\n const progress = steppedRamp(\n args.frame,\n delay,\n delay + durationSteps * step,\n {\n ease: EASES[args.ease ?? \"in-out\"],\n step,\n },\n );\n return from + (args.to - from) * progress;\n}\n\nexport function handCountText(\n value: number,\n options?: { decimals?: number; prefix?: string; suffix?: string },\n): string {\n return `${options?.prefix ?? \"\"}${value.toFixed(options?.decimals ?? 0)}${options?.suffix ?? \"\"}`;\n}\n\nexport function handCountPose(\n frame: number,\n options?: HandCountTiming,\n): number {\n const step = options?.step ?? DEFAULT_STEP;\n const settled = handCountDuration(options);\n return Math.min(qstep(Math.max(0, frame), step), qstep(settled, step));\n}\n\nexport function handCountJitter(\n args: HandCountTiming & { frame: number; index: number; seed?: string },\n): { rot: number; dy: number } {\n const seed = args.seed ?? \"count\";\n const pose = handCountPose(args.frame, args);\n return {\n rot: hashRange(`${seed}:${pose}:${args.index}:r`, -3.2, 3.2),\n dy: hashRange(`${seed}:${pose}:${args.index}:y`, -1.8, 1.8),\n };\n}\n\nexport interface HandCountProps {\n to: number;\n from?: number;\n delay?: number;\n durationSteps?: number;\n decimals?: number;\n prefix?: string;\n suffix?: string;\n fontSize?: number;\n color?: string;\n weight?: 400 | 500 | 600 | 700;\n ease?: HandCountEase;\n align?: \"left\" | \"center\";\n fontFamily?: string;\n seed?: string;\n step?: number;\n}\n\nexport function HandCount({\n to,\n from = 0,\n delay = 0,\n durationSteps = DEFAULT_DURATION_STEPS,\n decimals = 0,\n prefix = \"\",\n suffix = \"\",\n fontSize = 96,\n color = \"#26242c\",\n weight = 700,\n ease = \"in-out\",\n align = \"center\",\n fontFamily = HAND_FAMILY,\n seed = \"count\",\n step = DEFAULT_STEP,\n}: HandCountProps) {\n const frame = useCurrentFrame();\n const value = handCountValue({\n frame,\n to,\n from,\n delay,\n durationSteps,\n step,\n ease,\n });\n const chars = Array.from(handCountText(value, { decimals, prefix, suffix }));\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: align === \"center\" ? \"center\" : \"flex-start\",\n background: \"transparent\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n fontFamily: `${fontFamily}, cursive`,\n fontWeight: weight,\n fontSize,\n lineHeight: 1.15,\n color,\n whiteSpace: \"pre\",\n textAlign: align,\n }}\n >\n {chars.map((char, i) => {\n const { rot, dy } = handCountJitter({\n frame,\n index: i,\n seed,\n delay,\n durationSteps,\n step,\n });\n return (\n <span\n key={`${i}:${char}`}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n transform: `translateY(${dy}px) rotate(${rot}deg)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Caveat\";\nimport { useCurrentFrame } from \"remotion\";\nimport {\n DEFAULT_STEP,\n hashRange,\n qstep,\n steppedRamp,\n} from \"@/lib/remocn/stop-motion\";\n\nconst { fontFamily: HAND_FAMILY } = loadFont(\"normal\", {\n subsets: [\"latin\"],\n weights: [\"400\", \"500\", \"600\", \"700\"],\n});\n\nconst easeOutCubic = (t: number) => 1 - (1 - t) ** 3;\n\nconst easeInOutCubic = (t: number) =>\n t < 0.5 ? 4 * t ** 3 : 1 - (-2 * t + 2) ** 3 / 2;\n\nconst DEFAULT_DURATION_STEPS = 18;\n\nexport type HandCountEase = \"in-out\" | \"out\" | \"linear\";\n\nconst EASES: Record<HandCountEase, (t: number) => number> = {\n \"in-out\": easeInOutCubic,\n out: easeOutCubic,\n linear: (t: number) => t,\n};\n\nexport type HandCountTiming = {\n delay?: number;\n durationSteps?: number;\n step?: number;\n};\n\nexport function handCountDuration(options?: HandCountTiming): number {\n const delay = options?.delay ?? 0;\n const durationSteps = options?.durationSteps ?? DEFAULT_DURATION_STEPS;\n const step = options?.step ?? DEFAULT_STEP;\n const end = delay + durationSteps * step;\n return Math.ceil(end / step) * step;\n}\n\nexport function handCountValue(\n args: HandCountTiming & {\n frame: number;\n to: number;\n from?: number;\n ease?: HandCountEase;\n },\n): number {\n const from = args.from ?? 0;\n const delay = args.delay ?? 0;\n const durationSteps = args.durationSteps ?? DEFAULT_DURATION_STEPS;\n const step = args.step ?? DEFAULT_STEP;\n const progress = steppedRamp(\n args.frame,\n delay,\n delay + durationSteps * step,\n {\n ease: EASES[args.ease ?? \"in-out\"],\n step,\n },\n );\n return from + (args.to - from) * progress;\n}\n\nexport function handCountText(\n value: number,\n options?: { decimals?: number; prefix?: string; suffix?: string },\n): string {\n return `${options?.prefix ?? \"\"}${value.toFixed(options?.decimals ?? 0)}${options?.suffix ?? \"\"}`;\n}\n\nexport function handCountPose(\n frame: number,\n options?: HandCountTiming,\n): number {\n const step = options?.step ?? DEFAULT_STEP;\n const settled = handCountDuration(options);\n return Math.min(qstep(Math.max(0, frame), step), qstep(settled, step));\n}\n\nexport function handCountJitter(\n args: HandCountTiming & { frame: number; index: number; seed?: string },\n): { rot: number; dy: number } {\n const seed = args.seed ?? \"count\";\n const pose = handCountPose(args.frame, args);\n return {\n rot: hashRange(`${seed}:${pose}:${args.index}:r`, -3.2, 3.2),\n dy: hashRange(`${seed}:${pose}:${args.index}:y`, -1.8, 1.8),\n };\n}\n\nexport interface HandCountProps {\n to: number;\n from?: number;\n delay?: number;\n durationSteps?: number;\n decimals?: number;\n prefix?: string;\n suffix?: string;\n fontSize?: number;\n color?: string;\n weight?: 400 | 500 | 600 | 700;\n ease?: HandCountEase;\n align?: \"left\" | \"center\";\n fontFamily?: string;\n seed?: string;\n step?: number;\n}\n\nexport function HandCount({\n to,\n from = 0,\n delay = 0,\n durationSteps = DEFAULT_DURATION_STEPS,\n decimals = 0,\n prefix = \"\",\n suffix = \"\",\n fontSize = 96,\n color = \"#26242c\",\n weight = 700,\n ease = \"in-out\",\n align = \"center\",\n fontFamily = HAND_FAMILY,\n seed = \"count\",\n step = DEFAULT_STEP,\n}: HandCountProps) {\n const frame = useCurrentFrame();\n const value = handCountValue({\n frame,\n to,\n from,\n delay,\n durationSteps,\n step,\n ease,\n });\n const chars = Array.from(handCountText(value, { decimals, prefix, suffix }));\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: align === \"center\" ? \"center\" : \"flex-start\",\n background: \"transparent\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n fontFamily: `${fontFamily}, cursive`,\n fontWeight: weight,\n fontSize,\n lineHeight: 1.15,\n color,\n whiteSpace: \"pre\",\n textAlign: align,\n }}\n >\n {chars.map((char, i) => {\n const { rot, dy } = handCountJitter({\n frame,\n index: i,\n seed,\n delay,\n durationSteps,\n step,\n });\n return (\n <span\n key={`${i}:${char}`}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n translate: `0 ${dy}px`,\n rotate: `${rot}deg`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/hand-count.tsx"
}
diff --git a/registry-artifacts/handwrite.json b/registry-artifacts/handwrite.json
index 6c22f590..9fab359a 100644
--- a/registry-artifacts/handwrite.json
+++ b/registry-artifacts/handwrite.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/handwrite/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Caveat\";\nimport { useCurrentFrame } from \"remotion\";\nimport { DEFAULT_STEP, hashRange, qf, qstep } from \"@/lib/remocn/stop-motion\";\n\nconst { fontFamily: HAND_FAMILY } = loadFont(\"normal\", {\n subsets: [\"latin\"],\n weights: [\"400\", \"500\", \"600\", \"700\"],\n});\n\nexport interface HandwriteProps {\n text: string;\n fontSize?: number;\n color?: string;\n delay?: number;\n perStep?: number;\n weight?: 400 | 500 | 600 | 700;\n align?: \"left\" | \"center\";\n fontFamily?: string;\n step?: number;\n}\n\nexport function Handwrite({\n text,\n fontSize = 54,\n color = \"#26242c\",\n delay = 0,\n perStep = 1.6,\n weight = 600,\n align = \"center\",\n fontFamily = HAND_FAMILY,\n step = DEFAULT_STEP,\n}: HandwriteProps) {\n const frame = useCurrentFrame();\n const steps = Math.max(0, qstep(Math.max(0, qf(frame, step) - delay), step));\n const shown = Math.floor(steps * perStep);\n const chars = Array.from(text);\n const freshFrom = shown - Math.ceil(perStep);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: align === \"center\" ? \"center\" : \"flex-start\",\n background: \"transparent\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n fontFamily: `${fontFamily}, cursive`,\n fontWeight: weight,\n fontSize,\n lineHeight: 1.15,\n color,\n whiteSpace: \"pre-wrap\",\n textAlign: align,\n }}\n >\n {chars.map((char, i) => {\n const visible = i < shown;\n const slant = hashRange(`hw:${text}:${i}:r`, -3.2, 3.2);\n const dy = hashRange(`hw:${text}:${i}:y`, -1.8, 1.8);\n const fresh = visible && i >= freshFrom;\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n opacity: visible ? 1 : 0,\n transform: visible\n ? `translateY(${dy}px) rotate(${slant}deg) scale(${fresh ? 1.06 : 1})`\n : undefined,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nexport function handwriteDuration(\n text: string,\n options?: { perStep?: number; step?: number },\n): number {\n const perStep = options?.perStep ?? 1.6;\n const step = options?.step ?? DEFAULT_STEP;\n return Math.ceil(Array.from(text).length / perStep) * step + step;\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Caveat\";\nimport { useCurrentFrame } from \"remotion\";\nimport { DEFAULT_STEP, hashRange, qf, qstep } from \"@/lib/remocn/stop-motion\";\n\nconst { fontFamily: HAND_FAMILY } = loadFont(\"normal\", {\n subsets: [\"latin\"],\n weights: [\"400\", \"500\", \"600\", \"700\"],\n});\n\nexport interface HandwriteProps {\n text: string;\n fontSize?: number;\n color?: string;\n delay?: number;\n perStep?: number;\n weight?: 400 | 500 | 600 | 700;\n align?: \"left\" | \"center\";\n fontFamily?: string;\n step?: number;\n}\n\nexport function Handwrite({\n text,\n fontSize = 54,\n color = \"#26242c\",\n delay = 0,\n perStep = 1.6,\n weight = 600,\n align = \"center\",\n fontFamily = HAND_FAMILY,\n step = DEFAULT_STEP,\n}: HandwriteProps) {\n const frame = useCurrentFrame();\n const steps = Math.max(0, qstep(Math.max(0, qf(frame, step) - delay), step));\n const shown = Math.floor(steps * perStep);\n const chars = Array.from(text);\n const freshFrom = shown - Math.ceil(perStep);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: align === \"center\" ? \"center\" : \"flex-start\",\n background: \"transparent\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n fontFamily: `${fontFamily}, cursive`,\n fontWeight: weight,\n fontSize,\n lineHeight: 1.15,\n color,\n whiteSpace: \"pre-wrap\",\n textAlign: align,\n }}\n >\n {chars.map((char, i) => {\n const visible = i < shown;\n const slant = hashRange(`hw:${text}:${i}:r`, -3.2, 3.2);\n const dy = hashRange(`hw:${text}:${i}:y`, -1.8, 1.8);\n const fresh = visible && i >= freshFrom;\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n opacity: visible ? 1 : 0,\n translate: visible ? `0 ${dy}px` : undefined,\n rotate: visible ? `${slant}deg` : undefined,\n scale: visible ? `${fresh ? 1.06 : 1}` : undefined,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nexport function handwriteDuration(\n text: string,\n options?: { perStep?: number; step?: number },\n): number {\n const perStep = options?.perStep ?? 1.6;\n const step = options?.step ?? DEFAULT_STEP;\n return Math.ceil(Array.from(text).length / perStep) * step + step;\n}\n",
"type": "registry:component",
"target": "components/remocn/handwrite.tsx"
}
diff --git a/registry-artifacts/icon-scatter.json b/registry-artifacts/icon-scatter.json
index 85a9126d..d289e097 100644
--- a/registry-artifacts/icon-scatter.json
+++ b/registry-artifacts/icon-scatter.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/icon-scatter/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate, random } from \"remotion\";\n\n// ===========================================================================\n// icon-scatter — a scene change made of icons.\n//\n// The outgoing scene shatters into a deterministic field of line-icons that\n// draw themselves on, spin, and scatter outward; at mid-transition the field\n// is densest and covers the swap; then the icons fly off and draw away as the\n// incoming scene resolves through them. Motion-forward and self-contained —\n// the paths are inlined, the draw-on is CSS `pathLength` only, so the\n// transition ships as one file with no icon dependencies.\n//\n// Pace it with `linearTiming`/`springTiming` like any presentation. Reads\n// best over ~16–26 frames.\n// ===========================================================================\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// Single-path Lucide-style glyphs (viewBox 0 0 24 24) — each draws cleanly\n// from one continuous stroke via a normalized dashoffset.\nconst ICON_PATHS: string[] = [\n // star\n \"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\",\n // heart\n \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\",\n // zap\n \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\",\n // sparkles\n \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\",\n // moon\n \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n // play\n \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\",\n // crown\n \"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\",\n // circle\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\",\n // square (rounded)\n \"M7 4h10a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3z\",\n // triangle\n \"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3z\",\n // plus\n \"M12 5v14 M5 12h14\",\n];\n\nexport type IconScatterProps = {\n /** How many icons populate the field. Default 15. */\n count?: number;\n /** Icon stroke color. Default near-white ink. */\n color?: string;\n /** The fill that hides the swap at the field's peak. Default warm obsidian. */\n coverColor?: string;\n /** Peak opacity of the cover fill (0–1). Lower = more of the swap shows. */\n coverOpacity?: number;\n /** Stroke width of the icons, in their 24px viewBox units. Default 2. */\n strokeWidth?: number;\n /** How far icons fly on scatter, in px. Default 260. */\n flyDistance?: number;\n /** Seed so two scatters in one video can differ. Default \"icon-scatter\". */\n seed?: string;\n};\n\ntype Placed = {\n path: string;\n xPct: number;\n yPct: number;\n size: number;\n spin: number; // degrees swept over the whole transition\n dir: number; // outward scatter angle offset\n strokeOpacity: number;\n pStart: number; // when this icon begins drawing (p-space)\n pOut: number; // when this icon begins flying out (p-space)\n};\n\n// Jittered grid so the field reads as scattered but never clumps or overlaps.\nfunction placeIcons(count: number, seed: string): Placed[] {\n const cols = Math.ceil(Math.sqrt((count * 16) / 9));\n const rows = Math.ceil(count / cols);\n const out: Placed[] = [];\n for (let i = 0; i < count; i++) {\n const col = i % cols;\n const row = Math.floor(i / cols);\n const cellW = 100 / cols;\n const cellH = 100 / rows;\n const jx = (random(`${seed}-jx-${i}`) - 0.5) * cellW * 0.7;\n const jy = (random(`${seed}-jy-${i}`) - 0.5) * cellH * 0.7;\n out.push({\n path: ICON_PATHS[\n Math.floor(random(`${seed}-p-${i}`) * ICON_PATHS.length)\n ],\n xPct: cellW * (col + 0.5) + jx,\n yPct: cellH * (row + 0.5) + jy,\n size: 34 + random(`${seed}-s-${i}`) * 40,\n spin: (random(`${seed}-r-${i}`) - 0.5) * 320,\n dir: (random(`${seed}-d-${i}`) - 0.5) * 1.2,\n strokeOpacity: 0.5 + random(`${seed}-o-${i}`) * 0.5,\n pStart: random(`${seed}-a-${i}`) * 0.16,\n pOut: 0.52 + random(`${seed}-b-${i}`) * 0.16,\n });\n }\n return out;\n}\n\nconst IconField: React.FC<{\n p: number;\n placed: Placed[];\n color: string;\n strokeWidth: number;\n flyDistance: number;\n}> = ({ p, placed, color, strokeWidth, flyDistance }) => (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {placed.map((icon, i) => {\n // Draw on over ~0.34 of p from the icon's start, then fly out.\n const draw = interpolate(p, [icon.pStart, icon.pStart + 0.34], [0, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n });\n const scaleIn = interpolate(\n p,\n [icon.pStart, icon.pStart + 0.3],\n [0.4, 1],\n {\n ...clampOpts,\n easing: Easing.out(Easing.back(1.6)),\n },\n );\n const outP = interpolate(p, [icon.pOut, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n });\n\n // Scatter outward from the frame center, along the icon's own radial.\n const cx = icon.xPct - 50;\n const cy = icon.yPct - 50;\n const angle = Math.atan2(cy, cx) + icon.dir;\n const fly = outP * flyDistance;\n const tx = Math.cos(angle) * fly;\n const ty = Math.sin(angle) * fly;\n\n const spin =\n icon.spin * interpolate(p, [icon.pStart, 1], [0, 1], clampOpts);\n const opacity = Math.min(draw, 1 - outP) * icon.strokeOpacity;\n if (opacity <= 0.001) return null;\n\n return (\n <svg\n key={i}\n width={icon.size}\n height={icon.size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n position: \"absolute\",\n left: `${icon.xPct}%`,\n top: `${icon.yPct}%`,\n opacity,\n overflow: \"visible\",\n transform: `translate(-50%, -50%) translate(${tx}px, ${ty}px) scale(${\n scaleIn * (1 - outP * 0.3)\n }) rotate(${spin}deg)`,\n }}\n >\n <path\n d={icon.path}\n pathLength={1}\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n />\n </svg>\n );\n })}\n </AbsoluteFill>\n);\n\nconst IconScatterPresentation: React.FC<\n TransitionPresentationComponentProps<IconScatterProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n count = 15,\n color = \"#fafafa\",\n coverColor = \"#0a0a0a\",\n coverOpacity = 0.92,\n strokeWidth = 2,\n flyDistance = 260,\n seed = \"icon-scatter\",\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n // The outgoing scene sinks back and blurs as the field rises over it.\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.28, 0.5], [1, 0], clampOpts),\n transform: `scale(${interpolate(p, [0, 0.5], [1, 0.94], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.1, 0.45], [0, 10], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const placed = placeIcons(count, seed);\n\n // The incoming scene resolves once the field starts clearing.\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.5, 0.68], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.5, 1], [1.06, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.5, 0.72], [8, 0], clampOpts)}px)`,\n };\n\n // The cover fill hides the swap while the field is densest.\n const cover = interpolate(p, [0, 0.3, 0.62, 0.9], [0, 1, 1, 0], clampOpts);\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n <AbsoluteFill\n style={{\n background: coverColor,\n opacity: cover * coverOpacity,\n pointerEvents: \"none\",\n }}\n />\n <IconField\n p={p}\n placed={placed}\n color={color}\n strokeWidth={strokeWidth}\n flyDistance={flyDistance}\n />\n </AbsoluteFill>\n );\n};\n\nexport function iconScatter(\n props: IconScatterProps = {},\n): TransitionPresentation<IconScatterProps> {\n return {\n component: IconScatterPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate, random } from \"remotion\";\n\n// ===========================================================================\n// icon-scatter — a scene change made of icons.\n//\n// The outgoing scene shatters into a deterministic field of line-icons that\n// draw themselves on, spin, and scatter outward; at mid-transition the field\n// is densest and covers the swap; then the icons fly off and draw away as the\n// incoming scene resolves through them. Motion-forward and self-contained —\n// the paths are inlined, the draw-on is CSS `pathLength` only, so the\n// transition ships as one file with no icon dependencies.\n//\n// Pace it with `linearTiming`/`springTiming` like any presentation. Reads\n// best over ~16–26 frames.\n// ===========================================================================\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// Single-path Lucide-style glyphs (viewBox 0 0 24 24) — each draws cleanly\n// from one continuous stroke via a normalized dashoffset.\nconst ICON_PATHS: string[] = [\n // star\n \"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z\",\n // heart\n \"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5\",\n // zap\n \"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z\",\n // sparkles\n \"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z\",\n // moon\n \"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401\",\n // play\n \"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z\",\n // crown\n \"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z\",\n // circle\n \"M12 2 A10 10 0 0 1 22 12 A10 10 0 0 1 12 22 A10 10 0 0 1 2 12 A10 10 0 0 1 12 2\",\n // square (rounded)\n \"M7 4h10a3 3 0 0 1 3 3v10a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3z\",\n // triangle\n \"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3z\",\n // plus\n \"M12 5v14 M5 12h14\",\n];\n\nexport type IconScatterProps = {\n /** How many icons populate the field. Default 15. */\n count?: number;\n /** Icon stroke color. Default near-white ink. */\n color?: string;\n /** The fill that hides the swap at the field's peak. Default warm obsidian. */\n coverColor?: string;\n /** Peak opacity of the cover fill (0–1). Lower = more of the swap shows. */\n coverOpacity?: number;\n /** Stroke width of the icons, in their 24px viewBox units. Default 2. */\n strokeWidth?: number;\n /** How far icons fly on scatter, in px. Default 260. */\n flyDistance?: number;\n /** Seed so two scatters in one video can differ. Default \"icon-scatter\". */\n seed?: string;\n};\n\ntype Placed = {\n path: string;\n xPct: number;\n yPct: number;\n size: number;\n spin: number; // degrees swept over the whole transition\n dir: number; // outward scatter angle offset\n strokeOpacity: number;\n pStart: number; // when this icon begins drawing (p-space)\n pOut: number; // when this icon begins flying out (p-space)\n};\n\n// Jittered grid so the field reads as scattered but never clumps or overlaps.\nfunction placeIcons(count: number, seed: string): Placed[] {\n const cols = Math.ceil(Math.sqrt((count * 16) / 9));\n const rows = Math.ceil(count / cols);\n const out: Placed[] = [];\n for (let i = 0; i < count; i++) {\n const col = i % cols;\n const row = Math.floor(i / cols);\n const cellW = 100 / cols;\n const cellH = 100 / rows;\n const jx = (random(`${seed}-jx-${i}`) - 0.5) * cellW * 0.7;\n const jy = (random(`${seed}-jy-${i}`) - 0.5) * cellH * 0.7;\n out.push({\n path: ICON_PATHS[\n Math.floor(random(`${seed}-p-${i}`) * ICON_PATHS.length)\n ],\n xPct: cellW * (col + 0.5) + jx,\n yPct: cellH * (row + 0.5) + jy,\n size: 34 + random(`${seed}-s-${i}`) * 40,\n spin: (random(`${seed}-r-${i}`) - 0.5) * 320,\n dir: (random(`${seed}-d-${i}`) - 0.5) * 1.2,\n strokeOpacity: 0.5 + random(`${seed}-o-${i}`) * 0.5,\n pStart: random(`${seed}-a-${i}`) * 0.16,\n pOut: 0.52 + random(`${seed}-b-${i}`) * 0.16,\n });\n }\n return out;\n}\n\nconst IconField: React.FC<{\n p: number;\n placed: Placed[];\n color: string;\n strokeWidth: number;\n flyDistance: number;\n}> = ({ p, placed, color, strokeWidth, flyDistance }) => (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {placed.map((icon, i) => {\n // Draw on over ~0.34 of p from the icon's start, then fly out.\n const draw = interpolate(p, [icon.pStart, icon.pStart + 0.34], [0, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n });\n const scaleIn = interpolate(\n p,\n [icon.pStart, icon.pStart + 0.3],\n [0.4, 1],\n {\n ...clampOpts,\n easing: Easing.out(Easing.back(1.6)),\n },\n );\n const outP = interpolate(p, [icon.pOut, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n });\n\n // Scatter outward from the frame center, along the icon's own radial.\n const cx = icon.xPct - 50;\n const cy = icon.yPct - 50;\n const angle = Math.atan2(cy, cx) + icon.dir;\n const fly = outP * flyDistance;\n const tx = Math.cos(angle) * fly;\n const ty = Math.sin(angle) * fly;\n\n const spin =\n icon.spin * interpolate(p, [icon.pStart, 1], [0, 1], clampOpts);\n const opacity = Math.min(draw, 1 - outP) * icon.strokeOpacity;\n if (opacity <= 0.001) return null;\n\n return (\n <svg\n key={i}\n width={icon.size}\n height={icon.size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n style={{\n position: \"absolute\",\n left: `${icon.xPct}%`,\n top: `${icon.yPct}%`,\n opacity,\n overflow: \"visible\",\n transform: `translate(-50%, -50%) translate(${tx}px, ${ty}px) scale(${\n scaleIn * (1 - outP * 0.3)\n }) rotate(${spin}deg)`,\n }}\n >\n <path\n d={icon.path}\n pathLength={1}\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n />\n </svg>\n );\n })}\n </AbsoluteFill>\n);\n\nconst IconScatterPresentation: React.FC<\n TransitionPresentationComponentProps<IconScatterProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n count = 15,\n color = \"#fafafa\",\n coverColor = \"#0a0a0a\",\n coverOpacity = 0.92,\n strokeWidth = 2,\n flyDistance = 260,\n seed = \"icon-scatter\",\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n // The outgoing scene sinks back and blurs as the field rises over it.\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.28, 0.5], [1, 0], clampOpts),\n scale: `${interpolate(p, [0, 0.5], [1, 0.94], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.1, 0.45], [0, 10], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const placed = placeIcons(count, seed);\n\n // The incoming scene resolves once the field starts clearing.\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.5, 0.68], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.5, 1], [1.06, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.5, 0.72], [8, 0], clampOpts)}px)`,\n };\n\n // The cover fill hides the swap while the field is densest.\n const cover = interpolate(p, [0, 0.3, 0.62, 0.9], [0, 1, 1, 0], clampOpts);\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n <AbsoluteFill\n style={{\n background: coverColor,\n opacity: cover * coverOpacity,\n pointerEvents: \"none\",\n }}\n />\n <IconField\n p={p}\n placed={placed}\n color={color}\n strokeWidth={strokeWidth}\n flyDistance={flyDistance}\n />\n </AbsoluteFill>\n );\n};\n\nexport function iconScatter(\n props: IconScatterProps = {},\n): TransitionPresentation<IconScatterProps> {\n return {\n component: IconScatterPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/icon-scatter.tsx"
}
diff --git a/registry-artifacts/infinite-bento-pan.json b/registry-artifacts/infinite-bento-pan.json
index be372579..1180619a 100644
--- a/registry-artifacts/infinite-bento-pan.json
+++ b/registry-artifacts/infinite-bento-pan.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/infinite-bento-pan/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nexport function InfiniteBentoPan({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n transform: `translate(${-px}px, ${-py}px)`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nexport function InfiniteBentoPan({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n translate: `${-px}px ${-py}px`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/infinite-bento-pan.tsx"
}
diff --git a/registry-artifacts/infinite-marquee.json b/registry-artifacts/infinite-marquee.json
index feb96902..219df788 100644
--- a/registry-artifacts/infinite-marquee.json
+++ b/registry-artifacts/infinite-marquee.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/infinite-marquee/index.tsx",
- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nexport function InfiniteMarquee({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nexport function InfiniteMarquee({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n translate: `${offset}px`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/infinite-marquee.tsx"
}
diff --git a/registry-artifacts/lens-zoom.json b/registry-artifacts/lens-zoom.json
index 836f8c18..4a9af26e 100644
--- a/registry-artifacts/lens-zoom.json
+++ b/registry-artifacts/lens-zoom.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/lens-zoom/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type { ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport const LENS_ZOOM_DURATION_IN_FRAMES = 28;\n\nexport const SHAKE_STOPS = [-9 / 11, -3 / 11, 4 / 11, 8 / 11] as const;\n\nexport const LENS_ZOOM_EASE_IN = Easing.bezier(0.54, 0, 0.82, 0.8);\nexport const LENS_ZOOM_EASE_OUT = Easing.bezier(0.18, 0.2, 0.46, 1);\n\nexport type LensZoomProps = {\n inScaleFrom?: number;\n inScaleTo?: number;\n inFovFrom?: number;\n inFovTo?: number;\n inBlurFrom?: number;\n inBlurTo?: number;\n inRotationFrom?: number;\n inRotationTo?: number;\n outScaleFrom?: number;\n outScaleTo?: number;\n outFovFrom?: number;\n outFovTo?: number;\n outBlurFrom?: number;\n outBlurTo?: number;\n outRotationFrom?: number;\n outRotationTo?: number;\n anticipateScale?: number;\n anticipatePortion?: number;\n lensSteps?: number;\n blurSamples?: number;\n blurScaleGain?: number;\n blurFade?: number;\n shakeAmount?: number;\n shakeFrequency?: number;\n shakeCyclesPerUnit?: number;\n shakeTranslatePx?: number;\n shakeRotateDeg?: number;\n redScale?: number;\n greenScale?: number;\n blueScale?: number;\n letterboxAspect?: number;\n width?: number;\n height?: number;\n distortionCenterX?: number;\n distortionCenterY?: number;\n};\n\nfunction hashed(seed: number, i: number): number {\n let t = Math.imul(i ^ seed, 0x27d4eb2d);\n t ^= t >>> 15;\n t = Math.imul(t, 0x85ebca6b);\n t ^= t >>> 13;\n return ((t >>> 0) / 4294967296) * 2 - 1;\n}\n\nfunction valueNoise(seed: number, t: number): number {\n const i = Math.floor(t);\n const f = t - i;\n const u = f * f * (3 - 2 * f);\n return hashed(seed, i) * (1 - u) + hashed(seed, i + 1) * u;\n}\n\nfunction fovHalf(fov: number): number {\n return (Math.min(fov, 178) / 2) * (Math.PI / 180);\n}\n\nfunction lensMagnification(r: number, fov: number): number {\n if (fov < 0.01) return 1;\n const theta = fovHalf(fov);\n const peak = Math.tan(theta) / theta;\n if (r <= 0) return peak;\n const a = r * theta;\n if (a >= Math.PI / 2 - 1e-3) return 1;\n const rSource = Math.tan(a) / Math.tan(theta);\n if (rSource <= 1e-6) return peak;\n return Math.max(1, r / rSource);\n}\n\nfunction radiusForMagnification(target: number, fov: number): number {\n let lo = 0;\n let hi = 1;\n for (let i = 0; i < 24; i++) {\n const mid = (lo + hi) / 2;\n if (lensMagnification(mid, fov) > target) lo = mid;\n else hi = mid;\n }\n return (lo + hi) / 2;\n}\n\nfunction ringClip(\n rInner: number,\n rOuter: number | null,\n w: number,\n h: number,\n cx: number,\n cy: number,\n): string {\n const circle = (r: number, clockwise: boolean) => {\n const s = clockwise ? 1 : 0;\n return `M ${cx + r} ${cy} A ${r} ${r} 0 1 ${s} ${cx - r} ${cy} A ${r} ${r} 0 1 ${s} ${cx + r} ${cy} Z`;\n };\n const outer =\n rOuter === null\n ? `M 0 0 L ${w} 0 L ${w} ${h} L 0 ${h} Z`\n : circle(rOuter, true);\n return rInner > 0 ? `${outer} ${circle(rInner, false)}` : outer;\n}\n\ntype HalfProps = {\n scene: ReactNode;\n scale: number;\n fov: number;\n blur: number;\n rotation: number;\n centerX: number;\n centerY: number;\n width: number;\n height: number;\n lensSteps: number;\n blurSamples: number;\n blurScaleGain: number;\n blurFade: number;\n};\n\nfunction TransitionHalf({\n scene,\n scale,\n fov,\n blur,\n rotation,\n centerX,\n centerY,\n width,\n height,\n lensSteps,\n blurSamples,\n blurScaleGain,\n blurFade,\n}: HalfProps) {\n const origin = `${centerX}px ${centerY}px`;\n const base = scale / 100;\n\n const peak = lensMagnification(0, fov);\n const steps = peak <= 1.001 ? 0 : lensSteps;\n const rings = Array.from({ length: steps }, (_, i) => {\n const s = 1 + ((peak - 1) * (i + 0.5)) / steps;\n return { s, r: radiusForMagnification(s, fov) };\n });\n\n const samples =\n blur <= 0.05 ? 1 : Math.max(2, Math.round((blurSamples * blur) / 60));\n const weights = Array.from(\n { length: samples },\n (_, j) => (1 - j / samples) ** blurFade,\n );\n\n const groups: {\n key: number;\n alpha: number;\n copies: { key: string; clip: string; k: number }[];\n }[] = [];\n let running = 0;\n for (let j = samples - 1; j >= 0; j--) {\n running += weights[j];\n const g =\n samples === 1\n ? 1\n : 1 + (blur / 100) * blurScaleGain * (j / (samples - 1));\n const halfWidth = (width / 2) * g;\n const copies: { key: string; clip: string; k: number }[] = [];\n\n copies.push({\n key: \"base\",\n clip: ringClip(\n rings.length ? rings[0].r * halfWidth : 0,\n null,\n width,\n height,\n centerX,\n centerY,\n ),\n k: g * base,\n });\n\n for (let i = 0; i < rings.length; i++) {\n const inner = i + 1 < rings.length ? rings[i + 1].r * halfWidth : 0;\n copies.push({\n key: `${i}`,\n clip: ringClip(\n inner,\n rings[i].r * halfWidth,\n width,\n height,\n centerX,\n centerY,\n ),\n k: g * rings[i].s * base,\n });\n }\n\n groups.push({ key: j, alpha: weights[j] / running, copies });\n }\n\n return (\n <div style={{ position: \"absolute\", inset: 0 }}>\n {groups.map(({ key, alpha, copies }) => (\n <div\n key={key}\n style={{ position: \"absolute\", inset: 0, opacity: alpha }}\n >\n {copies.map(({ key: ck, clip, k }) => (\n <div\n key={ck}\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `path(\"${clip}\")`,\n transform: `rotate(${rotation}deg) scale(${k})`,\n transformOrigin: origin,\n }}\n >\n {scene}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n}\n\ninterface LensZoomStageProps extends HalfProps {\n shakeEnvelope: number;\n shakeFrequency: number;\n shakeCyclesPerUnit: number;\n shakeTranslatePx: number;\n shakeRotateDeg: number;\n redScale: number;\n greenScale: number;\n blueScale: number;\n letterboxAspect: number;\n}\n\nfunction LensZoomStage({\n shakeEnvelope,\n shakeFrequency,\n shakeCyclesPerUnit,\n shakeTranslatePx,\n shakeRotateDeg,\n redScale,\n greenScale,\n blueScale,\n letterboxAspect,\n ...half\n}: LensZoomStageProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const filterId = useId();\n const { width, height, centerX, centerY } = half;\n\n const core = <TransitionHalf {...half} />;\n\n const split = redScale !== greenScale || blueScale !== greenScale;\n const channels: { id: string; scale: number; matrix: string }[] = [\n {\n id: \"r\",\n scale: redScale,\n matrix: \"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n },\n {\n id: \"g\",\n scale: greenScale,\n matrix: \"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n },\n {\n id: \"b\",\n scale: blueScale,\n matrix: \"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0\",\n },\n ];\n\n const composited = split ? (\n <div style={{ position: \"absolute\", inset: 0, backgroundColor: \"#000000\" }}>\n {channels.map((c) => (\n <div\n key={c.id}\n style={{\n position: \"absolute\",\n inset: 0,\n mixBlendMode: \"screen\",\n filter: `url(#${filterId}-${c.id})`,\n transform: `scale(${c.scale})`,\n transformOrigin: `${centerX}px ${centerY}px`,\n }}\n >\n {core}\n </div>\n ))}\n </div>\n ) : (\n core\n );\n\n const t = (frame / fps) * shakeFrequency * shakeCyclesPerUnit;\n const octave = (seed: number) =>\n valueNoise(seed, t) + 0.45 * valueNoise(seed + 977, t * 2.6);\n const shakeX = octave(11) * shakeTranslatePx * shakeEnvelope;\n const shakeY = octave(23) * shakeTranslatePx * shakeEnvelope;\n const shakeR = octave(41) * shakeRotateDeg * shakeEnvelope;\n\n const barHeight =\n letterboxAspect > 0\n ? Math.max(0, (height - width / letterboxAspect) / 2)\n : 0;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n width,\n height,\n overflow: \"hidden\",\n backgroundColor: \"#000000\",\n }}\n >\n {split ? (\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n {channels.map((c) => (\n <filter\n key={c.id}\n id={`${filterId}-${c.id}`}\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix type=\"matrix\" values={c.matrix} />\n </filter>\n ))}\n </defs>\n </svg>\n ) : null}\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translate(${shakeX}px, ${shakeY}px) rotate(${shakeR}deg)`,\n transformOrigin: `${centerX}px ${centerY}px`,\n }}\n >\n {composited}\n </div>\n\n {barHeight > 0 ? (\n <>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height: barHeight,\n backgroundColor: \"#000000\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: barHeight,\n backgroundColor: \"#000000\",\n }}\n />\n </>\n ) : null}\n </div>\n );\n}\n\nconst LensZoomPresentation: React.FC<\n TransitionPresentationComponentProps<LensZoomProps>\n> = ({\n children,\n presentationDirection,\n presentationProgress,\n passedProps,\n}) => {\n const config = useVideoConfig();\n const {\n inScaleFrom = 100,\n inScaleTo = 150,\n inFovFrom = 0,\n inFovTo = 160,\n inBlurFrom = 0,\n inBlurTo = 60,\n inRotationFrom = 0,\n inRotationTo = -15,\n\n outScaleFrom = 135,\n outScaleTo = 100,\n outFovFrom = 135,\n outFovTo = 0,\n outBlurFrom = 45,\n outBlurTo = 0,\n outRotationFrom = 345,\n outRotationTo = 360,\n\n anticipateScale = 100,\n anticipatePortion = 0.35,\n\n lensSteps = 9,\n blurSamples = 7,\n blurScaleGain = 1,\n blurFade = 1.5,\n\n shakeAmount = 50,\n shakeFrequency = 1.4,\n shakeCyclesPerUnit = 8,\n shakeTranslatePx = 73,\n shakeRotateDeg = 1.1,\n\n redScale = 1.01,\n greenScale = 1.0,\n blueScale = 0.99,\n\n letterboxAspect = 0,\n\n width = config.width,\n height = config.height,\n distortionCenterX = width / 2,\n distortionCenterY = height / 2,\n } = passedProps;\n\n const exiting = presentationDirection === \"exiting\";\n\n if (exiting ? presentationProgress >= 0.5 : presentationProgress < 0.5)\n return null;\n\n const p = exiting\n ? interpolate(presentationProgress, [0, 0.5], [0, 1], {\n easing: LENS_ZOOM_EASE_IN,\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : interpolate(presentationProgress, [0.5, 1], [0, 1], {\n easing: LENS_ZOOM_EASE_OUT,\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const anticipating =\n exiting && anticipatePortion > 0 && anticipateScale < inScaleFrom;\n\n const pFx =\n anticipating && exiting\n ? interpolate(p, [anticipatePortion, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : p;\n\n const lerp = (from: number, to: number) => from + (to - from) * pFx;\n\n const exitScale = anticipating\n ? interpolate(\n p,\n [0, anticipatePortion, 1],\n [inScaleFrom, anticipateScale, inScaleTo],\n {\n easing: Easing.inOut(Easing.ease),\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : lerp(inScaleFrom, inScaleTo);\n\n const shakeEnvelope =\n interpolate(\n presentationProgress,\n SHAKE_STOPS.map((s) => 0.5 + s / 2),\n [0, shakeAmount, shakeAmount, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n ) / 100;\n\n return (\n <LensZoomStage\n scene={children}\n scale={exiting ? exitScale : lerp(outScaleFrom, outScaleTo)}\n fov={exiting ? lerp(inFovFrom, inFovTo) : lerp(outFovFrom, outFovTo)}\n blur={exiting ? lerp(inBlurFrom, inBlurTo) : lerp(outBlurFrom, outBlurTo)}\n rotation={\n exiting\n ? lerp(inRotationFrom, inRotationTo)\n : lerp(outRotationFrom, outRotationTo)\n }\n centerX={distortionCenterX}\n centerY={distortionCenterY}\n width={width}\n height={height}\n lensSteps={lensSteps}\n blurSamples={blurSamples}\n blurScaleGain={blurScaleGain}\n blurFade={blurFade}\n shakeEnvelope={shakeEnvelope}\n shakeFrequency={shakeFrequency}\n shakeCyclesPerUnit={shakeCyclesPerUnit}\n shakeTranslatePx={shakeTranslatePx}\n shakeRotateDeg={shakeRotateDeg}\n redScale={redScale}\n greenScale={greenScale}\n blueScale={blueScale}\n letterboxAspect={letterboxAspect}\n />\n );\n};\n\nexport function lensZoom(\n props: LensZoomProps = {},\n): TransitionPresentation<LensZoomProps> {\n return {\n component: LensZoomPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type { ReactNode } from \"react\";\nimport { useId } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport const LENS_ZOOM_DURATION_IN_FRAMES = 28;\n\nexport const SHAKE_STOPS = [-9 / 11, -3 / 11, 4 / 11, 8 / 11] as const;\n\nexport const LENS_ZOOM_EASE_IN = Easing.bezier(0.54, 0, 0.82, 0.8);\nexport const LENS_ZOOM_EASE_OUT = Easing.bezier(0.18, 0.2, 0.46, 1);\n\nexport type LensZoomProps = {\n inScaleFrom?: number;\n inScaleTo?: number;\n inFovFrom?: number;\n inFovTo?: number;\n inBlurFrom?: number;\n inBlurTo?: number;\n inRotationFrom?: number;\n inRotationTo?: number;\n outScaleFrom?: number;\n outScaleTo?: number;\n outFovFrom?: number;\n outFovTo?: number;\n outBlurFrom?: number;\n outBlurTo?: number;\n outRotationFrom?: number;\n outRotationTo?: number;\n anticipateScale?: number;\n anticipatePortion?: number;\n lensSteps?: number;\n blurSamples?: number;\n blurScaleGain?: number;\n blurFade?: number;\n shakeAmount?: number;\n shakeFrequency?: number;\n shakeCyclesPerUnit?: number;\n shakeTranslatePx?: number;\n shakeRotateDeg?: number;\n redScale?: number;\n greenScale?: number;\n blueScale?: number;\n letterboxAspect?: number;\n width?: number;\n height?: number;\n distortionCenterX?: number;\n distortionCenterY?: number;\n};\n\nfunction hashed(seed: number, i: number): number {\n let t = Math.imul(i ^ seed, 0x27d4eb2d);\n t ^= t >>> 15;\n t = Math.imul(t, 0x85ebca6b);\n t ^= t >>> 13;\n return ((t >>> 0) / 4294967296) * 2 - 1;\n}\n\nfunction valueNoise(seed: number, t: number): number {\n const i = Math.floor(t);\n const f = t - i;\n const u = f * f * (3 - 2 * f);\n return hashed(seed, i) * (1 - u) + hashed(seed, i + 1) * u;\n}\n\nfunction fovHalf(fov: number): number {\n return (Math.min(fov, 178) / 2) * (Math.PI / 180);\n}\n\nfunction lensMagnification(r: number, fov: number): number {\n if (fov < 0.01) return 1;\n const theta = fovHalf(fov);\n const peak = Math.tan(theta) / theta;\n if (r <= 0) return peak;\n const a = r * theta;\n if (a >= Math.PI / 2 - 1e-3) return 1;\n const rSource = Math.tan(a) / Math.tan(theta);\n if (rSource <= 1e-6) return peak;\n return Math.max(1, r / rSource);\n}\n\nfunction radiusForMagnification(target: number, fov: number): number {\n let lo = 0;\n let hi = 1;\n for (let i = 0; i < 24; i++) {\n const mid = (lo + hi) / 2;\n if (lensMagnification(mid, fov) > target) lo = mid;\n else hi = mid;\n }\n return (lo + hi) / 2;\n}\n\nfunction ringClip(\n rInner: number,\n rOuter: number | null,\n w: number,\n h: number,\n cx: number,\n cy: number,\n): string {\n const circle = (r: number, clockwise: boolean) => {\n const s = clockwise ? 1 : 0;\n return `M ${cx + r} ${cy} A ${r} ${r} 0 1 ${s} ${cx - r} ${cy} A ${r} ${r} 0 1 ${s} ${cx + r} ${cy} Z`;\n };\n const outer =\n rOuter === null\n ? `M 0 0 L ${w} 0 L ${w} ${h} L 0 ${h} Z`\n : circle(rOuter, true);\n return rInner > 0 ? `${outer} ${circle(rInner, false)}` : outer;\n}\n\ntype HalfProps = {\n scene: ReactNode;\n scale: number;\n fov: number;\n blur: number;\n rotation: number;\n centerX: number;\n centerY: number;\n width: number;\n height: number;\n lensSteps: number;\n blurSamples: number;\n blurScaleGain: number;\n blurFade: number;\n};\n\nfunction TransitionHalf({\n scene,\n scale,\n fov,\n blur,\n rotation,\n centerX,\n centerY,\n width,\n height,\n lensSteps,\n blurSamples,\n blurScaleGain,\n blurFade,\n}: HalfProps) {\n const origin = `${centerX}px ${centerY}px`;\n const base = scale / 100;\n\n const peak = lensMagnification(0, fov);\n const steps = peak <= 1.001 ? 0 : lensSteps;\n const rings = Array.from({ length: steps }, (_, i) => {\n const s = 1 + ((peak - 1) * (i + 0.5)) / steps;\n return { s, r: radiusForMagnification(s, fov) };\n });\n\n const samples =\n blur <= 0.05 ? 1 : Math.max(2, Math.round((blurSamples * blur) / 60));\n const weights = Array.from(\n { length: samples },\n (_, j) => (1 - j / samples) ** blurFade,\n );\n\n const groups: {\n key: number;\n alpha: number;\n copies: { key: string; clip: string; k: number }[];\n }[] = [];\n let running = 0;\n for (let j = samples - 1; j >= 0; j--) {\n running += weights[j];\n const g =\n samples === 1\n ? 1\n : 1 + (blur / 100) * blurScaleGain * (j / (samples - 1));\n const halfWidth = (width / 2) * g;\n const copies: { key: string; clip: string; k: number }[] = [];\n\n copies.push({\n key: \"base\",\n clip: ringClip(\n rings.length ? rings[0].r * halfWidth : 0,\n null,\n width,\n height,\n centerX,\n centerY,\n ),\n k: g * base,\n });\n\n for (let i = 0; i < rings.length; i++) {\n const inner = i + 1 < rings.length ? rings[i + 1].r * halfWidth : 0;\n copies.push({\n key: `${i}`,\n clip: ringClip(\n inner,\n rings[i].r * halfWidth,\n width,\n height,\n centerX,\n centerY,\n ),\n k: g * rings[i].s * base,\n });\n }\n\n groups.push({ key: j, alpha: weights[j] / running, copies });\n }\n\n return (\n <div style={{ position: \"absolute\", inset: 0 }}>\n {groups.map(({ key, alpha, copies }) => (\n <div\n key={key}\n style={{ position: \"absolute\", inset: 0, opacity: alpha }}\n >\n {copies.map(({ key: ck, clip, k }) => (\n <div\n key={ck}\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `path(\"${clip}\")`,\n rotate: `${rotation}deg`,\n scale: `${k}`,\n transformOrigin: origin,\n }}\n >\n {scene}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n}\n\ninterface LensZoomStageProps extends HalfProps {\n shakeEnvelope: number;\n shakeFrequency: number;\n shakeCyclesPerUnit: number;\n shakeTranslatePx: number;\n shakeRotateDeg: number;\n redScale: number;\n greenScale: number;\n blueScale: number;\n letterboxAspect: number;\n}\n\nfunction LensZoomStage({\n shakeEnvelope,\n shakeFrequency,\n shakeCyclesPerUnit,\n shakeTranslatePx,\n shakeRotateDeg,\n redScale,\n greenScale,\n blueScale,\n letterboxAspect,\n ...half\n}: LensZoomStageProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const filterId = useId();\n const { width, height, centerX, centerY } = half;\n\n const core = <TransitionHalf {...half} />;\n\n const split = redScale !== greenScale || blueScale !== greenScale;\n const channels: { id: string; scale: number; matrix: string }[] = [\n {\n id: \"r\",\n scale: redScale,\n matrix: \"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n },\n {\n id: \"g\",\n scale: greenScale,\n matrix: \"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n },\n {\n id: \"b\",\n scale: blueScale,\n matrix: \"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0\",\n },\n ];\n\n const composited = split ? (\n <div style={{ position: \"absolute\", inset: 0, backgroundColor: \"#000000\" }}>\n {channels.map((c) => (\n <div\n key={c.id}\n style={{\n position: \"absolute\",\n inset: 0,\n mixBlendMode: \"screen\",\n filter: `url(#${filterId}-${c.id})`,\n scale: `${c.scale}`,\n transformOrigin: `${centerX}px ${centerY}px`,\n }}\n >\n {core}\n </div>\n ))}\n </div>\n ) : (\n core\n );\n\n const t = (frame / fps) * shakeFrequency * shakeCyclesPerUnit;\n const octave = (seed: number) =>\n valueNoise(seed, t) + 0.45 * valueNoise(seed + 977, t * 2.6);\n const shakeX = octave(11) * shakeTranslatePx * shakeEnvelope;\n const shakeY = octave(23) * shakeTranslatePx * shakeEnvelope;\n const shakeR = octave(41) * shakeRotateDeg * shakeEnvelope;\n\n const barHeight =\n letterboxAspect > 0\n ? Math.max(0, (height - width / letterboxAspect) / 2)\n : 0;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n width,\n height,\n overflow: \"hidden\",\n backgroundColor: \"#000000\",\n }}\n >\n {split ? (\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n {channels.map((c) => (\n <filter\n key={c.id}\n id={`${filterId}-${c.id}`}\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix type=\"matrix\" values={c.matrix} />\n </filter>\n ))}\n </defs>\n </svg>\n ) : null}\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n translate: `${shakeX}px ${shakeY}px`,\n rotate: `${shakeR}deg`,\n transformOrigin: `${centerX}px ${centerY}px`,\n }}\n >\n {composited}\n </div>\n\n {barHeight > 0 ? (\n <>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height: barHeight,\n backgroundColor: \"#000000\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: barHeight,\n backgroundColor: \"#000000\",\n }}\n />\n </>\n ) : null}\n </div>\n );\n}\n\nconst LensZoomPresentation: React.FC<\n TransitionPresentationComponentProps<LensZoomProps>\n> = ({\n children,\n presentationDirection,\n presentationProgress,\n passedProps,\n}) => {\n const config = useVideoConfig();\n const {\n inScaleFrom = 100,\n inScaleTo = 150,\n inFovFrom = 0,\n inFovTo = 160,\n inBlurFrom = 0,\n inBlurTo = 60,\n inRotationFrom = 0,\n inRotationTo = -15,\n\n outScaleFrom = 135,\n outScaleTo = 100,\n outFovFrom = 135,\n outFovTo = 0,\n outBlurFrom = 45,\n outBlurTo = 0,\n outRotationFrom = 345,\n outRotationTo = 360,\n\n anticipateScale = 100,\n anticipatePortion = 0.35,\n\n lensSteps = 9,\n blurSamples = 7,\n blurScaleGain = 1,\n blurFade = 1.5,\n\n shakeAmount = 50,\n shakeFrequency = 1.4,\n shakeCyclesPerUnit = 8,\n shakeTranslatePx = 73,\n shakeRotateDeg = 1.1,\n\n redScale = 1.01,\n greenScale = 1.0,\n blueScale = 0.99,\n\n letterboxAspect = 0,\n\n width = config.width,\n height = config.height,\n distortionCenterX = width / 2,\n distortionCenterY = height / 2,\n } = passedProps;\n\n const exiting = presentationDirection === \"exiting\";\n\n if (exiting ? presentationProgress >= 0.5 : presentationProgress < 0.5)\n return null;\n\n const p = exiting\n ? interpolate(presentationProgress, [0, 0.5], [0, 1], {\n easing: LENS_ZOOM_EASE_IN,\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : interpolate(presentationProgress, [0.5, 1], [0, 1], {\n easing: LENS_ZOOM_EASE_OUT,\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const anticipating =\n exiting && anticipatePortion > 0 && anticipateScale < inScaleFrom;\n\n const pFx =\n anticipating && exiting\n ? interpolate(p, [anticipatePortion, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : p;\n\n const lerp = (from: number, to: number) => from + (to - from) * pFx;\n\n const exitScale = anticipating\n ? interpolate(\n p,\n [0, anticipatePortion, 1],\n [inScaleFrom, anticipateScale, inScaleTo],\n {\n easing: Easing.inOut(Easing.ease),\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n )\n : lerp(inScaleFrom, inScaleTo);\n\n const shakeEnvelope =\n interpolate(\n presentationProgress,\n SHAKE_STOPS.map((s) => 0.5 + s / 2),\n [0, shakeAmount, shakeAmount, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n ) / 100;\n\n return (\n <LensZoomStage\n scene={children}\n scale={exiting ? exitScale : lerp(outScaleFrom, outScaleTo)}\n fov={exiting ? lerp(inFovFrom, inFovTo) : lerp(outFovFrom, outFovTo)}\n blur={exiting ? lerp(inBlurFrom, inBlurTo) : lerp(outBlurFrom, outBlurTo)}\n rotation={\n exiting\n ? lerp(inRotationFrom, inRotationTo)\n : lerp(outRotationFrom, outRotationTo)\n }\n centerX={distortionCenterX}\n centerY={distortionCenterY}\n width={width}\n height={height}\n lensSteps={lensSteps}\n blurSamples={blurSamples}\n blurScaleGain={blurScaleGain}\n blurFade={blurFade}\n shakeEnvelope={shakeEnvelope}\n shakeFrequency={shakeFrequency}\n shakeCyclesPerUnit={shakeCyclesPerUnit}\n shakeTranslatePx={shakeTranslatePx}\n shakeRotateDeg={shakeRotateDeg}\n redScale={redScale}\n greenScale={greenScale}\n blueScale={blueScale}\n letterboxAspect={letterboxAspect}\n />\n );\n};\n\nexport function lensZoom(\n props: LensZoomProps = {},\n): TransitionPresentation<LensZoomProps> {\n return {\n component: LensZoomPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/lens-zoom.tsx"
}
diff --git a/registry-artifacts/line-by-line-slide.json b/registry-artifacts/line-by-line-slide.json
index 8be0859d..bb895a4a 100644
--- a/registry-artifacts/line-by-line-slide.json
+++ b/registry-artifacts/line-by-line-slide.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/line-by-line-slide/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function LineByLineSlide({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const enterTravel = 14;\n const exitDur = 18;\n const exitTravelFrom = 8;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, distance],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n transform: `translateX(${x}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function LineByLineSlide({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const enterTravel = 14;\n const exitDur = 18;\n const exitTravelFrom = 8;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, distance],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n translate: `${x}px`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/line-by-line-slide.tsx"
}
diff --git a/registry-artifacts/logo-enter.json b/registry-artifacts/logo-enter.json
index cd4b83be..62674955 100644
--- a/registry-artifacts/logo-enter.json
+++ b/registry-artifacts/logo-enter.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/logo-enter/index.tsx",
- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface Logo {\n mark: ReactNode;\n bg?: string;\n}\n\nexport interface LogoEnterProps {\n logos?: Logo[];\n diameter?: number;\n overlap?: number;\n ringColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n stagger?: number;\n speed?: number;\n}\n\nconst ClaudeMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n preserveAspectRatio=\"xMidYMid\"\n viewBox=\"0 0 256 257\"\n >\n <path\n fill=\"#D97757\"\n d=\"m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z\"\n />\n </svg>\n);\n\nconst CodexMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n fill=\"#fff\"\n fillRule=\"evenodd\"\n viewBox=\"0 0 24 24\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z\"\n />\n </svg>\n);\n\nconst CursorMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"#fff\" viewBox=\"0 0 466.73 532.09\">\n <path d=\"M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z\" />\n </svg>\n);\n\nconst GrokMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"none\" viewBox=\"0 0 1024 1024\">\n <path\n fill=\"#fff\"\n d=\"M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916\"\n />\n <path\n fill=\"#fff\"\n d=\"M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339\"\n />\n </svg>\n);\n\nexport const SAMPLE_LOGOS: Logo[] = [\n { mark: <ClaudeMark />, bg: \"#F0EEE6\" },\n { mark: <CodexMark />, bg: \"#0A0A0A\" },\n { mark: <CursorMark />, bg: \"#0A0A0A\" },\n { mark: <GrokMark />, bg: \"#0A0A0A\" },\n];\n\nexport function LogoEnter({\n logos = SAMPLE_LOGOS,\n diameter = 118,\n overlap = 38,\n ringColor = \"#fff\",\n orientation = \"horizontal\",\n stagger = 7,\n speed = 1,\n}: LogoEnterProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const isVertical = orientation === \"vertical\";\n\n return (\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: isVertical ? \"column\" : \"row\",\n }}\n >\n {logos.map(({ mark, bg }, i) => {\n const s = spring({\n fps,\n frame: frame * speed - i * stagger,\n config: { damping: 13, stiffness: 130, mass: 0.8 },\n });\n const scale = interpolate(s, [0, 1], [0.5, 1]);\n const offset = interpolate(s, [0, 1], [22, 0]);\n const lead = i === 0 ? 0 : -overlap;\n return (\n <div\n key={i}\n style={{\n width: diameter,\n height: diameter,\n borderRadius: \"50%\",\n marginLeft: isVertical ? 0 : lead,\n marginTop: isVertical ? lead : 0,\n zIndex: logos.length - i,\n background: bg,\n border: `5px solid ${ringColor}`,\n boxShadow: \"0 20px 48px rgba(0,0,0,0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: s,\n transform: isVertical\n ? `translateX(${offset}px) scale(${scale})`\n : `translateY(${offset}px) scale(${scale})`,\n }}\n >\n <div\n style={{\n width: diameter * 0.52,\n height: diameter * 0.52,\n display: \"flex\",\n }}\n >\n {mark}\n </div>\n </div>\n );\n })}\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface Logo {\n mark: ReactNode;\n bg?: string;\n}\n\nexport interface LogoEnterProps {\n logos?: Logo[];\n diameter?: number;\n overlap?: number;\n ringColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n stagger?: number;\n speed?: number;\n}\n\nconst ClaudeMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n preserveAspectRatio=\"xMidYMid\"\n viewBox=\"0 0 256 257\"\n >\n <path\n fill=\"#D97757\"\n d=\"m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z\"\n />\n </svg>\n);\n\nconst CodexMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n fill=\"#fff\"\n fillRule=\"evenodd\"\n viewBox=\"0 0 24 24\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z\"\n />\n </svg>\n);\n\nconst CursorMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"#fff\" viewBox=\"0 0 466.73 532.09\">\n <path d=\"M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z\" />\n </svg>\n);\n\nconst GrokMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"none\" viewBox=\"0 0 1024 1024\">\n <path\n fill=\"#fff\"\n d=\"M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916\"\n />\n <path\n fill=\"#fff\"\n d=\"M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339\"\n />\n </svg>\n);\n\nexport const SAMPLE_LOGOS: Logo[] = [\n { mark: <ClaudeMark />, bg: \"#F0EEE6\" },\n { mark: <CodexMark />, bg: \"#0A0A0A\" },\n { mark: <CursorMark />, bg: \"#0A0A0A\" },\n { mark: <GrokMark />, bg: \"#0A0A0A\" },\n];\n\nexport function LogoEnter({\n logos = SAMPLE_LOGOS,\n diameter = 118,\n overlap = 38,\n ringColor = \"#fff\",\n orientation = \"horizontal\",\n stagger = 7,\n speed = 1,\n}: LogoEnterProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const isVertical = orientation === \"vertical\";\n\n return (\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: isVertical ? \"column\" : \"row\",\n }}\n >\n {logos.map(({ mark, bg }, i) => {\n const s = spring({\n fps,\n frame: frame * speed - i * stagger,\n config: { damping: 13, stiffness: 130, mass: 0.8 },\n });\n const scale = interpolate(s, [0, 1], [0.5, 1]);\n const offset = interpolate(s, [0, 1], [22, 0]);\n const lead = i === 0 ? 0 : -overlap;\n return (\n <div\n key={i}\n style={{\n width: diameter,\n height: diameter,\n borderRadius: \"50%\",\n marginLeft: isVertical ? 0 : lead,\n marginTop: isVertical ? lead : 0,\n zIndex: logos.length - i,\n background: bg,\n border: `5px solid ${ringColor}`,\n boxShadow: \"0 20px 48px rgba(0,0,0,0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: s,\n translate: isVertical ? `${offset}px` : `0 ${offset}px`,\n scale: `${scale}`,\n }}\n >\n <div\n style={{\n width: diameter * 0.52,\n height: diameter * 0.52,\n display: \"flex\",\n }}\n >\n {mark}\n </div>\n </div>\n );\n })}\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/logo-enter.tsx"
}
diff --git a/registry-artifacts/marker-highlight.json b/registry-artifacts/marker-highlight.json
index b0a7e9ed..da06a780 100644
--- a/registry-artifacts/marker-highlight.json
+++ b/registry-artifacts/marker-highlight.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/marker-highlight/index.tsx",
- "content": "\"use client\";\n\nimport {\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface MarkerHighlightProps {\n before?: string;\n highlight: string;\n after?: string;\n markerColor?: string;\n baseColor?: string;\n highlightedTextColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MarkerHighlight({\n before = \"\",\n highlight,\n after = \"\",\n markerColor = \"#facc15\",\n baseColor = \"#171717\",\n highlightedTextColor = \"#171717\",\n fontSize = 72,\n fontWeight = 600,\n speed = 1,\n className,\n}: MarkerHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const markerScale = spring({\n frame: frame - 15,\n fps,\n config: { damping: 14 },\n });\n\n const textColor = interpolateColors(\n interpolate(markerScale, [0.5, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n [0, 1],\n [baseColor, highlightedTextColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ position: \"relative\", display: \"inline-block\" }}>\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n inset: \"0 -0.1em\",\n background: markerColor,\n transformOrigin: \"left center\",\n transform: `scaleX(${markerScale})`,\n zIndex: 0,\n }}\n />\n <span style={{ position: \"relative\", zIndex: 1, color: textColor }}>\n {highlight}\n </span>\n </span>\n {after}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface MarkerHighlightProps {\n before?: string;\n highlight: string;\n after?: string;\n markerColor?: string;\n baseColor?: string;\n highlightedTextColor?: string;\n fontSize?: number;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MarkerHighlight({\n before = \"\",\n highlight,\n after = \"\",\n markerColor = \"#facc15\",\n baseColor = \"#171717\",\n highlightedTextColor = \"#171717\",\n fontSize = 72,\n fontWeight = 600,\n speed = 1,\n className,\n}: MarkerHighlightProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const markerScale = spring({\n frame: frame - 15,\n fps,\n config: { damping: 14 },\n });\n\n const textColor = interpolateColors(\n interpolate(markerScale, [0.5, 0.8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n [0, 1],\n [baseColor, highlightedTextColor],\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color: baseColor,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {before}\n <span style={{ position: \"relative\", display: \"inline-block\" }}>\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n inset: \"0 -0.1em\",\n background: markerColor,\n transformOrigin: \"left center\",\n scale: `${markerScale} 1`,\n zIndex: 0,\n }}\n />\n <span style={{ position: \"relative\", zIndex: 1, color: textColor }}>\n {highlight}\n </span>\n </span>\n {after}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/marker-highlight.tsx"
}
diff --git a/registry-artifacts/mask-reveal-up.json b/registry-artifacts/mask-reveal-up.json
index e984ef1f..11d82da4 100644
--- a/registry-artifacts/mask-reveal-up.json
+++ b/registry-artifacts/mask-reveal-up.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/mask-reveal-up/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MaskRevealUp({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const enterTravel = 11;\n const exitDur = 16;\n const exitTravelFrom = 8;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -22],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MaskRevealUp({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const enterTravel = 11;\n const exitDur = 16;\n const exitTravelFrom = 8;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(\n enterLocal,\n [0, enterTravel],\n [distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const yExit = interpolate(\n exitLocal,\n [exitTravelFrom, exitDur],\n [0, -22],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n translate: `0 ${y}px`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/mask-reveal-up.tsx"
}
diff --git a/registry-artifacts/micro-scale-fade.json b/registry-artifacts/micro-scale-fade.json
index 4c2782f3..d38efee8 100644
--- a/registry-artifacts/micro-scale-fade.json
+++ b/registry-artifacts/micro-scale-fade.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/micro-scale-fade/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface MicroScaleFadeProps {\n text: string;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MicroScaleFade({\n text,\n scaleFrom = 0.96,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MicroScaleFadeProps) {\n const frame = useCurrentFrame() * speed;\n const easing = Easing.bezier(0.32, 0.72, 0, 1);\n\n const opacity = interpolate(frame, [0, 18], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const scale = interpolate(frame, [0, 18], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface MicroScaleFadeProps {\n text: string;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MicroScaleFade({\n text,\n scaleFrom = 0.96,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MicroScaleFadeProps) {\n const frame = useCurrentFrame() * speed;\n const easing = Easing.bezier(0.32, 0.72, 0, 1);\n\n const opacity = interpolate(frame, [0, 18], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const scale = interpolate(frame, [0, 18], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n scale: `${scale}`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/micro-scale-fade.tsx"
}
diff --git a/registry-artifacts/number-wheel.json b/registry-artifacts/number-wheel.json
index f953e84b..58d49c15 100644
--- a/registry-artifacts/number-wheel.json
+++ b/registry-artifacts/number-wheel.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/number-wheel/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface NumberWheelProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nexport interface OdometerProps {\n current: number;\n fontSize: number;\n color: string;\n}\n\nconst WHEEL_ROLL_START = 0.9;\nconst SPRING_FRAMES = 30;\nconst SPRING_CONFIG = { damping: 200, stiffness: 100, mass: 1 } as const;\nconst COUNT_PORTION = 0.8;\n\nfunction rollFraction(current: number, place: number): number {\n const v = current / 10 ** place;\n const frac = v - Math.floor(v);\n if (frac <= WHEEL_ROLL_START) return 0;\n return (frac - WHEEL_ROLL_START) / (1 - WHEEL_ROLL_START);\n}\n\nfunction computeWheel(\n current: number,\n place: number,\n springEased: (t: number) => number,\n): number {\n if (current <= 0) return 0;\n if (place === 0) return current % 10;\n\n const digit = Math.floor(current / 10 ** place) % 10;\n const t = rollFraction(current, place);\n if (t <= 0) return digit;\n return digit + springEased(t);\n}\n\nfunction placeOpacity(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * 0.9, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n opacity,\n}: {\n value: number;\n fontSize: number;\n opacity: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nfunction OdometerColumns({\n current,\n templateValue,\n fontSize,\n color,\n fps,\n}: {\n current: number;\n templateValue: number;\n fontSize: number;\n color: string;\n fps: number;\n}) {\n const springAtEnd = spring({\n frame: SPRING_FRAMES,\n fps,\n config: SPRING_CONFIG,\n });\n const springEased = (t: number) =>\n spring({ frame: t * SPRING_FRAMES, fps, config: SPRING_CONFIG }) /\n springAtEnd;\n\n const template = templateValue.toLocaleString(\"en-US\");\n\n const cells: React.ReactNode[] = [];\n let place = 0;\n for (let i = template.length - 1; i >= 0; i--) {\n const ch = template[i];\n if (ch === \",\") {\n cells.unshift(\n <span\n key={`c${i}`}\n style={{\n display: \"inline-block\",\n width: \"0.32em\",\n color: \"currentColor\",\n fontSize: \"0.85em\",\n textAlign: \"center\",\n opacity: placeOpacity(current, place),\n }}\n >\n ,\n </span>,\n );\n } else {\n const wheel = computeWheel(current, place, springEased);\n cells.unshift(\n <DigitColumn\n key={`d${i}`}\n value={wheel}\n fontSize={fontSize}\n opacity={placeOpacity(current, place)}\n />,\n );\n place++;\n }\n }\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n );\n}\n\nexport function Odometer({ current, fontSize, color }: OdometerProps) {\n const { fps } = useVideoConfig();\n const value = Math.max(0, Math.round(current));\n return (\n <OdometerColumns\n current={current}\n templateValue={value}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n );\n}\n\nexport function NumberWheel({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: NumberWheelProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, fps } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const progress = interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n const current = Math.max(0, start + progress * (end - start));\n const maxVal = Math.max(start, end);\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <OdometerColumns\n current={current}\n templateValue={maxVal}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface NumberWheelProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nexport interface OdometerProps {\n current: number;\n fontSize: number;\n color: string;\n}\n\nconst WHEEL_ROLL_START = 0.9;\nconst SPRING_FRAMES = 30;\nconst SPRING_CONFIG = { damping: 200, stiffness: 100, mass: 1 } as const;\nconst COUNT_PORTION = 0.8;\n\nfunction rollFraction(current: number, place: number): number {\n const v = current / 10 ** place;\n const frac = v - Math.floor(v);\n if (frac <= WHEEL_ROLL_START) return 0;\n return (frac - WHEEL_ROLL_START) / (1 - WHEEL_ROLL_START);\n}\n\nfunction computeWheel(\n current: number,\n place: number,\n springEased: (t: number) => number,\n): number {\n if (current <= 0) return 0;\n if (place === 0) return current % 10;\n\n const digit = Math.floor(current / 10 ** place) % 10;\n const t = rollFraction(current, place);\n if (t <= 0) return digit;\n return digit + springEased(t);\n}\n\nfunction placeOpacity(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * 0.9, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n opacity,\n}: {\n value: number;\n fontSize: number;\n opacity: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n translate: `0 ${-value * cellHeight}px`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nfunction OdometerColumns({\n current,\n templateValue,\n fontSize,\n color,\n fps,\n}: {\n current: number;\n templateValue: number;\n fontSize: number;\n color: string;\n fps: number;\n}) {\n const springAtEnd = spring({\n frame: SPRING_FRAMES,\n fps,\n config: SPRING_CONFIG,\n });\n const springEased = (t: number) =>\n spring({ frame: t * SPRING_FRAMES, fps, config: SPRING_CONFIG }) /\n springAtEnd;\n\n const template = templateValue.toLocaleString(\"en-US\");\n\n const cells: React.ReactNode[] = [];\n let place = 0;\n for (let i = template.length - 1; i >= 0; i--) {\n const ch = template[i];\n if (ch === \",\") {\n cells.unshift(\n <span\n key={`c${i}`}\n style={{\n display: \"inline-block\",\n width: \"0.32em\",\n color: \"currentColor\",\n fontSize: \"0.85em\",\n textAlign: \"center\",\n opacity: placeOpacity(current, place),\n }}\n >\n ,\n </span>,\n );\n } else {\n const wheel = computeWheel(current, place, springEased);\n cells.unshift(\n <DigitColumn\n key={`d${i}`}\n value={wheel}\n fontSize={fontSize}\n opacity={placeOpacity(current, place)}\n />,\n );\n place++;\n }\n }\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n );\n}\n\nexport function Odometer({ current, fontSize, color }: OdometerProps) {\n const { fps } = useVideoConfig();\n const value = Math.max(0, Math.round(current));\n return (\n <OdometerColumns\n current={current}\n templateValue={value}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n );\n}\n\nexport function NumberWheel({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: NumberWheelProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, fps } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const progress = interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n const current = Math.max(0, start + progress * (end - start));\n const maxVal = Math.max(start, end);\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <OdometerColumns\n current={current}\n templateValue={maxVal}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/number-wheel.tsx"
}
diff --git a/registry-artifacts/opencode.json b/registry-artifacts/opencode.json
index ebf68a44..4e126bf1 100644
--- a/registry-artifacts/opencode.json
+++ b/registry-artifacts/opencode.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/opencode/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: MONO_FAMILY } = loadFont();\n\nexport interface OpenCodeProps {\n placeholder?: string;\n query?: string;\n agentName?: string;\n modelName?: string;\n provider?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n fg: string;\n fgMuted: string;\n fgQuery: string;\n logoOpen: string;\n logoCode: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#F2F2F2\",\n fg: \"#111111\",\n fgMuted: \"#888888\",\n fgQuery: \"#555555\",\n logoOpen: \"#999999\",\n logoCode: \"#111111\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#161616\",\n fg: \"#EDEDED\",\n fgMuted: \"#6B6B6B\",\n fgQuery: \"#9A9A9A\",\n logoOpen: \"#6B6B6B\",\n logoCode: \"#EDEDED\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 20;\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nexport function OpenCode({\n placeholder = \"Ask anything... \",\n query = '\"What is the tech stack of this project?\"',\n agentName = \"Build\",\n modelName = \"Kimi K2.5\",\n provider = \"Moonshot AI\",\n accentColor = \"#2B7FFF\",\n speed = 1,\n}: OpenCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(query, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n\n const intro = introBounceIn(frame * speed, fps);\n const logoFade = fadeUpAt(frame * speed, [4, 22]);\n const boxFade = fadeUpAt(frame * speed, [12, 30]);\n const hintsFade = fadeUpAt(frame * speed, [20, 38]);\n\n const boxWidth = 1000;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n lineHeight: 0,\n opacity: logoFade.opacity,\n transform: `translateY(${logoFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n <svg\n width={468}\n height={84}\n viewBox=\"0 0 234 42\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>opencode</title>\n <clipPath id=\"opencode-wordmark-clip\">\n <rect width={234} height={42} fill=\"#ffffff\" />\n </clipPath>\n <g clipPath=\"url(#opencode-wordmark-clip)\">\n <path d=\"M18 30H6V18H18V30Z\" fill=\"#4B4646\" />\n <path d=\"M18 12H6V30H18V12ZM24 36H0V6H24V36Z\" fill=\"#B7B1B1\" />\n <path d=\"M48 30H36V18H48V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M36 30H48V12H36V30ZM54 36H36V42H30V6H54V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M84 24V30H66V24H84Z\" fill=\"#4B4646\" />\n <path\n d=\"M84 24H66V30H84V36H60V6H84V24ZM66 18H78V12H66V18Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M108 36H96V18H108V36Z\" fill=\"#4B4646\" />\n <path\n d=\"M108 12H96V36H90V6H108V12ZM114 36H108V12H114V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M144 30H126V18H144V30Z\" fill=\"#4B4646\" />\n <path d=\"M144 12H126V30H144V36H120V6H144V12Z\" fill=\"#F1ECEC\" />\n <path d=\"M168 30H156V18H168V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M168 12H156V30H168V12ZM174 36H150V6H174V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M198 30H186V18H198V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M198 12H186V30H198V12ZM204 36H180V6H198V0H204V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M234 24V30H216V24H234Z\" fill=\"#4B4646\" />\n <path\n d=\"M216 12V18H228V12H216ZM234 24H216V30H234V36H210V6H234V24Z\"\n fill=\"#F1ECEC\"\n />\n </g>\n </svg>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 40,\n minHeight: 150,\n background: t.boxBg,\n borderLeft: `4px solid ${accentColor}`,\n padding: \"26px 28px\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n gap: 26,\n opacity: boxFade.opacity,\n transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 22,\n }}\n >\n <span style={{ color: t.fgMuted }}>{placeholder}</span>\n {tw.count > 0 ? (\n <span style={{ color: t.fgQuery }}>{tw.text}</span>\n ) : null}\n <span style={{ opacity: 0.6, display: \"inline-flex\" }}>\n <Caret\n width={12}\n height={24}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 16,\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n }}\n >\n <span style={{ color: accentColor, fontWeight: 600 }}>\n {agentName}\n </span>\n <span style={{ color: t.fg }}>{modelName}</span>\n <span style={{ color: t.fgMuted }}>{provider}</span>\n </div>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 18,\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 22,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n opacity: hintsFade.opacity,\n transform: `translateY(${hintsFade.translateY}px)`,\n }}\n >\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>tab</span>\n <span style={{ color: t.fgMuted }}>agents</span>\n </span>\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>ctrl+p</span>\n <span style={{ color: t.fgMuted }}>commands</span>\n </span>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: MONO_FAMILY } = loadFont();\n\nexport interface OpenCodeProps {\n placeholder?: string;\n query?: string;\n agentName?: string;\n modelName?: string;\n provider?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n fg: string;\n fgMuted: string;\n fgQuery: string;\n logoOpen: string;\n logoCode: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#F2F2F2\",\n fg: \"#111111\",\n fgMuted: \"#888888\",\n fgQuery: \"#555555\",\n logoOpen: \"#999999\",\n logoCode: \"#111111\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#161616\",\n fg: \"#EDEDED\",\n fgMuted: \"#6B6B6B\",\n fgQuery: \"#9A9A9A\",\n logoOpen: \"#6B6B6B\",\n logoCode: \"#EDEDED\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 20;\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nexport function OpenCode({\n placeholder = \"Ask anything... \",\n query = '\"What is the tech stack of this project?\"',\n agentName = \"Build\",\n modelName = \"Kimi K2.5\",\n provider = \"Moonshot AI\",\n accentColor = \"#2B7FFF\",\n speed = 1,\n}: OpenCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(query, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n\n const intro = introBounceIn(frame * speed, fps);\n const logoFade = fadeUpAt(frame * speed, [4, 22]);\n const boxFade = fadeUpAt(frame * speed, [12, 30]);\n const hintsFade = fadeUpAt(frame * speed, [20, 38]);\n\n const boxWidth = 1000;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n lineHeight: 0,\n opacity: logoFade.opacity,\n translate: `0 ${logoFade.translateY + intro.translateY * 0.4}px`,\n }}\n >\n <svg\n width={468}\n height={84}\n viewBox=\"0 0 234 42\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>opencode</title>\n <clipPath id=\"opencode-wordmark-clip\">\n <rect width={234} height={42} fill=\"#ffffff\" />\n </clipPath>\n <g clipPath=\"url(#opencode-wordmark-clip)\">\n <path d=\"M18 30H6V18H18V30Z\" fill=\"#4B4646\" />\n <path d=\"M18 12H6V30H18V12ZM24 36H0V6H24V36Z\" fill=\"#B7B1B1\" />\n <path d=\"M48 30H36V18H48V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M36 30H48V12H36V30ZM54 36H36V42H30V6H54V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M84 24V30H66V24H84Z\" fill=\"#4B4646\" />\n <path\n d=\"M84 24H66V30H84V36H60V6H84V24ZM66 18H78V12H66V18Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M108 36H96V18H108V36Z\" fill=\"#4B4646\" />\n <path\n d=\"M108 12H96V36H90V6H108V12ZM114 36H108V12H114V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M144 30H126V18H144V30Z\" fill=\"#4B4646\" />\n <path d=\"M144 12H126V30H144V36H120V6H144V12Z\" fill=\"#F1ECEC\" />\n <path d=\"M168 30H156V18H168V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M168 12H156V30H168V12ZM174 36H150V6H174V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M198 30H186V18H198V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M198 12H186V30H198V12ZM204 36H180V6H198V0H204V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M234 24V30H216V24H234Z\" fill=\"#4B4646\" />\n <path\n d=\"M216 12V18H228V12H216ZM234 24H216V30H234V36H210V6H234V24Z\"\n fill=\"#F1ECEC\"\n />\n </g>\n </svg>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 40,\n minHeight: 150,\n background: t.boxBg,\n borderLeft: `4px solid ${accentColor}`,\n padding: \"26px 28px\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n gap: 26,\n opacity: boxFade.opacity,\n translate: `0 ${boxFade.translateY + intro.translateY * 0.6}px`,\n scale: `${intro.scale}`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 22,\n }}\n >\n <span style={{ color: t.fgMuted }}>{placeholder}</span>\n {tw.count > 0 ? (\n <span style={{ color: t.fgQuery }}>{tw.text}</span>\n ) : null}\n <span style={{ opacity: 0.6, display: \"inline-flex\" }}>\n <Caret\n width={12}\n height={24}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 16,\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n }}\n >\n <span style={{ color: accentColor, fontWeight: 600 }}>\n {agentName}\n </span>\n <span style={{ color: t.fg }}>{modelName}</span>\n <span style={{ color: t.fgMuted }}>{provider}</span>\n </div>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 18,\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 22,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n opacity: hintsFade.opacity,\n translate: `0 ${hintsFade.translateY}px`,\n }}\n >\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>tab</span>\n <span style={{ color: t.fgMuted }}>agents</span>\n </span>\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>ctrl+p</span>\n <span style={{ color: t.fgMuted }}>commands</span>\n </span>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/opencode.tsx"
}
diff --git a/registry-artifacts/page-turn.json b/registry-artifacts/page-turn.json
index 174ba8f0..8066b5bc 100644
--- a/registry-artifacts/page-turn.json
+++ b/registry-artifacts/page-turn.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/page-turn/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, useVideoConfig } from \"remotion\";\n\nconst LIFT_RATIO = 1.28;\n\nexport function pageTurnPose(progress: number, poses: number): number {\n const clamped = Math.min(1, Math.max(0, progress));\n const eased = clamped ** 3;\n if (poses <= 1) return eased >= 1 ? 1 : 0;\n const bucket = Math.min(poses - 1, Math.floor(eased * poses));\n return bucket / (poses - 1);\n}\n\nexport type PageTurnProps = {\n angle?: number;\n origin?: string;\n poses?: number;\n};\n\nconst PageTurnPresentation: React.FC<\n TransitionPresentationComponentProps<PageTurnProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { height } = useVideoConfig();\n const { angle = -7, origin = \"18% 100%\", poses = 8 } = passedProps;\n\n if (presentationDirection === \"entering\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const pose = pageTurnPose(presentationProgress, poses);\n\n return (\n <AbsoluteFill\n style={{\n zIndex: 2,\n transformOrigin: origin,\n transform: `translateY(${-pose * height * LIFT_RATIO}px) rotate(${angle * pose}deg)`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nexport function pageTurn(\n props: PageTurnProps = {},\n): TransitionPresentation<PageTurnProps> {\n return {\n component: PageTurnPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, useVideoConfig } from \"remotion\";\n\nconst LIFT_RATIO = 1.28;\n\nexport function pageTurnPose(progress: number, poses: number): number {\n const clamped = Math.min(1, Math.max(0, progress));\n const eased = clamped ** 3;\n if (poses <= 1) return eased >= 1 ? 1 : 0;\n const bucket = Math.min(poses - 1, Math.floor(eased * poses));\n return bucket / (poses - 1);\n}\n\nexport type PageTurnProps = {\n angle?: number;\n origin?: string;\n poses?: number;\n};\n\nconst PageTurnPresentation: React.FC<\n TransitionPresentationComponentProps<PageTurnProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { height } = useVideoConfig();\n const { angle = -7, origin = \"18% 100%\", poses = 8 } = passedProps;\n\n if (presentationDirection === \"entering\") {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const pose = pageTurnPose(presentationProgress, poses);\n\n return (\n <AbsoluteFill\n style={{\n zIndex: 2,\n transformOrigin: origin,\n translate: `0 ${-pose * height * LIFT_RATIO}px`,\n rotate: `${angle * pose}deg`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n};\n\nexport function pageTurn(\n props: PageTurnProps = {},\n): TransitionPresentation<PageTurnProps> {\n return {\n component: PageTurnPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/page-turn.tsx"
}
diff --git a/registry-artifacts/paper-sticker.json b/registry-artifacts/paper-sticker.json
index 0ef9920c..65ceeb3b 100644
--- a/registry-artifacts/paper-sticker.json
+++ b/registry-artifacts/paper-sticker.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/paper-sticker/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useCurrentFrame } from \"remotion\";\nimport {\n DEFAULT_STEP,\n hashRange,\n paperJitter,\n steppedRamp,\n} from \"@/lib/remocn/stop-motion\";\n\nexport interface PaperStickerProps {\n children: React.ReactNode;\n at?: number;\n seed?: string;\n padding?: string;\n background?: string;\n borderColor?: string;\n maxTilt?: number;\n step?: number;\n}\n\nexport function PaperSticker({\n children,\n at = 0,\n seed = \"sticker\",\n padding = \"10px 16px\",\n background = \"#fbfaf6\",\n borderColor = \"rgba(38,36,44,0.55)\",\n maxTilt = 2.6,\n step = DEFAULT_STEP,\n}: PaperStickerProps) {\n const frame = useCurrentFrame();\n const progress = steppedRamp(frame, at, at + 2 * step, { step });\n if (progress === 0) return null;\n\n const tilt = hashRange(`${seed}:rot`, -maxTilt, maxTilt);\n const jitter = paperJitter(frame, `sticker:${seed}`, {\n amp: 0.7,\n rotAmp: 0.2,\n step,\n });\n\n return (\n <div\n style={{\n display: \"inline-block\",\n padding,\n background,\n border: `1px solid ${borderColor}`,\n borderRadius: 3,\n boxShadow: \"0 2px 5px rgba(38,36,44,0.14)\",\n transform: `translate(${jitter.x}px, ${jitter.y}px) rotate(${tilt + jitter.rot}deg) scale(${progress < 1 ? 1.12 : 1})`,\n }}\n >\n {children}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useCurrentFrame } from \"remotion\";\nimport {\n DEFAULT_STEP,\n hashRange,\n paperJitter,\n steppedRamp,\n} from \"@/lib/remocn/stop-motion\";\n\nexport interface PaperStickerProps {\n children: React.ReactNode;\n at?: number;\n seed?: string;\n padding?: string;\n background?: string;\n borderColor?: string;\n maxTilt?: number;\n step?: number;\n}\n\nexport function PaperSticker({\n children,\n at = 0,\n seed = \"sticker\",\n padding = \"10px 16px\",\n background = \"#fbfaf6\",\n borderColor = \"rgba(38,36,44,0.55)\",\n maxTilt = 2.6,\n step = DEFAULT_STEP,\n}: PaperStickerProps) {\n const frame = useCurrentFrame();\n const progress = steppedRamp(frame, at, at + 2 * step, { step });\n if (progress === 0) return null;\n\n const tilt = hashRange(`${seed}:rot`, -maxTilt, maxTilt);\n const jitter = paperJitter(frame, `sticker:${seed}`, {\n amp: 0.7,\n rotAmp: 0.2,\n step,\n });\n\n return (\n <div\n style={{\n display: \"inline-block\",\n padding,\n background,\n border: `1px solid ${borderColor}`,\n borderRadius: 3,\n boxShadow: \"0 2px 5px rgba(38,36,44,0.14)\",\n translate: `${jitter.x}px ${jitter.y}px`,\n rotate: `${tilt + jitter.rot}deg`,\n scale: `${progress < 1 ? 1.12 : 1}`,\n }}\n >\n {children}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/paper-sticker.tsx"
}
diff --git a/registry-artifacts/per-character-rise.json b/registry-artifacts/per-character-rise.json
index cb5fc6e2..8d449904 100644
--- a/registry-artifacts/per-character-rise.json
+++ b/registry-artifacts/per-character-rise.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/per-character-rise/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerCharacterRise({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const charTravelFrames = 10;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const travelEasing = Easing.bezier(0.2, 0.8, 0.6, 0.85);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerCharacterRise({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const charTravelFrames = 10;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const travelEasing = Easing.bezier(0.2, 0.8, 0.6, 0.85);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/per-character-rise.tsx"
}
diff --git a/registry-artifacts/per-word-crossfade.json b/registry-artifacts/per-word-crossfade.json
index f84164d1..f5188135 100644
--- a/registry-artifacts/per-word-crossfade.json
+++ b/registry-artifacts/per-word-crossfade.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/per-word-crossfade/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerWordCrossfadeProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerWordCrossfade({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerWordCrossfadeProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 21;\n const enterTravel = 5;\n const exitDur = 15;\n const exitTravelFrom = 6;\n const enterStagger = 2;\n const exitStagger = 1;\n const overlapF = 5;\n const microDelayF = 2;\n\n const enterEasing = Easing.bezier(0.16, 1, 0.3, 1);\n const exitEasing = Easing.bezier(0.7, 0, 0.84, 0);\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const y = interpolate(local, [exitTravelFrom, exitDur], [0, -6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const y = interpolate(local, [0, enterTravel], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerWordCrossfadeProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerWordCrossfade({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerWordCrossfadeProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 21;\n const enterTravel = 5;\n const exitDur = 15;\n const exitTravelFrom = 6;\n const enterStagger = 2;\n const exitStagger = 1;\n const overlapF = 5;\n const microDelayF = 2;\n\n const enterEasing = Easing.bezier(0.16, 1, 0.3, 1);\n const exitEasing = Easing.bezier(0.7, 0, 0.84, 0);\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const y = interpolate(local, [exitTravelFrom, exitDur], [0, -6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const y = interpolate(local, [0, enterTravel], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/per-word-crossfade.tsx"
}
diff --git a/registry-artifacts/perspective-marquee.json b/registry-artifacts/perspective-marquee.json
index bd7eaef0..aadc611d 100644
--- a/registry-artifacts/perspective-marquee.json
+++ b/registry-artifacts/perspective-marquee.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/perspective-marquee/index.tsx",
- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nexport function PerspectiveMarquee({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nexport function PerspectiveMarquee({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n translate: `${offset}px`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/perspective-marquee.tsx"
}
diff --git a/registry-artifacts/perspective-squeeze.json b/registry-artifacts/perspective-squeeze.json
index eec59955..837d00a1 100644
--- a/registry-artifacts/perspective-squeeze.json
+++ b/registry-artifacts/perspective-squeeze.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/perspective-squeeze/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\ntype Corners = [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n];\n\nexport interface PerspectiveSqueezeProps {\n className?: string;\n width?: number;\n height?: number;\n blockWidth?: number;\n blockHeight?: number;\n lowerBlockPosition?: [number, number];\n upperBlockPosition?: [number, number];\n cornersRest?: Corners;\n cornerKeyframes?: number[];\n upperCornersMid?: Corners;\n upperCornersEnd?: Corners;\n lowerCornersMid?: Corners;\n lowerCornersEnd?: Corners;\n upperText?: string;\n lowerText?: string;\n upperFontFamily?: string;\n lowerFontFamily?: string;\n upperFontSize?: number;\n lowerFontSize?: number;\n capRatio?: number;\n lineGap?: number;\n scaleKeyframes?: number[];\n lowerScaleY?: number[];\n upperScaleY?: number[];\n fill?: string;\n}\n\nfunction cornerPinMatrix(src: Corners, dst: Corners): string {\n const a: number[][] = [];\n const rhs: number[] = [];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = src[i];\n const [u, v] = dst[i];\n a.push([x, y, 1, 0, 0, 0, -u * x, -u * y]);\n rhs.push(u);\n a.push([0, 0, 0, x, y, 1, -v * x, -v * y]);\n rhs.push(v);\n }\n\n const n = 8;\n for (let col = 0; col < n; col++) {\n let pivot = col;\n for (let r = col + 1; r < n; r++) {\n if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;\n }\n [a[col], a[pivot]] = [a[pivot], a[col]];\n [rhs[col], rhs[pivot]] = [rhs[pivot], rhs[col]];\n\n const d = a[col][col];\n if (Math.abs(d) < 1e-12) continue;\n for (let c = col; c < n; c++) a[col][c] /= d;\n rhs[col] /= d;\n\n for (let r = 0; r < n; r++) {\n if (r === col) continue;\n const f = a[r][col];\n if (f === 0) continue;\n for (let c = col; c < n; c++) a[r][c] -= f * a[col][c];\n rhs[r] -= f * rhs[col];\n }\n }\n\n const [m0, m1, m2, m3, m4, m5, m6, m7] = rhs;\n return `matrix3d(${m0}, ${m3}, 0, ${m6}, ${m1}, ${m4}, 0, ${m7}, 0, 0, 1, 0, ${m2}, ${m5}, 0, 1)`;\n}\n\nfunction lerpCorners(from: Corners, to: Corners, t: number): Corners {\n return from.map((p, i) => [\n p[0] + (to[i][0] - p[0]) * t,\n p[1] + (to[i][1] - p[1]) * t,\n ]) as Corners;\n}\n\nexport function PerspectiveSqueeze({\n className,\n width = 1920,\n height = 1080,\n blockWidth = 990,\n blockHeight = 546,\n lowerBlockPosition = [960, 860],\n upperBlockPosition = [960, 314],\n cornersRest = [\n [0, 0],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n cornerKeyframes = [0, 45, 70],\n upperCornersMid = [\n [0, -326],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n upperCornersEnd = [\n [0, 352],\n [990, -428],\n [460, 546],\n [990, 546],\n ],\n lowerCornersMid = [\n [0, 0],\n [990, 0],\n [0, 225],\n [990, 546],\n ],\n lowerCornersEnd = [\n [0, 0],\n [990, 0],\n [0, 897],\n [990, 116],\n ],\n upperText = \"REMOCN\",\n lowerText = \"BEST\",\n upperFontFamily = \"sans-serif\",\n lowerFontFamily = \"sans-serif\",\n upperFontSize = 603,\n lowerFontSize = 124,\n capRatio = 0.65,\n lineGap = 50,\n scaleKeyframes = [0, 60, 118, 161, 196, 225],\n lowerScaleY = [100, 384.8, 270, 330, 150, 100],\n upperScaleY = [100, 35.8, 64, 45, 110, 100],\n fill = \"#ffffff\",\n}: PerspectiveSqueezeProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const stageScale = Math.min(compWidth / width, compHeight / height);\n\n const squishEase = Easing.bezier(0.6, 0, 0.4, 1);\n\n const scaleAt = (track: number[]) =>\n interpolate(frame, scaleKeyframes, track, {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: squishEase,\n }) / 100;\n\n const cornersAt = (mid: Corners, end: Corners): Corners => {\n const [k0, k1, k2] = cornerKeyframes;\n if (frame <= k0) return cornersRest;\n if (frame >= k2) return end;\n if (frame <= k1) {\n return lerpCorners(\n cornersRest,\n mid,\n squishEase((frame - k0) / Math.max(k1 - k0, 1)),\n );\n }\n return lerpCorners(\n mid,\n end,\n squishEase((frame - k1) / Math.max(k2 - k1, 1)),\n );\n };\n\n const upperScale = scaleAt(upperScaleY);\n const lowerScale = scaleAt(lowerScaleY);\n\n const upperBoxHeight = upperFontSize * capRatio * upperScale;\n const lowerBoxHeight = lowerFontSize * capRatio * lowerScale;\n const stackTop =\n (blockHeight - (upperBoxHeight + lineGap + lowerBoxHeight)) / 2;\n const upperBaseline = stackTop + upperBoxHeight;\n const lowerBaseline = upperBaseline + lineGap + lowerBoxHeight;\n\n const line = (\n text: string,\n family: string,\n size: number,\n baseline: number,\n scale: number,\n ) => (\n <text\n x={0}\n y={baseline}\n textLength={blockWidth}\n lengthAdjust=\"spacingAndGlyphs\"\n fontFamily={family}\n fontSize={size}\n fontWeight={800}\n fill={fill}\n transform={`matrix(1, 0, 0, ${scale}, 0, ${baseline * (1 - scale)})`}\n >\n {text}\n </text>\n );\n\n const block = (corners: Corners, position: [number, number]) => (\n <div\n style={{\n position: \"absolute\",\n left: position[0] - blockWidth / 2,\n top: position[1] - blockHeight / 2,\n width: blockWidth,\n height: blockHeight,\n transformOrigin: \"0 0\",\n transform: cornerPinMatrix(cornersRest, corners),\n }}\n >\n <svg\n width={blockWidth}\n height={blockHeight}\n viewBox={`0 0 ${blockWidth} ${blockHeight}`}\n style={{ display: \"block\", overflow: \"hidden\" }}\n >\n {line(\n upperText,\n upperFontFamily,\n upperFontSize,\n upperBaseline,\n upperScale,\n )}\n {line(\n lowerText,\n lowerFontFamily,\n lowerFontSize,\n lowerBaseline,\n lowerScale,\n )}\n </svg>\n </div>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (compWidth - width * stageScale) / 2,\n top: (compHeight - height * stageScale) / 2,\n width,\n height,\n transform: `scale(${stageScale})`,\n transformOrigin: \"0 0\",\n }}\n >\n {block(cornersAt(upperCornersMid, upperCornersEnd), upperBlockPosition)}\n {block(cornersAt(lowerCornersMid, lowerCornersEnd), lowerBlockPosition)}\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\ntype Corners = [\n [number, number],\n [number, number],\n [number, number],\n [number, number],\n];\n\nexport interface PerspectiveSqueezeProps {\n className?: string;\n width?: number;\n height?: number;\n blockWidth?: number;\n blockHeight?: number;\n lowerBlockPosition?: [number, number];\n upperBlockPosition?: [number, number];\n cornersRest?: Corners;\n cornerKeyframes?: number[];\n upperCornersMid?: Corners;\n upperCornersEnd?: Corners;\n lowerCornersMid?: Corners;\n lowerCornersEnd?: Corners;\n upperText?: string;\n lowerText?: string;\n upperFontFamily?: string;\n lowerFontFamily?: string;\n upperFontSize?: number;\n lowerFontSize?: number;\n capRatio?: number;\n lineGap?: number;\n scaleKeyframes?: number[];\n lowerScaleY?: number[];\n upperScaleY?: number[];\n fill?: string;\n}\n\nfunction cornerPinMatrix(src: Corners, dst: Corners): string {\n const a: number[][] = [];\n const rhs: number[] = [];\n\n for (let i = 0; i < 4; i++) {\n const [x, y] = src[i];\n const [u, v] = dst[i];\n a.push([x, y, 1, 0, 0, 0, -u * x, -u * y]);\n rhs.push(u);\n a.push([0, 0, 0, x, y, 1, -v * x, -v * y]);\n rhs.push(v);\n }\n\n const n = 8;\n for (let col = 0; col < n; col++) {\n let pivot = col;\n for (let r = col + 1; r < n; r++) {\n if (Math.abs(a[r][col]) > Math.abs(a[pivot][col])) pivot = r;\n }\n [a[col], a[pivot]] = [a[pivot], a[col]];\n [rhs[col], rhs[pivot]] = [rhs[pivot], rhs[col]];\n\n const d = a[col][col];\n if (Math.abs(d) < 1e-12) continue;\n for (let c = col; c < n; c++) a[col][c] /= d;\n rhs[col] /= d;\n\n for (let r = 0; r < n; r++) {\n if (r === col) continue;\n const f = a[r][col];\n if (f === 0) continue;\n for (let c = col; c < n; c++) a[r][c] -= f * a[col][c];\n rhs[r] -= f * rhs[col];\n }\n }\n\n const [m0, m1, m2, m3, m4, m5, m6, m7] = rhs;\n return `matrix3d(${m0}, ${m3}, 0, ${m6}, ${m1}, ${m4}, 0, ${m7}, 0, 0, 1, 0, ${m2}, ${m5}, 0, 1)`;\n}\n\nfunction lerpCorners(from: Corners, to: Corners, t: number): Corners {\n return from.map((p, i) => [\n p[0] + (to[i][0] - p[0]) * t,\n p[1] + (to[i][1] - p[1]) * t,\n ]) as Corners;\n}\n\nexport function PerspectiveSqueeze({\n className,\n width = 1920,\n height = 1080,\n blockWidth = 990,\n blockHeight = 546,\n lowerBlockPosition = [960, 860],\n upperBlockPosition = [960, 314],\n cornersRest = [\n [0, 0],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n cornerKeyframes = [0, 45, 70],\n upperCornersMid = [\n [0, -326],\n [990, 0],\n [0, 546],\n [990, 546],\n ],\n upperCornersEnd = [\n [0, 352],\n [990, -428],\n [460, 546],\n [990, 546],\n ],\n lowerCornersMid = [\n [0, 0],\n [990, 0],\n [0, 225],\n [990, 546],\n ],\n lowerCornersEnd = [\n [0, 0],\n [990, 0],\n [0, 897],\n [990, 116],\n ],\n upperText = \"REMOCN\",\n lowerText = \"BEST\",\n upperFontFamily = \"sans-serif\",\n lowerFontFamily = \"sans-serif\",\n upperFontSize = 603,\n lowerFontSize = 124,\n capRatio = 0.65,\n lineGap = 50,\n scaleKeyframes = [0, 60, 118, 161, 196, 225],\n lowerScaleY = [100, 384.8, 270, 330, 150, 100],\n upperScaleY = [100, 35.8, 64, 45, 110, 100],\n fill = \"#ffffff\",\n}: PerspectiveSqueezeProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const stageScale = Math.min(compWidth / width, compHeight / height);\n\n const squishEase = Easing.bezier(0.6, 0, 0.4, 1);\n\n const scaleAt = (track: number[]) =>\n interpolate(frame, scaleKeyframes, track, {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: squishEase,\n }) / 100;\n\n const cornersAt = (mid: Corners, end: Corners): Corners => {\n const [k0, k1, k2] = cornerKeyframes;\n if (frame <= k0) return cornersRest;\n if (frame >= k2) return end;\n if (frame <= k1) {\n return lerpCorners(\n cornersRest,\n mid,\n squishEase((frame - k0) / Math.max(k1 - k0, 1)),\n );\n }\n return lerpCorners(\n mid,\n end,\n squishEase((frame - k1) / Math.max(k2 - k1, 1)),\n );\n };\n\n const upperScale = scaleAt(upperScaleY);\n const lowerScale = scaleAt(lowerScaleY);\n\n const upperBoxHeight = upperFontSize * capRatio * upperScale;\n const lowerBoxHeight = lowerFontSize * capRatio * lowerScale;\n const stackTop =\n (blockHeight - (upperBoxHeight + lineGap + lowerBoxHeight)) / 2;\n const upperBaseline = stackTop + upperBoxHeight;\n const lowerBaseline = upperBaseline + lineGap + lowerBoxHeight;\n\n const line = (\n text: string,\n family: string,\n size: number,\n baseline: number,\n scale: number,\n ) => (\n <text\n x={0}\n y={baseline}\n textLength={blockWidth}\n lengthAdjust=\"spacingAndGlyphs\"\n fontFamily={family}\n fontSize={size}\n fontWeight={800}\n fill={fill}\n transform={`matrix(1, 0, 0, ${scale}, 0, ${baseline * (1 - scale)})`}\n >\n {text}\n </text>\n );\n\n const block = (corners: Corners, position: [number, number]) => (\n <div\n style={{\n position: \"absolute\",\n left: position[0] - blockWidth / 2,\n top: position[1] - blockHeight / 2,\n width: blockWidth,\n height: blockHeight,\n transformOrigin: \"0 0\",\n transform: cornerPinMatrix(cornersRest, corners),\n }}\n >\n <svg\n width={blockWidth}\n height={blockHeight}\n viewBox={`0 0 ${blockWidth} ${blockHeight}`}\n style={{ display: \"block\", overflow: \"hidden\" }}\n >\n {line(\n upperText,\n upperFontFamily,\n upperFontSize,\n upperBaseline,\n upperScale,\n )}\n {line(\n lowerText,\n lowerFontFamily,\n lowerFontSize,\n lowerBaseline,\n lowerScale,\n )}\n </svg>\n </div>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: (compWidth - width * stageScale) / 2,\n top: (compHeight - height * stageScale) / 2,\n width,\n height,\n scale: `${stageScale}`,\n transformOrigin: \"0 0\",\n }}\n >\n {block(cornersAt(upperCornersMid, upperCornersEnd), upperBlockPosition)}\n {block(cornersAt(lowerCornersMid, lowerCornersEnd), lowerBlockPosition)}\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/perspective-squeeze.tsx"
}
diff --git a/registry-artifacts/push-through.json b/registry-artifacts/push-through.json
index f7754162..f6bd860c 100644
--- a/registry-artifacts/push-through.json
+++ b/registry-artifacts/push-through.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/push-through/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type PushThroughProps = {\n zoom?: number;\n blur?: number;\n};\n\nconst PushThroughPresentation: React.FC<\n TransitionPresentationComponentProps<PushThroughProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { zoom = 2.4, blur = 14 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.4, 0.62], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0, 0.65], [1, zoom], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.15, 0.6], [0, blur], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.3, 0.88, 1], [0.68, 1.02, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.3, 0.75], [blur * 0.7, 0], clampOpts)}px)`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function pushThrough(\n props: PushThroughProps = {},\n): TransitionPresentation<PushThroughProps> {\n return {\n component: PushThroughPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type PushThroughProps = {\n zoom?: number;\n blur?: number;\n};\n\nconst PushThroughPresentation: React.FC<\n TransitionPresentationComponentProps<PushThroughProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { zoom = 2.4, blur = 14 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.4, 0.62], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n scale: `${interpolate(p, [0, 0.65], [1, zoom], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.15, 0.6], [0, blur], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.3, 0.88, 1], [0.68, 1.02, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.3, 0.75], [blur * 0.7, 0], clampOpts)}px)`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function pushThrough(\n props: PushThroughProps = {},\n): TransitionPresentation<PushThroughProps> {\n return {\n component: PushThroughPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/push-through.tsx"
}
diff --git a/registry-artifacts/reel.json b/registry-artifacts/reel.json
index 5171cdae..cd3cd798 100644
--- a/registry-artifacts/reel.json
+++ b/registry-artifacts/reel.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/reel/index.tsx",
- "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst EASE_OUT = Easing.out(Easing.cubic);\n\nexport type ReelProps = {\n images: string[];\n width?: number;\n height?: number;\n radius?: number;\n step?: number;\n reveal?: number;\n objectPosition?: string;\n background?: string;\n};\n\nexport function Reel({\n images,\n width = 1180,\n height = 676,\n radius = 16,\n step = 20,\n reveal = 13,\n objectPosition = \"top\",\n background = \"#050506\",\n}: ReelProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const left = (compWidth - width) / 2;\n const top = (compHeight - height) / 2;\n\n return (\n <AbsoluteFill>\n {images.map((src, i) => {\n const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {\n ...clamp,\n easing: EASE_OUT,\n });\n if (p <= 0) return null;\n const inset = (1 - p) * 50;\n const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left,\n top,\n width,\n height,\n zIndex: i,\n clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n background,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.6)\",\n willChange: \"clip-path\",\n }}\n >\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n objectPosition,\n transform: `scale(${imgScale})`,\n willChange: \"transform\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst EASE_OUT = Easing.out(Easing.cubic);\n\nexport type ReelProps = {\n images: string[];\n width?: number;\n height?: number;\n radius?: number;\n step?: number;\n reveal?: number;\n objectPosition?: string;\n background?: string;\n};\n\nexport function Reel({\n images,\n width = 1180,\n height = 676,\n radius = 16,\n step = 20,\n reveal = 13,\n objectPosition = \"top\",\n background = \"#050506\",\n}: ReelProps) {\n const frame = useCurrentFrame();\n const { width: compWidth, height: compHeight } = useVideoConfig();\n const left = (compWidth - width) / 2;\n const top = (compHeight - height) / 2;\n\n return (\n <AbsoluteFill>\n {images.map((src, i) => {\n const p = interpolate(frame, [i * step, i * step + reveal], [0, 1], {\n ...clamp,\n easing: EASE_OUT,\n });\n if (p <= 0) return null;\n const inset = (1 - p) * 50;\n const imgScale = interpolate(p, [0, 1], [1.08, 1], clamp);\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left,\n top,\n width,\n height,\n zIndex: i,\n clipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n WebkitClipPath: `inset(${inset}% ${inset}% round ${radius}px)`,\n background,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.6)\",\n willChange: \"clip-path\",\n }}\n >\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n objectPosition,\n scale: `${imgScale}`,\n willChange: \"transform\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/reel.tsx"
}
diff --git a/registry-artifacts/rgb-glitch-text.json b/registry-artifacts/rgb-glitch-text.json
index f02faf8f..44edb203 100644
--- a/registry-artifacts/rgb-glitch-text.json
+++ b/registry-artifacts/rgb-glitch-text.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/rgb-glitch-text/index.tsx",
- "content": "\"use client\";\n\nimport { random, useCurrentFrame } from \"remotion\";\n\nexport interface RGBGlitchTextProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n glitchAt?: number;\n glitchDuration?: number;\n intensity?: number;\n seed?: string;\n speed?: number;\n className?: string;\n}\n\nexport function RGBGlitchText({\n text,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n glitchAt = 20,\n glitchDuration = 8,\n intensity = 6,\n seed = \"glitch\",\n speed = 1,\n className,\n}: RGBGlitchTextProps) {\n const frame = useCurrentFrame() * speed;\n\n const isGlitching = frame >= glitchAt && frame < glitchAt + glitchDuration;\n\n const offset = (axisSeed: string, scale: number) =>\n (random(`${seed}-${axisSeed}-${frame}`) * 2 - 1) * scale;\n\n const rX = isGlitching ? offset(\"r-x\", intensity) : 0;\n const rY = isGlitching ? offset(\"r-y\", intensity * 0.4) : 0;\n const gX = isGlitching ? offset(\"g-x\", intensity) : 0;\n const gY = isGlitching ? offset(\"g-y\", intensity * 0.4) : 0;\n const bX = isGlitching ? offset(\"b-x\", intensity) : 0;\n const bY = isGlitching ? offset(\"b-y\", intensity * 0.4) : 0;\n\n const copyOpacity = isGlitching ? 1 : 0;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n mixBlendMode: \"multiply\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#fafafa\",\n }}\n >\n <div\n className={className}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <span\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#ff0040\",\n opacity: copyOpacity,\n transform: `translateX(${rX}px) translateY(${rY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#00ff80\",\n opacity: copyOpacity,\n transform: `translateX(${gX}px) translateY(${gY}px)`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#0080ff\",\n opacity: copyOpacity,\n transform: `translateX(${bX}px) translateY(${bY}px)`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { random, useCurrentFrame } from \"remotion\";\n\nexport interface RGBGlitchTextProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n glitchAt?: number;\n glitchDuration?: number;\n intensity?: number;\n seed?: string;\n speed?: number;\n className?: string;\n}\n\nexport function RGBGlitchText({\n text,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n glitchAt = 20,\n glitchDuration = 8,\n intensity = 6,\n seed = \"glitch\",\n speed = 1,\n className,\n}: RGBGlitchTextProps) {\n const frame = useCurrentFrame() * speed;\n\n const isGlitching = frame >= glitchAt && frame < glitchAt + glitchDuration;\n\n const offset = (axisSeed: string, scale: number) =>\n (random(`${seed}-${axisSeed}-${frame}`) * 2 - 1) * scale;\n\n const rX = isGlitching ? offset(\"r-x\", intensity) : 0;\n const rY = isGlitching ? offset(\"r-y\", intensity * 0.4) : 0;\n const gX = isGlitching ? offset(\"g-x\", intensity) : 0;\n const gY = isGlitching ? offset(\"g-y\", intensity * 0.4) : 0;\n const bX = isGlitching ? offset(\"b-x\", intensity) : 0;\n const bY = isGlitching ? offset(\"b-y\", intensity * 0.4) : 0;\n\n const copyOpacity = isGlitching ? 1 : 0;\n\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n top: 0,\n left: 0,\n fontSize,\n fontWeight,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n mixBlendMode: \"multiply\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#fafafa\",\n }}\n >\n <div\n className={className}\n style={{ position: \"relative\", display: \"inline-block\" }}\n >\n <span\n style={{\n position: \"relative\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"pre\",\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#ff0040\",\n opacity: copyOpacity,\n translate: `${rX}px ${rY}px`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#00ff80\",\n opacity: copyOpacity,\n translate: `${gX}px ${gY}px`,\n }}\n >\n {text}\n </span>\n <span\n style={{\n ...baseStyle,\n color: \"#0080ff\",\n opacity: copyOpacity,\n translate: `${bX}px ${bY}px`,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/rgb-glitch-text.tsx"
}
diff --git a/registry-artifacts/ripple-zoom.json b/registry-artifacts/ripple-zoom.json
index 5645db21..e380bf78 100644
--- a/registry-artifacts/ripple-zoom.json
+++ b/registry-artifacts/ripple-zoom.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/ripple-zoom/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type RippleZoomProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst RippleZoomPresentation: React.FC<\n TransitionPresentationComponentProps<RippleZoomProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.5,\n softness = 0.5,\n noise = 0.5,\n zoom = 4,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.35, 0.55], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0.3, 0.62], [1, 1.6], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.08, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = interpolate(p, [0.32, 1], [0.2, zoom], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.3, 1),\n });\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.45, 0.62], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.42, 0.97], [0.2, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.33, 1, 0.68, 1),\n })})`,\n filter: `blur(${interpolate(p, [0.42, 0.8], [8, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"ripple\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function rippleZoom(\n props: RippleZoomProps = {},\n): TransitionPresentation<RippleZoomProps> {\n return {\n component: RippleZoomPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type RippleZoomProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst RippleZoomPresentation: React.FC<\n TransitionPresentationComponentProps<RippleZoomProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.5,\n softness = 0.5,\n noise = 0.5,\n zoom = 4,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.35, 0.55], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n scale: `${interpolate(p, [0.3, 0.62], [1, 1.6], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.08, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = interpolate(p, [0.32, 1], [0.2, zoom], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.3, 1),\n });\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.45, 0.62], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.42, 0.97], [0.2, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.33, 1, 0.68, 1),\n })}`,\n filter: `blur(${interpolate(p, [0.42, 0.8], [8, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"ripple\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function rippleZoom(\n props: RippleZoomProps = {},\n): TransitionPresentation<RippleZoomProps> {\n return {\n component: RippleZoomPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/ripple-zoom.tsx"
}
diff --git a/registry-artifacts/rolling-number.json b/registry-artifacts/rolling-number.json
index 28e8f42d..69b8d23d 100644
--- a/registry-artifacts/rolling-number.json
+++ b/registry-artifacts/rolling-number.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/rolling-number/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n translate: `0 ${(1 - reveal) * fontSize * REVEAL_RISE_EM}px`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n translate: `0 ${-value * cellHeight}px`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/rolling-number.tsx"
}
diff --git a/registry-artifacts/scale-down-fade.json b/registry-artifacts/scale-down-fade.json
index 835e7bf7..d5b7aa25 100644
--- a/registry-artifacts/scale-down-fade.json
+++ b/registry-artifacts/scale-down-fade.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/scale-down-fade/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ScaleDownFade({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ScaleDownFade({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n translate: `0 ${y}px`,\n scale: `${scale}`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/scale-down-fade.tsx"
}
diff --git a/registry-artifacts/shared-axis-z.json b/registry-artifacts/shared-axis-z.json
index ce24bd3b..8e57377f 100644
--- a/registry-artifacts/shared-axis-z.json
+++ b/registry-artifacts/shared-axis-z.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/shared-axis-z/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SharedAxisZProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SharedAxisZ({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisZProps) {\n const frame = useCurrentFrame() * speed;\n\n const enterDur = 16;\n const exitDur = 11;\n const overlapF = 3;\n const microDelayF = 1;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toBlur = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n transform: `scale(${fromScale})`,\n filter: `blur(${fromBlur}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n transform: `scale(${toScale})`,\n filter: `blur(${toBlur}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SharedAxisZProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SharedAxisZ({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisZProps) {\n const frame = useCurrentFrame() * speed;\n\n const enterDur = 16;\n const exitDur = 11;\n const overlapF = 3;\n const microDelayF = 1;\n\n const exitTotal = exitDur;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const exitEasing = Easing.bezier(0.4, 0, 1, 1);\n const enterEasing = Easing.bezier(0.2, 0, 0, 1);\n\n const fromOpacity = interpolate(frame, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromScale = interpolate(frame, [0, exitDur], [1, 1.06], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n const fromBlur = interpolate(frame, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const local = frame - newStart;\n const toOpacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toScale = interpolate(local, [0, enterDur], [0.9, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n const toBlur = interpolate(local, [0, enterDur], [2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: fromOpacity,\n scale: `${fromScale}`,\n filter: `blur(${fromBlur}px)`,\n }}\n >\n {fromText}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity: toOpacity,\n scale: `${toScale}`,\n filter: `blur(${toBlur}px)`,\n }}\n >\n {toText}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/shared-axis-z.tsx"
}
diff --git a/registry-artifacts/short-slide-right.json b/registry-artifacts/short-slide-right.json
index b6b74009..e6ab82b4 100644
--- a/registry-artifacts/short-slide-right.json
+++ b/registry-artifacts/short-slide-right.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/short-slide-right/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ShortSlideRight({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const travelDur = 8;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, travelDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transform: `translateX(${x}px)`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ShortSlideRight({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const travelDur = 8;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, travelDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n translate: `${x}px`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/short-slide-right.tsx"
}
diff --git a/registry-artifacts/simulated-cursor.json b/registry-artifacts/simulated-cursor.json
index 574ed4c1..19ac4365 100644
--- a/registry-artifacts/simulated-cursor.json
+++ b/registry-artifacts/simulated-cursor.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/simulated-cursor/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\nexport interface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nexport function SimulatedCursor({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n transform: `scale(${clickScale})`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\nexport interface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nexport function SimulatedCursor({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n scale: `${clickScale}`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/simulated-cursor.tsx"
}
diff --git a/registry-artifacts/slide-swap.json b/registry-artifacts/slide-swap.json
index 230cca77..b7801474 100644
--- a/registry-artifacts/slide-swap.json
+++ b/registry-artifacts/slide-swap.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/slide-swap/index.tsx",
- "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type SlideSwapConfig = {\n sceneFrames: number;\n slideFrames: number;\n inDistance: number;\n inDamping: number;\n inStiffness: number;\n inMass: number;\n inFadeFrames: number;\n outFrames: number;\n outDistance: number;\n outPower: number;\n};\n\nexport const SLIDE_SWAP_DEFAULTS: SlideSwapConfig = {\n sceneFrames: 70,\n slideFrames: 30,\n inDistance: 0.28,\n inDamping: 60,\n inStiffness: 300,\n inMass: 0.5,\n inFadeFrames: 24,\n outFrames: 22,\n outDistance: 0.1,\n outPower: 5,\n};\n\nexport type SlideAxis = \"x\" | \"y\";\n\nconst translate = (axis: SlideAxis, v: number) =>\n axis === \"x\" ? `translateX(${v}px)` : `translateY(${v}px)`;\n\nexport const slideInStyle = (\n e: number,\n size: number,\n fps: number,\n config?: Partial<SlideSwapConfig>,\n axis: SlideAxis = \"x\",\n): CSSProperties => {\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n if (e >= cfg.slideFrames) return {};\n const p = spring({\n frame: Math.max(e, 0),\n fps,\n config: {\n damping: cfg.inDamping,\n stiffness: cfg.inStiffness,\n mass: cfg.inMass,\n overshootClamping: true,\n },\n });\n const tFade = Math.min(Math.max(e / cfg.inFadeFrames, 0), 1);\n return {\n transform: translate(axis, cfg.inDistance * size * (1 - p)),\n opacity: 1 - (1 - tFade) * (1 - tFade),\n willChange: \"transform, opacity\",\n };\n};\n\nexport const slideOutStyle = (\n e: number,\n size: number,\n config?: Partial<SlideSwapConfig>,\n axis: SlideAxis = \"x\",\n): CSSProperties => {\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n if (e <= 0) return {};\n const t = Math.min(e / cfg.outFrames, 1);\n return {\n transform: translate(axis, -cfg.outDistance * size * t ** cfg.outPower),\n opacity: 1 - t * t,\n willChange: \"transform, opacity\",\n };\n};\n\nexport type SlideSwapSceneDef = {\n name?: string;\n durationInFrames?: number;\n content: ReactNode;\n};\n\nexport type SlideSwapPhase = \"slide\" | \"dwell\" | \"exit\";\n\nexport type SlideSwapTimeline = {\n index: number;\n local: number;\n dwellFrames: number;\n phase: SlideSwapPhase;\n};\n\nexport const slideSwapTimeline = (\n frame: number,\n scenes: SlideSwapSceneDef[],\n config?: Partial<SlideSwapConfig>,\n opts?: { loop?: boolean },\n): SlideSwapTimeline => {\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n const lens = scenes.map((s) => s.durationInFrames ?? cfg.sceneFrames);\n const total = lens.reduce((a, b) => a + b, 0);\n let w = opts?.loop\n ? ((frame % total) + total) % total\n : Math.min(frame, total - 1);\n let index = 0;\n while (index < scenes.length - 1 && w >= lens[index]) {\n w -= lens[index];\n index += 1;\n }\n const local = Math.min(w, lens[index] - 1);\n const dwellFrames = lens[index];\n const exits = index < scenes.length - 1 || Boolean(opts?.loop);\n const enters = index > 0 || Boolean(opts?.loop);\n const phase: SlideSwapPhase =\n exits && local >= dwellFrames - cfg.outFrames\n ? \"exit\"\n : enters && local + 1 < cfg.slideFrames\n ? \"slide\"\n : \"dwell\";\n return { index, local, dwellFrames, phase };\n};\n\nexport interface SlideSwapScenesProps {\n scenes: SlideSwapSceneDef[];\n bg?: string;\n axis?: SlideAxis;\n config?: Partial<SlideSwapConfig>;\n loop?: boolean;\n style?: CSSProperties;\n}\n\nexport function SlideSwapScenes({\n scenes,\n bg,\n axis = \"x\",\n config,\n loop = false,\n style,\n}: SlideSwapScenesProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n const size = axis === \"x\" ? width : height;\n\n const { index, local, dwellFrames, phase } = slideSwapTimeline(\n frame,\n scenes,\n cfg,\n { loop },\n );\n const cur = scenes[index];\n const enters = index > 0 || loop;\n\n const sceneStyle =\n phase === \"exit\"\n ? slideOutStyle(local - (dwellFrames - cfg.outFrames), size, cfg, axis)\n : enters\n ? slideInStyle(local + 1, size, fps, cfg, axis)\n : undefined;\n\n return (\n <AbsoluteFill style={{ background: bg, ...style }}>\n <AbsoluteFill style={sceneStyle}>{cur.content}</AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type SlideSwapConfig = {\n sceneFrames: number;\n slideFrames: number;\n inDistance: number;\n inDamping: number;\n inStiffness: number;\n inMass: number;\n inFadeFrames: number;\n outFrames: number;\n outDistance: number;\n outPower: number;\n};\n\nexport const SLIDE_SWAP_DEFAULTS: SlideSwapConfig = {\n sceneFrames: 70,\n slideFrames: 30,\n inDistance: 0.28,\n inDamping: 60,\n inStiffness: 300,\n inMass: 0.5,\n inFadeFrames: 24,\n outFrames: 22,\n outDistance: 0.1,\n outPower: 5,\n};\n\nexport type SlideAxis = \"x\" | \"y\";\n\nconst translate = (axis: SlideAxis, v: number) =>\n axis === \"x\" ? `${v}px` : `0 ${v}px`;\n\nexport const slideInStyle = (\n e: number,\n size: number,\n fps: number,\n config?: Partial<SlideSwapConfig>,\n axis: SlideAxis = \"x\",\n): CSSProperties => {\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n if (e >= cfg.slideFrames) return {};\n const p = spring({\n frame: Math.max(e, 0),\n fps,\n config: {\n damping: cfg.inDamping,\n stiffness: cfg.inStiffness,\n mass: cfg.inMass,\n overshootClamping: true,\n },\n });\n const tFade = Math.min(Math.max(e / cfg.inFadeFrames, 0), 1);\n return {\n translate: translate(axis, cfg.inDistance * size * (1 - p)),\n opacity: 1 - (1 - tFade) * (1 - tFade),\n willChange: \"transform, opacity\",\n };\n};\n\nexport const slideOutStyle = (\n e: number,\n size: number,\n config?: Partial<SlideSwapConfig>,\n axis: SlideAxis = \"x\",\n): CSSProperties => {\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n if (e <= 0) return {};\n const t = Math.min(e / cfg.outFrames, 1);\n return {\n translate: translate(axis, -cfg.outDistance * size * t ** cfg.outPower),\n opacity: 1 - t * t,\n willChange: \"transform, opacity\",\n };\n};\n\nexport type SlideSwapSceneDef = {\n name?: string;\n durationInFrames?: number;\n content: ReactNode;\n};\n\nexport type SlideSwapPhase = \"slide\" | \"dwell\" | \"exit\";\n\nexport type SlideSwapTimeline = {\n index: number;\n local: number;\n dwellFrames: number;\n phase: SlideSwapPhase;\n};\n\nexport const slideSwapTimeline = (\n frame: number,\n scenes: SlideSwapSceneDef[],\n config?: Partial<SlideSwapConfig>,\n opts?: { loop?: boolean },\n): SlideSwapTimeline => {\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n const lens = scenes.map((s) => s.durationInFrames ?? cfg.sceneFrames);\n const total = lens.reduce((a, b) => a + b, 0);\n let w = opts?.loop\n ? ((frame % total) + total) % total\n : Math.min(frame, total - 1);\n let index = 0;\n while (index < scenes.length - 1 && w >= lens[index]) {\n w -= lens[index];\n index += 1;\n }\n const local = Math.min(w, lens[index] - 1);\n const dwellFrames = lens[index];\n const exits = index < scenes.length - 1 || Boolean(opts?.loop);\n const enters = index > 0 || Boolean(opts?.loop);\n const phase: SlideSwapPhase =\n exits && local >= dwellFrames - cfg.outFrames\n ? \"exit\"\n : enters && local + 1 < cfg.slideFrames\n ? \"slide\"\n : \"dwell\";\n return { index, local, dwellFrames, phase };\n};\n\nexport interface SlideSwapScenesProps {\n scenes: SlideSwapSceneDef[];\n bg?: string;\n axis?: SlideAxis;\n config?: Partial<SlideSwapConfig>;\n loop?: boolean;\n style?: CSSProperties;\n}\n\nexport function SlideSwapScenes({\n scenes,\n bg,\n axis = \"x\",\n config,\n loop = false,\n style,\n}: SlideSwapScenesProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const cfg = { ...SLIDE_SWAP_DEFAULTS, ...config };\n const size = axis === \"x\" ? width : height;\n\n const { index, local, dwellFrames, phase } = slideSwapTimeline(\n frame,\n scenes,\n cfg,\n { loop },\n );\n const cur = scenes[index];\n const enters = index > 0 || loop;\n\n const sceneStyle =\n phase === \"exit\"\n ? slideOutStyle(local - (dwellFrames - cfg.outFrames), size, cfg, axis)\n : enters\n ? slideInStyle(local + 1, size, fps, cfg, axis)\n : undefined;\n\n return (\n <AbsoluteFill style={{ background: bg, ...style }}>\n <AbsoluteFill style={sceneStyle}>{cur.content}</AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/slide-swap.tsx"
}
diff --git a/registry-artifacts/slot-machine-roll.json b/registry-artifacts/slot-machine-roll.json
index ed2c0998..f6976a4d 100644
--- a/registry-artifacts/slot-machine-roll.json
+++ b/registry-artifacts/slot-machine-roll.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/slot-machine-roll/index.tsx",
- "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SlotMachineRollProps {\n from?: string;\n to?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SlotMachineRoll({\n from = \"$99\",\n to = \"$199\",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: SlotMachineRollProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const len = Math.max(from.length, to.length);\n const paddedFrom = from.padStart(len, \" \");\n const paddedTo = to.padStart(len, \" \");\n\n const columns = [];\n for (let i = 0; i < len; i++) {\n const raw = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 14 },\n });\n const t = Math.max(0, Math.min(1, raw));\n columns.push(\n <span\n key={i}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: \"1.1em\",\n lineHeight: \"1.1em\",\n verticalAlign: \"top\",\n width: \"0.7em\",\n textAlign: \"center\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-t * fontSize * 1.1}px)`,\n }}\n >\n <span>{paddedFrom[i]}</span>\n <span>{paddedTo[i]}</span>\n </span>\n </span>,\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n lineHeight: 1.1,\n }}\n >\n {columns}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SlotMachineRollProps {\n from?: string;\n to?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SlotMachineRoll({\n from = \"$99\",\n to = \"$199\",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: SlotMachineRollProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const len = Math.max(from.length, to.length);\n const paddedFrom = from.padStart(len, \" \");\n const paddedTo = to.padStart(len, \" \");\n\n const columns = [];\n for (let i = 0; i < len; i++) {\n const raw = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 14 },\n });\n const t = Math.max(0, Math.min(1, raw));\n columns.push(\n <span\n key={i}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: \"1.1em\",\n lineHeight: \"1.1em\",\n verticalAlign: \"top\",\n width: \"0.7em\",\n textAlign: \"center\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n translate: `0 ${-t * fontSize * 1.1}px`,\n }}\n >\n <span>{paddedFrom[i]}</span>\n <span>{paddedTo[i]}</span>\n </span>\n </span>,\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n lineHeight: 1.1,\n }}\n >\n {columns}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/slot-machine-roll.tsx"
}
diff --git a/registry-artifacts/smoke-dissolve.json b/registry-artifacts/smoke-dissolve.json
index 4847a3f2..ac7d8268 100644
--- a/registry-artifacts/smoke-dissolve.json
+++ b/registry-artifacts/smoke-dissolve.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/smoke-dissolve/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderSmokeRing } from \"@/components/remocn/shader-smoke-ring\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#8f88ae\"];\n\nexport type SmokeDissolveProps = {\n colorBack?: string;\n colors?: string[];\n speed?: number;\n};\n\nconst SmokeDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SmokeDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colors = DEFAULT_COLORS,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const radius = interpolate(p, [0, 1], [0, 1], clampOpts);\n const scale = interpolate(p, [0, 1], [1, 2], clampOpts);\n const thickness = interpolate(p, [0, 1], [1, 1.5], clampOpts);\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.55, 0.68], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.55, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.55, 0.75], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSmokeRing\n speed={speed}\n colorBack={colorBack}\n colors={colors}\n radius={radius}\n scale={scale}\n thickness={thickness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function smokeDissolve(\n props: SmokeDissolveProps = {},\n): TransitionPresentation<SmokeDissolveProps> {\n return {\n component: SmokeDissolvePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderSmokeRing } from \"@/components/remocn/shader-smoke-ring\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#8f88ae\"];\n\nexport type SmokeDissolveProps = {\n colorBack?: string;\n colors?: string[];\n speed?: number;\n};\n\nconst SmokeDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SmokeDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colors = DEFAULT_COLORS,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const radius = interpolate(p, [0, 1], [0, 1], clampOpts);\n const scale = interpolate(p, [0, 1], [1, 2], clampOpts);\n const thickness = interpolate(p, [0, 1], [1, 1.5], clampOpts);\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.55, 0.68], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.55, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.55, 0.75], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSmokeRing\n speed={speed}\n colorBack={colorBack}\n colors={colors}\n radius={radius}\n scale={scale}\n thickness={thickness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function smokeDissolve(\n props: SmokeDissolveProps = {},\n): TransitionPresentation<SmokeDissolveProps> {\n return {\n component: SmokeDissolvePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/smoke-dissolve.tsx"
}
diff --git a/registry-artifacts/soft-blur-in.json b/registry-artifacts/soft-blur-in.json
index eed26a89..9cc8947c 100644
--- a/registry-artifacts/soft-blur-in.json
+++ b/registry-artifacts/soft-blur-in.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/soft-blur-in/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SoftBlurIn({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const charTravelFrames = 9;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SoftBlurIn({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const charTravelFrames = 9;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/soft-blur-in.tsx"
}
diff --git a/registry-artifacts/spring-scale-in.json b/registry-artifacts/spring-scale-in.json
index 5a0e3fe4..b5ace276 100644
--- a/registry-artifacts/spring-scale-in.json
+++ b/registry-artifacts/spring-scale-in.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/spring-scale-in/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SpringScaleIn({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SpringScaleIn({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n scale: `${scale}`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/spring-scale-in.tsx"
}
diff --git a/registry-artifacts/spring-settle.json b/registry-artifacts/spring-settle.json
index 6be7edcd..bbc9cf5c 100644
--- a/registry-artifacts/spring-settle.json
+++ b/registry-artifacts/spring-settle.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/spring-settle/index.tsx",
- "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createContext, useContext } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { CLAMP, FADE, stagger } from \"@/lib/remocn/scene-motion\";\n\nexport type SpringSettleConfig = {\n sceneFrames: number;\n gapFrames: number;\n enterScale: number;\n enterFadeFrames: number;\n enterStagger: number;\n enterStaggerPower: number;\n enterStaggerJitter: number;\n springDamping: number;\n springStiffness: number;\n springMass: number;\n exitFrames: number;\n exitScale: number;\n exitPower: number;\n bgFadeFrames: number;\n};\n\nexport const SPRING_SETTLE_DEFAULTS: SpringSettleConfig = {\n sceneFrames: 70,\n gapFrames: 1,\n enterScale: 1.24,\n enterFadeFrames: 5,\n enterStagger: 3,\n enterStaggerPower: 0.8,\n enterStaggerJitter: 1,\n springDamping: 30,\n springStiffness: 320,\n springMass: 1,\n exitFrames: 6,\n exitScale: 0.84,\n exitPower: 5,\n bgFadeFrames: 4,\n};\n\nexport type SpringSettleSceneDef = {\n name?: string;\n bg?: string;\n durationInFrames?: number;\n content: ReactNode;\n};\n\nexport type SpringSettlePhase = \"enter\" | \"dwell\" | \"exit\" | \"gap\";\n\nexport type SpringSettleTimeline = {\n index: number;\n local: number;\n dwellFrames: number;\n};\n\ntype SceneClock = {\n local: number;\n cfg: SpringSettleConfig;\n fps: number;\n};\n\nconst SceneCtx = createContext<SceneClock | null>(null);\n\nconst resolveConfig = (\n config?: Partial<SpringSettleConfig>,\n): SpringSettleConfig => ({ ...SPRING_SETTLE_DEFAULTS, ...config });\n\nconst dwellOf = (scene: SpringSettleSceneDef, cfg: SpringSettleConfig) =>\n scene.durationInFrames ?? cfg.sceneFrames;\n\nexport const springSettleTimeline = (\n frame: number,\n scenes: SpringSettleSceneDef[],\n config?: Partial<SpringSettleConfig>,\n opts?: { loop?: boolean },\n): SpringSettleTimeline => {\n const cfg = resolveConfig(config);\n const lens = scenes.map((s) => dwellOf(s, cfg) + cfg.gapFrames);\n const total = lens.reduce((a, b) => a + b, 0);\n let w = opts?.loop ? ((frame % total) + total) % total : frame;\n let index = 0;\n while (index < scenes.length - 1 && w >= lens[index]) {\n w -= lens[index];\n index += 1;\n }\n const local = Math.min(w, lens[index] - 1);\n return { index, local, dwellFrames: dwellOf(scenes[index], cfg) };\n};\n\nexport const springSettlePhase = (\n timeline: SpringSettleTimeline,\n fps: number,\n config?: Partial<SpringSettleConfig>,\n): SpringSettlePhase => {\n const cfg = resolveConfig(config);\n const { local, dwellFrames } = timeline;\n if (local >= dwellFrames) return \"gap\";\n if (local >= dwellFrames - cfg.exitFrames) return \"exit\";\n const settled =\n spring({\n frame: local,\n fps,\n config: {\n damping: cfg.springDamping,\n stiffness: cfg.springStiffness,\n mass: cfg.springMass,\n },\n }) > 0.985;\n return settled ? \"dwell\" : \"enter\";\n};\n\nexport const springSettleExitStyle = (\n local: number,\n dwellFrames: number,\n config?: Partial<SpringSettleConfig>,\n): CSSProperties => {\n const cfg = resolveConfig(config);\n const tExit = interpolate(\n local,\n [dwellFrames - cfg.exitFrames, dwellFrames],\n [0, 1],\n CLAMP,\n );\n if (tExit <= 0) return {};\n const eExit = tExit ** cfg.exitPower;\n return {\n transform: `scale(${1 - (1 - cfg.exitScale) * eExit})`,\n opacity: 1 - eExit,\n willChange: \"transform, opacity\",\n };\n};\n\nexport interface SpringSettleEnterProps {\n local: number;\n config?: Partial<SpringSettleConfig>;\n children: ReactNode;\n}\n\nexport function SpringSettleEnter({\n local,\n config,\n children,\n}: SpringSettleEnterProps) {\n const { fps } = useVideoConfig();\n return (\n <SceneCtx.Provider value={{ local, cfg: resolveConfig(config), fps }}>\n {children}\n </SceneCtx.Provider>\n );\n}\n\nexport interface SpringSettleItemProps {\n index?: number;\n style?: CSSProperties;\n children: ReactNode;\n}\n\nexport function SpringSettleItem({\n index = 0,\n style,\n children,\n}: SpringSettleItemProps) {\n const clock = useContext(SceneCtx);\n if (!clock) {\n return <div style={style}>{children}</div>;\n }\n const { local, cfg, fps } = clock;\n const tEnter =\n local -\n stagger(\n index,\n cfg.enterStagger,\n cfg.enterStaggerPower,\n cfg.enterStaggerJitter,\n );\n const enterP = spring({\n frame: tEnter,\n fps,\n config: {\n damping: cfg.springDamping,\n stiffness: cfg.springStiffness,\n mass: cfg.springMass,\n },\n });\n const scaleEnter = interpolate(enterP, [0, 1], [cfg.enterScale, 1]);\n const opacityEnter = interpolate(tEnter, [0, cfg.enterFadeFrames], [0, 1], {\n ...CLAMP,\n easing: FADE,\n });\n return (\n <div\n style={{\n ...style,\n transform: `scale(${scaleEnter})`,\n opacity: opacityEnter,\n willChange: \"transform, opacity\",\n }}\n >\n {children}\n </div>\n );\n}\n\nconst wrapSigned = (d: number, total: number) =>\n (((d % total) + total * 1.5) % total) - total / 2;\n\nexport interface SpringSettleScenesProps {\n scenes: SpringSettleSceneDef[];\n config?: Partial<SpringSettleConfig>;\n loop?: boolean;\n style?: CSSProperties;\n}\n\nexport function SpringSettleScenes({\n scenes,\n config,\n loop = false,\n style,\n}: SpringSettleScenesProps) {\n const frame = useCurrentFrame();\n const cfg = resolveConfig(config);\n\n const lens = scenes.map((s) => dwellOf(s, cfg) + cfg.gapFrames);\n const total = lens.reduce((a, b) => a + b, 0);\n const { index, local, dwellFrames } = springSettleTimeline(\n frame,\n scenes,\n cfg,\n { loop },\n );\n\n const n = scenes.length;\n const cur = scenes[index];\n const prev = loop ? scenes[(index - 1 + n) % n] : scenes[index - 1];\n const next = loop ? scenes[(index + 1) % n] : scenes[index + 1];\n\n const w = loop ? ((frame % total) + total) % total : frame;\n const slotStart = w - local;\n const half = Math.max(cfg.bgFadeFrames, 0.001) / 2;\n let bg = cur.bg;\n if (prev?.bg && cur.bg) {\n let d = w - (slotStart - cfg.gapFrames / 2);\n if (loop) d = wrapSigned(d, total);\n if (Math.abs(d) <= half) {\n bg = interpolateColors(d, [-half, half], [prev.bg, cur.bg]);\n }\n }\n if (next?.bg && cur.bg && bg === cur.bg) {\n let d = w - (slotStart + dwellFrames + cfg.gapFrames / 2);\n if (loop) d = wrapSigned(d, total);\n if (Math.abs(d) <= half) {\n bg = interpolateColors(d, [-half, half], [cur.bg, next.bg]);\n }\n }\n\n return (\n <AbsoluteFill style={{ background: bg, ...style }}>\n {local < dwellFrames ? (\n <AbsoluteFill style={springSettleExitStyle(local, dwellFrames, cfg)}>\n <SpringSettleEnter local={local} config={cfg}>\n {cur.content}\n </SpringSettleEnter>\n </AbsoluteFill>\n ) : null}\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { createContext, useContext } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { CLAMP, FADE, stagger } from \"@/lib/remocn/scene-motion\";\n\nexport type SpringSettleConfig = {\n sceneFrames: number;\n gapFrames: number;\n enterScale: number;\n enterFadeFrames: number;\n enterStagger: number;\n enterStaggerPower: number;\n enterStaggerJitter: number;\n springDamping: number;\n springStiffness: number;\n springMass: number;\n exitFrames: number;\n exitScale: number;\n exitPower: number;\n bgFadeFrames: number;\n};\n\nexport const SPRING_SETTLE_DEFAULTS: SpringSettleConfig = {\n sceneFrames: 70,\n gapFrames: 1,\n enterScale: 1.24,\n enterFadeFrames: 5,\n enterStagger: 3,\n enterStaggerPower: 0.8,\n enterStaggerJitter: 1,\n springDamping: 30,\n springStiffness: 320,\n springMass: 1,\n exitFrames: 6,\n exitScale: 0.84,\n exitPower: 5,\n bgFadeFrames: 4,\n};\n\nexport type SpringSettleSceneDef = {\n name?: string;\n bg?: string;\n durationInFrames?: number;\n content: ReactNode;\n};\n\nexport type SpringSettlePhase = \"enter\" | \"dwell\" | \"exit\" | \"gap\";\n\nexport type SpringSettleTimeline = {\n index: number;\n local: number;\n dwellFrames: number;\n};\n\ntype SceneClock = {\n local: number;\n cfg: SpringSettleConfig;\n fps: number;\n};\n\nconst SceneCtx = createContext<SceneClock | null>(null);\n\nconst resolveConfig = (\n config?: Partial<SpringSettleConfig>,\n): SpringSettleConfig => ({ ...SPRING_SETTLE_DEFAULTS, ...config });\n\nconst dwellOf = (scene: SpringSettleSceneDef, cfg: SpringSettleConfig) =>\n scene.durationInFrames ?? cfg.sceneFrames;\n\nexport const springSettleTimeline = (\n frame: number,\n scenes: SpringSettleSceneDef[],\n config?: Partial<SpringSettleConfig>,\n opts?: { loop?: boolean },\n): SpringSettleTimeline => {\n const cfg = resolveConfig(config);\n const lens = scenes.map((s) => dwellOf(s, cfg) + cfg.gapFrames);\n const total = lens.reduce((a, b) => a + b, 0);\n let w = opts?.loop ? ((frame % total) + total) % total : frame;\n let index = 0;\n while (index < scenes.length - 1 && w >= lens[index]) {\n w -= lens[index];\n index += 1;\n }\n const local = Math.min(w, lens[index] - 1);\n return { index, local, dwellFrames: dwellOf(scenes[index], cfg) };\n};\n\nexport const springSettlePhase = (\n timeline: SpringSettleTimeline,\n fps: number,\n config?: Partial<SpringSettleConfig>,\n): SpringSettlePhase => {\n const cfg = resolveConfig(config);\n const { local, dwellFrames } = timeline;\n if (local >= dwellFrames) return \"gap\";\n if (local >= dwellFrames - cfg.exitFrames) return \"exit\";\n const settled =\n spring({\n frame: local,\n fps,\n config: {\n damping: cfg.springDamping,\n stiffness: cfg.springStiffness,\n mass: cfg.springMass,\n },\n }) > 0.985;\n return settled ? \"dwell\" : \"enter\";\n};\n\nexport const springSettleExitStyle = (\n local: number,\n dwellFrames: number,\n config?: Partial<SpringSettleConfig>,\n): CSSProperties => {\n const cfg = resolveConfig(config);\n const tExit = interpolate(\n local,\n [dwellFrames - cfg.exitFrames, dwellFrames],\n [0, 1],\n CLAMP,\n );\n if (tExit <= 0) return {};\n const eExit = tExit ** cfg.exitPower;\n return {\n scale: `${1 - (1 - cfg.exitScale) * eExit}`,\n opacity: 1 - eExit,\n willChange: \"transform, opacity\",\n };\n};\n\nexport interface SpringSettleEnterProps {\n local: number;\n config?: Partial<SpringSettleConfig>;\n children: ReactNode;\n}\n\nexport function SpringSettleEnter({\n local,\n config,\n children,\n}: SpringSettleEnterProps) {\n const { fps } = useVideoConfig();\n return (\n <SceneCtx.Provider value={{ local, cfg: resolveConfig(config), fps }}>\n {children}\n </SceneCtx.Provider>\n );\n}\n\nexport interface SpringSettleItemProps {\n index?: number;\n style?: CSSProperties;\n children: ReactNode;\n}\n\nexport function SpringSettleItem({\n index = 0,\n style,\n children,\n}: SpringSettleItemProps) {\n const clock = useContext(SceneCtx);\n if (!clock) {\n return <div style={style}>{children}</div>;\n }\n const { local, cfg, fps } = clock;\n const tEnter =\n local -\n stagger(\n index,\n cfg.enterStagger,\n cfg.enterStaggerPower,\n cfg.enterStaggerJitter,\n );\n const enterP = spring({\n frame: tEnter,\n fps,\n config: {\n damping: cfg.springDamping,\n stiffness: cfg.springStiffness,\n mass: cfg.springMass,\n },\n });\n const scaleEnter = interpolate(enterP, [0, 1], [cfg.enterScale, 1]);\n const opacityEnter = interpolate(tEnter, [0, cfg.enterFadeFrames], [0, 1], {\n ...CLAMP,\n easing: FADE,\n });\n return (\n <div\n style={{\n ...style,\n scale: `${scaleEnter}`,\n opacity: opacityEnter,\n willChange: \"transform, opacity\",\n }}\n >\n {children}\n </div>\n );\n}\n\nconst wrapSigned = (d: number, total: number) =>\n (((d % total) + total * 1.5) % total) - total / 2;\n\nexport interface SpringSettleScenesProps {\n scenes: SpringSettleSceneDef[];\n config?: Partial<SpringSettleConfig>;\n loop?: boolean;\n style?: CSSProperties;\n}\n\nexport function SpringSettleScenes({\n scenes,\n config,\n loop = false,\n style,\n}: SpringSettleScenesProps) {\n const frame = useCurrentFrame();\n const cfg = resolveConfig(config);\n\n const lens = scenes.map((s) => dwellOf(s, cfg) + cfg.gapFrames);\n const total = lens.reduce((a, b) => a + b, 0);\n const { index, local, dwellFrames } = springSettleTimeline(\n frame,\n scenes,\n cfg,\n { loop },\n );\n\n const n = scenes.length;\n const cur = scenes[index];\n const prev = loop ? scenes[(index - 1 + n) % n] : scenes[index - 1];\n const next = loop ? scenes[(index + 1) % n] : scenes[index + 1];\n\n const w = loop ? ((frame % total) + total) % total : frame;\n const slotStart = w - local;\n const half = Math.max(cfg.bgFadeFrames, 0.001) / 2;\n let bg = cur.bg;\n if (prev?.bg && cur.bg) {\n let d = w - (slotStart - cfg.gapFrames / 2);\n if (loop) d = wrapSigned(d, total);\n if (Math.abs(d) <= half) {\n bg = interpolateColors(d, [-half, half], [prev.bg, cur.bg]);\n }\n }\n if (next?.bg && cur.bg && bg === cur.bg) {\n let d = w - (slotStart + dwellFrames + cfg.gapFrames / 2);\n if (loop) d = wrapSigned(d, total);\n if (Math.abs(d) <= half) {\n bg = interpolateColors(d, [-half, half], [cur.bg, next.bg]);\n }\n }\n\n return (\n <AbsoluteFill style={{ background: bg, ...style }}>\n {local < dwellFrames ? (\n <AbsoluteFill style={springSettleExitStyle(local, dwellFrames, cfg)}>\n <SpringSettleEnter local={local} config={cfg}>\n {cur.content}\n </SpringSettleEnter>\n </AbsoluteFill>\n ) : null}\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/spring-settle.tsx"
}
diff --git a/registry-artifacts/staggered-fade-up.json b/registry-artifacts/staggered-fade-up.json
index 109ac2f1..253d499e 100644
--- a/registry-artifacts/staggered-fade-up.json
+++ b/registry-artifacts/staggered-fade-up.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/staggered-fade-up/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface StaggeredFadeUpProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StaggeredFadeUp({\n text,\n staggerDelay = 4,\n distance = 20,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StaggeredFadeUpProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const y = interpolate(local, [0, 12], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface StaggeredFadeUpProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StaggeredFadeUp({\n text,\n staggerDelay = 4,\n distance = 20,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StaggeredFadeUpProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const y = interpolate(local, [0, 12], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/staggered-fade-up.tsx"
}
diff --git a/registry-artifacts/strikethrough-replace.json b/registry-artifacts/strikethrough-replace.json
index dc47926d..8895825f 100644
--- a/registry-artifacts/strikethrough-replace.json
+++ b/registry-artifacts/strikethrough-replace.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/strikethrough-replace/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface StrikethroughReplaceProps {\n from: string;\n to: string;\n lineColor?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StrikethroughReplace({\n from,\n to,\n lineColor = \"#ff5e3a\",\n fontSize = 48,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StrikethroughReplaceProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Phases:\n // 0 .. 40% -> draw strikethrough across `from`\n // 40% .. 60% -> fade out `from`, fade in `to`\n // 60% .. 100% -> hold\n const strikeEnd = durationInFrames * 0.4;\n const fadeStart = durationInFrames * 0.4;\n const fadeEnd = durationInFrames * 0.6;\n\n const linePct = interpolate(frame, [0, strikeEnd], [0, 100], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const fromOpacity = interpolate(frame, [fadeStart, fadeEnd], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const toOpacity = interpolate(frame, [fadeStart, fadeEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const toY = interpolate(frame, [fadeStart, fadeEnd], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {/* from text with strikethrough line */}\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n opacity: fromOpacity,\n }}\n >\n {from}\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n height: Math.max(2, Math.round(fontSize * 0.08)),\n width: `${linePct}%`,\n background: lineColor,\n transform: \"translateY(-50%)\",\n borderRadius: 2,\n }}\n />\n </span>\n\n {/* to text */}\n <span\n className={className}\n style={{\n ...textStyle,\n opacity: toOpacity,\n transform: `translateY(${toY}px)`,\n }}\n >\n {to}\n </span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface StrikethroughReplaceProps {\n from: string;\n to: string;\n lineColor?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function StrikethroughReplace({\n from,\n to,\n lineColor = \"#ff5e3a\",\n fontSize = 48,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: StrikethroughReplaceProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Phases:\n // 0 .. 40% -> draw strikethrough across `from`\n // 40% .. 60% -> fade out `from`, fade in `to`\n // 60% .. 100% -> hold\n const strikeEnd = durationInFrames * 0.4;\n const fadeStart = durationInFrames * 0.4;\n const fadeEnd = durationInFrames * 0.6;\n\n const linePct = interpolate(frame, [0, strikeEnd], [0, 100], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const fromOpacity = interpolate(frame, [fadeStart, fadeEnd], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const toOpacity = interpolate(frame, [fadeStart, fadeEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const toY = interpolate(frame, [fadeStart, fadeEnd], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {/* from text with strikethrough line */}\n <span\n className={className}\n style={{\n ...textStyle,\n position: \"absolute\",\n opacity: fromOpacity,\n }}\n >\n {from}\n <span\n aria-hidden\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n height: Math.max(2, Math.round(fontSize * 0.08)),\n width: `${linePct}%`,\n background: lineColor,\n translate: \"0 -50%\",\n borderRadius: 2,\n }}\n />\n </span>\n\n {/* to text */}\n <span\n className={className}\n style={{\n ...textStyle,\n opacity: toOpacity,\n translate: `0 ${toY}px`,\n }}\n >\n {to}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/strikethrough-replace.tsx"
}
diff --git a/registry-artifacts/sustained-glitch.json b/registry-artifacts/sustained-glitch.json
index f7f2da37..a1c828a1 100644
--- a/registry-artifacts/sustained-glitch.json
+++ b/registry-artifacts/sustained-glitch.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/sustained-glitch/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, random, useCurrentFrame } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type SustainedGlitchProps = {\n intensity?: number;\n frequency?: number;\n slices?: number;\n seed?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_intensity;\nuniform float u_frequency;\nuniform float u_slices;\nuniform float u_seed;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(vec2 uv, float split) {\n vec4 center = texture(u_scene, uv);\n float r = texture(u_scene, fract(vec2(uv.x + split, uv.y))).r;\n float b = texture(u_scene, fract(vec2(uv.x - split, uv.y))).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float slotLength = max(30.0 / max(u_frequency, 0.1), 4.0);\n float slot = floor(u_frame / slotLength);\n float local = u_frame - slot * slotLength;\n\n float burstLength = 2.0 + floor(hash(vec2(slot, u_seed + 2.0)) * 4.0);\n float start =\n floor(hash(vec2(slot, u_seed + 1.0)) * max(slotLength - burstLength, 1.0));\n float fires = step(0.25, hash(vec2(slot, u_seed + 3.0)));\n\n float age = local - start;\n float live = fires * step(0.0, age) * step(age, burstLength - 1.0);\n float energy =\n max(u_intensity, 0.0) * live * (1.0 - age / burstLength);\n\n if (energy <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n\n float clock = mod(u_frame, 512.0) + u_seed;\n float row = floor(v_uv.y * max(u_slices, 2.0));\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.28 * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(1.0 - 0.45 * min(energy, 1.0), hash(block + clock * 7.3));\n vec2 jump =\n vec2(\n hash(block + clock * 3.1 + 5.0) - 0.5,\n hash(block + clock * 9.7 + 11.0) - 0.5\n ) *\n vec2(0.62, 0.34) *\n corrupt;\n\n vec2 uv = fract(v_uv + vec2(sliceShift, 0.0) + jump);\n float split = 0.02 * energy * (0.35 + abs(amount));\n\n vec4 color = sampleSplit(uv, split);\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = vec4(clamp(color.rgb, 0.0, 1.0), color.a);\n}`;\n\nconst shader = makeFilterShader<SustainedGlitchProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_frequency\"), frequency);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_seed\"), seed);\n },\n);\n\nfunction burstEnergy(\n frame: number,\n intensity: number,\n frequency: number,\n seed: number,\n): number {\n const slotLength = Math.max(30 / Math.max(frequency, 0.1), 4);\n const slot = Math.floor(frame / slotLength);\n const local = frame - slot * slotLength;\n\n const burstLength = 2 + Math.floor(random(`glitch-len-${seed}-${slot}`) * 4);\n const start = Math.floor(\n random(`glitch-start-${seed}-${slot}`) *\n Math.max(slotLength - burstLength, 1),\n );\n if (random(`glitch-fire-${seed}-${slot}`) < 0.25) return 0;\n\n const age = local - start;\n if (age < 0 || age > burstLength - 1) return 0;\n return Math.max(intensity, 0) * (1 - age / burstLength);\n}\n\nconst SustainedGlitchFallback: React.FC<\n SustainedGlitchProps & CanvasFilterProps\n> = ({\n children,\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n}) => {\n const frame = useCurrentFrame();\n const energy = burstEnergy(frame, intensity, frequency, seed);\n\n if (energy <= 0) {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shift =\n (random(`glitch-shift-${seed}-${frame}-${band}`) - 0.5) * 46 * energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n transform: `translateX(${shift}px)`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity:\n 0.18 *\n energy *\n random(`glitch-tint-${seed}-${frame}-${band}`),\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nexport const SustainedGlitch = makeCanvasFilter<SustainedGlitchProps>({\n shader,\n fallback: SustainedGlitchFallback,\n});\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, random, useCurrentFrame } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type SustainedGlitchProps = {\n intensity?: number;\n frequency?: number;\n slices?: number;\n seed?: number;\n};\n\nconst DEFAULTS = {\n intensity: 1,\n frequency: 1,\n slices: 24,\n seed: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_intensity;\nuniform float u_frequency;\nuniform float u_slices;\nuniform float u_seed;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float BLOCK_COLUMNS = 16.0;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nvec4 sampleSplit(vec2 uv, float split) {\n vec4 center = texture(u_scene, uv);\n float r = texture(u_scene, fract(vec2(uv.x + split, uv.y))).r;\n float b = texture(u_scene, fract(vec2(uv.x - split, uv.y))).b;\n return vec4(r, center.g, b, center.a);\n}\n\nvoid main() {\n float slotLength = max(30.0 / max(u_frequency, 0.1), 4.0);\n float slot = floor(u_frame / slotLength);\n float local = u_frame - slot * slotLength;\n\n float burstLength = 2.0 + floor(hash(vec2(slot, u_seed + 2.0)) * 4.0);\n float start =\n floor(hash(vec2(slot, u_seed + 1.0)) * max(slotLength - burstLength, 1.0));\n float fires = step(0.25, hash(vec2(slot, u_seed + 3.0)));\n\n float age = local - start;\n float live = fires * step(0.0, age) * step(age, burstLength - 1.0);\n float energy =\n max(u_intensity, 0.0) * live * (1.0 - age / burstLength);\n\n if (energy <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n\n float clock = mod(u_frame, 512.0) + u_seed;\n float row = floor(v_uv.y * max(u_slices, 2.0));\n float torn = step(0.45, hash(vec2(row, clock)));\n float amount = hash(vec2(row + 17.0, clock * 1.7 + 3.0)) - 0.5;\n float sliceShift = amount * 0.28 * energy * torn;\n\n vec2 block = vec2(floor(v_uv.x * BLOCK_COLUMNS), row);\n float corrupt = step(1.0 - 0.45 * min(energy, 1.0), hash(block + clock * 7.3));\n vec2 jump =\n vec2(\n hash(block + clock * 3.1 + 5.0) - 0.5,\n hash(block + clock * 9.7 + 11.0) - 0.5\n ) *\n vec2(0.62, 0.34) *\n corrupt;\n\n vec2 uv = fract(v_uv + vec2(sliceShift, 0.0) + jump);\n float split = 0.02 * energy * (0.35 + abs(amount));\n\n vec4 color = sampleSplit(uv, split);\n color.rgb +=\n vec3(0.05, 0.015, 0.09) *\n energy *\n torn *\n hash(vec2(row, clock + 41.0)) *\n color.a;\n\n outColor = vec4(clamp(color.rgb, 0.0, 1.0), color.a);\n}`;\n\nconst shader = makeFilterShader<SustainedGlitchProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n } = passedProps;\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n gl.uniform1f(uniform(\"u_frequency\"), frequency);\n gl.uniform1f(uniform(\"u_slices\"), slices);\n gl.uniform1f(uniform(\"u_seed\"), seed);\n },\n);\n\nfunction burstEnergy(\n frame: number,\n intensity: number,\n frequency: number,\n seed: number,\n): number {\n const slotLength = Math.max(30 / Math.max(frequency, 0.1), 4);\n const slot = Math.floor(frame / slotLength);\n const local = frame - slot * slotLength;\n\n const burstLength = 2 + Math.floor(random(`glitch-len-${seed}-${slot}`) * 4);\n const start = Math.floor(\n random(`glitch-start-${seed}-${slot}`) *\n Math.max(slotLength - burstLength, 1),\n );\n if (random(`glitch-fire-${seed}-${slot}`) < 0.25) return 0;\n\n const age = local - start;\n if (age < 0 || age > burstLength - 1) return 0;\n return Math.max(intensity, 0) * (1 - age / burstLength);\n}\n\nconst SustainedGlitchFallback: React.FC<\n SustainedGlitchProps & CanvasFilterProps\n> = ({\n children,\n intensity = DEFAULTS.intensity,\n frequency = DEFAULTS.frequency,\n slices = DEFAULTS.slices,\n seed = DEFAULTS.seed,\n}) => {\n const frame = useCurrentFrame();\n const energy = burstEnergy(frame, intensity, frequency, seed);\n\n if (energy <= 0) {\n return <AbsoluteFill>{children}</AbsoluteFill>;\n }\n\n const bands = Math.max(2, Math.min(6, Math.round(slices / 5)));\n const height = 100 / bands;\n\n return (\n <AbsoluteFill>\n {Array.from({ length: bands }, (_, band) => {\n const shift =\n (random(`glitch-shift-${seed}-${frame}-${band}`) - 0.5) * 46 * energy;\n const tint = band % 2 === 0 ? \"rgb(255, 42, 90)\" : \"rgb(0, 224, 255)\";\n return (\n <AbsoluteFill\n key={band}\n style={{\n clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,\n translate: `${shift}px`,\n }}\n >\n {children}\n <AbsoluteFill\n style={{\n background: tint,\n mixBlendMode: \"screen\",\n opacity:\n 0.18 *\n energy *\n random(`glitch-tint-${seed}-${frame}-${band}`),\n }}\n />\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nexport const SustainedGlitch = makeCanvasFilter<SustainedGlitchProps>({\n shader,\n fallback: SustainedGlitchFallback,\n});\n",
"type": "registry:component",
"target": "components/remocn/sustained-glitch.tsx"
}
diff --git a/registry-artifacts/swirl-dissolve.json b/registry-artifacts/swirl-dissolve.json
index 486b6a0b..52f45b9e 100644
--- a/registry-artifacts/swirl-dissolve.json
+++ b/registry-artifacts/swirl-dissolve.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/swirl-dissolve/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderSwirl } from \"@/components/remocn/shader-swirl\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#1f1d29\", \"#413d56\", \"#8f88ae\"];\n\nexport type SwirlDissolveProps = {\n colors?: string[];\n colorBack?: string;\n bandCount?: number;\n softness?: number;\n speed?: number;\n};\n\nconst SwirlDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SwirlDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n bandCount = 10,\n softness = 0.35,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const twist = interpolate(p, [0.1, 0.42, 0.64, 1], [1, 0, 0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.77, 0.87], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.77, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.77, 0.93], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSwirl\n speed={speed}\n twist={twist}\n colors={colors}\n colorBack={colorBack}\n bandCount={bandCount}\n softness={softness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function swirlDissolve(\n props: SwirlDissolveProps = {},\n): TransitionPresentation<SwirlDissolveProps> {\n return {\n component: SwirlDissolvePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderSwirl } from \"@/components/remocn/shader-swirl\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#1f1d29\", \"#413d56\", \"#8f88ae\"];\n\nexport type SwirlDissolveProps = {\n colors?: string[];\n colorBack?: string;\n bandCount?: number;\n softness?: number;\n speed?: number;\n};\n\nconst SwirlDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SwirlDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n bandCount = 10,\n softness = 0.35,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const twist = interpolate(p, [0.1, 0.42, 0.64, 1], [1, 0, 0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.77, 0.87], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.77, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.77, 0.93], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSwirl\n speed={speed}\n twist={twist}\n colors={colors}\n colorBack={colorBack}\n bandCount={bandCount}\n softness={softness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function swirlDissolve(\n props: SwirlDissolveProps = {},\n): TransitionPresentation<SwirlDissolveProps> {\n return {\n component: SwirlDissolvePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/swirl-dissolve.tsx"
}
diff --git a/registry-artifacts/terminal-cursor-zoom.json b/registry-artifacts/terminal-cursor-zoom.json
index 569f283f..350b25f1 100644
--- a/registry-artifacts/terminal-cursor-zoom.json
+++ b/registry-artifacts/terminal-cursor-zoom.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/terminal-cursor-zoom/index.tsx",
- "content": "\"use client\";\n\nimport { AbsoluteFill, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { TerminalSimulator } from \"@/components/remocn/terminal-simulator\";\n\nexport interface TerminalCursorZoomProps {\n command?: string;\n zoom?: number;\n fontSize?: number;\n prompt?: string;\n title?: string;\n charsPerFrame?: number;\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst WINDOW_WIDTH = 900;\nconst WINDOW_HEIGHT = 480;\nconst CONTENT_PADDING = 20;\nconst CHROME_HEIGHT = 40;\nconst PROMPT_GAP = 8;\nconst FIRST_LINE_FRAME = 10;\n\nexport function TerminalCursorZoom({\n command = \"npx shadcn add @remocn/terminal-cursor-zoom\",\n zoom = 2.8,\n fontSize = 20,\n prompt = \"$\",\n title = \"~/code/remocn-demo\",\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalCursorZoomProps) {\n const frame = useCurrentFrame();\n\n const charWidth = fontSize * 0.6;\n const windowLeft = (STAGE_WIDTH - WINDOW_WIDTH) / 2;\n const windowTop = (STAGE_HEIGHT - WINDOW_HEIGHT) / 2;\n const textStartX =\n windowLeft + CONTENT_PADDING + prompt.length * charWidth + PROMPT_GAP;\n const lineHeight = Math.round(fontSize * 1.6);\n const cursorY = windowTop + CHROME_HEIGHT + CONTENT_PADDING + lineHeight / 2;\n\n const lineStart = Math.round(FIRST_LINE_FRAME / speed);\n const localFrame = (frame - lineStart) * speed;\n const linearRevealed = Math.floor(\n interpolate(\n localFrame,\n [0, command.length / charsPerFrame],\n [0, command.length],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n ),\n );\n const revealed = Math.min(\n command.length,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n\n const cursorX = textStartX + revealed * charWidth;\n const tx = STAGE_WIDTH / 2 - zoom * cursorX;\n const ty = STAGE_HEIGHT / 2 - zoom * cursorY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n transform: `translate(${tx}px, ${ty}px) scale(${zoom})`,\n transformOrigin: \"0 0\",\n }}\n >\n <TerminalSimulator\n lines={[{ text: command, type: \"command\", delay: 0 }]}\n prompt={prompt}\n title={title}\n fontSize={fontSize}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { AbsoluteFill, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { TerminalSimulator } from \"@/components/remocn/terminal-simulator\";\n\nexport interface TerminalCursorZoomProps {\n command?: string;\n zoom?: number;\n fontSize?: number;\n prompt?: string;\n title?: string;\n charsPerFrame?: number;\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst WINDOW_WIDTH = 900;\nconst WINDOW_HEIGHT = 480;\nconst CONTENT_PADDING = 20;\nconst CHROME_HEIGHT = 40;\nconst PROMPT_GAP = 8;\nconst FIRST_LINE_FRAME = 10;\n\nexport function TerminalCursorZoom({\n command = \"npx shadcn add @remocn/terminal-cursor-zoom\",\n zoom = 2.8,\n fontSize = 20,\n prompt = \"$\",\n title = \"~/code/remocn-demo\",\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalCursorZoomProps) {\n const frame = useCurrentFrame();\n\n const charWidth = fontSize * 0.6;\n const windowLeft = (STAGE_WIDTH - WINDOW_WIDTH) / 2;\n const windowTop = (STAGE_HEIGHT - WINDOW_HEIGHT) / 2;\n const textStartX =\n windowLeft + CONTENT_PADDING + prompt.length * charWidth + PROMPT_GAP;\n const lineHeight = Math.round(fontSize * 1.6);\n const cursorY = windowTop + CHROME_HEIGHT + CONTENT_PADDING + lineHeight / 2;\n\n const lineStart = Math.round(FIRST_LINE_FRAME / speed);\n const localFrame = (frame - lineStart) * speed;\n const linearRevealed = Math.floor(\n interpolate(\n localFrame,\n [0, command.length / charsPerFrame],\n [0, command.length],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n ),\n );\n const revealed = Math.min(\n command.length,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n\n const cursorX = textStartX + revealed * charWidth;\n const tx = STAGE_WIDTH / 2 - zoom * cursorX;\n const ty = STAGE_HEIGHT / 2 - zoom * cursorY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n translate: `${tx}px ${ty}px`,\n scale: `${zoom}`,\n transformOrigin: \"0 0\",\n }}\n >\n <TerminalSimulator\n lines={[{ text: command, type: \"command\", delay: 0 }]}\n prompt={prompt}\n title={title}\n fontSize={fontSize}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/terminal-cursor-zoom.tsx"
}
diff --git a/registry-artifacts/terminal-simulator.json b/registry-artifacts/terminal-simulator.json
index f12f0d51..e57c031d 100644
--- a/registry-artifacts/terminal-simulator.json
+++ b/registry-artifacts/terminal-simulator.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/terminal-simulator/index.tsx",
- "content": "\"use client\";\n\nimport {\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\nexport interface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\nexport interface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nexport function TerminalSimulator({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n transform: `translateY(${translateY}px)`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\nexport interface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\nexport interface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nexport function TerminalSimulator({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n translate: `0 ${translateY}px`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/terminal-simulator.tsx"
}
diff --git a/registry-artifacts/top-down-letters.json b/registry-artifacts/top-down-letters.json
index 8d420086..44f910cf 100644
--- a/registry-artifacts/top-down-letters.json
+++ b/registry-artifacts/top-down-letters.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/top-down-letters/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TopDownLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TopDownLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n const charTravelFrames = 7;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charTravelFrames], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/top-down-letters.tsx"
}
diff --git a/registry-artifacts/tv-power-off.json b/registry-artifacts/tv-power-off.json
index 301aeced..b24b3696 100644
--- a/registry-artifacts/tv-power-off.json
+++ b/registry-artifacts/tv-power-off.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/tv-power-off/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, useCurrentFrame } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type TvPowerOffProps = {\n durationInFrames?: number;\n delay?: number;\n gain?: number;\n afterglow?: number;\n phosphor?: string;\n};\n\nconst DEFAULTS = {\n durationInFrames: 18,\n delay: 0,\n gain: 1,\n afterglow: 1,\n phosphor: \"#d8ecff\",\n};\n\nconst COLLAPSE_END = 0.6;\nconst PINCH_END = 0.82;\nconst MIN_SQUASH = 0.0055;\nconst MIN_PINCH = 0.004;\nconst CONCENTRATION = 0.3;\nconst DECAY_CURVE = 2.6;\nconst BLACKOUT_IN = 0.06;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec2 u_resolution;\nuniform float u_aspect;\nuniform float u_progress;\nuniform float u_gain;\nuniform float u_afterglow;\nuniform vec3 u_phosphor;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 32;\nconst int COLUMN_TAPS = 8;\nconst float GOLDEN = 0.6180339887;\nconst float COLLAPSE_END = ${COLLAPSE_END.toFixed(4)};\nconst float PINCH_END = ${PINCH_END.toFixed(4)};\nconst float MIN_SQUASH = ${MIN_SQUASH.toFixed(5)};\nconst float MIN_PINCH = ${MIN_PINCH.toFixed(5)};\nconst float CONCENTRATION = ${CONCENTRATION.toFixed(4)};\nconst float DECAY_CURVE = ${DECAY_CURVE.toFixed(4)};\nconst float BLACKOUT_IN = ${BLACKOUT_IN.toFixed(4)};\n\nvoid main() {\n float p = u_progress;\n\n if (p <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n if (p >= 1.0) {\n outColor = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n\n float collapse = clamp(p / COLLAPSE_END, 0.0, 1.0);\n float pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0.0, 1.0);\n float decayed = clamp((p - PINCH_END) / (1.0 - PINCH_END), 0.0, 1.0);\n\n vec2 scale = vec2(pow(MIN_PINCH, pinch), pow(MIN_SQUASH, collapse));\n vec2 centered = (v_uv - 0.5) / scale + 0.5;\n vec2 span = 1.0 / (scale * u_resolution);\n\n vec3 sum = vec3(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n vec2 at = centered + vec2(\n (fract(fi * GOLDEN + 0.5) - 0.5) * span.x,\n ((fi + 0.5) / float(TAPS) - 0.5) * span.y\n );\n vec2 inside = step(vec2(0.0), at) * step(at, vec2(1.0));\n sum += texture(u_scene, at).rgb * inside.x * inside.y;\n }\n\n float concentrate = pow(1.0 / (scale.x * scale.y), CONCENTRATION);\n vec3 light =\n (sum / float(TAPS)) * (1.0 + (concentrate - 1.0) * max(u_gain, 0.0));\n\n float glow = max(u_afterglow, 0.0);\n float bleed = smoothstep(0.2, 0.8, collapse) * (1.0 - pinch) * glow;\n\n if (bleed > 0.0) {\n vec3 column = vec3(0.0);\n float cx = clamp(centered.x, 0.0, 1.0);\n for (int i = 0; i < COLUMN_TAPS; i++) {\n column +=\n texture(u_scene, vec2(cx, (float(i) + 0.5) / float(COLUMN_TAPS))).rgb;\n }\n column /= float(COLUMN_TAPS);\n\n float dy = v_uv.y - 0.5;\n float reach = 0.02 + 0.03 * collapse;\n light +=\n column *\n mix(vec3(1.0), u_phosphor, 0.65) *\n exp(-(dy * dy) / (reach * reach)) *\n bleed *\n 0.9;\n }\n\n if (pinch > 0.0) {\n vec2 d = (v_uv - 0.5) * vec2(u_aspect, 1.0);\n float radius = max(0.045 * glow, 0.0005);\n light +=\n u_phosphor *\n exp(-dot(d, d) / (radius * radius)) *\n smoothstep(0.0, 0.5, pinch) *\n 1.15;\n }\n\n light *= pow(max(1.0 - decayed, 0.0001), DECAY_CURVE);\n\n float blackout = smoothstep(0.0, BLACKOUT_IN, p);\n outColor = vec4(\n clamp(light, 0.0, 1.0),\n mix(texture(u_scene, v_uv).a, 1.0, blackout)\n );\n}`;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nfunction powerProgress(props: TvPowerOffProps, frame: number): number {\n const {\n durationInFrames = DEFAULTS.durationInFrames,\n delay = DEFAULTS.delay,\n } = props;\n return clamp((frame - delay) / Math.max(1, durationInFrames), 0, 1);\n}\n\nconst shader = makeFilterShader<TvPowerOffProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, frame, passedProps }) => {\n const {\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = passedProps;\n gl.uniform1f(uniform(\"u_progress\"), powerProgress(passedProps, frame));\n gl.uniform2f(uniform(\"u_resolution\"), width, height);\n gl.uniform1f(uniform(\"u_gain\"), gain);\n gl.uniform1f(uniform(\"u_afterglow\"), afterglow);\n gl.uniform3fv(uniform(\"u_phosphor\"), toRgb(phosphor));\n },\n);\n\nconst TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (\n props,\n) => {\n const frame = useCurrentFrame();\n const {\n children,\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = props;\n\n const p = powerProgress(props, frame);\n const collapse = clamp(p / COLLAPSE_END, 0, 1);\n const pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0, 1);\n const decayed = clamp((p - PINCH_END) / (1 - PINCH_END), 0, 1);\n\n const squash = MIN_SQUASH ** collapse;\n const pinchX = MIN_PINCH ** pinch;\n const concentrate = (1 / (squash * pinchX)) ** CONCENTRATION;\n const fade = (1 - decayed) ** DECAY_CURVE;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n background: \"#000000\",\n opacity: clamp(p / BLACKOUT_IN, 0, 1),\n }}\n />\n <AbsoluteFill\n style={{\n transform: `scale(${pinchX}, ${squash})`,\n filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,\n opacity: fade,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: `radial-gradient(circle at 50% 50%, ${phosphor} 0%, transparent 55%)`,\n opacity: clamp(pinch * afterglow, 0, 1) * fade,\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const TvPowerOff = makeCanvasFilter<TvPowerOffProps>({\n shader,\n fallback: TvPowerOffFallback,\n});\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, useCurrentFrame } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type TvPowerOffProps = {\n durationInFrames?: number;\n delay?: number;\n gain?: number;\n afterglow?: number;\n phosphor?: string;\n};\n\nconst DEFAULTS = {\n durationInFrames: 18,\n delay: 0,\n gain: 1,\n afterglow: 1,\n phosphor: \"#d8ecff\",\n};\n\nconst COLLAPSE_END = 0.6;\nconst PINCH_END = 0.82;\nconst MIN_SQUASH = 0.0055;\nconst MIN_PINCH = 0.004;\nconst CONCENTRATION = 0.3;\nconst DECAY_CURVE = 2.6;\nconst BLACKOUT_IN = 0.06;\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform vec2 u_resolution;\nuniform float u_aspect;\nuniform float u_progress;\nuniform float u_gain;\nuniform float u_afterglow;\nuniform vec3 u_phosphor;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst int TAPS = 32;\nconst int COLUMN_TAPS = 8;\nconst float GOLDEN = 0.6180339887;\nconst float COLLAPSE_END = ${COLLAPSE_END.toFixed(4)};\nconst float PINCH_END = ${PINCH_END.toFixed(4)};\nconst float MIN_SQUASH = ${MIN_SQUASH.toFixed(5)};\nconst float MIN_PINCH = ${MIN_PINCH.toFixed(5)};\nconst float CONCENTRATION = ${CONCENTRATION.toFixed(4)};\nconst float DECAY_CURVE = ${DECAY_CURVE.toFixed(4)};\nconst float BLACKOUT_IN = ${BLACKOUT_IN.toFixed(4)};\n\nvoid main() {\n float p = u_progress;\n\n if (p <= 0.0) {\n outColor = texture(u_scene, v_uv);\n return;\n }\n if (p >= 1.0) {\n outColor = vec4(0.0, 0.0, 0.0, 1.0);\n return;\n }\n\n float collapse = clamp(p / COLLAPSE_END, 0.0, 1.0);\n float pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0.0, 1.0);\n float decayed = clamp((p - PINCH_END) / (1.0 - PINCH_END), 0.0, 1.0);\n\n vec2 scale = vec2(pow(MIN_PINCH, pinch), pow(MIN_SQUASH, collapse));\n vec2 centered = (v_uv - 0.5) / scale + 0.5;\n vec2 span = 1.0 / (scale * u_resolution);\n\n vec3 sum = vec3(0.0);\n for (int i = 0; i < TAPS; i++) {\n float fi = float(i);\n vec2 at = centered + vec2(\n (fract(fi * GOLDEN + 0.5) - 0.5) * span.x,\n ((fi + 0.5) / float(TAPS) - 0.5) * span.y\n );\n vec2 inside = step(vec2(0.0), at) * step(at, vec2(1.0));\n sum += texture(u_scene, at).rgb * inside.x * inside.y;\n }\n\n float concentrate = pow(1.0 / (scale.x * scale.y), CONCENTRATION);\n vec3 light =\n (sum / float(TAPS)) * (1.0 + (concentrate - 1.0) * max(u_gain, 0.0));\n\n float glow = max(u_afterglow, 0.0);\n float bleed = smoothstep(0.2, 0.8, collapse) * (1.0 - pinch) * glow;\n\n if (bleed > 0.0) {\n vec3 column = vec3(0.0);\n float cx = clamp(centered.x, 0.0, 1.0);\n for (int i = 0; i < COLUMN_TAPS; i++) {\n column +=\n texture(u_scene, vec2(cx, (float(i) + 0.5) / float(COLUMN_TAPS))).rgb;\n }\n column /= float(COLUMN_TAPS);\n\n float dy = v_uv.y - 0.5;\n float reach = 0.02 + 0.03 * collapse;\n light +=\n column *\n mix(vec3(1.0), u_phosphor, 0.65) *\n exp(-(dy * dy) / (reach * reach)) *\n bleed *\n 0.9;\n }\n\n if (pinch > 0.0) {\n vec2 d = (v_uv - 0.5) * vec2(u_aspect, 1.0);\n float radius = max(0.045 * glow, 0.0005);\n light +=\n u_phosphor *\n exp(-dot(d, d) / (radius * radius)) *\n smoothstep(0.0, 0.5, pinch) *\n 1.15;\n }\n\n light *= pow(max(1.0 - decayed, 0.0001), DECAY_CURVE);\n\n float blackout = smoothstep(0.0, BLACKOUT_IN, p);\n outColor = vec4(\n clamp(light, 0.0, 1.0),\n mix(texture(u_scene, v_uv).a, 1.0, blackout)\n );\n}`;\n\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\n\nfunction toRgb(hex: string): [number, number, number] {\n const value = hex.replace(\"#\", \"\");\n const full =\n value.length === 3\n ? value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : value;\n const int = Number.parseInt(full, 16);\n if (Number.isNaN(int)) return [1, 1, 1];\n return [\n ((int >> 16) & 255) / 255,\n ((int >> 8) & 255) / 255,\n (int & 255) / 255,\n ];\n}\n\nfunction powerProgress(props: TvPowerOffProps, frame: number): number {\n const {\n durationInFrames = DEFAULTS.durationInFrames,\n delay = DEFAULTS.delay,\n } = props;\n return clamp((frame - delay) / Math.max(1, durationInFrames), 0, 1);\n}\n\nconst shader = makeFilterShader<TvPowerOffProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, width, height, frame, passedProps }) => {\n const {\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = passedProps;\n gl.uniform1f(uniform(\"u_progress\"), powerProgress(passedProps, frame));\n gl.uniform2f(uniform(\"u_resolution\"), width, height);\n gl.uniform1f(uniform(\"u_gain\"), gain);\n gl.uniform1f(uniform(\"u_afterglow\"), afterglow);\n gl.uniform3fv(uniform(\"u_phosphor\"), toRgb(phosphor));\n },\n);\n\nconst TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (\n props,\n) => {\n const frame = useCurrentFrame();\n const {\n children,\n gain = DEFAULTS.gain,\n afterglow = DEFAULTS.afterglow,\n phosphor = DEFAULTS.phosphor,\n } = props;\n\n const p = powerProgress(props, frame);\n const collapse = clamp(p / COLLAPSE_END, 0, 1);\n const pinch = clamp((p - COLLAPSE_END) / (PINCH_END - COLLAPSE_END), 0, 1);\n const decayed = clamp((p - PINCH_END) / (1 - PINCH_END), 0, 1);\n\n const squash = MIN_SQUASH ** collapse;\n const pinchX = MIN_PINCH ** pinch;\n const concentrate = (1 / (squash * pinchX)) ** CONCENTRATION;\n const fade = (1 - decayed) ** DECAY_CURVE;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n background: \"#000000\",\n opacity: clamp(p / BLACKOUT_IN, 0, 1),\n }}\n />\n <AbsoluteFill\n style={{\n scale: `${pinchX} ${squash}`,\n filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,\n opacity: fade,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background: `radial-gradient(circle at 50% 50%, ${phosphor} 0%, transparent 55%)`,\n opacity: clamp(pinch * afterglow, 0, 1) * fade,\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const TvPowerOff = makeCanvasFilter<TvPowerOffProps>({\n shader,\n fallback: TvPowerOffFallback,\n});\n",
"type": "registry:component",
"target": "components/remocn/tv-power-off.tsx"
}
diff --git a/registry-artifacts/v0.json b/registry-artifacts/v0.json
index a92777f6..db1aed2e 100644
--- a/registry-artifacts/v0.json
+++ b/registry-artifacts/v0.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/v0/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface V0Props {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n projectName?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n boxBorder: string;\n fg: string;\n fgMuted: string;\n iconColor: string;\n btnBg: string;\n btnFg: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#FFFFFF\",\n boxBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#5D5D5D\",\n btnBg: \"#0D0D0D\",\n btnFg: \"#FFFFFF\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#0A0A0A\",\n boxBorder: \"#2A2A2A\",\n fg: \"#EDEDED\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#A0A0A0\",\n btnBg: \"#FFFFFF\",\n btnFg: \"#0A0A0A\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction V0LogoIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>v0</title>\n <rect\n x={2.5}\n y={2.5}\n width={19}\n height={19}\n rx={5}\n stroke={color}\n strokeWidth={1.8}\n />\n <rect\n x={7.5}\n y={7.5}\n width={9}\n height={9}\n rx={2.5}\n stroke={color}\n strokeWidth={1.8}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function V0({\n greeting = \"What do you want to create?\",\n placeholder = \"Ask v0 to build…\",\n prompt = \"a landing page for my SaaS with pricing and testimonials\",\n modelName = \"v0 Max\",\n projectName = \"Project\",\n speed = 1,\n}: V0Props) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const boxFade = fadeUpAt(frame * speed, [10, 26]);\n\n const boxWidth = 880;\n const boxLeft = (refW - boxWidth) / 2;\n const boxTop = 270;\n const boxHeight = 150;\n const btnSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 150,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 44,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: boxLeft,\n top: boxTop,\n width: boxWidth,\n height: boxHeight,\n background: t.boxBg,\n border: `1px solid ${t.boxBorder}`,\n borderRadius: 16,\n boxShadow: \"0 8px 40px -16px rgba(0,0,0,0.8)\",\n opacity: boxFade.opacity,\n transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n flex: 1,\n padding: \"18px 20px\",\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n color: t.fg,\n display: \"flex\",\n alignItems: \"flex-start\",\n overflow: \"hidden\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n whiteSpace: \"pre-wrap\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"12px 16px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 10 }}>\n <PlusIcon size={20} color={t.iconColor} />\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <V0LogoIcon size={18} color={t.fg} />\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n </div>\n\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 12 }}>\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {projectName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: btnSize,\n height: btnSize,\n borderRadius: 10,\n background: t.btnBg,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - morph,\n transform: `scale(${1 - 0.08 * morph})`,\n }}\n >\n <MicIcon size={20} color={t.btnFg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: morph,\n transform: `scale(${0.85 + 0.15 * morph})`,\n }}\n >\n <ArrowUpIcon size={20} color={t.btnFg} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface V0Props {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n projectName?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n boxBorder: string;\n fg: string;\n fgMuted: string;\n iconColor: string;\n btnBg: string;\n btnFg: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#FFFFFF\",\n boxBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#5D5D5D\",\n btnBg: \"#0D0D0D\",\n btnFg: \"#FFFFFF\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#0A0A0A\",\n boxBorder: \"#2A2A2A\",\n fg: \"#EDEDED\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#A0A0A0\",\n btnBg: \"#FFFFFF\",\n btnFg: \"#0A0A0A\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction V0LogoIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>v0</title>\n <rect\n x={2.5}\n y={2.5}\n width={19}\n height={19}\n rx={5}\n stroke={color}\n strokeWidth={1.8}\n />\n <rect\n x={7.5}\n y={7.5}\n width={9}\n height={9}\n rx={2.5}\n stroke={color}\n strokeWidth={1.8}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function V0({\n greeting = \"What do you want to create?\",\n placeholder = \"Ask v0 to build…\",\n prompt = \"a landing page for my SaaS with pricing and testimonials\",\n modelName = \"v0 Max\",\n projectName = \"Project\",\n speed = 1,\n}: V0Props) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const boxFade = fadeUpAt(frame * speed, [10, 26]);\n\n const boxWidth = 880;\n const boxLeft = (refW - boxWidth) / 2;\n const boxTop = 270;\n const boxHeight = 150;\n const btnSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 150,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 44,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n translate: `0 ${headingFade.translateY + intro.translateY * 0.4}px`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: boxLeft,\n top: boxTop,\n width: boxWidth,\n height: boxHeight,\n background: t.boxBg,\n border: `1px solid ${t.boxBorder}`,\n borderRadius: 16,\n boxShadow: \"0 8px 40px -16px rgba(0,0,0,0.8)\",\n opacity: boxFade.opacity,\n translate: `0 ${boxFade.translateY + intro.translateY * 0.6}px`,\n scale: `${intro.scale}`,\n transformOrigin: \"center top\",\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n flex: 1,\n padding: \"18px 20px\",\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n color: t.fg,\n display: \"flex\",\n alignItems: \"flex-start\",\n overflow: \"hidden\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n whiteSpace: \"pre-wrap\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"12px 16px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 10 }}>\n <PlusIcon size={20} color={t.iconColor} />\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <V0LogoIcon size={18} color={t.fg} />\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n </div>\n\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 12 }}>\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {projectName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: btnSize,\n height: btnSize,\n borderRadius: 10,\n background: t.btnBg,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - morph,\n scale: `${1 - 0.08 * morph}`,\n }}\n >\n <MicIcon size={20} color={t.btnFg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: morph,\n scale: `${0.85 + 0.15 * morph}`,\n }}\n >\n <ArrowUpIcon size={20} color={t.btnFg} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/v0.tsx"
}
diff --git a/registry-artifacts/value-swap.json b/registry-artifacts/value-swap.json
index ca1f2772..05d2047f 100644
--- a/registry-artifacts/value-swap.json
+++ b/registry-artifacts/value-swap.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/value-swap/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport interface ValueSwapProps {\n values: string[];\n at: number | number[];\n duration?: number;\n distance?: number;\n direction?: \"up\" | \"down\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function ValueSwap({\n values,\n at,\n duration = 10,\n distance = 12,\n direction = \"up\",\n className,\n style,\n}: ValueSwapProps) {\n const frame = useCurrentFrame();\n const ats = Array.isArray(at) ? at : [at];\n const d = direction === \"down\" ? -distance : distance;\n const count = Math.min(values.length, ats.length + 1);\n const rendered = values.slice(0, count);\n const sizer = rendered.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n const swapP = (start: number) =>\n interpolate(frame, [start, start + duration], [0, 1], {\n ...clampOpts,\n easing: Easing.inOut(Easing.cubic),\n });\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {rendered.map((value, i) => {\n const pIn = i > 0 ? swapP(ats[i - 1]) : 1;\n const pOut = i < count - 1 ? swapP(ats[i]) : 0;\n const opacity = pIn * (1 - pOut);\n if (opacity <= 0.001) return null;\n const y = (1 - pIn) * d + pOut * -d;\n return (\n <span\n key={`${i}-${value}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {value}\n </span>\n );\n })}\n </span>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport interface ValueSwapProps {\n values: string[];\n at: number | number[];\n duration?: number;\n distance?: number;\n direction?: \"up\" | \"down\";\n className?: string;\n style?: React.CSSProperties;\n}\n\nexport function ValueSwap({\n values,\n at,\n duration = 10,\n distance = 12,\n direction = \"up\",\n className,\n style,\n}: ValueSwapProps) {\n const frame = useCurrentFrame();\n const ats = Array.isArray(at) ? at : [at];\n const d = direction === \"down\" ? -distance : distance;\n const count = Math.min(values.length, ats.length + 1);\n const rendered = values.slice(0, count);\n const sizer = rendered.reduce((a, b) => (b.length > a.length ? b : a), \"\");\n const swapP = (start: number) =>\n interpolate(frame, [start, start + duration], [0, 1], {\n ...clampOpts,\n easing: Easing.inOut(Easing.cubic),\n });\n return (\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n ...style,\n }}\n >\n <span style={{ visibility: \"hidden\" }}>{sizer}</span>\n {rendered.map((value, i) => {\n const pIn = i > 0 ? swapP(ats[i - 1]) : 1;\n const pOut = i < count - 1 ? swapP(ats[i]) : 0;\n const opacity = pIn * (1 - pOut);\n if (opacity <= 0.001) return null;\n const y = (1 - pIn) * d + pOut * -d;\n return (\n <span\n key={`${i}-${value}`}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n whiteSpace: \"nowrap\",\n opacity,\n translate: `0 ${y}px`,\n }}\n >\n {value}\n </span>\n );\n })}\n </span>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/value-swap.tsx"
}
diff --git a/registry-artifacts/vhs-filter.json b/registry-artifacts/vhs-filter.json
index 3873fbef..76353ca2 100644
--- a/registry-artifacts/vhs-filter.json
+++ b/registry-artifacts/vhs-filter.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/vhs-filter/index.tsx",
- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, random, useCurrentFrame } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type VhsFilterProps = {\n bleed?: number;\n wobble?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_time;\nuniform float u_bleed;\nuniform float u_wobble;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float LINES = 486.0;\nconst int TAPS = 6;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat valueNoise(float x) {\n float i = floor(x);\n float f = fract(x);\n float a = hash(vec2(i, 7.0));\n float b = hash(vec2(i + 1.0, 7.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec3 rgb2yiq(vec3 c) {\n return vec3(\n dot(c, vec3(0.299, 0.587, 0.114)),\n dot(c, vec3(0.5959, -0.2746, -0.3213)),\n dot(c, vec3(0.2115, -0.5227, 0.3112))\n );\n}\n\nvec3 yiq2rgb(vec3 c) {\n return vec3(\n c.x + 0.956 * c.y + 0.619 * c.z,\n c.x - 0.272 * c.y - 0.647 * c.z,\n c.x - 1.106 * c.y + 1.703 * c.z\n );\n}\n\nvoid main() {\n float line = floor(v_uv.y * LINES);\n float clock = mod(u_frame, 64.0);\n\n float drift =\n sin(v_uv.y * 37.0 + u_time * 2.3) * 0.55 +\n sin(v_uv.y * 96.0 - u_time * 1.1) * 0.25;\n float jitter = valueNoise(line * 0.61 + u_time * 24.0) - 0.5;\n float wobble = (drift * 0.35 + jitter * 0.9) * 0.007 * u_wobble * u_intensity;\n\n float band = smoothstep(0.955, 0.994, v_uv.y);\n float tear = valueNoise(line * 2.7 + u_time * 43.0) - 0.5;\n float headSwitch = band * tear * 0.085 * u_intensity;\n\n vec2 uv = vec2(v_uv.x + wobble + headSwitch, v_uv.y);\n vec4 base = texture(u_scene, uv);\n float luma = rgb2yiq(base.rgb).x;\n\n float smear = u_bleed * 0.02 * u_intensity;\n vec2 chroma = vec2(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1);\n float weight = 1.0 - t * 0.72;\n vec3 tap = texture(u_scene, vec2(uv.x - smear * t, uv.y)).rgb;\n chroma += rgb2yiq(tap).yz * weight;\n total += weight;\n }\n\n vec3 color = yiq2rgb(vec3(luma, chroma / total));\n\n float scan = 0.94 + 0.06 * cos(v_uv.y * LINES * PI);\n color *= mix(1.0, scan, u_intensity);\n\n float grain =\n hash(vec2(v_uv.x * 640.0 + clock * 13.0, line + clock * 5.0)) - 0.5;\n color += grain * 0.07 * u_noise * u_intensity;\n\n color = mix(color, vec3(luma), band * 0.55 * u_intensity);\n color += band * (hash(vec2(line, clock * 3.0)) - 0.5) * 0.26 * u_intensity;\n\n outColor = vec4(clamp(color, 0.0, 1.0), base.a);\n}`;\n\nconst shader = makeFilterShader<VhsFilterProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform1f(uniform(\"u_bleed\"), bleed);\n gl.uniform1f(uniform(\"u_wobble\"), wobble);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({\n children,\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n}) => {\n const frame = useCurrentFrame();\n const shift =\n (random(`vhs-wobble-${frame}`) - 0.5) * 3.4 * wobble * intensity;\n const flicker =\n 1 + (random(`vhs-flicker-${frame}`) - 0.5) * 0.07 * noise * intensity;\n const smear = 3 + bleed * 5;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift}px)`,\n filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n transform: `translateX(${shift - smear}px)`,\n filter: \"saturate(2.2) blur(1.4px)\",\n mixBlendMode: \"screen\",\n opacity: 0.24 * bleed * intensity,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px)\",\n opacity: intensity,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n insetInline: 0,\n bottom: 0,\n height: \"3.6%\",\n transform: `translateX(${shift * 3}px)`,\n background: `rgba(228, 228, 228, ${0.13 * intensity})`,\n mixBlendMode: \"screen\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const VhsFilter = makeCanvasFilter<VhsFilterProps>({\n shader,\n fallback: VhsFilterFallback,\n});\n",
+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, random, useCurrentFrame } from \"remotion\";\nimport {\n type CanvasFilterProps,\n makeCanvasFilter,\n makeFilterShader,\n} from \"@/lib/remocn/canvas-presentation\";\n\nexport type VhsFilterProps = {\n bleed?: number;\n wobble?: number;\n noise?: number;\n intensity?: number;\n};\n\nconst DEFAULTS = {\n bleed: 1,\n wobble: 1,\n noise: 1,\n intensity: 1,\n};\n\nconst FRAGMENT_SHADER = `#version 300 es\nprecision highp float;\n\nuniform sampler2D u_scene;\nuniform float u_frame;\nuniform float u_time;\nuniform float u_bleed;\nuniform float u_wobble;\nuniform float u_noise;\nuniform float u_intensity;\n\nin vec2 v_uv;\nout vec4 outColor;\n\nconst float PI = 3.141592653589793;\nconst float LINES = 486.0;\nconst int TAPS = 6;\n\nfloat hash(vec2 p) {\n return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453123);\n}\n\nfloat valueNoise(float x) {\n float i = floor(x);\n float f = fract(x);\n float a = hash(vec2(i, 7.0));\n float b = hash(vec2(i + 1.0, 7.0));\n return mix(a, b, f * f * (3.0 - 2.0 * f));\n}\n\nvec3 rgb2yiq(vec3 c) {\n return vec3(\n dot(c, vec3(0.299, 0.587, 0.114)),\n dot(c, vec3(0.5959, -0.2746, -0.3213)),\n dot(c, vec3(0.2115, -0.5227, 0.3112))\n );\n}\n\nvec3 yiq2rgb(vec3 c) {\n return vec3(\n c.x + 0.956 * c.y + 0.619 * c.z,\n c.x - 0.272 * c.y - 0.647 * c.z,\n c.x - 1.106 * c.y + 1.703 * c.z\n );\n}\n\nvoid main() {\n float line = floor(v_uv.y * LINES);\n float clock = mod(u_frame, 64.0);\n\n float drift =\n sin(v_uv.y * 37.0 + u_time * 2.3) * 0.55 +\n sin(v_uv.y * 96.0 - u_time * 1.1) * 0.25;\n float jitter = valueNoise(line * 0.61 + u_time * 24.0) - 0.5;\n float wobble = (drift * 0.35 + jitter * 0.9) * 0.007 * u_wobble * u_intensity;\n\n float band = smoothstep(0.955, 0.994, v_uv.y);\n float tear = valueNoise(line * 2.7 + u_time * 43.0) - 0.5;\n float headSwitch = band * tear * 0.085 * u_intensity;\n\n vec2 uv = vec2(v_uv.x + wobble + headSwitch, v_uv.y);\n vec4 base = texture(u_scene, uv);\n float luma = rgb2yiq(base.rgb).x;\n\n float smear = u_bleed * 0.02 * u_intensity;\n vec2 chroma = vec2(0.0);\n float total = 0.0;\n for (int i = 0; i < TAPS; i++) {\n float t = float(i) / float(TAPS - 1);\n float weight = 1.0 - t * 0.72;\n vec3 tap = texture(u_scene, vec2(uv.x - smear * t, uv.y)).rgb;\n chroma += rgb2yiq(tap).yz * weight;\n total += weight;\n }\n\n vec3 color = yiq2rgb(vec3(luma, chroma / total));\n\n float scan = 0.94 + 0.06 * cos(v_uv.y * LINES * PI);\n color *= mix(1.0, scan, u_intensity);\n\n float grain =\n hash(vec2(v_uv.x * 640.0 + clock * 13.0, line + clock * 5.0)) - 0.5;\n color += grain * 0.07 * u_noise * u_intensity;\n\n color = mix(color, vec3(luma), band * 0.55 * u_intensity);\n color += band * (hash(vec2(line, clock * 3.0)) - 0.5) * 0.26 * u_intensity;\n\n outColor = vec4(clamp(color, 0.0, 1.0), base.a);\n}`;\n\nconst shader = makeFilterShader<VhsFilterProps>(\n FRAGMENT_SHADER,\n ({ gl, uniform, passedProps }) => {\n const {\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n } = passedProps;\n gl.uniform1f(uniform(\"u_bleed\"), bleed);\n gl.uniform1f(uniform(\"u_wobble\"), wobble);\n gl.uniform1f(uniform(\"u_noise\"), noise);\n gl.uniform1f(uniform(\"u_intensity\"), intensity);\n },\n);\n\nconst VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({\n children,\n bleed = DEFAULTS.bleed,\n wobble = DEFAULTS.wobble,\n noise = DEFAULTS.noise,\n intensity = DEFAULTS.intensity,\n}) => {\n const frame = useCurrentFrame();\n const shift =\n (random(`vhs-wobble-${frame}`) - 0.5) * 3.4 * wobble * intensity;\n const flicker =\n 1 + (random(`vhs-flicker-${frame}`) - 0.5) * 0.07 * noise * intensity;\n const smear = 3 + bleed * 5;\n\n return (\n <AbsoluteFill>\n <AbsoluteFill\n style={{\n translate: `${shift}px`,\n filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n translate: `${shift - smear}px`,\n filter: \"saturate(2.2) blur(1.4px)\",\n mixBlendMode: \"screen\",\n opacity: 0.24 * bleed * intensity,\n }}\n >\n {children}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n background:\n \"repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0.22) 0px, rgba(0, 0, 0, 0.22) 1px, transparent 1px, transparent 3px)\",\n opacity: intensity,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n insetInline: 0,\n bottom: 0,\n height: \"3.6%\",\n translate: `${shift * 3}px`,\n background: `rgba(228, 228, 228, ${0.13 * intensity})`,\n mixBlendMode: \"screen\",\n }}\n />\n </AbsoluteFill>\n );\n};\n\nexport const VhsFilter = makeCanvasFilter<VhsFilterProps>({\n shader,\n fallback: VhsFilterFallback,\n});\n",
"type": "registry:component",
"target": "components/remocn/vhs-filter.tsx"
}
diff --git a/registry-artifacts/warp-dissolve.json b/registry-artifacts/warp-dissolve.json
index 836e44d2..92d4b9ff 100644
--- a/registry-artifacts/warp-dissolve.json
+++ b/registry-artifacts/warp-dissolve.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/warp-dissolve/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderWarp } from \"@/components/remocn/shader-warp\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#141318\", \"#3a3a5c\", \"#1f1d29\", \"#8f88ae\"];\n\nexport type WarpDissolveProps = {\n colors?: string[];\n distortion?: number;\n swirl?: number;\n softness?: number;\n speed?: number;\n};\n\nconst WarpDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<WarpDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n distortion = 0.8,\n swirl = 0.6,\n softness = 1,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const meltStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.2, 0.38], [1, 0], clampOpts),\n transform: `scale(${interpolate(p, [0, 0.38], [1, 1.16], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.04, 0.38], [0, 18], clampOpts)}px)`,\n };\n return <AbsoluteFill style={meltStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldDistortion = interpolate(\n p,\n [0, 0.5, 1],\n [distortion * 0.3, distortion, distortion * 0.4],\n clampOpts,\n );\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.66, 0.82], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.66, 1], [1.18, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.66, 0.92], [16, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderWarp\n speed={speed}\n colors={colors}\n distortion={fieldDistortion}\n swirl={swirl}\n softness={softness}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function warpDissolve(\n props: WarpDissolveProps = {},\n): TransitionPresentation<WarpDissolveProps> {\n return {\n component: WarpDissolvePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderWarp } from \"@/components/remocn/shader-warp\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#141318\", \"#3a3a5c\", \"#1f1d29\", \"#8f88ae\"];\n\nexport type WarpDissolveProps = {\n colors?: string[];\n distortion?: number;\n swirl?: number;\n softness?: number;\n speed?: number;\n};\n\nconst WarpDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<WarpDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n distortion = 0.8,\n swirl = 0.6,\n softness = 1,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const meltStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.2, 0.38], [1, 0], clampOpts),\n scale: `${interpolate(p, [0, 0.38], [1, 1.16], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.04, 0.38], [0, 18], clampOpts)}px)`,\n };\n return <AbsoluteFill style={meltStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldDistortion = interpolate(\n p,\n [0, 0.5, 1],\n [distortion * 0.3, distortion, distortion * 0.4],\n clampOpts,\n );\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.66, 0.82], [0, 1], clampOpts),\n scale: `${interpolate(p, [0.66, 1], [1.18, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })}`,\n filter: `blur(${interpolate(p, [0.66, 0.92], [16, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderWarp\n speed={speed}\n colors={colors}\n distortion={fieldDistortion}\n swirl={swirl}\n softness={softness}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function warpDissolve(\n props: WarpDissolveProps = {},\n): TransitionPresentation<WarpDissolveProps> {\n return {\n component: WarpDissolvePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/warp-dissolve.tsx"
}
diff --git a/registry-artifacts/wave-wipe.json b/registry-artifacts/wave-wipe.json
index 16ff4017..3e8c4176 100644
--- a/registry-artifacts/wave-wipe.json
+++ b/registry-artifacts/wave-wipe.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/wave-wipe/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type WaveWipeProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst WaveWipePresentation: React.FC<\n TransitionPresentationComponentProps<WaveWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.2,\n softness = 0.7,\n noise = 0.4,\n zoom = 1.16,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `translateY(${interpolate(p, [0, 0.7], [0, -70], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}%)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.18, 0.45], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const drift = interpolate(p, [0, 1], [0, 0.7], {\n ...clampOpts,\n easing: Easing.bezier(0.45, 0, 0.55, 1),\n });\n const rise = interpolate(p, [0.4, 0.82, 1], [100, -3.5, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"wave\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={zoom}\n offsetY={drift}\n />\n </AbsoluteFill>\n <AbsoluteFill style={{ transform: `translateY(${rise}%)` }}>\n {children}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function waveWipe(\n props: WaveWipeProps = {},\n): TransitionPresentation<WaveWipeProps> {\n return {\n component: WaveWipePresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type WaveWipeProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst WaveWipePresentation: React.FC<\n TransitionPresentationComponentProps<WaveWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.2,\n softness = 0.7,\n noise = 0.4,\n zoom = 1.16,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n translate: `0 ${interpolate(p, [0, 0.7], [0, -70], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}%`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.18, 0.45], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const drift = interpolate(p, [0, 1], [0, 0.7], {\n ...clampOpts,\n easing: Easing.bezier(0.45, 0, 0.55, 1),\n });\n const rise = interpolate(p, [0.4, 0.82, 1], [100, -3.5, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"wave\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={zoom}\n offsetY={drift}\n />\n </AbsoluteFill>\n <AbsoluteFill style={{ translate: `0 ${rise}%` }}>\n {children}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function waveWipe(\n props: WaveWipeProps = {},\n): TransitionPresentation<WaveWipeProps> {\n return {\n component: WaveWipePresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/wave-wipe.tsx"
}
diff --git a/registry-artifacts/whip-pan.json b/registry-artifacts/whip-pan.json
index a1162d70..5fdab6cb 100644
--- a/registry-artifacts/whip-pan.json
+++ b/registry-artifacts/whip-pan.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/whip-pan/index.tsx",
- "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type WhipPanProps = {\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n blur?: number;\n};\n\nconst WhipPanPresentation: React.FC<\n TransitionPresentationComponentProps<WhipPanProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { direction = \"left\", blur = 24 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const travel = interpolate(p, [0, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.2, 1),\n });\n const velocity = Math.sin(Math.PI * travel);\n\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign = direction === \"left\" || direction === \"up\" ? -1 : 1;\n\n const offset = entering ? (travel - 1) * 110 * sign : travel * 110 * sign;\n const stretch = 1 + velocity * 0.12;\n\n const translate =\n axis === \"x\" ? `translateX(${offset}%)` : `translateY(${offset}%)`;\n const smear = axis === \"x\" ? `scaleX(${stretch})` : `scaleY(${stretch})`;\n\n const style: React.CSSProperties = {\n transform: `${translate} ${smear}`,\n filter: `blur(${velocity * blur}px)`,\n };\n\n return <AbsoluteFill style={style}>{children}</AbsoluteFill>;\n};\n\nexport function whipPan(\n props: WhipPanProps = {},\n): TransitionPresentation<WhipPanProps> {\n return {\n component: WhipPanPresentation,\n props,\n };\n}\n",
+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type WhipPanProps = {\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n blur?: number;\n};\n\nconst WhipPanPresentation: React.FC<\n TransitionPresentationComponentProps<WhipPanProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { direction = \"left\", blur = 24 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const travel = interpolate(p, [0, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.2, 1),\n });\n const velocity = Math.sin(Math.PI * travel);\n\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign = direction === \"left\" || direction === \"up\" ? -1 : 1;\n\n const offset = entering ? (travel - 1) * 110 * sign : travel * 110 * sign;\n const stretch = 1 + velocity * 0.12;\n\n const translate = axis === \"x\" ? `${offset}%` : `0 ${offset}%`;\n const smear = axis === \"x\" ? `${stretch} 1` : `1 ${stretch}`;\n\n const style: React.CSSProperties = {\n translate,\n scale: smear,\n filter: `blur(${velocity * blur}px)`,\n };\n\n return <AbsoluteFill style={style}>{children}</AbsoluteFill>;\n};\n\nexport function whipPan(\n props: WhipPanProps = {},\n): TransitionPresentation<WhipPanProps> {\n return {\n component: WhipPanPresentation,\n props,\n };\n}\n",
"type": "registry:component",
"target": "components/remocn/whip-pan.tsx"
}
diff --git a/registry-artifacts/x-follow-card.json b/registry-artifacts/x-follow-card.json
index d7e2cb89..5ad297dd 100644
--- a/registry-artifacts/x-follow-card.json
+++ b/registry-artifacts/x-follow-card.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/x-follow-card/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport { useState } from \"react\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Cursor, type CursorStyle } from \"@/components/remocn/cursor\";\nimport {\n type CursorWaypoint,\n useCursorPath,\n} from \"@/components/remocn/use-cursor-path\";\n\nconst { fontFamily: FONT_FAMILY } = loadFont();\n\nexport interface XFollowCardProps {\n name?: string;\n handle?: string;\n bio?: string;\n avatarUrl?: string;\n coverUrl?: string;\n location?: string;\n website?: string;\n joined?: string;\n verified?: boolean;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n divider: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#f5f7f9\",\n cardBg: \"#ffffff\",\n cardBorder: \"#e6e9eb\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n divider: \"#eff3f4\",\n },\n dark: {\n page: \"#0a0a0a\",\n cardBg: \"#16181c\",\n cardBorder: \"#2f3336\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n divider: \"#2f3336\",\n },\n};\n\nexport const CLICK_FRAME = 110;\n\nconst BUTTON_LAYOUT: Record<\n \"horizontal\" | \"vertical\",\n { x: number; y: number; w: number; h: number }\n> = {\n horizontal: { x: 800, y: 240, w: 116, h: 40 },\n vertical: { x: 542, y: 336, w: 124, h: 44 },\n};\n\nexport function cardBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 12, stiffness: 120, mass: 0.8 },\n });\n const translateY = interpolate(s, [0, 1], [60, 0]);\n const scale = interpolate(s, [0, 1], [0.9, 1]);\n return { translateY, scale };\n}\n\nexport function blurInSchedule(): {\n group: number;\n start: number;\n end: number;\n}[] {\n return [\n { group: 0, start: 20, end: 26 },\n { group: 1, start: 22, end: 28 },\n { group: 2, start: 24, end: 30 },\n { group: 3, start: 26, end: 32 },\n { group: 4, start: 28, end: 34 },\n { group: 5, start: 30, end: 36 },\n { group: 6, start: 32, end: 38 },\n { group: 7, start: 34, end: 40 },\n { group: 8, start: 36, end: 42 },\n ];\n}\n\nexport function blurInAt(\n step: { start: number; end: number },\n frame: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [step.start, step.end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [8, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [8, 0], opts),\n };\n}\n\nexport function followStateAt(frame: number, speed: number): boolean {\n return frame * speed >= CLICK_FRAME;\n}\n\nexport function buildFollowWaypoints(args: {\n buttonCenter: { x: number; y: number };\n orientation: \"horizontal\" | \"vertical\";\n}): CursorWaypoint[] {\n const { buttonCenter, orientation } = args;\n const rest =\n orientation === \"vertical\" ? { x: 640, y: 1120 } : { x: 1120, y: 600 };\n return [\n { at: 0, x: rest.x, y: rest.y },\n { at: 75, x: rest.x, y: rest.y },\n {\n at: CLICK_FRAME,\n x: buttonCenter.x,\n y: buttonCenter.y,\n duration: 32,\n click: true,\n easing: \"inOut\",\n },\n { at: CLICK_FRAME + 30, x: buttonCenter.x, y: buttonCenter.y },\n ];\n}\n\nfunction tintGradient(accent: string): string {\n return `linear-gradient(135deg, ${accent} 0%, ${accent}99 55%, ${accent}55 100%)`;\n}\n\nfunction Cover({\n coverUrl,\n accent,\n height,\n}: {\n coverUrl: string;\n accent: string;\n height: number;\n}) {\n const [errored, setErrored] = useState(false);\n const fallback = (\n <div\n style={{\n width: \"100%\",\n height,\n background: tintGradient(accent),\n }}\n />\n );\n if (errored || !coverUrl) return fallback;\n return (\n <Img\n src={coverUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ width: \"100%\", height, objectFit: \"cover\", display: \"block\" }}\n />\n );\n}\n\nfunction Avatar({\n avatarUrl,\n name,\n size,\n accent,\n theme,\n}: {\n avatarUrl: string;\n name: string;\n size: number;\n accent: string;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `4px solid ${theme.cardBg}`,\n flexShrink: 0,\n boxSizing: \"border-box\" as const,\n };\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: `${accent}33`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: accent,\n fontSize: size * 0.4,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {name.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction ProfileInfo({\n name,\n handle,\n bio,\n verified,\n accent,\n theme,\n isVertical,\n nameStyle,\n handleStyle,\n bioStyle,\n}: {\n name: string;\n handle: string;\n bio: string;\n verified: boolean;\n accent: string;\n theme: Theme;\n isVertical: boolean;\n nameStyle: React.CSSProperties;\n handleStyle: React.CSSProperties;\n bioStyle: React.CSSProperties;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n marginTop: 12,\n }}\n >\n <div\n style={{ ...nameStyle, display: \"flex\", alignItems: \"center\", gap: 6 }}\n >\n <span\n style={{\n fontSize: isVertical ? 28 : 24,\n fontWeight: 800,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.2,\n letterSpacing: \"-0.01em\",\n }}\n >\n {name}\n </span>\n {verified && (\n <VerifiedBadge accent={accent} size={isVertical ? 24 : 22} />\n )}\n </div>\n <span\n style={{\n ...handleStyle,\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n @{handle}\n </span>\n <p\n style={{\n ...bioStyle,\n margin: \"8px 0 0\",\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n overflow: \"hidden\",\n }}\n >\n {bio}\n </p>\n </div>\n );\n}\n\nfunction MetaRow({\n location,\n website,\n joined,\n accent,\n theme,\n}: {\n location: string;\n website: string;\n joined: string;\n accent: string;\n theme: Theme;\n}) {\n const itemStyle = {\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 15,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n } as const;\n return (\n <div\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: 16,\n marginTop: 14,\n }}\n >\n <span style={itemStyle}>\n <PinIcon color={theme.fgMuted} />\n {location}\n </span>\n <span style={itemStyle}>\n <LinkIcon color={theme.fgMuted} />\n <span style={{ color: accent }}>{website}</span>\n </span>\n <span style={itemStyle}>\n <CalendarIcon color={theme.fgMuted} />\n {`Joined ${joined}`}\n </span>\n </div>\n );\n}\n\nfunction PinIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Location</title>\n <path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z\" />\n </svg>\n );\n}\n\nfunction LinkIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Website</title>\n <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\" />\n </svg>\n );\n}\n\nfunction CalendarIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Joined</title>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </svg>\n );\n}\n\nfunction FollowButton({\n frame,\n speed,\n accent,\n theme,\n layout,\n pressScale,\n}: {\n frame: number;\n speed: number;\n accent: string;\n theme: Theme;\n layout: { x: number; y: number; w: number; h: number };\n pressScale: number;\n}) {\n const _followed = followStateAt(frame, speed);\n const flip = interpolate(\n frame * speed,\n [CLICK_FRAME, CLICK_FRAME + 10],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const base = {\n position: \"absolute\" as const,\n left: layout.x,\n top: layout.y,\n width: layout.w,\n height: layout.h,\n borderRadius: layout.h / 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 16,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n boxSizing: \"border-box\" as const,\n transform: `scale(${pressScale})`,\n transformOrigin: \"center\",\n };\n\n return (\n <div style={base}>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: accent,\n color: \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - flip,\n }}\n >\n Follow\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: theme.cardBg,\n border: `1px solid ${theme.cardBorder}`,\n color: theme.fg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: flip,\n }}\n >\n Following\n </div>\n </div>\n );\n}\n\nfunction MessageButton({\n layout,\n theme,\n}: {\n layout: { x: number; y: number; size: number };\n theme: Theme;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: layout.x,\n top: layout.y,\n width: layout.size,\n height: layout.size,\n borderRadius: layout.size / 2,\n border: `1px solid ${theme.cardBorder}`,\n background: theme.cardBg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill={theme.fg}>\n <title>Message</title>\n <path d=\"M1.998 5.5c0-1.381 1.119-2.5 2.5-2.5h15c1.381 0 2.5 1.119 2.5 2.5v13c0 1.381-1.119 2.5-2.5 2.5h-15c-1.381 0-2.5-1.119-2.5-2.5v-13zm2.5-.5c-.276 0-.5.224-.5.5v2.764l8 3.638 8-3.638V5.5c0-.276-.224-.5-.5-.5h-15zm15.5 5.463l-8 3.638-8-3.638V18.5c0 .276.224.5.5.5h15c.276 0 .5-.224.5-.5v-8.037z\" />\n </svg>\n </div>\n );\n}\n\nfunction Tabs({\n accent,\n theme,\n isVertical,\n}: {\n accent: string;\n theme: Theme;\n isVertical: boolean;\n}) {\n const tabs = [\"Posts\", \"Replies\", \"Media\", \"Likes\"];\n return (\n <div\n style={{\n display: \"flex\",\n marginTop: 0,\n columnGap: 32,\n borderBottom: `1px solid ${theme.divider}`,\n }}\n >\n {tabs.map((tab, i) => {\n const active = i === 0;\n return (\n <div\n key={tab}\n style={{\n // flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n paddingBottom: 12,\n position: \"relative\",\n }}\n >\n <span\n style={{\n fontSize: isVertical ? 17 : 15,\n fontWeight: active ? 700 : 500,\n color: active ? theme.fg : theme.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n {tab}\n </span>\n {active && (\n <div\n style={{\n position: \"absolute\",\n bottom: -1,\n height: 4,\n width: 56,\n borderRadius: 2,\n background: accent,\n }}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction SamplePost({\n name,\n handle,\n avatarUrl,\n accent,\n theme,\n}: {\n name: string;\n handle: string;\n avatarUrl: string;\n accent: string;\n theme: Theme;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n gap: 12,\n marginTop: 16,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={44}\n accent={accent}\n theme={theme}\n />\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontFamily: FONT_FAMILY,\n }}\n >\n <span style={{ fontSize: 15, fontWeight: 700, color: theme.fg }}>\n {name}\n </span>\n <span style={{ fontSize: 15, color: theme.fgMuted }}>\n {`@${handle} · 2d`}\n </span>\n </div>\n <p\n style={{\n margin: \"4px 0 0\",\n fontSize: 15,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n }}\n >\n Shipping something new today. Built entirely with Remotion and a lot\n of coffee. More soon.\n </p>\n <div\n style={{\n display: \"flex\",\n gap: 40,\n marginTop: 10,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n fontSize: 13,\n }}\n >\n <span>12</span>\n <span>48</span>\n <span>312</span>\n </div>\n </div>\n </div>\n );\n}\n\nfunction CursorLayer({\n accent,\n style,\n}: {\n accent: string;\n style: CursorStyle;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n }}\n >\n <Cursor variant=\"pointer\" rippleColor={accent} style={style} />\n </div>\n );\n}\n\nexport function XFollowCard({\n name = \"remocn\",\n handle = \"remocn\",\n bio = \"Building the collaborative video toolkit for small teams.\\nShip demos faster with ready-made motion.\",\n avatarUrl = \"/logo.svg\",\n coverUrl = \"\",\n location = \"Tunisia\",\n website = \"remocn.tn\",\n joined = \"January 2024\",\n verified = true,\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowCardProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const cardWidth = isVertical ? 660 : 600;\n const cardLeft = (refW - cardWidth) / 2;\n const cardTop = isVertical ? 140 : 70;\n const coverHeight = isVertical ? 180 : 150;\n const avatarSize = isVertical ? 120 : 110;\n\n const bounce = cardBounceIn(frame * speed, fps);\n const schedule = blurInSchedule();\n\n const layout = BUTTON_LAYOUT[orientation];\n const buttonCenter = {\n x: layout.x + layout.w / 2,\n y: layout.y + layout.h / 2,\n };\n\n const cursorStyle = useCursorPath(\n buildFollowWaypoints({ buttonCenter, orientation }),\n { speed },\n );\n const pressScale = 0.9 + 0.1 * (cursorStyle.pressScale ?? 1);\n\n const messageLayout = {\n x: layout.x - layout.h - 8,\n y: layout.y,\n size: layout.h,\n };\n\n const groupStyle = (group: number) => {\n const step = schedule[group];\n const b = blurInAt(step, frame * speed);\n return {\n filter: b.blur > 0 ? `blur(${b.blur}px)` : \"none\",\n opacity: b.opacity,\n transform: `translateY(${b.translateY}px)`,\n };\n };\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: cardTop,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n overflow: \"hidden\",\n transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,\n transformOrigin: \"center top\",\n boxShadow: \"0 12px 40px -16px rgba(15,20,25,0.18)\",\n }}\n >\n <div style={groupStyle(0)}>\n <Cover\n coverUrl={coverUrl}\n accent={accentColor}\n height={coverHeight}\n />\n </div>\n\n <div style={{ padding: \"0 24px 24px\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"flex-end\",\n marginTop: -(avatarSize / 2),\n position: \"relative\",\n }}\n >\n <div\n style={{\n width: avatarSize,\n height: avatarSize,\n borderRadius: \"100%\",\n background: t.cardBg,\n flexShrink: 0,\n }}\n >\n <div style={groupStyle(1)}>\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={avatarSize}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <ProfileInfo\n name={name}\n handle={handle}\n bio={bio}\n verified={verified}\n accent={accentColor}\n theme={t}\n isVertical={isVertical}\n nameStyle={groupStyle(2)}\n handleStyle={groupStyle(3)}\n bioStyle={groupStyle(4)}\n />\n\n <div style={groupStyle(5)}>\n <MetaRow\n location={location}\n website={website}\n joined={joined}\n accent={accentColor}\n theme={t}\n />\n </div>\n\n <div style={{ height: layout.h - 8 }} aria-hidden=\"true\" />\n\n <div style={groupStyle(7)}>\n <Tabs accent={accentColor} theme={t} isVertical={isVertical} />\n </div>\n\n <div style={groupStyle(8)}>\n <SamplePost\n name={name}\n handle={handle}\n avatarUrl={avatarUrl}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div style={{ ...groupStyle(6), position: \"absolute\", inset: 0 }}>\n <MessageButton layout={messageLayout} theme={t} />\n <FollowButton\n frame={frame}\n speed={speed}\n accent={accentColor}\n theme={t}\n layout={layout}\n pressScale={pressScale}\n />\n </div>\n </div>\n\n <CursorLayer accent={accentColor} style={cursorStyle} />\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport { useState } from \"react\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Cursor, type CursorStyle } from \"@/components/remocn/cursor\";\nimport {\n type CursorWaypoint,\n useCursorPath,\n} from \"@/components/remocn/use-cursor-path\";\n\nconst { fontFamily: FONT_FAMILY } = loadFont();\n\nexport interface XFollowCardProps {\n name?: string;\n handle?: string;\n bio?: string;\n avatarUrl?: string;\n coverUrl?: string;\n location?: string;\n website?: string;\n joined?: string;\n verified?: boolean;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n divider: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#f5f7f9\",\n cardBg: \"#ffffff\",\n cardBorder: \"#e6e9eb\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n divider: \"#eff3f4\",\n },\n dark: {\n page: \"#0a0a0a\",\n cardBg: \"#16181c\",\n cardBorder: \"#2f3336\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n divider: \"#2f3336\",\n },\n};\n\nexport const CLICK_FRAME = 110;\n\nconst BUTTON_LAYOUT: Record<\n \"horizontal\" | \"vertical\",\n { x: number; y: number; w: number; h: number }\n> = {\n horizontal: { x: 800, y: 240, w: 116, h: 40 },\n vertical: { x: 542, y: 336, w: 124, h: 44 },\n};\n\nexport function cardBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 12, stiffness: 120, mass: 0.8 },\n });\n const translateY = interpolate(s, [0, 1], [60, 0]);\n const scale = interpolate(s, [0, 1], [0.9, 1]);\n return { translateY, scale };\n}\n\nexport function blurInSchedule(): {\n group: number;\n start: number;\n end: number;\n}[] {\n return [\n { group: 0, start: 20, end: 26 },\n { group: 1, start: 22, end: 28 },\n { group: 2, start: 24, end: 30 },\n { group: 3, start: 26, end: 32 },\n { group: 4, start: 28, end: 34 },\n { group: 5, start: 30, end: 36 },\n { group: 6, start: 32, end: 38 },\n { group: 7, start: 34, end: 40 },\n { group: 8, start: 36, end: 42 },\n ];\n}\n\nexport function blurInAt(\n step: { start: number; end: number },\n frame: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [step.start, step.end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [8, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [8, 0], opts),\n };\n}\n\nexport function followStateAt(frame: number, speed: number): boolean {\n return frame * speed >= CLICK_FRAME;\n}\n\nexport function buildFollowWaypoints(args: {\n buttonCenter: { x: number; y: number };\n orientation: \"horizontal\" | \"vertical\";\n}): CursorWaypoint[] {\n const { buttonCenter, orientation } = args;\n const rest =\n orientation === \"vertical\" ? { x: 640, y: 1120 } : { x: 1120, y: 600 };\n return [\n { at: 0, x: rest.x, y: rest.y },\n { at: 75, x: rest.x, y: rest.y },\n {\n at: CLICK_FRAME,\n x: buttonCenter.x,\n y: buttonCenter.y,\n duration: 32,\n click: true,\n easing: \"inOut\",\n },\n { at: CLICK_FRAME + 30, x: buttonCenter.x, y: buttonCenter.y },\n ];\n}\n\nfunction tintGradient(accent: string): string {\n return `linear-gradient(135deg, ${accent} 0%, ${accent}99 55%, ${accent}55 100%)`;\n}\n\nfunction Cover({\n coverUrl,\n accent,\n height,\n}: {\n coverUrl: string;\n accent: string;\n height: number;\n}) {\n const [errored, setErrored] = useState(false);\n const fallback = (\n <div\n style={{\n width: \"100%\",\n height,\n background: tintGradient(accent),\n }}\n />\n );\n if (errored || !coverUrl) return fallback;\n return (\n <Img\n src={coverUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ width: \"100%\", height, objectFit: \"cover\", display: \"block\" }}\n />\n );\n}\n\nfunction Avatar({\n avatarUrl,\n name,\n size,\n accent,\n theme,\n}: {\n avatarUrl: string;\n name: string;\n size: number;\n accent: string;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `4px solid ${theme.cardBg}`,\n flexShrink: 0,\n boxSizing: \"border-box\" as const,\n };\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: `${accent}33`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: accent,\n fontSize: size * 0.4,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {name.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction ProfileInfo({\n name,\n handle,\n bio,\n verified,\n accent,\n theme,\n isVertical,\n nameStyle,\n handleStyle,\n bioStyle,\n}: {\n name: string;\n handle: string;\n bio: string;\n verified: boolean;\n accent: string;\n theme: Theme;\n isVertical: boolean;\n nameStyle: React.CSSProperties;\n handleStyle: React.CSSProperties;\n bioStyle: React.CSSProperties;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n marginTop: 12,\n }}\n >\n <div\n style={{ ...nameStyle, display: \"flex\", alignItems: \"center\", gap: 6 }}\n >\n <span\n style={{\n fontSize: isVertical ? 28 : 24,\n fontWeight: 800,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.2,\n letterSpacing: \"-0.01em\",\n }}\n >\n {name}\n </span>\n {verified && (\n <VerifiedBadge accent={accent} size={isVertical ? 24 : 22} />\n )}\n </div>\n <span\n style={{\n ...handleStyle,\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n @{handle}\n </span>\n <p\n style={{\n ...bioStyle,\n margin: \"8px 0 0\",\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n overflow: \"hidden\",\n }}\n >\n {bio}\n </p>\n </div>\n );\n}\n\nfunction MetaRow({\n location,\n website,\n joined,\n accent,\n theme,\n}: {\n location: string;\n website: string;\n joined: string;\n accent: string;\n theme: Theme;\n}) {\n const itemStyle = {\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 15,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n } as const;\n return (\n <div\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: 16,\n marginTop: 14,\n }}\n >\n <span style={itemStyle}>\n <PinIcon color={theme.fgMuted} />\n {location}\n </span>\n <span style={itemStyle}>\n <LinkIcon color={theme.fgMuted} />\n <span style={{ color: accent }}>{website}</span>\n </span>\n <span style={itemStyle}>\n <CalendarIcon color={theme.fgMuted} />\n {`Joined ${joined}`}\n </span>\n </div>\n );\n}\n\nfunction PinIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Location</title>\n <path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z\" />\n </svg>\n );\n}\n\nfunction LinkIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Website</title>\n <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\" />\n </svg>\n );\n}\n\nfunction CalendarIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Joined</title>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </svg>\n );\n}\n\nfunction FollowButton({\n frame,\n speed,\n accent,\n theme,\n layout,\n pressScale,\n}: {\n frame: number;\n speed: number;\n accent: string;\n theme: Theme;\n layout: { x: number; y: number; w: number; h: number };\n pressScale: number;\n}) {\n const _followed = followStateAt(frame, speed);\n const flip = interpolate(\n frame * speed,\n [CLICK_FRAME, CLICK_FRAME + 10],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const base = {\n position: \"absolute\" as const,\n left: layout.x,\n top: layout.y,\n width: layout.w,\n height: layout.h,\n borderRadius: layout.h / 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 16,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n boxSizing: \"border-box\" as const,\n scale: `${pressScale}`,\n transformOrigin: \"center\",\n };\n\n return (\n <div style={base}>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: accent,\n color: \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - flip,\n }}\n >\n Follow\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: theme.cardBg,\n border: `1px solid ${theme.cardBorder}`,\n color: theme.fg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: flip,\n }}\n >\n Following\n </div>\n </div>\n );\n}\n\nfunction MessageButton({\n layout,\n theme,\n}: {\n layout: { x: number; y: number; size: number };\n theme: Theme;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: layout.x,\n top: layout.y,\n width: layout.size,\n height: layout.size,\n borderRadius: layout.size / 2,\n border: `1px solid ${theme.cardBorder}`,\n background: theme.cardBg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill={theme.fg}>\n <title>Message</title>\n <path d=\"M1.998 5.5c0-1.381 1.119-2.5 2.5-2.5h15c1.381 0 2.5 1.119 2.5 2.5v13c0 1.381-1.119 2.5-2.5 2.5h-15c-1.381 0-2.5-1.119-2.5-2.5v-13zm2.5-.5c-.276 0-.5.224-.5.5v2.764l8 3.638 8-3.638V5.5c0-.276-.224-.5-.5-.5h-15zm15.5 5.463l-8 3.638-8-3.638V18.5c0 .276.224.5.5.5h15c.276 0 .5-.224.5-.5v-8.037z\" />\n </svg>\n </div>\n );\n}\n\nfunction Tabs({\n accent,\n theme,\n isVertical,\n}: {\n accent: string;\n theme: Theme;\n isVertical: boolean;\n}) {\n const tabs = [\"Posts\", \"Replies\", \"Media\", \"Likes\"];\n return (\n <div\n style={{\n display: \"flex\",\n marginTop: 0,\n columnGap: 32,\n borderBottom: `1px solid ${theme.divider}`,\n }}\n >\n {tabs.map((tab, i) => {\n const active = i === 0;\n return (\n <div\n key={tab}\n style={{\n // flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n paddingBottom: 12,\n position: \"relative\",\n }}\n >\n <span\n style={{\n fontSize: isVertical ? 17 : 15,\n fontWeight: active ? 700 : 500,\n color: active ? theme.fg : theme.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n {tab}\n </span>\n {active && (\n <div\n style={{\n position: \"absolute\",\n bottom: -1,\n height: 4,\n width: 56,\n borderRadius: 2,\n background: accent,\n }}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction SamplePost({\n name,\n handle,\n avatarUrl,\n accent,\n theme,\n}: {\n name: string;\n handle: string;\n avatarUrl: string;\n accent: string;\n theme: Theme;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n gap: 12,\n marginTop: 16,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={44}\n accent={accent}\n theme={theme}\n />\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontFamily: FONT_FAMILY,\n }}\n >\n <span style={{ fontSize: 15, fontWeight: 700, color: theme.fg }}>\n {name}\n </span>\n <span style={{ fontSize: 15, color: theme.fgMuted }}>\n {`@${handle} · 2d`}\n </span>\n </div>\n <p\n style={{\n margin: \"4px 0 0\",\n fontSize: 15,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n }}\n >\n Shipping something new today. Built entirely with Remotion and a lot\n of coffee. More soon.\n </p>\n <div\n style={{\n display: \"flex\",\n gap: 40,\n marginTop: 10,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n fontSize: 13,\n }}\n >\n <span>12</span>\n <span>48</span>\n <span>312</span>\n </div>\n </div>\n </div>\n );\n}\n\nfunction CursorLayer({\n accent,\n style,\n}: {\n accent: string;\n style: CursorStyle;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n }}\n >\n <Cursor variant=\"pointer\" rippleColor={accent} style={style} />\n </div>\n );\n}\n\nexport function XFollowCard({\n name = \"remocn\",\n handle = \"remocn\",\n bio = \"Building the collaborative video toolkit for small teams.\\nShip demos faster with ready-made motion.\",\n avatarUrl = \"/logo.svg\",\n coverUrl = \"\",\n location = \"Tunisia\",\n website = \"remocn.tn\",\n joined = \"January 2024\",\n verified = true,\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowCardProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const cardWidth = isVertical ? 660 : 600;\n const cardLeft = (refW - cardWidth) / 2;\n const cardTop = isVertical ? 140 : 70;\n const coverHeight = isVertical ? 180 : 150;\n const avatarSize = isVertical ? 120 : 110;\n\n const bounce = cardBounceIn(frame * speed, fps);\n const schedule = blurInSchedule();\n\n const layout = BUTTON_LAYOUT[orientation];\n const buttonCenter = {\n x: layout.x + layout.w / 2,\n y: layout.y + layout.h / 2,\n };\n\n const cursorStyle = useCursorPath(\n buildFollowWaypoints({ buttonCenter, orientation }),\n { speed },\n );\n const pressScale = 0.9 + 0.1 * (cursorStyle.pressScale ?? 1);\n\n const messageLayout = {\n x: layout.x - layout.h - 8,\n y: layout.y,\n size: layout.h,\n };\n\n const groupStyle = (group: number) => {\n const step = schedule[group];\n const b = blurInAt(step, frame * speed);\n return {\n filter: b.blur > 0 ? `blur(${b.blur}px)` : \"none\",\n opacity: b.opacity,\n translate: `0 ${b.translateY}px`,\n };\n };\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: cardTop,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n overflow: \"hidden\",\n translate: `0 ${bounce.translateY}px`,\n scale: `${bounce.scale}`,\n transformOrigin: \"center top\",\n boxShadow: \"0 12px 40px -16px rgba(15,20,25,0.18)\",\n }}\n >\n <div style={groupStyle(0)}>\n <Cover\n coverUrl={coverUrl}\n accent={accentColor}\n height={coverHeight}\n />\n </div>\n\n <div style={{ padding: \"0 24px 24px\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"flex-end\",\n marginTop: -(avatarSize / 2),\n position: \"relative\",\n }}\n >\n <div\n style={{\n width: avatarSize,\n height: avatarSize,\n borderRadius: \"100%\",\n background: t.cardBg,\n flexShrink: 0,\n }}\n >\n <div style={groupStyle(1)}>\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={avatarSize}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <ProfileInfo\n name={name}\n handle={handle}\n bio={bio}\n verified={verified}\n accent={accentColor}\n theme={t}\n isVertical={isVertical}\n nameStyle={groupStyle(2)}\n handleStyle={groupStyle(3)}\n bioStyle={groupStyle(4)}\n />\n\n <div style={groupStyle(5)}>\n <MetaRow\n location={location}\n website={website}\n joined={joined}\n accent={accentColor}\n theme={t}\n />\n </div>\n\n <div style={{ height: layout.h - 8 }} aria-hidden=\"true\" />\n\n <div style={groupStyle(7)}>\n <Tabs accent={accentColor} theme={t} isVertical={isVertical} />\n </div>\n\n <div style={groupStyle(8)}>\n <SamplePost\n name={name}\n handle={handle}\n avatarUrl={avatarUrl}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n translate: `0 ${bounce.translateY}px`,\n scale: `${bounce.scale}`,\n transformOrigin: \"center top\",\n }}\n >\n <div style={{ ...groupStyle(6), position: \"absolute\", inset: 0 }}>\n <MessageButton layout={messageLayout} theme={t} />\n <FollowButton\n frame={frame}\n speed={speed}\n accent={accentColor}\n theme={t}\n layout={layout}\n pressScale={pressScale}\n />\n </div>\n </div>\n\n <CursorLayer accent={accentColor} style={cursorStyle} />\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/x-follow-card.tsx"
}
diff --git a/registry-artifacts/x-followers-overview.json b/registry-artifacts/x-followers-overview.json
index c5f22a24..27e0d3b7 100644
--- a/registry-artifacts/x-followers-overview.json
+++ b/registry-artifacts/x-followers-overview.json
@@ -8,7 +8,7 @@
"files": [
{
"path": "registry/remocn/x-followers-overview/index.tsx",
- "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { useState } from \"react\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Confetti } from \"@/components/remocn/confetti\";\n\nexport interface FollowerNotification {\n name: string;\n verified: boolean;\n /** Relative time label, e.g. \"7h\", \"1d\". */\n time: string;\n}\n\nexport interface XFollowersOverviewProps {\n notifications?: FollowerNotification[];\n totalFollowers?: number;\n handle?: string;\n avatarUrl?: string;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n border: \"#eff3f4\",\n },\n dark: {\n bg: \"#0a0a0a\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n border: \"#2f3336\",\n },\n};\n\n/**\n * Hardcoded sample notifications so the composition renders immediately from\n * defaults. A future revision swaps this for live X API data.\n */\nexport const SAMPLE_FOLLOWERS: FollowerNotification[] = [\n { name: \"Andre Vitorio\", verified: true, time: \"7h\" },\n { name: \"Sarah Chen\", verified: true, time: \"7h\" },\n { name: \"marcus\", verified: false, time: \"8h\" },\n { name: \"Lena Powell\", verified: true, time: \"9h\" },\n { name: \"dev_jay\", verified: false, time: \"10h\" },\n { name: \"Priya Nair\", verified: true, time: \"11h\" },\n { name: \"Tomás Rivera\", verified: true, time: \"13h\" },\n { name: \"hana.eth\", verified: false, time: \"15h\" },\n { name: \"Will Carter\", verified: true, time: \"18h\" },\n { name: \"Yuki Tanaka\", verified: true, time: \"21h\" },\n { name: \"benoit\", verified: false, time: \"23h\" },\n { name: \"Amara Okafor\", verified: true, time: \"1d\" },\n { name: \"Leo Martins\", verified: true, time: \"1d\" },\n { name: \"sol\", verified: false, time: \"2d\" },\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Map an effective frame to the active notification index + in-slot fraction. */\nexport function slotProgress(\n fc: number,\n slotFrames: number,\n count: number,\n): { idx: number; frac: number } {\n if (slotFrames <= 0 || count <= 0) return { idx: 0, frac: 0 };\n const pos = fc / slotFrames;\n const idx = Math.max(0, Math.min(Math.floor(pos), count - 1));\n const frac = Math.max(0, Math.min(pos - idx, 1));\n return { idx, frac };\n}\n\n/** Smoothstep flip ramp: rest for `hold` of the slot, then flip 0→1. */\nexport function flipEase(frac: number, hold: number): number {\n if (hold >= 1) return 0;\n const raw = (frac - hold) / (1 - hold);\n const c = Math.max(0, Math.min(raw, 1));\n return c * c * (3 - 2 * c);\n}\n\nexport function blurIn(\n frame: number,\n start: number,\n end: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [start, end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [10, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n style={{ flexShrink: 0 }}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction Avatar({\n avatarUrl,\n handle,\n size,\n theme,\n}: {\n avatarUrl: string;\n handle: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.border,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {handle.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\n/** Username + verified badge — the only part that flips. Absolutely overlaid\n * and centered inside a slot sized to the active name, so the line as a whole\n * stays centered while names swap. */\nfunction NameBlock({\n item,\n fontSize,\n height,\n theme,\n accent,\n deg,\n opacity,\n}: {\n item: FollowerNotification;\n fontSize: number;\n height: number;\n theme: Theme;\n accent: string;\n deg: number;\n opacity: number;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: fontSize * 0.2,\n whiteSpace: \"nowrap\",\n transformOrigin: \"center\",\n backfaceVisibility: \"hidden\",\n transform: `rotateX(${deg}deg)`,\n opacity,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight: 800,\n color: theme.fg,\n lineHeight: 1,\n }}\n >\n {item.name}\n </span>\n {item.verified && (\n <VerifiedBadge accent={accent} size={fontSize * 0.66} />\n )}\n </div>\n );\n}\n\n// --- Main composition ------------------------------------------------------\n\nexport function XFollowersOverview({\n notifications = SAMPLE_FOLLOWERS,\n totalFollowers = 1709,\n handle = \"remocn\",\n avatarUrl = \"/logo.svg\",\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowersOverviewProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const notifSize = isVertical ? 38 : 46;\n const countNum = isVertical ? 92 : 110;\n const countLabel = isVertical ? 40 : 46;\n const perspective = isVertical ? 1000 : 1200;\n const stageH = isVertical ? 160 : 180;\n const lineH = notifSize * 1.4;\n // Fast cadence: ~0.43s per username at speed 1; flip occupies the back half.\n const SLOT = 13;\n const HOLD = 0.45;\n\n const fc = frame * speed;\n const items = notifications.length > 0 ? notifications : SAMPLE_FOLLOWERS;\n const count = items.length;\n\n // Notifications cycle first, then the total blurs in. The reveal starts once\n // the list is exhausted, capped so it always fits before the timeline ends.\n const revealStart = Math.min(\n count * SLOT,\n Math.round(durationInFrames * 0.82),\n );\n\n const { idx, frac } = slotProgress(fc, SLOT, count);\n const flipP = flipEase(frac, HOLD);\n const hasNext = idx + 1 < count;\n\n const current = items[idx];\n const next = hasNext ? items[idx + 1] : undefined;\n const activeItem = flipP >= 0.5 && next ? next : current;\n\n const currentDeg = hasNext ? -90 * flipP : 0;\n const currentOpacity = hasNext\n ? interpolate(flipP, [0, 0.55], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const nextDeg = 90 * (1 - flipP);\n const nextOpacity = interpolate(flipP, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const notifOpacity = interpolate(\n fc,\n [revealStart - 4, revealStart + 8],\n [1, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const countIn = blurIn(fc, revealStart + 4, revealStart + 28);\n // Dynamic pop: spring overshoot on the total as it blurs in.\n const revealSpring = spring({\n fps,\n frame: fc - (revealStart + 2),\n config: { damping: 10, stiffness: 170, mass: 0.8 },\n });\n const revealScale = interpolate(revealSpring, [0, 1], [0.5, 1]);\n\n // Avatar + handle reveal in sync with the total: same window as countIn,\n // avatar sliding in from the left, handle from the right.\n const avatarSize = isVertical ? 72 : 64;\n const handleSize = isVertical ? 30 : 34;\n const avatarIn = blurIn(fc, revealStart + 4, revealStart + 28);\n const handleIn = avatarIn;\n const slideOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n const avatarX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [-36, 0],\n slideOpts,\n );\n const handleX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [36, 0],\n slideOpts,\n );\n\n // Confetti fires on the real frame the reveal begins (sync across speeds),\n // centered on the canvas.\n const confettiStart = Math.round((revealStart + 2) / speed);\n const confettiColors = [\n accentColor,\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n ];\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div style={{ position: \"relative\", width: refW, height: stageH }}>\n {/* Cycling notifications — only the username flips in 3D, the\n \"followed you · <time>\" suffix stays put. */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: notifSize * 0.28,\n opacity: notifOpacity,\n }}\n >\n <div\n style={{\n position: \"relative\",\n height: lineH,\n perspective,\n display: \"inline-flex\",\n }}\n >\n {/* Invisible spacer sizes the slot to the active name so the\n whole line stays centered; flips overlay it absolutely. */}\n <div\n aria-hidden=\"true\"\n style={{\n visibility: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n gap: notifSize * 0.2,\n whiteSpace: \"nowrap\",\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 800,\n }}\n >\n {activeItem.name}\n {activeItem.verified && (\n <span style={{ width: notifSize * 0.66 }} />\n )}\n </div>\n <NameBlock\n item={current}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={currentDeg}\n opacity={currentOpacity}\n />\n {next && (\n <NameBlock\n item={next}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={nextDeg}\n opacity={nextOpacity}\n />\n )}\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 500,\n color: t.fgMuted,\n whiteSpace: \"nowrap\",\n lineHeight: 1,\n }}\n >\n followed you · {activeItem.time}\n </span>\n </div>\n\n {/* Total reveal: avatar + handle above the count */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: isVertical ? 26 : 22,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n opacity: avatarIn.opacity,\n filter:\n avatarIn.blur > 0 ? `blur(${avatarIn.blur}px)` : \"none\",\n transform: `translateX(${avatarX}px)`,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n handle={handle}\n size={avatarSize}\n theme={t}\n />\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: handleSize,\n fontWeight: 700,\n color: t.fg,\n whiteSpace: \"nowrap\",\n opacity: handleIn.opacity,\n filter:\n handleIn.blur > 0 ? `blur(${handleIn.blur}px)` : \"none\",\n transform: `translateX(${handleX}px)`,\n }}\n >\n @{handle}\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"center\",\n gap: 18,\n opacity: countIn.opacity,\n filter: countIn.blur > 0 ? `blur(${countIn.blur}px)` : \"none\",\n transform: `translateY(${countIn.translateY}px) scale(${revealScale})`,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countNum,\n fontWeight: 800,\n color: t.fg,\n letterSpacing: \"-0.03em\",\n fontVariantNumeric: \"tabular-nums\",\n lineHeight: 1,\n }}\n >\n {totalFollowers.toLocaleString(\"en-US\")}\n </span>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countLabel,\n fontWeight: 500,\n color: t.fgMuted,\n lineHeight: 1,\n }}\n >\n Followers\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <Confetti\n startFrame={confettiStart}\n originX={0.5}\n originY={0.5}\n colors={confettiColors}\n particleCount={160}\n />\n </AbsoluteFill>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { useState } from \"react\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Confetti } from \"@/components/remocn/confetti\";\n\nexport interface FollowerNotification {\n name: string;\n verified: boolean;\n /** Relative time label, e.g. \"7h\", \"1d\". */\n time: string;\n}\n\nexport interface XFollowersOverviewProps {\n notifications?: FollowerNotification[];\n totalFollowers?: number;\n handle?: string;\n avatarUrl?: string;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n border: \"#eff3f4\",\n },\n dark: {\n bg: \"#0a0a0a\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n border: \"#2f3336\",\n },\n};\n\n/**\n * Hardcoded sample notifications so the composition renders immediately from\n * defaults. A future revision swaps this for live X API data.\n */\nexport const SAMPLE_FOLLOWERS: FollowerNotification[] = [\n { name: \"Andre Vitorio\", verified: true, time: \"7h\" },\n { name: \"Sarah Chen\", verified: true, time: \"7h\" },\n { name: \"marcus\", verified: false, time: \"8h\" },\n { name: \"Lena Powell\", verified: true, time: \"9h\" },\n { name: \"dev_jay\", verified: false, time: \"10h\" },\n { name: \"Priya Nair\", verified: true, time: \"11h\" },\n { name: \"Tomás Rivera\", verified: true, time: \"13h\" },\n { name: \"hana.eth\", verified: false, time: \"15h\" },\n { name: \"Will Carter\", verified: true, time: \"18h\" },\n { name: \"Yuki Tanaka\", verified: true, time: \"21h\" },\n { name: \"benoit\", verified: false, time: \"23h\" },\n { name: \"Amara Okafor\", verified: true, time: \"1d\" },\n { name: \"Leo Martins\", verified: true, time: \"1d\" },\n { name: \"sol\", verified: false, time: \"2d\" },\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Map an effective frame to the active notification index + in-slot fraction. */\nexport function slotProgress(\n fc: number,\n slotFrames: number,\n count: number,\n): { idx: number; frac: number } {\n if (slotFrames <= 0 || count <= 0) return { idx: 0, frac: 0 };\n const pos = fc / slotFrames;\n const idx = Math.max(0, Math.min(Math.floor(pos), count - 1));\n const frac = Math.max(0, Math.min(pos - idx, 1));\n return { idx, frac };\n}\n\n/** Smoothstep flip ramp: rest for `hold` of the slot, then flip 0→1. */\nexport function flipEase(frac: number, hold: number): number {\n if (hold >= 1) return 0;\n const raw = (frac - hold) / (1 - hold);\n const c = Math.max(0, Math.min(raw, 1));\n return c * c * (3 - 2 * c);\n}\n\nexport function blurIn(\n frame: number,\n start: number,\n end: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [start, end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [10, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n style={{ flexShrink: 0 }}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction Avatar({\n avatarUrl,\n handle,\n size,\n theme,\n}: {\n avatarUrl: string;\n handle: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.border,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {handle.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\n/** Username + verified badge — the only part that flips. Absolutely overlaid\n * and centered inside a slot sized to the active name, so the line as a whole\n * stays centered while names swap. */\nfunction NameBlock({\n item,\n fontSize,\n height,\n theme,\n accent,\n deg,\n opacity,\n}: {\n item: FollowerNotification;\n fontSize: number;\n height: number;\n theme: Theme;\n accent: string;\n deg: number;\n opacity: number;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: fontSize * 0.2,\n whiteSpace: \"nowrap\",\n transformOrigin: \"center\",\n backfaceVisibility: \"hidden\",\n transform: `rotateX(${deg}deg)`,\n opacity,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight: 800,\n color: theme.fg,\n lineHeight: 1,\n }}\n >\n {item.name}\n </span>\n {item.verified && (\n <VerifiedBadge accent={accent} size={fontSize * 0.66} />\n )}\n </div>\n );\n}\n\n// --- Main composition ------------------------------------------------------\n\nexport function XFollowersOverview({\n notifications = SAMPLE_FOLLOWERS,\n totalFollowers = 1709,\n handle = \"remocn\",\n avatarUrl = \"/logo.svg\",\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowersOverviewProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const notifSize = isVertical ? 38 : 46;\n const countNum = isVertical ? 92 : 110;\n const countLabel = isVertical ? 40 : 46;\n const perspective = isVertical ? 1000 : 1200;\n const stageH = isVertical ? 160 : 180;\n const lineH = notifSize * 1.4;\n // Fast cadence: ~0.43s per username at speed 1; flip occupies the back half.\n const SLOT = 13;\n const HOLD = 0.45;\n\n const fc = frame * speed;\n const items = notifications.length > 0 ? notifications : SAMPLE_FOLLOWERS;\n const count = items.length;\n\n // Notifications cycle first, then the total blurs in. The reveal starts once\n // the list is exhausted, capped so it always fits before the timeline ends.\n const revealStart = Math.min(\n count * SLOT,\n Math.round(durationInFrames * 0.82),\n );\n\n const { idx, frac } = slotProgress(fc, SLOT, count);\n const flipP = flipEase(frac, HOLD);\n const hasNext = idx + 1 < count;\n\n const current = items[idx];\n const next = hasNext ? items[idx + 1] : undefined;\n const activeItem = flipP >= 0.5 && next ? next : current;\n\n const currentDeg = hasNext ? -90 * flipP : 0;\n const currentOpacity = hasNext\n ? interpolate(flipP, [0, 0.55], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const nextDeg = 90 * (1 - flipP);\n const nextOpacity = interpolate(flipP, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const notifOpacity = interpolate(\n fc,\n [revealStart - 4, revealStart + 8],\n [1, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const countIn = blurIn(fc, revealStart + 4, revealStart + 28);\n // Dynamic pop: spring overshoot on the total as it blurs in.\n const revealSpring = spring({\n fps,\n frame: fc - (revealStart + 2),\n config: { damping: 10, stiffness: 170, mass: 0.8 },\n });\n const revealScale = interpolate(revealSpring, [0, 1], [0.5, 1]);\n\n // Avatar + handle reveal in sync with the total: same window as countIn,\n // avatar sliding in from the left, handle from the right.\n const avatarSize = isVertical ? 72 : 64;\n const handleSize = isVertical ? 30 : 34;\n const avatarIn = blurIn(fc, revealStart + 4, revealStart + 28);\n const handleIn = avatarIn;\n const slideOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n const avatarX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [-36, 0],\n slideOpts,\n );\n const handleX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [36, 0],\n slideOpts,\n );\n\n // Confetti fires on the real frame the reveal begins (sync across speeds),\n // centered on the canvas.\n const confettiStart = Math.round((revealStart + 2) / speed);\n const confettiColors = [\n accentColor,\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n ];\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n translate: \"-50% -50%\",\n scale: `${stageScale}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div style={{ position: \"relative\", width: refW, height: stageH }}>\n {/* Cycling notifications — only the username flips in 3D, the\n \"followed you · <time>\" suffix stays put. */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: notifSize * 0.28,\n opacity: notifOpacity,\n }}\n >\n <div\n style={{\n position: \"relative\",\n height: lineH,\n perspective,\n display: \"inline-flex\",\n }}\n >\n {/* Invisible spacer sizes the slot to the active name so the\n whole line stays centered; flips overlay it absolutely. */}\n <div\n aria-hidden=\"true\"\n style={{\n visibility: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n gap: notifSize * 0.2,\n whiteSpace: \"nowrap\",\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 800,\n }}\n >\n {activeItem.name}\n {activeItem.verified && (\n <span style={{ width: notifSize * 0.66 }} />\n )}\n </div>\n <NameBlock\n item={current}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={currentDeg}\n opacity={currentOpacity}\n />\n {next && (\n <NameBlock\n item={next}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={nextDeg}\n opacity={nextOpacity}\n />\n )}\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 500,\n color: t.fgMuted,\n whiteSpace: \"nowrap\",\n lineHeight: 1,\n }}\n >\n followed you · {activeItem.time}\n </span>\n </div>\n\n {/* Total reveal: avatar + handle above the count */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: isVertical ? 26 : 22,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n opacity: avatarIn.opacity,\n filter:\n avatarIn.blur > 0 ? `blur(${avatarIn.blur}px)` : \"none\",\n translate: `${avatarX}px`,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n handle={handle}\n size={avatarSize}\n theme={t}\n />\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: handleSize,\n fontWeight: 700,\n color: t.fg,\n whiteSpace: \"nowrap\",\n opacity: handleIn.opacity,\n filter:\n handleIn.blur > 0 ? `blur(${handleIn.blur}px)` : \"none\",\n translate: `${handleX}px`,\n }}\n >\n @{handle}\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"center\",\n gap: 18,\n opacity: countIn.opacity,\n filter: countIn.blur > 0 ? `blur(${countIn.blur}px)` : \"none\",\n translate: `0 ${countIn.translateY}px`,\n scale: `${revealScale}`,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countNum,\n fontWeight: 800,\n color: t.fg,\n letterSpacing: \"-0.03em\",\n fontVariantNumeric: \"tabular-nums\",\n lineHeight: 1,\n }}\n >\n {totalFollowers.toLocaleString(\"en-US\")}\n </span>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countLabel,\n fontWeight: 500,\n color: t.fgMuted,\n lineHeight: 1,\n }}\n >\n Followers\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <Confetti\n startFrame={confettiStart}\n originX={0.5}\n originY={0.5}\n colors={confettiColors}\n particleCount={160}\n />\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/x-followers-overview.tsx"
}
diff --git a/registry/remocn-icons/icon-activity/config.ts b/registry/remocn-icons/icon-activity/config.ts
index ebbaf572..0df42cf5 100644
--- a/registry/remocn-icons/icon-activity/config.ts
+++ b/registry/remocn-icons/icon-activity/config.ts
@@ -43,6 +43,7 @@ export const iconActivityConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-alert-triangle/config.ts b/registry/remocn-icons/icon-alert-triangle/config.ts
index 91829500..c0ba31b6 100644
--- a/registry/remocn-icons/icon-alert-triangle/config.ts
+++ b/registry/remocn-icons/icon-alert-triangle/config.ts
@@ -43,6 +43,7 @@ export const iconAlertTriangleConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-arrow-down/config.ts b/registry/remocn-icons/icon-arrow-down/config.ts
index 272daa58..f7ca7d0e 100644
--- a/registry/remocn-icons/icon-arrow-down/config.ts
+++ b/registry/remocn-icons/icon-arrow-down/config.ts
@@ -43,6 +43,7 @@ export const iconArrowDownConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-arrow-left/config.ts b/registry/remocn-icons/icon-arrow-left/config.ts
index 50b4e796..f25d811f 100644
--- a/registry/remocn-icons/icon-arrow-left/config.ts
+++ b/registry/remocn-icons/icon-arrow-left/config.ts
@@ -43,6 +43,7 @@ export const iconArrowLeftConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-arrow-right/config.ts b/registry/remocn-icons/icon-arrow-right/config.ts
index 811e2256..b1c4cf4c 100644
--- a/registry/remocn-icons/icon-arrow-right/config.ts
+++ b/registry/remocn-icons/icon-arrow-right/config.ts
@@ -43,6 +43,7 @@ export const iconArrowRightConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-arrow-up/config.ts b/registry/remocn-icons/icon-arrow-up/config.ts
index 6da757c0..36d68314 100644
--- a/registry/remocn-icons/icon-arrow-up/config.ts
+++ b/registry/remocn-icons/icon-arrow-up/config.ts
@@ -43,6 +43,7 @@ export const iconArrowUpConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-at-sign/config.ts b/registry/remocn-icons/icon-at-sign/config.ts
index adf201ce..7de8e4a8 100644
--- a/registry/remocn-icons/icon-at-sign/config.ts
+++ b/registry/remocn-icons/icon-at-sign/config.ts
@@ -43,6 +43,7 @@ export const iconAtSignConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-award/config.ts b/registry/remocn-icons/icon-award/config.ts
index 5bbb4248..35e7e380 100644
--- a/registry/remocn-icons/icon-award/config.ts
+++ b/registry/remocn-icons/icon-award/config.ts
@@ -43,6 +43,7 @@ export const iconAwardConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-bar-chart-3/config.ts b/registry/remocn-icons/icon-bar-chart-3/config.ts
index 44a4638a..0aa33dab 100644
--- a/registry/remocn-icons/icon-bar-chart-3/config.ts
+++ b/registry/remocn-icons/icon-bar-chart-3/config.ts
@@ -43,6 +43,7 @@ export const iconBarChart3Config: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-bell/config.ts b/registry/remocn-icons/icon-bell/config.ts
index a49fc424..e5469d25 100644
--- a/registry/remocn-icons/icon-bell/config.ts
+++ b/registry/remocn-icons/icon-bell/config.ts
@@ -43,6 +43,7 @@ export const iconBellConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-bookmark/config.ts b/registry/remocn-icons/icon-bookmark/config.ts
index 38346d25..0714c2bb 100644
--- a/registry/remocn-icons/icon-bookmark/config.ts
+++ b/registry/remocn-icons/icon-bookmark/config.ts
@@ -43,6 +43,7 @@ export const iconBookmarkConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-calendar/config.ts b/registry/remocn-icons/icon-calendar/config.ts
index bfdda877..8a2e0ded 100644
--- a/registry/remocn-icons/icon-calendar/config.ts
+++ b/registry/remocn-icons/icon-calendar/config.ts
@@ -43,6 +43,7 @@ export const iconCalendarConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-camera/config.ts b/registry/remocn-icons/icon-camera/config.ts
index bf7b528d..1906fa4c 100644
--- a/registry/remocn-icons/icon-camera/config.ts
+++ b/registry/remocn-icons/icon-camera/config.ts
@@ -43,6 +43,7 @@ export const iconCameraConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-check-circle/config.ts b/registry/remocn-icons/icon-check-circle/config.ts
index 8f464699..596d49f5 100644
--- a/registry/remocn-icons/icon-check-circle/config.ts
+++ b/registry/remocn-icons/icon-check-circle/config.ts
@@ -43,6 +43,7 @@ export const iconCheckCircleConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-check/config.ts b/registry/remocn-icons/icon-check/config.ts
index 3cc30544..281ee94b 100644
--- a/registry/remocn-icons/icon-check/config.ts
+++ b/registry/remocn-icons/icon-check/config.ts
@@ -43,6 +43,7 @@ export const iconCheckConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-chevron-down/config.ts b/registry/remocn-icons/icon-chevron-down/config.ts
index 396a0090..9baa0ddc 100644
--- a/registry/remocn-icons/icon-chevron-down/config.ts
+++ b/registry/remocn-icons/icon-chevron-down/config.ts
@@ -43,6 +43,7 @@ export const iconChevronDownConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-chevron-left/config.ts b/registry/remocn-icons/icon-chevron-left/config.ts
index ae42828e..358e6664 100644
--- a/registry/remocn-icons/icon-chevron-left/config.ts
+++ b/registry/remocn-icons/icon-chevron-left/config.ts
@@ -43,6 +43,7 @@ export const iconChevronLeftConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-chevron-right/config.ts b/registry/remocn-icons/icon-chevron-right/config.ts
index 992e173c..b1c7c77d 100644
--- a/registry/remocn-icons/icon-chevron-right/config.ts
+++ b/registry/remocn-icons/icon-chevron-right/config.ts
@@ -43,6 +43,7 @@ export const iconChevronRightConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-chevron-up/config.ts b/registry/remocn-icons/icon-chevron-up/config.ts
index 717d66a8..d0ac1136 100644
--- a/registry/remocn-icons/icon-chevron-up/config.ts
+++ b/registry/remocn-icons/icon-chevron-up/config.ts
@@ -43,6 +43,7 @@ export const iconChevronUpConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-clock/config.ts b/registry/remocn-icons/icon-clock/config.ts
index 9222553f..5cf649ce 100644
--- a/registry/remocn-icons/icon-clock/config.ts
+++ b/registry/remocn-icons/icon-clock/config.ts
@@ -43,6 +43,7 @@ export const iconClockConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-cloud/config.ts b/registry/remocn-icons/icon-cloud/config.ts
index cb4c0583..c20ee5c4 100644
--- a/registry/remocn-icons/icon-cloud/config.ts
+++ b/registry/remocn-icons/icon-cloud/config.ts
@@ -43,6 +43,7 @@ export const iconCloudConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-code/config.ts b/registry/remocn-icons/icon-code/config.ts
index 0adf6fda..8d11b221 100644
--- a/registry/remocn-icons/icon-code/config.ts
+++ b/registry/remocn-icons/icon-code/config.ts
@@ -43,6 +43,7 @@ export const iconCodeConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-copy/config.ts b/registry/remocn-icons/icon-copy/config.ts
index 71ed0aad..3b2ca7a8 100644
--- a/registry/remocn-icons/icon-copy/config.ts
+++ b/registry/remocn-icons/icon-copy/config.ts
@@ -43,6 +43,7 @@ export const iconCopyConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-credit-card/config.ts b/registry/remocn-icons/icon-credit-card/config.ts
index 87f6bd42..8418656c 100644
--- a/registry/remocn-icons/icon-credit-card/config.ts
+++ b/registry/remocn-icons/icon-credit-card/config.ts
@@ -43,6 +43,7 @@ export const iconCreditCardConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-crown/config.ts b/registry/remocn-icons/icon-crown/config.ts
index 593e2b3d..634778f1 100644
--- a/registry/remocn-icons/icon-crown/config.ts
+++ b/registry/remocn-icons/icon-crown/config.ts
@@ -43,6 +43,7 @@ export const iconCrownConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-database/config.ts b/registry/remocn-icons/icon-database/config.ts
index 22f122a6..55465d02 100644
--- a/registry/remocn-icons/icon-database/config.ts
+++ b/registry/remocn-icons/icon-database/config.ts
@@ -43,6 +43,7 @@ export const iconDatabaseConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-dollar-sign/config.ts b/registry/remocn-icons/icon-dollar-sign/config.ts
index 863df34f..685d857e 100644
--- a/registry/remocn-icons/icon-dollar-sign/config.ts
+++ b/registry/remocn-icons/icon-dollar-sign/config.ts
@@ -43,6 +43,7 @@ export const iconDollarSignConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-download/config.ts b/registry/remocn-icons/icon-download/config.ts
index bd054e5e..9f50909a 100644
--- a/registry/remocn-icons/icon-download/config.ts
+++ b/registry/remocn-icons/icon-download/config.ts
@@ -43,6 +43,7 @@ export const iconDownloadConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-external-link/config.ts b/registry/remocn-icons/icon-external-link/config.ts
index 2fa9edae..6881920c 100644
--- a/registry/remocn-icons/icon-external-link/config.ts
+++ b/registry/remocn-icons/icon-external-link/config.ts
@@ -43,6 +43,7 @@ export const iconExternalLinkConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-eye-off/config.ts b/registry/remocn-icons/icon-eye-off/config.ts
index a7bc9f6c..a26d1a38 100644
--- a/registry/remocn-icons/icon-eye-off/config.ts
+++ b/registry/remocn-icons/icon-eye-off/config.ts
@@ -43,6 +43,7 @@ export const iconEyeOffConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-eye/config.ts b/registry/remocn-icons/icon-eye/config.ts
index fdadc571..fd8cbb00 100644
--- a/registry/remocn-icons/icon-eye/config.ts
+++ b/registry/remocn-icons/icon-eye/config.ts
@@ -43,6 +43,7 @@ export const iconEyeConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-file-text/config.ts b/registry/remocn-icons/icon-file-text/config.ts
index 1273f8e2..734fd740 100644
--- a/registry/remocn-icons/icon-file-text/config.ts
+++ b/registry/remocn-icons/icon-file-text/config.ts
@@ -43,6 +43,7 @@ export const iconFileTextConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-filter/config.ts b/registry/remocn-icons/icon-filter/config.ts
index 7fbe94da..3594cf29 100644
--- a/registry/remocn-icons/icon-filter/config.ts
+++ b/registry/remocn-icons/icon-filter/config.ts
@@ -43,6 +43,7 @@ export const iconFilterConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-flame/config.ts b/registry/remocn-icons/icon-flame/config.ts
index c2f84516..db27f29b 100644
--- a/registry/remocn-icons/icon-flame/config.ts
+++ b/registry/remocn-icons/icon-flame/config.ts
@@ -43,6 +43,7 @@ export const iconFlameConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-folder/config.ts b/registry/remocn-icons/icon-folder/config.ts
index a56ceeef..8cc5f4ba 100644
--- a/registry/remocn-icons/icon-folder/config.ts
+++ b/registry/remocn-icons/icon-folder/config.ts
@@ -43,6 +43,7 @@ export const iconFolderConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-gem/config.ts b/registry/remocn-icons/icon-gem/config.ts
index 0705a0df..222b796b 100644
--- a/registry/remocn-icons/icon-gem/config.ts
+++ b/registry/remocn-icons/icon-gem/config.ts
@@ -43,6 +43,7 @@ export const iconGemConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-gift/config.ts b/registry/remocn-icons/icon-gift/config.ts
index 21382f05..c1c865fc 100644
--- a/registry/remocn-icons/icon-gift/config.ts
+++ b/registry/remocn-icons/icon-gift/config.ts
@@ -43,6 +43,7 @@ export const iconGiftConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-globe/config.ts b/registry/remocn-icons/icon-globe/config.ts
index a25d6960..de460694 100644
--- a/registry/remocn-icons/icon-globe/config.ts
+++ b/registry/remocn-icons/icon-globe/config.ts
@@ -43,6 +43,7 @@ export const iconGlobeConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-heart/config.ts b/registry/remocn-icons/icon-heart/config.ts
index a842585e..e7cc73c5 100644
--- a/registry/remocn-icons/icon-heart/config.ts
+++ b/registry/remocn-icons/icon-heart/config.ts
@@ -43,6 +43,7 @@ export const iconHeartConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-help-circle/config.ts b/registry/remocn-icons/icon-help-circle/config.ts
index 3f49f3de..d05c4448 100644
--- a/registry/remocn-icons/icon-help-circle/config.ts
+++ b/registry/remocn-icons/icon-help-circle/config.ts
@@ -43,6 +43,7 @@ export const iconHelpCircleConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-home/config.ts b/registry/remocn-icons/icon-home/config.ts
index ca37ea3e..6d29d46c 100644
--- a/registry/remocn-icons/icon-home/config.ts
+++ b/registry/remocn-icons/icon-home/config.ts
@@ -43,6 +43,7 @@ export const iconHomeConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-image/config.ts b/registry/remocn-icons/icon-image/config.ts
index 388a97de..86ea398a 100644
--- a/registry/remocn-icons/icon-image/config.ts
+++ b/registry/remocn-icons/icon-image/config.ts
@@ -43,6 +43,7 @@ export const iconImageConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-inbox/config.ts b/registry/remocn-icons/icon-inbox/config.ts
index e7d6568d..d3f4ac9a 100644
--- a/registry/remocn-icons/icon-inbox/config.ts
+++ b/registry/remocn-icons/icon-inbox/config.ts
@@ -43,6 +43,7 @@ export const iconInboxConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-info/config.ts b/registry/remocn-icons/icon-info/config.ts
index 35f27009..2526365f 100644
--- a/registry/remocn-icons/icon-info/config.ts
+++ b/registry/remocn-icons/icon-info/config.ts
@@ -43,6 +43,7 @@ export const iconInfoConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-key/config.ts b/registry/remocn-icons/icon-key/config.ts
index 7f01dd5d..fcfa3a7f 100644
--- a/registry/remocn-icons/icon-key/config.ts
+++ b/registry/remocn-icons/icon-key/config.ts
@@ -43,6 +43,7 @@ export const iconKeyConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-layout-grid/config.ts b/registry/remocn-icons/icon-layout-grid/config.ts
index a4146e12..c4baa29e 100644
--- a/registry/remocn-icons/icon-layout-grid/config.ts
+++ b/registry/remocn-icons/icon-layout-grid/config.ts
@@ -43,6 +43,7 @@ export const iconLayoutGridConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-link/config.ts b/registry/remocn-icons/icon-link/config.ts
index bb90a58c..dd061793 100644
--- a/registry/remocn-icons/icon-link/config.ts
+++ b/registry/remocn-icons/icon-link/config.ts
@@ -43,6 +43,7 @@ export const iconLinkConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-loader/config.ts b/registry/remocn-icons/icon-loader/config.ts
index ecbc0178..cdf635df 100644
--- a/registry/remocn-icons/icon-loader/config.ts
+++ b/registry/remocn-icons/icon-loader/config.ts
@@ -43,6 +43,7 @@ export const iconLoaderConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-lock/config.ts b/registry/remocn-icons/icon-lock/config.ts
index 9795f3ba..b6eed21b 100644
--- a/registry/remocn-icons/icon-lock/config.ts
+++ b/registry/remocn-icons/icon-lock/config.ts
@@ -43,6 +43,7 @@ export const iconLockConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-log-out/config.ts b/registry/remocn-icons/icon-log-out/config.ts
index 4c64ca58..2d20a407 100644
--- a/registry/remocn-icons/icon-log-out/config.ts
+++ b/registry/remocn-icons/icon-log-out/config.ts
@@ -43,6 +43,7 @@ export const iconLogOutConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-mail/config.ts b/registry/remocn-icons/icon-mail/config.ts
index 812273e0..27ab1259 100644
--- a/registry/remocn-icons/icon-mail/config.ts
+++ b/registry/remocn-icons/icon-mail/config.ts
@@ -43,6 +43,7 @@ export const iconMailConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-maximize/config.ts b/registry/remocn-icons/icon-maximize/config.ts
index ab9ae837..b6849028 100644
--- a/registry/remocn-icons/icon-maximize/config.ts
+++ b/registry/remocn-icons/icon-maximize/config.ts
@@ -43,6 +43,7 @@ export const iconMaximizeConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-menu/config.ts b/registry/remocn-icons/icon-menu/config.ts
index 98783a0c..069775a1 100644
--- a/registry/remocn-icons/icon-menu/config.ts
+++ b/registry/remocn-icons/icon-menu/config.ts
@@ -43,6 +43,7 @@ export const iconMenuConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-message-circle/config.ts b/registry/remocn-icons/icon-message-circle/config.ts
index 3bba5e66..3109170a 100644
--- a/registry/remocn-icons/icon-message-circle/config.ts
+++ b/registry/remocn-icons/icon-message-circle/config.ts
@@ -43,6 +43,7 @@ export const iconMessageCircleConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-mic/config.ts b/registry/remocn-icons/icon-mic/config.ts
index bddaec00..b5963a53 100644
--- a/registry/remocn-icons/icon-mic/config.ts
+++ b/registry/remocn-icons/icon-mic/config.ts
@@ -43,6 +43,7 @@ export const iconMicConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-monitor/config.ts b/registry/remocn-icons/icon-monitor/config.ts
index d515b354..afc62121 100644
--- a/registry/remocn-icons/icon-monitor/config.ts
+++ b/registry/remocn-icons/icon-monitor/config.ts
@@ -43,6 +43,7 @@ export const iconMonitorConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-moon/config.ts b/registry/remocn-icons/icon-moon/config.ts
index 067ce4bf..072e1cdf 100644
--- a/registry/remocn-icons/icon-moon/config.ts
+++ b/registry/remocn-icons/icon-moon/config.ts
@@ -43,6 +43,7 @@ export const iconMoonConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-more-horizontal/config.ts b/registry/remocn-icons/icon-more-horizontal/config.ts
index 0232ec19..5953dd2b 100644
--- a/registry/remocn-icons/icon-more-horizontal/config.ts
+++ b/registry/remocn-icons/icon-more-horizontal/config.ts
@@ -43,6 +43,7 @@ export const iconMoreHorizontalConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-package/config.ts b/registry/remocn-icons/icon-package/config.ts
index b6c2bcf3..573cae5e 100644
--- a/registry/remocn-icons/icon-package/config.ts
+++ b/registry/remocn-icons/icon-package/config.ts
@@ -43,6 +43,7 @@ export const iconPackageConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-party-popper/config.ts b/registry/remocn-icons/icon-party-popper/config.ts
index 5929cea3..816dd58f 100644
--- a/registry/remocn-icons/icon-party-popper/config.ts
+++ b/registry/remocn-icons/icon-party-popper/config.ts
@@ -43,6 +43,7 @@ export const iconPartyPopperConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-pause/config.ts b/registry/remocn-icons/icon-pause/config.ts
index 70ad0ac7..fc799f9e 100644
--- a/registry/remocn-icons/icon-pause/config.ts
+++ b/registry/remocn-icons/icon-pause/config.ts
@@ -43,6 +43,7 @@ export const iconPauseConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-pencil/config.ts b/registry/remocn-icons/icon-pencil/config.ts
index f2a5c6af..24dcccfa 100644
--- a/registry/remocn-icons/icon-pencil/config.ts
+++ b/registry/remocn-icons/icon-pencil/config.ts
@@ -43,6 +43,7 @@ export const iconPencilConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-phone/config.ts b/registry/remocn-icons/icon-phone/config.ts
index dff16977..5d7eae6a 100644
--- a/registry/remocn-icons/icon-phone/config.ts
+++ b/registry/remocn-icons/icon-phone/config.ts
@@ -43,6 +43,7 @@ export const iconPhoneConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-play/config.ts b/registry/remocn-icons/icon-play/config.ts
index 99706cff..2af22aa4 100644
--- a/registry/remocn-icons/icon-play/config.ts
+++ b/registry/remocn-icons/icon-play/config.ts
@@ -43,6 +43,7 @@ export const iconPlayConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-plus-circle/config.ts b/registry/remocn-icons/icon-plus-circle/config.ts
index 576dc735..9833cdcd 100644
--- a/registry/remocn-icons/icon-plus-circle/config.ts
+++ b/registry/remocn-icons/icon-plus-circle/config.ts
@@ -43,6 +43,7 @@ export const iconPlusCircleConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-plus/config.ts b/registry/remocn-icons/icon-plus/config.ts
index 90a52733..2d2516b0 100644
--- a/registry/remocn-icons/icon-plus/config.ts
+++ b/registry/remocn-icons/icon-plus/config.ts
@@ -43,6 +43,7 @@ export const iconPlusConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-refresh-cw/config.ts b/registry/remocn-icons/icon-refresh-cw/config.ts
index 85f45045..4a240a8c 100644
--- a/registry/remocn-icons/icon-refresh-cw/config.ts
+++ b/registry/remocn-icons/icon-refresh-cw/config.ts
@@ -43,6 +43,7 @@ export const iconRefreshCwConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-rocket/config.ts b/registry/remocn-icons/icon-rocket/config.ts
index 020f7d5b..93e36c50 100644
--- a/registry/remocn-icons/icon-rocket/config.ts
+++ b/registry/remocn-icons/icon-rocket/config.ts
@@ -43,6 +43,7 @@ export const iconRocketConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-save/config.ts b/registry/remocn-icons/icon-save/config.ts
index 40f94890..e66d8da7 100644
--- a/registry/remocn-icons/icon-save/config.ts
+++ b/registry/remocn-icons/icon-save/config.ts
@@ -43,6 +43,7 @@ export const iconSaveConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-search/config.ts b/registry/remocn-icons/icon-search/config.ts
index 770e4ee6..1ea9428d 100644
--- a/registry/remocn-icons/icon-search/config.ts
+++ b/registry/remocn-icons/icon-search/config.ts
@@ -43,6 +43,7 @@ export const iconSearchConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-send/config.ts b/registry/remocn-icons/icon-send/config.ts
index 65b35434..5b6b1679 100644
--- a/registry/remocn-icons/icon-send/config.ts
+++ b/registry/remocn-icons/icon-send/config.ts
@@ -43,6 +43,7 @@ export const iconSendConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-settings/config.ts b/registry/remocn-icons/icon-settings/config.ts
index 140e48f1..76491b2a 100644
--- a/registry/remocn-icons/icon-settings/config.ts
+++ b/registry/remocn-icons/icon-settings/config.ts
@@ -43,6 +43,7 @@ export const iconSettingsConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-share-2/config.ts b/registry/remocn-icons/icon-share-2/config.ts
index 810ef6c9..c6b17fde 100644
--- a/registry/remocn-icons/icon-share-2/config.ts
+++ b/registry/remocn-icons/icon-share-2/config.ts
@@ -43,6 +43,7 @@ export const iconShare2Config: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-shield/config.ts b/registry/remocn-icons/icon-shield/config.ts
index c60f955c..878e614b 100644
--- a/registry/remocn-icons/icon-shield/config.ts
+++ b/registry/remocn-icons/icon-shield/config.ts
@@ -43,6 +43,7 @@ export const iconShieldConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-shopping-cart/config.ts b/registry/remocn-icons/icon-shopping-cart/config.ts
index c56243a9..c1a300b8 100644
--- a/registry/remocn-icons/icon-shopping-cart/config.ts
+++ b/registry/remocn-icons/icon-shopping-cart/config.ts
@@ -43,6 +43,7 @@ export const iconShoppingCartConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-skip-forward/config.ts b/registry/remocn-icons/icon-skip-forward/config.ts
index bc4b211c..93ddf8d4 100644
--- a/registry/remocn-icons/icon-skip-forward/config.ts
+++ b/registry/remocn-icons/icon-skip-forward/config.ts
@@ -43,6 +43,7 @@ export const iconSkipForwardConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-smartphone/config.ts b/registry/remocn-icons/icon-smartphone/config.ts
index 21f37089..88629acf 100644
--- a/registry/remocn-icons/icon-smartphone/config.ts
+++ b/registry/remocn-icons/icon-smartphone/config.ts
@@ -43,6 +43,7 @@ export const iconSmartphoneConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-sparkles/config.ts b/registry/remocn-icons/icon-sparkles/config.ts
index 4e0c08b8..ec0bcedf 100644
--- a/registry/remocn-icons/icon-sparkles/config.ts
+++ b/registry/remocn-icons/icon-sparkles/config.ts
@@ -43,6 +43,7 @@ export const iconSparklesConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-star/config.ts b/registry/remocn-icons/icon-star/config.ts
index 87e7f8c5..b6128262 100644
--- a/registry/remocn-icons/icon-star/config.ts
+++ b/registry/remocn-icons/icon-star/config.ts
@@ -43,6 +43,7 @@ export const iconStarConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-sun/config.ts b/registry/remocn-icons/icon-sun/config.ts
index 666d2c1b..94b5b964 100644
--- a/registry/remocn-icons/icon-sun/config.ts
+++ b/registry/remocn-icons/icon-sun/config.ts
@@ -43,6 +43,7 @@ export const iconSunConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 85,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-tag/config.ts b/registry/remocn-icons/icon-tag/config.ts
index c501d848..404d2cb3 100644
--- a/registry/remocn-icons/icon-tag/config.ts
+++ b/registry/remocn-icons/icon-tag/config.ts
@@ -43,6 +43,7 @@ export const iconTagConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-target/config.ts b/registry/remocn-icons/icon-target/config.ts
index 200c0149..42bbbebf 100644
--- a/registry/remocn-icons/icon-target/config.ts
+++ b/registry/remocn-icons/icon-target/config.ts
@@ -43,6 +43,7 @@ export const iconTargetConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-terminal/config.ts b/registry/remocn-icons/icon-terminal/config.ts
index 6d5fa2d6..be4991cf 100644
--- a/registry/remocn-icons/icon-terminal/config.ts
+++ b/registry/remocn-icons/icon-terminal/config.ts
@@ -43,6 +43,7 @@ export const iconTerminalConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-thumbs-up/config.ts b/registry/remocn-icons/icon-thumbs-up/config.ts
index 792409c2..a0e481ff 100644
--- a/registry/remocn-icons/icon-thumbs-up/config.ts
+++ b/registry/remocn-icons/icon-thumbs-up/config.ts
@@ -43,6 +43,7 @@ export const iconThumbsUpConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-timer/config.ts b/registry/remocn-icons/icon-timer/config.ts
index 068b6b75..6ae29d6a 100644
--- a/registry/remocn-icons/icon-timer/config.ts
+++ b/registry/remocn-icons/icon-timer/config.ts
@@ -43,6 +43,7 @@ export const iconTimerConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 90,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-trash/config.ts b/registry/remocn-icons/icon-trash/config.ts
index e975aafa..06db6305 100644
--- a/registry/remocn-icons/icon-trash/config.ts
+++ b/registry/remocn-icons/icon-trash/config.ts
@@ -43,6 +43,7 @@ export const iconTrashConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-trending-down/config.ts b/registry/remocn-icons/icon-trending-down/config.ts
index 5836d291..f9978802 100644
--- a/registry/remocn-icons/icon-trending-down/config.ts
+++ b/registry/remocn-icons/icon-trending-down/config.ts
@@ -43,6 +43,7 @@ export const iconTrendingDownConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-trending-up/config.ts b/registry/remocn-icons/icon-trending-up/config.ts
index 732d741d..25232708 100644
--- a/registry/remocn-icons/icon-trending-up/config.ts
+++ b/registry/remocn-icons/icon-trending-up/config.ts
@@ -43,6 +43,7 @@ export const iconTrendingUpConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-trophy/config.ts b/registry/remocn-icons/icon-trophy/config.ts
index 201fe895..e3d96236 100644
--- a/registry/remocn-icons/icon-trophy/config.ts
+++ b/registry/remocn-icons/icon-trophy/config.ts
@@ -43,6 +43,7 @@ export const iconTrophyConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 85,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-upload/config.ts b/registry/remocn-icons/icon-upload/config.ts
index 02167f44..03b4e468 100644
--- a/registry/remocn-icons/icon-upload/config.ts
+++ b/registry/remocn-icons/icon-upload/config.ts
@@ -43,6 +43,7 @@ export const iconUploadConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-user-plus/config.ts b/registry/remocn-icons/icon-user-plus/config.ts
index 553e8135..5e0e72a2 100644
--- a/registry/remocn-icons/icon-user-plus/config.ts
+++ b/registry/remocn-icons/icon-user-plus/config.ts
@@ -43,6 +43,7 @@ export const iconUserPlusConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 75,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-user/config.ts b/registry/remocn-icons/icon-user/config.ts
index 605be769..b6581f33 100644
--- a/registry/remocn-icons/icon-user/config.ts
+++ b/registry/remocn-icons/icon-user/config.ts
@@ -43,6 +43,7 @@ export const iconUserConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-users/config.ts b/registry/remocn-icons/icon-users/config.ts
index 74659d64..c97626c4 100644
--- a/registry/remocn-icons/icon-users/config.ts
+++ b/registry/remocn-icons/icon-users/config.ts
@@ -43,6 +43,7 @@ export const iconUsersConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 80,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-video/config.ts b/registry/remocn-icons/icon-video/config.ts
index 423098e2..e754da8f 100644
--- a/registry/remocn-icons/icon-video/config.ts
+++ b/registry/remocn-icons/icon-video/config.ts
@@ -43,6 +43,7 @@ export const iconVideoConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-volume-2/config.ts b/registry/remocn-icons/icon-volume-2/config.ts
index 0c79f0ef..19164d75 100644
--- a/registry/remocn-icons/icon-volume-2/config.ts
+++ b/registry/remocn-icons/icon-volume-2/config.ts
@@ -43,6 +43,7 @@ export const iconVolume2Config: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-volume-x/config.ts b/registry/remocn-icons/icon-volume-x/config.ts
index 8320ba27..5597c758 100644
--- a/registry/remocn-icons/icon-volume-x/config.ts
+++ b/registry/remocn-icons/icon-volume-x/config.ts
@@ -43,6 +43,7 @@ export const iconVolumeXConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-wallet/config.ts b/registry/remocn-icons/icon-wallet/config.ts
index bc89b2f1..fb10d19c 100644
--- a/registry/remocn-icons/icon-wallet/config.ts
+++ b/registry/remocn-icons/icon-wallet/config.ts
@@ -43,6 +43,7 @@ export const iconWalletConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-x-circle/config.ts b/registry/remocn-icons/icon-x-circle/config.ts
index 36706ed1..edfe2e78 100644
--- a/registry/remocn-icons/icon-x-circle/config.ts
+++ b/registry/remocn-icons/icon-x-circle/config.ts
@@ -43,6 +43,7 @@ export const iconXCircleConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 70,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-x/config.ts b/registry/remocn-icons/icon-x/config.ts
index a5e18c25..d1eef182 100644
--- a/registry/remocn-icons/icon-x/config.ts
+++ b/registry/remocn-icons/icon-x/config.ts
@@ -43,6 +43,7 @@ export const iconXConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn-icons/icon-zap/config.ts b/registry/remocn-icons/icon-zap/config.ts
index f940af1f..40c0d7aa 100644
--- a/registry/remocn-icons/icon-zap/config.ts
+++ b/registry/remocn-icons/icon-zap/config.ts
@@ -43,6 +43,7 @@ export const iconZapConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 48, height: 48 },
durationInFrames: 60,
fps: FPS,
compositionWidth: 48,
diff --git a/registry/remocn/a1-product-demo/acts/ai-planning.tsx b/registry/remocn/a1-product-demo/acts/ai-planning.tsx
index 4c6179cc..f381a359 100644
--- a/registry/remocn/a1-product-demo/acts/ai-planning.tsx
+++ b/registry/remocn/a1-product-demo/acts/ai-planning.tsx
@@ -162,7 +162,7 @@ function TaskBlock({
paddingRight: 12,
overflow: "hidden",
opacity: p,
- transform: `translateX(${(1 - p) * -22}px)`,
+ translate: `${(1 - p) * -22}px`,
}}
>
<div style={{ width: 4, height: "100%", background: ACCENT_BAR }} />
@@ -277,7 +277,7 @@ export function AIPlanning({ speed = 1 }: { speed?: number }) {
alignItems: "center",
justifyContent: "space-between",
opacity: headP,
- transform: `translateY(${(1 - headP) * 8}px)`,
+ translate: `0 ${(1 - headP) * 8}px`,
}}
>
<span
@@ -308,7 +308,7 @@ export function AIPlanning({ speed = 1 }: { speed?: number }) {
marginTop: 22,
marginBottom: 26,
opacity: titleP,
- transform: `translateY(${(1 - titleP) * 10}px)`,
+ translate: `0 ${(1 - titleP) * 10}px`,
}}
>
Intelligently plan your entire day
@@ -395,7 +395,7 @@ export function AIPlanning({ speed = 1 }: { speed?: number }) {
height: ROW_H - 6,
background: FLOW_YELLOW,
opacity: markerP,
- transform: `scaleY(${markerP})`,
+ scale: `1 ${markerP}`,
transformOrigin: "top",
}}
/>
diff --git a/registry/remocn/a1-product-demo/acts/features-swap.tsx b/registry/remocn/a1-product-demo/acts/features-swap.tsx
index e30542d8..67f6795f 100644
--- a/registry/remocn/a1-product-demo/acts/features-swap.tsx
+++ b/registry/remocn/a1-product-demo/acts/features-swap.tsx
@@ -37,7 +37,7 @@ export function FeaturesSwap({ speed = 1 }: { speed?: number }) {
fontWeight: 400,
color: FLOW_INK,
opacity: lineReveal,
- transform: `translateY(${lineShift}px)`,
+ translate: `0 ${lineShift}px`,
}}
>
<span>Features designed to&nbsp;</span>
@@ -70,7 +70,7 @@ export function FeaturesSwap({ speed = 1 }: { speed?: number }) {
textAlign: "center",
color: FLOW_YELLOW,
opacity,
- transform: `translateY(${ty}px)`,
+ translate: `0 ${ty}px`,
filter: blur > 0.05 ? `blur(${blur}px)` : undefined,
willChange: "transform, filter, opacity",
}}
diff --git a/registry/remocn/a1-product-demo/acts/focus-analytics.tsx b/registry/remocn/a1-product-demo/acts/focus-analytics.tsx
index 4bb73f2e..8dcfee4f 100644
--- a/registry/remocn/a1-product-demo/acts/focus-analytics.tsx
+++ b/registry/remocn/a1-product-demo/acts/focus-analytics.tsx
@@ -61,7 +61,7 @@ export function FocusAnalytics({ speed = 1 }: { speed?: number }) {
<div
style={{
position: "relative",
- transform: `scale(${cardScale})`,
+ scale: `${cardScale}`,
opacity: cardOpacity,
}}
>
@@ -140,7 +140,7 @@ export function FocusAnalytics({ speed = 1 }: { speed?: number }) {
height: `${h * 100}%`,
borderRadius: 5,
transformOrigin: "bottom",
- transform: `scaleY(${grow})`,
+ scale: `1 ${grow}`,
background: isYellow ? FLOW_YELLOW : "#ECE9DA",
}}
/>
@@ -154,7 +154,7 @@ export function FocusAnalytics({ speed = 1 }: { speed?: number }) {
position: "absolute",
top: -22,
right: 70,
- transform: `scale(${johnPop})`,
+ scale: `${johnPop}`,
transformOrigin: "center",
}}
>
@@ -165,7 +165,7 @@ export function FocusAnalytics({ speed = 1 }: { speed?: number }) {
position: "absolute",
bottom: -22,
right: -34,
- transform: `scale(${amyPop})`,
+ scale: `${amyPop}`,
transformOrigin: "center",
}}
>
diff --git a/registry/remocn/a1-product-demo/acts/icon-cloud.tsx b/registry/remocn/a1-product-demo/acts/icon-cloud.tsx
index d6b08ec6..fc9bb69f 100644
--- a/registry/remocn/a1-product-demo/acts/icon-cloud.tsx
+++ b/registry/remocn/a1-product-demo/acts/icon-cloud.tsx
@@ -232,7 +232,8 @@ function ChipNode({
position: "absolute",
left: `calc(50% + ${x}px)`,
top: `calc(50% + ${y}px)`,
- transform: `translate(-50%, -50%) scale(${scale})`,
+ translate: "-50% -50%",
+ scale: `${scale}`,
opacity: opacityIn * opacityOut,
filter: blur > 0.05 ? `blur(${blur}px)` : undefined,
willChange: "transform, filter, opacity",
@@ -299,7 +300,7 @@ function HeadWord({
style={{
display: "inline-block",
color,
- transform: `translateY(${ty}%)`,
+ translate: `0 ${ty}%`,
filter: blur > 0.05 ? `blur(${blur}px)` : undefined,
willChange: "transform, filter",
}}
@@ -376,7 +377,7 @@ export function IconCloud({ speed = 1 }: { speed?: number }) {
style={{
position: "absolute",
opacity: lineBOpacity,
- transform: `translateY(${lineBTy}px)`,
+ translate: `0 ${lineBTy}px`,
filter: lineBBlur > 0.05 ? `blur(${lineBBlur}px)` : undefined,
fontFamily: FONT_SERIF,
fontSize: 60,
diff --git a/registry/remocn/a1-product-demo/acts/integrations.tsx b/registry/remocn/a1-product-demo/acts/integrations.tsx
index 1ed43e88..db05edf4 100644
--- a/registry/remocn/a1-product-demo/acts/integrations.tsx
+++ b/registry/remocn/a1-product-demo/acts/integrations.tsx
@@ -46,7 +46,8 @@ export function Integrations({ speed = 1 }: { speed?: number }) {
height: 2,
background: FLOW_BORDER,
transformOrigin: "center",
- transform: `translateY(-50%) scaleX(${lineGrow})`,
+ translate: "0 -50%",
+ scale: `${lineGrow} 1`,
}}
/>
{ICONS.map((kind, i) => {
@@ -62,7 +63,7 @@ export function Integrations({ speed = 1 }: { speed?: number }) {
key={kind}
style={{
position: "relative",
- transform: `scale(${pop})`,
+ scale: `${pop}`,
transformOrigin: "center",
}}
>
diff --git a/registry/remocn/a1-product-demo/acts/logo-outro.tsx b/registry/remocn/a1-product-demo/acts/logo-outro.tsx
index 7f18c1a3..0b9b364f 100644
--- a/registry/remocn/a1-product-demo/acts/logo-outro.tsx
+++ b/registry/remocn/a1-product-demo/acts/logo-outro.tsx
@@ -65,7 +65,7 @@ export function LogoOutro({ speed = 1 }: { speed?: number }) {
alignItems: "center",
gap: 30,
opacity,
- transform: `scale(${scale})`,
+ scale: `${scale}`,
transformOrigin: "center",
willChange: "transform, opacity",
}}
diff --git a/registry/remocn/a1-product-demo/acts/metrics-cards.tsx b/registry/remocn/a1-product-demo/acts/metrics-cards.tsx
index 8e6cbd28..6c49c4d5 100644
--- a/registry/remocn/a1-product-demo/acts/metrics-cards.tsx
+++ b/registry/remocn/a1-product-demo/acts/metrics-cards.tsx
@@ -55,7 +55,8 @@ function Card({
flexDirection: "column",
justifyContent: "space-between",
opacity,
- transform: `translateY(${ty}px) scale(${scale})`,
+ translate: `0 ${ty}px`,
+ scale: `${scale}`,
transformOrigin: "center bottom",
willChange: "transform, opacity",
}}
diff --git a/registry/remocn/a1-product-demo/acts/positioning.tsx b/registry/remocn/a1-product-demo/acts/positioning.tsx
index f6226f7a..a276f5da 100644
--- a/registry/remocn/a1-product-demo/acts/positioning.tsx
+++ b/registry/remocn/a1-product-demo/acts/positioning.tsx
@@ -87,7 +87,7 @@ function WordReveal({
style={{
display: "inline-block",
color,
- transform: `translateY(${ty}%)`,
+ translate: `0 ${ty}%`,
filter: blur > 0.05 ? `blur(${blur}px)` : undefined,
willChange: "transform, filter",
}}
@@ -152,7 +152,7 @@ export function Positioning({ speed = 1 }: { speed?: number }) {
alignItems: "center",
justifyContent: "center",
opacity: lockupOpacity,
- transform: `scale(${lockupScale})`,
+ scale: `${lockupScale}`,
transformOrigin: "center",
willChange: "transform, opacity",
}}
diff --git a/registry/remocn/a1-product-demo/acts/problem-hook.tsx b/registry/remocn/a1-product-demo/acts/problem-hook.tsx
index 1ce2ad6a..19c428b6 100644
--- a/registry/remocn/a1-product-demo/acts/problem-hook.tsx
+++ b/registry/remocn/a1-product-demo/acts/problem-hook.tsx
@@ -62,7 +62,7 @@ function WordReveal({
style={{
display: "inline-block",
color,
- transform: `translateY(${ty}%)`,
+ translate: `0 ${ty}%`,
filter: blur > 0.05 ? `blur(${blur}px)` : undefined,
willChange: "transform, filter",
}}
@@ -199,7 +199,7 @@ export function ProblemHook({ speed = 1 }: { speed?: number }) {
top: "50%",
marginLeft: -card.w / 2,
marginTop: -card.h / 2,
- transform: `translate(${sp * card.dx}px, ${sp * card.dy}px)`,
+ translate: `${sp * card.dx}px ${sp * card.dy}px`,
width: card.w,
height: card.h,
borderRadius: 10,
@@ -225,7 +225,7 @@ export function ProblemHook({ speed = 1 }: { speed?: number }) {
letterSpacing: "-0.01em",
position: "relative",
zIndex: 1,
- transform: `translateY(${line2ty}%)`,
+ translate: `0 ${line2ty}%`,
filter: line2blur > 0.05 ? `blur(${line2blur}px)` : undefined,
willChange: "transform, filter",
}}
@@ -249,7 +249,7 @@ export function ProblemHook({ speed = 1 }: { speed?: number }) {
alignItems: "center",
justifyContent: "center",
opacity: beat3Opacity,
- transform: `translateY(${beat3ty}px)`,
+ translate: `0 ${beat3ty}px`,
willChange: "transform, opacity",
}}
>
diff --git a/registry/remocn/a1-product-demo/acts/social-proof.tsx b/registry/remocn/a1-product-demo/acts/social-proof.tsx
index a7ade567..f790901f 100644
--- a/registry/remocn/a1-product-demo/acts/social-proof.tsx
+++ b/registry/remocn/a1-product-demo/acts/social-proof.tsx
@@ -97,7 +97,7 @@ function TestimonialCard({
flexDirection: "column",
gap: 20,
opacity,
- transform: `translateY(${ty}px)`,
+ translate: `0 ${ty}px`,
willChange: "transform, opacity",
}}
>
@@ -191,7 +191,7 @@ export function SocialProof({ speed = 1 }: { speed?: number }) {
flexDirection: "column",
alignItems: "center",
opacity: headOpacity,
- transform: `translateY(${headTy}px)`,
+ translate: `0 ${headTy}px`,
willChange: "transform, opacity",
}}
>
diff --git a/registry/remocn/a1-product-demo/acts/task-mgmt.tsx b/registry/remocn/a1-product-demo/acts/task-mgmt.tsx
index 238640ba..13af7ed4 100644
--- a/registry/remocn/a1-product-demo/acts/task-mgmt.tsx
+++ b/registry/remocn/a1-product-demo/acts/task-mgmt.tsx
@@ -137,7 +137,7 @@ function ChecklistPill({
boxShadow: row.highlighted
? "0 14px 34px rgba(242, 210, 0, 0.30)"
: "0 8px 22px rgba(30, 28, 22, 0.06)",
- transform: `translateX(${tx}px)`,
+ translate: `${tx}px`,
opacity,
willChange: "transform, opacity",
}}
@@ -184,7 +184,8 @@ function DetailCard({
borderRadius: 14,
boxShadow: CARD_SHADOW,
padding: "22px 26px 18px",
- transform: `translateY(${ty}px) scale(${scale})`,
+ translate: `0 ${ty}px`,
+ scale: `${scale}`,
opacity,
transformOrigin: "left top",
willChange: "transform, opacity",
diff --git a/registry/remocn/a1-product-demo/acts/workflow-auto.tsx b/registry/remocn/a1-product-demo/acts/workflow-auto.tsx
index ae281e77..afff49e9 100644
--- a/registry/remocn/a1-product-demo/acts/workflow-auto.tsx
+++ b/registry/remocn/a1-product-demo/acts/workflow-auto.tsx
@@ -143,7 +143,7 @@ export function WorkflowAuto({ speed = 1 }: { speed?: number }) {
alignItems: "center",
gap: 18,
opacity: headerReveal,
- transform: `translateY(${headerShift}px)`,
+ translate: `0 ${headerShift}px`,
}}
>
<div style={{ display: "flex", alignItems: "center", gap: 10 }}>
@@ -213,7 +213,8 @@ export function WorkflowAuto({ speed = 1 }: { speed?: number }) {
position: "absolute",
left: spec.x,
top: spec.y,
- transform: `translate(-50%, -50%) scale(${scale})`,
+ translate: "-50% -50%",
+ scale: `${scale}`,
transformOrigin: "center",
opacity: pop,
}}
diff --git a/registry/remocn/a1-product-demo/feature-frame.tsx b/registry/remocn/a1-product-demo/feature-frame.tsx
index 7b3ef7b8..9d87f493 100644
--- a/registry/remocn/a1-product-demo/feature-frame.tsx
+++ b/registry/remocn/a1-product-demo/feature-frame.tsx
@@ -52,7 +52,8 @@ export function FeatureFrame({
flex: "0 0 46%",
display: "flex",
opacity: cardOpacity,
- transform: `translateX(${cardShift}px) scale(${cardScale})`,
+ translate: `${cardShift}px`,
+ scale: `${cardScale}`,
}}
>
<UiSnapshotCard
@@ -162,7 +163,7 @@ function TitleBlock({
display: "inline-block",
marginRight: "0.26em",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{word}
@@ -180,7 +181,7 @@ function TitleBlock({
borderRadius: 3,
background: accent,
transformOrigin: "left center",
- transform: `scaleX(${underline})`,
+ scale: `${underline} 1`,
}}
/>
</div>
@@ -217,7 +218,7 @@ function BulletLine({
letterSpacing: "-0.01em",
color,
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{bullet}
diff --git a/registry/remocn/a1-product-demo/foundation.tsx b/registry/remocn/a1-product-demo/foundation.tsx
index 80b8205e..64f3ce8b 100644
--- a/registry/remocn/a1-product-demo/foundation.tsx
+++ b/registry/remocn/a1-product-demo/foundation.tsx
@@ -117,7 +117,8 @@ export function Camera({
return (
<AbsoluteFill
style={{
- transform: `translate(${x}px, ${y}px) scale(${scale})`,
+ translate: `${x}px ${y}px`,
+ scale: `${scale}`,
transformOrigin: "center",
filter: blur > 0.01 ? `blur(${blur}px)` : undefined,
willChange: "transform, filter",
@@ -150,7 +151,7 @@ const CameraCraneUpPresentation: FC<
return (
<AbsoluteFill
style={{
- transform: `translateY(${translateY}%)`,
+ translate: `0 ${translateY}%`,
filter: `blur(${blur}px)`,
willChange: "transform, filter",
}}
@@ -184,7 +185,7 @@ const SpatialPushPresentation: FC<
return (
<AbsoluteFill
style={{
- transform: `scale(${scale})`,
+ scale: `${scale}`,
filter: `brightness(${brightness}) blur(${blur}px)`,
willChange: "transform, filter",
}}
diff --git a/registry/remocn/a1-product-demo/index.tsx b/registry/remocn/a1-product-demo/index.tsx
index e87afe93..327b182d 100644
--- a/registry/remocn/a1-product-demo/index.tsx
+++ b/registry/remocn/a1-product-demo/index.tsx
@@ -117,7 +117,7 @@ function SnapshotLine({
borderRadius: 6,
background: strong ? `${theme.foreground}30` : `${theme.foreground}16`,
opacity: p,
- transform: `scaleX(${interpolate(p, [0, 1], [0.6, 1])})`,
+ scale: `${interpolate(p, [0, 1], [0.6, 1])} 1`,
transformOrigin: "left center",
}}
/>
diff --git a/registry/remocn/animated-bar-chart/config.ts b/registry/remocn/animated-bar-chart/config.ts
index f4bc7c06..e1fc73e7 100644
--- a/registry/remocn/animated-bar-chart/config.ts
+++ b/registry/remocn/animated-bar-chart/config.ts
@@ -28,6 +28,7 @@ export const animatedBarChartConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 1000, height: 500 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/animated-bar-chart/index.tsx b/registry/remocn/animated-bar-chart/index.tsx
index f1867c27..d7419d37 100644
--- a/registry/remocn/animated-bar-chart/index.tsx
+++ b/registry/remocn/animated-bar-chart/index.tsx
@@ -83,7 +83,7 @@ export function AnimatedBarChart({
rx={6}
fill={barColor}
style={{
- transform: `scaleY(${scaleY})`,
+ scale: `1 ${scaleY}`,
transformOrigin: `${x + barWidth / 2}px ${baseY}px`,
transformBox: "fill-box",
filter: `drop-shadow(0 4px 16px ${barColor}55)`,
diff --git a/registry/remocn/animated-line-chart/config.ts b/registry/remocn/animated-line-chart/config.ts
index 68298b3e..f7e5baa1 100644
--- a/registry/remocn/animated-line-chart/config.ts
+++ b/registry/remocn/animated-line-chart/config.ts
@@ -29,6 +29,7 @@ export const animatedLineChartConfig: ComponentConfig = {
description: "Show leading dot",
},
},
+ dimensions: { width: 1000, height: 500 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/ascii-dissolve/index.tsx b/registry/remocn/ascii-dissolve/index.tsx
index f0d68e6e..8d431646 100644
--- a/registry/remocn/ascii-dissolve/index.tsx
+++ b/registry/remocn/ascii-dissolve/index.tsx
@@ -460,10 +460,10 @@ const AsciiDissolvePresentation: React.FC<
? { opacity: interpolate(p, enterWindow, [0, 1], clampOpts) }
: {
opacity: interpolate(p, enterWindow, [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [enterWindow[0], 1], [1.04, 1], {
+ scale: `${interpolate(p, [enterWindow[0], 1], [1.04, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
- })})`,
+ })}`,
filter: enterBlur > 0.01 ? `blur(${enterBlur}px)` : undefined,
};
diff --git a/registry/remocn/blur-out-up/config.ts b/registry/remocn/blur-out-up/config.ts
index 8658b5f0..0844e0a5 100644
--- a/registry/remocn/blur-out-up/config.ts
+++ b/registry/remocn/blur-out-up/config.ts
@@ -44,6 +44,7 @@ export const blurOutUpConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 720, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/blur-out-up/index.tsx b/registry/remocn/blur-out-up/index.tsx
index 9457f5c4..3487fdc1 100644
--- a/registry/remocn/blur-out-up/index.tsx
+++ b/registry/remocn/blur-out-up/index.tsx
@@ -121,7 +121,7 @@ export function BlurOutUp({
marginRight: "0.25em",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
filter: `blur(${blur}px)`,
}}
>
diff --git a/registry/remocn/bottom-up-letters/config.ts b/registry/remocn/bottom-up-letters/config.ts
index 7e7b843f..afe56257 100644
--- a/registry/remocn/bottom-up-letters/config.ts
+++ b/registry/remocn/bottom-up-letters/config.ts
@@ -53,6 +53,7 @@ export const bottomUpLettersConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 190, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/bottom-up-letters/index.tsx b/registry/remocn/bottom-up-letters/index.tsx
index 6f74e799..c7708bb3 100644
--- a/registry/remocn/bottom-up-letters/index.tsx
+++ b/registry/remocn/bottom-up-letters/index.tsx
@@ -73,7 +73,7 @@ export function BottomUpLetters({
backfaceVisibility: "hidden",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{char}
diff --git a/registry/remocn/caret-wipe/index.tsx b/registry/remocn/caret-wipe/index.tsx
index d8c23d0c..a094ad4e 100644
--- a/registry/remocn/caret-wipe/index.tsx
+++ b/registry/remocn/caret-wipe/index.tsx
@@ -74,7 +74,7 @@ const CaretWipePresentation: React.FC<
style={{
clipPath: keep,
WebkitClipPath: keep,
- transform: `translateY(${interpolate(p, [0, 1], [0, -6], clampOpts)}px)`,
+ translate: `0 ${interpolate(p, [0, 1], [0, -6], clampOpts)}px`,
filter: `blur(${interpolate(p, [0.1, 1], [0, 4], clampOpts)}px)`,
}}
>
@@ -105,7 +105,7 @@ const CaretWipePresentation: React.FC<
style={{
clipPath: reveal,
WebkitClipPath: reveal,
- transform: `translateY(${interpolate(p, [0, 1], [3, 0], clampOpts)}px)`,
+ translate: `0 ${interpolate(p, [0, 1], [3, 0], clampOpts)}px`,
filter: `blur(${interpolate(p, [0, 0.8], [2, 0], clampOpts)}px)`,
}}
>
@@ -122,7 +122,7 @@ const CaretWipePresentation: React.FC<
top: `${(1 - caretHeight) * 50}%`,
height: `${caretHeight * 100}%`,
width: caretWidth,
- transform: "translateX(-50%)",
+ translate: "-50%",
background: caretColor,
borderRadius: caretWidth,
boxShadow: `0 0 18px ${caretColor}, 0 0 6px ${caretColor}`,
diff --git a/registry/remocn/chat-gpt/index.tsx b/registry/remocn/chat-gpt/index.tsx
index d55daaf0..e0ba1417 100644
--- a/registry/remocn/chat-gpt/index.tsx
+++ b/registry/remocn/chat-gpt/index.tsx
@@ -325,7 +325,8 @@ export function ChatGpt({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
<div
@@ -340,7 +341,7 @@ export function ChatGpt({
fontWeight: 700,
color: t.fg,
opacity: headingFade.opacity,
- transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,
+ translate: `0 ${headingFade.translateY + intro.translateY * 0.4}px`,
}}
>
{greeting}
@@ -358,7 +359,8 @@ export function ChatGpt({
borderRadius: 32,
boxShadow: "0 8px 30px -14px rgba(13,13,13,0.14)",
opacity: pillFade.opacity,
- transform: `translateY(${pillFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,
+ translate: `0 ${pillFade.translateY + intro.translateY * 0.6}px`,
+ scale: `${intro.scale}`,
transformOrigin: "center top",
display: "flex",
alignItems: "center",
@@ -455,7 +457,7 @@ export function ChatGpt({
borderRadius: "100%",
background: accentColor,
opacity: 1 - morph,
- transform: `scale(${1 - 0.1 * morph})`,
+ scale: `${1 - 0.1 * morph}`,
}}
>
<WaveformIcon size={22} color="#FFFFFF" />
@@ -470,7 +472,7 @@ export function ChatGpt({
borderRadius: "100%",
background: t.sendBg,
opacity: morph,
- transform: `scale(${0.8 + 0.2 * morph})`,
+ scale: `${0.8 + 0.2 * morph}`,
}}
>
<ArrowUpIcon size={22} color={t.sendArrow} />
@@ -489,7 +491,7 @@ export function ChatGpt({
justifyContent: "center",
gap: 12,
opacity: chipsOpacity,
- transform: `translateY(${chipsShift}px)`,
+ translate: `0 ${chipsShift}px`,
}}
>
<SuggestionChip
diff --git a/registry/remocn/chat-to-preview-layout/index.tsx b/registry/remocn/chat-to-preview-layout/index.tsx
index eb14d19b..90ad591c 100644
--- a/registry/remocn/chat-to-preview-layout/index.tsx
+++ b/registry/remocn/chat-to-preview-layout/index.tsx
@@ -252,7 +252,7 @@ export function ChatToPreviewLayout({
borderRadius: 16,
border: "1px solid rgba(255,255,255,0.08)",
opacity: previewOpacity,
- transform: `translateX(${previewTx}px)`,
+ translate: `${previewTx}px`,
}}
>
<div
diff --git a/registry/remocn/claude-chat/index.tsx b/registry/remocn/claude-chat/index.tsx
index 67c25773..5519273d 100644
--- a/registry/remocn/claude-chat/index.tsx
+++ b/registry/remocn/claude-chat/index.tsx
@@ -261,7 +261,8 @@ export function ClaudeChat({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
<div
@@ -275,7 +276,8 @@ export function ClaudeChat({
borderRadius: 24,
boxShadow: "0 8px 30px -12px rgba(31,30,29,0.12)",
opacity: cardFade.opacity,
- transform: `translateY(${cardFade.translateY + intro.translateY}px) scale(${intro.scale})`,
+ translate: `0 ${cardFade.translateY + intro.translateY}px`,
+ scale: `${intro.scale}`,
transformOrigin: "center top",
}}
>
@@ -302,7 +304,7 @@ export function ClaudeChat({
marginLeft={1}
style={{
verticalAlign: "text-bottom",
- transform: "translateY(3px)",
+ translate: "0 3px",
}}
/>
</span>
@@ -323,7 +325,7 @@ export function ClaudeChat({
marginLeft={1}
style={{
verticalAlign: "text-bottom",
- transform: "translateY(3px)",
+ translate: "0 3px",
}}
/>
<span style={{ marginLeft: 2 }}>{placeholder}</span>
@@ -402,7 +404,7 @@ export function ClaudeChat({
borderRadius: "100%",
border: `1px solid ${t.iconBtnBorder}`,
opacity: 1 - morph,
- transform: `scale(${1 - 0.1 * morph})`,
+ scale: `${1 - 0.1 * morph}`,
}}
>
<WaveformIcon size={22} color={t.fg} />
@@ -417,7 +419,7 @@ export function ClaudeChat({
borderRadius: 10,
background: accentColor,
opacity: morph,
- transform: `scale(${0.8 + 0.2 * morph})`,
+ scale: `${0.8 + 0.2 * morph}`,
}}
>
<SendIcon size={22} />
diff --git a/registry/remocn/claude-code/index.tsx b/registry/remocn/claude-code/index.tsx
index 84999855..b3bb2277 100644
--- a/registry/remocn/claude-code/index.tsx
+++ b/registry/remocn/claude-code/index.tsx
@@ -159,7 +159,8 @@ export function ClaudeCode({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
<div
@@ -174,7 +175,8 @@ export function ClaudeCode({
overflow: "hidden",
boxShadow: "0 24px 60px -20px rgba(0,0,0,0.6)",
opacity: intro.scale,
- transform: `translateY(${intro.translateY}px) scale(${intro.scale})`,
+ translate: `0 ${intro.translateY}px`,
+ scale: `${intro.scale}`,
transformOrigin: "center top",
display: "flex",
flexDirection: "column",
@@ -235,7 +237,7 @@ export function ClaudeCode({
borderRadius: 6,
padding: "28px 24px 24px",
opacity: leftFade.opacity,
- transform: `translateY(${leftFade.translateY}px)`,
+ translate: `0 ${leftFade.translateY}px`,
}}
>
<span
@@ -315,7 +317,7 @@ export function ClaudeCode({
display: "flex",
flexDirection: "column",
opacity: rightFade.opacity,
- transform: `translateY(${rightFade.translateY}px)`,
+ translate: `0 ${rightFade.translateY}px`,
}}
>
<div>
@@ -369,7 +371,7 @@ export function ClaudeCode({
<div
style={{
opacity: promptFade.opacity,
- transform: `translateY(${promptFade.translateY}px)`,
+ translate: `0 ${promptFade.translateY}px`,
}}
>
<div
diff --git a/registry/remocn/confetti/index.tsx b/registry/remocn/confetti/index.tsx
index 5df508f8..3ba6ba24 100644
--- a/registry/remocn/confetti/index.tsx
+++ b/registry/remocn/confetti/index.tsx
@@ -154,7 +154,9 @@ export function Confetti({
borderRadius: 2,
background: p.color,
opacity,
- transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,
+ translate: "-50% -50%",
+ rotate: `${rot}rad`,
+ scale: `${flutter} 1`,
}}
/>
);
diff --git a/registry/remocn/crumple-toss/index.tsx b/registry/remocn/crumple-toss/index.tsx
index 20ef02ac..503920f2 100644
--- a/registry/remocn/crumple-toss/index.tsx
+++ b/registry/remocn/crumple-toss/index.tsx
@@ -332,7 +332,9 @@ export function CrumpleToss({
height,
transformOrigin: "center",
opacity: pose.opacity,
- transform: `translate(${pose.x}px, ${pose.y}px) rotate(${pose.rotate}deg) scale(${pose.scale})`,
+ translate: `${pose.x}px ${pose.y}px`,
+ rotate: `${pose.rotate}deg`,
+ scale: `${pose.scale}`,
}}
>
{pieces.map((piece, i) => (
@@ -343,7 +345,9 @@ export function CrumpleToss({
inset: 0,
clipPath: `polygon(${piece.clip.map(([x, y]) => `${x}% ${y}%`).join(", ")})`,
transformOrigin: `${piece.origin[0]}% ${piece.origin[1]}%`,
- transform: `translate(${piece.dx * c}px, ${piece.dy * c}px) rotate(${piece.rotate * c}deg) scale(${1 + (piece.scale - 1) * c})`,
+ translate: `${piece.dx * c}px ${piece.dy * c}px`,
+ rotate: `${piece.rotate * c}deg`,
+ scale: `${1 + (piece.scale - 1) * c}`,
filter:
c > 0
? `drop-shadow(0 0 ${0.6 * c}px rgba(38,36,44,0.55))`
diff --git a/registry/remocn/displacement/index.tsx b/registry/remocn/displacement/index.tsx
index fcef7e50..e9f8dd21 100644
--- a/registry/remocn/displacement/index.tsx
+++ b/registry/remocn/displacement/index.tsx
@@ -135,7 +135,7 @@ const DisplacementFallback: React.FC<
<AbsoluteFill
style={{
opacity: settle,
- transform: `translateX(${entering ? jolt : -jolt}px)`,
+ translate: `${entering ? jolt : -jolt}px`,
}}
>
{children}
diff --git a/registry/remocn/drift/index.tsx b/registry/remocn/drift/index.tsx
index 58aa7828..dd11eaf5 100644
--- a/registry/remocn/drift/index.tsx
+++ b/registry/remocn/drift/index.tsx
@@ -18,7 +18,7 @@ export function Drift({ children, grow = 0.035 }: DriftProps) {
const { durationInFrames } = useVideoConfig();
const scale = interpolate(frame, [0, durationInFrames], [1, 1 + grow]);
return (
- <AbsoluteFill style={{ transform: `scale(${scale})` }}>
+ <AbsoluteFill style={{ scale: `${scale}` }}>
{children}
</AbsoluteFill>
);
diff --git a/registry/remocn/ecosystem-constellation/index.tsx b/registry/remocn/ecosystem-constellation/index.tsx
index e7090997..8f9ea275 100644
--- a/registry/remocn/ecosystem-constellation/index.tsx
+++ b/registry/remocn/ecosystem-constellation/index.tsx
@@ -282,7 +282,7 @@ export function EcosystemConstellation({
fontWeight: 800,
fontSize: 52,
letterSpacing: "-0.05em",
- transform: `scale(${centerScale})`,
+ scale: `${centerScale}`,
boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,
border: "1px solid rgba(255,255,255,0.15)",
}}
@@ -309,7 +309,7 @@ export function EcosystemConstellation({
display: "flex",
alignItems: "center",
justifyContent: "center",
- transform: `scale(${s.satScale})`,
+ scale: `${s.satScale}`,
boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,
border: "1px solid rgba(255,255,255,0.12)",
opacity: s.visible ? 1 : 0,
diff --git a/registry/remocn/fade-through/config.ts b/registry/remocn/fade-through/config.ts
index b1cf3634..41aedd32 100644
--- a/registry/remocn/fade-through/config.ts
+++ b/registry/remocn/fade-through/config.ts
@@ -40,6 +40,7 @@ export const fadeThroughConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 640, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/fade-through/index.tsx b/registry/remocn/fade-through/index.tsx
index acdf5946..27f3dd6f 100644
--- a/registry/remocn/fade-through/index.tsx
+++ b/registry/remocn/fade-through/index.tsx
@@ -98,7 +98,7 @@ export function FadeThrough({
display: "inline-block",
transformOrigin: "50% 50%",
opacity: fromOpacity,
- transform: `translateY(${fromY}px)`,
+ translate: `0 ${fromY}px`,
}}
>
{fromText}
@@ -124,7 +124,8 @@ export function FadeThrough({
display: "inline-block",
transformOrigin: "50% 50%",
opacity: toOpacity,
- transform: `translateY(${toY}px) scale(${toScale})`,
+ translate: `0 ${toY}px`,
+ scale: `${toScale}`,
filter: `blur(${blurVal}px)`,
}}
>
diff --git a/registry/remocn/focus-blur-resolve/config.ts b/registry/remocn/focus-blur-resolve/config.ts
index 8499f1ec..7a89eed8 100644
--- a/registry/remocn/focus-blur-resolve/config.ts
+++ b/registry/remocn/focus-blur-resolve/config.ts
@@ -44,6 +44,7 @@ export const focusBlurResolveConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 870, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/focus-blur-resolve/index.tsx b/registry/remocn/focus-blur-resolve/index.tsx
index 89bc5c4b..ffee523b 100644
--- a/registry/remocn/focus-blur-resolve/index.tsx
+++ b/registry/remocn/focus-blur-resolve/index.tsx
@@ -102,7 +102,8 @@ export function FocusBlurResolve({
display: "inline-block",
transformOrigin: "50% 50%",
opacity,
- transform: `translateY(${y}px) scale(${scale})`,
+ translate: `0 ${y}px`,
+ scale: `${scale}`,
filter: `blur(${blurVal}px)`,
}}
>
diff --git a/registry/remocn/focus-pull/index.tsx b/registry/remocn/focus-pull/index.tsx
index cb220e9e..ec8d413d 100644
--- a/registry/remocn/focus-pull/index.tsx
+++ b/registry/remocn/focus-pull/index.tsx
@@ -34,10 +34,10 @@ const FocusPullPresentation: React.FC<
...clampOpts,
easing: Easing.bezier(0.42, 0, 0.58, 1),
}),
- transform: `scale(${interpolate(p, [0, 0.6], [1, 1.05], {
+ scale: `${interpolate(p, [0, 0.6], [1, 1.05], {
...clampOpts,
easing: Easing.bezier(0.42, 0, 0.58, 1),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.05, 0.55], [0, blur], {
...clampOpts,
easing: Easing.in(Easing.quad),
@@ -48,10 +48,10 @@ const FocusPullPresentation: React.FC<
const childStyle: React.CSSProperties = {
opacity: interpolate(p, [0.32, 0.52], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.35, 1], [0.97, 1], {
+ scale: `${interpolate(p, [0.35, 1], [0.97, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.35, 0.9], [blur, 0], {
...clampOpts,
easing: Easing.out(Easing.quad),
diff --git a/registry/remocn/github-sponsors/index.tsx b/registry/remocn/github-sponsors/index.tsx
index cf6c4d86..177419e9 100644
--- a/registry/remocn/github-sponsors/index.tsx
+++ b/registry/remocn/github-sponsors/index.tsx
@@ -327,7 +327,7 @@ const SponsorNode = memo(function SponsorNode({
position: "absolute",
left: cell.x,
top: cell.y,
- transform: `translate(-50%, -50%) translateY(${y}px)`,
+ translate: `-50% calc(-50% + ${y}px)`,
opacity: progress,
filter: `blur(${blur}px)`,
willChange: "transform, opacity, filter",
@@ -433,7 +433,8 @@ export function GitHubSponsors({
top: "50%",
width: REF_W,
height: REF_H,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
{sponsors.map((sponsor, i) => (
@@ -457,7 +458,8 @@ export function GitHubSponsors({
position: "absolute",
left: GRID_CX,
top: HEART_START_Y,
- transform: `translate(-50%, -50%) translate(0px, ${heartDy}px) scale(${heartScale})`,
+ translate: `-50% calc(-50% + ${heartDy}px)`,
+ scale: `${heartScale}`,
width: heartBase,
height: heartBase,
display: "flex",
@@ -528,7 +530,7 @@ export function GitHubSponsors({
>
<div
style={{
- transform: `translateY(${ctaY}px)`,
+ translate: `0 ${ctaY}px`,
opacity: ctaProgress,
filter: `blur(${ctaBlur}px)`,
display: "flex",
diff --git a/registry/remocn/github-stars/index.tsx b/registry/remocn/github-stars/index.tsx
index 49b9d16f..32a8f506 100644
--- a/registry/remocn/github-stars/index.tsx
+++ b/registry/remocn/github-stars/index.tsx
@@ -1033,7 +1033,7 @@ export function GitHubStars({
>
<div
style={{
- transform: `translateY(${scrollY}px)`,
+ translate: `0 ${scrollY}px`,
willChange: "transform",
}}
>
@@ -1186,7 +1186,8 @@ export function GitHubStars({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
{counterZone}
diff --git a/registry/remocn/glass-code-block/index.tsx b/registry/remocn/glass-code-block/index.tsx
index a58daf14..64ed3f0a 100644
--- a/registry/remocn/glass-code-block/index.tsx
+++ b/registry/remocn/glass-code-block/index.tsx
@@ -252,7 +252,7 @@ function CodeLine({
<div
style={{
opacity,
- transform: `translateY(${ty}px)`,
+ translate: `0 ${ty}px`,
whiteSpace: "pre",
display: "flex",
gap: 0,
diff --git a/registry/remocn/glass-code-walk/index.tsx b/registry/remocn/glass-code-walk/index.tsx
index 35c25904..e0816e89 100644
--- a/registry/remocn/glass-code-walk/index.tsx
+++ b/registry/remocn/glass-code-walk/index.tsx
@@ -110,7 +110,8 @@ export function GlassCodeWalk({
top: 0,
width: STAGE_WIDTH,
height: STAGE_HEIGHT,
- transform: `translate(${tx}px, ${ty}px) scale(${scale})`,
+ translate: `${tx}px ${ty}px`,
+ scale: `${scale}`,
transformOrigin: "0 0",
}}
>
diff --git a/registry/remocn/glitch-cut/index.tsx b/registry/remocn/glitch-cut/index.tsx
index df2bec0b..513928fa 100644
--- a/registry/remocn/glitch-cut/index.tsx
+++ b/registry/remocn/glitch-cut/index.tsx
@@ -162,7 +162,7 @@ const GlitchCutFallback: React.FC<
key={band}
style={{
clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,
- transform: `translateX(${shift}px)`,
+ translate: `${shift}px`,
}}
>
{children}
diff --git a/registry/remocn/grain-dissolve/index.tsx b/registry/remocn/grain-dissolve/index.tsx
index 90c8d423..8b059fba 100644
--- a/registry/remocn/grain-dissolve/index.tsx
+++ b/registry/remocn/grain-dissolve/index.tsx
@@ -70,7 +70,7 @@ const GrainDissolvePresentation: React.FC<
const childStyle: React.CSSProperties = {
opacity: interpolate(p, [0.7, 0.86], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.7, 1], [1.05, 1], {
+ scale: `${interpolate(p, [0.7, 1], [1.05, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
})})`,
diff --git a/registry/remocn/grid-wave/index.tsx b/registry/remocn/grid-wave/index.tsx
index 8789f4bd..f120a064 100644
--- a/registry/remocn/grid-wave/index.tsx
+++ b/registry/remocn/grid-wave/index.tsx
@@ -192,7 +192,7 @@ const GridWaveFallback: React.FC<
<AbsoluteFill
style={{
opacity: reveal,
- transform: `scale(${1.04 - reveal * 0.04})`,
+ scale: `${1.04 - reveal * 0.04}`,
}}
>
{children}
diff --git a/registry/remocn/hand-count/index.tsx b/registry/remocn/hand-count/index.tsx
index 35156f17..9e8baeb5 100644
--- a/registry/remocn/hand-count/index.tsx
+++ b/registry/remocn/hand-count/index.tsx
@@ -179,7 +179,8 @@ export function HandCount({
style={{
display: "inline-block",
whiteSpace: "pre",
- transform: `translateY(${dy}px) rotate(${rot}deg)`,
+ translate: `0 ${dy}px`,
+ rotate: `${rot}deg`,
}}
>
{char}
diff --git a/registry/remocn/handwrite/index.tsx b/registry/remocn/handwrite/index.tsx
index f2fb68fc..479a0176 100644
--- a/registry/remocn/handwrite/index.tsx
+++ b/registry/remocn/handwrite/index.tsx
@@ -73,9 +73,9 @@ export function Handwrite({
display: "inline-block",
whiteSpace: "pre",
opacity: visible ? 1 : 0,
- transform: visible
- ? `translateY(${dy}px) rotate(${slant}deg) scale(${fresh ? 1.06 : 1})`
- : undefined,
+ translate: visible ? `0 ${dy}px` : undefined,
+ rotate: visible ? `${slant}deg` : undefined,
+ scale: visible ? `${fresh ? 1.06 : 1}` : undefined,
}}
>
{char}
diff --git a/registry/remocn/icon-scatter/index.tsx b/registry/remocn/icon-scatter/index.tsx
index f9d20a5a..f2c87c70 100644
--- a/registry/remocn/icon-scatter/index.tsx
+++ b/registry/remocn/icon-scatter/index.tsx
@@ -210,7 +210,7 @@ const IconScatterPresentation: React.FC<
// The outgoing scene sinks back and blurs as the field rises over it.
const exitStyle: React.CSSProperties = {
opacity: interpolate(p, [0.28, 0.5], [1, 0], clampOpts),
- transform: `scale(${interpolate(p, [0, 0.5], [1, 0.94], {
+ scale: `${interpolate(p, [0, 0.5], [1, 0.94], {
...clampOpts,
easing: Easing.in(Easing.cubic),
})})`,
@@ -224,7 +224,7 @@ const IconScatterPresentation: React.FC<
// The incoming scene resolves once the field starts clearing.
const childStyle: React.CSSProperties = {
opacity: interpolate(p, [0.5, 0.68], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.5, 1], [1.06, 1], {
+ scale: `${interpolate(p, [0.5, 1], [1.06, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
})})`,
diff --git a/registry/remocn/infinite-bento-pan/index.tsx b/registry/remocn/infinite-bento-pan/index.tsx
index c9922238..566d7d7f 100644
--- a/registry/remocn/infinite-bento-pan/index.tsx
+++ b/registry/remocn/infinite-bento-pan/index.tsx
@@ -460,7 +460,7 @@ export function InfiniteBentoPan({
top: 0,
width: SUPER_W,
height: SUPER_H,
- transform: `translate(${-px}px, ${-py}px)`,
+ translate: `${-px}px ${-py}px`,
willChange: "transform",
}}
>
diff --git a/registry/remocn/infinite-marquee/index.tsx b/registry/remocn/infinite-marquee/index.tsx
index d46b0b93..b596b514 100644
--- a/registry/remocn/infinite-marquee/index.tsx
+++ b/registry/remocn/infinite-marquee/index.tsx
@@ -56,7 +56,7 @@ export function InfiniteMarquee({
style={{
display: "flex",
whiteSpace: "nowrap",
- transform: `translateX(${offset}px)`,
+ translate: `${offset}px`,
}}
>
<span style={spanStyle}>{text}</span>
diff --git a/registry/remocn/inline-highlight/config.ts b/registry/remocn/inline-highlight/config.ts
index 6384542c..e39a0742 100644
--- a/registry/remocn/inline-highlight/config.ts
+++ b/registry/remocn/inline-highlight/config.ts
@@ -50,6 +50,7 @@ export const inlineHighlightConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 640, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/kinetic-center-build/config.ts b/registry/remocn/kinetic-center-build/config.ts
index 8f445ecd..123b9d4f 100644
--- a/registry/remocn/kinetic-center-build/config.ts
+++ b/registry/remocn/kinetic-center-build/config.ts
@@ -44,6 +44,7 @@ export const kineticCenterBuildConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 600, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/lens-zoom/index.tsx b/registry/remocn/lens-zoom/index.tsx
index 9e6f63ba..46362024 100644
--- a/registry/remocn/lens-zoom/index.tsx
+++ b/registry/remocn/lens-zoom/index.tsx
@@ -223,7 +223,8 @@ function TransitionHalf({
position: "absolute",
inset: 0,
clipPath: `path("${clip}")`,
- transform: `rotate(${rotation}deg) scale(${k})`,
+ rotate: `${rotation}deg`,
+ scale: `${k}`,
transformOrigin: origin,
}}
>
@@ -296,7 +297,7 @@ function LensZoomStage({
inset: 0,
mixBlendMode: "screen",
filter: `url(#${filterId}-${c.id})`,
- transform: `scale(${c.scale})`,
+ scale: `${c.scale}`,
transformOrigin: `${centerX}px ${centerY}px`,
}}
>
@@ -351,7 +352,8 @@ function LensZoomStage({
style={{
position: "absolute",
inset: 0,
- transform: `translate(${shakeX}px, ${shakeY}px) rotate(${shakeR}deg)`,
+ translate: `${shakeX}px ${shakeY}px`,
+ rotate: `${shakeR}deg`,
transformOrigin: `${centerX}px ${centerY}px`,
}}
>
diff --git a/registry/remocn/line-by-line-slide/config.ts b/registry/remocn/line-by-line-slide/config.ts
index 9ba56773..8e7da638 100644
--- a/registry/remocn/line-by-line-slide/config.ts
+++ b/registry/remocn/line-by-line-slide/config.ts
@@ -44,6 +44,7 @@ export const lineByLineSlideConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 600, height: 200 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/line-by-line-slide/index.tsx b/registry/remocn/line-by-line-slide/index.tsx
index 10c294d8..80805d0e 100644
--- a/registry/remocn/line-by-line-slide/index.tsx
+++ b/registry/remocn/line-by-line-slide/index.tsx
@@ -115,7 +115,7 @@ export function LineByLineSlide({
display: "block",
transformOrigin: "0% 50%",
opacity,
- transform: `translateX(${x}px)`,
+ translate: `${x}px`,
}}
>
{line}
diff --git a/registry/remocn/logo-enter/index.tsx b/registry/remocn/logo-enter/index.tsx
index f9bf9fbd..75061a94 100644
--- a/registry/remocn/logo-enter/index.tsx
+++ b/registry/remocn/logo-enter/index.tsx
@@ -132,9 +132,8 @@ export function LogoEnter({
alignItems: "center",
justifyContent: "center",
opacity: s,
- transform: isVertical
- ? `translateX(${offset}px) scale(${scale})`
- : `translateY(${offset}px) scale(${scale})`,
+ translate: isVertical ? `${offset}px` : `0 ${offset}px`,
+ scale: `${scale}`,
}}
>
<div
diff --git a/registry/remocn/marker-highlight/config.ts b/registry/remocn/marker-highlight/config.ts
index 48e2a4a5..5b5aeeb5 100644
--- a/registry/remocn/marker-highlight/config.ts
+++ b/registry/remocn/marker-highlight/config.ts
@@ -55,6 +55,7 @@ export const markerHighlightConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 340, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/marker-highlight/index.tsx b/registry/remocn/marker-highlight/index.tsx
index 2fc688c7..ebd60d02 100644
--- a/registry/remocn/marker-highlight/index.tsx
+++ b/registry/remocn/marker-highlight/index.tsx
@@ -82,7 +82,7 @@ export function MarkerHighlight({
inset: "0 -0.1em",
background: markerColor,
transformOrigin: "left center",
- transform: `scaleX(${markerScale})`,
+ scale: `${markerScale} 1`,
zIndex: 0,
}}
/>
diff --git a/registry/remocn/mask-reveal-up/config.ts b/registry/remocn/mask-reveal-up/config.ts
index c8650f7a..e8206caa 100644
--- a/registry/remocn/mask-reveal-up/config.ts
+++ b/registry/remocn/mask-reveal-up/config.ts
@@ -44,6 +44,7 @@ export const maskRevealUpConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 640, height: 200 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/mask-reveal-up/index.tsx b/registry/remocn/mask-reveal-up/index.tsx
index 7938e7ef..4fb218e7 100644
--- a/registry/remocn/mask-reveal-up/index.tsx
+++ b/registry/remocn/mask-reveal-up/index.tsx
@@ -129,7 +129,7 @@ export function MaskRevealUp({
display: "block",
transformOrigin: "50% 50%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
filter: `blur(${blur}px)`,
}}
>
diff --git a/registry/remocn/matrix-decode/config.ts b/registry/remocn/matrix-decode/config.ts
index f73e0f26..b279a3c0 100644
--- a/registry/remocn/matrix-decode/config.ts
+++ b/registry/remocn/matrix-decode/config.ts
@@ -49,6 +49,7 @@ export const matrixDecodeConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 340, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/micro-scale-fade/config.ts b/registry/remocn/micro-scale-fade/config.ts
index 50b5e62f..e003d8db 100644
--- a/registry/remocn/micro-scale-fade/config.ts
+++ b/registry/remocn/micro-scale-fade/config.ts
@@ -44,6 +44,7 @@ export const microScaleFadeConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 680, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/micro-scale-fade/index.tsx b/registry/remocn/micro-scale-fade/index.tsx
index 89a888d2..48cfcb23 100644
--- a/registry/remocn/micro-scale-fade/index.tsx
+++ b/registry/remocn/micro-scale-fade/index.tsx
@@ -59,7 +59,7 @@ export function MicroScaleFade({
display: "inline-block",
transformOrigin: "50% 50%",
opacity,
- transform: `scale(${scale})`,
+ scale: `${scale}`,
}}
>
{text}
diff --git a/registry/remocn/number-wheel/index.tsx b/registry/remocn/number-wheel/index.tsx
index 071dc991..e02b9b78 100644
--- a/registry/remocn/number-wheel/index.tsx
+++ b/registry/remocn/number-wheel/index.tsx
@@ -88,7 +88,7 @@ function DigitColumn({
style={{
display: "flex",
flexDirection: "column",
- transform: `translateY(${-value * cellHeight}px)`,
+ translate: `0 ${-value * cellHeight}px`,
}}
>
{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (
diff --git a/registry/remocn/opencode/index.tsx b/registry/remocn/opencode/index.tsx
index ee2edad5..06411f6b 100644
--- a/registry/remocn/opencode/index.tsx
+++ b/registry/remocn/opencode/index.tsx
@@ -125,7 +125,8 @@ export function OpenCode({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
display: "flex",
flexDirection: "column",
alignItems: "center",
@@ -136,7 +137,7 @@ export function OpenCode({
style={{
lineHeight: 0,
opacity: logoFade.opacity,
- transform: `translateY(${logoFade.translateY + intro.translateY * 0.4}px)`,
+ translate: `0 ${logoFade.translateY + intro.translateY * 0.4}px`,
}}
>
<svg
@@ -203,7 +204,8 @@ export function OpenCode({
justifyContent: "center",
gap: 26,
opacity: boxFade.opacity,
- transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,
+ translate: `0 ${boxFade.translateY + intro.translateY * 0.6}px`,
+ scale: `${intro.scale}`,
transformOrigin: "center top",
}}
>
@@ -259,7 +261,7 @@ export function OpenCode({
fontFamily: MONO_FAMILY,
fontSize: 18,
opacity: hintsFade.opacity,
- transform: `translateY(${hintsFade.translateY}px)`,
+ translate: `0 ${hintsFade.translateY}px`,
}}
>
<span style={{ display: "inline-flex", gap: 8 }}>
diff --git a/registry/remocn/page-turn/index.tsx b/registry/remocn/page-turn/index.tsx
index bf9bd0b4..4f303c7d 100644
--- a/registry/remocn/page-turn/index.tsx
+++ b/registry/remocn/page-turn/index.tsx
@@ -45,7 +45,8 @@ const PageTurnPresentation: React.FC<
style={{
zIndex: 2,
transformOrigin: origin,
- transform: `translateY(${-pose * height * LIFT_RATIO}px) rotate(${angle * pose}deg)`,
+ translate: `0 ${-pose * height * LIFT_RATIO}px`,
+ rotate: `${angle * pose}deg`,
}}
>
{children}
diff --git a/registry/remocn/paper-sticker/index.tsx b/registry/remocn/paper-sticker/index.tsx
index dcc8b62c..ab6ade7f 100644
--- a/registry/remocn/paper-sticker/index.tsx
+++ b/registry/remocn/paper-sticker/index.tsx
@@ -50,7 +50,9 @@ export function PaperSticker({
border: `1px solid ${borderColor}`,
borderRadius: 3,
boxShadow: "0 2px 5px rgba(38,36,44,0.14)",
- transform: `translate(${jitter.x}px, ${jitter.y}px) rotate(${tilt + jitter.rot}deg) scale(${progress < 1 ? 1.12 : 1})`,
+ translate: `${jitter.x}px ${jitter.y}px`,
+ rotate: `${tilt + jitter.rot}deg`,
+ scale: `${progress < 1 ? 1.12 : 1}`,
}}
>
{children}
diff --git a/registry/remocn/per-character-rise/config.ts b/registry/remocn/per-character-rise/config.ts
index 26488955..7e67542d 100644
--- a/registry/remocn/per-character-rise/config.ts
+++ b/registry/remocn/per-character-rise/config.ts
@@ -44,6 +44,7 @@ export const perCharacterRiseConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 570, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/per-character-rise/index.tsx b/registry/remocn/per-character-rise/index.tsx
index 9ab6f456..e3728545 100644
--- a/registry/remocn/per-character-rise/index.tsx
+++ b/registry/remocn/per-character-rise/index.tsx
@@ -73,7 +73,7 @@ export function PerCharacterRise({
backfaceVisibility: "hidden",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{char}
diff --git a/registry/remocn/per-word-crossfade/config.ts b/registry/remocn/per-word-crossfade/config.ts
index 35a221c1..03a07f23 100644
--- a/registry/remocn/per-word-crossfade/config.ts
+++ b/registry/remocn/per-word-crossfade/config.ts
@@ -40,6 +40,7 @@ export const perWordCrossfadeConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 720, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/per-word-crossfade/index.tsx b/registry/remocn/per-word-crossfade/index.tsx
index 96f3cb47..35dd1114 100644
--- a/registry/remocn/per-word-crossfade/index.tsx
+++ b/registry/remocn/per-word-crossfade/index.tsx
@@ -91,7 +91,7 @@ export function PerWordCrossfade({
marginRight: "0.25em",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{word}
@@ -139,7 +139,7 @@ export function PerWordCrossfade({
marginRight: "0.25em",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{word}
diff --git a/registry/remocn/perspective-marquee/index.tsx b/registry/remocn/perspective-marquee/index.tsx
index 50757028..e87325d9 100644
--- a/registry/remocn/perspective-marquee/index.tsx
+++ b/registry/remocn/perspective-marquee/index.tsx
@@ -84,7 +84,7 @@ export function PerspectiveMarquee({
style={{
display: "flex",
whiteSpace: "nowrap",
- transform: `translateX(${offset}px)`,
+ translate: `${offset}px`,
}}
>
{rendered.map((item, i) => {
diff --git a/registry/remocn/perspective-squeeze/index.tsx b/registry/remocn/perspective-squeeze/index.tsx
index e4ece79b..1ba83d8c 100644
--- a/registry/remocn/perspective-squeeze/index.tsx
+++ b/registry/remocn/perspective-squeeze/index.tsx
@@ -247,7 +247,7 @@ export function PerspectiveSqueeze({
top: (compHeight - height * stageScale) / 2,
width,
height,
- transform: `scale(${stageScale})`,
+ scale: `${stageScale}`,
transformOrigin: "0 0",
}}
>
diff --git a/registry/remocn/push-through/index.tsx b/registry/remocn/push-through/index.tsx
index 7a5d918f..21dd1fc9 100644
--- a/registry/remocn/push-through/index.tsx
+++ b/registry/remocn/push-through/index.tsx
@@ -35,10 +35,10 @@ const PushThroughPresentation: React.FC<
...clampOpts,
easing: Easing.bezier(0.42, 0, 0.58, 1),
}),
- transform: `scale(${interpolate(p, [0, 0.65], [1, zoom], {
+ scale: `${interpolate(p, [0, 0.65], [1, zoom], {
...clampOpts,
easing: Easing.in(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.15, 0.6], [0, blur], clampOpts)}px)`,
};
return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;
@@ -46,10 +46,10 @@ const PushThroughPresentation: React.FC<
const childStyle: React.CSSProperties = {
opacity: interpolate(p, [0.3, 0.5], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.3, 0.88, 1], [0.68, 1.02, 1], {
+ scale: `${interpolate(p, [0.3, 0.88, 1], [0.68, 1.02, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.3, 0.75], [blur * 0.7, 0], clampOpts)}px)`,
};
diff --git a/registry/remocn/reel/config.ts b/registry/remocn/reel/config.ts
index cd520480..2da97f27 100644
--- a/registry/remocn/reel/config.ts
+++ b/registry/remocn/reel/config.ts
@@ -51,6 +51,7 @@ export const reelConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 1180, height: 676 },
durationInFrames: 160,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/reel/index.tsx b/registry/remocn/reel/index.tsx
index 3c4bea42..6078af1a 100644
--- a/registry/remocn/reel/index.tsx
+++ b/registry/remocn/reel/index.tsx
@@ -75,7 +75,7 @@ export function Reel({
height: "100%",
objectFit: "cover",
objectPosition,
- transform: `scale(${imgScale})`,
+ scale: `${imgScale}`,
willChange: "transform",
}}
/>
diff --git a/registry/remocn/rgb-glitch-text/config.ts b/registry/remocn/rgb-glitch-text/config.ts
index d1b6c352..2a93b574 100644
--- a/registry/remocn/rgb-glitch-text/config.ts
+++ b/registry/remocn/rgb-glitch-text/config.ts
@@ -67,6 +67,7 @@ export const rgbGlitchTextConfig: ComponentConfig = {
description: "Seed",
},
},
+ dimensions: { width: 300, height: 130 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/rgb-glitch-text/index.tsx b/registry/remocn/rgb-glitch-text/index.tsx
index 6b2e6a79..cbf62535 100644
--- a/registry/remocn/rgb-glitch-text/index.tsx
+++ b/registry/remocn/rgb-glitch-text/index.tsx
@@ -90,7 +90,7 @@ export function RGBGlitchText({
...baseStyle,
color: "#ff0040",
opacity: copyOpacity,
- transform: `translateX(${rX}px) translateY(${rY}px)`,
+ translate: `${rX}px ${rY}px`,
}}
>
{text}
@@ -100,7 +100,7 @@ export function RGBGlitchText({
...baseStyle,
color: "#00ff80",
opacity: copyOpacity,
- transform: `translateX(${gX}px) translateY(${gY}px)`,
+ translate: `${gX}px ${gY}px`,
}}
>
{text}
@@ -110,7 +110,7 @@ export function RGBGlitchText({
...baseStyle,
color: "#0080ff",
opacity: copyOpacity,
- transform: `translateX(${bX}px) translateY(${bY}px)`,
+ translate: `${bX}px ${bY}px`,
}}
>
{text}
diff --git a/registry/remocn/ripple-zoom/index.tsx b/registry/remocn/ripple-zoom/index.tsx
index 30c0d760..155f2ab5 100644
--- a/registry/remocn/ripple-zoom/index.tsx
+++ b/registry/remocn/ripple-zoom/index.tsx
@@ -51,10 +51,10 @@ const RippleZoomPresentation: React.FC<
...clampOpts,
easing: Easing.bezier(0.42, 0, 0.58, 1),
}),
- transform: `scale(${interpolate(p, [0.3, 0.62], [1, 1.6], {
+ scale: `${interpolate(p, [0.3, 0.62], [1, 1.6], {
...clampOpts,
easing: Easing.in(Easing.cubic),
- })})`,
+ })}`,
};
return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;
}
@@ -70,10 +70,10 @@ const RippleZoomPresentation: React.FC<
const childStyle: React.CSSProperties = {
opacity: interpolate(p, [0.45, 0.62], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.42, 0.97], [0.2, 1], {
+ scale: `${interpolate(p, [0.42, 0.97], [0.2, 1], {
...clampOpts,
easing: Easing.bezier(0.33, 1, 0.68, 1),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.42, 0.8], [8, 0], clampOpts)}px)`,
};
diff --git a/registry/remocn/rolling-number/config.ts b/registry/remocn/rolling-number/config.ts
index e27b0a4a..6516bde8 100644
--- a/registry/remocn/rolling-number/config.ts
+++ b/registry/remocn/rolling-number/config.ts
@@ -35,6 +35,7 @@ export const rollingNumberConfig: ComponentConfig = {
description: "Color",
},
},
+ dimensions: { width: 380, height: 140 },
durationInFrames: 150,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/rolling-number/index.tsx b/registry/remocn/rolling-number/index.tsx
index 86a0e393..4bff538d 100644
--- a/registry/remocn/rolling-number/index.tsx
+++ b/registry/remocn/rolling-number/index.tsx
@@ -91,14 +91,14 @@ function DigitColumn({
verticalAlign: "top",
textAlign: "center",
opacity: reveal,
- transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,
+ translate: `0 ${(1 - reveal) * fontSize * REVEAL_RISE_EM}px`,
}}
>
<span
style={{
display: "flex",
flexDirection: "column",
- transform: `translateY(${-value * cellHeight}px)`,
+ translate: `0 ${-value * cellHeight}px`,
}}
>
{[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (
diff --git a/registry/remocn/rolodex-flip/config.ts b/registry/remocn/rolodex-flip/config.ts
index 8e738694..60a05d35 100644
--- a/registry/remocn/rolodex-flip/config.ts
+++ b/registry/remocn/rolodex-flip/config.ts
@@ -24,6 +24,7 @@ export const rolodexFlipConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 220, height: 60 },
durationInFrames: 110,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/scale-down-fade/config.ts b/registry/remocn/scale-down-fade/config.ts
index 4dc165a7..53478bef 100644
--- a/registry/remocn/scale-down-fade/config.ts
+++ b/registry/remocn/scale-down-fade/config.ts
@@ -35,6 +35,7 @@ export const scaleDownFadeConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 600, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/scale-down-fade/index.tsx b/registry/remocn/scale-down-fade/index.tsx
index 0ed5eb3b..0f646148 100644
--- a/registry/remocn/scale-down-fade/index.tsx
+++ b/registry/remocn/scale-down-fade/index.tsx
@@ -99,7 +99,8 @@ export function ScaleDownFade({
display: "inline-block",
transformOrigin: "50% 50%",
opacity,
- transform: `translateY(${y}px) scale(${scale})`,
+ translate: `0 ${y}px`,
+ scale: `${scale}`,
}}
>
{text}
diff --git a/registry/remocn/shared-axis-y/config.ts b/registry/remocn/shared-axis-y/config.ts
index c8f50f15..b852ecd7 100644
--- a/registry/remocn/shared-axis-y/config.ts
+++ b/registry/remocn/shared-axis-y/config.ts
@@ -40,6 +40,7 @@ export const sharedAxisYConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 720, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/shared-axis-z/config.ts b/registry/remocn/shared-axis-z/config.ts
index 32a6eae6..b2c29b10 100644
--- a/registry/remocn/shared-axis-z/config.ts
+++ b/registry/remocn/shared-axis-z/config.ts
@@ -40,6 +40,7 @@ export const sharedAxisZConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 870, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/shared-axis-z/index.tsx b/registry/remocn/shared-axis-z/index.tsx
index a65b86c7..86ff31c0 100644
--- a/registry/remocn/shared-axis-z/index.tsx
+++ b/registry/remocn/shared-axis-z/index.tsx
@@ -98,7 +98,7 @@ export function SharedAxisZ({
display: "inline-block",
transformOrigin: "50% 50%",
opacity: fromOpacity,
- transform: `scale(${fromScale})`,
+ scale: `${fromScale}`,
filter: `blur(${fromBlur}px)`,
}}
>
@@ -125,7 +125,7 @@ export function SharedAxisZ({
display: "inline-block",
transformOrigin: "50% 50%",
opacity: toOpacity,
- transform: `scale(${toScale})`,
+ scale: `${toScale}`,
filter: `blur(${toBlur}px)`,
}}
>
diff --git a/registry/remocn/shimmer-sweep/config.ts b/registry/remocn/shimmer-sweep/config.ts
index 650b8227..bd8fc996 100644
--- a/registry/remocn/shimmer-sweep/config.ts
+++ b/registry/remocn/shimmer-sweep/config.ts
@@ -40,6 +40,7 @@ export const shimmerSweepConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 500, height: 130 },
durationInFrames: 120,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/short-slide-down/config.ts b/registry/remocn/short-slide-down/config.ts
index 777cc3fd..e45ee101 100644
--- a/registry/remocn/short-slide-down/config.ts
+++ b/registry/remocn/short-slide-down/config.ts
@@ -44,6 +44,7 @@ export const shortSlideDownConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 640, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/short-slide-right/config.ts b/registry/remocn/short-slide-right/config.ts
index adb8482d..eba3586f 100644
--- a/registry/remocn/short-slide-right/config.ts
+++ b/registry/remocn/short-slide-right/config.ts
@@ -53,6 +53,7 @@ export const shortSlideRightConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 640, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/short-slide-right/index.tsx b/registry/remocn/short-slide-right/index.tsx
index 84e16141..d80cbcd7 100644
--- a/registry/remocn/short-slide-right/index.tsx
+++ b/registry/remocn/short-slide-right/index.tsx
@@ -65,7 +65,7 @@ export function ShortSlideRight({
fontFamily:
"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif",
display: "inline-block",
- transform: `translateX(${x}px)`,
+ translate: `${x}px`,
filter: `blur(${blurVal}px)`,
}}
>
diff --git a/registry/remocn/simulated-cursor/config.ts b/registry/remocn/simulated-cursor/config.ts
index 1e0f4fad..1625d657 100644
--- a/registry/remocn/simulated-cursor/config.ts
+++ b/registry/remocn/simulated-cursor/config.ts
@@ -19,6 +19,7 @@ export const simulatedCursorConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 890, height: 450 },
durationInFrames: 150,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/simulated-cursor/index.tsx b/registry/remocn/simulated-cursor/index.tsx
index e489a6ab..487e6a1d 100644
--- a/registry/remocn/simulated-cursor/index.tsx
+++ b/registry/remocn/simulated-cursor/index.tsx
@@ -161,7 +161,7 @@ export function SimulatedCursor({
top: y,
width: size,
height: size,
- transform: `scale(${clickScale})`,
+ scale: `${clickScale}`,
transformOrigin: "top left",
zIndex: 2147483647,
pointerEvents: "none",
diff --git a/registry/remocn/slide-swap/index.tsx b/registry/remocn/slide-swap/index.tsx
index a45d3fef..d11b0540 100644
--- a/registry/remocn/slide-swap/index.tsx
+++ b/registry/remocn/slide-swap/index.tsx
@@ -37,7 +37,7 @@ export const SLIDE_SWAP_DEFAULTS: SlideSwapConfig = {
export type SlideAxis = "x" | "y";
const translate = (axis: SlideAxis, v: number) =>
- axis === "x" ? `translateX(${v}px)` : `translateY(${v}px)`;
+ axis === "x" ? `${v}px` : `0 ${v}px`;
export const slideInStyle = (
e: number,
@@ -60,7 +60,7 @@ export const slideInStyle = (
});
const tFade = Math.min(Math.max(e / cfg.inFadeFrames, 0), 1);
return {
- transform: translate(axis, cfg.inDistance * size * (1 - p)),
+ translate: translate(axis, cfg.inDistance * size * (1 - p)),
opacity: 1 - (1 - tFade) * (1 - tFade),
willChange: "transform, opacity",
};
@@ -76,7 +76,7 @@ export const slideOutStyle = (
if (e <= 0) return {};
const t = Math.min(e / cfg.outFrames, 1);
return {
- transform: translate(axis, -cfg.outDistance * size * t ** cfg.outPower),
+ translate: translate(axis, -cfg.outDistance * size * t ** cfg.outPower),
opacity: 1 - t * t,
willChange: "transform, opacity",
};
diff --git a/registry/remocn/slot-machine-roll/config.ts b/registry/remocn/slot-machine-roll/config.ts
index bacccae5..83108502 100644
--- a/registry/remocn/slot-machine-roll/config.ts
+++ b/registry/remocn/slot-machine-roll/config.ts
@@ -40,6 +40,7 @@ export const slotMachineRollConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 190, height: 170 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/slot-machine-roll/index.tsx b/registry/remocn/slot-machine-roll/index.tsx
index 1651c6a2..9b7075f9 100644
--- a/registry/remocn/slot-machine-roll/index.tsx
+++ b/registry/remocn/slot-machine-roll/index.tsx
@@ -53,7 +53,7 @@ export function SlotMachineRoll({
style={{
display: "flex",
flexDirection: "column",
- transform: `translateY(${-t * fontSize * 1.1}px)`,
+ translate: `0 ${-t * fontSize * 1.1}px`,
}}
>
<span>{paddedFrom[i]}</span>
diff --git a/registry/remocn/smoke-dissolve/index.tsx b/registry/remocn/smoke-dissolve/index.tsx
index 59317686..fc102ded 100644
--- a/registry/remocn/smoke-dissolve/index.tsx
+++ b/registry/remocn/smoke-dissolve/index.tsx
@@ -44,10 +44,10 @@ const SmokeDissolvePresentation: React.FC<
const childStyle: React.CSSProperties = entering
? {
opacity: interpolate(p, [0.55, 0.68], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.55, 1], [0.3, 1], {
+ scale: `${interpolate(p, [0.55, 1], [0.3, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.55, 0.75], [10, 0], clampOpts)}px)`,
}
: { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };
diff --git a/registry/remocn/soft-blur-in/config.ts b/registry/remocn/soft-blur-in/config.ts
index b2e05af9..b9a6f761 100644
--- a/registry/remocn/soft-blur-in/config.ts
+++ b/registry/remocn/soft-blur-in/config.ts
@@ -44,6 +44,7 @@ export const softBlurInConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 600, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/soft-blur-in/index.tsx b/registry/remocn/soft-blur-in/index.tsx
index 5b59195d..6bd443ca 100644
--- a/registry/remocn/soft-blur-in/index.tsx
+++ b/registry/remocn/soft-blur-in/index.tsx
@@ -78,7 +78,7 @@ export function SoftBlurIn({
backfaceVisibility: "hidden",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
filter: `blur(${blurAmount}px)`,
}}
>
diff --git a/registry/remocn/spring-scale-in/config.ts b/registry/remocn/spring-scale-in/config.ts
index 30b5be9e..0c8b50aa 100644
--- a/registry/remocn/spring-scale-in/config.ts
+++ b/registry/remocn/spring-scale-in/config.ts
@@ -53,6 +53,7 @@ export const springScaleInConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 720, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/spring-scale-in/index.tsx b/registry/remocn/spring-scale-in/index.tsx
index 8987fe1a..c23dd4f6 100644
--- a/registry/remocn/spring-scale-in/index.tsx
+++ b/registry/remocn/spring-scale-in/index.tsx
@@ -76,7 +76,7 @@ export function SpringScaleIn({
marginRight: "0.25em",
transformOrigin: "50% 50%",
opacity,
- transform: `scale(${scale})`,
+ scale: `${scale}`,
}}
>
{word}
diff --git a/registry/remocn/spring-settle/index.tsx b/registry/remocn/spring-settle/index.tsx
index c3dfd0fa..a8a15223 100644
--- a/registry/remocn/spring-settle/index.tsx
+++ b/registry/remocn/spring-settle/index.tsx
@@ -132,7 +132,7 @@ export const springSettleExitStyle = (
if (tExit <= 0) return {};
const eExit = tExit ** cfg.exitPower;
return {
- transform: `scale(${1 - (1 - cfg.exitScale) * eExit})`,
+ scale: `${1 - (1 - cfg.exitScale) * eExit}`,
opacity: 1 - eExit,
willChange: "transform, opacity",
};
@@ -199,7 +199,7 @@ export function SpringSettleItem({
<div
style={{
...style,
- transform: `scale(${scaleEnter})`,
+ scale: `${scaleEnter}`,
opacity: opacityEnter,
willChange: "transform, opacity",
}}
diff --git a/registry/remocn/staggered-fade-up/config.ts b/registry/remocn/staggered-fade-up/config.ts
index dbd5e935..150df313 100644
--- a/registry/remocn/staggered-fade-up/config.ts
+++ b/registry/remocn/staggered-fade-up/config.ts
@@ -53,6 +53,7 @@ export const staggeredFadeUpConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 870, height: 100 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/staggered-fade-up/index.tsx b/registry/remocn/staggered-fade-up/index.tsx
index 1a126904..5fef4337 100644
--- a/registry/remocn/staggered-fade-up/index.tsx
+++ b/registry/remocn/staggered-fade-up/index.tsx
@@ -66,7 +66,7 @@ export function StaggeredFadeUp({
display: "inline-block",
marginRight: "0.25em",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{word}
diff --git a/registry/remocn/strikethrough-replace/config.ts b/registry/remocn/strikethrough-replace/config.ts
index ad155182..1dc61db2 100644
--- a/registry/remocn/strikethrough-replace/config.ts
+++ b/registry/remocn/strikethrough-replace/config.ts
@@ -45,6 +45,7 @@ export const strikethroughReplaceConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 300, height: 130 },
durationInFrames: 120,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/strikethrough-replace/index.tsx b/registry/remocn/strikethrough-replace/index.tsx
index d4cc978e..6229cde5 100644
--- a/registry/remocn/strikethrough-replace/index.tsx
+++ b/registry/remocn/strikethrough-replace/index.tsx
@@ -101,7 +101,7 @@ export function StrikethroughReplace({
height: Math.max(2, Math.round(fontSize * 0.08)),
width: `${linePct}%`,
background: lineColor,
- transform: "translateY(-50%)",
+ translate: "0 -50%",
borderRadius: 2,
}}
/>
@@ -113,7 +113,7 @@ export function StrikethroughReplace({
style={{
...textStyle,
opacity: toOpacity,
- transform: `translateY(${toY}px)`,
+ translate: `0 ${toY}px`,
}}
>
{to}
diff --git a/registry/remocn/sustained-glitch/index.tsx b/registry/remocn/sustained-glitch/index.tsx
index 70479a25..ddc5e0dd 100644
--- a/registry/remocn/sustained-glitch/index.tsx
+++ b/registry/remocn/sustained-glitch/index.tsx
@@ -166,7 +166,7 @@ const SustainedGlitchFallback: React.FC<
key={band}
style={{
clipPath: `inset(${band * height}% 0 ${100 - (band + 1) * height}% 0)`,
- transform: `translateX(${shift}px)`,
+ translate: `${shift}px`,
}}
>
{children}
diff --git a/registry/remocn/swirl-dissolve/index.tsx b/registry/remocn/swirl-dissolve/index.tsx
index 2d03a326..d634bb4c 100644
--- a/registry/remocn/swirl-dissolve/index.tsx
+++ b/registry/remocn/swirl-dissolve/index.tsx
@@ -49,10 +49,10 @@ const SwirlDissolvePresentation: React.FC<
const childStyle: React.CSSProperties = entering
? {
opacity: interpolate(p, [0.77, 0.87], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.77, 1], [0.3, 1], {
+ scale: `${interpolate(p, [0.77, 1], [0.3, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.77, 0.93], [10, 0], clampOpts)}px)`,
}
: { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };
diff --git a/registry/remocn/terminal-cursor-zoom/index.tsx b/registry/remocn/terminal-cursor-zoom/index.tsx
index 93934a46..ce0a3567 100644
--- a/registry/remocn/terminal-cursor-zoom/index.tsx
+++ b/registry/remocn/terminal-cursor-zoom/index.tsx
@@ -77,7 +77,8 @@ export function TerminalCursorZoom({
top: 0,
width: STAGE_WIDTH,
height: STAGE_HEIGHT,
- transform: `translate(${tx}px, ${ty}px) scale(${zoom})`,
+ translate: `${tx}px ${ty}px`,
+ scale: `${zoom}`,
transformOrigin: "0 0",
}}
>
diff --git a/registry/remocn/terminal-simulator/config.ts b/registry/remocn/terminal-simulator/config.ts
index c7583e4f..034cb1fc 100644
--- a/registry/remocn/terminal-simulator/config.ts
+++ b/registry/remocn/terminal-simulator/config.ts
@@ -52,6 +52,7 @@ export const terminalSimulatorConfig: ComponentConfig = {
hiddenFromList: false,
},
},
+ dimensions: { width: 900, height: 480 },
durationInFrames: 240,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/terminal-simulator/index.tsx b/registry/remocn/terminal-simulator/index.tsx
index 3927653b..54b3e8c2 100644
--- a/registry/remocn/terminal-simulator/index.tsx
+++ b/registry/remocn/terminal-simulator/index.tsx
@@ -178,7 +178,7 @@ export function TerminalSimulator({
left: 20,
right: 20,
top: 20,
- transform: `translateY(${translateY}px)`,
+ translate: `0 ${translateY}px`,
}}
>
{lines.map((line, index) => (
diff --git a/registry/remocn/top-down-letters/config.ts b/registry/remocn/top-down-letters/config.ts
index 07722518..0b413d7b 100644
--- a/registry/remocn/top-down-letters/config.ts
+++ b/registry/remocn/top-down-letters/config.ts
@@ -53,6 +53,7 @@ export const topDownLettersConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 230, height: 100 },
durationInFrames: 60,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/top-down-letters/index.tsx b/registry/remocn/top-down-letters/index.tsx
index a5533e63..65ed454f 100644
--- a/registry/remocn/top-down-letters/index.tsx
+++ b/registry/remocn/top-down-letters/index.tsx
@@ -73,7 +73,7 @@ export function TopDownLetters({
backfaceVisibility: "hidden",
transformOrigin: "50% 55%",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{char}
diff --git a/registry/remocn/tracking-in/config.ts b/registry/remocn/tracking-in/config.ts
index ed35ea0b..88bf43d6 100644
--- a/registry/remocn/tracking-in/config.ts
+++ b/registry/remocn/tracking-in/config.ts
@@ -53,6 +53,7 @@ export const trackingInConfig: ComponentConfig = {
description: "Font weight",
},
},
+ dimensions: { width: 550, height: 130 },
durationInFrames: 90,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/tv-power-off/index.tsx b/registry/remocn/tv-power-off/index.tsx
index db5d9999..8ad7caa8 100644
--- a/registry/remocn/tv-power-off/index.tsx
+++ b/registry/remocn/tv-power-off/index.tsx
@@ -209,7 +209,7 @@ const TvPowerOffFallback: React.FC<TvPowerOffProps & CanvasFilterProps> = (
/>
<AbsoluteFill
style={{
- transform: `scale(${pinchX}, ${squash})`,
+ scale: `${pinchX} ${squash}`,
filter: `brightness(${1 + (concentrate - 1) * Math.max(gain, 0)})`,
opacity: fade,
}}
diff --git a/registry/remocn/v0/index.tsx b/registry/remocn/v0/index.tsx
index 87704dcd..2f53fb0f 100644
--- a/registry/remocn/v0/index.tsx
+++ b/registry/remocn/v0/index.tsx
@@ -239,7 +239,8 @@ export function V0({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
<div
@@ -254,7 +255,7 @@ export function V0({
fontWeight: 700,
color: t.fg,
opacity: headingFade.opacity,
- transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,
+ translate: `0 ${headingFade.translateY + intro.translateY * 0.4}px`,
}}
>
{greeting}
@@ -272,7 +273,8 @@ export function V0({
borderRadius: 16,
boxShadow: "0 8px 40px -16px rgba(0,0,0,0.8)",
opacity: boxFade.opacity,
- transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,
+ translate: `0 ${boxFade.translateY + intro.translateY * 0.6}px`,
+ scale: `${intro.scale}`,
transformOrigin: "center top",
display: "flex",
flexDirection: "column",
@@ -396,7 +398,7 @@ export function V0({
alignItems: "center",
justifyContent: "center",
opacity: 1 - morph,
- transform: `scale(${1 - 0.08 * morph})`,
+ scale: `${1 - 0.08 * morph}`,
}}
>
<MicIcon size={20} color={t.btnFg} />
@@ -409,7 +411,7 @@ export function V0({
alignItems: "center",
justifyContent: "center",
opacity: morph,
- transform: `scale(${0.85 + 0.15 * morph})`,
+ scale: `${0.85 + 0.15 * morph}`,
}}
>
<ArrowUpIcon size={20} color={t.btnFg} />
diff --git a/registry/remocn/value-swap/config.ts b/registry/remocn/value-swap/config.ts
index e3e86802..728ea443 100644
--- a/registry/remocn/value-swap/config.ts
+++ b/registry/remocn/value-swap/config.ts
@@ -33,6 +33,7 @@ export const valueSwapConfig: ComponentConfig = {
description: "Direction",
},
},
+ dimensions: { width: 220, height: 70 },
durationInFrames: 100,
fps: FPS,
compositionWidth: W,
diff --git a/registry/remocn/value-swap/index.tsx b/registry/remocn/value-swap/index.tsx
index 9f11b92f..4f5dc4cf 100644
--- a/registry/remocn/value-swap/index.tsx
+++ b/registry/remocn/value-swap/index.tsx
@@ -63,7 +63,7 @@ export function ValueSwap({
top: 0,
whiteSpace: "nowrap",
opacity,
- transform: `translateY(${y}px)`,
+ translate: `0 ${y}px`,
}}
>
{value}
diff --git a/registry/remocn/vhs-filter/index.tsx b/registry/remocn/vhs-filter/index.tsx
index babc06a7..ea1b5ead 100644
--- a/registry/remocn/vhs-filter/index.tsx
+++ b/registry/remocn/vhs-filter/index.tsx
@@ -146,7 +146,7 @@ const VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({
<AbsoluteFill>
<AbsoluteFill
style={{
- transform: `translateX(${shift}px)`,
+ translate: `${shift}px`,
filter: `saturate(${1 + bleed * 0.3}) contrast(1.04) brightness(${flicker}) blur(${0.3 * intensity}px)`,
}}
>
@@ -154,7 +154,7 @@ const VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({
</AbsoluteFill>
<AbsoluteFill
style={{
- transform: `translateX(${shift - smear}px)`,
+ translate: `${shift - smear}px`,
filter: "saturate(2.2) blur(1.4px)",
mixBlendMode: "screen",
opacity: 0.24 * bleed * intensity,
@@ -175,7 +175,7 @@ const VhsFilterFallback: React.FC<VhsFilterProps & CanvasFilterProps> = ({
insetInline: 0,
bottom: 0,
height: "3.6%",
- transform: `translateX(${shift * 3}px)`,
+ translate: `${shift * 3}px`,
background: `rgba(228, 228, 228, ${0.13 * intensity})`,
mixBlendMode: "screen",
}}
diff --git a/registry/remocn/volumetric-rays/index.tsx b/registry/remocn/volumetric-rays/index.tsx
index 910980cb..77b684b5 100644
--- a/registry/remocn/volumetric-rays/index.tsx
+++ b/registry/remocn/volumetric-rays/index.tsx
@@ -82,7 +82,7 @@ export function VolumetricRays({
...sharedTextStyle,
color: rayColor,
filter: `blur(${60 * intensity}px)`,
- transform: "scale(1.2, 1.6)",
+ scale: "1.2 1.6",
transformOrigin: "center bottom",
opacity: bloomOpacity * haloPulse,
}}
diff --git a/registry/remocn/warp-dissolve/index.tsx b/registry/remocn/warp-dissolve/index.tsx
index 91019ade..6f8ff2c8 100644
--- a/registry/remocn/warp-dissolve/index.tsx
+++ b/registry/remocn/warp-dissolve/index.tsx
@@ -44,10 +44,10 @@ const WarpDissolvePresentation: React.FC<
if (!entering) {
const meltStyle: React.CSSProperties = {
opacity: interpolate(p, [0.2, 0.38], [1, 0], clampOpts),
- transform: `scale(${interpolate(p, [0, 0.38], [1, 1.16], {
+ scale: `${interpolate(p, [0, 0.38], [1, 1.16], {
...clampOpts,
easing: Easing.in(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.04, 0.38], [0, 18], clampOpts)}px)`,
};
return <AbsoluteFill style={meltStyle}>{children}</AbsoluteFill>;
@@ -66,10 +66,10 @@ const WarpDissolvePresentation: React.FC<
const childStyle: React.CSSProperties = {
opacity: interpolate(p, [0.66, 0.82], [0, 1], clampOpts),
- transform: `scale(${interpolate(p, [0.66, 1], [1.18, 1], {
+ scale: `${interpolate(p, [0.66, 1], [1.18, 1], {
...clampOpts,
easing: Easing.out(Easing.cubic),
- })})`,
+ })}`,
filter: `blur(${interpolate(p, [0.66, 0.92], [16, 0], clampOpts)}px)`,
};
diff --git a/registry/remocn/wave-wipe/index.tsx b/registry/remocn/wave-wipe/index.tsx
index 9994b468..82c5542a 100644
--- a/registry/remocn/wave-wipe/index.tsx
+++ b/registry/remocn/wave-wipe/index.tsx
@@ -51,10 +51,10 @@ const WaveWipePresentation: React.FC<
...clampOpts,
easing: Easing.bezier(0.42, 0, 0.58, 1),
}),
- transform: `translateY(${interpolate(p, [0, 0.7], [0, -70], {
+ translate: `0 ${interpolate(p, [0, 0.7], [0, -70], {
...clampOpts,
easing: Easing.in(Easing.cubic),
- })}%)`,
+ })}%`,
};
return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;
}
@@ -87,7 +87,7 @@ const WaveWipePresentation: React.FC<
offsetY={drift}
/>
</AbsoluteFill>
- <AbsoluteFill style={{ transform: `translateY(${rise}%)` }}>
+ <AbsoluteFill style={{ translate: `0 ${rise}%` }}>
{children}
</AbsoluteFill>
</AbsoluteFill>
diff --git a/registry/remocn/whip-pan/index.tsx b/registry/remocn/whip-pan/index.tsx
index d563f68d..0af7a5b4 100644
--- a/registry/remocn/whip-pan/index.tsx
+++ b/registry/remocn/whip-pan/index.tsx
@@ -42,12 +42,12 @@ const WhipPanPresentation: React.FC<
const offset = entering ? (travel - 1) * 110 * sign : travel * 110 * sign;
const stretch = 1 + velocity * 0.12;
- const translate =
- axis === "x" ? `translateX(${offset}%)` : `translateY(${offset}%)`;
- const smear = axis === "x" ? `scaleX(${stretch})` : `scaleY(${stretch})`;
+ const translate = axis === "x" ? `${offset}%` : `0 ${offset}%`;
+ const smear = axis === "x" ? `${stretch} 1` : `1 ${stretch}`;
const style: React.CSSProperties = {
- transform: `${translate} ${smear}`,
+ translate,
+ scale: smear,
filter: `blur(${velocity * blur}px)`,
};
diff --git a/registry/remocn/x-follow-card/index.tsx b/registry/remocn/x-follow-card/index.tsx
index 58a8efa3..a2accee9 100644
--- a/registry/remocn/x-follow-card/index.tsx
+++ b/registry/remocn/x-follow-card/index.tsx
@@ -441,7 +441,7 @@ function FollowButton({
fontWeight: 700,
fontFamily: FONT_FAMILY,
boxSizing: "border-box" as const,
- transform: `scale(${pressScale})`,
+ scale: `${pressScale}`,
transformOrigin: "center",
};
@@ -726,7 +726,7 @@ export function XFollowCard({
return {
filter: b.blur > 0 ? `blur(${b.blur}px)` : "none",
opacity: b.opacity,
- transform: `translateY(${b.translateY}px)`,
+ translate: `0 ${b.translateY}px`,
};
};
@@ -739,7 +739,8 @@ export function XFollowCard({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
<div
@@ -752,7 +753,8 @@ export function XFollowCard({
border: `1px solid ${t.cardBorder}`,
borderRadius: 24,
overflow: "hidden",
- transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,
+ translate: `0 ${bounce.translateY}px`,
+ scale: `${bounce.scale}`,
transformOrigin: "center top",
boxShadow: "0 12px 40px -16px rgba(15,20,25,0.18)",
}}
@@ -841,7 +843,8 @@ export function XFollowCard({
style={{
position: "absolute",
inset: 0,
- transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,
+ translate: `0 ${bounce.translateY}px`,
+ scale: `${bounce.scale}`,
transformOrigin: "center top",
}}
>
diff --git a/registry/remocn/x-followers-overview/index.tsx b/registry/remocn/x-followers-overview/index.tsx
index 19d0bcc2..7cf9c108 100644
--- a/registry/remocn/x-followers-overview/index.tsx
+++ b/registry/remocn/x-followers-overview/index.tsx
@@ -360,7 +360,8 @@ export function XFollowersOverview({
top: "50%",
width: refW,
height: refH,
- transform: `translate(-50%, -50%) scale(${stageScale})`,
+ translate: "-50% -50%",
+ scale: `${stageScale}`,
}}
>
<div
@@ -473,7 +474,7 @@ export function XFollowersOverview({
opacity: avatarIn.opacity,
filter:
avatarIn.blur > 0 ? `blur(${avatarIn.blur}px)` : "none",
- transform: `translateX(${avatarX}px)`,
+ translate: `${avatarX}px`,
}}
>
<Avatar
@@ -493,7 +494,7 @@ export function XFollowersOverview({
opacity: handleIn.opacity,
filter:
handleIn.blur > 0 ? `blur(${handleIn.blur}px)` : "none",
- transform: `translateX(${handleX}px)`,
+ translate: `${handleX}px`,
}}
>
@{handle}
@@ -508,7 +509,8 @@ export function XFollowersOverview({
gap: 18,
opacity: countIn.opacity,
filter: countIn.blur > 0 ? `blur(${countIn.blur}px)` : "none",
- transform: `translateY(${countIn.translateY}px) scale(${revealScale})`,
+ translate: `0 ${countIn.translateY}px`,
+ scale: `${revealScale}`,
}}
>
<span
diff --git a/scripts/build-elements.mts b/scripts/build-elements.mts
index f0dc909a..9e90c0a2 100644
--- a/scripts/build-elements.mts
+++ b/scripts/build-elements.mts
@@ -254,29 +254,100 @@ function serializeSchema(value: unknown, indent: string): string {
return `{\n${lines.join("\n")}\n${indent}}`;
}
-async function loadElementSchema(
+interface ElementConfig {
+ schema: InteractivitySchema | null;
+ dimensions: { width: number; height: number } | null;
+}
+
+async function loadElementConfig(
name: string,
sourcePath: string,
-): Promise<InteractivitySchema | null> {
+): Promise<ElementConfig> {
const configPath = join(dirname(sourcePath), "config.ts");
- if (!existsSync(configPath)) return null;
+ if (!existsSync(configPath)) return { schema: null, dimensions: null };
const mod = await import(resolve(configPath));
const config = Object.values(mod).find(
(v) => v && typeof v === "object" && "controls" in (v as object),
- ) as { controls: InteractivitySchema } | undefined;
- if (!config) return null;
+ ) as
+ | {
+ controls: InteractivitySchema;
+ dimensions?: { width: number; height: number };
+ }
+ | undefined;
+ if (!config) return { schema: null, dimensions: null };
+ const dimensions = config.dimensions ?? null;
const schema = resolveSchema(name, config.controls);
if (Object.keys(schema).some((key) => RESERVED_SCHEMA_KEYS.has(key))) {
- return null;
+ return { schema: null, dimensions };
}
- return schema;
+ return { schema, dimensions };
}
function makeInteractiveWrapper(
componentName: string,
schema: InteractivitySchema,
+ dimensions: { width: number; height: number } | null,
): string {
const keys = Object.keys(schema);
+ const sizeControls =
+ dimensions !== null && !("width" in schema) && !("height" in schema);
+ const sizeSchema = sizeControls
+ ? ` width: {
+ type: "number",
+ default: ${dimensions?.width},
+ min: 10,
+ step: 10,
+ description: "Width",
+ },
+ height: {
+ type: "number",
+ default: ${dimensions?.height},
+ min: 10,
+ step: 10,
+ description: "Height",
+ },
+`
+ : "";
+ const content = dimensions
+ ? `<div
+ style={{
+ position: "absolute",
+ inset: 0,
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ }}
+ >
+ <div
+ ref={outlineRef}
+ style={{
+ position: "relative",
+ width${sizeControls ? "" : `: ${dimensions.width}`},
+ height${sizeControls ? "" : `: ${dimensions.height}`},
+ ...style,
+ }}
+ >
+ <${componentName}Base
+ {...(componentProps as unknown as ComponentProps<typeof ${componentName}Base>)}
+ />
+ </div>
+ </div>`
+ : `<div
+ ref={outlineRef}
+ style={{
+ position: "relative",
+ width: "100%",
+ height: "100%",
+ display: "flex",
+ alignItems: "center",
+ justifyContent: "center",
+ ...style,
+ }}
+ >
+ <${componentName}Base
+ {...(componentProps as unknown as ComponentProps<typeof ${componentName}Base>)}
+ />
+ </div>`;
return `const elementSchema = {
...Interactive.baseSchema,
${Object.entries(schema)
@@ -285,7 +356,7 @@ ${Object.entries(schema)
` ${IDENT.test(k) ? k : JSON.stringify(k)}: ${serializeSchema(v, " ")},`,
)
.join("\n")}
- ...Interactive.transformSchema,
+${sizeSchema} ...Interactive.transformSchema,
} as const satisfies InteractivitySchema;
const ELEMENT_PROP_KEYS = new Set(${JSON.stringify(keys)});
@@ -302,13 +373,21 @@ const ELEMENT_PROP_DEFAULTS: Record<string, unknown> = ${serializeSchema(
)};
type ${componentName}ElementProps = InteractiveBaseProps &
- InteractiveTransformProps &
+ InteractiveTransformProps &${
+ sizeControls
+ ? ` { readonly width?: number; readonly height?: number } &`
+ : ""
+ }
ComponentProps<typeof ${componentName}Base>;
const ${componentName}Inner = forwardRef<
HTMLDivElement,
${componentName}ElementProps & { readonly controls: SequenceControls | undefined }
->(({ controls, name, style, ...rest }, ref) => {
+>(({ controls, name, style, ${
+ sizeControls
+ ? `width = ${dimensions?.width}, height = ${dimensions?.height}, `
+ : ""
+ }...rest }, ref) => {
const outlineRef = useRef<HTMLDivElement>(null);
useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);
const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };
@@ -328,22 +407,7 @@ const ${componentName}Inner = forwardRef<
name={name ?? "<${componentName}>"}
outlineRef={outlineRef}
>
- <div
- ref={outlineRef}
- style={{
- position: "relative",
- width: "100%",
- height: "100%",
- display: "flex",
- alignItems: "center",
- justifyContent: "center",
- ...style,
- }}
- >
- <${componentName}Base
- {...(componentProps as unknown as ComponentProps<typeof ${componentName}Base>)}
- />
- </div>
+ ${content}
</Sequence>
);
});
@@ -406,7 +470,7 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {
const lib = libSources.get(dep);
return lib ? [lib] : [];
});
- const schema = await loadElementSchema(item.name, path);
+ const { schema, dimensions } = await loadElementConfig(item.name, path);
let sourceCode = mergeSources(
parseSource(item.files[0].content),
libs.map((lib) => lib.parsed),
@@ -441,7 +505,7 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {
`${componentName}Base`,
),
);
- sourceCode += `\n\n${makeInteractiveWrapper(componentName, schema)}\n`;
+ sourceCode += `\n\n${makeInteractiveWrapper(componentName, schema, dimensions)}\n`;
installationMode = "component-owned-sequence";
interactive++;
}
@@ -456,7 +520,7 @@ for (const file of readdirSync(ARTIFACTS_DIR).sort()) {
slug: item.name,
sourceCode,
dependencies: resolveDependencies(depNames),
- dimensions: null,
+ dimensions,
durationInFrames,
installationMode,
});