Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
Add kinetic text, radial burst, and search reveal components
kapishdima3e03565f5c00
diff --git a/components/docs/component-preview.tsx b/components/docs/component-preview.tsxindex 93fd7c38..8b1f5cc4 100644--- a/components/docs/component-preview.tsx+++ b/components/docs/component-preview.tsx@@ -147,7 +147,10 @@ function Preview({name={name}load={load}inputProps={values}- durationInFrames={config.durationInFrames}+ durationInFrames={+ config.getDurationInFrames?.(values) ??+ config.durationInFrames+ }fps={config.fps}compositionWidth={config.compositionWidth}compositionHeight={config.compositionHeight}diff --git a/config/site.ts b/config/site.tsindex a9bd2a45..a960998a 100644--- a/config/site.ts+++ b/config/site.ts@@ -70,6 +70,7 @@ export const NEW_BADGE_PATHS = new Set<string>(["/docs/typography/fog-rise","/docs/typography/gradient-scale-cut-text","/docs/typography/inline-pill-takeover",+ "/docs/typography/kinetic-morph-text","/docs/typography/outline-fill-track-text","/docs/typography/rush-type","/docs/typography/shadow-sweep-text",@@ -79,6 +80,8 @@ export const NEW_BADGE_PATHS = new Set<string>(["/docs/typography/word-push","/docs/typography/word-stream","/docs/typography/zoom-words",+ "/docs/effects/radial-burst",+ "/docs/ui-blocks/search-reveal",]);export type FooterGroup = {diff --git a/content/changelog/2026-09-08-kinetic-morph-text.mdx b/content/changelog/2026-09-08-kinetic-morph-text.mdxnew file mode 100644index 00000000..14cf1ebd--- /dev/null+++ b/content/changelog/2026-09-08-kinetic-morph-text.mdx@@ -0,0 +1,14 @@+---+title: Letters in motion+date: 2026-09-08+---++### New components++[Kinetic Morph Text](/docs/typography/kinetic-morph-text) turns editable phrases+into a sequence of individual letter flights, rotations, and soft glyph+changes. Shared letters move to their new positions, with contour trails that+clear as each phrase settles. Controls cover the copy, motion, colors, timing,+and looping.++<ChangelogPreview name="kinetic-morph-text" />diff --git a/content/changelog/2026-09-08-radial-burst.mdx b/content/changelog/2026-09-08-radial-burst.mdxnew file mode 100644index 00000000..98e82fdc--- /dev/null+++ b/content/changelog/2026-09-08-radial-burst.mdx@@ -0,0 +1,14 @@+---+title: A geometric opening+date: 2026-09-08+---++### New components++[Radial Burst](/docs/effects/radial-burst) is an abstract opening for product+introductions. A circle blooms into sculptural ribbons, twists through a+tilted plane, and folds into a ring that sweeps outward with contour echoes.+Customize the intensity, ribbon curvature, echoes, segment count, palette,+and timing, or turn intensity to zero for a classic geometric burst.++<ChangelogPreview name="radial-burst" />diff --git a/content/changelog/2026-09-08-search-reveal.mdx b/content/changelog/2026-09-08-search-reveal.mdxnew file mode 100644index 00000000..3b2d6030--- /dev/null+++ b/content/changelog/2026-09-08-search-reveal.mdx@@ -0,0 +1,13 @@+---+title: Start with a search+date: 2026-09-08+---++### New components++[Search Reveal](/docs/ui-blocks/search-reveal) opens with overlapping construction+circles, stretches a dash into a search field, and types your product name.+An optional abstract panel unfolds behind it in remocn purple. Customize the+copy, typing pace, field size, guides, and palette through the preview controls.++<ChangelogPreview name="search-reveal" />diff --git a/content/docs/effects/index.mdx b/content/docs/effects/index.mdxindex 32e837bd..83d698f6 100644--- a/content/docs/effects/index.mdx+++ b/content/docs/effects/index.mdx@@ -7,6 +7,12 @@ Drop-in effect overlays you compose on top of any scene — fire them on a frame<ComponentCardGriditems={[+ {+ name: "Radial Burst",+ description: "A sculptural intro — twisting ribbons fold into a tilted ring and sweep outward with contour echoes",+ status: "stable",+ href: "/docs/effects/radial-burst",+ },{name: "TV Power Off",description: "Collapses a scene into a glowing line and a phosphor dot the way a tube switches off, leaving the frame dead black",diff --git a/content/docs/effects/meta.json b/content/docs/effects/meta.jsonindex 14d4e955..39c9f6c6 100644--- a/content/docs/effects/meta.json+++ b/content/docs/effects/meta.json@@ -3,6 +3,7 @@"defaultOpen": true,"pages": ["index",+ "radial-burst","tv-power-off","confetti","paper-wobble",diff --git a/content/docs/effects/radial-burst.mdx b/content/docs/effects/radial-burst.mdxnew file mode 100644index 00000000..188adf53--- /dev/null+++ b/content/docs/effects/radial-burst.mdx@@ -0,0 +1,128 @@+---+title: Radial Burst+description: Sculptural ribbons twist into a tilted ring and sweep outward through layered contour echoes+component: radial-burst+vibe: playful+length: 114+useWhen:+ - "A product introduction needs a short abstract geometric opening before its title."+ - "A motion-design stinger should build anticipation and leave a clean frame for the next beat."+ - "A brand-colored animation needs editable segment count, rotation, and scale without external assets."+avoidWhen:+ - "The effect should celebrate an action with scattered particles — use `confetti`."+ - "Two complete scenes need a camera move through concentric rings — use `ripple-zoom`."+ - "The introduction should be driven by editable words — use `kinetic-morph-text`."+---++<ComponentPreview name="radial-burst" />++<InstallBlock name="radial-burst" />++## Usage++`RadialBurst` is a four-second sculptural stinger. A small circle bursts into+wide, tapered ribbons that twist through an asymmetric bloom. Fine contour+echoes trace their movement while a warm accent picks out a few petals. The+ribbons fold into a tilted ring, compress, then sweep outward through layered+rings to leave a clean field for the next title, logo, or scene.++```tsx+import { RadialBurst } from "@/components/remocn/radial-burst";++export const Intro = () => <RadialBurst />;+```++The default palette is white and warm cream on remocn's primary purple. No text, logo,+images, fonts, or shaders are included. SVG geometry, springs, and curves are+derived directly from the Remotion frame, so seeking and rendering are+deterministic. The geometry scales with the shorter composition dimension;+the exit uses the full diagonal to clear portrait, square, and wide frames.++## Timing and title handoff++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–18 | Central circle enters with a small overshoot |+| 18–44 | Ribbons burst outward, stretching into broad petals |+| 44–84 | Ribbons twist through a tilted bloom, then close into a ring |+| 84–96 | Ring contracts to anticipate the exit |+| 96–114 | Ring and contour echoes expand out of frame |+| 114–120 | Clean background |++Place a title above the animation as the ring opens up. This example shares+the purple background and uses the burst as a transparent overlay.++```tsx+import { AbsoluteFill, Sequence } from "remotion";+import { RadialBurst } from "@/components/remocn/radial-burst";++export const ProductIntro = () => (+ <AbsoluteFill style={{ backgroundColor: "#a800b7" }}>+ <RadialBurst backgroundColor="transparent" />+ <Sequence from={108}>+ <AbsoluteFill style={{+ alignItems: "center",+ justifyContent: "center",+ color: "#ffffff",+ fontFamily: "Arial, sans-serif",+ fontSize: 88,+ fontWeight: 600,+ }}>+ Introducing something new+ </AbsoluteFill>+ </Sequence>+ </AbsoluteFill>+);+```++`radialBurstLength` is 114 frames, the point where all shapes have left.+`getRadialBurstDuration({ speed })` includes the clean tail and returns the+duration at 30 fps. Multiply by `fps / 30` and round up for another frame rate.+The docs preview adjusts its duration when speed changes. Enable `loop` to+repeat the full 120-frame cycle; otherwise the background stays clear after+the first pass.++## Variations++Use four segments for broad, sculptural shapes or twelve for a dense radial+pattern. `intensity` controls ribbon swelling, asymmetric movement, and plane+tilt. Set it to `0` for the original flat capsule-to-ring animation. `twist`+changes the ribbon bend; negative values curl in the opposite direction.+`echoes={0}` removes the contour trails. Negative `rotation` reverses the+assembly. `radius` and `thickness` are measured at a 720px reference size and+scale with the composition.++```tsx+<RadialBurst+ segments={6}+ radius={240}+ thickness={24}+ rotation={-180}+ intensity={1.2}+ twist={140}+ echoes={3}+ color="#a800b7"+ backgroundColor="#faf5ff"+ speed={1.25}+/>+```++<PropsTable title="Props"+ rows={[+ { name: "segments", type: "number", default: "8", description: "Rounded segment count, clamped to 4–16 and rounded to an integer" },+ { name: "radius", type: "number", default: "210", description: "Burst radius at 720px, clamped to 100–280" },+ { name: "thickness", type: "number", default: "30", description: "Segment thickness at 720px, clamped to 8–60" },+ { name: "rotation", type: "number", default: "135", description: "Assembly rotation in degrees; negative values reverse it" },+ { name: "intensity", type: "number", default: "1", description: "Ribbon swelling, asymmetric movement, and tilt; 0 restores classic geometry, maximum 1.5" },+ { name: "twist", type: "number", default: "110", description: "Ribbon bend in degrees, from -180 to 180" },+ { name: "echoes", type: "number", default: "3", description: "Contour echo count, from 0 to 5" },+ { name: "accentColor", type: "string", default: '"#f4e4a7"', description: "Warm accent on selected ribbons and exit echoes" },+ { name: "color", type: "string", default: '"#ffffff"', description: "Circle, segment, and ring color" },+ { name: "backgroundColor", type: "string", default: '"#a800b7"', description: "Full-frame background; use transparent for an overlay" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; 0 freezes the initial frame" },+ { name: "loop", type: "boolean", default: "false", description: "Repeat the entire animation, including its clean tail" },+ { name: "className", type: "string", description: "Optional class name on the full-frame root" },+ ]}+/>diff --git a/content/docs/typography/kinetic-morph-text.mdx b/content/docs/typography/kinetic-morph-text.mdxnew file mode 100644index 00000000..bf2ce608--- /dev/null+++ b/content/docs/typography/kinetic-morph-text.mdx@@ -0,0 +1,125 @@+---+title: Kinetic Morph Text+description: Letters lift, rotate, and reshape into the next phrase with delicate outline trails+component: kinetic-morph-text+vibe: playful+length: 246+useWhen:+ - "A short sequence of phrases should feel like the same letters physically rearranging."+ - "A playful title needs individual letter flights, soft shape changes, and readable pauses."+ - "Editable copy should drive the animation without manually positioning characters."+avoidWhen:+ - "Words should switch with minimal movement — use `per-word-crossfade`."+ - "The text should stay readable throughout a subtle entrance — use `per-character-rise`."+ - "A single word should deform as one continuous surface — use `kinetic-warp`."+---++<ComponentPreview name="kinetic-morph-text" />++<InstallBlock name="kinetic-morph-text" />++## Usage++Separate phrases with `|` or a newline. The first phrase flies into place;+after a readable pause, its letters lift and rotate into the next phrase.+Identical letters travel to their new positions. Other letters stretch and+soften into replacement glyphs, while additional characters enter and excess+characters leave. The final phrase stays on screen.++```tsx+import { KineticMorphText } from "@/components/remocn/kinetic-morph-text";++export const TitleScene = () => (+ <KineticMorphText text="Hello | Make it move | Shape what's next" />+);+```++The soft morph combines squash/stretch and a local blur/threshold blend of+native glyphs; it does not interpolate font outlines. Contour trails sample+earlier poses and disappear when the letters settle. All motion is driven by+the Remotion frame, including when scrubbing backward.++## Timing++At the defaults, the first entrance takes 54 frames, followed by a 42-frame+hold. Each subsequent phrase adds another 54-frame transition and 42-frame+hold. The three-phrase sequence finishes moving at frame 246; its full duration+including the final hold is 288 frames at 30 fps.++Use the duration helper when changing the phrase count, timing, or speed. It+returns frames at 30 fps; scale the result for another composition frame rate.+The docs preview updates its duration automatically when the copy, timing, or+speed changes, so every phrase remains included.++```tsx+import { Composition } from "remotion";+import {+ KineticMorphText,+ getKineticMorphTextDuration,+} from "@/components/remocn/kinetic-morph-text";++const props = {+ text: "Think | Make | Move | Repeat",+ transitionFrames: 48,+ holdFrames: 36,+ speed: 1,+};++export const Root = () => (+ <Composition+ id="KineticMorphText"+ component={KineticMorphText}+ defaultProps={props}+ durationInFrames={getKineticMorphTextDuration(props)}+ fps={30}+ width={1280}+ height={720}+ />+);+```++With `loop`, the sequence starts on the readable first phrase, skips the initial+entrance, and uses its final transition to return to that phrase. One complete+cycle has the same duration as the non-looping sequence. A single phrase stays+still in loop mode.++## Tuning the motion++Reduce `spread` and `rotation` for quieter movement. Set `morph={0}` for a clean+glyph crossfade during the flight and `trails={0}` to remove the outlines.+The font is Arial with Helvetica and sans-serif fallbacks, so no font download+is needed. The longest phrase determines a shared font size that fits within+82% of the composition width. Empty entries are ignored; empty input renders+only the background. Spaces, punctuation, repeated letters, and grapheme+clusters are preserved.++```tsx+<KineticMorphText+ text="Create | Iterate | Ship"+ spread={140}+ rotation={80}+ morph={0.65}+ trails={0.3}+ color="#ded4ff"+ backgroundColor="#171324"+/>+```++<PropsTable title="Props"+ rows={[+ { name: "text", type: "string", default: '"Hello | Make it move | Shape what\'s next"', description: "Phrases separated by pipes or newlines" },+ { name: "fontSize", type: "number", default: "100", description: "Maximum font size; automatically reduced to fit the longest phrase" },+ { name: "fontWeight", type: "number", default: "600", description: "CSS font weight" },+ { name: "color", type: "string", default: '"#b4f4d9"', description: "Letter and outline color" },+ { name: "backgroundColor", type: "string", default: '"#a800b7"', description: "Full-frame background; accepts transparent" },+ { name: "spread", type: "number", default: "180", description: "Flight radius in pixels, capped to fit the composition" },+ { name: "rotation", type: "number", default: "110", description: "Maximum letter rotation in degrees" },+ { name: "morph", type: "number", default: "0.75", description: "Soft shape-blend strength from 0 to 1" },+ { name: "trails", type: "number", default: "0.45", description: "Outline echo opacity from 0 to 1" },+ { name: "transitionFrames", type: "number", default: "54", description: "Entrance and transition duration at 30 fps" },+ { name: "holdFrames", type: "number", default: "42", description: "Readable pause per phrase at 30 fps" },+ { name: "loop", type: "boolean", default: "false", description: "Start on the first phrase and cycle back to it" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; 0 freezes the animation" },+ { name: "className", type: "string", description: "Optional class name on the full-frame root" },+ ]}+/>diff --git a/content/docs/typography/meta.json b/content/docs/typography/meta.jsonindex d5496968..4342bb32 100644--- a/content/docs/typography/meta.json+++ b/content/docs/typography/meta.json@@ -34,6 +34,7 @@"strikethrough-replace","short-slide-right","kinetic-center-build",+ "kinetic-morph-text","kinetic-warp","short-slide-down","staggered-fade-up",diff --git a/content/docs/ui-blocks/index.mdx b/content/docs/ui-blocks/index.mdxindex c10802aa..3d45c586 100644--- a/content/docs/ui-blocks/index.mdx+++ b/content/docs/ui-blocks/index.mdx@@ -48,3 +48,16 @@ Larger blocks built from primitives, the actual surfaces your viewers will recog},]}/>++## Product intros++<ComponentCardGrid+ items={[+ {+ name: "SearchReveal",+ description: "Construction circles become a search field that types your product name over an abstract graphic reveal",+ status: "stable",+ href: "/docs/ui-blocks/search-reveal",+ },+ ]}+/>diff --git a/content/docs/ui-blocks/meta.json b/content/docs/ui-blocks/meta.jsonindex 9d45f303..7348e572 100644--- a/content/docs/ui-blocks/meta.json+++ b/content/docs/ui-blocks/meta.json@@ -3,6 +3,7 @@"defaultOpen": true,"pages": ["index",+ "search-reveal","glass-code-block","glass-code-walk","terminal-simulator",diff --git a/content/docs/ui-blocks/search-reveal.mdx b/content/docs/ui-blocks/search-reveal.mdxnew file mode 100644index 00000000..f9795242--- /dev/null+++ b/content/docs/ui-blocks/search-reveal.mdx@@ -0,0 +1,93 @@+---+title: Search Reveal+description: Construction circles expand into a search field, type your product name, and reveal an abstract graphic panel+component: search-reveal+vibe: premium+length: 90+useWhen:+ - "A product introduction should begin with a search for its name."+ - "A short geometric opening should resolve into a familiar interface element."+ - "A search scene needs editable copy and palette without external assets."+avoidWhen:+ - "Words should fly and morph between phrases — use `kinetic-morph-text`."+ - "The opening should stay entirely abstract — use `radial-burst`."+ - "Typing should resemble a command-line session — use `terminal-simulator`."+---++<ComponentPreview name="search-reveal" />++<InstallBlock name="search-reveal" />++## Usage++Two fine construction circles expand, then snap into a short white dash.+The dash stretches into a search pill, types `remocn`, and reveals a purple+panel with contour rings and graphic accents. Corner markers follow the+field and then the expanding panel.++```tsx+import { SearchReveal } from "@/components/remocn/search-reveal";++export const Intro = () => <SearchReveal text="remocn" />;+```++This is a simulated search interface for video. It does not accept keyboard+input or perform a search. Edit the text through props or the preview controls.+All motion and cursor timing come from the Remotion frame; no assets, fonts,+CSS animation clocks, or network requests are required.++## Timing++At 30 fps and the default speed:++| Frames | Motion |+| --- | --- |+| 0–25 | Overlapping circles expand beyond the frame |+| 26–48 | Short dash stretches and levels into a search field |+| 52–78 | Caret appears and `remocn` types one character at a time |+| 56–90 | Graphic panel expands from the field into a rectangle |+| 90–108 | Final pose holds with the caret hidden |++`searchRevealLength` is 90 frames for the default copy. Longer text or slower+typing extends the animation. `getSearchRevealDuration({ text, framesPerCharacter,+speed })` returns the full preview duration, including an 18-frame hold, at+30 fps. For another frame rate, multiply by `fps / 30` and round up. The docs+preview updates its duration automatically. After completion the final pose+stays visible, ready for a cut to the next scene.++## Minimal variation++```tsx+<SearchReveal+ text="Find your next idea"+ fieldWidth={640}+ showPanel={false}+ showGuides={false}+ framesPerCharacter={3}+/>+```++The scene scales to fit the composition while retaining its proportions.+Long copy automatically reduces its font size to fit the field. Typing keeps+Unicode grapheme clusters intact. `reducedMotion` immediately displays the+finished composition, suitable when a host opts into a static preview.++<PropsTable title="Props"+ rows={[+ { name: "text", type: "string", default: '"remocn"', description: "Search copy, revealed one grapheme at a time" },+ { name: "fieldWidth", type: "number", default: "464", description: "Final field width at 1280×720, clamped to 320–640" },+ { name: "fontSize", type: "number", default: "34", description: "Maximum text size, clamped to 18–54 and reduced for long copy" },+ { name: "framesPerCharacter", type: "number", default: "4", description: "Typing interval at 30 fps, clamped to 1–12" },+ { name: "showPanel", type: "boolean", default: "true", description: "Reveal the abstract graphic panel behind the field" },+ { name: "showGuides", type: "boolean", default: "true", description: "Show construction ticks, corner crosses, and fine guide lines" },+ { name: "color", type: "string", default: '"#26232b"', description: "Text, caret, and corner markers" },+ { name: "fieldColor", type: "string", default: '"#ffffff"', description: "Search field and contour ring color" },+ { name: "ringColor", type: "string", default: '"#cbc5cf"', description: "Construction circles, guide lines, and search icon" },+ { name: "panelColor", type: "string", default: '"#a800b7"', description: "Graphic panel background, remocn primary purple" },+ { name: "accentColor", type: "string", default: '"#e8f99a"', description: "Flower and graphic accents" },+ { name: "backgroundColor", type: "string", default: '"#f5f1f5"', description: "Full-frame background; accepts transparent" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; zero freezes the opening frame" },+ { name: "reducedMotion", type: "boolean", default: "false", description: "Show the static finished composition" },+ { name: "className", type: "string", description: "Optional full-frame root class" },+ ]}+/>diff --git a/docs/plans/2026-09-08-kinetic-morph-text-design.md b/docs/plans/2026-09-08-kinetic-morph-text-design.mdnew file mode 100644index 00000000..d2513f09--- /dev/null+++ b/docs/plans/2026-09-08-kinetic-morph-text-design.md@@ -0,0 +1,33 @@+# Kinetic Morph Text++Approved direction: a reusable registry typography component inspired by the+supplied reference's independent letters, rotating clusters, outline echoes,+and reconstruction into a new phrase. The reference's hand-shaped arrangement+and copy are not reproduced. Default copy and all documentation are English.++`KineticMorphText` accepts pipe- or newline-separated phrases through `text`.+It assembles the first phrase, holds for reading, then moves through the list.+Matching graphemes retain their identity and move to their new positions;+unmatched letters soften, stretch, and blend into replacement glyphs near the+middle of a curved flight. Additional letters enter and excess letters leave.+The final phrase holds unless `loop` is enabled.++Use native SVG text and measured advances with a system font, avoiding font+downloads or external assets. Soft glyph blending is a local blur/threshold+effect, not interpolation of font outlines. All poses and contour echoes are+pure functions of the Remotion frame, so seeking and rendering are repeatable.+Fit the longest phrase within the composition, preserving spaces, punctuation,+and grapheme clusters. Ignore empty entries; empty input renders no letters.++Controls cover text, font size/weight, text/background colors, flight spread,+rotation, morph amount, outline trails, transition/hold frames, loop, and the+shared speed multiplier. Export a duration helper for longer phrase sequences.++Implementation sequence:++1. Build and verify phrase parsing, character matching, frame timing, and poses.+2. Add measured typography, SVG glyph blending, and sampled contour echoes.+3. Register the component, controls, documentation, navigation, and changelog.+4. Regenerate registry and preview artifacts; run focused tests and TypeScript.+5. Render the default sequence and alternate copy, inspect transition and hold+ frames, and verify editable controls in the docs preview.diff --git a/docs/plans/2026-09-08-radial-burst-design.md b/docs/plans/2026-09-08-radial-burst-design.mdnew file mode 100644index 00000000..8380defd--- /dev/null+++ b/docs/plans/2026-09-08-radial-burst-design.md@@ -0,0 +1,38 @@+# Radial Burst++Approved direction: a standard geometric motion-design stinger for an+introducing video. A central circle pops in, divides into rounded radial+segments, rotates and reforms into a ring. The ring expands beyond the frame,+leaving a clean field for the next title or scene. No built-in text or logo.++The default palette is white geometry over remocn's primary purple, `#a800b7`.+Controls expose segment count, burst radius, stroke thickness, rotation, both+colors, speed, and looping. Transparent backgrounds allow overlay use.++Author a four-second sequence at 30 fps with deterministic SVG geometry:+circle arrival (0–18), radial burst (18–42), rotating assembly (42–84),+anticipation (84–96), expanding ring exit (96–114), and clean tail (114–120).+Morph cubic segment paths from straight radial capsules into circular arcs;+close the gaps before switching to a complete ring. Fit geometry to the shorter+composition dimension, but calculate the exit radius from the diagonal so it+clears landscape, square, and portrait frames. All motion derives from the+Remotion frame; the non-looping version remains cleared after completion.++Implementation: create the component and controls; add Effects documentation,+navigation, preview registration, and changelog; regenerate registry artifacts+and the preview manifest. Verify timing boundaries, geometry, looping, and+frame coverage with focused tests. Render the default sequence and alternate+segment counts/aspect ratios, inspect the assembly and exit, then check the+live docs controls and production build.+++## Expressive revision++The user requested a more extravagant result after reviewing the first version.+The default now stretches the spokes into broad, tapered ribbons, bends them+into an asymmetric pinwheel, and tilts the geometry as a single plane. Warm+cream accents and sampled contour echoes emphasize the changing silhouette.+The closing ring expands through its earlier contours for a portal-like exit.+Intensity controls the deformation and tilt; zero restores the classic version.+Ribbon twist, echo count, and accent color are independently editable.+The timeline, transparent overlay support, and clean final frame remain.diff --git a/docs/plans/2026-09-08-search-reveal-design.md b/docs/plans/2026-09-08-search-reveal-design.mdnew file mode 100644index 00000000..2210f38e--- /dev/null+++ b/docs/plans/2026-09-08-search-reveal-design.md@@ -0,0 +1,19 @@+# Search Reveal++Reference: user-supplied NNhPC00Tu2RlZsEw.mp4, seconds 0–3 only.+Requested result: a separate registry component, construction circles, search+field entrance, and typing `remocn` in English. This concrete reference defines+the implementation direction.++Use the reference's pale background, thin overlapping circles, snap to a small+dash, expanding white pill, right search icon, centered copy, and moving corner+crosses. Replace the source's collage with original SVG contour and floral+geometry on the remocn primary purple panel. Allow the panel and guides to be+hidden separately. End in the completed search state; do not include later+reference scenes.++Keep the source self-contained and deterministic with Remotion frame timing.+Default movement: 90 frames at 30 fps, followed by 18 frames of hold. Longer+copy extends typing and preview duration. Include static reduced-motion pose.+Validate stage boundaries, extended copy, grapheme typing, speed, out-of-order+seeking, and registry integration; render the full clip and alternate controls.diff --git a/lib/customizer-config.ts b/lib/customizer-config.tsindex 7dc36fb3..8d0f161f 100644--- a/lib/customizer-config.ts+++ b/lib/customizer-config.ts@@ -49,6 +49,8 @@ export interface ComponentConfig {*/dimensions?: { width: number; height: number };durationInFrames: number;+ /** Optional duration for edited copy/timing in the interactive docs preview. */+ getDurationInFrames?: (values: Record<string, unknown>) => number;fps: number;compositionWidth: number;compositionHeight: number;diff --git a/registry-artifacts/elements/kinetic-morph-text.json b/registry-artifacts/elements/kinetic-morph-text.jsonnew file mode 100644index 00000000..6841a6c7--- /dev/null+++ b/registry-artifacts/elements/kinetic-morph-text.json@@ -0,0 +1,14 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "dependencies": [],+ "dimensions": null,+ "displayName": "Kinetic Morph Text",+ "durationInFrames": 246,+ "installationMode": "component-owned-sequence",+ "slug": "kinetic-morph-text",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState, type ComponentProps } from \"react\";\nimport { Easing, Interactive, Sequence, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ninterface KineticMorphTextProps {\n /** One phrase per line, or separate phrases with |. */\n text?: string;\n fontSize?: number;\n fontWeight?: number;\n color?: string;\n backgroundColor?: string;\n /** Flight radius in composition pixels. */\n spread?: number;\n /** Maximum letter rotation in degrees. */\n rotation?: number;\n /** Strength of the soft silhouette blend, from 0 to 1. */\n morph?: number;\n /** Opacity of the sampled outline echoes, from 0 to 1. */\n trails?: number;\n transitionFrames?: number;\n holdFrames?: number;\n loop?: boolean;\n speed?: number;\n className?: string;\n}\n\nconst kineticMorphTextDefaultText =\n \"Hello | Make it move | Shape what's next\";\n\nconst FONT_FAMILY = \"Arial, Helvetica, sans-serif\";\nconst TRANSITION = 54;\nconst HOLD = 42;\nconst clamp = (value: number) => Math.min(1, Math.max(0, value));\nconst finite = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\nconst ease = Easing.bezier(0.65, 0, 0.25, 1);\nconst smooth = (value: number) => {\n const p = clamp(value);\n return p * p * (3 - 2 * p);\n};\nconst mix = (a: number, b: number, p: number) => a + (b - a) * p;\nconst noise = (index: number) => {\n const value = Math.sin(index * 127.1 + 311.7) * 43758.5453;\n return value - Math.floor(value);\n};\n\nfunction parseKineticMorphText(text: string): string[] {\n return text\n .split(/[|\\n\\r]+/)\n .map((phrase) => phrase.trim().replace(/\\s+/g, \" \"))\n .filter(Boolean);\n}\n\n/** Includes the last readable hold. Timing values are authored at 30 fps. */\nfunction getKineticMorphTextDuration({\n text = kineticMorphTextDefaultText,\n transitionFrames = TRANSITION,\n holdFrames = HOLD,\n speed = 1,\n}: Pick<\n KineticMorphTextProps,\n \"text\" | \"transitionFrames\" | \"holdFrames\" | \"speed\" | \"loop\"\n> = {}): number {\n const count = parseKineticMorphText(text).length;\n const transition = Math.max(1, finite(transitionFrames, TRANSITION));\n const hold = Math.max(0, finite(holdFrames, HOLD));\n const rate = Math.max(0.01, finite(speed, 1));\n // Both modes use one transition + hold per phrase. Loop mode starts with\n // a readable first phrase and spends its last transition returning to it.\n const frames = count * (transition + hold);\n return Math.max(1, Math.ceil(frames / rate));\n}\n\n/** Last moving frame at defaults; the demo adds a final 42-frame hold. */\nconst kineticMorphTextLength = 246;\n\ninterface KineticMorphGlyph {\n character: string;\n x: number;\n}\n\ninterface KineticMorphPair {\n from?: KineticMorphGlyph;\n to?: KineticMorphGlyph;\n}\n\n/** Reserve identical graphemes before pairing remaining replacements. */\nfunction matchKineticMorphGlyphs(\n from: KineticMorphGlyph[],\n to: KineticMorphGlyph[],\n): KineticMorphPair[] {\n const unused = new Set(from.map((_, index) => index));\n const matches = to.map((target) => {\n let closest = -1;\n let distance = Number.POSITIVE_INFINITY;\n for (const index of unused) {\n const source = from[index];\n if (source.character !== target.character) continue;\n const travel = Math.abs(source.x - target.x);\n if (travel < distance) {\n closest = index;\n distance = travel;\n }\n }\n if (closest !== -1) unused.delete(closest);\n return closest;\n });\n const remaining = [...unused];\n const pairs: KineticMorphPair[] = to.map((target, index) => {\n const source = matches[index] === -1 ? remaining.shift() : matches[index];\n return {\n from: source === undefined ? undefined : from[source],\n to: target,\n };\n });\n for (const index of remaining) pairs.push({ from: from[index] });\n return pairs;\n}\n\nfunction getKineticMorphTimeline(\n frame: number,\n count: number,\n transitionFrames = TRANSITION,\n holdFrames = HOLD,\n loop = false,\n) {\n const transition = Math.max(1, finite(transitionFrames, TRANSITION));\n const hold = Math.max(0, finite(holdFrames, HOLD));\n const time = Math.max(0, finite(frame, 0));\n if (count === 0) return { from: -1, to: -1, progress: 1 };\n if (!loop && time < transition) {\n return { from: -1, to: 0, progress: time / transition };\n }\n const cursor = loop ? time : time - transition;\n const cycle = transition + hold;\n const index = Math.floor(cursor / cycle);\n if ((!loop && index >= count - 1) || (loop && count === 1)) {\n return { from: count - 1, to: count - 1, progress: 1 };\n }\n return {\n from: index % count,\n to: (index + 1) % count,\n progress: clamp(((cursor % cycle) - hold) / transition),\n };\n}\n\ninterface PoseOptions {\n spread: number;\n rotation: number;\n morph: number;\n}\n\nfunction getKineticMorphPose(\n pair: KineticMorphPair,\n index: number,\n count: number,\n progress: number,\n { spread, rotation, morph }: PoseOptions,\n) {\n // A bounded stagger keeps long phrases within the same transition window.\n const delay = noise(index + 3) * 0.12;\n const p = clamp((progress - delay) / (1 - delay));\n const travel = ease(p);\n const motion = Math.sin(Math.PI * travel);\n const angle = (index / Math.max(count, 1)) * Math.PI * 2 - Math.PI / 2;\n const orbitX = Math.cos(angle) * spread * (0.7 + noise(index) * 0.4);\n const orbitY = Math.sin(angle) * spread * 0.72 - spread * 0.25;\n const fromX = pair.from?.x ?? orbitX * 1.2;\n const toX = pair.to?.x ?? orbitX * 1.2;\n const fromY = pair.from ? 0 : orbitY + spread * 0.65;\n const toY = pair.to ? 0 : orbitY - spread * 0.6;\n const x = mix(fromX, toX, travel) + orbitX * motion;\n const y = mix(fromY, toY, travel) + orbitY * motion;\n const turn = (noise(index + 9) * 2 - 1) * rotation;\n const rotate = pair.from\n ? pair.to\n ? turn * motion\n : turn * travel\n : turn * (1 - travel);\n const replacement = Boolean(\n pair.from && pair.to && pair.from.character !== pair.to.character,\n );\n const blend = replacement ? smooth((p - 0.36) / 0.28) : 0;\n const melt = replacement ? Math.sin(Math.PI * blend) * morph : 0;\n const opacity = pair.from\n ? pair.to\n ? 1\n : 1 - smooth((p - 0.35) / 0.5)\n : smooth(p / 0.36);\n return {\n x,\n y,\n rotate,\n scaleX: 1 - melt * 0.52 + motion * 0.08,\n scaleY: 1 + melt * 0.42 - motion * 0.06,\n blend,\n melt,\n opacity,\n motion,\n };\n}\n\ninterface Layout {\n key: string;\n phrases: KineticMorphGlyph[][];\n size: number;\n baseline: number;\n}\n\nfunction useGlyphLayout(\n text: string,\n size: number,\n weight: number,\n width: number,\n) {\n const [layout, setLayout] = useState<Layout | null>(null);\n const key = JSON.stringify([text, size, weight, width]);\n\n useLayoutEffect(() => {\n const context = document.createElement(\"canvas\").getContext(\"2d\");\n if (!context) return;\n const segmenter = new Intl.Segmenter(\"en\", { granularity: \"grapheme\" });\n const phrases = parseKineticMorphText(text).map((phrase) =>\n Array.from(segmenter.segment(phrase), ({ segment }) => segment),\n );\n context.font = `${weight} ${size}px ${FONT_FAMILY}`;\n context.fontKerning = \"none\";\n const advances = phrases.map((phrase) =>\n phrase.map((character) => context.measureText(character).width),\n );\n const widths = advances.map((row) =>\n row.reduce((sum, value) => sum + value, 0),\n );\n const fit = Math.min(1, (width * 0.82) / Math.max(1, ...widths));\n const metrics = context.measureText(\"Hg\");\n setLayout({\n key,\n size: size * fit,\n baseline:\n ((metrics.actualBoundingBoxAscent - metrics.actualBoundingBoxDescent) /\n 2) *\n fit,\n phrases: phrases.map((phrase, row) => {\n let cursor = (-widths[row] * fit) / 2;\n return phrase.flatMap((character, column) => {\n const advance = advances[row][column] * fit;\n const x = cursor + advance / 2;\n cursor += advance;\n return character.trim() ? [{ character, x }] : [];\n });\n }),\n });\n }, [key, text, size, weight, width]);\n\n return layout?.key === key ? layout : null;\n}\n\nfunction MorphGlyph({\n pair,\n index,\n count,\n progress,\n options,\n size,\n baseline,\n color,\n trails,\n transitionFrames,\n}: {\n pair: KineticMorphPair;\n index: number;\n count: number;\n progress: number;\n options: PoseOptions;\n size: number;\n baseline: number;\n color: string;\n trails: number;\n transitionFrames: number;\n}) {\n const filterId = useId().replace(/:/g, \"\");\n const pose = getKineticMorphPose(pair, index, count, progress, options);\n const transform = (value: typeof pose) =>\n `translate(${value.x} ${value.y}) rotate(${value.rotate}) scale(${value.scaleX} ${value.scaleY})`;\n const replacement =\n pair.from && pair.to && pair.from.character !== pair.to.character;\n const character = pair.from?.character ?? pair.to?.character;\n\n return (\n <g>\n {trails > 0 && pose.motion > 0.001\n ? [3, 2, 1].map((sample) => {\n const echo = getKineticMorphPose(\n pair,\n index,\n count,\n Math.max(0, progress - (sample * 1.5) / transitionFrames),\n options,\n );\n return (\n <text\n key={sample}\n transform={transform(echo)}\n y={baseline}\n fill=\"none\"\n stroke={color}\n strokeWidth={Math.max(0.7, size * 0.009)}\n opacity={echo.opacity * pose.motion * trails * (1 - sample / 4)}\n >\n {replacement && echo.blend > 0.5\n ? pair.to?.character\n : character}\n </text>\n );\n })\n : null}\n {replacement && pose.melt > 0.001 ? (\n <defs>\n <filter\n id={filterId}\n x=\"-70%\"\n y=\"-70%\"\n width=\"240%\"\n height=\"240%\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation={pose.melt * size * 0.045} />\n <feColorMatrix\n type=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 12 -4\"\n />\n </filter>\n </defs>\n ) : null}\n <g transform={transform(pose)} opacity={pose.opacity}>\n <g\n filter={\n replacement && pose.melt > 0.001 ? `url(#${filterId})` : undefined\n }\n fill={color}\n >\n <text y={baseline} opacity={replacement ? 1 - pose.blend : 1}>\n {character}\n </text>\n {replacement ? (\n <text y={baseline} opacity={pose.blend}>\n {pair.to?.character}\n </text>\n ) : null}\n </g>\n </g>\n </g>\n );\n}\n\nfunction KineticMorphTextBase({\n text = kineticMorphTextDefaultText,\n fontSize = 100,\n fontWeight = 600,\n color = \"#b4f4d9\",\n backgroundColor = \"#a800b7\",\n spread = 180,\n rotation = 110,\n morph = 0.75,\n trails = 0.45,\n transitionFrames = TRANSITION,\n holdFrames = HOLD,\n loop = false,\n speed = 1,\n className,\n}: KineticMorphTextProps) {\n const currentFrame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const frame = currentFrame * (30 / fps) * Math.max(0, finite(speed, 1));\n const size = Math.min(height * 0.28, Math.max(1, finite(fontSize, 100)));\n const weight = Math.min(900, Math.max(100, finite(Number(fontWeight), 600)));\n const layout = useGlyphLayout(text, size, weight, width);\n const transition = Math.max(1, finite(transitionFrames, TRANSITION));\n const timeline = getKineticMorphTimeline(\n frame,\n layout?.phrases.length ?? 0,\n transition,\n holdFrames,\n loop,\n );\n const pairs = useMemo(\n () =>\n matchKineticMorphGlyphs(\n layout?.phrases[timeline.from] ?? [],\n layout?.phrases[timeline.to] ?? [],\n ),\n [layout, timeline.from, timeline.to],\n );\n const options = {\n spread: Math.min(\n width * 0.24,\n height * 0.32,\n Math.max(0, finite(spread, 180)),\n ),\n rotation: Math.max(0, finite(rotation, 110)),\n morph: clamp(finite(morph, 0.75)),\n };\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor,\n overflow: \"hidden\",\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label={parseKineticMorphText(text).join(\". \")}\n style={{\n display: \"block\",\n fontFamily: FONT_FAMILY,\n fontSize: layout?.size ?? size,\n fontWeight: weight,\n fontKerning: \"none\",\n }}\n >\n <g\n transform={`translate(${width / 2} ${height / 2})`}\n textAnchor=\"middle\"\n >\n {layout\n ? pairs.map((pair, index) => (\n <MorphGlyph\n key={`${timeline.from}:${timeline.to}:${index}`}\n pair={pair}\n index={index}\n count={pairs.length}\n progress={timeline.progress}\n options={options}\n size={layout.size}\n baseline={layout.baseline}\n color={color}\n trails={clamp(finite(trails, 0.45))}\n transitionFrames={transition}\n />\n ))\n : null}\n </g>\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Hello | Make it move | Shape what's next\",\n description: \"Phrases (separate with |)\",\n },\n fontSize: {\n type: \"number\",\n default: 100,\n min: 24,\n max: 180,\n step: 1,\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 spread: {\n type: \"number\",\n default: 180,\n min: 0,\n max: 230,\n step: 5,\n description: \"Flight spread\",\n hiddenFromList: false,\n },\n rotation: {\n type: \"number\",\n default: 110,\n min: 0,\n max: 240,\n step: 5,\n description: \"Rotation\",\n hiddenFromList: false,\n },\n morph: {\n type: \"number\",\n default: 0.75,\n min: 0,\n max: 1,\n step: 0.05,\n description: \"Morph strength\",\n hiddenFromList: false,\n },\n trails: {\n type: \"number\",\n default: 0.45,\n min: 0,\n max: 1,\n step: 0.05,\n description: \"Outline trails\",\n hiddenFromList: false,\n },\n transitionFrames: {\n type: \"number\",\n default: 54,\n min: 18,\n max: 90,\n step: 1,\n description: \"Transition frames\",\n hiddenFromList: false,\n },\n holdFrames: {\n type: \"number\",\n default: 42,\n min: 0,\n max: 90,\n step: 1,\n description: \"Hold frames\",\n hiddenFromList: false,\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop phrases\",\n },\n color: {\n type: \"color\",\n default: \"#b4f4d9\",\n description: \"Text color\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#a800b7\",\n description: \"Background\",\n },\n speed: {\n 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\",\"fontWeight\",\"spread\",\"rotation\",\"morph\",\"trails\",\"transitionFrames\",\"holdFrames\",\"loop\",\"color\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Hello | Make it move | Shape what's next\",\n fontSize: 100,\n fontWeight: \"600\",\n spread: 180,\n rotation: 110,\n morph: 0.75,\n trails: 0.45,\n transitionFrames: 54,\n holdFrames: 42,\n loop: false,\n color: \"#b4f4d9\",\n backgroundColor: \"#a800b7\",\n speed: 1,\n};\n\ntype KineticMorphTextElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof KineticMorphTextBase>;\n\nconst KineticMorphTextInner = forwardRef<\n HTMLDivElement,\n KineticMorphTextElementProps & { 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 ?? \"<KineticMorphText>\"}\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 <KineticMorphTextBase\n {...(componentProps as unknown as ComponentProps<typeof KineticMorphTextBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const KineticMorphText = Interactive.withSchema({\n Component: KineticMorphTextInner,\n componentName: \"<KineticMorphText>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 246+}diff --git a/registry-artifacts/elements/radial-burst.json b/registry-artifacts/elements/radial-burst.jsonnew file mode 100644index 00000000..2da5543b--- /dev/null+++ b/registry-artifacts/elements/radial-burst.json@@ -0,0 +1,14 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "dependencies": [],+ "dimensions": null,+ "displayName": "Radial Burst",+ "durationInFrames": 114,+ "installationMode": "component-owned-sequence",+ "slug": "radial-burst",+ "sourceCode": "import { Easing, Interactive, Sequence, interpolateColors, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface RadialBurstProps {\n /** Number of rounded segments, from 4 to 16. */\n segments?: number;\n /** Burst radius at a 720px reference size. */\n radius?: number;\n /** Segment thickness at a 720px reference size. */\n thickness?: number;\n /** Rotation during assembly, in degrees; negative reverses it. */\n rotation?: number;\n /** Sculptural stretch and tilt, from 0 (classic) to 1.5. */\n intensity?: number;\n /** Curvature of the flying ribbons in degrees. */\n twist?: number;\n /** Number of contour echoes, from 0 to 5. */\n echoes?: number;\n color?: string;\n accentColor?: string;\n backgroundColor?: string;\n speed?: number;\n loop?: boolean;\n className?: string;\n}\n\n/** The ring has completely left the composition by this frame at 30 fps. */\nconst radialBurstLength = 114;\nconst CYCLE = 120;\nconst finite = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\nconst clamp = (value: number) => Math.min(1, Math.max(0, value));\nconst mix = (from: number, to: number, progress: number) =>\n from + (to - from) * progress;\nconst easeInOut = Easing.bezier(0.65, 0, 0.25, 1);\nconst easeOut = Easing.bezier(0.16, 1, 0.3, 1);\nconst progress = (frame: number, start: number, end: number) =>\n clamp((frame - start) / (end - start));\n\n/** Includes the clean tail, in frames at 30 fps. */\nfunction getRadialBurstDuration({\n speed = 1,\n}: Pick<RadialBurstProps, \"speed\"> = {}) {\n const rate = finite(speed, 1);\n return rate <= 0 ? 1 : Math.max(1, Math.ceil(CYCLE / rate));\n}\n\nfunction getRadialBurstState(\n frame: number,\n {\n segments = 8,\n radius = 210,\n thickness = 30,\n rotation = 135,\n intensity = 1,\n loop = false,\n width = 1280,\n height = 720,\n }: Omit<\n RadialBurstProps,\n \"color\" | \"accentColor\" | \"backgroundColor\" | \"speed\" | \"className\"\n > & {\n width?: number;\n height?: number;\n } = {},\n) {\n const w = Math.max(1, finite(width, 1280));\n const h = Math.max(1, finite(height, 720));\n const unit = Math.min(w, h) / 720;\n const time = Math.max(0, finite(frame, 0));\n const local = loop ? time % CYCLE : time;\n const count = Math.round(Math.min(16, Math.max(4, finite(segments, 8))));\n const burstRadius = Math.min(280, Math.max(100, finite(radius, 210))) * unit;\n const stroke = Math.min(60, Math.max(8, finite(thickness, 30))) * unit;\n const ringRadius = burstRadius * 0.68;\n const assemble = easeInOut(progress(local, 44, 76));\n const curl = easeInOut(progress(local, 48, 78));\n const close = easeInOut(progress(local, 72, 84));\n const anticipate = easeInOut(progress(local, 86, 96));\n const exit = progress(local, 96, radialBurstLength) ** 2.6;\n const launch = spring({\n frame: Math.max(0, local - 18),\n fps: 30,\n durationInFrames: 26,\n config: { damping: 13, stiffness: 170, mass: 0.8 },\n });\n const pop = spring({\n frame: Math.max(0, local - 2),\n fps: 30,\n durationInFrames: 16,\n config: { damping: 11, stiffness: 180, mass: 0.65 },\n });\n const ringStroke = mix(stroke * 0.8, stroke * 1.1, anticipate);\n const exitStroke = mix(ringStroke, stroke * 2.2, exit);\n // The inner edge, not just the centerline, must pass every corner.\n const clearRadius = Math.hypot(w, h) / 2 + stroke * 2.2 + 2;\n const orbitRadius = mix(\n mix(28 * unit, burstRadius, launch),\n ringRadius,\n assemble,\n );\n const finalRadius = mix(ringRadius, ringRadius * 0.84, anticipate);\n const strength = Math.min(1.5, Math.max(0, finite(intensity, 1)));\n const energy = Math.sin(Math.PI * progress(local, 18, 84));\n const tilt =\n easeOut(progress(local, 18, 48)) *\n (1 - easeInOut(progress(local, 96, 114)));\n\n return {\n frame: local,\n count,\n unit,\n strength,\n energy: Math.max(0, energy) * strength,\n planeScale: 1 - tilt * 0.46 * Math.min(1.5, strength),\n planeAngle:\n Math.sin(progress(local, 18, 114) * Math.PI * 1.6) * 32 * strength,\n offsetX:\n Math.sin(Math.PI * progress(local, 18, 114)) * 65 * unit * strength,\n offsetY:\n -Math.sin(Math.PI * progress(local, 18, 114)) * 32 * unit * strength,\n dotRadius: 37 * unit * pop * (1 - easeOut(progress(local, 18, 26))),\n dotSquash: 1 - Math.sin(Math.PI * progress(local, 2, 18)) * 0.16,\n showSegments: local >= 18 && local < 84,\n showRing: local >= 84 && local < radialBurstLength,\n segmentOpacity: easeOut(progress(local, 18, 23)),\n radius: local < 84 ? orbitRadius : mix(finalRadius, clearRadius, exit),\n strokeWidth: local < 84 ? mix(stroke, stroke * 0.8, assemble) : exitStroke,\n segmentLength: mix(\n 12 * unit,\n Math.min(82 * unit, burstRadius * 0.42),\n easeOut(progress(local, 18, 36)),\n ),\n curl,\n // Gaps close with a tiny overlap to prevent raster seams at the weld.\n arcAngle: ((Math.PI * 2) / count) * mix(0.62, 1.002, close),\n rotation: finite(rotation, 135) * easeInOut(progress(local, 34, 84)),\n };\n}\n\n/** A straight rounded spoke curls continuously into a circular arc. */\nfunction getSegmentPoints({\n radius,\n segmentLength,\n arcAngle,\n curl,\n}: Pick<\n ReturnType<typeof getRadialBurstState>,\n \"radius\" | \"segmentLength\" | \"arcAngle\" | \"curl\"\n>) {\n const half = arcAngle / 2;\n const x = radius * Math.cos(half);\n const y = radius * Math.sin(half);\n const tangent = (4 / 3) * Math.tan(arcAngle / 4) * radius;\n const arc = [\n [x, -y],\n [x + tangent * Math.sin(half), -y + tangent * Math.cos(half)],\n [x + tangent * Math.sin(half), y - tangent * Math.cos(half)],\n [x, y],\n ];\n const angle = (curl * Math.PI) / 2;\n return [-0.5, -1 / 6, 1 / 6, 0.5].map((offset, index) => {\n const px = radius + segmentLength * offset * Math.cos(angle);\n const py = segmentLength * offset * Math.sin(angle);\n return [mix(px, arc[index][0], curl), mix(py, arc[index][1], curl)];\n });\n}\n\nfunction getRadialBurstSegmentPath(\n state: Parameters<typeof getSegmentPoints>[0],\n) {\n const points = getSegmentPoints(state).map((point) =>\n point.map((value) => value.toFixed(3)).join(\" \"),\n );\n return `M ${points[0]} C ${points[1]} ${points[2]} ${points[3]}`;\n}\n\n/** Sample a bent centerline and its normals to make a tapered, filled ribbon. */\nfunction getRadialBurstRibbonPath(\n state: ReturnType<typeof getRadialBurstState>,\n index: number,\n twist = 110,\n) {\n const energy = state.energy;\n const points = getSegmentPoints({\n ...state,\n radius: state.radius * (1 + Math.sin(index * 2.4) * energy * 0.15),\n segmentLength: state.segmentLength * (1 + energy * 2.8),\n });\n const bend =\n (Math.min(180, Math.max(-180, finite(twist, 110))) / 110) *\n energy *\n 145 *\n state.unit;\n points[1][1] += bend * 0.55;\n points[2][1] += bend;\n // Carry the tip with the bend so the centerline does not double back into\n // a hairpin while the ribbon transitions from a spoke to an arc.\n points[3][1] += bend * 1.25;\n points[2][0] += energy * 38 * state.unit;\n const upper: string[] = [];\n const lower: string[] = [];\n const format = (x: number, y: number) => `${x.toFixed(3)} ${y.toFixed(3)}`;\n let firstWidth = 0;\n let lastWidth = 0;\n for (let sample = 0; sample <= 36; sample++) {\n const t = sample / 36;\n const q = 1 - t;\n const x =\n q ** 3 * points[0][0] +\n 3 * q * q * t * points[1][0] +\n 3 * q * t * t * points[2][0] +\n t ** 3 * points[3][0];\n const y =\n q ** 3 * points[0][1] +\n 3 * q * q * t * points[1][1] +\n 3 * q * t * t * points[2][1] +\n t ** 3 * points[3][1];\n const dx =\n 3 * q * q * (points[1][0] - points[0][0]) +\n 6 * q * t * (points[2][0] - points[1][0]) +\n 3 * t * t * (points[3][0] - points[2][0]);\n const dy =\n 3 * q * q * (points[1][1] - points[0][1]) +\n 6 * q * t * (points[2][1] - points[1][1]) +\n 3 * t * t * (points[3][1] - points[2][1]);\n const length = Math.max(0.001, Math.hypot(dx, dy));\n const ddx =\n 6 * q * (points[2][0] - 2 * points[1][0] + points[0][0]) +\n 6 * t * (points[3][0] - 2 * points[2][0] + points[1][0]);\n const ddy =\n 6 * q * (points[2][1] - 2 * points[1][1] + points[0][1]) +\n 6 * t * (points[3][1] - 2 * points[2][1] + points[1][1]);\n const curvature = Math.abs(dx * ddy - dy * ddx) / length ** 3;\n const swell = Math.sin(Math.PI * t) ** 1.4;\n // Offset curves fold back on themselves when their width exceeds the\n // bend radius. Limit the width locally to keep tight curls smooth.\n const halfWidth = Math.min(\n (state.strokeWidth / 2) * (1 + energy * (2.4 * swell - 0.65 * t)),\n 0.72 / Math.max(curvature, 0.00001),\n );\n if (sample === 0) firstWidth = halfWidth;\n if (sample === 36) lastWidth = halfWidth;\n upper.push(\n format(x - (dy / length) * halfWidth, y + (dx / length) * halfWidth),\n );\n lower.push(\n format(x + (dy / length) * halfWidth, y - (dx / length) * halfWidth),\n );\n }\n return `M ${upper.join(\" L \")} A ${lastWidth} ${lastWidth} 0 0 0 ${lower[36]} L ${lower.slice(0, -1).reverse().join(\" L \")} A ${firstWidth} ${firstWidth} 0 0 0 ${upper[0]} Z`;\n}\n\nfunction RadialBurstBase({\n segments = 8,\n radius = 210,\n thickness = 30,\n rotation = 135,\n intensity = 1,\n twist = 110,\n echoes = 3,\n color = \"#ffffff\",\n accentColor = \"#f4e4a7\",\n backgroundColor = \"#a800b7\",\n speed = 1,\n loop = false,\n className,\n}: RadialBurstProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const time = frame * (30 / fps) * Math.max(0, finite(speed, 1));\n const options = {\n segments,\n radius,\n thickness,\n rotation,\n intensity,\n loop,\n width,\n height,\n };\n const state = getRadialBurstState(time, options);\n const path = getRadialBurstSegmentPath(state);\n const echoCount = Math.round(Math.min(5, Math.max(0, finite(echoes, 3))));\n const plane = (pose: typeof state) =>\n `translate(${pose.offsetX} ${pose.offsetY}) rotate(${pose.planeAngle}) scale(1 ${pose.planeScale})`;\n const ribbons = (pose: typeof state, outline: boolean) =>\n Array.from({ length: pose.count }, (_, index) => (\n <path\n key={index}\n d={getRadialBurstRibbonPath(pose, index, twist)}\n transform={`rotate(${(index * 360) / pose.count + pose.rotation - 90 + Math.sin(index * 1.7) * pose.energy * 16})`}\n fill={\n outline\n ? \"none\"\n : index % 3 === 0\n ? interpolateColors(\n clamp(pose.energy),\n [0, 1],\n [color, accentColor],\n )\n : color\n }\n stroke={outline ? color : \"none\"}\n strokeWidth={1.5 * pose.unit}\n />\n ));\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n backgroundColor,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Geometric radial burst\"\n style={{ display: \"block\" }}\n >\n <g transform={`translate(${width / 2} ${height / 2})`}>\n {state.strength > 0 &&\n state.frame >= 18 &&\n state.frame < radialBurstLength\n ? Array.from({ length: echoCount }, (_, index) => {\n const lag = (echoCount - index) * 2.2;\n const echo = getRadialBurstState(\n Math.max(18, state.frame - lag),\n { ...options, loop: false },\n );\n const opacity =\n 0.36 *\n (1 - index / (echoCount + 1)) *\n Math.min(1, state.strength) *\n (1 - easeOut(progress(state.frame, 107, 114)));\n return (\n <g key={index} transform={plane(echo)} opacity={opacity}>\n {echo.showSegments ? (\n ribbons(echo, true)\n ) : echo.showRing ? (\n <circle\n r={echo.radius}\n fill=\"none\"\n stroke={index % 2 ? color : accentColor}\n strokeWidth={echo.strokeWidth * (0.22 + index * 0.07)}\n />\n ) : null}\n </g>\n );\n })\n : null}\n <g transform={plane(state)}>\n {state.dotRadius > 0.001 ? (\n <circle\n r={state.dotRadius}\n fill={color}\n transform={`scale(${1 / state.dotSquash} ${state.dotSquash})`}\n />\n ) : null}\n {state.showSegments && state.strength > 0 ? (\n <g opacity={state.segmentOpacity}>{ribbons(state, false)}</g>\n ) : state.showSegments ? (\n <g\n fill=\"none\"\n stroke={color}\n strokeWidth={state.strokeWidth}\n strokeLinecap=\"round\"\n opacity={state.segmentOpacity}\n transform={`rotate(${state.rotation - 90})`}\n >\n {Array.from({ length: state.count }, (_, index) => (\n <path\n key={index}\n d={path}\n transform={`rotate(${(index * 360) / state.count})`}\n />\n ))}\n </g>\n ) : null}\n {state.showRing ? (\n <circle\n r={state.radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={state.strokeWidth}\n />\n ) : null}\n </g>\n </g>\n </svg>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n segments: {\n type: \"number\",\n default: 8,\n min: 4,\n max: 16,\n step: 1,\n description: \"Segments\",\n hiddenFromList: false,\n },\n radius: {\n type: \"number\",\n default: 210,\n min: 100,\n max: 280,\n step: 5,\n description: \"Burst radius\",\n hiddenFromList: false,\n },\n thickness: {\n type: \"number\",\n default: 30,\n min: 8,\n max: 60,\n step: 1,\n description: \"Thickness\",\n hiddenFromList: false,\n },\n rotation: {\n type: \"number\",\n default: 135,\n min: -360,\n max: 360,\n step: 15,\n description: \"Rotation\",\n hiddenFromList: false,\n },\n intensity: {\n type: \"number\",\n default: 1,\n min: 0,\n max: 1.5,\n step: 0.1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n twist: {\n type: \"number\",\n default: 110,\n min: -180,\n max: 180,\n step: 10,\n description: \"Ribbon twist\",\n hiddenFromList: false,\n },\n echoes: {\n type: \"number\",\n default: 3,\n min: 0,\n max: 5,\n step: 1,\n description: \"Contour echoes\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Shape color\",\n },\n accentColor: {\n type: \"color\",\n default: \"#f4e4a7\",\n description: \"Accent color\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#a800b7\",\n description: \"Background\",\n },\n loop: {\n type: \"boolean\",\n default: false,\n description: \"Loop animation\",\n },\n speed: {\n 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([\"segments\",\"radius\",\"thickness\",\"rotation\",\"intensity\",\"twist\",\"echoes\",\"color\",\"accentColor\",\"backgroundColor\",\"loop\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n segments: 8,\n radius: 210,\n thickness: 30,\n rotation: 135,\n intensity: 1,\n twist: 110,\n echoes: 3,\n color: \"#ffffff\",\n accentColor: \"#f4e4a7\",\n backgroundColor: \"#a800b7\",\n loop: false,\n speed: 1,\n};\n\ntype RadialBurstElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RadialBurstBase>;\n\nconst RadialBurstInner = forwardRef<\n HTMLDivElement,\n RadialBurstElementProps & { 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 ?? \"<RadialBurst>\"}\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 <RadialBurstBase\n {...(componentProps as unknown as ComponentProps<typeof RadialBurstBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RadialBurst = Interactive.withSchema({\n Component: RadialBurstInner,\n componentName: \"<RadialBurst>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 114+}diff --git a/registry-artifacts/elements/search-reveal.json b/registry-artifacts/elements/search-reveal.jsonnew file mode 100644index 00000000..4e40363a--- /dev/null+++ b/registry-artifacts/elements/search-reveal.json@@ -0,0 +1,14 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "dependencies": [],+ "dimensions": null,+ "displayName": "Search Reveal",+ "durationInFrames": 90,+ "installationMode": "component-owned-sequence",+ "slug": "search-reveal",+ "sourceCode": "import { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype SearchRevealProps = {\n text?: string;\n fieldWidth?: number;\n fontSize?: number;\n framesPerCharacter?: number;\n showPanel?: boolean;\n showGuides?: boolean;\n color?: string;\n fieldColor?: string;\n ringColor?: string;\n panelColor?: string;\n accentColor?: string;\n backgroundColor?: string;\n speed?: number;\n reducedMotion?: boolean;\n className?: string;\n};\n\nconst searchRevealLength = 90;\nconst finite = (value: number | undefined, fallback: number) =>\n typeof value === \"number\" && Number.isFinite(value) ? value : fallback;\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\nconst letters = (text: string) =>\n Array.from(\n new Intl.Segmenter(\"en\", { granularity: \"grapheme\" }).segment(text),\n (part) => part.segment,\n );\nconst curve = Easing.bezier(0.22, 1, 0.36, 1);\nconst tween = (frame: number, start: number, end: number, from = 0, to = 1) =>\n interpolate(frame, [start, end], [from, to], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: curve,\n });\n\nfunction timing(props: SearchRevealProps) {\n const characters = letters(props.text ?? \"remocn\");\n const step = clamp(finite(props.framesPerCharacter, 4), 1, 12);\n const end = Math.max(searchRevealLength, 54 + characters.length * step + 10);\n return { characters, step, end, speed: Math.max(0, finite(props.speed, 1)) };\n}\n\n/** Demo duration at 30 fps, including an 18-frame final hold. */\nfunction getSearchRevealDuration(props: SearchRevealProps = {}) {\n const { end, speed } = timing(props);\n return speed === 0 ? 1 : Math.ceil((end + 18) / speed);\n}\n\n/** Frame is expressed at 30 fps; playback speed is applied here. */\nfunction getSearchRevealState(\n frame: number,\n props: SearchRevealProps = {},\n) {\n const { characters, step, end, speed } = timing(props);\n const t = props.reducedMotion ? end : Math.max(0, finite(frame, 0)) * speed;\n const typedCount = clamp(Math.floor((t - 54) / step), 0, characters.length);\n const width = clamp(finite(props.fieldWidth, 464), 320, 640);\n const reveal = props.showPanel === false ? 0 : tween(t, 56, 90);\n const fieldWidth = tween(t, 26, 48, 130, width);\n const fieldHeight = tween(t, 26, 46, 24, 80);\n const panelWidth =\n fieldWidth + (Math.max(774, width + 170) - fieldWidth) * reveal;\n const panelHeight = fieldHeight + (374 - fieldHeight) * reveal;\n return {\n t,\n end,\n typedCount,\n text: characters.slice(0, typedCount).join(\"\"),\n circleRadius: tween(t, 0, 26, 250, 410),\n circleOffset: tween(t, 0, 26, 62, 185),\n circlesVisible: t < 26,\n fieldVisible: t >= 26,\n fieldWidth,\n fieldHeight,\n tilt: tween(t, 26, 47, -4, 0),\n iconOpacity: tween(t, 34, 46),\n panelWidth,\n panelHeight,\n panelRadius: 40 * (1 - reveal),\n panelOpacity: tween(t, 56, 60),\n reveal,\n caretVisible:\n t >= 52 &&\n t < end &&\n (typedCount < characters.length || Math.floor((t - 52) / 12) % 2 === 0),\n };\n}\n\nfunction Cross({ x, y, size = 9 }: { x: number; y: number; size?: number }) {\n return (\n <path\n d={`M ${x - size} ${y} H ${x + size} M ${x} ${y - size} V ${y + size}`}\n />\n );\n}\n\n/** A video scene: expanding construction circles, a search pill, and typed copy. */\nfunction SearchRevealBase({\n text = \"remocn\",\n fieldWidth = 464,\n fontSize = 34,\n framesPerCharacter = 4,\n showPanel = true,\n showGuides = true,\n color = \"#26232b\",\n fieldColor = \"#ffffff\",\n ringColor = \"#cbc5cf\",\n panelColor = \"#a800b7\",\n accentColor = \"#e8f99a\",\n backgroundColor = \"#f5f1f5\",\n speed = 1,\n reducedMotion = false,\n className,\n}: SearchRevealProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const state = getSearchRevealState((frame * 30) / fps, {\n text,\n fieldWidth,\n framesPerCharacter,\n showPanel,\n speed,\n reducedMotion,\n });\n const scale = Math.min(width / 1280, height / 720);\n const fittedFont = Math.min(\n clamp(finite(fontSize, 34), 18, 54),\n (state.fieldWidth - 120) / Math.max(1, letters(text).length * 0.65),\n );\n const markerWidth = showPanel ? state.panelWidth : state.fieldWidth;\n const markerHeight = showPanel ? state.panelHeight : state.fieldHeight;\n\n return (\n <AbsoluteFill\n className={className}\n style={{\n backgroundColor,\n overflow: \"hidden\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 1280,\n height: 720,\n flexShrink: 0,\n position: \"relative\",\n transform: `scale(${scale})`,\n }}\n >\n {state.circlesVisible && (\n <svg\n aria-hidden=\"true\"\n width=\"1280\"\n height=\"720\"\n viewBox=\"-640 -360 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n <g fill=\"none\" stroke={ringColor} strokeWidth=\"1\">\n {[-1, 1].map((side) => (\n <g key={side}>\n <circle\n cx={side * state.circleOffset}\n r={state.circleRadius}\n />\n {showGuides &&\n [-1, 1].map((edge) => (\n <Cross\n key={edge}\n x={\n side * state.circleOffset + edge * state.circleRadius\n }\n y={0}\n size={6}\n />\n ))}\n </g>\n ))}\n </g>\n </svg>\n )}\n {state.fieldVisible && (\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: 0,\n height: 0,\n transform: `rotate(${state.tilt}deg)`,\n }}\n >\n {showPanel && (\n <div\n style={{\n position: \"absolute\",\n left: -state.panelWidth / 2,\n top: -state.panelHeight / 2,\n width: state.panelWidth,\n height: state.panelHeight,\n borderRadius: state.panelRadius,\n overflow: \"hidden\",\n opacity: state.panelOpacity,\n backgroundColor: panelColor,\n }}\n >\n <svg\n aria-hidden=\"true\"\n width=\"844\"\n height=\"374\"\n viewBox=\"0 0 844 374\"\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n transform: `translate(-50%, -50%) scale(${1.07 - state.reveal * 0.07})`,\n }}\n >\n <g\n transform={`translate(310 -45) rotate(${-24 + 10 * state.reveal})`}\n fill=\"none\"\n stroke={fieldColor}\n >\n {Array.from({ length: 30 }, (_, i) => (\n <ellipse\n key={i}\n rx={82 + i * 3}\n ry={118}\n transform={`rotate(${i * 6})`}\n strokeWidth=\"1.4\"\n opacity={0.35 + i / 70}\n />\n ))}\n </g>\n <g\n transform={`translate(65 233) rotate(${state.reveal * 25})`}\n fill={accentColor}\n >\n {Array.from({ length: 10 }, (_, i) => (\n <ellipse\n key={i}\n cy=\"-41\"\n rx=\"19\"\n ry=\"48\"\n transform={`rotate(${i * 36})`}\n />\n ))}\n </g>\n <g\n transform={`translate(720 357) rotate(${-18 * state.reveal})`}\n fill=\"none\"\n stroke={accentColor}\n strokeWidth=\"22\"\n >\n <path d=\"M -68 -115 V 80 M -122 -60 L -14 26 M -125 18 L -12 -61\" />\n <circle cx=\"103\" cy=\"-35\" r=\"54\" />\n </g>\n </svg>\n </div>\n )}\n {showGuides && (\n <svg\n aria-hidden=\"true\"\n width=\"1280\"\n height=\"720\"\n viewBox=\"-640 -360 1280 720\"\n style={{\n position: \"absolute\",\n left: -640,\n top: -360,\n overflow: \"visible\",\n }}\n >\n <g\n fill=\"none\"\n stroke={ringColor}\n strokeWidth=\"1\"\n opacity={0.5 * state.iconOpacity}\n >\n <path\n d={`M ${markerWidth / 2} ${-markerHeight / 2 - 14} V -360 M ${-markerWidth / 2} ${markerHeight / 2 + 14} V 360`}\n />\n </g>\n <g fill=\"none\" stroke={color} strokeWidth=\"1.5\">\n <Cross x={-markerWidth / 2} y={markerHeight / 2} />\n <Cross x={markerWidth / 2} y={-markerHeight / 2} />\n </g>\n </svg>\n )}\n <div\n style={{\n position: \"absolute\",\n left: -state.fieldWidth / 2,\n top: -state.fieldHeight / 2,\n width: state.fieldWidth,\n height: state.fieldHeight,\n borderRadius: 999,\n backgroundColor: fieldColor,\n boxShadow: \"0 3px 12px #26232b08, inset 0 0 0 1px #26232b0a\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n color,\n fontFamily: \"Arial, Helvetica, sans-serif\",\n fontSize: fittedFont,\n fontWeight: 400,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n maxWidth: state.fieldWidth - 116,\n overflow: \"hidden\",\n whiteSpace: \"pre\",\n }}\n >\n <span>{state.text}</span>\n <span\n aria-hidden=\"true\"\n style={{\n width: 1.5,\n height: fittedFont * 1.12,\n marginLeft: 2,\n flexShrink: 0,\n backgroundColor: color,\n opacity: state.caretVisible ? 1 : 0,\n }}\n />\n </div>\n <svg\n aria-hidden=\"true\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n stroke={ringColor}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n style={{\n position: \"absolute\",\n right: 24,\n opacity: state.iconOpacity,\n }}\n >\n <circle cx=\"11.5\" cy=\"11.5\" r=\"7.5\" />\n <path d=\"m17 17 7 7\" />\n </svg>\n </div>\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"remocn\",\n description: \"Search text\",\n },\n fieldWidth: {\n type: \"number\",\n default: 464,\n min: 320,\n max: 640,\n step: 8,\n description: \"Field width\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n default: 34,\n min: 18,\n max: 54,\n step: 1,\n description: \"Font size\",\n hiddenFromList: false,\n },\n framesPerCharacter: {\n type: \"number\",\n default: 4,\n min: 1,\n max: 12,\n step: 1,\n description: \"Frames per character\",\n hiddenFromList: false,\n },\n showPanel: {\n type: \"boolean\",\n default: true,\n description: \"Graphic panel\",\n },\n showGuides: {\n type: \"boolean\",\n default: true,\n description: \"Construction guides\",\n },\n color: {\n type: \"color\",\n default: \"#26232b\",\n description: \"Text and markers\",\n },\n fieldColor: {\n type: \"color\",\n default: \"#ffffff\",\n description: \"Search field\",\n },\n ringColor: {\n type: \"color\",\n default: \"#cbc5cf\",\n description: \"Circles and search icon\",\n },\n panelColor: {\n type: \"color\",\n default: \"#a800b7\",\n description: \"Panel color\",\n },\n accentColor: {\n type: \"color\",\n default: \"#e8f99a\",\n description: \"Graphic accents\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#f5f1f5\",\n description: \"Background\",\n },\n reducedMotion: {\n type: \"boolean\",\n default: false,\n description: \"Static final pose\",\n },\n speed: {\n 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\",\"fieldWidth\",\"fontSize\",\"framesPerCharacter\",\"showPanel\",\"showGuides\",\"color\",\"fieldColor\",\"ringColor\",\"panelColor\",\"accentColor\",\"backgroundColor\",\"reducedMotion\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"remocn\",\n fieldWidth: 464,\n fontSize: 34,\n framesPerCharacter: 4,\n showPanel: true,\n showGuides: true,\n color: \"#26232b\",\n fieldColor: \"#ffffff\",\n ringColor: \"#cbc5cf\",\n panelColor: \"#a800b7\",\n accentColor: \"#e8f99a\",\n backgroundColor: \"#f5f1f5\",\n reducedMotion: false,\n speed: 1,\n};\n\ntype SearchRevealElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SearchRevealBase>;\n\nconst SearchRevealInner = forwardRef<\n HTMLDivElement,\n SearchRevealElementProps & { 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 ?? \"<SearchReveal>\"}\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 <SearchRevealBase\n {...(componentProps as unknown as ComponentProps<typeof SearchRevealBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const SearchReveal = Interactive.withSchema({\n Component: SearchRevealInner,\n componentName: \"<SearchReveal>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 90+}diff --git a/registry-artifacts/kinetic-morph-text.json b/registry-artifacts/kinetic-morph-text.jsonnew file mode 100644index 00000000..7c320f07--- /dev/null+++ b/registry-artifacts/kinetic-morph-text.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "kinetic-morph-text",+ "title": "Kinetic Morph Text",+ "description": "Letters lift, rotate, and softly reshape into editable phrases with sampled outline trails.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/kinetic-morph-text/index.tsx",+ "content": "\"use client\";\n\nimport { useId, useLayoutEffect, useMemo, useState } from \"react\";\nimport { Easing, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface KineticMorphTextProps {\n /** One phrase per line, or separate phrases with |. */\n text?: string;\n fontSize?: number;\n fontWeight?: number;\n color?: string;\n backgroundColor?: string;\n /** Flight radius in composition pixels. */\n spread?: number;\n /** Maximum letter rotation in degrees. */\n rotation?: number;\n /** Strength of the soft silhouette blend, from 0 to 1. */\n morph?: number;\n /** Opacity of the sampled outline echoes, from 0 to 1. */\n trails?: number;\n transitionFrames?: number;\n holdFrames?: number;\n loop?: boolean;\n speed?: number;\n className?: string;\n}\n\nexport const kineticMorphTextDefaultText =\n \"Hello | Make it move | Shape what's next\";\n\nconst FONT_FAMILY = \"Arial, Helvetica, sans-serif\";\nconst TRANSITION = 54;\nconst HOLD = 42;\nconst clamp = (value: number) => Math.min(1, Math.max(0, value));\nconst finite = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\nconst ease = Easing.bezier(0.65, 0, 0.25, 1);\nconst smooth = (value: number) => {\n const p = clamp(value);\n return p * p * (3 - 2 * p);\n};\nconst mix = (a: number, b: number, p: number) => a + (b - a) * p;\nconst noise = (index: number) => {\n const value = Math.sin(index * 127.1 + 311.7) * 43758.5453;\n return value - Math.floor(value);\n};\n\nexport function parseKineticMorphText(text: string): string[] {\n return text\n .split(/[|\\n\\r]+/)\n .map((phrase) => phrase.trim().replace(/\\s+/g, \" \"))\n .filter(Boolean);\n}\n\n/** Includes the last readable hold. Timing values are authored at 30 fps. */\nexport function getKineticMorphTextDuration({\n text = kineticMorphTextDefaultText,\n transitionFrames = TRANSITION,\n holdFrames = HOLD,\n speed = 1,\n}: Pick<\n KineticMorphTextProps,\n \"text\" | \"transitionFrames\" | \"holdFrames\" | \"speed\" | \"loop\"\n> = {}): number {\n const count = parseKineticMorphText(text).length;\n const transition = Math.max(1, finite(transitionFrames, TRANSITION));\n const hold = Math.max(0, finite(holdFrames, HOLD));\n const rate = Math.max(0.01, finite(speed, 1));\n // Both modes use one transition + hold per phrase. Loop mode starts with\n // a readable first phrase and spends its last transition returning to it.\n const frames = count * (transition + hold);\n return Math.max(1, Math.ceil(frames / rate));\n}\n\n/** Last moving frame at defaults; the demo adds a final 42-frame hold. */\nexport const kineticMorphTextLength = 246;\n\nexport interface KineticMorphGlyph {\n character: string;\n x: number;\n}\n\nexport interface KineticMorphPair {\n from?: KineticMorphGlyph;\n to?: KineticMorphGlyph;\n}\n\n/** Reserve identical graphemes before pairing remaining replacements. */\nexport function matchKineticMorphGlyphs(\n from: KineticMorphGlyph[],\n to: KineticMorphGlyph[],\n): KineticMorphPair[] {\n const unused = new Set(from.map((_, index) => index));\n const matches = to.map((target) => {\n let closest = -1;\n let distance = Number.POSITIVE_INFINITY;\n for (const index of unused) {\n const source = from[index];\n if (source.character !== target.character) continue;\n const travel = Math.abs(source.x - target.x);\n if (travel < distance) {\n closest = index;\n distance = travel;\n }\n }\n if (closest !== -1) unused.delete(closest);\n return closest;\n });\n const remaining = [...unused];\n const pairs: KineticMorphPair[] = to.map((target, index) => {\n const source = matches[index] === -1 ? remaining.shift() : matches[index];\n return {\n from: source === undefined ? undefined : from[source],\n to: target,\n };\n });\n for (const index of remaining) pairs.push({ from: from[index] });\n return pairs;\n}\n\nexport function getKineticMorphTimeline(\n frame: number,\n count: number,\n transitionFrames = TRANSITION,\n holdFrames = HOLD,\n loop = false,\n) {\n const transition = Math.max(1, finite(transitionFrames, TRANSITION));\n const hold = Math.max(0, finite(holdFrames, HOLD));\n const time = Math.max(0, finite(frame, 0));\n if (count === 0) return { from: -1, to: -1, progress: 1 };\n if (!loop && time < transition) {\n return { from: -1, to: 0, progress: time / transition };\n }\n const cursor = loop ? time : time - transition;\n const cycle = transition + hold;\n const index = Math.floor(cursor / cycle);\n if ((!loop && index >= count - 1) || (loop && count === 1)) {\n return { from: count - 1, to: count - 1, progress: 1 };\n }\n return {\n from: index % count,\n to: (index + 1) % count,\n progress: clamp(((cursor % cycle) - hold) / transition),\n };\n}\n\ninterface PoseOptions {\n spread: number;\n rotation: number;\n morph: number;\n}\n\nexport function getKineticMorphPose(\n pair: KineticMorphPair,\n index: number,\n count: number,\n progress: number,\n { spread, rotation, morph }: PoseOptions,\n) {\n // A bounded stagger keeps long phrases within the same transition window.\n const delay = noise(index + 3) * 0.12;\n const p = clamp((progress - delay) / (1 - delay));\n const travel = ease(p);\n const motion = Math.sin(Math.PI * travel);\n const angle = (index / Math.max(count, 1)) * Math.PI * 2 - Math.PI / 2;\n const orbitX = Math.cos(angle) * spread * (0.7 + noise(index) * 0.4);\n const orbitY = Math.sin(angle) * spread * 0.72 - spread * 0.25;\n const fromX = pair.from?.x ?? orbitX * 1.2;\n const toX = pair.to?.x ?? orbitX * 1.2;\n const fromY = pair.from ? 0 : orbitY + spread * 0.65;\n const toY = pair.to ? 0 : orbitY - spread * 0.6;\n const x = mix(fromX, toX, travel) + orbitX * motion;\n const y = mix(fromY, toY, travel) + orbitY * motion;\n const turn = (noise(index + 9) * 2 - 1) * rotation;\n const rotate = pair.from\n ? pair.to\n ? turn * motion\n : turn * travel\n : turn * (1 - travel);\n const replacement = Boolean(\n pair.from && pair.to && pair.from.character !== pair.to.character,\n );\n const blend = replacement ? smooth((p - 0.36) / 0.28) : 0;\n const melt = replacement ? Math.sin(Math.PI * blend) * morph : 0;\n const opacity = pair.from\n ? pair.to\n ? 1\n : 1 - smooth((p - 0.35) / 0.5)\n : smooth(p / 0.36);\n return {\n x,\n y,\n rotate,\n scaleX: 1 - melt * 0.52 + motion * 0.08,\n scaleY: 1 + melt * 0.42 - motion * 0.06,\n blend,\n melt,\n opacity,\n motion,\n };\n}\n\ninterface Layout {\n key: string;\n phrases: KineticMorphGlyph[][];\n size: number;\n baseline: number;\n}\n\nfunction useGlyphLayout(\n text: string,\n size: number,\n weight: number,\n width: number,\n) {\n const [layout, setLayout] = useState<Layout | null>(null);\n const key = JSON.stringify([text, size, weight, width]);\n\n useLayoutEffect(() => {\n const context = document.createElement(\"canvas\").getContext(\"2d\");\n if (!context) return;\n const segmenter = new Intl.Segmenter(\"en\", { granularity: \"grapheme\" });\n const phrases = parseKineticMorphText(text).map((phrase) =>\n Array.from(segmenter.segment(phrase), ({ segment }) => segment),\n );\n context.font = `${weight} ${size}px ${FONT_FAMILY}`;\n context.fontKerning = \"none\";\n const advances = phrases.map((phrase) =>\n phrase.map((character) => context.measureText(character).width),\n );\n const widths = advances.map((row) =>\n row.reduce((sum, value) => sum + value, 0),\n );\n const fit = Math.min(1, (width * 0.82) / Math.max(1, ...widths));\n const metrics = context.measureText(\"Hg\");\n setLayout({\n key,\n size: size * fit,\n baseline:\n ((metrics.actualBoundingBoxAscent - metrics.actualBoundingBoxDescent) /\n 2) *\n fit,\n phrases: phrases.map((phrase, row) => {\n let cursor = (-widths[row] * fit) / 2;\n return phrase.flatMap((character, column) => {\n const advance = advances[row][column] * fit;\n const x = cursor + advance / 2;\n cursor += advance;\n return character.trim() ? [{ character, x }] : [];\n });\n }),\n });\n }, [key, text, size, weight, width]);\n\n return layout?.key === key ? layout : null;\n}\n\nfunction MorphGlyph({\n pair,\n index,\n count,\n progress,\n options,\n size,\n baseline,\n color,\n trails,\n transitionFrames,\n}: {\n pair: KineticMorphPair;\n index: number;\n count: number;\n progress: number;\n options: PoseOptions;\n size: number;\n baseline: number;\n color: string;\n trails: number;\n transitionFrames: number;\n}) {\n const filterId = useId().replace(/:/g, \"\");\n const pose = getKineticMorphPose(pair, index, count, progress, options);\n const transform = (value: typeof pose) =>\n `translate(${value.x} ${value.y}) rotate(${value.rotate}) scale(${value.scaleX} ${value.scaleY})`;\n const replacement =\n pair.from && pair.to && pair.from.character !== pair.to.character;\n const character = pair.from?.character ?? pair.to?.character;\n\n return (\n <g>\n {trails > 0 && pose.motion > 0.001\n ? [3, 2, 1].map((sample) => {\n const echo = getKineticMorphPose(\n pair,\n index,\n count,\n Math.max(0, progress - (sample * 1.5) / transitionFrames),\n options,\n );\n return (\n <text\n key={sample}\n transform={transform(echo)}\n y={baseline}\n fill=\"none\"\n stroke={color}\n strokeWidth={Math.max(0.7, size * 0.009)}\n opacity={echo.opacity * pose.motion * trails * (1 - sample / 4)}\n >\n {replacement && echo.blend > 0.5\n ? pair.to?.character\n : character}\n </text>\n );\n })\n : null}\n {replacement && pose.melt > 0.001 ? (\n <defs>\n <filter\n id={filterId}\n x=\"-70%\"\n y=\"-70%\"\n width=\"240%\"\n height=\"240%\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur stdDeviation={pose.melt * size * 0.045} />\n <feColorMatrix\n type=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 12 -4\"\n />\n </filter>\n </defs>\n ) : null}\n <g transform={transform(pose)} opacity={pose.opacity}>\n <g\n filter={\n replacement && pose.melt > 0.001 ? `url(#${filterId})` : undefined\n }\n fill={color}\n >\n <text y={baseline} opacity={replacement ? 1 - pose.blend : 1}>\n {character}\n </text>\n {replacement ? (\n <text y={baseline} opacity={pose.blend}>\n {pair.to?.character}\n </text>\n ) : null}\n </g>\n </g>\n </g>\n );\n}\n\nexport function KineticMorphText({\n text = kineticMorphTextDefaultText,\n fontSize = 100,\n fontWeight = 600,\n color = \"#b4f4d9\",\n backgroundColor = \"#a800b7\",\n spread = 180,\n rotation = 110,\n morph = 0.75,\n trails = 0.45,\n transitionFrames = TRANSITION,\n holdFrames = HOLD,\n loop = false,\n speed = 1,\n className,\n}: KineticMorphTextProps) {\n const currentFrame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const frame = currentFrame * (30 / fps) * Math.max(0, finite(speed, 1));\n const size = Math.min(height * 0.28, Math.max(1, finite(fontSize, 100)));\n const weight = Math.min(900, Math.max(100, finite(Number(fontWeight), 600)));\n const layout = useGlyphLayout(text, size, weight, width);\n const transition = Math.max(1, finite(transitionFrames, TRANSITION));\n const timeline = getKineticMorphTimeline(\n frame,\n layout?.phrases.length ?? 0,\n transition,\n holdFrames,\n loop,\n );\n const pairs = useMemo(\n () =>\n matchKineticMorphGlyphs(\n layout?.phrases[timeline.from] ?? [],\n layout?.phrases[timeline.to] ?? [],\n ),\n [layout, timeline.from, timeline.to],\n );\n const options = {\n spread: Math.min(\n width * 0.24,\n height * 0.32,\n Math.max(0, finite(spread, 180)),\n ),\n rotation: Math.max(0, finite(rotation, 110)),\n morph: clamp(finite(morph, 0.75)),\n };\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor,\n overflow: \"hidden\",\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label={parseKineticMorphText(text).join(\". \")}\n style={{\n display: \"block\",\n fontFamily: FONT_FAMILY,\n fontSize: layout?.size ?? size,\n fontWeight: weight,\n fontKerning: \"none\",\n }}\n >\n <g\n transform={`translate(${width / 2} ${height / 2})`}\n textAnchor=\"middle\"\n >\n {layout\n ? pairs.map((pair, index) => (\n <MorphGlyph\n key={`${timeline.from}:${timeline.to}:${index}`}\n pair={pair}\n index={index}\n count={pairs.length}\n progress={timeline.progress}\n options={options}\n size={layout.size}\n baseline={layout.baseline}\n color={color}\n trails={clamp(finite(trails, 0.45))}\n transitionFrames={transition}\n />\n ))\n : null}\n </g>\n </svg>\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/kinetic-morph-text.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/radial-burst.json b/registry-artifacts/radial-burst.jsonnew file mode 100644index 00000000..9095d4b9--- /dev/null+++ b/registry-artifacts/radial-burst.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "radial-burst",+ "title": "Radial Burst",+ "description": "Sculptural ribbons twist into a tilted ring and sweep outward through contour echoes for an expressive product introduction.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/radial-burst/index.tsx",+ "content": "\"use client\";\n\nimport {\n Easing,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface RadialBurstProps {\n /** Number of rounded segments, from 4 to 16. */\n segments?: number;\n /** Burst radius at a 720px reference size. */\n radius?: number;\n /** Segment thickness at a 720px reference size. */\n thickness?: number;\n /** Rotation during assembly, in degrees; negative reverses it. */\n rotation?: number;\n /** Sculptural stretch and tilt, from 0 (classic) to 1.5. */\n intensity?: number;\n /** Curvature of the flying ribbons in degrees. */\n twist?: number;\n /** Number of contour echoes, from 0 to 5. */\n echoes?: number;\n color?: string;\n accentColor?: string;\n backgroundColor?: string;\n speed?: number;\n loop?: boolean;\n className?: string;\n}\n\n/** The ring has completely left the composition by this frame at 30 fps. */\nexport const radialBurstLength = 114;\nconst CYCLE = 120;\nconst finite = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\nconst clamp = (value: number) => Math.min(1, Math.max(0, value));\nconst mix = (from: number, to: number, progress: number) =>\n from + (to - from) * progress;\nconst easeInOut = Easing.bezier(0.65, 0, 0.25, 1);\nconst easeOut = Easing.bezier(0.16, 1, 0.3, 1);\nconst progress = (frame: number, start: number, end: number) =>\n clamp((frame - start) / (end - start));\n\n/** Includes the clean tail, in frames at 30 fps. */\nexport function getRadialBurstDuration({\n speed = 1,\n}: Pick<RadialBurstProps, \"speed\"> = {}) {\n const rate = finite(speed, 1);\n return rate <= 0 ? 1 : Math.max(1, Math.ceil(CYCLE / rate));\n}\n\nexport function getRadialBurstState(\n frame: number,\n {\n segments = 8,\n radius = 210,\n thickness = 30,\n rotation = 135,\n intensity = 1,\n loop = false,\n width = 1280,\n height = 720,\n }: Omit<\n RadialBurstProps,\n \"color\" | \"accentColor\" | \"backgroundColor\" | \"speed\" | \"className\"\n > & {\n width?: number;\n height?: number;\n } = {},\n) {\n const w = Math.max(1, finite(width, 1280));\n const h = Math.max(1, finite(height, 720));\n const unit = Math.min(w, h) / 720;\n const time = Math.max(0, finite(frame, 0));\n const local = loop ? time % CYCLE : time;\n const count = Math.round(Math.min(16, Math.max(4, finite(segments, 8))));\n const burstRadius = Math.min(280, Math.max(100, finite(radius, 210))) * unit;\n const stroke = Math.min(60, Math.max(8, finite(thickness, 30))) * unit;\n const ringRadius = burstRadius * 0.68;\n const assemble = easeInOut(progress(local, 44, 76));\n const curl = easeInOut(progress(local, 48, 78));\n const close = easeInOut(progress(local, 72, 84));\n const anticipate = easeInOut(progress(local, 86, 96));\n const exit = progress(local, 96, radialBurstLength) ** 2.6;\n const launch = spring({\n frame: Math.max(0, local - 18),\n fps: 30,\n durationInFrames: 26,\n config: { damping: 13, stiffness: 170, mass: 0.8 },\n });\n const pop = spring({\n frame: Math.max(0, local - 2),\n fps: 30,\n durationInFrames: 16,\n config: { damping: 11, stiffness: 180, mass: 0.65 },\n });\n const ringStroke = mix(stroke * 0.8, stroke * 1.1, anticipate);\n const exitStroke = mix(ringStroke, stroke * 2.2, exit);\n // The inner edge, not just the centerline, must pass every corner.\n const clearRadius = Math.hypot(w, h) / 2 + stroke * 2.2 + 2;\n const orbitRadius = mix(\n mix(28 * unit, burstRadius, launch),\n ringRadius,\n assemble,\n );\n const finalRadius = mix(ringRadius, ringRadius * 0.84, anticipate);\n const strength = Math.min(1.5, Math.max(0, finite(intensity, 1)));\n const energy = Math.sin(Math.PI * progress(local, 18, 84));\n const tilt =\n easeOut(progress(local, 18, 48)) *\n (1 - easeInOut(progress(local, 96, 114)));\n\n return {\n frame: local,\n count,\n unit,\n strength,\n energy: Math.max(0, energy) * strength,\n planeScale: 1 - tilt * 0.46 * Math.min(1.5, strength),\n planeAngle:\n Math.sin(progress(local, 18, 114) * Math.PI * 1.6) * 32 * strength,\n offsetX:\n Math.sin(Math.PI * progress(local, 18, 114)) * 65 * unit * strength,\n offsetY:\n -Math.sin(Math.PI * progress(local, 18, 114)) * 32 * unit * strength,\n dotRadius: 37 * unit * pop * (1 - easeOut(progress(local, 18, 26))),\n dotSquash: 1 - Math.sin(Math.PI * progress(local, 2, 18)) * 0.16,\n showSegments: local >= 18 && local < 84,\n showRing: local >= 84 && local < radialBurstLength,\n segmentOpacity: easeOut(progress(local, 18, 23)),\n radius: local < 84 ? orbitRadius : mix(finalRadius, clearRadius, exit),\n strokeWidth: local < 84 ? mix(stroke, stroke * 0.8, assemble) : exitStroke,\n segmentLength: mix(\n 12 * unit,\n Math.min(82 * unit, burstRadius * 0.42),\n easeOut(progress(local, 18, 36)),\n ),\n curl,\n // Gaps close with a tiny overlap to prevent raster seams at the weld.\n arcAngle: ((Math.PI * 2) / count) * mix(0.62, 1.002, close),\n rotation: finite(rotation, 135) * easeInOut(progress(local, 34, 84)),\n };\n}\n\n/** A straight rounded spoke curls continuously into a circular arc. */\nfunction getSegmentPoints({\n radius,\n segmentLength,\n arcAngle,\n curl,\n}: Pick<\n ReturnType<typeof getRadialBurstState>,\n \"radius\" | \"segmentLength\" | \"arcAngle\" | \"curl\"\n>) {\n const half = arcAngle / 2;\n const x = radius * Math.cos(half);\n const y = radius * Math.sin(half);\n const tangent = (4 / 3) * Math.tan(arcAngle / 4) * radius;\n const arc = [\n [x, -y],\n [x + tangent * Math.sin(half), -y + tangent * Math.cos(half)],\n [x + tangent * Math.sin(half), y - tangent * Math.cos(half)],\n [x, y],\n ];\n const angle = (curl * Math.PI) / 2;\n return [-0.5, -1 / 6, 1 / 6, 0.5].map((offset, index) => {\n const px = radius + segmentLength * offset * Math.cos(angle);\n const py = segmentLength * offset * Math.sin(angle);\n return [mix(px, arc[index][0], curl), mix(py, arc[index][1], curl)];\n });\n}\n\nexport function getRadialBurstSegmentPath(\n state: Parameters<typeof getSegmentPoints>[0],\n) {\n const points = getSegmentPoints(state).map((point) =>\n point.map((value) => value.toFixed(3)).join(\" \"),\n );\n return `M ${points[0]} C ${points[1]} ${points[2]} ${points[3]}`;\n}\n\n/** Sample a bent centerline and its normals to make a tapered, filled ribbon. */\nexport function getRadialBurstRibbonPath(\n state: ReturnType<typeof getRadialBurstState>,\n index: number,\n twist = 110,\n) {\n const energy = state.energy;\n const points = getSegmentPoints({\n ...state,\n radius: state.radius * (1 + Math.sin(index * 2.4) * energy * 0.15),\n segmentLength: state.segmentLength * (1 + energy * 2.8),\n });\n const bend =\n (Math.min(180, Math.max(-180, finite(twist, 110))) / 110) *\n energy *\n 145 *\n state.unit;\n points[1][1] += bend * 0.55;\n points[2][1] += bend;\n // Carry the tip with the bend so the centerline does not double back into\n // a hairpin while the ribbon transitions from a spoke to an arc.\n points[3][1] += bend * 1.25;\n points[2][0] += energy * 38 * state.unit;\n const upper: string[] = [];\n const lower: string[] = [];\n const format = (x: number, y: number) => `${x.toFixed(3)} ${y.toFixed(3)}`;\n let firstWidth = 0;\n let lastWidth = 0;\n for (let sample = 0; sample <= 36; sample++) {\n const t = sample / 36;\n const q = 1 - t;\n const x =\n q ** 3 * points[0][0] +\n 3 * q * q * t * points[1][0] +\n 3 * q * t * t * points[2][0] +\n t ** 3 * points[3][0];\n const y =\n q ** 3 * points[0][1] +\n 3 * q * q * t * points[1][1] +\n 3 * q * t * t * points[2][1] +\n t ** 3 * points[3][1];\n const dx =\n 3 * q * q * (points[1][0] - points[0][0]) +\n 6 * q * t * (points[2][0] - points[1][0]) +\n 3 * t * t * (points[3][0] - points[2][0]);\n const dy =\n 3 * q * q * (points[1][1] - points[0][1]) +\n 6 * q * t * (points[2][1] - points[1][1]) +\n 3 * t * t * (points[3][1] - points[2][1]);\n const length = Math.max(0.001, Math.hypot(dx, dy));\n const ddx =\n 6 * q * (points[2][0] - 2 * points[1][0] + points[0][0]) +\n 6 * t * (points[3][0] - 2 * points[2][0] + points[1][0]);\n const ddy =\n 6 * q * (points[2][1] - 2 * points[1][1] + points[0][1]) +\n 6 * t * (points[3][1] - 2 * points[2][1] + points[1][1]);\n const curvature = Math.abs(dx * ddy - dy * ddx) / length ** 3;\n const swell = Math.sin(Math.PI * t) ** 1.4;\n // Offset curves fold back on themselves when their width exceeds the\n // bend radius. Limit the width locally to keep tight curls smooth.\n const halfWidth = Math.min(\n (state.strokeWidth / 2) * (1 + energy * (2.4 * swell - 0.65 * t)),\n 0.72 / Math.max(curvature, 0.00001),\n );\n if (sample === 0) firstWidth = halfWidth;\n if (sample === 36) lastWidth = halfWidth;\n upper.push(\n format(x - (dy / length) * halfWidth, y + (dx / length) * halfWidth),\n );\n lower.push(\n format(x + (dy / length) * halfWidth, y - (dx / length) * halfWidth),\n );\n }\n return `M ${upper.join(\" L \")} A ${lastWidth} ${lastWidth} 0 0 0 ${lower[36]} L ${lower.slice(0, -1).reverse().join(\" L \")} A ${firstWidth} ${firstWidth} 0 0 0 ${upper[0]} Z`;\n}\n\nexport function RadialBurst({\n segments = 8,\n radius = 210,\n thickness = 30,\n rotation = 135,\n intensity = 1,\n twist = 110,\n echoes = 3,\n color = \"#ffffff\",\n accentColor = \"#f4e4a7\",\n backgroundColor = \"#a800b7\",\n speed = 1,\n loop = false,\n className,\n}: RadialBurstProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const time = frame * (30 / fps) * Math.max(0, finite(speed, 1));\n const options = {\n segments,\n radius,\n thickness,\n rotation,\n intensity,\n loop,\n width,\n height,\n };\n const state = getRadialBurstState(time, options);\n const path = getRadialBurstSegmentPath(state);\n const echoCount = Math.round(Math.min(5, Math.max(0, finite(echoes, 3))));\n const plane = (pose: typeof state) =>\n `translate(${pose.offsetX} ${pose.offsetY}) rotate(${pose.planeAngle}) scale(1 ${pose.planeScale})`;\n const ribbons = (pose: typeof state, outline: boolean) =>\n Array.from({ length: pose.count }, (_, index) => (\n <path\n key={index}\n d={getRadialBurstRibbonPath(pose, index, twist)}\n transform={`rotate(${(index * 360) / pose.count + pose.rotation - 90 + Math.sin(index * 1.7) * pose.energy * 16})`}\n fill={\n outline\n ? \"none\"\n : index % 3 === 0\n ? interpolateColors(\n clamp(pose.energy),\n [0, 1],\n [color, accentColor],\n )\n : color\n }\n stroke={outline ? color : \"none\"}\n strokeWidth={1.5 * pose.unit}\n />\n ));\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n backgroundColor,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Geometric radial burst\"\n style={{ display: \"block\" }}\n >\n <g transform={`translate(${width / 2} ${height / 2})`}>\n {state.strength > 0 &&\n state.frame >= 18 &&\n state.frame < radialBurstLength\n ? Array.from({ length: echoCount }, (_, index) => {\n const lag = (echoCount - index) * 2.2;\n const echo = getRadialBurstState(\n Math.max(18, state.frame - lag),\n { ...options, loop: false },\n );\n const opacity =\n 0.36 *\n (1 - index / (echoCount + 1)) *\n Math.min(1, state.strength) *\n (1 - easeOut(progress(state.frame, 107, 114)));\n return (\n <g key={index} transform={plane(echo)} opacity={opacity}>\n {echo.showSegments ? (\n ribbons(echo, true)\n ) : echo.showRing ? (\n <circle\n r={echo.radius}\n fill=\"none\"\n stroke={index % 2 ? color : accentColor}\n strokeWidth={echo.strokeWidth * (0.22 + index * 0.07)}\n />\n ) : null}\n </g>\n );\n })\n : null}\n <g transform={plane(state)}>\n {state.dotRadius > 0.001 ? (\n <circle\n r={state.dotRadius}\n fill={color}\n transform={`scale(${1 / state.dotSquash} ${state.dotSquash})`}\n />\n ) : null}\n {state.showSegments && state.strength > 0 ? (\n <g opacity={state.segmentOpacity}>{ribbons(state, false)}</g>\n ) : state.showSegments ? (\n <g\n fill=\"none\"\n stroke={color}\n strokeWidth={state.strokeWidth}\n strokeLinecap=\"round\"\n opacity={state.segmentOpacity}\n transform={`rotate(${state.rotation - 90})`}\n >\n {Array.from({ length: state.count }, (_, index) => (\n <path\n key={index}\n d={path}\n transform={`rotate(${(index * 360) / state.count})`}\n />\n ))}\n </g>\n ) : null}\n {state.showRing ? (\n <circle\n r={state.radius}\n fill=\"none\"\n stroke={color}\n strokeWidth={state.strokeWidth}\n />\n ) : null}\n </g>\n </g>\n </svg>\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/radial-burst.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.jsonindex 54539895..385a2fed 100644--- a/registry-artifacts/registry.json+++ b/registry-artifacts/registry.json@@ -437,6 +437,20 @@],"type": "registry:component"},+ {+ "name": "kinetic-morph-text",+ "title": "Kinetic Morph Text",+ "description": "Letters lift, rotate, and softly reshape into editable phrases with sampled outline trails.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/kinetic-morph-text/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/kinetic-morph-text.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "kinetic-warp","title": "Kinetic Warp",@@ -1493,6 +1507,20 @@],"type": "registry:component"},+ {+ "name": "radial-burst",+ "title": "Radial Burst",+ "description": "Sculptural ribbons twist into a tilted ring and sweep outward through contour echoes for an expressive product introduction.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/radial-burst/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/radial-burst.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "confetti","title": "Confetti",@@ -2165,6 +2193,20 @@],"type": "registry:component"},+ {+ "name": "search-reveal",+ "title": "Search Reveal",+ "description": "Expanding construction circles snap into a search pill, type editable text, and reveal an abstract graphic panel.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/search-reveal/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/search-reveal.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "remocn-ui","title": "remocn UI Core",diff --git a/registry-artifacts/search-reveal.json b/registry-artifacts/search-reveal.jsonnew file mode 100644index 00000000..bea3f54e--- /dev/null+++ b/registry-artifacts/search-reveal.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "search-reveal",+ "title": "Search Reveal",+ "description": "Expanding construction circles snap into a search pill, type editable text, and reveal an abstract graphic panel.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/search-reveal/index.tsx",+ "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type SearchRevealProps = {\n text?: string;\n fieldWidth?: number;\n fontSize?: number;\n framesPerCharacter?: number;\n showPanel?: boolean;\n showGuides?: boolean;\n color?: string;\n fieldColor?: string;\n ringColor?: string;\n panelColor?: string;\n accentColor?: string;\n backgroundColor?: string;\n speed?: number;\n reducedMotion?: boolean;\n className?: string;\n};\n\nexport const searchRevealLength = 90;\nconst finite = (value: number | undefined, fallback: number) =>\n typeof value === \"number\" && Number.isFinite(value) ? value : fallback;\nconst clamp = (value: number, min: number, max: number) =>\n Math.min(max, Math.max(min, value));\nconst letters = (text: string) =>\n Array.from(\n new Intl.Segmenter(\"en\", { granularity: \"grapheme\" }).segment(text),\n (part) => part.segment,\n );\nconst curve = Easing.bezier(0.22, 1, 0.36, 1);\nconst tween = (frame: number, start: number, end: number, from = 0, to = 1) =>\n interpolate(frame, [start, end], [from, to], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: curve,\n });\n\nfunction timing(props: SearchRevealProps) {\n const characters = letters(props.text ?? \"remocn\");\n const step = clamp(finite(props.framesPerCharacter, 4), 1, 12);\n const end = Math.max(searchRevealLength, 54 + characters.length * step + 10);\n return { characters, step, end, speed: Math.max(0, finite(props.speed, 1)) };\n}\n\n/** Demo duration at 30 fps, including an 18-frame final hold. */\nexport function getSearchRevealDuration(props: SearchRevealProps = {}) {\n const { end, speed } = timing(props);\n return speed === 0 ? 1 : Math.ceil((end + 18) / speed);\n}\n\n/** Frame is expressed at 30 fps; playback speed is applied here. */\nexport function getSearchRevealState(\n frame: number,\n props: SearchRevealProps = {},\n) {\n const { characters, step, end, speed } = timing(props);\n const t = props.reducedMotion ? end : Math.max(0, finite(frame, 0)) * speed;\n const typedCount = clamp(Math.floor((t - 54) / step), 0, characters.length);\n const width = clamp(finite(props.fieldWidth, 464), 320, 640);\n const reveal = props.showPanel === false ? 0 : tween(t, 56, 90);\n const fieldWidth = tween(t, 26, 48, 130, width);\n const fieldHeight = tween(t, 26, 46, 24, 80);\n const panelWidth =\n fieldWidth + (Math.max(774, width + 170) - fieldWidth) * reveal;\n const panelHeight = fieldHeight + (374 - fieldHeight) * reveal;\n return {\n t,\n end,\n typedCount,\n text: characters.slice(0, typedCount).join(\"\"),\n circleRadius: tween(t, 0, 26, 250, 410),\n circleOffset: tween(t, 0, 26, 62, 185),\n circlesVisible: t < 26,\n fieldVisible: t >= 26,\n fieldWidth,\n fieldHeight,\n tilt: tween(t, 26, 47, -4, 0),\n iconOpacity: tween(t, 34, 46),\n panelWidth,\n panelHeight,\n panelRadius: 40 * (1 - reveal),\n panelOpacity: tween(t, 56, 60),\n reveal,\n caretVisible:\n t >= 52 &&\n t < end &&\n (typedCount < characters.length || Math.floor((t - 52) / 12) % 2 === 0),\n };\n}\n\nfunction Cross({ x, y, size = 9 }: { x: number; y: number; size?: number }) {\n return (\n <path\n d={`M ${x - size} ${y} H ${x + size} M ${x} ${y - size} V ${y + size}`}\n />\n );\n}\n\n/** A video scene: expanding construction circles, a search pill, and typed copy. */\nexport function SearchReveal({\n text = \"remocn\",\n fieldWidth = 464,\n fontSize = 34,\n framesPerCharacter = 4,\n showPanel = true,\n showGuides = true,\n color = \"#26232b\",\n fieldColor = \"#ffffff\",\n ringColor = \"#cbc5cf\",\n panelColor = \"#a800b7\",\n accentColor = \"#e8f99a\",\n backgroundColor = \"#f5f1f5\",\n speed = 1,\n reducedMotion = false,\n className,\n}: SearchRevealProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const state = getSearchRevealState((frame * 30) / fps, {\n text,\n fieldWidth,\n framesPerCharacter,\n showPanel,\n speed,\n reducedMotion,\n });\n const scale = Math.min(width / 1280, height / 720);\n const fittedFont = Math.min(\n clamp(finite(fontSize, 34), 18, 54),\n (state.fieldWidth - 120) / Math.max(1, letters(text).length * 0.65),\n );\n const markerWidth = showPanel ? state.panelWidth : state.fieldWidth;\n const markerHeight = showPanel ? state.panelHeight : state.fieldHeight;\n\n return (\n <AbsoluteFill\n className={className}\n style={{\n backgroundColor,\n overflow: \"hidden\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 1280,\n height: 720,\n flexShrink: 0,\n position: \"relative\",\n transform: `scale(${scale})`,\n }}\n >\n {state.circlesVisible && (\n <svg\n aria-hidden=\"true\"\n width=\"1280\"\n height=\"720\"\n viewBox=\"-640 -360 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n <g fill=\"none\" stroke={ringColor} strokeWidth=\"1\">\n {[-1, 1].map((side) => (\n <g key={side}>\n <circle\n cx={side * state.circleOffset}\n r={state.circleRadius}\n />\n {showGuides &&\n [-1, 1].map((edge) => (\n <Cross\n key={edge}\n x={\n side * state.circleOffset + edge * state.circleRadius\n }\n y={0}\n size={6}\n />\n ))}\n </g>\n ))}\n </g>\n </svg>\n )}\n {state.fieldVisible && (\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: 0,\n height: 0,\n transform: `rotate(${state.tilt}deg)`,\n }}\n >\n {showPanel && (\n <div\n style={{\n position: \"absolute\",\n left: -state.panelWidth / 2,\n top: -state.panelHeight / 2,\n width: state.panelWidth,\n height: state.panelHeight,\n borderRadius: state.panelRadius,\n overflow: \"hidden\",\n opacity: state.panelOpacity,\n backgroundColor: panelColor,\n }}\n >\n <svg\n aria-hidden=\"true\"\n width=\"844\"\n height=\"374\"\n viewBox=\"0 0 844 374\"\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n transform: `translate(-50%, -50%) scale(${1.07 - state.reveal * 0.07})`,\n }}\n >\n <g\n transform={`translate(310 -45) rotate(${-24 + 10 * state.reveal})`}\n fill=\"none\"\n stroke={fieldColor}\n >\n {Array.from({ length: 30 }, (_, i) => (\n <ellipse\n key={i}\n rx={82 + i * 3}\n ry={118}\n transform={`rotate(${i * 6})`}\n strokeWidth=\"1.4\"\n opacity={0.35 + i / 70}\n />\n ))}\n </g>\n <g\n transform={`translate(65 233) rotate(${state.reveal * 25})`}\n fill={accentColor}\n >\n {Array.from({ length: 10 }, (_, i) => (\n <ellipse\n key={i}\n cy=\"-41\"\n rx=\"19\"\n ry=\"48\"\n transform={`rotate(${i * 36})`}\n />\n ))}\n </g>\n <g\n transform={`translate(720 357) rotate(${-18 * state.reveal})`}\n fill=\"none\"\n stroke={accentColor}\n strokeWidth=\"22\"\n >\n <path d=\"M -68 -115 V 80 M -122 -60 L -14 26 M -125 18 L -12 -61\" />\n <circle cx=\"103\" cy=\"-35\" r=\"54\" />\n </g>\n </svg>\n </div>\n )}\n {showGuides && (\n <svg\n aria-hidden=\"true\"\n width=\"1280\"\n height=\"720\"\n viewBox=\"-640 -360 1280 720\"\n style={{\n position: \"absolute\",\n left: -640,\n top: -360,\n overflow: \"visible\",\n }}\n >\n <g\n fill=\"none\"\n stroke={ringColor}\n strokeWidth=\"1\"\n opacity={0.5 * state.iconOpacity}\n >\n <path\n d={`M ${markerWidth / 2} ${-markerHeight / 2 - 14} V -360 M ${-markerWidth / 2} ${markerHeight / 2 + 14} V 360`}\n />\n </g>\n <g fill=\"none\" stroke={color} strokeWidth=\"1.5\">\n <Cross x={-markerWidth / 2} y={markerHeight / 2} />\n <Cross x={markerWidth / 2} y={-markerHeight / 2} />\n </g>\n </svg>\n )}\n <div\n style={{\n position: \"absolute\",\n left: -state.fieldWidth / 2,\n top: -state.fieldHeight / 2,\n width: state.fieldWidth,\n height: state.fieldHeight,\n borderRadius: 999,\n backgroundColor: fieldColor,\n boxShadow: \"0 3px 12px #26232b08, inset 0 0 0 1px #26232b0a\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n color,\n fontFamily: \"Arial, Helvetica, sans-serif\",\n fontSize: fittedFont,\n fontWeight: 400,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n maxWidth: state.fieldWidth - 116,\n overflow: \"hidden\",\n whiteSpace: \"pre\",\n }}\n >\n <span>{state.text}</span>\n <span\n aria-hidden=\"true\"\n style={{\n width: 1.5,\n height: fittedFont * 1.12,\n marginLeft: 2,\n flexShrink: 0,\n backgroundColor: color,\n opacity: state.caretVisible ? 1 : 0,\n }}\n />\n </div>\n <svg\n aria-hidden=\"true\"\n width=\"28\"\n height=\"28\"\n viewBox=\"0 0 28 28\"\n fill=\"none\"\n stroke={ringColor}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n style={{\n position: \"absolute\",\n right: 24,\n opacity: state.iconOpacity,\n }}\n >\n <circle cx=\"11.5\" cy=\"11.5\" r=\"7.5\" />\n <path d=\"m17 17 7 7\" />\n </svg>\n </div>\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/search-reveal.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex 2d3ba514..752513b1 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -12,6 +12,16 @@ export interface RegistryEntry {}const registry: Record<string, RegistryEntry> = {+ "search-reveal": {+ load: () =>+ import("@/registry/remocn/search-reveal").then((m) => ({+ default: m.SearchReveal,+ })),+ loadConfig: () =>+ import("@/registry/remocn/search-reveal/config").then(+ (m) => m.searchRevealConfig,+ ),+ },"soft-blur-in": {load: () =>import("@/registry/remocn/soft-blur-in").then((m) => ({@@ -500,6 +510,16 @@ const registry: Record<string, RegistryEntry> = {(m) => m.perspectiveSqueezeConfig,),},+ "kinetic-morph-text": {+ load: () =>+ import("@/registry/remocn/kinetic-morph-text").then((m) => ({+ default: m.KineticMorphText,+ })),+ loadConfig: () =>+ import("@/registry/remocn/kinetic-morph-text/config").then(+ (m) => m.kineticMorphTextConfig,+ ),+ },"kinetic-warp": {load: () =>import("@/registry/remocn/kinetic-warp").then((m) => ({@@ -2226,6 +2246,16 @@ const registry: Record<string, RegistryEntry> = {(m) => m.xFollowersOverviewConfig,),},+ "radial-burst": {+ load: () =>+ import("@/registry/remocn/radial-burst").then((m) => ({+ default: m.RadialBurst,+ })),+ loadConfig: () =>+ import("@/registry/remocn/radial-burst/config").then(+ (m) => m.radialBurstConfig,+ ),+ },confetti: {load: () =>import("@/registry/remocn/confetti").then((m) => ({diff --git a/registry/__manifest__.ts b/registry/__manifest__.tsindex e5af075d..e95adb1f 100644--- a/registry/__manifest__.ts+++ b/registry/__manifest__.ts@@ -2645,6 +2645,27 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "kinetic-morph-text": {+ durationInFrames: 288,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ defaults: {+ text: "Hello | Make it move | Shape what's next",+ fontSize: 100,+ fontWeight: "600",+ spread: 180,+ rotation: 110,+ morph: 0.75,+ trails: 0.45,+ transitionFrames: 54,+ holdFrames: 42,+ loop: false,+ color: "#b4f4d9",+ backgroundColor: "#a800b7",+ speed: 1,+ },+ },"kinetic-warp": {durationInFrames: 120,fps: 30,@@ -3118,6 +3139,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "radial-burst": {+ durationInFrames: 120,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ defaults: {+ segments: 8,+ radius: 210,+ thickness: 30,+ rotation: 135,+ intensity: 1,+ twist: 110,+ echoes: 3,+ color: "#ffffff",+ accentColor: "#f4e4a7",+ backgroundColor: "#a800b7",+ loop: false,+ speed: 1,+ },+ },radio: {durationInFrames: 120,fps: 30,@@ -3248,6 +3289,8 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {phrase: "gone before you look",fontSize: 68,fontWeight: "400",+ color: "#ffffff",+ backgroundColor: "#000000",verticalStretch: 7,chromaticSpread: 1,restDuration: 12,@@ -3293,6 +3336,28 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "search-reveal": {+ durationInFrames: 108,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ defaults: {+ text: "remocn",+ fieldWidth: 464,+ fontSize: 34,+ framesPerCharacter: 4,+ showPanel: true,+ showGuides: true,+ color: "#26232b",+ fieldColor: "#ffffff",+ ringColor: "#cbc5cf",+ panelColor: "#a800b7",+ accentColor: "#e8f99a",+ backgroundColor: "#f5f1f5",+ reducedMotion: false,+ speed: 1,+ },+ },"security-cam": {durationInFrames: 90,fps: 30,@@ -3342,6 +3407,21 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "select-menu": {+ durationInFrames: 128,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "oklch(1 0 0)",+ },+ defaults: {+ selectedIndex: 1,+ variant: "soft",+ speed: 1,+ },+ },"shader-caustics": {durationInFrames: 150,fps: 30,diff --git a/registry/remocn/kinetic-morph-text/__tests__/kinetic-morph-text.test.ts b/registry/remocn/kinetic-morph-text/__tests__/kinetic-morph-text.test.tsnew file mode 100644index 00000000..bd04b3a5--- /dev/null+++ b/registry/remocn/kinetic-morph-text/__tests__/kinetic-morph-text.test.ts@@ -0,0 +1,192 @@+import { describe, expect, it } from "bun:test";+import {+ getKineticMorphPose,+ getKineticMorphTextDuration,+ getKineticMorphTimeline,+ type KineticMorphGlyph,+ matchKineticMorphGlyphs,+ parseKineticMorphText,+} from "..";+import { kineticMorphTextConfig } from "../config";++const glyphs = (text: string): KineticMorphGlyph[] =>+ Array.from(text, (character, index) => ({ character, x: index * 50 - 100 }));+const options = { spread: 180, rotation: 110, morph: 0.75 };++describe("editable phrases", () => {+ it("preserves phrase boundaries and punctuation while ignoring empty entries", () => {+ expect(+ parseKineticMorphText(' Hello! |\n Make "it" move \r\n | Go '),+ ).toEqual(["Hello!", 'Make "it" move', "Go"]);+ expect(parseKineticMorphText(" |\n\r ")).toEqual([]);+ });++ it("reserves all repeated matching letters before assigning replacements", () => {+ const source = glyphs("letter");+ const target = glyphs("better");+ const pairs = matchKineticMorphGlyphs(source, target);+ expect(pairs.map((pair) => pair.to)).toEqual(target);+ expect(new Set(pairs.map((pair) => pair.from)).size).toBe(source.length);+ expect(+ pairs.filter((pair) => pair.from?.character === pair.to?.character),+ ).toHaveLength(5);+ expect(pairs[0].from?.character).toBe("l");+ });++ it("reorders matching letters without duplicating or losing a source glyph", () => {+ const source = glyphs("loop");+ const pairs = matchKineticMorphGlyphs(source, glyphs("pool"));+ expect(+ pairs.every((pair) => pair.from?.character === pair.to?.character),+ ).toBe(true);+ expect(new Set(pairs.map((pair) => pair.from))).toEqual(new Set(source));+ });++ it("accounts for unequal lengths and completely empty input", () => {+ const growing = matchKineticMorphGlyphs(glyphs("A"), glyphs("MAGIC"));+ expect(growing.filter((pair) => !pair.from)).toHaveLength(4);+ const shrinking = matchKineticMorphGlyphs(glyphs("MAGIC"), glyphs("A"));+ expect(shrinking.filter((pair) => !pair.to)).toHaveLength(4);+ expect(matchKineticMorphGlyphs([], [])).toEqual([]);+ });+});++describe("timeline and preview duration", () => {+ it("keeps the last phrase after the sequence and allocates every phrase a hold", () => {+ expect(getKineticMorphTextDuration()).toBe(288);+ expect(getKineticMorphTimeline(0, 3)).toEqual({+ from: -1,+ to: 0,+ progress: 0,+ });+ expect(getKineticMorphTimeline(70, 3)).toEqual({+ from: 0,+ to: 1,+ progress: 0,+ });+ expect(getKineticMorphTimeline(123, 3)).toEqual({+ from: 0,+ to: 1,+ progress: 0.5,+ });+ expect(getKineticMorphTimeline(246, 3)).toEqual({+ from: 2,+ to: 2,+ progress: 1,+ });+ expect(getKineticMorphTimeline(10000, 3)).toEqual({+ from: 2,+ to: 2,+ progress: 1,+ });+ });++ it("loops continuously back to the initial readable phrase", () => {+ expect(getKineticMorphTimeline(0, 3, 54, 42, true)).toEqual({+ from: 0,+ to: 1,+ progress: 0,+ });+ expect(getKineticMorphTimeline(287, 3, 54, 42, true).to).toBe(0);+ expect(getKineticMorphTimeline(288, 3, 54, 42, true)).toEqual(+ getKineticMorphTimeline(0, 3, 54, 42, true),+ );+ expect(getKineticMorphTimeline(10000, 1, 54, 42, true)).toEqual({+ from: 0,+ to: 0,+ progress: 1,+ });+ expect(getKineticMorphTimeline(100, 0)).toEqual({+ from: -1,+ to: -1,+ progress: 1,+ });+ });++ it("extends the actual customizer preview for more phrases and slower playback", () => {+ const resolve = kineticMorphTextConfig.getDurationInFrames;+ expect(resolve?.({ text: "One | Two | Three | Four", speed: 0.5 })).toBe(+ 768,+ );+ expect(+ resolve?.({+ text: "One",+ transitionFrames: 20,+ holdFrames: 10,+ speed: 2,+ }),+ ).toBe(15);+ expect(resolve?.({ text: "" })).toBe(1);+ expect(+ Number.isFinite(+ getKineticMorphTextDuration({+ transitionFrames: Number.NaN,+ holdFrames: -10,+ speed: 0,+ }),+ ),+ ).toBe(true);+ });++ it("generates valid JSX for edited quotes, newlines, and numeric font weight", () => {+ const code = kineticMorphTextConfig.snippet?.({+ text: 'Say "hello"\nLet\'s move',+ fontWeight: "600",+ loop: false,+ });+ expect(() =>+ new Bun.Transpiler({ loader: "tsx" }).transformSync(code ?? ""),+ ).not.toThrow();+ expect(code).toContain("fontWeight={600}");+ expect(code).toContain("loop={false}");+ });+});++describe("letter flight", () => {+ it("lands every source/target exactly at the measured positions", () => {+ for (const [index, pair] of matchKineticMorphGlyphs(+ glyphs("Hello"),+ glyphs("Goodbye!"),+ ).entries()) {+ const start = getKineticMorphPose(pair, index, 8, 0, options);+ const end = getKineticMorphPose(pair, index, 8, 1, options);+ if (pair.from) {+ expect(start.x).toBeCloseTo(pair.from.x);+ expect(start.y).toBeCloseTo(0);+ expect(start.opacity).toBe(1);+ } else expect(start.opacity).toBe(0);+ if (pair.to) {+ expect(end.x).toBeCloseTo(pair.to.x);+ expect(end.y).toBeCloseTo(0);+ expect(end.rotate).toBeCloseTo(0);+ expect(end.scaleX).toBeCloseTo(1);+ expect(end.scaleY).toBeCloseTo(1);+ expect(end.opacity).toBe(1);+ } else expect(end.opacity).toBe(0);+ }+ });++ it("preserves common glyphs and produces the same pose when seeking backward", () => {+ const pair = { from: glyphs("o")[0], to: { character: "o", x: 200 } };+ const middle = getKineticMorphPose(pair, 2, 8, 0.5, options);+ expect(middle.blend).toBe(0);+ expect(middle.melt).toBe(0);+ expect(Math.abs(middle.y)).toBeGreaterThan(1);+ getKineticMorphPose(pair, 2, 8, 1, options);+ expect(getKineticMorphPose(pair, 2, 8, 0.5, options)).toEqual(middle);+ });++ it("clears deformation and exposes independent motion controls", () => {+ const pair = { from: glyphs("a")[0], to: glyphs("b")[0] };+ const pose = getKineticMorphPose(pair, 0, 1, 0.55, {+ spread: 0,+ rotation: 0,+ morph: 0,+ });+ expect(pose.y).toBe(0);+ expect(pose.rotate).toBe(0);+ expect(pose.melt).toBe(0);+ expect(pose.blend).toBeGreaterThan(0);+ expect(pose.blend).toBeLessThan(1);+ });+});diff --git a/registry/remocn/kinetic-morph-text/config.ts b/registry/remocn/kinetic-morph-text/config.tsnew file mode 100644index 00000000..142c1ead--- /dev/null+++ b/registry/remocn/kinetic-morph-text/config.ts@@ -0,0 +1,117 @@+import {+ type ComponentConfig,+ enumVariants,+ FONT_WEIGHT_OPTIONS,+ FPS,+ H,+ W,+} from "@/lib/customizer-config";+import { getKineticMorphTextDuration } from ".";++export const kineticMorphTextConfig: ComponentConfig = {+ componentName: "KineticMorphText",+ importPath: "@/components/remocn/kinetic-morph-text",+ controls: {+ text: {+ type: "text-content",+ default: "Hello | Make it move | Shape what's next",+ description: "Phrases (separate with |)",+ },+ fontSize: {+ type: "number",+ default: 100,+ min: 24,+ max: 180,+ step: 1,+ description: "Font size",+ hiddenFromList: false,+ },+ fontWeight: {+ type: "enum",+ default: "600",+ variants: enumVariants(FONT_WEIGHT_OPTIONS),+ description: "Font weight",+ },+ spread: {+ type: "number",+ default: 180,+ min: 0,+ max: 230,+ step: 5,+ description: "Flight spread",+ hiddenFromList: false,+ },+ rotation: {+ type: "number",+ default: 110,+ min: 0,+ max: 240,+ step: 5,+ description: "Rotation",+ hiddenFromList: false,+ },+ morph: {+ type: "number",+ default: 0.75,+ min: 0,+ max: 1,+ step: 0.05,+ description: "Morph strength",+ hiddenFromList: false,+ },+ trails: {+ type: "number",+ default: 0.45,+ min: 0,+ max: 1,+ step: 0.05,+ description: "Outline trails",+ hiddenFromList: false,+ },+ transitionFrames: {+ type: "number",+ default: 54,+ min: 18,+ max: 90,+ step: 1,+ description: "Transition frames",+ hiddenFromList: false,+ },+ holdFrames: {+ type: "number",+ default: 42,+ min: 0,+ max: 90,+ step: 1,+ description: "Hold frames",+ hiddenFromList: false,+ },+ loop: {+ type: "boolean",+ default: false,+ description: "Loop phrases",+ },+ color: {+ type: "color",+ default: "#b4f4d9",+ description: "Text color",+ },+ backgroundColor: {+ type: "color",+ default: "#a800b7",+ description: "Background",+ },+ },+ durationInFrames: 288,+ getDurationInFrames: (values) => getKineticMorphTextDuration(values),+ snippet: (values) => {+ const props = Object.entries(values).map(([name, value]) => {+ const typedValue = name === "fontWeight" ? Number(value) : value;+ return ` ${name}={${JSON.stringify(typedValue)}}`;+ });+ return `import { KineticMorphText } from "@/components/remocn/kinetic-morph-text";\n\n<KineticMorphText\n${props.join("\n")}\n/>`;+ },+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/kinetic-morph-text/index.tsx b/registry/remocn/kinetic-morph-text/index.tsxnew file mode 100644index 00000000..5ca70888--- /dev/null+++ b/registry/remocn/kinetic-morph-text/index.tsx@@ -0,0 +1,454 @@+"use client";++import { useId, useLayoutEffect, useMemo, useState } from "react";+import { Easing, useCurrentFrame, useVideoConfig } from "remotion";++export interface KineticMorphTextProps {+ /** One phrase per line, or separate phrases with |. */+ text?: string;+ fontSize?: number;+ fontWeight?: number;+ color?: string;+ backgroundColor?: string;+ /** Flight radius in composition pixels. */+ spread?: number;+ /** Maximum letter rotation in degrees. */+ rotation?: number;+ /** Strength of the soft silhouette blend, from 0 to 1. */+ morph?: number;+ /** Opacity of the sampled outline echoes, from 0 to 1. */+ trails?: number;+ transitionFrames?: number;+ holdFrames?: number;+ loop?: boolean;+ speed?: number;+ className?: string;+}++export const kineticMorphTextDefaultText =+ "Hello | Make it move | Shape what's next";++const FONT_FAMILY = "Arial, Helvetica, sans-serif";+const TRANSITION = 54;+const HOLD = 42;+const clamp = (value: number) => Math.min(1, Math.max(0, value));+const finite = (value: number, fallback: number) =>+ Number.isFinite(value) ? value : fallback;+const ease = Easing.bezier(0.65, 0, 0.25, 1);+const smooth = (value: number) => {+ const p = clamp(value);+ return p * p * (3 - 2 * p);+};+const mix = (a: number, b: number, p: number) => a + (b - a) * p;+const noise = (index: number) => {+ const value = Math.sin(index * 127.1 + 311.7) * 43758.5453;+ return value - Math.floor(value);+};++export function parseKineticMorphText(text: string): string[] {+ return text+ .split(/[|\n\r]+/)+ .map((phrase) => phrase.trim().replace(/\s+/g, " "))+ .filter(Boolean);+}++/** Includes the last readable hold. Timing values are authored at 30 fps. */+export function getKineticMorphTextDuration({+ text = kineticMorphTextDefaultText,+ transitionFrames = TRANSITION,+ holdFrames = HOLD,+ speed = 1,+}: Pick<+ KineticMorphTextProps,+ "text" | "transitionFrames" | "holdFrames" | "speed" | "loop"+> = {}): number {+ const count = parseKineticMorphText(text).length;+ const transition = Math.max(1, finite(transitionFrames, TRANSITION));+ const hold = Math.max(0, finite(holdFrames, HOLD));+ const rate = Math.max(0.01, finite(speed, 1));+ // Both modes use one transition + hold per phrase. Loop mode starts with+ // a readable first phrase and spends its last transition returning to it.+ const frames = count * (transition + hold);+ return Math.max(1, Math.ceil(frames / rate));+}++/** Last moving frame at defaults; the demo adds a final 42-frame hold. */+export const kineticMorphTextLength = 246;++export interface KineticMorphGlyph {+ character: string;+ x: number;+}++export interface KineticMorphPair {+ from?: KineticMorphGlyph;+ to?: KineticMorphGlyph;+}++/** Reserve identical graphemes before pairing remaining replacements. */+export function matchKineticMorphGlyphs(+ from: KineticMorphGlyph[],+ to: KineticMorphGlyph[],+): KineticMorphPair[] {+ const unused = new Set(from.map((_, index) => index));+ const matches = to.map((target) => {+ let closest = -1;+ let distance = Number.POSITIVE_INFINITY;+ for (const index of unused) {+ const source = from[index];+ if (source.character !== target.character) continue;+ const travel = Math.abs(source.x - target.x);+ if (travel < distance) {+ closest = index;+ distance = travel;+ }+ }+ if (closest !== -1) unused.delete(closest);+ return closest;+ });+ const remaining = [...unused];+ const pairs: KineticMorphPair[] = to.map((target, index) => {+ const source = matches[index] === -1 ? remaining.shift() : matches[index];+ return {+ from: source === undefined ? undefined : from[source],+ to: target,+ };+ });+ for (const index of remaining) pairs.push({ from: from[index] });+ return pairs;+}++export function getKineticMorphTimeline(+ frame: number,+ count: number,+ transitionFrames = TRANSITION,+ holdFrames = HOLD,+ loop = false,+) {+ const transition = Math.max(1, finite(transitionFrames, TRANSITION));+ const hold = Math.max(0, finite(holdFrames, HOLD));+ const time = Math.max(0, finite(frame, 0));+ if (count === 0) return { from: -1, to: -1, progress: 1 };+ if (!loop && time < transition) {+ return { from: -1, to: 0, progress: time / transition };+ }+ const cursor = loop ? time : time - transition;+ const cycle = transition + hold;+ const index = Math.floor(cursor / cycle);+ if ((!loop && index >= count - 1) || (loop && count === 1)) {+ return { from: count - 1, to: count - 1, progress: 1 };+ }+ return {+ from: index % count,+ to: (index + 1) % count,+ progress: clamp(((cursor % cycle) - hold) / transition),+ };+}++interface PoseOptions {+ spread: number;+ rotation: number;+ morph: number;+}++export function getKineticMorphPose(+ pair: KineticMorphPair,+ index: number,+ count: number,+ progress: number,+ { spread, rotation, morph }: PoseOptions,+) {+ // A bounded stagger keeps long phrases within the same transition window.+ const delay = noise(index + 3) * 0.12;+ const p = clamp((progress - delay) / (1 - delay));+ const travel = ease(p);+ const motion = Math.sin(Math.PI * travel);+ const angle = (index / Math.max(count, 1)) * Math.PI * 2 - Math.PI / 2;+ const orbitX = Math.cos(angle) * spread * (0.7 + noise(index) * 0.4);+ const orbitY = Math.sin(angle) * spread * 0.72 - spread * 0.25;+ const fromX = pair.from?.x ?? orbitX * 1.2;+ const toX = pair.to?.x ?? orbitX * 1.2;+ const fromY = pair.from ? 0 : orbitY + spread * 0.65;+ const toY = pair.to ? 0 : orbitY - spread * 0.6;+ const x = mix(fromX, toX, travel) + orbitX * motion;+ const y = mix(fromY, toY, travel) + orbitY * motion;+ const turn = (noise(index + 9) * 2 - 1) * rotation;+ const rotate = pair.from+ ? pair.to+ ? turn * motion+ : turn * travel+ : turn * (1 - travel);+ const replacement = Boolean(+ pair.from && pair.to && pair.from.character !== pair.to.character,+ );+ const blend = replacement ? smooth((p - 0.36) / 0.28) : 0;+ const melt = replacement ? Math.sin(Math.PI * blend) * morph : 0;+ const opacity = pair.from+ ? pair.to+ ? 1+ : 1 - smooth((p - 0.35) / 0.5)+ : smooth(p / 0.36);+ return {+ x,+ y,+ rotate,+ scaleX: 1 - melt * 0.52 + motion * 0.08,+ scaleY: 1 + melt * 0.42 - motion * 0.06,+ blend,+ melt,+ opacity,+ motion,+ };+}++interface Layout {+ key: string;+ phrases: KineticMorphGlyph[][];+ size: number;+ baseline: number;+}++function useGlyphLayout(+ text: string,+ size: number,+ weight: number,+ width: number,+) {+ const [layout, setLayout] = useState<Layout | null>(null);+ const key = JSON.stringify([text, size, weight, width]);++ useLayoutEffect(() => {+ const context = document.createElement("canvas").getContext("2d");+ if (!context) return;+ const segmenter = new Intl.Segmenter("en", { granularity: "grapheme" });+ const phrases = parseKineticMorphText(text).map((phrase) =>+ Array.from(segmenter.segment(phrase), ({ segment }) => segment),+ );+ context.font = `${weight} ${size}px ${FONT_FAMILY}`;+ context.fontKerning = "none";+ const advances = phrases.map((phrase) =>+ phrase.map((character) => context.measureText(character).width),+ );+ const widths = advances.map((row) =>+ row.reduce((sum, value) => sum + value, 0),+ );+ const fit = Math.min(1, (width * 0.82) / Math.max(1, ...widths));+ const metrics = context.measureText("Hg");+ setLayout({+ key,+ size: size * fit,+ baseline:+ ((metrics.actualBoundingBoxAscent - metrics.actualBoundingBoxDescent) /+ 2) *+ fit,+ phrases: phrases.map((phrase, row) => {+ let cursor = (-widths[row] * fit) / 2;+ return phrase.flatMap((character, column) => {+ const advance = advances[row][column] * fit;+ const x = cursor + advance / 2;+ cursor += advance;+ return character.trim() ? [{ character, x }] : [];+ });+ }),+ });+ }, [key, text, size, weight, width]);++ return layout?.key === key ? layout : null;+}++function MorphGlyph({+ pair,+ index,+ count,+ progress,+ options,+ size,+ baseline,+ color,+ trails,+ transitionFrames,+}: {+ pair: KineticMorphPair;+ index: number;+ count: number;+ progress: number;+ options: PoseOptions;+ size: number;+ baseline: number;+ color: string;+ trails: number;+ transitionFrames: number;+}) {+ const filterId = useId().replace(/:/g, "");+ const pose = getKineticMorphPose(pair, index, count, progress, options);+ const transform = (value: typeof pose) =>+ `translate(${value.x} ${value.y}) rotate(${value.rotate}) scale(${value.scaleX} ${value.scaleY})`;+ const replacement =+ pair.from && pair.to && pair.from.character !== pair.to.character;+ const character = pair.from?.character ?? pair.to?.character;++ return (+ <g>+ {trails > 0 && pose.motion > 0.001+ ? [3, 2, 1].map((sample) => {+ const echo = getKineticMorphPose(+ pair,+ index,+ count,+ Math.max(0, progress - (sample * 1.5) / transitionFrames),+ options,+ );+ return (+ <text+ key={sample}+ transform={transform(echo)}+ y={baseline}+ fill="none"+ stroke={color}+ strokeWidth={Math.max(0.7, size * 0.009)}+ opacity={echo.opacity * pose.motion * trails * (1 - sample / 4)}+ >+ {replacement && echo.blend > 0.5+ ? pair.to?.character+ : character}+ </text>+ );+ })+ : null}+ {replacement && pose.melt > 0.001 ? (+ <defs>+ <filter+ id={filterId}+ x="-70%"+ y="-70%"+ width="240%"+ height="240%"+ colorInterpolationFilters="sRGB"+ >+ <feGaussianBlur stdDeviation={pose.melt * size * 0.045} />+ <feColorMatrix+ type="matrix"+ values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 12 -4"+ />+ </filter>+ </defs>+ ) : null}+ <g transform={transform(pose)} opacity={pose.opacity}>+ <g+ filter={+ replacement && pose.melt > 0.001 ? `url(#${filterId})` : undefined+ }+ fill={color}+ >+ <text y={baseline} opacity={replacement ? 1 - pose.blend : 1}>+ {character}+ </text>+ {replacement ? (+ <text y={baseline} opacity={pose.blend}>+ {pair.to?.character}+ </text>+ ) : null}+ </g>+ </g>+ </g>+ );+}++export function KineticMorphText({+ text = kineticMorphTextDefaultText,+ fontSize = 100,+ fontWeight = 600,+ color = "#b4f4d9",+ backgroundColor = "#a800b7",+ spread = 180,+ rotation = 110,+ morph = 0.75,+ trails = 0.45,+ transitionFrames = TRANSITION,+ holdFrames = HOLD,+ loop = false,+ speed = 1,+ className,+}: KineticMorphTextProps) {+ const currentFrame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const frame = currentFrame * (30 / fps) * Math.max(0, finite(speed, 1));+ const size = Math.min(height * 0.28, Math.max(1, finite(fontSize, 100)));+ const weight = Math.min(900, Math.max(100, finite(Number(fontWeight), 600)));+ const layout = useGlyphLayout(text, size, weight, width);+ const transition = Math.max(1, finite(transitionFrames, TRANSITION));+ const timeline = getKineticMorphTimeline(+ frame,+ layout?.phrases.length ?? 0,+ transition,+ holdFrames,+ loop,+ );+ const pairs = useMemo(+ () =>+ matchKineticMorphGlyphs(+ layout?.phrases[timeline.from] ?? [],+ layout?.phrases[timeline.to] ?? [],+ ),+ [layout, timeline.from, timeline.to],+ );+ const options = {+ spread: Math.min(+ width * 0.24,+ height * 0.32,+ Math.max(0, finite(spread, 180)),+ ),+ rotation: Math.max(0, finite(rotation, 110)),+ morph: clamp(finite(morph, 0.75)),+ };++ return (+ <div+ className={className}+ style={{+ position: "absolute",+ inset: 0,+ backgroundColor,+ overflow: "hidden",+ }}+ >+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label={parseKineticMorphText(text).join(". ")}+ style={{+ display: "block",+ fontFamily: FONT_FAMILY,+ fontSize: layout?.size ?? size,+ fontWeight: weight,+ fontKerning: "none",+ }}+ >+ <g+ transform={`translate(${width / 2} ${height / 2})`}+ textAnchor="middle"+ >+ {layout+ ? pairs.map((pair, index) => (+ <MorphGlyph+ key={`${timeline.from}:${timeline.to}:${index}`}+ pair={pair}+ index={index}+ count={pairs.length}+ progress={timeline.progress}+ options={options}+ size={layout.size}+ baseline={layout.baseline}+ color={color}+ trails={clamp(finite(trails, 0.45))}+ transitionFrames={transition}+ />+ ))+ : null}+ </g>+ </svg>+ </div>+ );+}diff --git a/registry/remocn/radial-burst/__tests__/radial-burst.test.ts b/registry/remocn/radial-burst/__tests__/radial-burst.test.tsnew file mode 100644index 00000000..b4b8a660--- /dev/null+++ b/registry/remocn/radial-burst/__tests__/radial-burst.test.ts@@ -0,0 +1,140 @@+import { describe, expect, it } from "bun:test";+import {+ getRadialBurstDuration,+ getRadialBurstRibbonPath,+ getRadialBurstSegmentPath,+ getRadialBurstState,+ radialBurstLength,+} from "..";+import { radialBurstConfig } from "../config";++describe("radial burst timeline", () => {+ it("starts and finishes on a clean frame, staying clear after one pass", () => {+ for (const frame of [0, radialBurstLength, 120, 1000]) {+ const state = getRadialBurstState(frame);+ expect(state.dotRadius).toBe(0);+ expect(state.showSegments).toBe(false);+ expect(state.showRing).toBe(false);+ }+ expect(getRadialBurstState(12).dotRadius).toBeGreaterThan(0);+ expect(getRadialBurstState(36).showSegments).toBe(true);+ expect(getRadialBurstState(90).showRing).toBe(true);+ });++ it("welds the arcs into the ring without a jump in radius or thickness", () => {+ const before = getRadialBurstState(84 - 0.0001);+ const after = getRadialBurstState(84);+ expect(before.showSegments).toBe(true);+ expect(after.showRing).toBe(true);+ expect(before.curl).toBe(1);+ expect(before.arcAngle * before.count).toBeGreaterThan(Math.PI * 2);+ expect(before.radius).toBeCloseTo(after.radius, 3);+ expect(before.strokeWidth).toBeCloseTo(after.strokeWidth, 3);+ });++ it("loops repeatably and can be sampled in any order", () => {+ for (const frame of [0, 12, 30, 61, 84, 109, 119]) {+ const pose = getRadialBurstState(frame, { loop: true });+ getRadialBurstState(1000, { loop: true });+ expect(getRadialBurstState(frame + 120, { loop: true })).toEqual(pose);+ }+ });++ it("adjusts preview duration with speed", () => {+ expect(getRadialBurstDuration()).toBe(120);+ expect(radialBurstConfig.getDurationInFrames?.({ speed: 0.5 })).toBe(240);+ expect(getRadialBurstDuration({ speed: 2 })).toBe(60);+ expect(getRadialBurstDuration({ speed: 0 })).toBe(1);+ });+});++describe("radial burst geometry", () => {+ it("uses the intensity control to restore the classic plane and symmetrical geometry", () => {+ const classic = getRadialBurstState(54, { intensity: 0 });+ const sculptural = getRadialBurstState(54, { intensity: 1 });+ expect(classic.planeScale).toBe(1);+ expect(classic.planeAngle).toBe(0);+ expect(classic.offsetX).toBe(0);+ expect(classic.energy).toBe(0);+ expect(sculptural.planeScale).toBeLessThan(1);+ expect(sculptural.energy).toBeGreaterThan(0.5);+ expect(getRadialBurstRibbonPath(sculptural, 0)).not.toBe(+ getRadialBurstRibbonPath(sculptural, 1),+ );+ });++ it("keeps closed ribbon silhouettes finite at maximum intensity and reversed twist", () => {+ for (const frame of [18, 30, 54, 72, 83]) {+ const state = getRadialBurstState(frame, {+ intensity: 1.5,+ thickness: 60,+ radius: 100,+ });+ for (const twist of [-180, 0, 180]) {+ const path = getRadialBurstRibbonPath(state, 0, twist);+ expect(path.endsWith(" Z")).toBe(true);+ expect(path).not.toMatch(/NaN|Infinity/);+ }+ }+ });++ it("moves the inner ring edge beyond all corners, including on wide and portrait frames", () => {+ for (const [width, height] of [+ [1280, 720],+ [720, 1280],+ [720, 720],+ [2560, 720],+ ]) {+ for (const thickness of [8, 30, 60]) {+ const state = getRadialBurstState(radialBurstLength, {+ width,+ height,+ thickness,+ });+ expect(state.radius - state.strokeWidth / 2).toBeGreaterThan(+ Math.hypot(width, height) / 2,+ );+ }+ }+ });++ it("starts with straight spokes and curves their endpoints onto the ring", () => {+ const straight = getRadialBurstState(30);+ const values =+ getRadialBurstSegmentPath(straight)+ .match(/-?\d+(?:\.\d+)?/g)+ ?.map(Number) ?? [];+ expect(values).toHaveLength(8);+ expect([values[1], values[3], values[5], values[7]]).toEqual([0, 0, 0, 0]);+ const curved = getRadialBurstState(83);+ const points =+ getRadialBurstSegmentPath(curved)+ .match(/-?\d+(?:\.\d+)?/g)+ ?.map(Number) ?? [];+ expect(Math.hypot(points[0], points[1])).toBeCloseTo(curved.radius, 2);+ expect(Math.hypot(points[6], points[7])).toBeCloseTo(curved.radius, 2);+ });++ it("keeps geometry finite at control extremes and normalizes invalid numeric input", () => {+ for (const segments of [4, 16, -20, Number.NaN]) {+ for (const frame of [0, 20, 54, 83, 96, 114]) {+ const state = getRadialBurstState(frame, {+ segments,+ thickness: 60,+ radius: 100,+ });+ expect(state.count).toBeGreaterThanOrEqual(4);+ expect(state.count).toBeLessThanOrEqual(16);+ expect(getRadialBurstSegmentPath(state)).not.toMatch(/NaN|Infinity/);+ }+ }+ });++ it("reverses the assembly direction independently of radius and segment count", () => {+ const forward = getRadialBurstState(60, { rotation: 180, segments: 6 });+ const backward = getRadialBurstState(60, { rotation: -180, segments: 6 });+ expect(forward.rotation).toBeCloseTo(-backward.rotation);+ expect(forward.radius).toBe(backward.radius);+ expect(backward.count).toBe(6);+ });+});diff --git a/registry/remocn/radial-burst/config.ts b/registry/remocn/radial-burst/config.tsnew file mode 100644index 00000000..6a62147e--- /dev/null+++ b/registry/remocn/radial-burst/config.ts@@ -0,0 +1,89 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";+import { getRadialBurstDuration } from ".";++export const radialBurstConfig: ComponentConfig = {+ componentName: "RadialBurst",+ importPath: "@/components/remocn/radial-burst",+ controls: {+ segments: {+ type: "number",+ default: 8,+ min: 4,+ max: 16,+ step: 1,+ description: "Segments",+ hiddenFromList: false,+ },+ radius: {+ type: "number",+ default: 210,+ min: 100,+ max: 280,+ step: 5,+ description: "Burst radius",+ hiddenFromList: false,+ },+ thickness: {+ type: "number",+ default: 30,+ min: 8,+ max: 60,+ step: 1,+ description: "Thickness",+ hiddenFromList: false,+ },+ rotation: {+ type: "number",+ default: 135,+ min: -360,+ max: 360,+ step: 15,+ description: "Rotation",+ hiddenFromList: false,+ },+ intensity: {+ type: "number",+ default: 1,+ min: 0,+ max: 1.5,+ step: 0.1,+ description: "Intensity",+ hiddenFromList: false,+ },+ twist: {+ type: "number",+ default: 110,+ min: -180,+ max: 180,+ step: 10,+ description: "Ribbon twist",+ hiddenFromList: false,+ },+ echoes: {+ type: "number",+ default: 3,+ min: 0,+ max: 5,+ step: 1,+ description: "Contour echoes",+ hiddenFromList: false,+ },+ color: { type: "color", default: "#ffffff", description: "Shape color" },+ accentColor: {+ type: "color",+ default: "#f4e4a7",+ description: "Accent color",+ },+ backgroundColor: {+ type: "color",+ default: "#a800b7",+ description: "Background",+ },+ loop: { type: "boolean", default: false, description: "Loop animation" },+ },+ durationInFrames: 120,+ getDurationInFrames: (values) => getRadialBurstDuration(values),+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/radial-burst/index.tsx b/registry/remocn/radial-burst/index.tsxnew file mode 100644index 00000000..8573bc61--- /dev/null+++ b/registry/remocn/radial-burst/index.tsx@@ -0,0 +1,406 @@+"use client";++import {+ Easing,+ interpolateColors,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export interface RadialBurstProps {+ /** Number of rounded segments, from 4 to 16. */+ segments?: number;+ /** Burst radius at a 720px reference size. */+ radius?: number;+ /** Segment thickness at a 720px reference size. */+ thickness?: number;+ /** Rotation during assembly, in degrees; negative reverses it. */+ rotation?: number;+ /** Sculptural stretch and tilt, from 0 (classic) to 1.5. */+ intensity?: number;+ /** Curvature of the flying ribbons in degrees. */+ twist?: number;+ /** Number of contour echoes, from 0 to 5. */+ echoes?: number;+ color?: string;+ accentColor?: string;+ backgroundColor?: string;+ speed?: number;+ loop?: boolean;+ className?: string;+}++/** The ring has completely left the composition by this frame at 30 fps. */+export const radialBurstLength = 114;+const CYCLE = 120;+const finite = (value: number, fallback: number) =>+ Number.isFinite(value) ? value : fallback;+const clamp = (value: number) => Math.min(1, Math.max(0, value));+const mix = (from: number, to: number, progress: number) =>+ from + (to - from) * progress;+const easeInOut = Easing.bezier(0.65, 0, 0.25, 1);+const easeOut = Easing.bezier(0.16, 1, 0.3, 1);+const progress = (frame: number, start: number, end: number) =>+ clamp((frame - start) / (end - start));++/** Includes the clean tail, in frames at 30 fps. */+export function getRadialBurstDuration({+ speed = 1,+}: Pick<RadialBurstProps, "speed"> = {}) {+ const rate = finite(speed, 1);+ return rate <= 0 ? 1 : Math.max(1, Math.ceil(CYCLE / rate));+}++export function getRadialBurstState(+ frame: number,+ {+ segments = 8,+ radius = 210,+ thickness = 30,+ rotation = 135,+ intensity = 1,+ loop = false,+ width = 1280,+ height = 720,+ }: Omit<+ RadialBurstProps,+ "color" | "accentColor" | "backgroundColor" | "speed" | "className"+ > & {+ width?: number;+ height?: number;+ } = {},+) {+ const w = Math.max(1, finite(width, 1280));+ const h = Math.max(1, finite(height, 720));+ const unit = Math.min(w, h) / 720;+ const time = Math.max(0, finite(frame, 0));+ const local = loop ? time % CYCLE : time;+ const count = Math.round(Math.min(16, Math.max(4, finite(segments, 8))));+ const burstRadius = Math.min(280, Math.max(100, finite(radius, 210))) * unit;+ const stroke = Math.min(60, Math.max(8, finite(thickness, 30))) * unit;+ const ringRadius = burstRadius * 0.68;+ const assemble = easeInOut(progress(local, 44, 76));+ const curl = easeInOut(progress(local, 48, 78));+ const close = easeInOut(progress(local, 72, 84));+ const anticipate = easeInOut(progress(local, 86, 96));+ const exit = progress(local, 96, radialBurstLength) ** 2.6;+ const launch = spring({+ frame: Math.max(0, local - 18),+ fps: 30,+ durationInFrames: 26,+ config: { damping: 13, stiffness: 170, mass: 0.8 },+ });+ const pop = spring({+ frame: Math.max(0, local - 2),+ fps: 30,+ durationInFrames: 16,+ config: { damping: 11, stiffness: 180, mass: 0.65 },+ });+ const ringStroke = mix(stroke * 0.8, stroke * 1.1, anticipate);+ const exitStroke = mix(ringStroke, stroke * 2.2, exit);+ // The inner edge, not just the centerline, must pass every corner.+ const clearRadius = Math.hypot(w, h) / 2 + stroke * 2.2 + 2;+ const orbitRadius = mix(+ mix(28 * unit, burstRadius, launch),+ ringRadius,+ assemble,+ );+ const finalRadius = mix(ringRadius, ringRadius * 0.84, anticipate);+ const strength = Math.min(1.5, Math.max(0, finite(intensity, 1)));+ const energy = Math.sin(Math.PI * progress(local, 18, 84));+ const tilt =+ easeOut(progress(local, 18, 48)) *+ (1 - easeInOut(progress(local, 96, 114)));++ return {+ frame: local,+ count,+ unit,+ strength,+ energy: Math.max(0, energy) * strength,+ planeScale: 1 - tilt * 0.46 * Math.min(1.5, strength),+ planeAngle:+ Math.sin(progress(local, 18, 114) * Math.PI * 1.6) * 32 * strength,+ offsetX:+ Math.sin(Math.PI * progress(local, 18, 114)) * 65 * unit * strength,+ offsetY:+ -Math.sin(Math.PI * progress(local, 18, 114)) * 32 * unit * strength,+ dotRadius: 37 * unit * pop * (1 - easeOut(progress(local, 18, 26))),+ dotSquash: 1 - Math.sin(Math.PI * progress(local, 2, 18)) * 0.16,+ showSegments: local >= 18 && local < 84,+ showRing: local >= 84 && local < radialBurstLength,+ segmentOpacity: easeOut(progress(local, 18, 23)),+ radius: local < 84 ? orbitRadius : mix(finalRadius, clearRadius, exit),+ strokeWidth: local < 84 ? mix(stroke, stroke * 0.8, assemble) : exitStroke,+ segmentLength: mix(+ 12 * unit,+ Math.min(82 * unit, burstRadius * 0.42),+ easeOut(progress(local, 18, 36)),+ ),+ curl,+ // Gaps close with a tiny overlap to prevent raster seams at the weld.+ arcAngle: ((Math.PI * 2) / count) * mix(0.62, 1.002, close),+ rotation: finite(rotation, 135) * easeInOut(progress(local, 34, 84)),+ };+}++/** A straight rounded spoke curls continuously into a circular arc. */+function getSegmentPoints({+ radius,+ segmentLength,+ arcAngle,+ curl,+}: Pick<+ ReturnType<typeof getRadialBurstState>,+ "radius" | "segmentLength" | "arcAngle" | "curl"+>) {+ const half = arcAngle / 2;+ const x = radius * Math.cos(half);+ const y = radius * Math.sin(half);+ const tangent = (4 / 3) * Math.tan(arcAngle / 4) * radius;+ const arc = [+ [x, -y],+ [x + tangent * Math.sin(half), -y + tangent * Math.cos(half)],+ [x + tangent * Math.sin(half), y - tangent * Math.cos(half)],+ [x, y],+ ];+ const angle = (curl * Math.PI) / 2;+ return [-0.5, -1 / 6, 1 / 6, 0.5].map((offset, index) => {+ const px = radius + segmentLength * offset * Math.cos(angle);+ const py = segmentLength * offset * Math.sin(angle);+ return [mix(px, arc[index][0], curl), mix(py, arc[index][1], curl)];+ });+}++export function getRadialBurstSegmentPath(+ state: Parameters<typeof getSegmentPoints>[0],+) {+ const points = getSegmentPoints(state).map((point) =>+ point.map((value) => value.toFixed(3)).join(" "),+ );+ return `M ${points[0]} C ${points[1]} ${points[2]} ${points[3]}`;+}++/** Sample a bent centerline and its normals to make a tapered, filled ribbon. */+export function getRadialBurstRibbonPath(+ state: ReturnType<typeof getRadialBurstState>,+ index: number,+ twist = 110,+) {+ const energy = state.energy;+ const points = getSegmentPoints({+ ...state,+ radius: state.radius * (1 + Math.sin(index * 2.4) * energy * 0.15),+ segmentLength: state.segmentLength * (1 + energy * 2.8),+ });+ const bend =+ (Math.min(180, Math.max(-180, finite(twist, 110))) / 110) *+ energy *+ 145 *+ state.unit;+ points[1][1] += bend * 0.55;+ points[2][1] += bend;+ // Carry the tip with the bend so the centerline does not double back into+ // a hairpin while the ribbon transitions from a spoke to an arc.+ points[3][1] += bend * 1.25;+ points[2][0] += energy * 38 * state.unit;+ const upper: string[] = [];+ const lower: string[] = [];+ const format = (x: number, y: number) => `${x.toFixed(3)} ${y.toFixed(3)}`;+ let firstWidth = 0;+ let lastWidth = 0;+ for (let sample = 0; sample <= 36; sample++) {+ const t = sample / 36;+ const q = 1 - t;+ const x =+ q ** 3 * points[0][0] ++ 3 * q * q * t * points[1][0] ++ 3 * q * t * t * points[2][0] ++ t ** 3 * points[3][0];+ const y =+ q ** 3 * points[0][1] ++ 3 * q * q * t * points[1][1] ++ 3 * q * t * t * points[2][1] ++ t ** 3 * points[3][1];+ const dx =+ 3 * q * q * (points[1][0] - points[0][0]) ++ 6 * q * t * (points[2][0] - points[1][0]) ++ 3 * t * t * (points[3][0] - points[2][0]);+ const dy =+ 3 * q * q * (points[1][1] - points[0][1]) ++ 6 * q * t * (points[2][1] - points[1][1]) ++ 3 * t * t * (points[3][1] - points[2][1]);+ const length = Math.max(0.001, Math.hypot(dx, dy));+ const ddx =+ 6 * q * (points[2][0] - 2 * points[1][0] + points[0][0]) ++ 6 * t * (points[3][0] - 2 * points[2][0] + points[1][0]);+ const ddy =+ 6 * q * (points[2][1] - 2 * points[1][1] + points[0][1]) ++ 6 * t * (points[3][1] - 2 * points[2][1] + points[1][1]);+ const curvature = Math.abs(dx * ddy - dy * ddx) / length ** 3;+ const swell = Math.sin(Math.PI * t) ** 1.4;+ // Offset curves fold back on themselves when their width exceeds the+ // bend radius. Limit the width locally to keep tight curls smooth.+ const halfWidth = Math.min(+ (state.strokeWidth / 2) * (1 + energy * (2.4 * swell - 0.65 * t)),+ 0.72 / Math.max(curvature, 0.00001),+ );+ if (sample === 0) firstWidth = halfWidth;+ if (sample === 36) lastWidth = halfWidth;+ upper.push(+ format(x - (dy / length) * halfWidth, y + (dx / length) * halfWidth),+ );+ lower.push(+ format(x + (dy / length) * halfWidth, y - (dx / length) * halfWidth),+ );+ }+ return `M ${upper.join(" L ")} A ${lastWidth} ${lastWidth} 0 0 0 ${lower[36]} L ${lower.slice(0, -1).reverse().join(" L ")} A ${firstWidth} ${firstWidth} 0 0 0 ${upper[0]} Z`;+}++export function RadialBurst({+ segments = 8,+ radius = 210,+ thickness = 30,+ rotation = 135,+ intensity = 1,+ twist = 110,+ echoes = 3,+ color = "#ffffff",+ accentColor = "#f4e4a7",+ backgroundColor = "#a800b7",+ speed = 1,+ loop = false,+ className,+}: RadialBurstProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const time = frame * (30 / fps) * Math.max(0, finite(speed, 1));+ const options = {+ segments,+ radius,+ thickness,+ rotation,+ intensity,+ loop,+ width,+ height,+ };+ const state = getRadialBurstState(time, options);+ const path = getRadialBurstSegmentPath(state);+ const echoCount = Math.round(Math.min(5, Math.max(0, finite(echoes, 3))));+ const plane = (pose: typeof state) =>+ `translate(${pose.offsetX} ${pose.offsetY}) rotate(${pose.planeAngle}) scale(1 ${pose.planeScale})`;+ const ribbons = (pose: typeof state, outline: boolean) =>+ Array.from({ length: pose.count }, (_, index) => (+ <path+ key={index}+ d={getRadialBurstRibbonPath(pose, index, twist)}+ transform={`rotate(${(index * 360) / pose.count + pose.rotation - 90 + Math.sin(index * 1.7) * pose.energy * 16})`}+ fill={+ outline+ ? "none"+ : index % 3 === 0+ ? interpolateColors(+ clamp(pose.energy),+ [0, 1],+ [color, accentColor],+ )+ : color+ }+ stroke={outline ? color : "none"}+ strokeWidth={1.5 * pose.unit}+ />+ ));++ return (+ <div+ className={className}+ style={{+ position: "absolute",+ inset: 0,+ overflow: "hidden",+ backgroundColor,+ }}+ >+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Geometric radial burst"+ style={{ display: "block" }}+ >+ <g transform={`translate(${width / 2} ${height / 2})`}>+ {state.strength > 0 &&+ state.frame >= 18 &&+ state.frame < radialBurstLength+ ? Array.from({ length: echoCount }, (_, index) => {+ const lag = (echoCount - index) * 2.2;+ const echo = getRadialBurstState(+ Math.max(18, state.frame - lag),+ { ...options, loop: false },+ );+ const opacity =+ 0.36 *+ (1 - index / (echoCount + 1)) *+ Math.min(1, state.strength) *+ (1 - easeOut(progress(state.frame, 107, 114)));+ return (+ <g key={index} transform={plane(echo)} opacity={opacity}>+ {echo.showSegments ? (+ ribbons(echo, true)+ ) : echo.showRing ? (+ <circle+ r={echo.radius}+ fill="none"+ stroke={index % 2 ? color : accentColor}+ strokeWidth={echo.strokeWidth * (0.22 + index * 0.07)}+ />+ ) : null}+ </g>+ );+ })+ : null}+ <g transform={plane(state)}>+ {state.dotRadius > 0.001 ? (+ <circle+ r={state.dotRadius}+ fill={color}+ transform={`scale(${1 / state.dotSquash} ${state.dotSquash})`}+ />+ ) : null}+ {state.showSegments && state.strength > 0 ? (+ <g opacity={state.segmentOpacity}>{ribbons(state, false)}</g>+ ) : state.showSegments ? (+ <g+ fill="none"+ stroke={color}+ strokeWidth={state.strokeWidth}+ strokeLinecap="round"+ opacity={state.segmentOpacity}+ transform={`rotate(${state.rotation - 90})`}+ >+ {Array.from({ length: state.count }, (_, index) => (+ <path+ key={index}+ d={path}+ transform={`rotate(${(index * 360) / state.count})`}+ />+ ))}+ </g>+ ) : null}+ {state.showRing ? (+ <circle+ r={state.radius}+ fill="none"+ stroke={color}+ strokeWidth={state.strokeWidth}+ />+ ) : null}+ </g>+ </g>+ </svg>+ </div>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex ea747a0d..c19ed3cb 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -437,6 +437,20 @@}]},+ {+ "name": "kinetic-morph-text",+ "type": "registry:component",+ "title": "Kinetic Morph Text",+ "description": "Letters lift, rotate, and softly reshape into editable phrases with sampled outline trails.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "kinetic-morph-text/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/kinetic-morph-text.tsx"+ }+ ]+ },{"name": "kinetic-warp","type": "registry:component",@@ -1493,6 +1507,20 @@}]},+ {+ "name": "radial-burst",+ "type": "registry:component",+ "title": "Radial Burst",+ "description": "Sculptural ribbons twist into a tilted ring and sweep outward through contour echoes for an expressive product introduction.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "radial-burst/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/radial-burst.tsx"+ }+ ]+ },{"name": "confetti","type": "registry:component",@@ -2164,6 +2192,20 @@"target": "components/remocn/glitch-cut.tsx"}]+ },+ {+ "name": "search-reveal",+ "type": "registry:component",+ "title": "Search Reveal",+ "description": "Expanding construction circles snap into a search pill, type editable text, and reveal an abstract graphic panel.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "search-reveal/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/search-reveal.tsx"+ }+ ]}]}diff --git a/registry/remocn/search-reveal/__tests__/search-reveal.test.ts b/registry/remocn/search-reveal/__tests__/search-reveal.test.tsnew file mode 100644index 00000000..e636102b--- /dev/null+++ b/registry/remocn/search-reveal/__tests__/search-reveal.test.ts@@ -0,0 +1,57 @@+import { describe, expect, it } from "bun:test";+import { getSearchRevealDuration, getSearchRevealState } from "..";+import { searchRevealConfig } from "../config";++describe("search reveal", () => {+ it("snaps from construction circles to the field at the reference cut", () => {+ expect(getSearchRevealState(25).circlesVisible).toBe(true);+ expect(getSearchRevealState(25).fieldVisible).toBe(false);+ expect(getSearchRevealState(26).circlesVisible).toBe(false);+ expect(getSearchRevealState(26).fieldWidth).toBe(130);+ expect(getSearchRevealState(48).fieldWidth).toBe(464);+ expect(getSearchRevealState(48).fieldHeight).toBe(80);+ expect(getSearchRevealState(48).tilt).toBe(0);+ });+ it("types remocn completely before three seconds and holds a stable final pose", () => {+ expect(getSearchRevealState(54).text).toBe("");+ expect(getSearchRevealState(58).text).toBe("r");+ expect(getSearchRevealState(78).text).toBe("remocn");+ for (const frame of [90, 108, 10000]) {+ const state = getSearchRevealState(frame);+ expect(state.text).toBe("remocn");+ expect(state.caretVisible).toBe(false);+ expect(state.panelWidth).toBe(774);+ expect(state.panelHeight).toBe(374);+ expect(state.panelRadius).toBe(0);+ }+ });+ it("preserves grapheme clusters and extends duration for edited copy", () => {+ expect(getSearchRevealState(58, { text: "👩💻é" }).text).toBe("👩💻");+ const props = { text: "Introducing remocn", framesPerCharacter: 8 };+ const duration = getSearchRevealDuration(props);+ expect(duration).toBeGreaterThan(108);+ expect(getSearchRevealState(duration - 1, props).text).toBe(props.text);+ expect(searchRevealConfig.getDurationInFrames?.(props)).toBe(duration);+ });+ it("supports empty copy, speed zero, and a static final pose", () => {+ expect(getSearchRevealState(90, { text: "" }).text).toBe("");+ expect(getSearchRevealDuration({ speed: 0 })).toBe(1);+ expect(getSearchRevealState(99, { speed: 0 }).circlesVisible).toBe(true);+ expect(getSearchRevealState(0, { reducedMotion: true }).text).toBe(+ "remocn",+ );+ expect(getSearchRevealState(0, { reducedMotion: true }).caretVisible).toBe(+ false,+ );+ expect(getSearchRevealState(90, { showPanel: false }).reveal).toBe(0);+ });+ it("seeks deterministically and applies speed to every stage", () => {+ for (const frame of [0, 25, 26, 40, 58, 74, 90]) {+ const before = getSearchRevealState(frame);+ getSearchRevealState(500);+ expect(getSearchRevealState(frame)).toEqual(before);+ expect(getSearchRevealState(frame / 2, { speed: 2 })).toEqual(before);+ }+ expect(getSearchRevealDuration({ speed: 2 })).toBe(54);+ });+});diff --git a/registry/remocn/search-reveal/config.ts b/registry/remocn/search-reveal/config.tsnew file mode 100644index 00000000..9f01c12b--- /dev/null+++ b/registry/remocn/search-reveal/config.ts@@ -0,0 +1,93 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";+import { getSearchRevealDuration } from ".";++export const searchRevealConfig: ComponentConfig = {+ componentName: "SearchReveal",+ importPath: "@/components/remocn/search-reveal",+ controls: {+ text: {+ type: "text-content",+ default: "remocn",+ description: "Search text",+ },+ fieldWidth: {+ type: "number",+ default: 464,+ min: 320,+ max: 640,+ step: 8,+ description: "Field width",+ hiddenFromList: false,+ },+ fontSize: {+ type: "number",+ default: 34,+ min: 18,+ max: 54,+ step: 1,+ description: "Font size",+ hiddenFromList: false,+ },+ framesPerCharacter: {+ type: "number",+ default: 4,+ min: 1,+ max: 12,+ step: 1,+ description: "Frames per character",+ hiddenFromList: false,+ },+ showPanel: { type: "boolean", default: true, description: "Graphic panel" },+ showGuides: {+ type: "boolean",+ default: true,+ description: "Construction guides",+ },+ color: {+ type: "color",+ default: "#26232b",+ description: "Text and markers",+ },+ fieldColor: {+ type: "color",+ default: "#ffffff",+ description: "Search field",+ },+ ringColor: {+ type: "color",+ default: "#cbc5cf",+ description: "Circles and search icon",+ },+ panelColor: {+ type: "color",+ default: "#a800b7",+ description: "Panel color",+ },+ accentColor: {+ type: "color",+ default: "#e8f99a",+ description: "Graphic accents",+ },+ backgroundColor: {+ type: "color",+ default: "#f5f1f5",+ description: "Background",+ },+ reducedMotion: {+ type: "boolean",+ default: false,+ description: "Static final pose",+ },+ },+ durationInFrames: 108,+ getDurationInFrames: (values) => getSearchRevealDuration(values),+ snippet: (values) =>+ `import { SearchReveal } from "@/components/remocn/search-reveal";\n\n<SearchReveal\n${Object.entries(+ values,+ )+ .map(([key, value]) => ` ${key}={${JSON.stringify(value)}}`)+ .join("\n")}\n/>`,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+};diff --git a/registry/remocn/search-reveal/index.tsx b/registry/remocn/search-reveal/index.tsxnew file mode 100644index 00000000..cd2cedf9--- /dev/null+++ b/registry/remocn/search-reveal/index.tsx@@ -0,0 +1,369 @@+"use client";++import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type SearchRevealProps = {+ text?: string;+ fieldWidth?: number;+ fontSize?: number;+ framesPerCharacter?: number;+ showPanel?: boolean;+ showGuides?: boolean;+ color?: string;+ fieldColor?: string;+ ringColor?: string;+ panelColor?: string;+ accentColor?: string;+ backgroundColor?: string;+ speed?: number;+ reducedMotion?: boolean;+ className?: string;+};++export const searchRevealLength = 90;+const finite = (value: number | undefined, fallback: number) =>+ typeof value === "number" && Number.isFinite(value) ? value : fallback;+const clamp = (value: number, min: number, max: number) =>+ Math.min(max, Math.max(min, value));+const letters = (text: string) =>+ Array.from(+ new Intl.Segmenter("en", { granularity: "grapheme" }).segment(text),+ (part) => part.segment,+ );+const curve = Easing.bezier(0.22, 1, 0.36, 1);+const tween = (frame: number, start: number, end: number, from = 0, to = 1) =>+ interpolate(frame, [start, end], [from, to], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: curve,+ });++function timing(props: SearchRevealProps) {+ const characters = letters(props.text ?? "remocn");+ const step = clamp(finite(props.framesPerCharacter, 4), 1, 12);+ const end = Math.max(searchRevealLength, 54 + characters.length * step + 10);+ return { characters, step, end, speed: Math.max(0, finite(props.speed, 1)) };+}++/** Demo duration at 30 fps, including an 18-frame final hold. */+export function getSearchRevealDuration(props: SearchRevealProps = {}) {+ const { end, speed } = timing(props);+ return speed === 0 ? 1 : Math.ceil((end + 18) / speed);+}++/** Frame is expressed at 30 fps; playback speed is applied here. */+export function getSearchRevealState(+ frame: number,+ props: SearchRevealProps = {},+) {+ const { characters, step, end, speed } = timing(props);+ const t = props.reducedMotion ? end : Math.max(0, finite(frame, 0)) * speed;+ const typedCount = clamp(Math.floor((t - 54) / step), 0, characters.length);+ const width = clamp(finite(props.fieldWidth, 464), 320, 640);+ const reveal = props.showPanel === false ? 0 : tween(t, 56, 90);+ const fieldWidth = tween(t, 26, 48, 130, width);+ const fieldHeight = tween(t, 26, 46, 24, 80);+ const panelWidth =+ fieldWidth + (Math.max(774, width + 170) - fieldWidth) * reveal;+ const panelHeight = fieldHeight + (374 - fieldHeight) * reveal;+ return {+ t,+ end,+ typedCount,+ text: characters.slice(0, typedCount).join(""),+ circleRadius: tween(t, 0, 26, 250, 410),+ circleOffset: tween(t, 0, 26, 62, 185),+ circlesVisible: t < 26,+ fieldVisible: t >= 26,+ fieldWidth,+ fieldHeight,+ tilt: tween(t, 26, 47, -4, 0),+ iconOpacity: tween(t, 34, 46),+ panelWidth,+ panelHeight,+ panelRadius: 40 * (1 - reveal),+ panelOpacity: tween(t, 56, 60),+ reveal,+ caretVisible:+ t >= 52 &&+ t < end &&+ (typedCount < characters.length || Math.floor((t - 52) / 12) % 2 === 0),+ };+}++function Cross({ x, y, size = 9 }: { x: number; y: number; size?: number }) {+ return (+ <path+ d={`M ${x - size} ${y} H ${x + size} M ${x} ${y - size} V ${y + size}`}+ />+ );+}++/** A video scene: expanding construction circles, a search pill, and typed copy. */+export function SearchReveal({+ text = "remocn",+ fieldWidth = 464,+ fontSize = 34,+ framesPerCharacter = 4,+ showPanel = true,+ showGuides = true,+ color = "#26232b",+ fieldColor = "#ffffff",+ ringColor = "#cbc5cf",+ panelColor = "#a800b7",+ accentColor = "#e8f99a",+ backgroundColor = "#f5f1f5",+ speed = 1,+ reducedMotion = false,+ className,+}: SearchRevealProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const state = getSearchRevealState((frame * 30) / fps, {+ text,+ fieldWidth,+ framesPerCharacter,+ showPanel,+ speed,+ reducedMotion,+ });+ const scale = Math.min(width / 1280, height / 720);+ const fittedFont = Math.min(+ clamp(finite(fontSize, 34), 18, 54),+ (state.fieldWidth - 120) / Math.max(1, letters(text).length * 0.65),+ );+ const markerWidth = showPanel ? state.panelWidth : state.fieldWidth;+ const markerHeight = showPanel ? state.panelHeight : state.fieldHeight;++ return (+ <AbsoluteFill+ className={className}+ style={{+ backgroundColor,+ overflow: "hidden",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 1280,+ height: 720,+ flexShrink: 0,+ position: "relative",+ transform: `scale(${scale})`,+ }}+ >+ {state.circlesVisible && (+ <svg+ aria-hidden="true"+ width="1280"+ height="720"+ viewBox="-640 -360 1280 720"+ style={{ position: "absolute", inset: 0, overflow: "visible" }}+ >+ <g fill="none" stroke={ringColor} strokeWidth="1">+ {[-1, 1].map((side) => (+ <g key={side}>+ <circle+ cx={side * state.circleOffset}+ r={state.circleRadius}+ />+ {showGuides &&+ [-1, 1].map((edge) => (+ <Cross+ key={edge}+ x={+ side * state.circleOffset + edge * state.circleRadius+ }+ y={0}+ size={6}+ />+ ))}+ </g>+ ))}+ </g>+ </svg>+ )}+ {state.fieldVisible && (+ <div+ style={{+ position: "absolute",+ left: "50%",+ top: "50%",+ width: 0,+ height: 0,+ transform: `rotate(${state.tilt}deg)`,+ }}+ >+ {showPanel && (+ <div+ style={{+ position: "absolute",+ left: -state.panelWidth / 2,+ top: -state.panelHeight / 2,+ width: state.panelWidth,+ height: state.panelHeight,+ borderRadius: state.panelRadius,+ overflow: "hidden",+ opacity: state.panelOpacity,+ backgroundColor: panelColor,+ }}+ >+ <svg+ aria-hidden="true"+ width="844"+ height="374"+ viewBox="0 0 844 374"+ style={{+ position: "absolute",+ left: "50%",+ top: "50%",+ transform: `translate(-50%, -50%) scale(${1.07 - state.reveal * 0.07})`,+ }}+ >+ <g+ transform={`translate(310 -45) rotate(${-24 + 10 * state.reveal})`}+ fill="none"+ stroke={fieldColor}+ >+ {Array.from({ length: 30 }, (_, i) => (+ <ellipse+ key={i}+ rx={82 + i * 3}+ ry={118}+ transform={`rotate(${i * 6})`}+ strokeWidth="1.4"+ opacity={0.35 + i / 70}+ />+ ))}+ </g>+ <g+ transform={`translate(65 233) rotate(${state.reveal * 25})`}+ fill={accentColor}+ >+ {Array.from({ length: 10 }, (_, i) => (+ <ellipse+ key={i}+ cy="-41"+ rx="19"+ ry="48"+ transform={`rotate(${i * 36})`}+ />+ ))}+ </g>+ <g+ transform={`translate(720 357) rotate(${-18 * state.reveal})`}+ fill="none"+ stroke={accentColor}+ strokeWidth="22"+ >+ <path d="M -68 -115 V 80 M -122 -60 L -14 26 M -125 18 L -12 -61" />+ <circle cx="103" cy="-35" r="54" />+ </g>+ </svg>+ </div>+ )}+ {showGuides && (+ <svg+ aria-hidden="true"+ width="1280"+ height="720"+ viewBox="-640 -360 1280 720"+ style={{+ position: "absolute",+ left: -640,+ top: -360,+ overflow: "visible",+ }}+ >+ <g+ fill="none"+ stroke={ringColor}+ strokeWidth="1"+ opacity={0.5 * state.iconOpacity}+ >+ <path+ d={`M ${markerWidth / 2} ${-markerHeight / 2 - 14} V -360 M ${-markerWidth / 2} ${markerHeight / 2 + 14} V 360`}+ />+ </g>+ <g fill="none" stroke={color} strokeWidth="1.5">+ <Cross x={-markerWidth / 2} y={markerHeight / 2} />+ <Cross x={markerWidth / 2} y={-markerHeight / 2} />+ </g>+ </svg>+ )}+ <div+ style={{+ position: "absolute",+ left: -state.fieldWidth / 2,+ top: -state.fieldHeight / 2,+ width: state.fieldWidth,+ height: state.fieldHeight,+ borderRadius: 999,+ backgroundColor: fieldColor,+ boxShadow: "0 3px 12px #26232b08, inset 0 0 0 1px #26232b0a",+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ overflow: "hidden",+ color,+ fontFamily: "Arial, Helvetica, sans-serif",+ fontSize: fittedFont,+ fontWeight: 400,+ }}+ >+ <div+ style={{+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ maxWidth: state.fieldWidth - 116,+ overflow: "hidden",+ whiteSpace: "pre",+ }}+ >+ <span>{state.text}</span>+ <span+ aria-hidden="true"+ style={{+ width: 1.5,+ height: fittedFont * 1.12,+ marginLeft: 2,+ flexShrink: 0,+ backgroundColor: color,+ opacity: state.caretVisible ? 1 : 0,+ }}+ />+ </div>+ <svg+ aria-hidden="true"+ width="28"+ height="28"+ viewBox="0 0 28 28"+ fill="none"+ stroke={ringColor}+ strokeWidth="1.5"+ strokeLinecap="round"+ style={{+ position: "absolute",+ right: 24,+ opacity: state.iconOpacity,+ }}+ >+ <circle cx="11.5" cy="11.5" r="7.5" />+ <path d="m17 17 7 7" />+ </svg>+ </div>+ </div>+ )}+ </div>+ </AbsoluteFill>+ );+}