Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: chromatic wave ;
kapishdimadc105961771c
diff --git a/content/docs/typography/chromatic-wave.mdx b/content/docs/typography/chromatic-wave.mdxnew file mode 100644index 00000000..e1a94f1a--- /dev/null+++ b/content/docs/typography/chromatic-wave.mdx@@ -0,0 +1,179 @@+---+title: Chromatic Wave+description: A soft wave travels down through the type; where it crosses, the letters ripple and split into RGB fringes, then settle back to white+component: chromatic-wave+vibe: tech+length: 150+useWhen:+ - "A held title — an album cover, a poster hold, a loop — needs slow, ambient distortion instead of a one-shot entrance."+ - "The aesthetic is music-video or vaporwave: rippling glass with red, green and blue fringes at the distortion edges."+ - "The type can sit on a dark background — the channel split sums back to white via screen blending, which is only exact over black."+avoidWhen:+ - "You need a quick glitch accent rather than a five-second traveling wave — use `rgb-glitch-text`."+ - "The background is light — the screen blend that reassembles the channels breaks over anything but dark fills."+ - "The copy changes or enters mid-scene — the type is static; this is a treatment, not a reveal; use `soft-blur-in` first."+---++<ComponentPreview name="chromatic-wave" />++## Installation++<InstallBlock name="chromatic-wave" />++## Usage++```tsx+// src/Root.tsx+import { Composition } from "remotion";+import { ChromaticWave } from "@/components/remocn/chromatic-wave";++const ChromaticWaveScene = () => (+ <ChromaticWave headline="MUSIC" kicker="APPLES" />+);++export const RemotionRoot = () => (+ <Composition+ id="ChromaticWave"+ component={ChromaticWaveScene}+ durationInFrames={100}+ fps={30}+ width={1920}+ height={1080}+ />+);+```++Three copies of the type are displaced by the same traveling wave at three+different depths — one per color channel — and summed back together with+`screen` blending. Where the copies still coincide the sum is white; where the+depths pull them apart, red, green and blue fringes appear. The component+paints its own `background` (default black) because the reassembly is only+exact over black.++## Props++<PropsTable+ rows={[+ {+ name: "headline",+ type: "string",+ default: "\"MUSIC\"",+ description: "The large center line",+ },+ {+ name: "kicker",+ type: "string",+ default: "\"APPLES\"",+ description: "The small tracked line, repeated above and below the headline",+ },+ {+ name: "headlineFontFamily / kickerFontFamily",+ type: "string",+ default: "Helvetica stack",+ description: "Fonts of the two lines",+ },+ {+ name: "headlineFontSize / kickerFontSize",+ type: "number",+ default: "174 / 52",+ description: "Font sizes in comp pixels",+ },+ {+ name: "kickerTracking",+ type: "number",+ default: "32",+ description: "Letter spacing of the kicker lines",+ },+ {+ name: "headlineBaselineY / kickerBaselines",+ type: "number / [number, number]",+ default: "601 / [444, 670]",+ description: "Baselines of the three lines in comp pixels",+ },+ {+ name: "textCenterX",+ type: "number",+ default: "960",+ description: "Horizontal center of the type",+ },+ {+ name: "fill",+ type: "string",+ default: "\"#ffffff\"",+ description: "Color of the type before the split",+ },+ {+ name: "background",+ type: "string",+ default: "\"#000000\"",+ description: "Painted stage background. Keep it dark — the channel reassembly is only exact over black",+ },+ {+ name: "width / height",+ type: "number",+ default: "1920 / 1080",+ description: "Coordinate space of the composition",+ },+ {+ name: "bandHeight / bandCopies / bandPitch",+ type: "number",+ default: "147.1 / 7 / 750",+ description: "Geometry of the traveling distortion bands",+ },+ {+ name: "mapStartY / mapEndY / mapTravelFrames",+ type: "number",+ default: "31 / 1560 / 150",+ description: "The bands' travel. Deliberately linear — an ease reads as the ripple hesitating inside the word",+ },+ {+ name: "waveHeight / waveWidth / waveSpeed",+ type: "number",+ default: "28 / 272 / 1",+ description: "The sine ripple on each band's edges",+ },+ {+ name: "turbulentAmount / turbulentSize",+ type: "number",+ default: "130 / 163",+ description: "Turbulent displacement breaking the wave's regular rhythm",+ },+ {+ name: "evolutionPerSecond",+ type: "number",+ default: "50",+ description: "How fast the turbulence field pans",+ },+ {+ name: "mapBlurRadius / mapBlurIterations",+ type: "number",+ default: "13 / 6",+ description: "Blur on the displacement map — without it the map's edges tear the output",+ },+ {+ name: "glassDisplacement / maxDisplacementPx",+ type: "number",+ default: "100 / 39",+ description: "Displacement strength, and the pixel span it maps to",+ },+ {+ name: "glassPasses",+ type: "number",+ default: "3",+ description: "How many depth passes — also how many channels split",+ },+ {+ name: "channelOrder",+ type: "(\"red\" | \"green\" | \"blue\")[]",+ default: "[\"blue\", \"green\", \"red\"]",+ description: "Which channel rides which depth, shallowest first",+ },+ {+ name: "className",+ type: "string",+ description: "Optional className passed to the wrapper",+ },+ ]}+/>++Inspired by [5 Clean Text Animations](https://www.youtube.com/watch?v=Nmi7cE2wT54) by Mapal.diff --git a/content/docs/typography/meta.json b/content/docs/typography/meta.jsonindex 3ecaabc4..8909dda8 100644--- a/content/docs/typography/meta.json+++ b/content/docs/typography/meta.json@@ -43,6 +43,7 @@"rgb-glitch-text","gooey-morph","perspective-squeeze",- "extrude-pop"+ "extrude-pop",+ "chromatic-wave"]}diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 62de49cc..57796ec2 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -318,6 +318,16 @@ const registry: Record<string, RegistryEntry> = {(m) => m.gooeyMorphConfig,),},+ "chromatic-wave": {+ load: () =>+ import("@/registry/remocn/chromatic-wave").then((m) => ({+ default: m.ChromaticWave,+ })),+ loadConfig: () =>+ import("@/registry/remocn/chromatic-wave/config").then(+ (m) => m.chromaticWaveConfig,+ ),+ },"extrude-pop": {load: () =>import("@/registry/remocn/extrude-pop").then((m) => ({diff --git a/registry/remocn/chromatic-wave/config.ts b/registry/remocn/chromatic-wave/config.tsnew file mode 100644index 00000000..b16b17e5--- /dev/null+++ b/registry/remocn/chromatic-wave/config.ts@@ -0,0 +1,39 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const chromaticWaveConfig: ComponentConfig = {+ componentName: "ChromaticWave",+ importPath: "@/components/remocn/chromatic-wave",+ controls: {+ headline: { type: "text", default: "MUSIC", label: "Headline" },+ kicker: { type: "text", default: "APPLES", label: "Kicker" },+ fill: { type: "color", default: "#ffffff", label: "Fill" },+ waveHeight: {+ type: "number",+ default: 28,+ min: 0,+ max: 40,+ step: 1,+ label: "Wave height",+ },+ maxDisplacementPx: {+ type: "number",+ default: 39,+ min: 0,+ max: 60,+ step: 1,+ label: "Displacement (px)",+ },+ turbulentAmount: {+ type: "number",+ default: 130,+ min: 0,+ max: 200,+ step: 2,+ label: "Turbulence",+ },+ },+ durationInFrames: 100,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/chromatic-wave/index.tsx b/registry/remocn/chromatic-wave/index.tsxnew file mode 100644index 00000000..41c3f5dd--- /dev/null+++ b/registry/remocn/chromatic-wave/index.tsx@@ -0,0 +1,305 @@+"use client";++import { useId } from "react";+import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";++export interface ChromaticWaveProps {+ className?: string;+ width?: number;+ height?: number;+ headline?: string;+ kicker?: string;+ headlineFontFamily?: string;+ kickerFontFamily?: string;+ headlineFontSize?: number;+ kickerFontSize?: number;+ kickerTracking?: number;+ headlineBaselineY?: number;+ kickerBaselines?: [number, number];+ textCenterX?: number;+ fill?: string;+ background?: string;+ bandHeight?: number;+ bandCopies?: number;+ bandPitch?: number;+ mapStartY?: number;+ mapEndY?: number;+ mapTravelFrames?: number;+ waveHeight?: number;+ waveWidth?: number;+ waveSpeed?: number;+ turbulentAmount?: number;+ turbulentSize?: number;+ evolutionPerSecond?: number;+ mapBlurRadius?: number;+ mapBlurIterations?: number;+ glassDisplacement?: number;+ maxDisplacementPx?: number;+ glassPasses?: number;+ channelOrder?: ("red" | "green" | "blue")[];+}++function boxBlurSigma(radius: number, iterations: number): number {+ const w = 2 * radius + 1;+ return Math.sqrt((iterations * (w * w - 1)) / 12);+}++function buildMapUri({+ width,+ height,+ bandHeight,+ bandCopies,+ bandPitch,+ mapY,+ waveHeight,+ waveWidth,+ phase,+}: {+ width: number;+ height: number;+ bandHeight: number;+ bandCopies: number;+ bandPitch: number;+ mapY: number;+ waveHeight: number;+ waveWidth: number;+ phase: number;+}): string {+ const overhang = 120;+ const segments = 48;++ const bands = Array.from({ length: bandCopies }, (_, i) => {+ const top = mapY + i * bandPitch - bandHeight / 2;+ const pts = Array.from({ length: segments + 1 }, (_, s) => {+ const x = -overhang + (s / segments) * (width + overhang * 2);+ const y =+ top + Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;+ return `${x},${y}`;+ });+ const back = Array.from({ length: segments + 1 }, (_, s) => {+ const x = -overhang + ((segments - s) / segments) * (width + overhang * 2);+ const y =+ top ++ bandHeight ++ Math.sin((x / waveWidth) * Math.PI * 2 + phase) * waveHeight;+ return `${x},${y}`;+ });+ return `<path d="M${pts.join("L")}L${back.join("L")}Z" fill="url(#g)"/>`;+ }).join("");++ const svg =+ `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}">` ++ `<defs><linearGradient id="g" x1="0" y1="0" x2="0" y2="1">` ++ `<stop offset="0" stop-color="rgb(128,128,128)"/>` ++ `<stop offset="0.25" stop-color="rgb(0,0,0)"/>` ++ `<stop offset="0.5" stop-color="rgb(128,128,128)"/>` ++ `<stop offset="0.75" stop-color="rgb(255,255,255)"/>` ++ `<stop offset="1" stop-color="rgb(128,128,128)"/>` ++ `</linearGradient></defs>` ++ `<rect width="${width}" height="${height}" fill="rgb(128,128,128)"/>` ++ bands ++ `</svg>`;++ return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}`;+}++export function ChromaticWave({+ className,+ width = 1920,+ height = 1080,+ headline = "MUSIC",+ kicker = "APPLES",+ headlineFontFamily = "'Helvetica Neue', Helvetica, Arial, sans-serif",+ kickerFontFamily = "'Helvetica Neue', Helvetica, Arial, sans-serif",+ headlineFontSize = 174,+ kickerFontSize = 52,+ kickerTracking = 32,+ headlineBaselineY = 601,+ kickerBaselines = [444, 670],+ textCenterX = 960,+ fill = "#ffffff",+ background = "#000000",+ bandHeight = 147.1,+ bandCopies = 7,+ bandPitch = 750,+ mapStartY = 31,+ mapEndY = 1560,+ mapTravelFrames = 150,+ waveHeight = 28,+ waveWidth = 272,+ waveSpeed = 1,+ turbulentAmount = 130,+ turbulentSize = 163,+ evolutionPerSecond = 50,+ mapBlurRadius = 13,+ mapBlurIterations = 6,+ glassDisplacement = 100,+ maxDisplacementPx = 39,+ glassPasses = 3,+ channelOrder = ["blue", "green", "red"],+}: ChromaticWaveProps) {+ const frame = useCurrentFrame();+ const { fps } = useVideoConfig();+ const filterId = useId();+ const seconds = frame / fps;++ const mapY = interpolate(frame, [0, mapTravelFrames], [mapStartY, mapEndY], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ });++ const mapUri = buildMapUri({+ width,+ height,+ bandHeight,+ bandCopies,+ bandPitch,+ mapY,+ waveHeight,+ waveWidth,+ phase: seconds * waveSpeed * Math.PI * 2,+ });++ const mapSigma = boxBlurSigma(mapBlurRadius, mapBlurIterations);+ const evolution = seconds * evolutionPerSecond;++ const channelMatrix: Record<string, string> = {+ red: "1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0",+ green: "0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0",+ blue: "0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 1 0",+ };++ const content = (+ <>+ <text+ x={textCenterX}+ y={kickerBaselines[0]}+ textAnchor="middle"+ fontFamily={kickerFontFamily}+ fontSize={kickerFontSize}+ letterSpacing={kickerTracking}+ fill={fill}+ >+ {kicker}+ </text>+ <text+ x={textCenterX}+ y={headlineBaselineY}+ textAnchor="middle"+ fontFamily={headlineFontFamily}+ fontWeight={700}+ fontSize={headlineFontSize}+ fill={fill}+ >+ {headline}+ </text>+ <text+ x={textCenterX}+ y={kickerBaselines[1]}+ textAnchor="middle"+ fontFamily={kickerFontFamily}+ fontSize={kickerFontSize}+ letterSpacing={kickerTracking}+ fill={fill}+ >+ {kicker}+ </text>+ </>+ );++ return (+ <div+ className={className}+ style={{ position: "absolute", inset: 0, overflow: "hidden" }}+ >+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ preserveAspectRatio="xMidYMid meet"+ style={{ display: "block" }}+ >+ <defs>+ {Array.from({ length: glassPasses }, (_, i) => {+ const depth =+ ((i + 1) / glassPasses) *+ maxDisplacementPx *+ (glassDisplacement / 100);+ return (+ <filter+ key={channelOrder[i] ?? i}+ id={`${filterId}-${i}`}+ filterUnits="userSpaceOnUse"+ x="0"+ y="0"+ width={width}+ height={height}+ colorInterpolationFilters="sRGB"+ >+ <feImage+ href={mapUri}+ x="0"+ y="0"+ width={width}+ height={height}+ result="rawMap"+ />+ <feTurbulence+ type="turbulence"+ baseFrequency={1 / Math.max(turbulentSize, 1)}+ numOctaves={1}+ seed={11}+ result="noise"+ />+ <feOffset+ in="noise"+ dx={evolution}+ dy={evolution * 0.4}+ result="noiseMoved"+ />+ <feDisplacementMap+ in="rawMap"+ in2="noiseMoved"+ scale={turbulentAmount}+ xChannelSelector="R"+ yChannelSelector="G"+ result="turbulentMap"+ />+ <feGaussianBlur+ in="turbulentMap"+ stdDeviation={mapSigma}+ result="slopeMap"+ />+ <feDisplacementMap+ in="SourceGraphic"+ in2="slopeMap"+ scale={depth}+ xChannelSelector="R"+ yChannelSelector="R"+ result="displaced"+ />+ <feColorMatrix+ in="displaced"+ type="matrix"+ values={channelMatrix[channelOrder[i] ?? "red"]}+ />+ </filter>+ );+ })}+ </defs>++ <rect width={width} height={height} fill={background} />++ {Array.from({ length: glassPasses }, (_, i) => (+ <g+ key={channelOrder[i] ?? i}+ filter={`url(#${filterId}-${i})`}+ style={{ mixBlendMode: "screen" }}+ >+ {content}+ </g>+ ))}+ </svg>+ </div>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 8a7a1a12..226fdcc2 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -1269,6 +1269,20 @@}]},+ {+ "name": "chromatic-wave",+ "type": "registry:component",+ "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": "chromatic-wave/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/chromatic-wave.tsx"+ }+ ]+ },{"name": "confetti","type": "registry:component",