Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: august changelog
kapishdima081eadc4e6db
diff --git a/app/(home)/components/hero-badge.tsx b/app/(home)/components/hero-badge.tsxindex 7184d2b7..837d7bed 100644--- a/app/(home)/components/hero-badge.tsx+++ b/app/(home)/components/hero-badge.tsx@@ -5,8 +5,7 @@ import Link from "next/link";import { Badge } from "@/components/ui/badge";import { useTrackEvent } from "@/lib/analytics";-const HERO_BADGE_HREF =- "https://remocn.dev/docs/filters/getting-started/introduction";+const HERO_BADGE_HREF = "/changelog#2026-08-12-august-components";export function HeroBadge() {const trackEvent = useTrackEvent();@@ -31,7 +30,7 @@ export function HeroBadge() {<span aria-hidden className="text-muted-foreground/60">·</span>- <span className="text-foreground">HTML in Canvas</span>+ <span className="text-foreground">August update</span><ArrowRightclassName="size-3 transition-transform group-hover:translate-x-0.5"aria-hidden="true"diff --git a/config/site.ts b/config/site.tsindex 5996a6ff..df8c3ff2 100644--- a/config/site.ts+++ b/config/site.ts@@ -64,22 +64,13 @@ export const NAV_LINKS: NavLink[] = [* tag another menu item — no component changes needed. See `withNewBadges`.*/export const NEW_BADGE_PATHS = new Set<string>([- "/docs/transitions/glitch-cut",- "/docs/transitions/ember-burn",- "/docs/transitions/particle-dissolve",- "/docs/transitions/grid-wave",- "/docs/transitions/displacement",- "/docs/filters/components/vhs-filter",- "/docs/filters/components/crt-screen",- "/docs/filters/components/sustained-glitch",- "/docs/filters/components/pixelate-region",- "/docs/filters/components/ascii-render",- "/docs/filters/components/halftone-print",- "/docs/filters/components/underwater-ripple",- "/docs/filters/components/camera-lens",- "/docs/filters/components/security-cam",- "/docs/filters/components/hologram",- "/docs/effects/tv-power-off",+ "/docs/typography/kinetic-warp",+ "/docs/transitions/lens-zoom",+ "/docs/typography/gooey-morph",+ "/docs/typography/perspective-squeeze",+ "/docs/typography/extrude-pop",+ "/docs/typography/chromatic-wave",+ "/docs/typography/stretch-in",]);export type FooterGroup = {diff --git a/content/changelog/2026-08-12-august-components.mdx b/content/changelog/2026-08-12-august-components.mdxnew file mode 100644index 00000000..0ef2c703--- /dev/null+++ b/content/changelog/2026-08-12-august-components.mdx@@ -0,0 +1,18 @@+---+title: Seven from the tutorials+date: 2026-08-12+---++Seven components ported from finished motion-design tutorial reproductions — six typography moments and one full-optics transition. Each one is a technique that has no CSS primitive: mesh warps, gooey thresholds, projective corner pins, morphological extrusions, glass displacement and glyph-level deformation, all rebuilt on deterministic Remotion math.++<ChangelogPreview name="stretch-in" />++### New components++- [Kinetic Warp](/docs/typography/kinetic-warp) — a coarse mesh warp bends a whole word in staccato beats, one axis per keyframe. The text never moves; a 2×4 grid does, and two monotone splines resample the canvas so the word bends without folding through itself. Inspired by P A N T E R's kinetic warp tutorial.+- [Lens Zoom](/docs/transitions/lens-zoom) — a hard cut disguised as a lens punch-in: barrel distortion, fading zoom blur, chromatic split and camera shake around the splice. A full `TransitionSeries` presentation; the cut lands exactly halfway through. Inspired by Creative Dojo.+- [Gooey Morph](/docs/typography/gooey-morph) — bars fly in Tetris-style, land as a row, and melt into a word. The melt is blur-the-alpha-then-threshold: where shapes sit close, their blurred edges add up and paint a solid neck between them. Inspired by Mapal.+- [Perspective Squeeze](/docs/typography/perspective-squeeze) — two lines of heavy type endlessly trade height while a true projective corner-pin bends the flat stack into receding planes. A 225-frame loop that ends where it starts. Inspired by Mapal.+- [Extrude Pop](/docs/typography/extrude-pop) — a flat word pops up out of the plane on a solid colored 3D body, no camera involved. The body is the glyph swept along the extrusion vector; long text auto-shrinks to fit. Inspired by Mapal.+- [Chromatic Wave](/docs/typography/chromatic-wave) — a soft wave travels down through the type; where it crosses, the letters ripple and split into RGB fringes, then settle back to white. Three displacement depths, one per channel, summed back with screen blending. Inspired by Mapal.+- [Stretch In](/docs/typography/stretch-in) — letters fly in from off-canvas and smear horizontally on the way. A vertex-lag deformation on real glyph outlines parsed with `opentype.js`: the leading edge lands first, the trailing edge catches up, and stems never change width. Works with any text and any font file. Inspired by Ben Marriott.diff --git a/registry-artifacts/chromatic-wave.json b/registry-artifacts/chromatic-wave.jsonnew file mode 100644index 00000000..bf55c5d5--- /dev/null+++ b/registry-artifacts/chromatic-wave.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "chromatic-wave",+ "title": "Chromatic Wave",+ "description": "A soft wave travels down through the type; where it crosses, the letters ripple and split into RGB fringes.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/chromatic-wave/index.tsx",+ "content": "\"use client\";\n\nimport { useId } from \"react\";\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChromaticWaveProps {\n className?: string;\n width?: number;\n height?: number;\n headline?: string;\n kicker?: string;\n headlineFontFamily?: string;\n kickerFontFamily?: string;\n headlineFontSize?: number;\n kickerFontSize?: number;\n kickerTracking?: number;\n headlineBaselineY?: number;\n kickerBaselines?: [number, number];\n textCenterX?: number;\n fill?: string;\n background?: string;\n bandHeight?: number;\n bandCopies?: number;\n bandPitch?: number;\n mapStartY?: number;\n mapEndY?: number;\n mapTravelFrames?: number;\n waveHeight?: number;\n waveWidth?: number;\n waveSpeed?: number;\n turbulentAmount?: number;\n turbulentSize?: number;\n evolutionPerSecond?: number;\n mapBlurRadius?: number;\n mapBlurIterations?: number;\n glassDisplacement?: number;\n maxDisplacementPx?: number;\n glassPasses?: number;\n channelOrder?: (\"red\" | \"green\" | \"blue\")[];\n}\n\nfunction boxBlurSigma(radius: number, iterations: number): number {\n const w = 2 * radius + 1;\n return Math.sqrt((iterations * (w * w - 1)) / 12);\n}\n\nfunction buildMapUri({\n width,\n height,\n bandHeight,\n bandCopies,\n bandPitch,\n mapY,\n waveHeight,\n waveWidth,\n phase,\n}: {\n width: number;\n height: number;\n bandHeight: number;\n bandCopies: number;\n bandPitch: number;\n mapY: number;\n waveHeight: number;\n waveWidth: number;\n phase: number;\n}): string {\n const overhang = 120;\n const segments = 48;\n\n const bands = Array.from({ length: bandCopies }, (_, i) => {\n const top = mapY + i * bandPitch - bandHeight / 2;\n const pts = Array.from({ length: segments + 1 }, (_, s) => {\n const x = -overhang + (s / segments) * (width + overhang * 2);\n const y =\n top + Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;\n return `${x},${y}`;\n });\n const back = Array.from({ length: segments + 1 }, (_, s) => {\n const x = -overhang + ((segments - s) / segments) * (width + overhang * 2);\n const y =\n top +\n bandHeight +\n Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;\n return `${x},${y}`;\n });\n return `<path d=\"M${pts.join(\"L\")}L${back.join(\"L\")}Z\" fill=\"url(#g)\"/>`;\n }).join(\"\");\n\n const svg =\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${width}\" height=\"${height}\">` +\n `<defs><linearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">` +\n `<stop offset=\"0\" stop-color=\"rgb(128,128,128)\"/>` +\n `<stop offset=\"0.25\" stop-color=\"rgb(0,0,0)\"/>` +\n `<stop offset=\"0.5\" stop-color=\"rgb(128,128,128)\"/>` +\n `<stop offset=\"0.75\" stop-color=\"rgb(255,255,255)\"/>` +\n `<stop offset=\"1\" stop-color=\"rgb(128,128,128)\"/>` +\n `</linearGradient></defs>` +\n `<rect width=\"${width}\" height=\"${height}\" fill=\"rgb(128,128,128)\"/>` +\n bands +\n `</svg>`;\n\n return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;\n}\n\nexport function ChromaticWave({\n className,\n width = 1920,\n height = 1080,\n headline = \"MUSIC\",\n kicker = \"APPLES\",\n headlineFontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n kickerFontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n headlineFontSize = 174,\n kickerFontSize = 52,\n kickerTracking = 32,\n headlineBaselineY = 601,\n kickerBaselines = [444, 670],\n textCenterX = 960,\n fill = \"#ffffff\",\n background = \"#000000\",\n bandHeight = 147.1,\n bandCopies = 7,\n bandPitch = 750,\n mapStartY = 31,\n mapEndY = 1560,\n mapTravelFrames = 150,\n waveHeight = 28,\n waveWidth = 272,\n waveSpeed = 1,\n turbulentAmount = 130,\n turbulentSize = 163,\n evolutionPerSecond = 50,\n mapBlurRadius = 13,\n mapBlurIterations = 6,\n glassDisplacement = 100,\n maxDisplacementPx = 39,\n glassPasses = 3,\n channelOrder = [\"blue\", \"green\", \"red\"],\n}: ChromaticWaveProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const filterId = useId();\n const seconds = frame / fps;\n\n const mapY = interpolate(frame, [0, mapTravelFrames], [mapStartY, mapEndY], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const mapUri = buildMapUri({\n width,\n height,\n bandHeight,\n bandCopies,\n bandPitch,\n mapY,\n waveHeight,\n waveWidth,\n phase: seconds * waveSpeed * Math.PI * 2,\n });\n\n const mapSigma = boxBlurSigma(mapBlurRadius, mapBlurIterations);\n const evolution = seconds * evolutionPerSecond;\n\n const channelMatrix: Record<string, string> = {\n red: \"1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n green: \"0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0\",\n blue: \"0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0\",\n };\n\n const content = (\n <>\n <text\n x={textCenterX}\n y={kickerBaselines[0]}\n textAnchor=\"middle\"\n fontFamily={kickerFontFamily}\n fontSize={kickerFontSize}\n letterSpacing={kickerTracking}\n fill={fill}\n >\n {kicker}\n </text>\n <text\n x={textCenterX}\n y={headlineBaselineY}\n textAnchor=\"middle\"\n fontFamily={headlineFontFamily}\n fontWeight={700}\n fontSize={headlineFontSize}\n fill={fill}\n >\n {headline}\n </text>\n <text\n x={textCenterX}\n y={kickerBaselines[1]}\n textAnchor=\"middle\"\n fontFamily={kickerFontFamily}\n fontSize={kickerFontSize}\n letterSpacing={kickerTracking}\n fill={fill}\n >\n {kicker}\n </text>\n </>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <defs>\n {Array.from({ length: glassPasses }, (_, i) => {\n const depth =\n ((i + 1) / glassPasses) *\n maxDisplacementPx *\n (glassDisplacement / 100);\n return (\n <filter\n key={channelOrder[i] ?? i}\n id={`${filterId}-${i}`}\n filterUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width={width}\n height={height}\n colorInterpolationFilters=\"sRGB\"\n >\n <feImage\n href={mapUri}\n x=\"0\"\n y=\"0\"\n width={width}\n height={height}\n result=\"rawMap\"\n />\n <feTurbulence\n type=\"turbulence\"\n baseFrequency={1 / Math.max(turbulentSize, 1)}\n numOctaves={1}\n seed={11}\n result=\"noise\"\n />\n <feOffset\n in=\"noise\"\n dx={evolution}\n dy={evolution * 0.4}\n result=\"noiseMoved\"\n />\n <feDisplacementMap\n in=\"rawMap\"\n in2=\"noiseMoved\"\n scale={turbulentAmount}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n result=\"turbulentMap\"\n />\n <feGaussianBlur\n in=\"turbulentMap\"\n stdDeviation={mapSigma}\n result=\"slopeMap\"\n />\n <feDisplacementMap\n in=\"SourceGraphic\"\n in2=\"slopeMap\"\n scale={depth}\n xChannelSelector=\"R\"\n yChannelSelector=\"R\"\n result=\"displaced\"\n />\n <feColorMatrix\n in=\"displaced\"\n type=\"matrix\"\n values={channelMatrix[channelOrder[i] ?? \"red\"]}\n />\n </filter>\n );\n })}\n </defs>\n\n <rect width={width} height={height} fill={background} />\n\n {Array.from({ length: glassPasses }, (_, i) => (\n <g\n key={channelOrder[i] ?? i}\n filter={`url(#${filterId}-${i})`}\n style={{ mixBlendMode: \"screen\" }}\n >\n {content}\n </g>\n ))}\n </svg>\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/chromatic-wave.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/extrude-pop.json b/registry-artifacts/extrude-pop.jsonnew file mode 100644index 00000000..575aacc2--- /dev/null+++ b/registry-artifacts/extrude-pop.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "extrude-pop",+ "title": "Extrude Pop",+ "description": "A flat word pops up out of the plane on a solid colored 3D body, no camera involved.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/extrude-pop/index.tsx",+ "content": "\"use client\";\n\nimport { useMemo } from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ExtrudePopProps {\n className?: string;\n width?: number;\n height?: number;\n letter?: string;\n fontFamily?: string;\n fontWeight?: number | string;\n fontSize?: number;\n basePosition?: [number, number];\n maxTextWidth?: number;\n minimaxRadius?: number;\n extrudeAngleDeg?: number;\n extrudeSteps?: number;\n extrudeStartFrame?: number;\n extrudeEndFrame?: number;\n bodyColor?: string;\n faceColor?: string;\n}\n\nexport function ExtrudePop({\n className,\n width = 1920,\n height = 1080,\n letter = \"WIN\",\n fontFamily = \"'Helvetica Neue', Helvetica, Arial, sans-serif\",\n fontWeight = 700,\n fontSize = 603,\n basePosition = [959.2, 752.5],\n maxTextWidth = 1660,\n minimaxRadius = 80,\n extrudeAngleDeg = -58.6,\n extrudeSteps = 200,\n extrudeStartFrame = 0,\n extrudeEndFrame = 48,\n bodyColor = \"#e8192b\",\n faceColor = \"#ffffff\",\n}: ExtrudePopProps) {\n const frame = useCurrentFrame();\n\n const fit = useMemo(() => {\n if (typeof document === \"undefined\") return 1;\n const ctx = document.createElement(\"canvas\").getContext(\"2d\");\n if (!ctx) return 1;\n ctx.font = `${fontWeight} ${fontSize}px ${fontFamily}`;\n const measured = ctx.measureText(letter).width;\n if (measured <= 0) return 1;\n return Math.min(1, maxTextWidth / measured);\n }, [letter, fontFamily, fontWeight, fontSize, maxTextWidth]);\n\n const fitFontSize = fontSize * fit;\n const fitRadius = minimaxRadius * fit;\n\n const radius = interpolate(\n frame,\n [extrudeStartFrame, extrudeEndFrame],\n [0, fitRadius],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.16, 1, 0.3, 1),\n },\n );\n\n const depth = radius * 2;\n\n const theta = (extrudeAngleDeg * Math.PI) / 180;\n const stepX = (depth * Math.sin(theta)) / extrudeSteps;\n const stepY = (depth * Math.cos(theta)) / extrudeSteps;\n\n const glyph = (fill: string, dx: number, dy: number, key?: string) => (\n <text\n key={key}\n x={basePosition[0] + dx}\n y={basePosition[1] + dy}\n textAnchor=\"middle\"\n fontFamily={fontFamily}\n fontWeight={fontWeight}\n fontSize={fitFontSize}\n fill={fill}\n >\n {letter}\n </text>\n );\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <g>\n {Array.from(\n { length: extrudeSteps + 1 },\n (_, i) => extrudeSteps - i,\n ).map((i) => glyph(bodyColor, stepX * i, stepY * i, `body-${i}`))}\n </g>\n\n {glyph(faceColor, stepX * extrudeSteps, stepY * extrudeSteps)}\n </svg>\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/extrude-pop.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/gooey-morph.json b/registry-artifacts/gooey-morph.jsonnew file mode 100644index 00000000..9b8aa219--- /dev/null+++ b/registry-artifacts/gooey-morph.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "gooey-morph",+ "title": "Gooey Morph",+ "description": "Bars fly in Tetris-style, land as a row, and melt into a word through a gooey blur-and-threshold morph.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/gooey-morph/index.tsx",+ "content": "\"use client\";\n\nimport { useId } from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface GooeyMorphProps {\n className?: string;\n width?: number;\n height?: number;\n barWidth?: number;\n barHeight?: number;\n barStartPositions?: [number, number][];\n barRestPositions?: [number, number][];\n barEntryFrames?: number[];\n barTravelFrames?: number;\n word?: string;\n fontFamily?: string;\n fontSize?: number;\n tracking?: number;\n wordCenterX?: number;\n wordBaselineY?: number;\n blurRadius?: number;\n blurIterations?: number;\n alphaInputBlack?: number;\n alphaInputWhite?: number;\n morphStartFrame?: number;\n morphPeakFrame?: number;\n morphEndFrame?: number;\n displaceAmount?: number;\n displaceSize?: number;\n displaceComplexity?: number;\n displaceEvolutionPerSecond?: number;\n fill?: string;\n}\n\nfunction boxBlurSigma(radius: number, iterations: number): number {\n const w = 2 * radius + 1;\n return Math.sqrt((iterations * (w * w - 1)) / 12);\n}\n\nexport function GooeyMorph({\n className,\n width = 1920,\n height = 1080,\n barWidth = 213,\n barHeight = 181,\n barStartPositions = [\n [956.9, 764.9],\n [297.5, 799.9],\n [738.2, 257.9],\n [1617.9, 302.9],\n ],\n barRestPositions = [\n [634.9, 538.9],\n [852.5, 538.9],\n [1070.2, 538.9],\n [1287.9, 538.9],\n ],\n barEntryFrames = [8, 0, 4, 13],\n barTravelFrames = 30,\n word = \"HELLO\",\n fontFamily = \"sans-serif\",\n fontSize = 237,\n tracking = 0,\n wordCenterX = 961.4,\n wordBaselineY = 601.3,\n blurRadius = 6,\n blurIterations = 6,\n alphaInputBlack = 0.4588,\n alphaInputWhite = 0.5098,\n morphStartFrame = 50,\n morphPeakFrame = 63,\n morphEndFrame = 76,\n displaceAmount = 20,\n displaceSize = 19,\n displaceComplexity = 1,\n displaceEvolutionPerSecond = 50,\n fill = \"#ffffff\",\n}: GooeyMorphProps) {\n const frame = useCurrentFrame();\n const filterId = useId();\n\n const travelEase = Easing.bezier(0.88, 0.14, 0.12, 0.86);\n\n const morphWindow: [number, number, number] = [\n morphStartFrame,\n morphPeakFrame,\n morphEndFrame,\n ];\n\n const blur = interpolate(frame, morphWindow, [0, blurRadius, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.33, 0, 0.67, 1),\n });\n const sigma = boxBlurSigma(blur, blurIterations);\n\n const displaceScale = interpolate(\n frame,\n morphWindow,\n [0, displaceAmount, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.33, 0, 0.67, 1),\n },\n );\n\n const barsOpacity = interpolate(\n frame,\n [morphStartFrame, morphEndFrame],\n [1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n const wordOpacity = interpolate(\n frame,\n [morphStartFrame, morphEndFrame],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const slope = 1 / Math.max(alphaInputWhite - alphaInputBlack, 1e-6);\n const offset = -alphaInputBlack * slope;\n\n const evolution = (frame / 30) * displaceEvolutionPerSecond;\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n <defs>\n <filter\n id={filterId}\n x=\"-15%\"\n y=\"-15%\"\n width=\"130%\"\n height=\"130%\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation={sigma}\n result=\"blurred\"\n />\n <feColorMatrix\n in=\"blurred\"\n type=\"matrix\"\n values={[\n \"1 0 0 0 0\",\n \"0 1 0 0 0\",\n \"0 0 1 0 0\",\n `0 0 0 ${slope} ${offset}`,\n ].join(\" \")}\n result=\"threshold\"\n />\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={1 / Math.max(displaceSize, 1)}\n numOctaves={Math.max(1, Math.round(displaceComplexity))}\n seed={7}\n result=\"noise\"\n />\n <feOffset\n in=\"noise\"\n dx={evolution}\n dy={evolution * 0.6}\n result=\"noiseMoved\"\n />\n <feDisplacementMap\n in=\"threshold\"\n in2=\"noiseMoved\"\n scale={displaceScale}\n xChannelSelector=\"R\"\n yChannelSelector=\"G\"\n />\n </filter>\n </defs>\n\n <g filter={`url(#${filterId})`}>\n <g opacity={barsOpacity}>\n {barRestPositions.map((rest, i) => {\n const start = barStartPositions[i] ?? rest;\n const entry = barEntryFrames[i] ?? 0;\n const local = frame - entry;\n const stops = [0, barTravelFrames / 2, barTravelFrames];\n\n const x = interpolate(\n local,\n stops,\n [start[0], rest[0], rest[0]],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEase,\n },\n );\n const y = interpolate(\n local,\n stops,\n [start[1], start[1], rest[1]],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: travelEase,\n },\n );\n\n return (\n <rect\n key={rest.join(\",\")}\n x={x - barWidth / 2}\n y={y - barHeight / 2}\n width={barWidth}\n height={barHeight}\n fill={fill}\n />\n );\n })}\n </g>\n\n <text\n x={wordCenterX}\n y={wordBaselineY}\n textAnchor=\"middle\"\n fontFamily={fontFamily}\n fontSize={fontSize}\n fontWeight={900}\n letterSpacing={tracking}\n fill={fill}\n opacity={wordOpacity}\n >\n {word}\n </text>\n </g>\n </svg>\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/gooey-morph.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/kinetic-warp.json b/registry-artifacts/kinetic-warp.jsonnew file mode 100644index 00000000..8830bc60--- /dev/null+++ b/registry-artifacts/kinetic-warp.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "kinetic-warp",+ "title": "Kinetic Warp",+ "description": "A coarse mesh warp bends a whole word in staccato beats, one axis per keyframe.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/kinetic-warp/index.tsx",+ "content": "\"use client\";\n\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport {\n continueRender,\n delayRender,\n Easing,\n interpolate,\n useCurrentFrame,\n} from \"remotion\";\n\nexport interface KineticWarpProps {\n className?: string;\n compWidth?: number;\n compHeight?: number;\n textColor?: string;\n text?: string;\n fontFamily?: string;\n fontUrl?: string;\n fontWeight?: number;\n fontSize?: number;\n leading?: number;\n tracking?: number;\n layerScale?: number;\n positionX?: number;\n positionY?: number;\n meshRows?: number;\n meshColumns?: number;\n colRestX?: number;\n colRightX?: number;\n colLeftX?: number;\n rowRestY?: number;\n rowDownY?: number;\n rowUpY?: number;\n keyframeStride?: number;\n easingBezier?: [number, number, number, number];\n resampleStep?: number;\n}\n\nfunction monotoneSpline(xs: number[], ys: number[]): (x: number) => number {\n const n = xs.length;\n const dx: number[] = [];\n const secant: number[] = [];\n for (let i = 0; i < n - 1; i++) {\n dx.push(xs[i + 1] - xs[i]);\n secant.push((ys[i + 1] - ys[i]) / (xs[i + 1] - xs[i]));\n }\n\n const m: number[] = new Array(n);\n m[0] = secant[0];\n m[n - 1] = secant[n - 2];\n for (let i = 1; i < n - 1; i++) {\n m[i] = secant[i - 1] * secant[i] <= 0 ? 0 : (secant[i - 1] + secant[i]) / 2;\n }\n\n for (let i = 0; i < n - 1; i++) {\n if (secant[i] === 0) {\n m[i] = 0;\n m[i + 1] = 0;\n continue;\n }\n const a = m[i] / secant[i];\n const b = m[i + 1] / secant[i];\n const s = a * a + b * b;\n if (s > 9) {\n const t = 3 / Math.sqrt(s);\n m[i] = t * a * secant[i];\n m[i + 1] = t * b * secant[i];\n }\n }\n\n return (x: number) => {\n if (x <= xs[0]) return ys[0] + m[0] * (x - xs[0]);\n if (x >= xs[n - 1]) return ys[n - 1] + m[n - 1] * (x - xs[n - 1]);\n let i = n - 2;\n while (i > 0 && x < xs[i]) i--;\n const h = dx[i];\n const t = (x - xs[i]) / h;\n const t2 = t * t;\n const t3 = t2 * t;\n return (\n (2 * t3 - 3 * t2 + 1) * ys[i] +\n (t3 - 2 * t2 + t) * h * m[i] +\n (-2 * t3 + 3 * t2) * ys[i + 1] +\n (t3 - t2) * h * m[i + 1]\n );\n };\n}\n\nexport function KineticWarp({\n className,\n compWidth = 1920,\n compHeight = 1080,\n textColor = \"#FFFFFF\",\n text = \"REM\\nOCN\",\n fontFamily = \"sans-serif\",\n fontUrl = \"\",\n fontWeight = 700,\n fontSize = 107.1,\n leading = 70,\n tracking = -21,\n layerScale = 480,\n positionX = 960,\n positionY = 540,\n meshRows = 2,\n meshColumns = 4,\n colRestX = 960,\n colRightX = 1255,\n colLeftX = 678,\n rowRestY = 540,\n rowDownY = 850,\n rowUpY = 387,\n keyframeStride = 20,\n easingBezier = [0.3, 0.74, 0.09, 1],\n resampleStep = 4,\n}: KineticWarpProps) {\n const frame = useCurrentFrame();\n const canvasRef = useRef<HTMLCanvasElement | null>(null);\n const [fontReady, setFontReady] = useState(false);\n\n const scale = layerScale / 100;\n const pxSize = fontSize * scale;\n const pxLeading = leading * scale;\n const pxTracking = (tracking / 1000) * pxSize;\n\n useEffect(() => {\n const handle = delayRender(\"kinetic-warp: loading font\");\n let cancelled = false;\n const done = () => {\n if (!cancelled) setFontReady(true);\n continueRender(handle);\n };\n if (typeof document === \"undefined\" || !document.fonts) {\n done();\n return;\n }\n document.fonts\n .load(`${fontWeight} ${pxSize}px \"${fontFamily}\"`)\n .then(done, done);\n return () => {\n cancelled = true;\n };\n }, [fontFamily, fontWeight, pxSize]);\n\n const source = useMemo(() => {\n if (!fontReady || typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = compWidth;\n canvas.height = compHeight;\n const ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n\n ctx.font = `${fontWeight} ${pxSize}px \"${fontFamily}\", sans-serif`;\n ctx.letterSpacing = `${pxTracking}px`;\n ctx.fillStyle = textColor;\n ctx.textAlign = \"left\";\n ctx.textBaseline = \"alphabetic\";\n\n const lines = text.split(\"\\n\");\n const metrics = lines.map((line) => ctx.measureText(line));\n\n const ascent = metrics[0].actualBoundingBoxAscent;\n const descent = metrics[metrics.length - 1].actualBoundingBoxDescent;\n const span = (lines.length - 1) * pxLeading;\n const firstBaseline = positionY - (span - ascent + descent) / 2;\n\n lines.forEach((line, i) => {\n const m = metrics[i];\n const x =\n positionX - (m.actualBoundingBoxRight - m.actualBoundingBoxLeft) / 2;\n ctx.fillText(line, x, firstBaseline + i * pxLeading);\n });\n\n return canvas;\n }, [\n compWidth,\n compHeight,\n text,\n fontFamily,\n fontWeight,\n pxSize,\n pxLeading,\n pxTracking,\n textColor,\n positionX,\n positionY,\n fontReady,\n ]);\n\n const scratch = useMemo(() => {\n if (typeof document === \"undefined\") return null;\n const canvas = document.createElement(\"canvas\");\n canvas.width = compWidth;\n canvas.height = compHeight;\n return canvas;\n }, [compWidth, compHeight]);\n\n const easing = Easing.bezier(...easingBezier);\n const stops = [0, 1, 2, 3, 4, 5].map((i) => i * keyframeStride);\n const clamp = {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n } as const;\n\n const colX = interpolate(\n frame,\n stops,\n [colRestX, colRightX, colRightX, colLeftX, colLeftX, colRestX],\n clamp,\n );\n const rowY = interpolate(\n frame,\n stops,\n [rowRestY, rowRestY, rowDownY, rowDownY, rowUpY, rowRestY],\n clamp,\n );\n\n useEffect(() => {\n const canvas = canvasRef.current;\n if (!canvas || !source || !scratch) return;\n const out = canvas.getContext(\"2d\");\n const mid = scratch.getContext(\"2d\");\n if (!out || !mid) return;\n\n const xs = Array.from(\n { length: meshColumns + 1 },\n (_, i) => (i * compWidth) / meshColumns,\n );\n const ys = Array.from(\n { length: meshRows + 1 },\n (_, i) => (i * compHeight) / meshRows,\n );\n const xd = xs.slice();\n const yd = ys.slice();\n xd[Math.round(meshColumns / 2)] = colX;\n yd[Math.round(meshRows / 2)] = rowY;\n\n const gx = monotoneSpline(xd, xs);\n const gy = monotoneSpline(yd, ys);\n\n mid.clearRect(0, 0, compWidth, compHeight);\n out.clearRect(0, 0, compWidth, compHeight);\n\n for (let d0 = 0; d0 < compWidth; d0 += resampleStep) {\n const d1 = Math.min(d0 + resampleStep, compWidth);\n const s0 = gx(d0);\n const sw = gx(d1) - s0;\n if (sw <= 0) continue;\n mid.drawImage(source, s0, 0, sw, compHeight, d0, 0, d1 - d0, compHeight);\n }\n\n for (let d0 = 0; d0 < compHeight; d0 += resampleStep) {\n const d1 = Math.min(d0 + resampleStep, compHeight);\n const s0 = gy(d0);\n const sh = gy(d1) - s0;\n if (sh <= 0) continue;\n out.drawImage(scratch, 0, s0, compWidth, sh, 0, d0, compWidth, d1 - d0);\n }\n }, [\n source,\n scratch,\n colX,\n rowY,\n compWidth,\n compHeight,\n meshRows,\n meshColumns,\n resampleStep,\n ]);\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n {fontUrl ? <link rel=\"stylesheet\" href={fontUrl} /> : null}\n <canvas\n ref={canvasRef}\n width={compWidth}\n height={compHeight}\n style={{ width: \"100%\", height: \"100%\", display: \"block\" }}\n />\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/kinetic-warp.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/lens-zoom.json b/registry-artifacts/lens-zoom.jsonnew file mode 100644index 00000000..aa17711c--- /dev/null+++ b/registry-artifacts/lens-zoom.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "lens-zoom",+ "title": "Lens Zoom",+ "description": "A hard cut disguised as a lens punch-in: barrel distortion, zoom blur, chromatic split and camera shake around the splice.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "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({ length: samples }, (_, j) =>\n Math.pow(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 key={key} style={{ position: \"absolute\", inset: 0, opacity: alpha }}>\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> = ({ children, presentationDirection, presentationProgress, passedProps }) => {\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"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/perspective-squeeze.json b/registry-artifacts/perspective-squeeze.jsonnew file mode 100644index 00000000..eec59955--- /dev/null+++ b/registry-artifacts/perspective-squeeze.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "perspective-squeeze",+ "title": "Perspective Squeeze",+ "description": "Two lines of heavy type endlessly trade height while corner-pinned perspective bends the flat stack into receding planes.",+ "dependencies": ["remotion"],+ "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",+ "type": "registry:component",+ "target": "components/remocn/perspective-squeeze.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.jsonindex 3386f25a..cacc89da 100644--- a/registry-artifacts/registry.json+++ b/registry-artifacts/registry.json@@ -129,6 +129,20 @@],"type": "registry:component"},+ {+ "name": "lens-zoom",+ "title": "Lens Zoom",+ "description": "A hard cut disguised as a lens punch-in: barrel distortion, zoom blur, chromatic split and camera shake around the splice.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/lens-zoom/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/lens-zoom.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "line-by-line-slide","title": "Line-by-Line Slide",@@ -157,6 +171,20 @@],"type": "registry:component"},+ {+ "name": "extrude-pop",+ "title": "Extrude Pop",+ "description": "A flat word pops up out of the plane on a solid colored 3D body, no camera involved.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/extrude-pop/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/extrude-pop.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "fade-through","title": "Fade Through",@@ -213,6 +241,20 @@],"type": "registry:component"},+ {+ "name": "kinetic-warp",+ "title": "Kinetic Warp",+ "description": "A coarse mesh warp bends a whole word in staccato beats, one axis per keyframe.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/kinetic-warp/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/kinetic-warp.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "kinetic-center-build","title": "Kinetic Center Build",@@ -270,6 +312,20 @@],"type": "registry:component"},+ {+ "name": "stretch-in",+ "title": "Stretch In",+ "description": "Letters fly in from off-canvas and smear horizontally on the way — a vertex-lag deformation, not a scale.",+ "dependencies": ["remotion", "opentype.js"],+ "files": [+ {+ "path": "registry/remocn/stretch-in/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/stretch-in.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "strikethrough-replace","title": "Strikethrough Replace",@@ -766,6 +822,20 @@],"type": "registry:component"},+ {+ "name": "gooey-morph",+ "title": "Gooey Morph",+ "description": "Bars fly in Tetris-style, land as a row, and melt into a word through a gooey blur-and-threshold morph.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/gooey-morph/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/gooey-morph.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "grain-dissolve","title": "Grain Dissolve",@@ -994,6 +1064,20 @@],"type": "registry:component"},+ {+ "name": "perspective-squeeze",+ "title": "Perspective Squeeze",+ "description": "Two lines of heavy type endlessly trade height while corner-pinned perspective bends the flat stack into receding planes.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/perspective-squeeze/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/perspective-squeeze.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "ecosystem-constellation","title": "Ecosystem Constellation",@@ -1199,6 +1283,20 @@],"type": "registry:component"},+ {+ "name": "chromatic-wave",+ "title": "Chromatic Wave",+ "description": "A soft wave travels down through the type; where it crosses, the letters ripple and split into RGB fringes.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/chromatic-wave/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/chromatic-wave.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "confetti","title": "Confetti",diff --git a/registry-artifacts/stretch-in.json b/registry-artifacts/stretch-in.jsonnew file mode 100644index 00000000..29eefa06--- /dev/null+++ b/registry-artifacts/stretch-in.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "stretch-in",+ "title": "Stretch In",+ "description": "Letters fly in from off-canvas and smear horizontally on the way — a vertex-lag deformation, not a scale.",+ "dependencies": ["remotion", "opentype.js"],+ "files": [+ {+ "path": "registry/remocn/stretch-in/index.tsx",+ "content": "\"use client\";\n\nimport { type Font, parse } from \"opentype.js\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport {\n continueRender,\n delayRender,\n Easing,\n interpolate,\n useCurrentFrame,\n} from \"remotion\";\n\nexport interface StretchInProps {\n className?: string;\n width?: number;\n height?: number;\n text?: string;\n fontUrl?: string;\n fontSize?: number;\n letterSpacing?: number;\n baselineY?: number;\n entryStart?: number;\n entryStagger?: number;\n travelFrames?: number;\n travelDistance?: number;\n vertexLagFrames?: number;\n curveSteps?: number;\n fill?: string;\n strokeWidth?: number;\n stroke?: string;\n}\n\ntype Contour = [number, number][];\n\nfunction flattenPath(\n commands: ReturnType<Font[\"getPath\"]>[\"commands\"],\n steps: number,\n): Contour[] {\n const contours: Contour[] = [];\n let current: Contour = [];\n let cx = 0;\n let cy = 0;\n\n for (const cmd of commands) {\n if (cmd.type === \"M\") {\n if (current.length > 0) contours.push(current);\n current = [[cmd.x, cmd.y]];\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"L\") {\n current.push([cmd.x, cmd.y]);\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"Q\") {\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const mt = 1 - t;\n current.push([\n mt * mt * cx + 2 * mt * t * cmd.x1 + t * t * cmd.x,\n mt * mt * cy + 2 * mt * t * cmd.y1 + t * t * cmd.y,\n ]);\n }\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"C\") {\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const mt = 1 - t;\n current.push([\n mt * mt * mt * cx +\n 3 * mt * mt * t * cmd.x1 +\n 3 * mt * t * t * cmd.x2 +\n t * t * t * cmd.x,\n mt * mt * mt * cy +\n 3 * mt * mt * t * cmd.y1 +\n 3 * mt * t * t * cmd.y2 +\n t * t * t * cmd.y,\n ]);\n }\n cx = cmd.x;\n cy = cmd.y;\n } else if (cmd.type === \"Z\") {\n if (current.length > 0) contours.push(current);\n current = [];\n }\n }\n if (current.length > 0) contours.push(current);\n return contours;\n}\n\nexport function StretchIn({\n className,\n width = 1920,\n height = 1080,\n text = \"REMOCN\",\n fontUrl = \"https://fonts.gstatic.com/s/anton/v27/1Ptgg87LROyAm0K0.ttf\",\n fontSize = 510,\n letterSpacing = 0,\n baselineY,\n entryStart = 0,\n entryStagger = 3,\n travelFrames = 33,\n travelDistance = 1500,\n vertexLagFrames = 3.5,\n curveSteps = 8,\n fill = \"#ffffff\",\n strokeWidth = 0,\n stroke = \"#ffffff\",\n}: StretchInProps) {\n const frame = useCurrentFrame();\n const [font, setFont] = useState<Font | null>(null);\n\n useEffect(() => {\n const handle = delayRender(\"stretch-in: loading font\");\n let cancelled = false;\n fetch(fontUrl)\n .then((res) => res.arrayBuffer())\n .then((buffer) => {\n if (!cancelled) setFont(parse(buffer));\n continueRender(handle);\n })\n .catch(() => {\n continueRender(handle);\n });\n return () => {\n cancelled = true;\n };\n }, [fontUrl]);\n\n const letters = useMemo(() => {\n if (!font) return null;\n const scale = fontSize / font.unitsPerEm;\n const glyphs = font.stringToGlyphs(text);\n let x = 0;\n const items = glyphs.map((glyph, i) => {\n if (i > 0) x += font.getKerningValue(glyphs[i - 1], glyph) * scale;\n const left = x;\n const advance = (glyph.advanceWidth ?? 0) * scale;\n const contours = flattenPath(\n glyph.getPath(x, 0, fontSize).commands,\n curveSteps,\n );\n x += advance + letterSpacing;\n return { left, width: advance, contours };\n });\n return { items, totalWidth: Math.max(0, x - letterSpacing) };\n }, [font, text, fontSize, letterSpacing, curveSteps]);\n\n if (!letters) return null;\n\n const startX = (width - letters.totalWidth) / 2;\n const resolvedBaseline = baselineY ?? (height + fontSize * 0.72) / 2;\n\n return (\n <div\n className={className}\n style={{ position: \"absolute\", inset: 0, overflow: \"hidden\" }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"xMidYMid meet\"\n style={{ display: \"block\" }}\n >\n {letters.items.map((glyph, i) => {\n const entry = entryStart + entryStagger * i;\n const run = Math.max(1, travelFrames - vertexLagFrames);\n\n const d = glyph.contours\n .map((contour) => {\n const pts = contour.map(([px, py]) => {\n const u =\n glyph.width === 0\n ? 0\n : Math.min(1, Math.max(0, (px - glyph.left) / glyph.width));\n const start = entry + u * vertexLagFrames;\n const remaining = interpolate(\n frame,\n [start, start + run],\n [1, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.2, 0.9, 0.25, 1),\n },\n );\n return [\n startX + px + travelDistance * remaining,\n resolvedBaseline + py,\n ];\n });\n return (\n `M${pts[0][0].toFixed(2)},${pts[0][1].toFixed(2)}` +\n pts\n .slice(1)\n .map((p) => `L${p[0].toFixed(2)},${p[1].toFixed(2)}`)\n .join(\"\") +\n \"Z\"\n );\n })\n .join(\" \");\n\n return (\n <path\n key={`${i}-${glyph.left}`}\n d={d}\n fill={fill}\n fillRule=\"evenodd\"\n stroke={strokeWidth > 0 ? stroke : \"none\"}\n strokeWidth={strokeWidth}\n />\n );\n })}\n </svg>\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/stretch-in.tsx"+ }+ ],+ "type": "registry:component"+}