Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: Motion Pack — 38 motion design components (#300)
KapishDima7aebcbe6514e
diff --git a/app/(home)/components/hero-badge.tsx b/app/(home)/components/hero-badge.tsxindex c11d5043..287494eb 100644--- a/app/(home)/components/hero-badge.tsx+++ b/app/(home)/components/hero-badge.tsx@@ -5,7 +5,7 @@ import Link from "next/link";import { Badge } from "@/components/ui/badge";import { useTrackEvent } from "@/lib/analytics";-const HERO_BADGE_HREF = "/docs/captions/getting-started/introduction";+const HERO_BADGE_HREF = "/changelog#2026-10-23-motion-pack";export function HeroBadge() {const trackEvent = useTrackEvent();@@ -19,7 +19,7 @@ export function HeroBadge() {href={HERO_BADGE_HREF}onClick={() =>trackEvent("cta_clicked", {- cta: "hero_motion_graphics_badge",+ cta: "hero_motion_pack_badge",destination: HERO_BADGE_HREF,})}@@ -27,7 +27,7 @@ export function HeroBadge() {}><span className="font-semibold text-foreground">Introducing</span>- <span className="text-foreground">Captions</span>+ <span className="text-foreground">Motion Pack</span><ArrowRightclassName="size-3 transition-transform group-hover:translate-x-0.5"aria-hidden="true"diff --git a/components/docs/examples/accordion-unfold-example.tsx b/components/docs/examples/accordion-unfold-example.tsxnew file mode 100644index 00000000..7bd0a610--- /dev/null+++ b/components/docs/examples/accordion-unfold-example.tsx@@ -0,0 +1,30 @@+"use client";++import {+ DemoLockup,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import {+ AccordionUnfold,+ type AccordionUnfoldProps,+} from "@/registry/remocn/accordion-unfold";++export function AccordionUnfoldExampleScene(+ props: Omit<AccordionUnfoldProps, "children">,+) {+ return (+ <AccordionUnfold {...props}>+ <DemoLockup scale={0.8} color="#111111" />+ </AccordionUnfold>+ );+}++export const accordionUnfoldExampleCode = (+ values: Record<string, unknown>,+): string =>+ logoStingCode({+ name: "accordion-unfold",+ component: "AccordionUnfold",+ values,+ child: "logo",+ });diff --git a/components/docs/examples/anamorphic-flare-example.tsx b/components/docs/examples/anamorphic-flare-example.tsxnew file mode 100644index 00000000..71a3571a--- /dev/null+++ b/components/docs/examples/anamorphic-flare-example.tsx@@ -0,0 +1,30 @@+"use client";++import {+ DemoLockup,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import {+ AnamorphicFlare,+ type AnamorphicFlareProps,+} from "@/registry/remocn/anamorphic-flare";++export function AnamorphicFlareExampleScene(+ props: Omit<AnamorphicFlareProps, "children">,+) {+ return (+ <AnamorphicFlare {...props}>+ <DemoLockup />+ </AnamorphicFlare>+ );+}++export const anamorphicFlareExampleCode = (+ values: Record<string, unknown>,+): string =>+ logoStingCode({+ name: "anamorphic-flare",+ component: "AnamorphicFlare",+ values,+ child: "logo",+ });diff --git a/components/docs/examples/cloth-reveal-example.tsx b/components/docs/examples/cloth-reveal-example.tsxnew file mode 100644index 00000000..10facace--- /dev/null+++ b/components/docs/examples/cloth-reveal-example.tsx@@ -0,0 +1,108 @@+"use client";++import {+ ClothReveal,+ type ClothRevealDirection,+} from "@/registry/remocn/cloth-reveal";++const FONT_FAMILY =+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif";++function Lockup() {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 }}>+ <div+ style={{+ width: 120,+ height: 120,+ borderRadius: 32,+ backgroundColor: "#E5322D",+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36,+ height: 36,+ borderRadius: "50%",+ backgroundColor: "#111111",+ }}+ />+ </div>+ <span+ style={{+ fontFamily: FONT_FAMILY,+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: "#FFFFFF",+ }}+ >+ remocn+ </span>+ </div>+ );+}++interface ClothRevealExampleProps {+ direction?: ClothRevealDirection;+ clothColor?: string;+ undersideColor?: string;+ background?: string;+ delay?: number;+ seed?: number;+ speed?: number;+}++export function ClothRevealExampleScene({+ direction = "right",+ clothColor = "#E5322D",+ undersideColor = "#8E1A16",+ background = "#111111",+ delay = 6,+ seed = 2,+ speed = 1,+}: ClothRevealExampleProps) {+ return (+ <ClothReveal+ direction={direction}+ clothColor={clothColor}+ undersideColor={undersideColor}+ background={background}+ delay={delay}+ seed={seed}+ speed={speed}+ >+ <Lockup />+ </ClothReveal>+ );+}++export const clothRevealExampleCode = (+ values: Record<string, unknown>,+): string => {+ const direction = (values.direction as string) ?? "right";+ const clothColor = (values.clothColor as string) ?? "#E5322D";+ const undersideColor = (values.undersideColor as string) ?? "#8E1A16";+ const background = (values.background as string) ?? "#111111";+ const delay = (values.delay as number) ?? 6;+ const seed = (values.seed as number) ?? 2;+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { ClothReveal } from "@/components/remocn/cloth-reveal";++export const MyScene = () => (+ <ClothReveal+ direction="${direction}"+ clothColor="${clothColor}"+ undersideColor="${undersideColor}"+ background="${background}"+ delay={${delay}}+ seed={${seed}}${speedLine}+ >+ <YourLogo />+ </ClothReveal>+);`;+};diff --git a/components/docs/examples/comic-panels-example.tsx b/components/docs/examples/comic-panels-example.tsxnew file mode 100644index 00000000..d86750e0--- /dev/null+++ b/components/docs/examples/comic-panels-example.tsx@@ -0,0 +1,104 @@+"use client";++import {+ ComicPanels,+ comicPanelsDefaults,+} from "@/registry/remocn/comic-panels";++const FONT_FAMILY =+ "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";++function Lockup({ ink, accent }: { ink: string; accent: string }) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 }}>+ <div+ style={{+ width: 120,+ height: 120,+ borderRadius: 32,+ backgroundColor: accent,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36,+ height: 36,+ borderRadius: "50%",+ backgroundColor: ink,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: FONT_FAMILY,+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: ink,+ }}+ >+ remocn+ </span>+ </div>+ );+}++interface ComicPanelsExampleProps {+ word?: string;+ ink?: string;+ paper?: string;+ accent?: string;+ heroScale?: number;+ speed?: number;+}++export function ComicPanelsExampleScene({+ word = "POW",+ ink = comicPanelsDefaults.colors.ink,+ paper,+ accent = comicPanelsDefaults.colors.accent,+ heroScale,+ speed,+}: ComicPanelsExampleProps) {+ return (+ <ComicPanels+ word={word}+ ink={ink}+ paper={paper}+ accent={accent}+ heroScale={heroScale}+ speed={speed}+ >+ <Lockup ink={ink} accent={accent} />+ </ComicPanels>+ );+}++export const comicPanelsExampleCode = (+ values: Record<string, unknown>,+): string => {+ const d = comicPanelsDefaults;+ const word = (values.word as string) ?? "POW";+ const ink = (values.ink as string) ?? d.colors.ink;+ const paper = (values.paper as string) ?? d.colors.paper;+ const accent = (values.accent as string) ?? d.colors.accent;+ const heroScale = (values.heroScale as number) ?? d.heroScale;+ const speed = (values.speed as number) ?? 1;+ return `import { ComicPanels } from "@/components/remocn/comic-panels";++export const MyScene = () => (+ <ComicPanels+ word=${JSON.stringify(word)}+ ink="${ink}"+ paper="${paper}"+ accent="${accent}"+ heroScale={${heroScale}}+ speed={${speed}}+ >+ <Logo />+ </ComicPanels>+);`;+};diff --git a/components/docs/examples/dolly-zoom-example.tsx b/components/docs/examples/dolly-zoom-example.tsxnew file mode 100644index 00000000..25712ca8--- /dev/null+++ b/components/docs/examples/dolly-zoom-example.tsx@@ -0,0 +1,30 @@+"use client";++import { DollyZoom, type DollyZoomProps } from "@/registry/remocn/dolly-zoom";++export function DollyZoomExampleScene(props: DollyZoomProps) {+ return <DollyZoom {...props} />;+}++export const dollyZoomExampleCode = (+ values: Record<string, unknown>,+): string => {+ const intensity = (values.intensity as number) ?? 1;+ const reverse = (values.reverse as boolean) ?? false;+ const door = (values.doorColor as string) ?? "#E5322D";+ const figure = (values.figureColor as string) ?? "#FFFFFF";+ const line = (values.lineColor as string) ?? "#FFFFFF";+ const speed = (values.speed as number) ?? 1;+ const reverseLine = reverse ? "\n reverse" : "";+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { DollyZoom } from "@/components/remocn/dolly-zoom";++export const MyScene = () => (+ <DollyZoom+ intensity={${intensity}}${reverseLine}+ doorColor="${door}"+ figureColor="${figure}"+ lineColor="${line}"${speedLine}+ />+);`;+};diff --git a/components/docs/examples/exploded-view-example.tsx b/components/docs/examples/exploded-view-example.tsxnew file mode 100644index 00000000..a1613fd6--- /dev/null+++ b/components/docs/examples/exploded-view-example.tsx@@ -0,0 +1,45 @@+"use client";++import {+ ExplodedView,+ type ExplodedViewProps,+} from "@/registry/remocn/exploded-view";++const DEFAULT_LABELS = "Interface, Engine, Storage, Hardware";++// The customizer edits labels as one comma-separated string.+const toLabels = (text: string) => text.split(",").map((label) => label.trim());++type ExplodedViewExampleProps = Omit<ExplodedViewProps, "labels"> & {+ labels?: string;+};++export function ExplodedViewExampleScene({+ labels = DEFAULT_LABELS,+ ...props+}: ExplodedViewExampleProps) {+ return <ExplodedView {...props} labels={toLabels(labels)} />;+}++export const explodedViewExampleCode = (+ values: Record<string, unknown>,+): string => {+ const layers = (values.layers as number) ?? 4;+ const highlight = (values.highlight as number) ?? 1;+ const labels = toLabels((values.labels as string) ?? DEFAULT_LABELS);+ const background = (values.backgroundColor as string) ?? "#111111";+ const label = (values.labelColor as string) ?? "#FFFFFF";+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { ExplodedView } from "@/components/remocn/exploded-view";++export const MyScene = () => (+ <ExplodedView+ layers={${layers}}+ highlight={${highlight}}+ labels={${JSON.stringify(labels)}}+ backgroundColor="${background}"+ labelColor="${label}"${speedLine}+ />+);`;+};diff --git a/components/docs/examples/gravity-pile-example.tsx b/components/docs/examples/gravity-pile-example.tsxnew file mode 100644index 00000000..1324b90b--- /dev/null+++ b/components/docs/examples/gravity-pile-example.tsx@@ -0,0 +1,33 @@+"use client";++import {+ GravityPile,+ type GravityPileProps,+} from "@/registry/remocn/gravity-pile";++export function GravityPileExampleScene(props: GravityPileProps) {+ return <GravityPile {...props} />;+}++export const gravityPileExampleCode = (+ values: Record<string, unknown>,+): string => {+ const count = (values.count as number) ?? 30;+ const gravity = (values.gravity as number) ?? 1;+ const seed = (values.seed as number) ?? 7;+ const accent = (values.accentColor as string) ?? "#E5322D";+ const background = (values.backgroundColor as string) ?? "#111111";+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { GravityPile } from "@/components/remocn/gravity-pile";++export const MyScene = () => (+ <GravityPile+ count={${count}}+ gravity={${gravity}}+ seed={${seed}}+ accentColor="${accent}"+ backgroundColor="${background}"${speedLine}+ />+);`;+};diff --git a/components/docs/examples/hyperspace-example.tsx b/components/docs/examples/hyperspace-example.tsxnew file mode 100644index 00000000..8f106646--- /dev/null+++ b/components/docs/examples/hyperspace-example.tsx@@ -0,0 +1,83 @@+"use client";++import { linearTiming, TransitionSeries } from "@remotion/transitions";+import {+ CanvasSceneA,+ CanvasSceneB,+} from "@/components/docs/examples/canvas-scenes";+import { hyperspace } from "@/registry/remocn/hyperspace";++interface HyperspaceExampleProps {+ stars?: number;+ streakColor?: string;+ accentColor?: string;+ accentRatio?: number;+ flash?: boolean;+ flashColor?: string;+}++export function HyperspaceExampleScene({+ stars,+ streakColor,+ accentColor,+ accentRatio,+ flash,+ flashColor,+}: HyperspaceExampleProps) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={90}>+ <CanvasSceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 56 })}+ presentation={hyperspace({+ stars,+ streakColor,+ accentColor,+ accentRatio,+ flash,+ flashColor,+ })}+ />+ <TransitionSeries.Sequence durationInFrames={90}>+ <CanvasSceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}++export const hyperspaceExampleCode = (+ values: Record<string, unknown>,+): string => {+ const stars = (values.stars as number) ?? 260;+ const streakColor = (values.streakColor as string) ?? "#FFFFFF";+ const accentColor = (values.accentColor as string) ?? "#E5322D";+ const accentRatio = (values.accentRatio as number) ?? 0.14;+ const flash = (values.flash as boolean) ?? true;+ const flashColor = (values.flashColor as string) ?? "#FFFFFF";+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { hyperspace } from "@/components/remocn/hyperspace";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={90}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 56 })}+ presentation={hyperspace({+ stars: ${stars},+ streakColor: "${streakColor}",+ accentColor: "${accentColor}",+ accentRatio: ${accentRatio},+ flash: ${flash},+ flashColor: "${flashColor}",+ })}+ />+ <TransitionSeries.Sequence durationInFrames={90}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);`;+};diff --git a/components/docs/examples/impact-shake-example.tsx b/components/docs/examples/impact-shake-example.tsxnew file mode 100644index 00000000..2cfcc7e8--- /dev/null+++ b/components/docs/examples/impact-shake-example.tsx@@ -0,0 +1,35 @@+"use client";++import {+ ImpactShake,+ type ImpactShakeProps,+} from "@/registry/remocn/impact-shake";++export function ImpactShakeExampleScene(props: ImpactShakeProps) {+ return <ImpactShake {...props} />;+}++export const impactShakeExampleCode = (+ values: Record<string, unknown>,+): string => {+ const text = (values.text as string) ?? "LAUNCH";+ const intensity = (values.intensity as number) ?? 1;+ const impact = (values.impact as number) ?? 7;+ const foreground = (values.foregroundColor as string) ?? "#FFFFFF";+ const background = (values.backgroundColor as string) ?? "#111111";+ const seed = (values.seed as number) ?? 1;+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { ImpactShake } from "@/components/remocn/impact-shake";++export const MyScene = () => (+ <ImpactShake+ text=${JSON.stringify(text)}+ intensity={${intensity}}+ impact={${impact}}+ foregroundColor="${foreground}"+ backgroundColor="${background}"+ seed={${seed}}${speedLine}+ />+);`;+};diff --git a/components/docs/examples/inflate-example.tsx b/components/docs/examples/inflate-example.tsxnew file mode 100644index 00000000..b7f7b646--- /dev/null+++ b/components/docs/examples/inflate-example.tsx@@ -0,0 +1,23 @@+"use client";++import {+ DemoWordmark,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import { Inflate, type InflateProps } from "@/registry/remocn/inflate";++export function InflateExampleScene(props: Omit<InflateProps, "children">) {+ return (+ <Inflate {...props}>+ <DemoWordmark />+ </Inflate>+ );+}++export const inflateExampleCode = (values: Record<string, unknown>): string =>+ logoStingCode({+ name: "inflate",+ component: "Inflate",+ values,+ child: "wordmark",+ });diff --git a/components/docs/examples/iris-wipe-example.tsx b/components/docs/examples/iris-wipe-example.tsxnew file mode 100644index 00000000..ab04e35f--- /dev/null+++ b/components/docs/examples/iris-wipe-example.tsx@@ -0,0 +1,63 @@+"use client";++import { linearTiming, TransitionSeries } from "@remotion/transitions";+import {+ CanvasSceneB,+ CanvasScenePoster,+} from "@/components/docs/examples/canvas-scenes";+import { irisWipe } from "@/registry/remocn/iris-wipe";++interface IrisWipeExampleProps {+ color?: string;+ centerX?: number;+ centerY?: number;+ holdRadius?: number;+}++export function IrisWipeExampleScene({+ color,+ centerX,+ centerY,+ holdRadius,+}: IrisWipeExampleProps) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasScenePoster />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 36 })}+ presentation={irisWipe({ color, centerX, centerY, holdRadius })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasSceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}++export const irisWipeExampleCode = (+ values: Record<string, unknown>,+): string => {+ const color = (values.color as string) ?? "#000000";+ const centerX = (values.centerX as number) ?? 0.5;+ const centerY = (values.centerY as number) ?? 0.5;+ const holdRadius = (values.holdRadius as number) ?? 12;+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { irisWipe } from "@/components/remocn/iris-wipe";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 36 })}+ presentation={irisWipe({ color: "${color}", centerX: ${centerX}, centerY: ${centerY}, holdRadius: ${holdRadius} })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);`;+};diff --git a/components/docs/examples/light-leak-example.tsx b/components/docs/examples/light-leak-example.tsxnew file mode 100644index 00000000..307b93e3--- /dev/null+++ b/components/docs/examples/light-leak-example.tsx@@ -0,0 +1,92 @@+"use client";++import { linearTiming, TransitionSeries } from "@remotion/transitions";+import {+ CanvasSceneA,+ CanvasSceneB,+} from "@/components/docs/examples/canvas-scenes";+import {+ type LightLeakProps,+ lightLeak,+ lightLeakDefaults,+} from "@/registry/remocn/light-leak";++const [DEFAULT_LEAK, MID_A, MID_B, DEFAULT_BLOWOUT] = lightLeakDefaults.colors;++// The customizer passes flat props, the presentation takes a palette: the+// first color leads the leak, the last one is the blow-out tint.+function paletteOf(leakColor?: string, blowoutColor?: string) {+ return [+ leakColor ?? DEFAULT_LEAK,+ MID_A,+ MID_B,+ blowoutColor ?? DEFAULT_BLOWOUT,+ ];+}++interface LightLeakExampleProps {+ origin?: LightLeakProps["origin"];+ intensity?: number;+ leakColor?: string;+ blowoutColor?: string;+}++export function LightLeakExampleScene({+ origin,+ intensity,+ leakColor,+ blowoutColor,+}: LightLeakExampleProps) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasSceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 20 })}+ presentation={lightLeak({+ origin,+ intensity,+ colors: paletteOf(leakColor, blowoutColor),+ })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasSceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}++export const lightLeakExampleCode = (+ values: Record<string, unknown>,+): string => {+ const origin = (values.origin as string) ?? "left";+ const intensity = (values.intensity as number) ?? 1;+ const leakColor = (values.leakColor as string) ?? DEFAULT_LEAK;+ const blowoutColor = (values.blowoutColor as string) ?? DEFAULT_BLOWOUT;+ const customPalette =+ leakColor.toLowerCase() !== DEFAULT_LEAK.toLowerCase() ||+ blowoutColor.toLowerCase() !== DEFAULT_BLOWOUT.toLowerCase();+ const colors = customPalette+ ? `, colors: [${paletteOf(leakColor, blowoutColor)+ .map((c) => `"${c}"`)+ .join(", ")}]`+ : "";+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { lightLeak } from "@/components/remocn/light-leak";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 20 })}+ presentation={lightLeak({ origin: "${origin}", intensity: ${intensity}${colors} })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);`;+};diff --git a/components/docs/examples/line-boil-example.tsx b/components/docs/examples/line-boil-example.tsxnew file mode 100644index 00000000..11e4aab9--- /dev/null+++ b/components/docs/examples/line-boil-example.tsx@@ -0,0 +1,49 @@+"use client";++import { LineBoil, lineBoilDefaults } from "@/registry/remocn/line-boil";++interface LineBoilExampleProps {+ line?: string;+ fill?: string;+ background?: string;+ boilEvery?: number;+ drawings?: number;+ amplitude?: number;+ strokeWidth?: number;+ size?: number;+ speed?: number;+}++export function LineBoilExampleScene(props: LineBoilExampleProps) {+ return <LineBoil {...props} />;+}++export const lineBoilExampleCode = (+ values: Record<string, unknown>,+): string => {+ const d = lineBoilDefaults;+ const line = (values.line as string) ?? d.colors.line;+ const fill = (values.fill as string) ?? d.colors.fill;+ const background = (values.background as string) ?? d.colors.background;+ const boilEvery = (values.boilEvery as number) ?? d.boilEvery;+ const drawings = (values.drawings as number) ?? d.drawings;+ const amplitude = (values.amplitude as number) ?? d.amplitude;+ const strokeWidth = (values.strokeWidth as number) ?? d.strokeWidth;+ const size = (values.size as number) ?? d.size;+ const speed = (values.speed as number) ?? 1;+ return `import { LineBoil } from "@/components/remocn/line-boil";++export const MyScene = () => (+ <LineBoil+ line="${line}"+ fill="${fill}"+ background="${background}"+ boilEvery={${boilEvery}}+ drawings={${drawings}}+ amplitude={${amplitude}}+ strokeWidth={${strokeWidth}}+ size={${size}}+ speed={${speed}}+ />+);`;+};diff --git a/components/docs/examples/liquid-fill-example.tsx b/components/docs/examples/liquid-fill-example.tsxnew file mode 100644index 00000000..8ab24992--- /dev/null+++ b/components/docs/examples/liquid-fill-example.tsx@@ -0,0 +1,30 @@+"use client";++import {+ DemoWordmark,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import {+ LiquidFill,+ type LiquidFillProps,+} from "@/registry/remocn/liquid-fill";++export function LiquidFillExampleScene(+ props: Omit<LiquidFillProps, "children">,+) {+ return (+ <LiquidFill {...props}>+ <DemoWordmark />+ </LiquidFill>+ );+}++export const liquidFillExampleCode = (+ values: Record<string, unknown>,+): string =>+ logoStingCode({+ name: "liquid-fill",+ component: "LiquidFill",+ values,+ child: "wordmark",+ });diff --git a/components/docs/examples/logo-sting-lockup.tsx b/components/docs/examples/logo-sting-lockup.tsxnew file mode 100644index 00000000..7bfcc6e8--- /dev/null+++ b/components/docs/examples/logo-sting-lockup.tsx@@ -0,0 +1,123 @@+"use client";++/**+ * Neutral placeholder brand used by the logo-sting docs previews. Kept local to+ * the docs examples so they never import from the Studio shelves.+ */++const FONT_FAMILY =+ "var(--font-geist-sans), Inter, -apple-system, BlinkMacSystemFont, sans-serif";++const MARK = "#E5322D";+const INK = "#111111";++/** Wordmark only, for stings that draw their own mark. */+export function DemoWordmark({ color = "#FFFFFF" }: { color?: string }) {+ return (+ <span+ style={{+ fontFamily: FONT_FAMILY,+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color,+ }}+ >+ remocn+ </span>+ );+}++/** Rounded red mark plus a wordmark, for stings that reveal a full lockup. */+export function DemoLockup({+ scale = 1,+ color = "#FFFFFF",+}: {+ scale?: number;+ color?: string;+}) {+ return (+ <div+ style={{+ display: "flex",+ alignItems: "center",+ gap: 28 * scale,+ transform: `scale(${scale})`,+ }}+ >+ <div+ style={{+ width: 120,+ height: 120,+ borderRadius: 32,+ backgroundColor: MARK,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36,+ height: 36,+ borderRadius: "50%",+ backgroundColor: INK,+ }}+ />+ </div>+ <DemoWordmark color={color} />+ </div>+ );+}++const LOGO_CHILD = `<Img src={staticFile("logo.svg")} style={{ height: 120 }} />`;++const WORDMARK_CHILD = `<span+ style={{+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: "#FFFFFF",+ }}+ >+ remocn+ </span>`;++function formatProp(key: string, value: unknown) {+ if (typeof value === "string") return ` ${key}="${value}"`;+ return ` ${key}={${JSON.stringify(value)}}`;+}++/**+ * Usage snippet for a logo sting that wraps its children. `child: "logo"` emits+ * an image lockup, `child: "wordmark"` a plain text wordmark for stings that+ * draw their own mark.+ */+export function logoStingCode({+ name,+ component,+ values,+ child,+}: {+ name: string;+ component: string;+ values: Record<string, unknown>;+ child: "logo" | "wordmark";+}): string {+ const props = Object.entries(values)+ .filter(([, value]) => value !== undefined)+ .map(([key, value]) => formatProp(key, value))+ .join("\n");+ const imports =+ child === "logo" ? `import { Img, staticFile } from "remotion";\n` : "";+ const body = child === "logo" ? LOGO_CHILD : WORDMARK_CHILD;+ return `${imports}import { ${component} } from "@/components/remocn/${name}";++export const LogoSting = () => (+ <${component}+${props}+ >+ ${body}+ </${component}>+);`;+}diff --git a/components/docs/examples/orbit-lock-example.tsx b/components/docs/examples/orbit-lock-example.tsxnew file mode 100644index 00000000..e3307886--- /dev/null+++ b/components/docs/examples/orbit-lock-example.tsx@@ -0,0 +1,23 @@+"use client";++import {+ DemoLockup,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import { OrbitLock, type OrbitLockProps } from "@/registry/remocn/orbit-lock";++export function OrbitLockExampleScene(props: Omit<OrbitLockProps, "children">) {+ return (+ <OrbitLock {...props}>+ <DemoLockup />+ </OrbitLock>+ );+}++export const orbitLockExampleCode = (values: Record<string, unknown>): string =>+ logoStingCode({+ name: "orbit-lock",+ component: "OrbitLock",+ values,+ child: "logo",+ });diff --git a/components/docs/examples/paper-tear-example.tsx b/components/docs/examples/paper-tear-example.tsxnew file mode 100644index 00000000..92c31a84--- /dev/null+++ b/components/docs/examples/paper-tear-example.tsx@@ -0,0 +1,63 @@+"use client";++import { linearTiming, TransitionSeries } from "@remotion/transitions";+import {+ CanvasSceneA,+ CanvasScenePoster,+} from "@/components/docs/examples/canvas-scenes";+import { paperTear } from "@/registry/remocn/paper-tear";++interface PaperTearExampleProps {+ impact?: number;+ roughness?: number;+ seed?: number;+ edgeColor?: string;+}++export function PaperTearExampleScene({+ impact,+ roughness,+ seed,+ edgeColor,+}: PaperTearExampleProps) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasSceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 36 })}+ presentation={paperTear({ impact, roughness, seed, edgeColor })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasScenePoster />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}++export const paperTearExampleCode = (+ values: Record<string, unknown>,+): string => {+ const impact = (values.impact as number) ?? 1;+ const roughness = (values.roughness as number) ?? 0.5;+ const seed = (values.seed as number) ?? 7;+ const edgeColor = (values.edgeColor as string) ?? "#FFFFFF";+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { paperTear } from "@/components/remocn/paper-tear";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 36 })}+ presentation={paperTear({ impact: ${impact}, roughness: ${roughness}, seed: ${seed}, edgeColor: "${edgeColor}" })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);`;+};diff --git a/components/docs/examples/parallax-depth-example.tsx b/components/docs/examples/parallax-depth-example.tsxnew file mode 100644index 00000000..54775e3e--- /dev/null+++ b/components/docs/examples/parallax-depth-example.tsx@@ -0,0 +1,43 @@+"use client";++import {+ ParallaxDepth,+ type ParallaxDepthProps,+} from "@/registry/remocn/parallax-depth";++type ParallaxDepthExampleProps = Omit<ParallaxDepthProps, "direction"> & {+ // The customizer edits direction as an enum.+ direction?: "right" | "left";+};++export function ParallaxDepthExampleScene({+ direction = "right",+ ...props+}: ParallaxDepthExampleProps) {+ return <ParallaxDepth {...props} direction={direction === "left" ? -1 : 1} />;+}++export const parallaxDepthExampleCode = (+ values: Record<string, unknown>,+): string => {+ const distance = (values.distance as number) ?? 0.5;+ const push = (values.push as number) ?? 0.16;+ const direction = values.direction === "left" ? -1 : 1;+ const seed = (values.seed as number) ?? 3;+ const sky = (values.skyColor as string) ?? "#111111";+ const sun = (values.sunColor as string) ?? "#E5322D";+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { ParallaxDepth } from "@/components/remocn/parallax-depth";++export const MyScene = () => (+ <ParallaxDepth+ distance={${distance}}+ push={${push}}+ direction={${direction}}+ seed={${seed}}+ skyColor="${sky}"+ sunColor="${sun}"${speedLine}+ />+);`;+};diff --git a/components/docs/examples/pixel-sort-example.tsx b/components/docs/examples/pixel-sort-example.tsxnew file mode 100644index 00000000..7df27031--- /dev/null+++ b/components/docs/examples/pixel-sort-example.tsx@@ -0,0 +1,60 @@+"use client";++import { linearTiming, TransitionSeries } from "@remotion/transitions";+import {+ CanvasSceneA,+ CanvasScenePoster,+} from "@/components/docs/examples/canvas-scenes";+import { pixelSort } from "@/registry/remocn/pixel-sort";++interface PixelSortExampleProps {+ columns?: number;+ seed?: number;+ streakColor?: string;+}++export function PixelSortExampleScene({+ columns,+ seed,+ streakColor,+}: PixelSortExampleProps) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasSceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 30 })}+ presentation={pixelSort({ columns, seed, streakColor })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasScenePoster />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}++export const pixelSortExampleCode = (+ values: Record<string, unknown>,+): string => {+ const columns = (values.columns as number) ?? 40;+ const seed = (values.seed as number) ?? 5;+ const streakColor = (values.streakColor as string) ?? "#FFFFFF";+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { pixelSort } from "@/components/remocn/pixel-sort";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 30 })}+ presentation={pixelSort({ columns: ${columns}, seed: ${seed}, streakColor: "${streakColor}" })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);`;+};diff --git a/components/docs/examples/puzzle-snap-example.tsx b/components/docs/examples/puzzle-snap-example.tsxnew file mode 100644index 00000000..96045f18--- /dev/null+++ b/components/docs/examples/puzzle-snap-example.tsx@@ -0,0 +1,30 @@+"use client";++import {+ DemoWordmark,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import {+ PuzzleSnap,+ type PuzzleSnapProps,+} from "@/registry/remocn/puzzle-snap";++export function PuzzleSnapExampleScene(+ props: Omit<PuzzleSnapProps, "children">,+) {+ return (+ <PuzzleSnap {...props}>+ <DemoWordmark />+ </PuzzleSnap>+ );+}++export const puzzleSnapExampleCode = (+ values: Record<string, unknown>,+): string =>+ logoStingCode({+ name: "puzzle-snap",+ component: "PuzzleSnap",+ values,+ child: "wordmark",+ });diff --git a/components/docs/examples/riso-print-example.tsx b/components/docs/examples/riso-print-example.tsxnew file mode 100644index 00000000..f66685d9--- /dev/null+++ b/components/docs/examples/riso-print-example.tsx@@ -0,0 +1,42 @@+"use client";++import { RisoPrint, risoPrintDefaults } from "@/registry/remocn/riso-print";++interface RisoPrintExampleProps {+ keyInk?: string;+ accentInk?: string;+ paper?: string;+ grain?: number;+ jitter?: number;+ marks?: boolean;+ speed?: number;+}++export function RisoPrintExampleScene(props: RisoPrintExampleProps) {+ return <RisoPrint {...props} />;+}++export const risoPrintExampleCode = (+ values: Record<string, unknown>,+): string => {+ const keyInk = (values.keyInk as string) ?? risoPrintDefaults.inks[0];+ const accentInk = (values.accentInk as string) ?? risoPrintDefaults.inks[1];+ const paper = (values.paper as string) ?? risoPrintDefaults.paper;+ const grain = (values.grain as number) ?? risoPrintDefaults.grain;+ const jitter = (values.jitter as number) ?? risoPrintDefaults.jitter;+ const marks = (values.marks as boolean) ?? risoPrintDefaults.marks;+ const speed = (values.speed as number) ?? 1;+ return `import { RisoPrint } from "@/components/remocn/riso-print";++export const MyScene = () => (+ <RisoPrint+ keyInk="${keyInk}"+ accentInk="${accentInk}"+ paper="${paper}"+ grain={${grain}}+ jitter={${jitter}}+ marks={${marks}}+ speed={${speed}}+ />+);`;+};diff --git a/components/docs/examples/spotlight-example.tsx b/components/docs/examples/spotlight-example.tsxnew file mode 100644index 00000000..b3446c6d--- /dev/null+++ b/components/docs/examples/spotlight-example.tsx@@ -0,0 +1,23 @@+"use client";++import {+ DemoLockup,+ logoStingCode,+} from "@/components/docs/examples/logo-sting-lockup";+import { Spotlight, type SpotlightProps } from "@/registry/remocn/spotlight";++export function SpotlightExampleScene(props: Omit<SpotlightProps, "children">) {+ return (+ <Spotlight {...props}>+ <DemoLockup />+ </Spotlight>+ );+}++export const spotlightExampleCode = (values: Record<string, unknown>): string =>+ logoStingCode({+ name: "spotlight",+ component: "Spotlight",+ values,+ child: "logo",+ });diff --git a/components/docs/examples/synthwave-example.tsx b/components/docs/examples/synthwave-example.tsxnew file mode 100644index 00000000..c2fe7a20--- /dev/null+++ b/components/docs/examples/synthwave-example.tsx@@ -0,0 +1,46 @@+"use client";++import { Synthwave, synthwaveDefaults } from "@/registry/remocn/synthwave";++interface SynthwaveExampleProps {+ grid?: string;+ sunTop?: string;+ sunBottom?: string;+ skyHorizon?: string;+ gridSpeed?: number;+ horizon?: number;+ sunStripes?: boolean;+ speed?: number;+}++export function SynthwaveExampleScene(props: SynthwaveExampleProps) {+ return <Synthwave {...props} />;+}++export const synthwaveExampleCode = (+ values: Record<string, unknown>,+): string => {+ const d = synthwaveDefaults;+ const grid = (values.grid as string) ?? d.colors.grid;+ const sunTop = (values.sunTop as string) ?? d.colors.sunTop;+ const sunBottom = (values.sunBottom as string) ?? d.colors.sunBottom;+ const skyHorizon = (values.skyHorizon as string) ?? d.colors.skyHorizon;+ const gridSpeed = (values.gridSpeed as number) ?? d.gridSpeed;+ const horizon = (values.horizon as number) ?? d.horizon;+ const sunStripes = (values.sunStripes as boolean) ?? d.sunStripes;+ const speed = (values.speed as number) ?? 1;+ return `import { Synthwave } from "@/components/remocn/synthwave";++export const MyBackground = () => (+ <Synthwave+ grid="${grid}"+ sunTop="${sunTop}"+ sunBottom="${sunBottom}"+ skyHorizon="${skyHorizon}"+ gridSpeed={${gridSpeed}}+ horizon={${horizon}}+ sunStripes={${sunStripes}}+ speed={${speed}}+ />+);`;+};diff --git a/components/docs/examples/tiny-planet-example.tsx b/components/docs/examples/tiny-planet-example.tsxnew file mode 100644index 00000000..a85c5b14--- /dev/null+++ b/components/docs/examples/tiny-planet-example.tsx@@ -0,0 +1,37 @@+"use client";++import {+ TinyPlanet,+ type TinyPlanetProps,+} from "@/registry/remocn/tiny-planet";++export function TinyPlanetExampleScene(props: TinyPlanetProps) {+ return <TinyPlanet {...props} />;+}++export const tinyPlanetExampleCode = (+ values: Record<string, unknown>,+): string => {+ const buildings = (values.buildings as number) ?? 26;+ const spin = (values.spin as number) ?? 0.7;+ const seed = (values.seed as number) ?? 4;+ const sky = (values.skyColor as string) ?? "#111111";+ const sun = (values.sunColor as string) ?? "#E5322D";+ const building = (values.buildingColor as string) ?? "#FFFFFF";+ const ground = (values.groundColor as string) ?? "#262626";+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { TinyPlanet } from "@/components/remocn/tiny-planet";++export const MyScene = () => (+ <TinyPlanet+ buildings={${buildings}}+ spin={${spin}}+ seed={${seed}}+ skyColor="${sky}"+ sunColor="${sun}"+ buildingColor="${building}"+ groundColor="${ground}"${speedLine}+ />+);`;+};diff --git a/components/docs/examples/turntable-example.tsx b/components/docs/examples/turntable-example.tsxnew file mode 100644index 00000000..dacdaebd--- /dev/null+++ b/components/docs/examples/turntable-example.tsx@@ -0,0 +1,34 @@+"use client";++import { Turntable, type TurntableProps } from "@/registry/remocn/turntable";++export function TurntableExampleScene(props: TurntableProps) {+ return <Turntable {...props} />;+}++export const turntableExampleCode = (+ values: Record<string, unknown>,+): string => {+ const thickness = (values.thickness as number) ?? 22;+ const turns = (values.turns as number) ?? 1;+ const tilt = (values.tilt as number) ?? 8;+ const front = (values.frontColor as string) ?? "#E5322D";+ const edge = (values.edgeColor as string) ?? "#A3201C";+ const back = (values.backColor as string) ?? "#F2F2F2";+ const background = (values.backgroundColor as string) ?? "#111111";+ const speed = (values.speed as number) ?? 1;+ const speedLine = speed === 1 ? "" : `\n speed={${speed}}`;+ return `import { Turntable } from "@/components/remocn/turntable";++export const MyScene = () => (+ <Turntable+ thickness={${thickness}}+ turns={${turns}}+ tilt={${tilt}}+ frontColor="${front}"+ edgeColor="${edge}"+ backColor="${back}"+ backgroundColor="${background}"${speedLine}+ />+);`;+};diff --git a/components/docs/examples/venetian-blinds-example.tsx b/components/docs/examples/venetian-blinds-example.tsxnew file mode 100644index 00000000..c26e88c2--- /dev/null+++ b/components/docs/examples/venetian-blinds-example.tsx@@ -0,0 +1,66 @@+"use client";++import { linearTiming, TransitionSeries } from "@remotion/transitions";+import {+ CanvasSceneA,+ CanvasScenePoster,+} from "@/components/docs/examples/canvas-scenes";+import {+ type VenetianBlindsProps,+ venetianBlinds,+} from "@/registry/remocn/venetian-blinds";++interface VenetianBlindsExampleProps {+ slats?: number;+ stagger?: number;+ direction?: VenetianBlindsProps["direction"];+ shadeColor?: string;+}++export function VenetianBlindsExampleScene({+ slats,+ stagger,+ direction,+ shadeColor,+}: VenetianBlindsExampleProps) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasSceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 26 })}+ presentation={venetianBlinds({ slats, stagger, direction, shadeColor })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <CanvasScenePoster />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}++export const venetianBlindsExampleCode = (+ values: Record<string, unknown>,+): string => {+ const slats = (values.slats as number) ?? 12;+ const stagger = (values.stagger as number) ?? 0.55;+ const direction = (values.direction as string) ?? "top-down";+ const shadeColor = (values.shadeColor as string) ?? "#000000";+ return `import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { venetianBlinds } from "@/components/remocn/venetian-blinds";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 26 })}+ presentation={venetianBlinds({ slats: ${slats}, stagger: ${stagger}, direction: "${direction}", shadeColor: "${shadeColor}" })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);`;+};diff --git a/components/docs/examples/x-ray-scan-example.tsx b/components/docs/examples/x-ray-scan-example.tsxnew file mode 100644index 00000000..27b27ede--- /dev/null+++ b/components/docs/examples/x-ray-scan-example.tsx@@ -0,0 +1,44 @@+"use client";++import {+ XRayScan,+ type XRayScanProps,+ xRayScanDefaults,+} from "@/registry/remocn/x-ray-scan";++interface XRayScanExampleProps {+ direction?: XRayScanProps["direction"];+ shell?: string;+ accent?: string;+ line?: string;+ background?: string;+ speed?: number;+}++export function XRayScanExampleScene(props: XRayScanExampleProps) {+ return <XRayScan {...props} />;+}++export const xRayScanExampleCode = (+ values: Record<string, unknown>,+): string => {+ const d = xRayScanDefaults;+ const direction = (values.direction as string) ?? d.direction;+ const shell = (values.shell as string) ?? d.colors.shell;+ const accent = (values.accent as string) ?? d.colors.accent;+ const line = (values.line as string) ?? d.colors.line;+ const background = (values.background as string) ?? d.colors.background;+ const speed = (values.speed as number) ?? 1;+ return `import { XRayScan } from "@/components/remocn/x-ray-scan";++export const MyScene = () => (+ <XRayScan+ direction="${direction}"+ shell="${shell}"+ accent="${accent}"+ line="${line}"+ background="${background}"+ speed={${speed}}+ />+);`;+};diff --git a/config/mega-menu.ts b/config/mega-menu.tsindex 033f0cb0..6f8ca5e9 100644--- a/config/mega-menu.ts+++ b/config/mega-menu.ts@@ -37,6 +37,13 @@ const COMPONENT_CATEGORIES: MegaMenuItem[] = [href: "/docs/motion-graphics",preview: "bauhaus-build",},+ { label: "Logo Stings", href: "/docs/logo-stings", preview: "neon-sign" },+ { label: "Camera & Physics", href: "/docs/camera", preview: "dolly-zoom" },+ {+ label: "Graphic Looks",+ href: "/docs/graphic-looks",+ preview: "riso-print",+ },{label: "Filters",href: "/docs/filters/getting-started/introduction",diff --git a/config/site.ts b/config/site.tsindex 1fb7c990..c81f9878 100644--- a/config/site.ts+++ b/config/site.ts@@ -78,20 +78,44 @@ export const NAV_LINKS: NavLink[] = [* tag another menu item — no component changes needed. See `withNewBadges`.*/export const NEW_BADGE_PATHS = new Set<string>([- "/docs/motion-graphics/bauhaus-build",- "/docs/motion-graphics/mondrian-split",- "/docs/motion-graphics/truchet-flip",- "/docs/motion-graphics/trim-burst",- "/docs/motion-graphics/speed-lines",- "/docs/motion-graphics/squiggle",- "/docs/effects/keystroke",- "/docs/ui-blocks/code-morph",- "/docs/ai/agent-run",- "/docs/typography/selection-snap",- "/docs/typography/echo-stack",- "/docs/typography/type-wall",- "/docs/typography/ring-text",- "/docs/typography/period-drop",+ "/docs/transitions/iris-wipe",+ "/docs/transitions/venetian-blinds",+ "/docs/transitions/paper-tear",+ "/docs/transitions/pixel-sort",+ "/docs/transitions/light-leak",+ "/docs/transitions/hyperspace",+ "/docs/logo-stings/orbit-lock",+ "/docs/logo-stings/puzzle-snap",+ "/docs/logo-stings/spotlight",+ "/docs/logo-stings/neon-sign",+ "/docs/logo-stings/inflate",+ "/docs/logo-stings/liquid-fill",+ "/docs/logo-stings/accordion-unfold",+ "/docs/logo-stings/anamorphic-flare",+ "/docs/motion-graphics/pendulum-wave",+ "/docs/motion-graphics/flow-field",+ "/docs/motion-graphics/isometric-build",+ "/docs/motion-graphics/life-grid",+ "/docs/motion-graphics/string-art",+ "/docs/motion-graphics/topo-lines",+ "/docs/motion-graphics/phyllotaxis",+ "/docs/camera/parallax-depth",+ "/docs/camera/dolly-zoom",+ "/docs/camera/turntable",+ "/docs/camera/tiny-planet",+ "/docs/camera/exploded-view",+ "/docs/camera/gravity-pile",+ "/docs/camera/cloth-reveal",+ "/docs/camera/impact-shake",+ "/docs/graphic-looks/riso-print",+ "/docs/graphic-looks/line-boil",+ "/docs/graphic-looks/blueprint",+ "/docs/graphic-looks/duotone-beat",+ "/docs/graphic-looks/comic-panels",+ "/docs/graphic-looks/long-shadow",+ "/docs/graphic-looks/synthwave",+ "/docs/graphic-looks/brick-mosaic",+ "/docs/graphic-looks/x-ray-scan",]);export type FooterGroup = {diff --git a/content/changelog/2026-10-23-motion-pack.mdx b/content/changelog/2026-10-23-motion-pack.mdxnew file mode 100644index 00000000..2af848a2--- /dev/null+++ b/content/changelog/2026-10-23-motion-pack.mdx@@ -0,0 +1,67 @@+---+title: Motion Pack+date: 2026-10-23+---++Thirty-eight new pieces of motion design, the kind a motion designer builds in After Effects for a single beat. They include graphic cuts between scenes and logo stings for an opener or an end card. Generative loops fill a section break. Camera moves and physics give a product shot some weight, and graphic looks restyle a subject as print, film or a technical drawing. Every piece is deterministic, takes your colors and plays from the Remotion frame, so it seeks and renders the same every time.++<ChangelogPreview name="hyperspace" />++### New components++**Transitions.** Six graphic cuts for `TransitionSeries`.++- [Iris Wipe](/docs/transitions/iris-wipe) closes a cartoon iris on the subject, holds it as a dot for a beat, then opens on the next scene.+- [Venetian Blinds](/docs/transitions/venetian-blinds) turns the outgoing scene edge-on in staggered slats to reveal the next one.+- [Paper Tear](/docs/transitions/paper-tear) rips the frame down the middle and flings both halves apart with a shake, a seam flash and debris.+- [Pixel Sort](/docs/transitions/pixel-sort) melts the scene into glowing vertical streaks and drops the next one in column by column.+- [Light Leak](/docs/transitions/light-leak) drifts a warm analog leak across the frame and cuts to the next scene under its blow-out.+- [Hyperspace](/docs/transitions/hyperspace) stretches a starfield into radial streaks, tunnels forward and lands on the next scene through a white flash.++**Logo stings.** A new [Logo Stings](/docs/logo-stings) category. Most of them wrap your own logo.++- [Orbit Lock](/docs/logo-stings/orbit-lock): moons spiral down shrinking orbits into a core, which bursts into a ring flash as your logo springs into place.+- [Puzzle Snap](/docs/logo-stings/puzzle-snap): geometric pieces spin in and snap into a mark with spark bursts, then the wordmark slides out.+- [Spotlight](/docs/logo-stings/spotlight): a stage light searches the dark, overshoots and lands on your logo, then the house lights come up.+- [Neon Sign](/docs/logo-stings/neon-sign): any SVG path lights up as glass tubes that stutter on, buzz off once and hold lit.+- [Inflate](/docs/logo-stings/inflate): a flat sliver puffs up like a balloon toy into a glossy mark.+- [Liquid Fill](/docs/logo-stings/liquid-fill): a drop falls into an outlined mark, which fills with sloshing liquid until it turns solid.+- [Accordion Unfold](/docs/logo-stings/accordion-unfold): a folded paper zigzag opens into a flat card with your logo printed across it.+- [Anamorphic Flare](/docs/logo-stings/anamorphic-flare): a point of light stretches into a cinematic lens streak that sweeps the frame and reveals your logo.++<ChangelogPreview name="neon-sign" />++**Generative loops.** A new section in [Motion Graphics](/docs/motion-graphics). Most of these loop seamlessly as backgrounds.++- [Pendulum Wave](/docs/motion-graphics/pendulum-wave): a row of tuned pendulums drifts from a line into waves and braids, then realigns.+- [Flow Field](/docs/motion-graphics/flow-field): hundreds of particles ride a seeded vector field and leave fine fading trails.+- [Isometric Build](/docs/motion-graphics/isometric-build): an isometric grid springs up row by row into a stepped block sculpture with one accent tower.+- [Life Grid](/docs/motion-graphics/life-grid): Conway's Game of Life on a seeded grid, with newborn cells flashing in the accent.+- [String Art](/docs/motion-graphics/string-art): thread strings a ring of pins as a times table, and the figure morphs from a cardioid into a nephroid and beyond.+- [Topo Lines](/docs/motion-graphics/topo-lines): contour lines around seeded peaks breathe and drift, with one line picked out in the accent.+- [Phyllotaxis](/docs/motion-graphics/phyllotaxis): seeds spiral out at the golden angle into a sunflower head, then a Fibonacci arm pulses outward.++**Camera and physics.** A new [Camera & Physics](/docs/camera) category.++- [Parallax Depth](/docs/camera/parallax-depth): a layered landscape trucks sideways, with near layers sliding faster than far ones. You can pass your own layers.+- [Dolly Zoom](/docs/camera/dolly-zoom): the vertigo shot. A corridor stretches while the subject keeps its exact size.+- [Turntable](/docs/camera/turntable): a product card with real thickness spins through its front, edge and back in CSS 3D.+- [Tiny Planet](/docs/camera/tiny-planet): a flat skyline bends into a tiny planet, then keeps turning beside a sun.+- [Exploded View](/docs/camera/exploded-view): a stack of isometric slabs springs apart with leader lines and numbered labels, then clicks back together.+- [Gravity Pile](/docs/camera/gravity-pile): shapes or your own items rain down, bounce and settle into a heap in a deterministic simulation.+- [Cloth Reveal](/docs/camera/cloth-reveal): a satin sheet is yanked off your content from one corner and flutters out of frame.+- [Impact Shake](/docs/camera/impact-shake): heavy content slams down with a squash, a camera jolt, an RGB split and a dust kick.++**Graphic looks.** A new [Graphic Looks](/docs/graphic-looks) category.++- [Riso Print](/docs/graphic-looks/riso-print): a subject printed in two risograph inks, with the accent plate landing off-register on grainy paper.+- [Line Boil](/docs/graphic-looks/line-boil): an SVG outline is drawn by hand, boils on threes like cel animation and fills with color.+- [Blueprint](/docs/graphic-looks/blueprint): a product wipes into a technical drawing with a grid, linework, dimension lines and a callout.+- [Duotone Beat](/docs/graphic-looks/duotone-beat): a portrait as a two-ink halftone that swaps its ink pair and punches in on every beat.+- [Comic Panels](/docs/graphic-looks/comic-panels): the frame cracks into a three-panel comic page, and the action panel bursts into a full-frame POW.+- [Long Shadow](/docs/graphic-looks/long-shadow): a flat icon pops in casting a long shadow, then the light swings and the shadow sweeps around.+- [Synthwave](/docs/graphic-looks/synthwave): a looping retro backdrop with a scrolling perspective grid, a striped sun and mountain ranges.+- [Brick Mosaic](/docs/graphic-looks/brick-mosaic): toy bricks drop row by row onto a baseplate and build any pixel-art image.+- [X-Ray Scan](/docs/graphic-looks/x-ray-scan): a scanner bar sweeps across a device and reveals its internals as white linework.++<ChangelogPreview name="riso-print" />diff --git a/content/docs/camera/cloth-reveal.mdx b/content/docs/camera/cloth-reveal.mdxnew file mode 100644index 00000000..18f5b66a--- /dev/null+++ b/content/docs/camera/cloth-reveal.mdx@@ -0,0 +1,90 @@+---+title: Cloth Reveal+description: A satin sheet draped over your content is yanked from one corner, folding and fluttering as a simulated cloth before it clears the frame+component: cloth-reveal+vibe: premium+length: 34+useWhen:+ - "A logo, product or headline should be unveiled like a launch-event reveal."+ - "The video opens on a covered shape so the viewer waits a beat for what is underneath."+ - "A single premium reveal is the payoff of the video and can afford a heavier render."+avoidWhen:+ - "The reveal is a move from one scene to the next rather than content under a sheet — use `page-turn`."+ - "A light should search the dark stage and land on the logo — use `spotlight`."+ - "Lines of text only need to rise into place — use `mask-reveal-up`."+---++<ComponentPreview name="cloth-reveal" />++<InstallBlock name="cloth-reveal" />++## Usage++`ClothReveal` covers its children with a sheet of cloth. The sheet rests on a+soft bump in the middle, as if draped over the hidden object, with seeded+folds and waves so it never looks ironed. On the tug frame a hand pinches one+corner, lifts it, and yanks it off-frame with growing speed. The rest of the+sheet follows as a mass-spring cloth: it peels up, folds over to show its+darker underside, flutters, and casts a soft shadow on the content below.++```tsx+import { ClothReveal } from "@/components/remocn/cloth-reveal";++export const Unveil = () => (+ <ClothReveal direction="right" clothColor="#1F3A93" undersideColor="#0E1C4A">+ <YourLogo />+ </ClothReveal>+);+```++Children are centered in the frame on top of `background`. `direction` picks+the corner and the pull:++| `direction` | Corner | Pull |+| --- | --- | --- |+| `right` | Top right | Right and slightly up |+| `left` | Top left | Left and slightly up |+| `up` | Top right | Up and to the right |+| `down` | Bottom left | Down and to the left |++`delay` is the tug frame at 30 fps. `seed` changes the fold pattern and+waves of the resting sheet.++`clothColor` and `undersideColor` are parsed as hex (`#RGB` or `#RRGGBB`)+to light the cloth per vertex, so CSS names, `rgb()` and gradients are not+supported.++## Timing++At 30 fps, `speed={1}` and the default `delay` of 6:++| Frames | Motion |+| --- | --- |+| 0–6 | The sheet rests over the content |+| 6–15 | The corner lifts as the pull starts |+| 15–28 | The yank speeds up; the sheet peels back, folds and flutters |+| 28–34 | The trailing edge clears the frame |+| 34+ | The content holds, uncovered |++The cloth is simulated for 72 frames at 30 fps, which covers any `delay` up to+about 38. `speed` scales the timeline after the simulation, so it does not+change how the cloth moves.++This is one of the heavier components in the registry. The simulation, a+40×24 grid with 12 constraint passes per step, runs once per composition size,+`direction`, `delay` and `seed`. Each frame then draws about 900 shaded SVG+quads through two blur filters. Expect slower renders than a CSS-only reveal,+and use it once as the payoff rather than on every scene.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Content hidden under the sheet, centered in the frame. Without it a placeholder lockup (a rounded mark and the word remocn) is shown" },+ { name: "clothColor", type: "string", default: '"#E5322D"', description: "Top side of the cloth, as #RGB or #RRGGBB" },+ { name: "undersideColor", type: "string", default: '"#8E1A16"', description: "Underside tint seen where the sheet folds over, as #RGB or #RRGGBB" },+ { name: "background", type: "string", default: '"#111111"', description: "Background behind the children" },+ { name: "direction", type: '"right" | "left" | "up" | "down"', default: '"right"', description: "Which way the sheet is yanked" },+ { name: "delay", type: "number", default: "6", description: "Frame at 30 fps when the tug starts" },+ { name: "seed", type: "number", default: "2", description: "Seeds the folds and waves of the resting sheet" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/dolly-zoom.mdx b/content/docs/camera/dolly-zoom.mdxnew file mode 100644index 00000000..9e4f0faf--- /dev/null+++ b/content/docs/camera/dolly-zoom.mdx@@ -0,0 +1,84 @@+---+title: Dolly Zoom+description: The vertigo shot, a corridor with a red door stretches deeper while the subject in the middle keeps its exact size+component: dolly-zoom+vibe: premium+length: 36+useWhen:+ - "A realization or a turning point in the story needs one unsettling, cinematic beat."+ - "A logo, product or figure should stay perfectly still while the space around it warps."+ - "A dark, dramatic tone fits, such as a problem statement before the reveal."+avoidWhen:+ - "You need to move from one scene to the next, not a held shot — use `push-through`."+ - "The move should feel calm and simply show depth — use `parallax-depth`."+ - "The subject is a UI screen the camera should move across — use `stage`."+---++<ComponentPreview name="dolly-zoom" />++<InstallBlock name="dolly-zoom" />++## Usage++`DollyZoom` renders a perspective corridor with a red door at the far end and+a standing figure in the middle. Over the move the camera dollies toward the+figure while the focal length shortens at exactly the same rate, so the figure+never changes size while the corridor stretches away behind it, the way the+shot works in film. Floor tiles, ceiling lights and frame lines fade with+distance, and a vignette darkens the corners.++```tsx+import { DollyZoom } from "@/components/remocn/dolly-zoom";++export const Vertigo = () => <DollyZoom />;+```++`intensity` sets how far the camera travels, from 0 (no move) to 2. At 1 the+camera ends at about 37% of its starting distance. `reverse` plays the same+move backward: the corridor starts stretched and compresses toward the+subject.++### Your own subject++Children replace the figure. They are centered in the frame and are not+scaled, which is what keeps them steady.++```tsx+import { Img, staticFile } from "remotion";+import { DollyZoom } from "@/components/remocn/dolly-zoom";++export const LogoVertigo = () => (+ <DollyZoom intensity={1.4} doorColor="#3D7BFF">+ <Img src={staticFile("logo.svg")} style={{ height: 160 }} />+ </DollyZoom>+);+```++The built-in figure stands on the floor. Children sit at the frame center+instead, so a tall subject may overlap the floor line; that is usually fine+for a logo or a word.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–4 | The shot holds on the starting framing |+| 4–36 | The camera dollies in while zooming out on one eased curve, fastest around frame 16 |+| 36+ | The shot holds on the stretched corridor |++`speed` scales the move, so `speed={2}` ends at frame 18.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Subject held at a constant size in the frame center. Defaults to a standing figure" },+ { name: "intensity", type: "number", default: "1", description: "How far the camera dollies in, 0 to 2" },+ { name: "reverse", type: "boolean", default: "false", description: "Plays the move backward so the corridor compresses toward the subject" },+ { name: "colors", type: "Partial<DollyZoomColors>", default: '{ background: "#0B0B0B", wall: "#1B1B1B", wallAlt: "#151515", floor: "#262626", floorAlt: "#1D1D1D", line: "#FFFFFF", light: "#FFFFFF", door: "#E5322D", figure: "#FFFFFF" }', description: "Corridor, line, ceiling light, door and figure colors; merged over the defaults. The flat color props below win over it" },+ { name: "doorColor", type: "string", default: '"#E5322D"', description: "Door color; overrides colors.door" },+ { name: "figureColor", type: "string", default: '"#FFFFFF"', description: "Default figure color; overrides colors.figure" },+ { name: "lineColor", type: "string", default: '"#FFFFFF"', description: "Corridor edge lines; overrides colors.line" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/exploded-view.mdx b/content/docs/camera/exploded-view.mdxnew file mode 100644index 00000000..ce1a1609--- /dev/null+++ b/content/docs/camera/exploded-view.mdx@@ -0,0 +1,75 @@+---+title: Exploded View+description: An isometric stack of slabs springs apart with leader lines and labels, holds, then clicks back together+component: exploded-view+vibe: tech+length: 50+useWhen:+ - "An architecture or a product stack should be explained layer by layer, such as interface, engine, storage and hardware."+ - "One layer of a system is the point of the story and should be called out in brand color."+ - "A technical explainer needs a clean diagram beat that comes apart and snaps back into one product."+avoidWhen:+ - "The object should turn to show its front and back rather than come apart — use `turntable`."+ - "The scene should grow a whole city of towers from a grid — use `isometric-build`."+ - "The layers are numbers to compare rather than parts of one thing — use `animated-bar-chart`."+---++<ComponentPreview name="exploded-view" />++<InstallBlock name="exploded-view" />++## Usage++`ExplodedView` draws a stack of square slabs in isometric projection, left of+center. The slabs spring apart from the top down, each one leaving a beat+after the one above it. A leader line then draws out from each slab to the+right, and a numbered label slides in at its end. After a short hold the+labels retract, the slabs spring shut, and the stack gives a small downward+knock as it clicks together.++```tsx+import { ExplodedView } from "@/components/remocn/exploded-view";++export const Stack = () => (+ <ExplodedView+ layers={3}+ labels={["Edge", "Runtime", "Database"]}+ highlight={2}+ />+);+```++`layers` is clamped to 2–6. `labels` are listed top slab first and numbered+`01`, `02` and so on; a slab with no label gets no leader line. `highlight`+picks the slab painted in the highlight colors, counted from the top starting+at 0; an index past the last slab highlights nothing. The labels use Inter+with a system fallback.++## Timing++At 30 fps and `speed={1}`, with 4 slabs:++| Frames | Motion |+| --- | --- |+| 3–20 | Slabs spring apart from the top down, 1.5 frames apart, overshoot and settle |+| 14–32 | Leader lines draw out, 2.5 frames apart per slab |+| 19–35 | Labels slide in and fade up at the end of each line |+| 33–38 | Lines and labels retract |+| 38–46 | The slabs spring shut |+| 43–50 | The stack knocks down and settles |++All labels are on screen together for only a few frames before they retract+at frame 33. If they need longer, slow the whole piece with `speed={0.5}`,+which doubles every time in the table.++<PropsTable title="Props"+ rows={[+ { name: "layers", type: "number", default: "4", description: "Number of slabs, rounded and clamped to 2–6" },+ { name: "labels", type: "string[]", default: '["Interface", "Engine", "Storage", "Hardware"]', description: "One label per slab, top slab first; missing entries get no leader line" },+ { name: "highlight", type: "number", default: "1", description: "Index of the highlighted slab, counted from the top starting at 0" },+ { name: "colors", type: "Partial<ExplodedViewColors>", default: '{ background: "#111111", top: "#F4F4F4", left: "#A6A6A6", right: "#747474", highlightTop: "#E5322D", highlightLeft: "#B5231F", highlightRight: "#8A1A17", line: "#FFFFFF", label: "#FFFFFF" }', description: "Background, the three visible faces of a slab and of the highlighted slab, leader lines and labels; merged over the defaults. The flat color props below win over it" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Background; overrides colors.background" },+ { name: "labelColor", type: "string", default: '"#FFFFFF"', description: "Label text; overrides colors.label" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/gravity-pile.mdx b/content/docs/camera/gravity-pile.mdxnew file mode 100644index 00000000..18fa789f--- /dev/null+++ b/content/docs/camera/gravity-pile.mdx@@ -0,0 +1,107 @@+---+title: Gravity Pile+description: Seeded circles, squares and triangles rain down, bounce off the floor and each other, and settle into a heap, with optional content of your own landing on top+component: gravity-pile+vibe: playful+length: 64+useWhen:+ - "A beat about volume should feel physical, such as a pile of tasks, tickets or features."+ - "Your own icons or logos should drop onto a heap and land last, on top."+ - "A playful transition beat or bumper needs real bounces rather than hand-keyed ones."+avoidWhen:+ - "The moment is a celebration that should shower the frame with color — use `confetti`."+ - "Icons should scatter over a cut to hide a scene change — use `icon-scatter`."+ - "Pieces should fly together into a logo instead of falling into a heap — use `puzzle-snap`."+---++<ComponentPreview name="gravity-pile" />++<InstallBlock name="gravity-pile" />++## Usage++`GravityPile` runs a small rigid-body simulation. Bodies spawn in a tall+column above the frame, fall under gravity, bounce off a floor at 90% of the+frame height and off each other, and stack with contact friction so the heap+holds its shape instead of flowing apart. One body is painted in the accent+color. Late in the fall the simulation bleeds off energy so the heap comes+fully to rest, then it sleeps and nothing creeps.++```tsx+import { GravityPile } from "@/components/remocn/gravity-pile";++export const Backlog = () => (+ <GravityPile count={40} seed={12} accentColor="#3D7BFF" />+);+```++Every body collides as a circle with a radius between 3.6% and 6.8% of the+frame height, so squares and triangles rest on each other a little loosely.+`colors.shapes` cycles through its list for the plain bodies. `seed` changes+sizes, kinds, colors and spawn positions.++### Dropping your own content++`items` turns the last bodies into your own nodes. They spawn highest, so they+land last and end up on top of the heap. Each item is centered in a square box+the size of its body's diameter, 52 to 98px at 720p, and rotates with it, so+round content fits best.++```tsx+import { Img, staticFile } from "remotion";+import { GravityPile } from "@/components/remocn/gravity-pile";++const Logo = ({ src }: { src: string }) => (+ <Img+ src={staticFile(src)}+ style={{ width: "100%", height: "100%", borderRadius: "50%" }}+ />+);++export const Integrations = () => (+ <GravityPile+ count={30}+ items={[+ <Logo key="a" src="slack.png" />,+ <Logo key="b" src="github.png" />,+ <Logo key="c" src="linear.png" />,+ ]}+ />+);+```++`count` includes the items, and at most `count` items are used.++## Timing++At 30 fps, `speed={1}` and `gravity={1}`:++| Frames | Motion |+| --- | --- |+| 0–20 | The first bodies fall into frame and hit the floor |+| 20–46 | The rest of the column lands, bounces and stacks |+| 46–64 | The heap loses its remaining energy and comes to rest |+| 64+ | The heap sleeps and holds still |++Weaker gravity slows the rain, so the heap settles later: the settle phase+starts at `46 / √gravity`, about frame 65 at `gravity={0.5}`. The simulation+records 150 frames, after which the last frame holds.++The simulation is precomputed once per `count`, `seed`, `gravity`, number of+items and composition size, and every frame reads it back. Contacts are+checked between every pair of bodies, so the cost grows with the square of+`count`; a few dozen bodies is instant, but a few hundred will stall the first+render.++<PropsTable title="Props"+ rows={[+ { name: "count", type: "number", default: "30", description: "Number of falling bodies, including items" },+ { name: "seed", type: "number", default: "7", description: "Seeds body sizes, kinds, colors and spawn positions" },+ { name: "gravity", type: "number", default: "1", description: "Gravity multiplier; lower values fall slower and settle later" },+ { name: "items", type: "ReactNode[]", description: "Nodes dropped as round bodies; they spawn last and land on top of the heap" },+ { name: "colors", type: "Partial<GravityPileColors>", default: '{ background: "#111111", shapes: ["#FFFFFF", "#C9C9C9", "#7A7A7A"], accent: "#E5322D", floor: "#FFFFFF" }', description: "Background, the palette cycled across shapes, the one accent body and the floor line; merged over the defaults. The flat color props below win over it" },+ { name: "accentColor", type: "string", default: '"#E5322D"', description: "The one accent body; overrides colors.accent" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Background; overrides colors.background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/impact-shake.mdx b/content/docs/camera/impact-shake.mdxnew file mode 100644index 00000000..a80fcfc5--- /dev/null+++ b/content/docs/camera/impact-shake.mdx@@ -0,0 +1,89 @@+---+title: Impact Shake+description: Heavy content slams down from above with a squash, a damped camera jolt, a two-frame RGB split and dust puffs kicking out sideways+component: impact-shake+vibe: social+length: 30+useWhen:+ - "A launch word, a price or a logo should land like it weighs a ton."+ - "A hype edit or a social teaser needs one hard-hitting beat on the drop."+ - "A single word should own the frame, with the whole camera reacting to its arrival."+avoidWhen:+ - "The landing only needs a light accent around a small element — use `trim-burst`."+ - "The element should fly in sideways with motion streaks — use `speed-lines`."+ - "The jolt should hide a cut between two scenes — use `lens-zoom`."+---++<ComponentPreview name="impact-shake" />++<InstallBlock name="impact-shake" />++## Usage++`ImpactShake` drops its subject from above the frame on pure acceleration,+stretching it taller as it falls. On the impact frame the subject squashes+wide and springs back, the whole camera jolts and settles on a damped shake,+red and blue copies split apart for two frames, the frame flashes faintly, and+dust puffs and small chips kick out sideways along the floor line. With no+children it drops the word in `text`.++```tsx+import { ImpactShake } from "@/components/remocn/impact-shake";++export const Drop = () => <ImpactShake text="NOW LIVE" intensity={1.2} />;+```++`intensity` scales the shake, the split, the flash and the dust spread, from+0 to 2; the squash stops growing above 1. `impact` is the frame, at 30 fps,+when the subject hits, so a larger value makes a longer fall. `seed` changes+the shake phase and the dust pattern.++### Your own subject++Children replace the word. They are centered in the frame, and the dust+kicks out from a floor line at 62% of the frame height, which lines up with+the bottom of the default word. Size the subject so its base sits near that+line.++```tsx+import { Img, staticFile } from "remotion";+import { ImpactShake } from "@/components/remocn/impact-shake";++export const LogoDrop = () => (+ <ImpactShake backgroundColor="#0B0B0B">+ <Img src={staticFile("logo.svg")} style={{ height: 180 }} />+ </ImpactShake>+);+```++During the two split frames the subject renders three times, the two extra+copies tinted through an SVG color filter. `colors.splitA` and+`colors.splitB` must be `#RRGGBB` hex. The flash uses the foreground color.++## Timing++At 30 fps, `speed={1}` and the default `impact` of 7:++| Frames | Motion |+| --- | --- |+| 0–7 | The subject falls in from above, accelerating and stretching |+| 7 | Impact: squash, camera jolt, flash and dust burst |+| 7–9 | Red and blue copies split apart and close |+| 7–20 | The camera shake decays to nothing |+| 7–30 | Dust hangs and fades, and the squash wobble settles |++`speed` scales the timeline, so `speed={2}` lands at about frame 4.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "The heavy subject. Defaults to a big word set from text" },+ { name: "text", type: "string", default: '"LAUNCH"', description: "Word used when no children are passed" },+ { name: "intensity", type: "number", default: "1", description: "Shake, split, flash and dust strength, 0 to 2" },+ { name: "impact", type: "number", default: "7", description: "Frame at 30 fps when the subject hits" },+ { name: "colors", type: "Partial<ImpactShakeColors>", default: '{ background: "#111111", foreground: "#FFFFFF", splitA: "#FF2A2A", splitB: "#2A6BFF", dust: "#D9D9D9" }', description: "Background, default word and flash, the two RGB split tints (#RRGGBB) and dust; merged over the defaults. The flat color props below win over it" },+ { name: "foregroundColor", type: "string", default: '"#FFFFFF"', description: "Default word and flash; overrides colors.foreground" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Background; overrides colors.background" },+ { name: "seed", type: "number", default: "1", description: "Seeds the shake phase and the dust pattern" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/index.mdx b/content/docs/camera/index.mdxnew file mode 100644index 00000000..26b4b9e9--- /dev/null+++ b/content/docs/camera/index.mdx@@ -0,0 +1,68 @@+---+title: Camera & Physics+description: Full-frame shots built on a simulated camera or a small physics engine, from parallax trucks and a dolly zoom to falling bodies and a cloth yank+---++Each piece here owns the whole frame. The camera shots project a small 3D scene through a pinhole camera, and the physics pieces run a deterministic simulation once and play it back, so seeking and rendering always land on the same frame. Most ship with a built-in subject and accept your own content as children or layers.++## Camera++<ComponentCardGrid+ items={[+ {+ name: "Parallax Depth",+ description: "A layered landscape trucks sideways with a gentle push-in, near layers sliding faster than far ones",+ status: "stable",+ href: "/docs/camera/parallax-depth",+ },+ {+ name: "Dolly Zoom",+ description: "The vertigo shot: a corridor stretches while the subject in the middle keeps its exact size",+ status: "stable",+ href: "/docs/camera/dolly-zoom",+ },+ {+ name: "Turntable",+ description: "A product card with real thickness spins through front, edge and back with face shading and a floor shadow",+ status: "stable",+ href: "/docs/camera/turntable",+ },+ {+ name: "Tiny Planet",+ description: "A flat skyline bends into a tiny planet, then keeps turning beside the sun",+ status: "stable",+ href: "/docs/camera/tiny-planet",+ },+ {+ name: "Exploded View",+ description: "An isometric stack of slabs springs apart with leader lines and labels, then clicks back together",+ status: "stable",+ href: "/docs/camera/exploded-view",+ },+ ]}+/>++## Physics++<ComponentCardGrid+ items={[+ {+ name: "Gravity Pile",+ description: "Seeded shapes rain down, bounce off the floor and each other, and settle into a heap",+ status: "stable",+ href: "/docs/camera/gravity-pile",+ },+ {+ name: "Cloth Reveal",+ description: "A simulated satin sheet is yanked off your content from one corner, folding and fluttering out of frame",+ status: "stable",+ href: "/docs/camera/cloth-reveal",+ },+ {+ name: "Impact Shake",+ description: "Heavy content slams down with a squash, a damped camera jolt, a two-frame RGB split and a dust kick",+ status: "stable",+ href: "/docs/camera/impact-shake",+ },+ ]}+/>diff --git a/content/docs/camera/meta.json b/content/docs/camera/meta.jsonnew file mode 100644index 00000000..affe2d41--- /dev/null+++ b/content/docs/camera/meta.json@@ -0,0 +1,16 @@+{+ "title": "Camera & Physics",+ "defaultOpen": true,+ "pages": [+ "index",+ "parallax-depth",+ "dolly-zoom",+ "turntable",+ "tiny-planet",+ "exploded-view",+ "gravity-pile",+ "cloth-reveal",+ "impact-shake"+ ],+ "icon": "Video01Icon"+}diff --git a/content/docs/camera/parallax-depth.mdx b/content/docs/camera/parallax-depth.mdxnew file mode 100644index 00000000..f58a81ef--- /dev/null+++ b/content/docs/camera/parallax-depth.mdx@@ -0,0 +1,136 @@+---+title: Parallax Depth+description: A layered landscape trucks sideways with a gentle push-in, near layers sliding faster than far ones, through a pinhole camera you can fill with your own layers+component: parallax-depth+vibe: premium+length: 60+useWhen:+ - "An opener or a quiet beat needs a cinematic establishing shot, a slow sideways camera move across a sun and hills."+ - "You have a few flat layers, such as a backdrop, a product shot and a headline, and want them to read as one scene with real depth."+ - "A title or tagline needs a calm moving bed behind it for about two seconds."+avoidWhen:+ - "The subject is a screenshot, recording or long page the camera should travel across — use `stage`."+ - "The subject should hold its size while the space behind it stretches — use `dolly-zoom`."+ - "You only need a slow push-in on an existing scene so no frame sits still — use `drift`."+---++<ComponentPreview name="parallax-depth" />++<InstallBlock name="parallax-depth" />++## Usage++`ParallaxDepth` is a full-frame camera shot. Every layer sits at a depth, and+a pinhole camera trucks sideways across them while it pushes in a little. Both+the sideways offset and the push-in scale fall off with `1 / depth`, so near+layers slide past quickly, far layers barely move, and the scene reads as 3D+without any 3D engine. With no props it renders a seeded landscape: a sun at+depth 9 and three hill ridges at depths 6, 2.6 and 1.2.++```tsx+import { ParallaxDepth } from "@/components/remocn/parallax-depth";++export const Opener = () => (+ <ParallaxDepth skyColor="#0B1020" sunColor="#F5B83D" />+);+```++The camera travels the whole move in 60 frames on a slow-in, slow-out curve+and is centered at the midpoint, so the scene starts offset to one side and+ends offset to the other. `distance` sets the total sideways travel at depth 1+as a fraction of the frame width, `push` the push-in in depth units, and+`direction={-1}` trucks left instead of right.++### Your own layers++Pass `layers` to replace the landscape. Each layer is a full-frame node and a+depth: 1 is nearest, larger values move less, and anything below 0.2 is+clamped. Layers are sorted far to near, so array order does not matter.+`skyColor` still paints the background behind them.++```tsx+import type { ReactNode } from "react";+import { AbsoluteFill, Img, staticFile } from "remotion";+import { ParallaxDepth } from "@/components/remocn/parallax-depth";++const Centered = ({ children }: { children: ReactNode }) => (+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center" }}>+ {children}+ </AbsoluteFill>+);++export const ProductShot = () => (+ <ParallaxDepth+ distance={0.3}+ push={0.1}+ skyColor="#0B1020"+ layers={[+ {+ depth: 6,+ content: (+ <Centered>+ <div+ style={{+ width: 520,+ height: 520,+ borderRadius: "50%",+ background: "#1D2A5A",+ }}+ />+ </Centered>+ ),+ },+ {+ depth: 2.5,+ content: (+ <Centered>+ <Img src={staticFile("phone.png")} style={{ height: 480 }} />+ </Centered>+ ),+ },+ {+ depth: 1,+ content: (+ <AbsoluteFill style={{ justifyContent: "flex-end", padding: 64 }}>+ <h1 style={{ color: "white", fontSize: 72, margin: 0 }}>+ Ship it today+ </h1>+ </AbsoluteFill>+ ),+ },+ ]}+ />+);+```++A layer at depth 1 shifts by `distance / 2` of the frame width at each end of+the move, 320px at 1280px wide with the default `distance` of 0.5. Keep+edge-to-edge content wider than the frame, or keep near layers small and+centered, so its edges never come into view.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0 | The camera sits half of `distance` to one side |+| 0–60 | The camera trucks across and pushes in on one eased curve, fastest around frame 20 |+| 60+ | The shot holds on its final framing |++`speed` scales the move, so `speed={2}` finishes in 30 frames. For another+frame rate the move still takes two seconds.++<PropsTable title="Props"+ rows={[+ { name: "layers", type: "ParallaxDepthLayer[]", description: "Custom layers, each { content: ReactNode; depth: number }. Falls back to the built-in sun and hills" },+ { name: "distance", type: "number", default: "0.5", description: "Total sideways camera travel at depth 1, as a fraction of the frame width" },+ { name: "push", type: "number", default: "0.16", description: "Push-in toward the scene over the move, in depth units" },+ { name: "direction", type: "1 | -1", default: "1", description: "1 trucks the camera right, -1 left" },+ { name: "colors", type: "Partial<ParallaxDepthColors>", default: '{ sky: "#111111", sun: "#E5322D", far: "#2C2C2C", mid: "#555555", near: "#8E8E8E" }', description: "Sky background, sun and the three hill ridges from far to near; merged over the defaults. The flat color props below win over it" },+ { name: "skyColor", type: "string", default: '"#111111"', description: "Sky background; overrides colors.sky" },+ { name: "sunColor", type: "string", default: '"#E5322D"', description: "Sun color; overrides colors.sun" },+ { name: "seed", type: "number", default: "3", description: "Seeds the hill ridge shapes" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/tiny-planet.mdx b/content/docs/camera/tiny-planet.mdxnew file mode 100644index 00000000..f6f6f0e0--- /dev/null+++ b/content/docs/camera/tiny-planet.mdx@@ -0,0 +1,70 @@+---+title: Tiny Planet+description: A seeded flat skyline bends into a tiny planet through a polar remap, then keeps turning beside a red sun+component: tiny-planet+vibe: playful+length: 40+useWhen:+ - "A story about a city, a community or a global product needs a playful world-building beat."+ - "An opener should turn an ordinary flat scene into something surprising in about a second."+ - "A title needs a slowly turning backdrop that can hold for as long as the beat lasts."+avoidWhen:+ - "The city should rise out of a grid tile by tile instead of bending — use `isometric-build`."+ - "You want a calm cinematic landscape with depth, not a stylized planet — use `parallax-depth`."+ - "The background should be abstract and stay out of the way of the copy — use `shader-mesh-gradient`."+---++<ComponentPreview name="tiny-planet" />++<InstallBlock name="tiny-planet" />++## Usage++`TinyPlanet` draws a seeded two-row skyline with lit windows and spires on a+flat horizon, then bends it into a circle like the tiny planet effect in+360° photography. The strip is exactly as long as the planet's circumference,+so it closes without a seam. While it bends the planet shrinks to fit the+frame and the sun drifts up and to the right. Once closed, the planet turns at+a steady rate for as long as the sequence lasts.++```tsx+import { TinyPlanet } from "@/components/remocn/tiny-planet";++export const Hometown = () => (+ <TinyPlanet buildings={32} seed={9} sunColor="#F5B83D" />+);+```++`buildings` is the front row count (minimum 4); the back row gets 80% of+that. `seed` changes widths, heights, spires and windows. `spin` is the final+turning rate in degrees per frame at 30 fps, and `spin={0}` leaves the planet+still once it closes.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–8 | The flat skyline holds |+| 8–40 | The skyline bends into a planet on an ease-in-out, fastest around frame 24 |+| 26–40 | The spin eases in while the strip closes |+| 40+ | The planet turns at `spin` degrees per frame for as long as the sequence lasts |++`length` covers the bend. Give the sequence a few extra seconds if you want+the turning planet to hold behind a title. `speed` scales the whole timeline,+including the spin rate.++<PropsTable title="Props"+ rows={[+ { name: "buildings", type: "number", default: "26", description: "Buildings in the front row, minimum 4; the back row gets 80% as many" },+ { name: "seed", type: "number", default: "4", description: "Seeds building widths, heights, spires and windows" },+ { name: "spin", type: "number", default: "0.7", description: "Planet spin once bent, in degrees per frame at 30 fps" },+ { name: "colors", type: "Partial<TinyPlanetColors>", default: '{ sky: "#111111", ground: "#262626", near: "#FFFFFF", far: "#6B6B6B", window: "#111111", sun: "#E5322D" }', description: "Sky background, ground, front and back building rows, windows and sun; merged over the defaults. The flat color props below win over it" },+ { name: "skyColor", type: "string", default: '"#111111"', description: "Sky background; overrides colors.sky" },+ { name: "sunColor", type: "string", default: '"#E5322D"', description: "Sun color; overrides colors.sun" },+ { name: "buildingColor", type: "string", default: '"#FFFFFF"', description: "Front building row; overrides colors.near" },+ { name: "groundColor", type: "string", default: '"#262626"', description: "Ground color; overrides colors.ground" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/camera/turntable.mdx b/content/docs/camera/turntable.mdxnew file mode 100644index 00000000..deb19dbd--- /dev/null+++ b/content/docs/camera/turntable.mdx@@ -0,0 +1,102 @@+---+title: Turntable+description: A product card with real thickness spins on an invisible turntable through front, edge and back, with face shading, a moving sheen and a floor shadow+component: turntable+vibe: premium+length: 64+useWhen:+ - "A physical-looking object, such as a credit card, a membership pass or a ticket, should be shown from every side."+ - "A product launch needs a hero beat where the object turns once and settles facing the camera."+ - "Front and back carry different content and both should be seen in one move."+avoidWhen:+ - "The content is a long page or recording the camera should travel across — use `stage`."+ - "A flat word should pop out of the plane into 3D — use `extrude-pop`."+ - "The object should come apart into labelled layers — use `exploded-view`."+---++<ComponentPreview name="turntable" />++<InstallBlock name="turntable" />++## Usage++`Turntable` builds a card in CSS 3D: a front face, a back face and four edge+slabs, sized like a credit card at 46% of the frame height. It spins around+its vertical axis on a slow-in, slow-out curve. Each face is shaded from a key+light at the front left, a sheen slides across as it turns, and a soft floor+shadow narrows and fades when the card is edge-on. With no children it shows a+red front with a mark and a light back.++```tsx+import { Turntable } from "@/components/remocn/turntable";++export const CardSpin = () => <Turntable />;+```++`turns` sets full rotations, so `turns={0.5}` ends on the back face and+`turns={2}` spins twice in the same time. `tilt` looks down on the card in+degrees; negative values look up at it. `thickness` is the card depth in px+at 720p.++### Your own faces++`children` is the front face and `back` is the back face. Each face clips its+content to the rounded card, so fill it edge to edge. The face font size is+1/30 of the card height, so content sized in `em` scales with the+composition.++```tsx+import { AbsoluteFill } from "remotion";+import { Turntable } from "@/components/remocn/turntable";++export const PassSpin = () => (+ <Turntable+ turns={1}+ edgeColor="#2E2A8C"+ back={<AbsoluteFill style={{ background: "#F5F5F5" }} />}+ >+ <AbsoluteFill+ style={{+ background: "linear-gradient(135deg, #4F46E5, #7C3AED)",+ padding: "2.5em",+ color: "white",+ fontSize: "1.6em",+ fontWeight: 700,+ }}+ >+ Pro Pass+ </AbsoluteFill>+ </Turntable>+);+```++Set `edgeColor` to a darker shade of your front so the card edge reads as+the same material.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–6 | The card rests facing the camera |+| 6–64 | The card spins `turns` times on one eased curve, fastest around frame 29 |+| 64+ | The card holds, facing front for whole turns or back for half turns |++`speed` scales the spin, so `speed={2}` ends at frame 32.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Front face content. Defaults to a red card with a mark" },+ { name: "back", type: "ReactNode", description: "Back face content. Defaults to a light card with a stripe" },+ { name: "thickness", type: "number", default: "22", description: "Card thickness in px at 720p" },+ { name: "turns", type: "number", default: "1", description: "Full rotations over the spin" },+ { name: "tilt", type: "number", default: "8", description: "Camera tilt in degrees; positive looks down on the card" },+ { name: "colors", type: "Partial<TurntableColors>", default: '{ background: "#111111", front: "#E5322D", back: "#F2F2F2", edge: "#A3201C", mark: "#FFFFFF", shadow: "#000000" }', description: "Background, default face colors, edge slabs, default mark and floor shadow; merged over the defaults. The flat color props below win over it" },+ { name: "frontColor", type: "string", default: '"#E5322D"', description: "Default front face color; overrides colors.front" },+ { name: "edgeColor", type: "string", default: '"#A3201C"', description: "Card edge color; overrides colors.edge" },+ { name: "backColor", type: "string", default: '"#F2F2F2"', description: "Default back face color; overrides colors.back" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Stage background; overrides colors.background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/components.mdx b/content/docs/components.mdxindex ad9ccf78..f6f04c78 100644--- a/content/docs/components.mdx+++ b/content/docs/components.mdx@@ -513,6 +513,51 @@ Scene transitions, camera moves, and stylized wipes.]}/>+### Graphic Cuts++Bold, showy cuts built from plain CSS and SVG: shapes, slats, torn paper, streaks and light. No dependencies beyond Remotion.++<ComponentCardGrid+ items={[+ {+ name: "IrisWipe",+ description: "Close a cartoon iris on the subject, hold it as a dot, then open it on the next scene",+ status: "stable",+ href: "/docs/transitions/iris-wipe",+ },+ {+ name: "VenetianBlinds",+ description: "Turn the outgoing scene edge-on in staggered horizontal slats to reveal the next one",+ status: "stable",+ href: "/docs/transitions/venetian-blinds",+ },+ {+ name: "PaperTear",+ description: "Rip the frame down the middle and fling both torn halves apart on impact",+ status: "stable",+ href: "/docs/transitions/paper-tear",+ },+ {+ name: "PixelSort",+ description: "Melt the scene into glowing vertical streaks and drop the next one in column by column",+ status: "stable",+ href: "/docs/transitions/pixel-sort",+ },+ {+ name: "LightLeak",+ description: "Drift a warm analog light leak across the frame and hard-cut under its blow-out",+ status: "stable",+ href: "/docs/transitions/light-leak",+ },+ {+ name: "Hyperspace",+ description: "Stretch a starfield into streaks, tunnel forward and land on the next scene through a flash",+ status: "stable",+ href: "/docs/transitions/hyperspace",+ },+ ]}+/>+### Scene SequencersSequencers rather than presentations — they own the whole run of scenes and the boundary between them.@@ -573,6 +618,243 @@ Physical overlays and hand-made motion.]}/>+## Logo Stings++Short brand reveals that land your logo at the open or close of a video.++<ComponentCardGrid+ items={[+ {+ name: "Orbit Lock",+ description: "Moons ride tilted, shrinking orbits into a core that bursts into a ring flash, and the logo springs into place",+ status: "stable",+ href: "/docs/logo-stings/orbit-lock",+ },+ {+ name: "Puzzle Snap",+ description: "Geometric pieces spin in from scattered positions and snap into a mark with sparks, then the wordmark slides out beside it",+ status: "stable",+ href: "/docs/logo-stings/puzzle-snap",+ },+ {+ name: "Spotlight",+ description: "A soft stage spotlight searches the dark, overshoots, lands on the logo, and the house lights come up",+ status: "stable",+ href: "/docs/logo-stings/spotlight",+ },+ {+ name: "Neon Sign",+ description: "A glass neon tube stutters alive segment by segment, buzzes off once, then holds lit with a glow on the wall",+ status: "stable",+ href: "/docs/logo-stings/neon-sign",+ },+ {+ name: "Inflate",+ description: "A flat sliver puffs up like a balloon toy, squashes and settles into a glossy mark, then the wordmark slides out",+ status: "stable",+ href: "/docs/logo-stings/inflate",+ },+ {+ name: "Liquid Fill",+ description: "A drop falls into an outlined mark and liquid rises with a sloshing surface and bubbles until the mark is solid",+ status: "stable",+ href: "/docs/logo-stings/liquid-fill",+ },+ {+ name: "Accordion Unfold",+ description: "A tight paper zigzag unfolds sideways into a flat card with the logo printed across it",+ status: "stable",+ href: "/docs/logo-stings/accordion-unfold",+ },+ {+ name: "Anamorphic Flare",+ description: "A point of light stretches into a cinematic horizontal streak that sweeps the frame and reveals the logo behind it",+ status: "stable",+ href: "/docs/logo-stings/anamorphic-flare",+ },+ ]}+/>++## Camera & Physics++Camera moves and simulated physics that give a scene depth and weight.++### Camera++<ComponentCardGrid+ items={[+ {+ name: "Parallax Depth",+ description: "A layered landscape trucks sideways with a gentle push-in, near layers sliding faster than far ones",+ status: "stable",+ href: "/docs/camera/parallax-depth",+ },+ {+ name: "Dolly Zoom",+ description: "The vertigo shot: a corridor stretches while the subject in the middle keeps its exact size",+ status: "stable",+ href: "/docs/camera/dolly-zoom",+ },+ {+ name: "Turntable",+ description: "A product card with real thickness spins through front, edge and back with face shading and a floor shadow",+ status: "stable",+ href: "/docs/camera/turntable",+ },+ {+ name: "Tiny Planet",+ description: "A flat skyline bends into a tiny planet, then keeps turning beside the sun",+ status: "stable",+ href: "/docs/camera/tiny-planet",+ },+ {+ name: "Exploded View",+ description: "An isometric stack of slabs springs apart with leader lines and labels, then clicks back together",+ status: "stable",+ href: "/docs/camera/exploded-view",+ },+ ]}+/>++### Physics++<ComponentCardGrid+ items={[+ {+ name: "Gravity Pile",+ description: "Seeded shapes rain down, bounce off the floor and each other, and settle into a heap",+ status: "stable",+ href: "/docs/camera/gravity-pile",+ },+ {+ name: "Cloth Reveal",+ description: "A simulated satin sheet is yanked off your content from one corner, folding and fluttering out of frame",+ status: "stable",+ href: "/docs/camera/cloth-reveal",+ },+ {+ name: "Impact Shake",+ description: "Heavy content slams down with a squash, a damped camera jolt, a two-frame RGB split and a dust kick",+ status: "stable",+ href: "/docs/camera/impact-shake",+ },+ ]}+/>++## Graphic Looks++Stylized treatments that restyle a subject as print, film, or a technical drawing.++<ComponentCardGrid+ items={[+ {+ name: "Riso Print",+ description: "Two ink plates print the subject; the accent plate slides in off-register, wobbles and settles a hair out of alignment over grainy paper",+ status: "stable",+ href: "/docs/graphic-looks/riso-print",+ },+ {+ name: "Line Boil",+ description: "A hand-drawn outline draws itself, boils on threes like a cel animation, and fills with color while it keeps boiling",+ status: "stable",+ href: "/docs/graphic-looks/line-boil",+ },+ {+ name: "Blueprint",+ description: "A product wipes into a technical drawing with a grid, white linework, dimension lines and a red callout",+ status: "stable",+ href: "/docs/graphic-looks/blueprint",+ },+ {+ name: "Duotone Beat",+ description: "A halftone portrait in two inks that swaps its ink pair on every beat and punches in on the downbeat",+ status: "stable",+ href: "/docs/graphic-looks/duotone-beat",+ },+ {+ name: "Comic Panels",+ description: "The frame cracks into a three-panel comic page, then the action panel bursts into a full-frame POW",+ status: "stable",+ href: "/docs/graphic-looks/comic-panels",+ },+ {+ name: "Long Shadow",+ description: "A flat icon pops in and casts a long shadow to the frame edge, then the light swings and the shadow sweeps around",+ status: "stable",+ href: "/docs/graphic-looks/long-shadow",+ },+ {+ name: "Synthwave",+ description: "A retro neon horizon with a scrolling perspective grid, a rising striped sun and mountain ranges that slide in",+ status: "stable",+ href: "/docs/graphic-looks/synthwave",+ },+ {+ name: "Brick Mosaic",+ description: "Toy bricks drop in row by row from the bottom with a small bounce and build a pixel-art image on a baseplate",+ status: "stable",+ href: "/docs/graphic-looks/brick-mosaic",+ },+ {+ name: "X-Ray Scan",+ description: "A glowing bar sweeps across a device and reveals its white-line internals, with one part marked in red",+ status: "stable",+ href: "/docs/graphic-looks/x-ray-scan",+ },+ ]}+/>++## Generative Loops++Seeded, deterministic pattern beds for backgrounds and section breaks.++<ComponentCardGrid+ items={[+ {+ name: "Pendulum Wave",+ description: "A row of pendulums with tuned periods drifts from a line into waves and braids, then realigns as a seamless loop",+ status: "stable",+ href: "/docs/motion-graphics/pendulum-wave",+ },+ {+ name: "Flow Field",+ description: "Hundreds of particles ride a seeded vector field and leave fine fading trails, as a seamless loop",+ status: "stable",+ href: "/docs/motion-graphics/flow-field",+ },+ {+ name: "Isometric Build",+ description: "An isometric grid springs up row by row into a stepped block sculpture with one accent tower",+ status: "stable",+ href: "/docs/motion-graphics/isometric-build",+ },+ {+ name: "Life Grid",+ description: "Conway's Game of Life on a seeded grid, newborn cells flashing in the accent",+ status: "stable",+ href: "/docs/motion-graphics/life-grid",+ },+ {+ name: "String Art",+ description: "Threads string a ring of pins as a times table, then morph from a cardioid through a nephroid and beyond",+ status: "stable",+ href: "/docs/motion-graphics/string-art",+ },+ {+ name: "Topo Lines",+ description: "Contour lines around seeded peaks breathe and drift, one line picked out in the accent, as a seamless loop",+ status: "stable",+ href: "/docs/motion-graphics/topo-lines",+ },+ {+ name: "Phyllotaxis",+ description: "Seeds spiral out at the golden angle into a sunflower head, then a Fibonacci arm pulses outward",+ status: "stable",+ href: "/docs/motion-graphics/phyllotaxis",+ },+ ]}+/>+## CompositionsFull scenes built by composing primitives and UI blocks.diff --git a/content/docs/graphic-looks/blueprint.mdx b/content/docs/graphic-looks/blueprint.mdxnew file mode 100644index 00000000..f58bd69b--- /dev/null+++ b/content/docs/graphic-looks/blueprint.mdx@@ -0,0 +1,98 @@+---+title: Blueprint+description: A product wipes left to right into a technical drawing with a blueprint grid, white linework, dimension lines and a red callout+component: blueprint+vibe: tech+length: 45+useWhen:+ - "A hardware or product launch should show the object as an engineering drawing: measured, labelled and precise."+ - "One feature of the product deserves a callout, like a sensor, a port or a button."+ - "The scene should switch from a glossy product shot to a technical one in a single readable move."+avoidWhen:+ - "The product should come apart into labelled layers instead of being measured — use `exploded-view`."+ - "The reveal should show what is inside the device rather than its outline — use `x-ray-scan`."+ - "The subject is a word whose outlines should draw themselves — use `outline-trace`."+---++<ComponentPreview name="blueprint" />++<InstallBlock name="blueprint" />++## Usage++`Blueprint` is a full-frame scene. It opens on the product over a plain ground.+A glowing scan edge wipes left to right and leaves a technical drawing behind+it: a blue sheet with a minor and major grid, the product traced in white+lines, dashed center lines, extension and dimension lines with architectural+ticks, size labels, a title block, and a red callout ring with a lettered+bubble.++```tsx+import { Blueprint } from "@/components/remocn/blueprint";++export const Spec = () => <Blueprint />;+```++Without children it draws a red phone-shaped device with a sensor dot. Pass+your product as children to convert it instead. The children are centered at+47% across and 46% down the frame. Behind the wipe, an SVG filter turns them+into linework: their silhouette edge plus the edges of their dark details.++```tsx+import { Img, staticFile } from "remotion";+import { Blueprint } from "@/components/remocn/blueprint";++export const Speaker = () => (+ <Blueprint+ box={[0.22, 0.56]}+ calloutAt={[0.5, 0.2]}+ labels={{+ width: "98 mm",+ height: "203 mm",+ callout: "TWEETER",+ title: "DWG S-02 SCALE 1:2",+ }}+ >+ <Img src={staticFile("speaker.png")} style={{ height: 400 }} />+ </Blueprint>+);+```++The dimension lines measure `box`, not your children. `box` is the measured+rectangle as fractions of the frame width and height, centered on the same+point as the children, so size it to match the product. `calloutAt` places the+callout ring as fractions of that box. The label and bubble go to the left of+the product when the callout text fits there, and above it otherwise.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 6–24 | The scan edge wipes left to right and lays down the blue grid |+| 8–28 | The product's linework draws in |+| 22–28 | Extension lines grow out from the box |+| 24–32 | Dimension lines grow from their centers; the ticks land at the end |+| 30–36 | Size labels and the title block fade in |+| 32–40 | The callout ring and leader line draw |+| 36–42 | The callout bubble pops with an overshoot |+| 38–44 | The callout text fades in |++`blueprintLength` is 45. After that the drawing holds still. `speed` scales the+whole timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "Product to convert; its silhouette and dark details become white linework. Without it a red device is drawn" },+ { name: "box", type: "[number, number]", default: "[0.17, 0.6]", description: "Measured box around the product as fractions of the frame [width, height]; the dimension lines measure this box" },+ { name: "calloutAt", type: "[number, number]", default: "[0.5, 0.11]", description: "Point the callout ring marks, as fractions of the box [x, y]" },+ { name: "labels", type: "{ width?: string; height?: string; callout?: string; title?: string }", default: '{ width: "71.6 mm", height: "147.5 mm", callout: "SENSOR", title: "DWG A-01 SCALE 1:1" }', description: "Dimension labels, callout text and title block; missing keys keep their defaults" },+ { name: "blueprintColor", type: "string", default: '"#173C8F"', description: "Blueprint sheet color" },+ { name: "lineColor", type: "string", default: '"#FFFFFF"', description: "Linework, grid, labels and scan edge color" },+ { name: "calloutColor", type: "string", default: '"#E5322D"', description: "Callout ring, leader and bubble color" },+ { name: "background", type: "string", default: '"#FFFFFF"', description: "Ground behind the product before the wipe" },+ { name: "productColor", type: "string", default: '"#E5322D"', description: "Color of the default device; ignored with children" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/brick-mosaic.mdx b/content/docs/graphic-looks/brick-mosaic.mdxnew file mode 100644index 00000000..630bf454--- /dev/null+++ b/content/docs/graphic-looks/brick-mosaic.mdx@@ -0,0 +1,103 @@+---+title: Brick Mosaic+description: Toy bricks drop in row by row from the bottom with a small bounce and build a pixel-art image on a baseplate+component: brick-mosaic+vibe: playful+length: 56+useWhen:+ - "A logo, icon or emoji should be built out of toy bricks, one row at a time, for a playful reveal."+ - "The image is simple enough to read as pixel art on a grid of about 10 to 40 cells across."+ - "A kids, gaming or maker-themed video needs a build moment that feels hands-on."+avoidWhen:+ - "The mark should assemble from a few geometric pieces that spin and snap into place — use `puzzle-snap`."+ - "The build should rise as an isometric 3D city rather than a flat mosaic — use `isometric-build`."+ - "The scene should melt into pixel streaks as a transition — use `pixel-sort`."+---++<ComponentPreview name="brick-mosaic" />++<InstallBlock name="brick-mosaic" />++## Usage++`BrickMosaic` is a full-frame scene. A baseplate of studs fades in, then+bricks fall onto it row by row from the bottom. Within a row they land left to+right with a little seeded scatter, and each brick hops once after it lands.+Every brick is shaded with beveled edges and a stud, so the finished image+reads as a plastic mosaic.++```tsx+import { BrickMosaic } from "@/components/remocn/brick-mosaic";++export const Build = () => <BrickMosaic />;+```++Without `pattern` it builds a red disc on white, `cols` by `rows` bricks. Pass+`pattern` to build your own image, as rows of characters looked up in+`colors`:++```tsx+import { BrickMosaic } from "@/components/remocn/brick-mosaic";++const heart = [+ "..........",+ ".##....##.",+ "####..####",+ "##########",+ "##########",+ ".########.",+ "..######..",+ "...####...",+ "....##....",+ "..........",+];++export const Heart = () => (+ <BrickMosaic+ pattern={heart}+ colors={{ "#": "#E5322D", ".": "#FFFFFF" }}+ background="#1C1A17"+ />+);+```++Characters missing from `colors`, and spaces, leave the cell empty, so the+baseplate shows through. `colors` replaces the default map entirely. A pattern+can also be a 2D array of CSS colors, with `""` for an empty cell, which is+handy when you generate it from an image. The grid is scaled to fit 86% of the+frame and centered.++## Timing++At 30 fps and `speed={1}`, each brick falls for 7 frames from about two brick+heights up, accelerating, then hops for 5 frames. Rows start `rowDelay` frames+apart from the bottom up, and bricks within a row are spread over about 1.5+frames plus 0.12 frames per column.++| Frames | Motion |+| --- | --- |+| 0–10 | The baseplate studs fade in |+| 0–16 | The bottom row lands and hops |+| 3 frames per row | Each row above starts `rowDelay` frames after the one below |+| 56 | The top row's last brick finishes its hop |++`getBrickMosaicLength(rows, cols, rowDelay)` returns the build length, 56 at+the defaults. For a custom pattern, pass the number of pattern rows and the+longest row length. Divide by `speed` for other speeds.++## Notes++Each brick is six SVG shapes on top of a baseplate stud, so a 40 by 24 grid draws close to 7,000 nodes.+That is fine for rendering, but keep grids smaller for smooth live previews.++<PropsTable title="Props"+ rows={[+ { name: "pattern", type: "string[] | string[][]", description: "Image to build: rows of characters looked up in colors, or a 2D grid of CSS colors with \"\" for empty. Overrides cols and rows" },+ { name: "cols", type: "number", default: "24", description: "Columns of the default disc image" },+ { name: "rows", type: "number", default: "14", description: "Rows of the default disc image" },+ { name: "colors", type: "Record<string, string>", default: '{ "#": "#E5322D", ".": "#FFFFFF", x: "#111111" }', description: "Character-to-color map for string patterns; replaces the default map" },+ { name: "background", type: "string", default: '"#111111"', description: "Baseplate color behind the bricks" },+ { name: "rowDelay", type: "number", default: "3", description: "Frames between rows" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/comic-panels.mdx b/content/docs/graphic-looks/comic-panels.mdxnew file mode 100644index 00000000..0dab6dab--- /dev/null+++ b/content/docs/graphic-looks/comic-panels.mdx@@ -0,0 +1,76 @@+---+title: Comic Panels+description: The frame cracks into a three-panel comic page with speed lines and halftone, then the action panel bursts into a full-frame POW+component: comic-panels+vibe: playful+length: 36+useWhen:+ - "A logo, product or headline should land with comic-book energy, framed in a hero panel with speed lines."+ - "A playful launch or social clip needs a loud sound-effect beat, like POW, ZAP or NEW, that takes over the frame."+ - "The scene should turn from a single hero shot into a page layout in one move."+avoidWhen:+ - "You only need the manga-style impact lines around an element, without the page — use `speed-lines`."+ - "The hit should be a heavy slam with a camera jolt rather than a page cracking — use `impact-shake`."+ - "The burst should be a sculptural ribbon opener rather than a printed comic page — use `radial-burst`."+---++<ComponentPreview name="comic-panels" />++<InstallBlock name="comic-panels" />++## Usage++`ComicPanels` is a full-frame scene. Your content starts centered on the page,+surrounded by ink speed lines that are redrawn every two frames. A page border+closes in, and a slanted gutter cracks across the frame and lifts the content+into the top panel. A second gutter cracks down, and two panels slide in+underneath: a halftone panel in the accent color from the left and an ink+panel with a small starburst from the right. The page shakes, and the+starburst grows until its accent rays fill the frame, leaving a paper burst+with the word in the middle.++```tsx+import { ComicPanels } from "@/components/remocn/comic-panels";++export const Launch = () => (+ <ComicPanels word="POW">+ <Logo />+ </ComicPanels>+);+```++`children` is the hero content. It is rendered at full size at first and+scales to `heroScale` as it moves into the top panel, so size it as you would+for a full frame. Without children a placeholder "remocn" lockup is shown. `word` is optional. Without it the starbursts are empty. Keep+the word short: it is set large and bold, and three or four letters read best.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–8 | The page margin and ink border close in |+| 2–10 | The horizontal gutter cracks across; the hero rises and scales to `heroScale` |+| 8–14 | The vertical gutter cracks down to the bottom edge |+| 10–18 | The halftone panel slides in from the left |+| 13–21 | The ink panel with the starburst slides in from the right |+| 22–31 | The page shakes |+| 23–34 | The starburst grows and spins until the accent fills the frame |+| 30–36 | The paper burst settles from a slight overshoot |++`comicPanelsLength` is 36. The final burst keeps a gentle 4% pulse after that,+so the hold never freezes. `speed` scales the whole timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "Hero content, centered at first and framed in the top panel once the page cracks. Without it a placeholder \"remocn\" lockup in the ink and accent colors is shown" },+ { name: "word", type: "string", description: "Sound-effect word in the starburst, for example \"POW\"" },+ { name: "ink", type: "string", default: '"#111111"', description: "Speed lines, borders, the ink panel and the word. Overrides colors.ink when set" },+ { name: "paper", type: "string", default: '"#FFFFFF"', description: "Page, gutters and the inner burst. Overrides colors.paper when set" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Halftone, outer rays and the word shadow. Overrides colors.accent when set" },+ { name: "colors", type: "{ ink?: string; paper?: string; accent?: string }", default: '{ ink: "#111111", paper: "#FFFFFF", accent: "#E5322D" }', description: "The same colors as one object; the flat props above take precedence, missing keys keep their defaults" },+ { name: "heroScale", type: "number", default: "0.62", description: "Scale of children inside the top panel" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/duotone-beat.mdx b/content/docs/graphic-looks/duotone-beat.mdxnew file mode 100644index 00000000..0ae0959f--- /dev/null+++ b/content/docs/graphic-looks/duotone-beat.mdx@@ -0,0 +1,90 @@+---+title: Duotone Beat+description: A two-ink halftone portrait that swaps its ink pair on every beat, punches in on the downbeat and shows a bar indicator+component: duotone-beat+vibe: social+length: sustained+useWhen:+ - "A speaker, artist or team portrait should hit on the beat of a track, poster-style, for a promo or social cut."+ - "The edit is cut to music at a known BPM and the visual should flash through brand color pairs in time."+ - "A photo needs a bold two-color print treatment that keeps moving instead of sitting as a still."+avoidWhen:+ - "The print look should hold steady on a live scene with full color separation — use `halftone-print`."+ - "The image should print once and settle, without a beat — use `riso-print`."+ - "The beat should drive a camera jolt on heavy content rather than a color swap — use `impact-shake`."+---++<ComponentPreview name="duotone-beat" />++<InstallBlock name="duotone-beat" />++## Usage++`DuotoneBeat` is a full-frame scene. It takes a portrait, drops it to+grayscale, optionally screens it into halftone dots, and maps the tones onto+two inks: shadows to the first ink, highlights to the second. On every beat it+switches to the next ink pair in `palettes` and punches the image in with a+small scale kick that decays over a few frames. The first beat of each bar+gets the full `punch`, the others a third of it. A row of squares in the lower+left marks the beat within the bar, next to a BPM label.++```tsx+import { staticFile } from "remotion";+import { DuotoneBeat } from "@/components/remocn/duotone-beat";++export const Speaker = () => (+ <DuotoneBeat+ src={staticFile("speaker.jpg")}+ bpm={124}+ palettes={[+ ["#0B0B45", "#FFD23F"],+ ["#0B0B45", "#FF5D8F"],+ ["#FF5D8F", "#FFFFFF"],+ ]}+ />+);+```++Without `src` it draws a head-and-shoulders silhouette that rises into frame.+With `src` the image covers the frame and settles from 112% to 100% scale over+the first 12 frames. Palette colors must be hex (`#rgb` or `#rrggbb`), since+they are parsed into a lookup table for an SVG filter.++## Timing++The beat length is `1800 / bpm` frames at 30 fps when `bpm` is set, and+`beatFrames` otherwise. The default of 15 frames is 120 BPM. Beats are counted+in real time, so `bpm` stays in sync with the music at any composition frame+rate.++| Frames | Motion |+| --- | --- |+| 0–12 | The silhouette rises into place, or the image settles from 112% scale |+| Each beat | The ink pair changes and the image punches in, decaying over about 10 frames |+| Each downbeat | The punch is three times stronger |++The look has no end: it keeps cycling for as long as the sequence runs. Start+the sequence on a downbeat of your track so the punches land on the music.+`speed` also speeds up the beat, while the BPM label keeps showing the nominal+tempo, so prefer `bpm` to sync with a track.++## Notes++`halftone` is the dot pitch in px at 720p. Larger values give coarser, more+graphic dots, and `0` keeps smooth duotone gradients. The whole frame,+including the white ground, passes through the duotone filter, so the ground+takes the highlight ink.++<PropsTable title="Props"+ rows={[+ { name: "src", type: "string", description: "Portrait image URL, covering the frame. Without it a silhouette is drawn" },+ { name: "palettes", type: "[string, string][]", default: "4 pairs of #111111, #FFFFFF and #E5322D", description: "Ink pairs [shadow, highlight], one per beat, cycled. Hex colors only" },+ { name: "beatFrames", type: "number", default: "15", description: "Frames per beat at 30 fps; ignored when bpm is set" },+ { name: "bpm", type: "number", description: "Tempo in beats per minute; overrides beatFrames" },+ { name: "beatsPerBar", type: "number", default: "4", description: "Beats per bar; the first beat of each bar gets the full punch" },+ { name: "punch", type: "number", default: "0.07", description: "Scale added on the downbeat; other beats get a third of it" },+ { name: "showIndicator", type: "boolean", default: "true", description: "Shows the beat squares and BPM label in the lower left" },+ { name: "halftone", type: "number", default: "8", description: "Halftone dot pitch in px at 720p; 0 keeps smooth tones" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier, including the beat rate" },+ ]}+/>diff --git a/content/docs/graphic-looks/index.mdx b/content/docs/graphic-looks/index.mdxnew file mode 100644index 00000000..a2fb3fe2--- /dev/null+++ b/content/docs/graphic-looks/index.mdx@@ -0,0 +1,65 @@+---+title: Graphic Looks+description: Full-frame scenes that borrow a print, drawing or screen technique, from risograph plates and blueprints to heat cameras and toy bricks+---++Each look is a complete, full-frame scene with its own ground. It plays a short entrance, then holds the finished image, or keeps it alive with a boil, a beat or a scrolling floor. Most take your own subject as children and fall back to a built-in demo subject without them.++<ComponentCardGrid+ items={[+ {+ name: "Riso Print",+ description: "Two ink plates print the subject; the accent plate slides in off-register, wobbles and settles a hair out of alignment over grainy paper",+ status: "stable",+ href: "/docs/graphic-looks/riso-print",+ },+ {+ name: "Line Boil",+ description: "A hand-drawn outline draws itself, boils on threes like a cel animation, and fills with color while it keeps boiling",+ status: "stable",+ href: "/docs/graphic-looks/line-boil",+ },+ {+ name: "Blueprint",+ description: "A product wipes into a technical drawing with a grid, white linework, dimension lines and a red callout",+ status: "stable",+ href: "/docs/graphic-looks/blueprint",+ },+ {+ name: "Duotone Beat",+ description: "A halftone portrait in two inks that swaps its ink pair on every beat and punches in on the downbeat",+ status: "stable",+ href: "/docs/graphic-looks/duotone-beat",+ },+ {+ name: "Comic Panels",+ description: "The frame cracks into a three-panel comic page, then the action panel bursts into a full-frame POW",+ status: "stable",+ href: "/docs/graphic-looks/comic-panels",+ },+ {+ name: "Long Shadow",+ description: "A flat icon pops in and casts a long shadow to the frame edge, then the light swings and the shadow sweeps around",+ status: "stable",+ href: "/docs/graphic-looks/long-shadow",+ },+ {+ name: "Synthwave",+ description: "A retro neon horizon with a scrolling perspective grid, a rising striped sun and mountain ranges that slide in",+ status: "stable",+ href: "/docs/graphic-looks/synthwave",+ },+ {+ name: "Brick Mosaic",+ description: "Toy bricks drop in row by row from the bottom with a small bounce and build a pixel-art image on a baseplate",+ status: "stable",+ href: "/docs/graphic-looks/brick-mosaic",+ },+ {+ name: "X-Ray Scan",+ description: "A glowing bar sweeps across a device and reveals its white-line internals, with one part marked in red",+ status: "stable",+ href: "/docs/graphic-looks/x-ray-scan",+ },+ ]}+/>diff --git a/content/docs/graphic-looks/line-boil.mdx b/content/docs/graphic-looks/line-boil.mdxnew file mode 100644index 00000000..3a753c0b--- /dev/null+++ b/content/docs/graphic-looks/line-boil.mdx@@ -0,0 +1,90 @@+---+title: Line Boil+description: A hand-drawn outline draws itself, boils on threes like a cel animation, and fills with color while it keeps boiling+component: line-boil+vibe: playful+length: 40+useWhen:+ - "A simple mark, icon or shape should feel hand-animated, with the restless line of traditional cel animation."+ - "A playful explainer or kids-friendly scene needs a hero shape that draws itself and then stays alive on screen."+ - "You have the shape as SVG path data and want it drawn, filled and boiling without keyframing anything."+avoidWhen:+ - "The thing being drawn is a word or a font's glyph outlines — use `outline-trace`."+ - "The line should circle or mark up an existing part of the frame rather than be the subject — use `scribble-circle`."+ - "Handwritten text should appear letter by letter — use `handwrite`."+ - "Existing content should just feel hand-placed and jittery, without being redrawn — use `paper-wobble`."+---++<ComponentPreview name="line-boil" />++<InstallBlock name="line-boil" />++## Usage++`LineBoil` is a full-frame scene. It draws a closed outline with a pen that+tapers in and out and varies its pressure along the stroke, then fills the+shape with color. The line never sits still. Like a cel animation shot "on+threes", the whole drawing is retraced every few frames with a slightly+different wobble, cycling through a small set of drawings.++```tsx+import { LineBoil } from "@/components/remocn/line-boil";++export const Star = () => <LineBoil />;+```++Pass `path` to draw your own shape. It takes SVG path data in any coordinate+space. The outline is sampled at 160 points along its length, scaled so its+longer side is `size` of the frame's short side, and centered. Use one closed+outline: separate subpaths and holes are joined into one continuous stroke.++```tsx+import { LineBoil } from "@/components/remocn/line-boil";++const heart =+ "M 50 88 C 20 66 4 48 4 30 C 4 14 16 4 30 4 C 40 4 47 10 50 18 C 53 10 60 4 70 4 C 84 4 96 14 96 30 C 96 48 80 66 50 88 Z";++export const Heart = () => (+ <LineBoil+ path={heart}+ line="#1C1A17"+ fill="#FF8FB1"+ background="#FFF6E9"+ boilEvery={2}+ />+);+```++The fill boils with its own seed and a stronger wobble than the line, so the+color slips a little past the outline the way a cel fill does.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–22 | The pen draws the outline along the path on an ease-in-out, with tapered ends |+| 28–40 | The fill grows from the shape's center with a small overshoot |+| 40+ | The finished drawing keeps boiling |++`lineBoilLength` is 40, the frame the fill lands. The boil runs from frame 0+and never stops: a new drawing every `boilEvery` frames, cycling through+`drawings` variations. `speed` scales the draw, the fill and the boil rate+together.++<PropsTable title="Props"+ rows={[+ { name: "path", type: "string", default: "5-point star", description: "Closed outline as SVG path data in any coordinate space, fitted to the frame" },+ { name: "boilEvery", type: "number", default: "3", description: "Frames each drawing holds before the next one" },+ { name: "drawings", type: "number", default: "3", description: "Number of distinct drawings the boil cycles through" },+ { name: "amplitude", type: "number", default: "1", description: "Wobble strength; 1 is a gentle hand-drawn boil, 0 is a steady line" },+ { name: "strokeWidth", type: "number", default: "9", description: "Base line weight in px at 720p; pen pressure varies it along the stroke" },+ { name: "size", type: "number", default: "0.66", description: "Size of the shape's longer side as a fraction of the frame's short side" },+ { name: "line", type: "string", default: '"#111111"', description: "Outline color. Overrides colors.line when set" },+ { name: "fill", type: "string", default: '"#E5322D"', description: "Shape fill. Overrides colors.fill when set" },+ { name: "background", type: "string", default: '"#FFFFFF"', description: "Background color. Overrides colors.background when set" },+ { name: "colors", type: "{ line?: string; fill?: string; background?: string }", default: '{ line: "#111111", fill: "#E5322D", background: "#FFFFFF" }', description: "The same colors as one object; the flat props above take precedence, missing keys keep their defaults" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/long-shadow.mdx b/content/docs/graphic-looks/long-shadow.mdxnew file mode 100644index 00000000..97b6d154--- /dev/null+++ b/content/docs/graphic-looks/long-shadow.mdx@@ -0,0 +1,98 @@+---+title: Long Shadow+description: A flat icon pops in and casts a long shadow to the frame edge, then the light swings and the shadow sweeps around on a spring+component: long-shadow+vibe: clean+length: 48+useWhen:+ - "A flat icon, badge or logo mark should get the classic flat-design long shadow, with a little motion in it."+ - "A success, feature or app icon beat needs a calm, clean accent that fills the frame without extra elements."+ - "You want depth on a flat mark without lighting it in 3D."+avoidWhen:+ - "The subject is a word that should rise out of the plane on a solid 3D body — use `extrude-pop`."+ - "A line of text should be uncovered and wiped by moving shadows — use `shadow-sweep-text`."+ - "The mark should land with a heavy impact rather than a soft pop — use `impact-shake`."+---++<ComponentPreview name="long-shadow" />++<InstallBlock name="long-shadow" />++## Usage++`LongShadow` is a full-frame scene. The icon springs in from nothing at the+center of the frame. Its shadow grows out of it until it reaches the frame+edge, a solid band the exact shape of the icon's silhouette. Then the light+swings, and the shadow sweeps from `angleFrom` to `angleTo` on a soft spring+that overshoots a little before it settles.++```tsx+import { LongShadow } from "@/components/remocn/long-shadow";++export const Done = () => <LongShadow />;+```++Without children it shows a red check badge. Pass a flat icon or mark as+children to cast its shadow instead. The children are centered, and the+shadow is built from their alpha, so any opaque shape works: an SVG, an image+with transparency or plain text.++```tsx+import { LongShadow } from "@/components/remocn/long-shadow";++export const AppIcon = () => (+ <LongShadow+ angleFrom={30}+ angleTo={150}+ shadowColor="#1F4FD1"+ background="#2D6BE5"+ fade={0.6}+ >+ <div+ style={{+ width: 240,+ height: 240,+ borderRadius: 56,+ background: "#FFFFFF",+ }}+ />+ </LongShadow>+);+```++Angles are in degrees, clockwise from the right: `0` casts the shadow to the+right and `90` casts it down. `fade` fades the shadow toward its far end,+from `0` for a solid band to `1` for a shadow that disappears at the edge.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–19 | The icon and its shadow spring in from zero scale |+| 7–22 | The shadow grows out to the frame edge at `angleFrom` |+| 24–48 | The light swings and the shadow sweeps to `angleTo`, overshooting slightly |++`longShadowLength` is 48, the frame the swing settles. `speed` scales the whole+timeline.++## Notes++The shadow is an SVG filter that stacks 1023 offset copies of the silhouette+in ten doubling passes, then softens the steps with a hair of blur. It covers+the full frame, so expect slower renders than a plain scene, especially at 4K.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "Flat icon or mark that casts the shadow, centered. Without it a red check badge is shown" },+ { name: "angleFrom", type: "number", default: "45", description: "Shadow direction before the swing, in degrees clockwise from the right" },+ { name: "angleTo", type: "number", default: "135", description: "Shadow direction after the swing" },+ { name: "shadowColor", type: "string", default: '"#ECEAE6"', description: "Shadow color" },+ { name: "background", type: "string", default: '"#FFFFFF"', description: "Background color" },+ { name: "fade", type: "number", default: "0", description: "Fades the shadow toward its far end, 0 to 1" },+ { name: "iconColor", type: "string", default: '"#E5322D"', description: "Disc color of the default badge; ignored with children" },+ { name: "checkColor", type: "string", default: '"#FFFFFF"', description: "Check mark color of the default badge; ignored with children" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/meta.json b/content/docs/graphic-looks/meta.jsonnew file mode 100644index 00000000..869d1ba2--- /dev/null+++ b/content/docs/graphic-looks/meta.json@@ -0,0 +1,17 @@+{+ "title": "Graphic Looks",+ "defaultOpen": true,+ "pages": [+ "index",+ "riso-print",+ "line-boil",+ "blueprint",+ "duotone-beat",+ "comic-panels",+ "long-shadow",+ "synthwave",+ "brick-mosaic",+ "x-ray-scan"+ ],+ "icon": "PaintBoardIcon"+}diff --git a/content/docs/graphic-looks/riso-print.mdx b/content/docs/graphic-looks/riso-print.mdxnew file mode 100644index 00000000..2802c45b--- /dev/null+++ b/content/docs/graphic-looks/riso-print.mdx@@ -0,0 +1,116 @@+---+title: Riso Print+description: Print a subject in two risograph inks, with the accent plate sliding in off-register and settling a hair out of alignment over grainy paper+component: riso-print+vibe: paper+length: 34+useWhen:+ - "A title card, poster or logo should arrive as if it came off a two-color risograph, with visible misregistration and ink speckle."+ - "The brand has two inks and the scene should read as a zine, flyer or gig poster rather than a screen."+ - "You want the print to keep a little life after it lands: the accent plate keeps a small stop-motion wobble."+avoidWhen:+ - "An existing live scene, photo or video should be re-screened as a printed page for its whole duration — use `halftone-print`."+ - "The print should pulse to music and swap its ink pair on every beat — use `duotone-beat`."+ - "Only one element should feel hand-placed on paper while the rest stays clean — use `paper-wobble`."+---++<ComponentPreview name="riso-print" />++<InstallBlock name="riso-print" />++## Usage++`RisoPrint` is a full-frame scene. It renders its subject twice, once per ink+plate, and multiplies both plates onto a paper ground. The key plate presses+onto the paper first. The accent plate slides in from the lower left on a+loose spring, overshoots, and settles a few pixels off register. Both plates+are speckled with seeded noise where the ink failed to take, and a paper tooth+texture sits over everything.++```tsx+import { RisoPrint } from "@/components/remocn/riso-print";++export const Poster = () => <RisoPrint />;+```++Without children it prints a built-in geometric poster. Pass children to print+your own subject. Children are centered in the frame and rendered once per+plate.++### Separating your subject into plates++Each plate picks up ink by color channel, like a separation:++| Color in your subject | Key plate | Accent plate |+| --- | --- | --- |+| Black | Yes | Yes, overprinting into a rich black |+| Red, `#FF0000` | No | Yes |+| Cyan or green, `#00FFFF`, `#00FF00` | Yes | No |+| White or transparent | No | No |++The key plate takes everything without red, and the accent plate takes+everything without green. So paint the subject in these flat separation colors,+not in the final inks. The final inks come from `keyInk` and `accentInk` (or+the `inks` tuple).++```tsx+import { RisoPrint } from "@/components/remocn/riso-print";++export const ZineCover = () => (+ <RisoPrint keyInk="#1F3A93" accentInk="#FF4F64" paper="#F4EFE4">+ <div style={{ display: "flex", alignItems: "center", gap: 56 }}>+ <div+ style={{+ width: 300,+ height: 300,+ borderRadius: "50%",+ background: "#FF0000",+ }}+ />+ <span style={{ fontSize: 180, fontWeight: 900, color: "#00FFFF" }}>+ ZINE+ </span>+ </div>+ </RisoPrint>+);+```++Here the circle prints only in pink and the word only in blue. Black text would+print in both plates and show the accent plate's offset as a pink fringe.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–8 | The key plate presses in: it fades in and shrinks from 103.5% to 100% |+| 4–8 | The accent plate fades in while it starts to slide |+| 4–33 | The accent plate springs from the lower left, rotated −4°, overshoots and settles at `offset` with a 0.35° skew |+| 26–34 | The stop-motion wobble fades in |+| 34+ | The print holds. The accent plate jumps to a new seeded position every 4 frames, within `jitter` pixels |++The wobble never stops, so the hold stays alive. Set `jitter={0}` for a still+hold. `speed` scales the whole timeline. Pixel props are pixels at 720p and+scale with the composition height.++## Notes++Both plates and the paper run SVG filters with fractal noise over the full+frame, so this look renders slower than a plain scene. The noise is seeded,+so every frame is deterministic.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "Subject to print, centered and rendered once per plate. Without it a geometric poster is printed" },+ { name: "keyInk", type: "string", default: '"#111111"', description: "Key ink. Overrides inks[0] when set" },+ { name: "accentInk", type: "string", default: '"#E5322D"', description: "Accent ink. Overrides inks[1] when set" },+ { name: "inks", type: "[string, string]", default: '["#111111", "#E5322D"]', description: "Key ink and accent ink as a tuple; keyInk and accentInk take precedence" },+ { name: "paper", type: "string", default: '"#F2F0EA"', description: "Paper color behind the inks" },+ { name: "offset", type: "[number, number]", default: "[7, -5]", description: "Final misregistration of the accent plate in px at 720p" },+ { name: "grain", type: "number", default: "0.5", description: "Ink speckle and paper tooth, clamped to 0–1" },+ { name: "jitter", type: "number", default: "1.2", description: "Stop-motion wobble of the accent plate after it settles, in px at 720p; 0 disables it" },+ { name: "marks", type: "boolean", default: "true", description: "Prints registration marks in the four corners on both plates" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/synthwave.mdx b/content/docs/graphic-looks/synthwave.mdxnew file mode 100644index 00000000..494500d7--- /dev/null+++ b/content/docs/graphic-looks/synthwave.mdx@@ -0,0 +1,75 @@+---+title: Synthwave+description: A retro neon horizon with a scrolling perspective grid, a rising striped sun and mountain ranges that slide in+component: synthwave+vibe: playful+length: sustained+useWhen:+ - "A scene needs an 80s retro backdrop: a music drop, a gaming or nostalgia beat, a late-night product teaser."+ - "Titles or a logo should sit over a moving background that loops for as long as the beat lasts."+ - "The brand has a neon accent and the backdrop should be built from it."+avoidWhen:+ - "The camera should fly forward through space into the next scene — use `hyperspace`."+ - "The backdrop should be a calm landscape that trucks sideways in layers — use `parallax-depth`."+ - "The moving floor should be a tunnel you travel through rather than a horizon — use `shader-light-tunnel`."+---++<ComponentPreview name="synthwave" />++<InstallBlock name="synthwave" />++## Usage++`Synthwave` is a full-frame background. A perspective grid glows on the floor+and scrolls toward the viewer. A striped sun rises from behind the horizon,+its stripes thickening toward the bottom and drifting downward. Two mountain+ranges slide in from opposite sides as they rise into place, the front one+traced in the grid color. Stars twinkle in the dark sky, and a haze swallows+the lines where they converge.++```tsx+import { AbsoluteFill } from "remotion";+import { Synthwave } from "@/components/remocn/synthwave";++export const Drop = () => (+ <AbsoluteFill>+ <Synthwave grid="#00E5FF" sunTop="#FFE66D" sunBottom="#FF2E88" />+ <AbsoluteFill style={{ alignItems: "center", paddingTop: 120 }}>+ <Title />+ </AbsoluteFill>+ </AbsoluteFill>+);+```++It takes no children. Layer your content on top in a sibling `AbsoluteFill`,+and keep it above the horizon, which sits at `horizon` of the frame height+(60% by default).++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–40 | The sun rises from behind the horizon |+| 4–34 | The back range slides in from the left and rises |+| 8–38 | The front range slides in from the right and rises |+| Always | The grid scrolls at `gridSpeed` rows per second; the sun stripes cycle every 36 frames |++`synthwaveLength` is 40, the frame the sun and mountains are in place. The+grid and stripes never stop, so the background holds for any duration.+`speed` scales the entrance and the scroll together.++<PropsTable title="Props"+ rows={[+ { name: "grid", type: "string", default: '"#E5322D"', description: "Grid lines and the front mountain outline. Overrides colors.grid when set" },+ { name: "sunTop", type: "string", default: '"#FFC46B"', description: "Top of the sun gradient. Overrides colors.sunTop when set" },+ { name: "sunBottom", type: "string", default: '"#E5322D"', description: "Bottom of the sun gradient. Overrides colors.sunBottom when set" },+ { name: "skyHorizon", type: "string", default: '"#3B0C10"', description: "Sky glow at the horizon, also tints the floor and haze. Overrides colors.skyHorizon when set" },+ { name: "colors", type: "{ skyTop?, skyHorizon?, sunTop?, sunBottom?, grid?, floor?, mountainsBack?, mountainsFront?: string }", default: '{ skyTop: "#08080B", skyHorizon: "#3B0C10", sunTop: "#FFC46B", sunBottom: "#E5322D", grid: "#E5322D", floor: "#0A0A0C", mountainsBack: "#2A0A0E", mountainsFront: "#111111" }', description: "All scene colors as one object; skyHorizon also tints the floor and the horizon haze. The flat props above take precedence, missing keys keep their defaults" },+ { name: "gridSpeed", type: "number", default: "2", description: "Grid rows that pass the viewer per second" },+ { name: "horizon", type: "number", default: "0.6", description: "Horizon height as a fraction of the frame height, from the top" },+ { name: "sunStripes", type: "boolean", default: "true", description: "Scrolls the sun stripes downward; false keeps them fixed" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/graphic-looks/x-ray-scan.mdx b/content/docs/graphic-looks/x-ray-scan.mdxnew file mode 100644index 00000000..d509098a--- /dev/null+++ b/content/docs/graphic-looks/x-ray-scan.mdx@@ -0,0 +1,105 @@+---+title: X-Ray Scan+description: A glowing scanner bar sweeps across a device and reveals its white-line internals, with one part marked in red+component: x-ray-scan+vibe: tech+length: 32+useWhen:+ - "A hardware launch should show what is inside the device: the board, the battery, the chip that matters."+ - "One internal part is the story, like a new chip or a bigger battery, and should be singled out in the brand color."+ - "The reveal should read as a single clean scanner pass, left to right or top to bottom."+avoidWhen:+ - "The product should come apart into labelled layers — use `exploded-view`."+ - "The product should be measured and annotated from the outside — use `blueprint`."+ - "The subject should read as a printed poster rather than a device scan — use `riso-print`."+---++<ComponentPreview name="x-ray-scan" />++<InstallBlock name="x-ray-scan" />++## Usage++`XRayScan` is a full-frame scene. It starts on the outside of a device. A thin+glowing bar sweeps across it, and behind the bar the shell is gone: the device+shows as white linework on a dark plate, with one part highlighted in the+accent color. A freshly exposed band just behind the bar glows brighter and+fades as the bar moves on.++```tsx+import { XRayScan } from "@/components/remocn/x-ray-scan";++export const Inside = () => <XRayScan />;+```++Without `outside` and `inside` it draws the back of a phone and its internals:+the camera array, the logic board with the SoC in the accent color, the+battery with a wireless charging coil, and the speaker grille. `direction`+picks a left-to-right or a top-to-bottom sweep.++### Your own layers++Pass `outside` and `inside` to scan your own product. Both are full-frame+layers stacked on each other, so draw them in the same coordinates, for+example as two aligned images.++```tsx+import { AbsoluteFill, Img, staticFile } from "remotion";+import { XRayScan } from "@/components/remocn/x-ray-scan";++export const Watch = () => (+ <XRayScan+ direction="vertical"+ outside={+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center" }}>+ <Img src={staticFile("watch-front.png")} style={{ height: 560 }} />+ </AbsoluteFill>+ }+ inside={+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center" }}>+ <Img src={staticFile("watch-xray.png")} style={{ height: 560 }} />+ </AbsoluteFill>+ }+ />+);+```++The sweep is sized to the default device, a centered box 80% of the frame+height tall and about 39% of the height wide. The bar starts 12% of the frame+width before that box and stops 12% past it, or 10% of the frame height for a+vertical sweep. Content outside that span never+changes: before the start it shows the inside layer from the first frame, and+past the end it keeps the outside layer. Keep custom products centered and+about that size.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–5 | The outside of the device holds |+| 5–32 | The bar sweeps across on an ease-in-out, revealing the inside |+| 32+ | The bar is gone and the inside holds |++`xRayScanLength` is 32. `speed` scales the sweep.++## Notes++The inside layer renders twice: once as the revealed view and once under a+glow filter for the bright band behind the bar. Heavy custom `inside` content+costs twice.++<PropsTable title="Props"+ rows={[+ { name: "outside", type: "React.ReactNode", description: "Full-frame exterior shown ahead of the bar. Defaults to the back of a phone" },+ { name: "inside", type: "React.ReactNode", description: "Full-frame interior revealed behind the bar. Defaults to white-line phone internals" },+ { name: "direction", type: '"horizontal" | "vertical"', default: '"horizontal"', description: "Horizontal sweeps left to right, vertical sweeps top to bottom" },+ { name: "shell", type: "string", default: '"#E5322D"', description: "Shell of the default device. Overrides colors.shell when set" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Highlighted part inside the default device. Overrides colors.accent when set" },+ { name: "line", type: "string", default: '"#FFFFFF"', description: "Interior linework and the scan bar. Overrides colors.line when set" },+ { name: "background", type: "string", default: '"#111111"', description: "Frame background. Overrides colors.background when set" },+ { name: "colors", type: "{ background?, shell?, detail?, xray?, line?, accent?: string }", default: '{ background: "#111111", shell: "#E5322D", detail: "#111111", xray: "#07080A", line: "#FFFFFF", accent: "#E5322D" }', description: "All colors as one object: frame background, default shell and its camera bump, x-ray plate, linework and scan bar, highlighted part. The flat props above take precedence, missing keys keep their defaults; shell, detail, xray and accent only affect the default device" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/accordion-unfold.mdx b/content/docs/logo-stings/accordion-unfold.mdxnew file mode 100644index 00000000..a81f6949--- /dev/null+++ b/content/docs/logo-stings/accordion-unfold.mdx@@ -0,0 +1,82 @@+---+title: Accordion Unfold+description: A tight paper zigzag unfolds sideways into a flat card with the logo printed across it+component: accordion-unfold+vibe: paper+length: 26+useWhen:+ - "A print, stationery, travel or editorial brand wants a tactile reveal, like opening a folded brochure or map."+ - "Your logo should sit on a card or label rather than float on the background."+ - "You want a quick, quiet sting that settles flat by frame 26 and leaves a clean card to hold on."+avoidWhen:+ - "The logo should float freely on the background instead of on a card — use `spotlight` or `anamorphic-flare`."+ - "You want a stop-motion paper feel with hand-placed jitter — use `paper-sticker`."+ - "The paper motion is a scene change, not a logo reveal — use `page-turn`."+ - "The content should be revealed by pulling a cloth off it — use `cloth-reveal`."+---++<ComponentPreview name="accordion-unfold" />++<InstallBlock name="accordion-unfold" />++## Usage++`AccordionUnfold` prints your logo across a paper card, then folds the card+into vertical pleats. It starts as a tight zigzag and opens sideways on a+smooth spring with no overshoot, staying centered as it widens. Pleats facing+away from the light are shaded and the ones facing it catch a faint+highlight, so the folds read in 3D. When the card is flat it switches to a+single plain card, so no seams are left in the hold.++```tsx+import { Img, staticFile } from "remotion";+import { AccordionUnfold } from "@/components/remocn/accordion-unfold";++export const LogoSting = () => (+ <AccordionUnfold color="#FFFFFF" panels={6}>+ <Img src={staticFile("logo-dark.svg")} style={{ height: 96 }} />+ </AccordionUnfold>+);+```++`children` are centered on the card, and each pleat shows its own slice of+them, so the logo folds with the paper. Use a version of your logo that reads+on `color`: the default card is white, so a dark logo works best. The card is+66% of the frame width, capped at 130% of the height, and 40% of the frame+height tall, capped at 40% of its width. Children larger than the card are+cropped at its edges.++The fold uses CSS 3D transforms (`rotateY` with `preserve-3d`), which Remotion+renders in Chrome as expected.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–3 | The folded card fades in |+| 0–6 | The card lifts from 92% to full scale |+| 4–26 | The pleats open on a spring and the card lies flat |++The docs preview runs 66 frames to hold the flat card. `speed` scales the+timeline.++## Variations++Fewer `panels` gives wide, slow pleats; 10 or more gives a tight concertina.+`foldAngle` sets how closed the card starts: near 89 it starts as a thin+strip, 30–45 starts half open for a gentler move. `shade={0}` removes the fold+shading for a flat graphic look.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Lockup printed across the card; use a color that reads on the card. Without it a placeholder lockup (a rounded mark and the word remocn) is shown" },+ { name: "panels", type: "number", default: "6", description: "Number of vertical pleats, rounded, minimum 2" },+ { name: "foldAngle", type: "number", default: "82", description: "Fold angle of each pleat at the start, in degrees" },+ { name: "shade", type: "number", default: "0.55", description: "Darkness of the pleats facing away from the light, 0 to 1" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Paper color of the card" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/anamorphic-flare.mdx b/content/docs/logo-stings/anamorphic-flare.mdxnew file mode 100644index 00000000..e236c264--- /dev/null+++ b/content/docs/logo-stings/anamorphic-flare.mdx@@ -0,0 +1,76 @@+---+title: Anamorphic Flare+description: A point of light stretches into a cinematic horizontal streak that sweeps the frame and reveals the logo behind it+component: anamorphic-flare+vibe: premium+length: 40+useWhen:+ - "A film, studio, automotive or premium product needs a cinematic opener with a lens-flare look."+ - "Your logo is an image or component you already have, and it should be wiped in by light rather than redrawn."+ - "You want a fast left-to-right sweep that has a centered logo fully revealed by about frame 20."+avoidWhen:+ - "The light should search and land on the logo like a stage light — use `spotlight`."+ - "You want warm light flooding a cut between two scenes, not a logo reveal — use `light-leak`."+ - "The moment calls for a kinetic impact rather than a sweep — use `orbit-lock`."+ - "Text, not a logo, should get a single shine across it — use `shimmer-sweep`."+---++<ComponentPreview name="anamorphic-flare" />++<InstallBlock name="anamorphic-flare" />++## Usage++`AnamorphicFlare` starts with a point of light near the left edge. It ignites,+stretches into a long horizontal streak with a hot core line and a tinted+glow, and sweeps across the frame. Your logo is revealed behind the head of+the streak through a soft-edged mask, so it appears left to right in the+light's wake. Ghost orbs sit mirrored across the frame center and slide the+opposite way, like real lens reflections. After the streak exits, a faint+tinted line is left across the frame.++```tsx+import { Img, staticFile } from "remotion";+import { AnamorphicFlare } from "@/components/remocn/anamorphic-flare";++export const LogoSting = () => (+ <AnamorphicFlare tint="#E5322D" coreColor="#FFFFFF">+ <Img src={staticFile("logo.svg")} style={{ height: 120 }} />+ </AnamorphicFlare>+);+```++`children` are centered in the frame at their own size. `y` moves the streak+vertically as a fraction of the height; the logo stays centered, so keep `y`+within the logo's height for the reveal to read as the light uncovering it.+The streak layer uses `mix-blend-mode: screen`, so it brightens the logo where+they overlap and works best on dark backgrounds. Ghost positions, sizes and+opacities come from Remotion's seeded `random()`, so the same `seed` always+renders the same frames.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–6 | The point of light ignites at 7% of the width |+| 0–12 | The streak stretches from a point to 130% of the frame width |+| 4–26 | The head sweeps from 7% to 112% of the width, revealing the logo behind it |+| 20–28 | The streak, bloom and ghosts fade out |+| 24–40 | A faint tinted line fades up across the frame and holds |++The docs preview runs 70 frames. `speed` scales the timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Lockup revealed behind the streak, centered in the frame. Without it a placeholder lockup (a rounded mark and the word remocn) is shown" },+ { name: "tint", type: "string", default: '"#E5322D"', description: "Color of the streak glow, bloom, ghosts and the residual line" },+ { name: "coreColor", type: "string", default: '"#FFFFFF"', description: "Hot core line and the center of the bloom" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame background" },+ { name: "ghosts", type: "number", default: "4", description: "Number of ghost orbs mirrored across the frame center, rounded" },+ { name: "y", type: "number", default: "0.5", description: "Vertical position of the streak, 0 to 1" },+ { name: "seed", type: "number", default: "2", description: "Seeds the ghost positions, sizes and opacities" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/index.mdx b/content/docs/logo-stings/index.mdxnew file mode 100644index 00000000..820ab8e9--- /dev/null+++ b/content/docs/logo-stings/index.mdx@@ -0,0 +1,59 @@+---+title: Logo Stings+description: Short brand reveals that land your logo or wordmark at the open or close of a video+---++A logo sting is the one or two second beat where the brand lands. Each one fills the frame, plays its own lead-in, and leaves your lockup centered and holding, so it works as the first or last `Sequence` of a video. Most take the logo as children; a few draw a mark themselves and only need the wordmark.++<ComponentCardGrid+ items={[+ {+ name: "Orbit Lock",+ description: "Moons ride tilted, shrinking orbits into a core that bursts into a ring flash, and the logo springs into place",+ status: "stable",+ href: "/docs/logo-stings/orbit-lock",+ },+ {+ name: "Puzzle Snap",+ description: "Geometric pieces spin in from scattered positions and snap into a mark with sparks, then the wordmark slides out beside it",+ status: "stable",+ href: "/docs/logo-stings/puzzle-snap",+ },+ {+ name: "Spotlight",+ description: "A soft stage spotlight searches the dark, overshoots, lands on the logo, and the house lights come up",+ status: "stable",+ href: "/docs/logo-stings/spotlight",+ },+ {+ name: "Neon Sign",+ description: "A glass neon tube stutters alive segment by segment, buzzes off once, then holds lit with a glow on the wall",+ status: "stable",+ href: "/docs/logo-stings/neon-sign",+ },+ {+ name: "Inflate",+ description: "A flat sliver puffs up like a balloon toy, squashes and settles into a glossy mark, then the wordmark slides out",+ status: "stable",+ href: "/docs/logo-stings/inflate",+ },+ {+ name: "Liquid Fill",+ description: "A drop falls into an outlined mark and liquid rises with a sloshing surface and bubbles until the mark is solid",+ status: "stable",+ href: "/docs/logo-stings/liquid-fill",+ },+ {+ name: "Accordion Unfold",+ description: "A tight paper zigzag unfolds sideways into a flat card with the logo printed across it",+ status: "stable",+ href: "/docs/logo-stings/accordion-unfold",+ },+ {+ name: "Anamorphic Flare",+ description: "A point of light stretches into a cinematic horizontal streak that sweeps the frame and reveals the logo behind it",+ status: "stable",+ href: "/docs/logo-stings/anamorphic-flare",+ },+ ]}+/>diff --git a/content/docs/logo-stings/inflate.mdx b/content/docs/logo-stings/inflate.mdxnew file mode 100644index 00000000..1a6fe5e7--- /dev/null+++ b/content/docs/logo-stings/inflate.mdx@@ -0,0 +1,79 @@+---+title: Inflate+description: A flat sliver puffs up like a balloon toy, squashes and settles into a glossy mark, then the wordmark slides out+component: inflate+vibe: playful+length: 35+useWhen:+ - "A consumer, kids or casual app wants a soft, bouncy brand moment with a toy-like feel."+ - "You have a wordmark and want the sting to supply a simple rounded mark beside it."+ - "The sting should be short, with the mark settled and the wordmark in by frame 35."+avoidWhen:+ - "Your real logo must appear exactly as designed — the mark here is a fixed rounded square with a dot, so wrap your logo with `spotlight` or `orbit-lock`."+ - "You want a word, not a mark, to pop up with a solid 3D body — use `extrude-pop`."+ - "The mark should assemble from crisp geometric parts rather than inflate — use `puzzle-snap`."+ - "The brand is serious or premium and the bounce reads as too playful — use `anamorphic-flare`."+---++<ComponentPreview name="inflate" />++<InstallBlock name="inflate" />++## Usage++`Inflate` draws its own mark: a glossy rounded square with a dot in the+middle. It starts as a flat, deflated sliver, then puffs up on an underdamped+spring, overshoots, squashes wide and rings out like a balloon. As it fills,+the corners tighten from a pill to a rounded square and a specular highlight+and inner shadow fade in. The dot pops in last, then the mark slides left+while your wordmark wipes in on its right.++```tsx+import { Inflate } from "@/components/remocn/inflate";++export const LogoSting = () => (+ <Inflate color="#E5322D" dotColor="#111111">+ <span+ style={{+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: "#FFFFFF",+ }}+ >+ remocn+ </span>+ </Inflate>+);+```++Pass only the wordmark as `children`. Without `children` the mark stays+centered and no slide happens. The mark is 22% of the shorter side of the+composition (158px at 720p); the wordmark keeps its own size.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–3 | A flat sliver fades in and widens |+| 3–26 | The body puffs up on a spring, peaking about 23% oversize around frame 10 |+| 10–30 | Squash-and-stretch wobble that decays to rest |+| 5–12 | Highlight and inner shadow fade in |+| 15–32 | The dot springs in with a small overshoot |+| 22–33 | The mark slides from the center to the left |+| 24–35 | The wordmark wipes in from the left |++The docs preview runs 66 frames. `speed` scales the timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Wordmark revealed to the right of the mark once it settles. Without it the mark settles alone in the center" },+ { name: "color", type: "string", default: '"#E5322D"', description: "Body color of the mark" },+ { name: "highlight", type: "string", default: '"#FFFFFF"', description: "Specular highlight color" },+ { name: "dotColor", type: "string", default: '"#111111"', description: "Dot inside the mark" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/liquid-fill.mdx b/content/docs/logo-stings/liquid-fill.mdxnew file mode 100644index 00000000..1cb973fc--- /dev/null+++ b/content/docs/logo-stings/liquid-fill.mdx@@ -0,0 +1,94 @@+---+title: Liquid Fill+description: A drop falls into an outlined mark and liquid rises with a sloshing surface and bubbles until the mark is solid+component: liquid-fill+vibe: clean+length: 49+useWhen:+ - "A beverage, fintech or utility brand wants a reveal about filling up, loading or topping off."+ - "Your mark is a simple closed shape you can express as one SVG path, and the sting should fill it."+ - "You want a calm build with a clear payoff, the mark turning solid around frame 34."+avoidWhen:+ - "Your logo is a detailed image rather than a single closed shape — wrap it with `spotlight` or `orbit-lock`."+ - "Letters, not a mark, should draw as outlines and then fill — use `outline-trace`."+ - "The mark should feel bouncy and soft rather than fluid — use `inflate`."+ - "You need a fluid look as a looping background, not a reveal — use `shader-water`."+---++<ComponentPreview name="liquid-fill" />++<InstallBlock name="liquid-fill" />++## Usage++`LiquidFill` draws an outlined mark and fills it. A single drop falls in from+above and lands on the floor of the shape. Liquid rises from the bottom with a+surface that sloshes on two sine waves, dips where the drop splashed, and calms+as it climbs. A few bubbles rise through it. When the liquid reaches the top,+the outline turns the liquid color and the bubbles and surface line fade, so+the mark reads as solid. Then the mark slides left and your wordmark wipes in+on its right.++```tsx+import { LiquidFill } from "@/components/remocn/liquid-fill";++export const LogoSting = () => (+ <LiquidFill liquidColor="#E5322D" outlineColor="#FFFFFF">+ <span+ style={{+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: "#FFFFFF",+ }}+ >+ remocn+ </span>+ </LiquidFill>+);+```++Pass only the wordmark as `children`. Without `children` the mark stays+centered and no slide happens. The mark is 24% of the shorter side of the+composition (173px at 720p).++### Custom shape++`shape` is SVG path data drawn in a 100×100 box. The liquid is clipped to it+and the outline is stroked along it, 3 units wide. Keep the shape inside about+2–98 on both axes so the stroke is not cut off, and make it one closed path,+since the drop lands at the center bottom.++```tsx+<LiquidFill shape="M 50 4 A 46 46 0 1 1 49.9 4 Z" liquidColor="#2F6BFF">+ <Wordmark />+</LiquidFill>+```++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–5 | Outline fades in |+| 0–9 | The drop falls and stretches as it speeds up |+| 9–34 | Liquid rises from the floor to over the top; the splash and sloshing decay as it climbs |+| 11–34 | Bubbles rise and pop at the surface |+| 32–37 | Outline turns the liquid color; surface line and bubbles fade |+| 36–47 | The mark slides from the center to the left |+| 38–49 | The wordmark wipes in from the left |++The docs preview runs 78 frames. `speed` scales the timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Wordmark revealed to the right of the mark once it is full. Without it the mark settles alone in the center" },+ { name: "shape", type: "string", default: "rounded square", description: "Mark outline as SVG path data in a 100×100 box" },+ { name: "liquidColor", type: "string", default: '"#E5322D"', description: "Drop and liquid color; also the final outline color" },+ { name: "outlineColor", type: "string", default: '"#FFFFFF"', description: "Outline color while the mark is filling" },+ { name: "bubbleColor", type: "string", default: '"#FFFFFF"', description: "Bubble outline color" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/meta.json b/content/docs/logo-stings/meta.jsonnew file mode 100644index 00000000..cbd5df13--- /dev/null+++ b/content/docs/logo-stings/meta.json@@ -0,0 +1,16 @@+{+ "title": "Logo Stings",+ "defaultOpen": true,+ "pages": [+ "index",+ "orbit-lock",+ "puzzle-snap",+ "spotlight",+ "neon-sign",+ "inflate",+ "liquid-fill",+ "accordion-unfold",+ "anamorphic-flare"+ ],+ "icon": "Award01Icon"+}diff --git a/content/docs/logo-stings/neon-sign.mdx b/content/docs/logo-stings/neon-sign.mdxnew file mode 100644index 00000000..a7b590c8--- /dev/null+++ b/content/docs/logo-stings/neon-sign.mdx@@ -0,0 +1,91 @@+---+title: Neon Sign+description: A glass neon tube stutters alive segment by segment, buzzes off once, then holds lit with a glow on the wall+component: neon-sign+vibe: playful+length: 40+useWhen:+ - "The brand, venue or event has a nightlife, retro or hand-lettered feel and the sting should look like a lit sign."+ - "Your mark or word exists as a monoline SVG path, so each stroke can light as its own tube."+ - "You want a short greeting or title card like the default \"hello\" with a buzzing, imperfect start."+avoidWhen:+ - "Your logo is a filled image rather than a stroke path — wrap it with `spotlight` or `anamorphic-flare` instead."+ - "Letters should draw on as clean outlines and then fill, without the neon look — use `outline-trace`."+ - "The word should be written by hand on paper, not lit in glass — use `handwrite`."+ - "You want a full retro neon landscape behind your content rather than a sign — use `synthwave`."+---++<ComponentPreview name="neon-sign" />++<InstallBlock name="neon-sign" />++## Usage++`NeonSign` renders an SVG path as glass neon tubing on a dark wall. The unlit+glass is visible from the first frame. Each subpath of the path is its own+tube: tubes switch on one after another, flicker for 7 frames, then hold. Once+everything is lit, the whole sign drops out for a few frames like a bad+transformer and comes back for good. A lit tube has four layers: a wide+blurred glow, a tight halo, the colored tube and a thin hot core. A soft glow+on the wall behind follows the average brightness of the sign.++```tsx+import { NeonSign } from "@/components/remocn/neon-sign";++export const LogoSting = () => <NeonSign color="#E5322D" glowColor="#E5322D" />;+```++With no props it writes a handwritten "hello" with an underline swash. To use+your own mark or word, pass monoline path data in `path`. Every `M` command+starts a new tube, so split the artwork where you want separate segments to+light:++```tsx+<NeonSign+ path="M 10 80 L 50 10 L 90 80 M 30 50 L 70 50"+ strokeWidth={5}+ color="#4DE1FF"+ glowColor="#4DE1FF"+/>+```++`strokeWidth` is in path units, so match it to your path's scale. Without a+`viewBox` the sign frames the path's bounding box with padding of six stroke+widths. The sign is scaled to `fit` of the frame width, and never taller than+70% of the frame. Flicker comes from Remotion's seeded `random()`, so the+same `seed` always renders the same frames.++Each tube renders two blurred copies, so very long paths with many subpaths+are heavier to render than the default.++## Timing++At 30 fps, `speed={1}` and the default six-tube path:++| Frames | Motion |+| --- | --- |+| 0 | Unlit glass tubes on the dark wall |+| 3–22 | Tubes switch on roughly every 3.4 frames, each with up to 2 frames of seeded delay |+| each onset + 7 | Each tube flickers for 7 frames, then holds lit |+| 29–32 | The whole sign drops out and stutters back on |+| 32–40 | The wall glow settles to full strength |++The buzz is fixed at frames 29–32. With more than six or seven tubes the last+ones are still switching on when it hits, so allow for about 3.4 frames per+extra tube. The docs preview runs 70 frames. `speed` scales the timeline.++<PropsTable title="Props"+ rows={[+ { name: "path", type: "string", default: "handwritten \"hello\"", description: "SVG path data for the tubes; each subpath (M command) lights on its own" },+ { name: "viewBox", type: "string", description: "viewBox for the path; defaults to the path's bounding box padded by six stroke widths" },+ { name: "color", type: "string", default: '"#E5322D"', description: "Tube color when lit" },+ { name: "glowColor", type: "string", default: '"#E5322D"', description: "Halo around the tubes and the glow on the wall" },+ { name: "tubeColor", type: "string", default: '"#2A2A2A"', description: "Unlit glass tube" },+ { name: "coreColor", type: "string", default: '"#FFFFFF"', description: "Hot core inside a lit tube" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame wall" },+ { name: "strokeWidth", type: "number", default: "6", description: "Tube thickness in path units" },+ { name: "fit", type: "number", default: "0.62", description: "Share of the frame width the sign spans, capped at 70% of the height" },+ { name: "seed", type: "number", default: "7", description: "Seeds each tube's onset delay and flicker pattern" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/orbit-lock.mdx b/content/docs/logo-stings/orbit-lock.mdxnew file mode 100644index 00000000..6972f270--- /dev/null+++ b/content/docs/logo-stings/orbit-lock.mdx@@ -0,0 +1,84 @@+---+title: Orbit Lock+description: Moons ride tilted, shrinking orbits into a core that bursts into a ring flash, and the logo springs into place+component: orbit-lock+vibe: tech+length: 50+useWhen:+ - "A tech, AI or infrastructure product needs an opener or closer where the logo arrives out of a small physical event."+ - "You want a sting with a clear impact frame to sync a sound hit to, at frame 30."+ - "Your lockup is a logo you already have as an image or component, and the sting should frame it, not redraw it."+avoidWhen:+ - "Several partner or integration logos should arrive together as a group — use `logo-enter`."+ - "The reveal should feel cinematic and calm rather than kinetic — use `anamorphic-flare` or `spotlight`."+ - "The brand is a word with no mark and the reveal should be pure type — use `mask-reveal-up` or `spring-scale-in`."+ - "The moment should explode outward to clear the frame for a title, with no logo at the end — use `radial-burst`."+---++<ComponentPreview name="orbit-lock" />++<InstallBlock name="orbit-lock" />++## Usage++`OrbitLock` fills the frame with its background and draws a small red core+with a few moons circling it on tilted orbits. The orbits shrink on an+ease-in curve while the moons speed up, each one trailing a tapered ribbon.+Moons on the far side of an orbit pass behind the core. At frame 30 the moons+hit the core: it flashes to `flashColor`, swells and pops, a ring shoots out,+and your logo springs in from 55% scale with a small overshoot.++```tsx+import { Img, staticFile } from "remotion";+import { OrbitLock } from "@/components/remocn/orbit-lock";++export const LogoSting = () => (+ <OrbitLock moons={3} tilt={64}>+ <Img src={staticFile("logo.svg")} style={{ height: 120 }} />+ </OrbitLock>+);+```++`children` are centered in the frame and rendered at their own size; the sting+does not resize them. The core, orbits and moons scale with the shorter side+of the composition, so the look is the same at 720p and 4K. Everything derives+from the frame, so seeking and rendering are deterministic.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–5 | Core, moons and faint orbit guides fade in |+| 0–30 | Orbits collapse toward the core while the moons spin 1.9 turns; the core swells by up to 30% near the end |+| 28–31 | Core color shifts to `flashColor` |+| 30–36 | Core bursts outward and shrinks to nothing |+| 30–46 | Ring flash expands and fades |+| 33–36 | Logo fades in |+| 33–50 | Logo springs from 55% to full size, peaking near 107% around frame 40 |++Give the sequence about 30 extra frames after frame 50 to hold the logo. The+docs preview runs 78 frames. `speed` scales the whole timeline, so at+`speed={2}` the impact lands on frame 15. `speed={0}` freezes on the first,+empty frame.++## Variations++`moons={1}` gives a single, cleaner orbit; 5 or more turns it into a busy+atom. `tilt={0}` draws flat circles, and values toward 85 flatten the orbits+into near edge-on lines. For a light theme, set `backgroundColor` light and+`moonColor` and `flashColor` dark so the trails and ring still read.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Logo revealed after the impact, centered in the frame. Without it a placeholder lockup (a rounded mark and the word remocn) is shown" },+ { name: "moons", type: "number", default: "3", description: "Number of moons, rounded, minimum 1" },+ { name: "tilt", type: "number", default: "64", description: "Orbit tilt in degrees, clamped to 0–85; 0 is a flat circle" },+ { name: "coreColor", type: "string", default: '"#E5322D"', description: "Core fill before the impact" },+ { name: "moonColor", type: "string", default: '"#FFFFFF"', description: "Moons, their trails and the orbit guides" },+ { name: "flashColor", type: "string", default: '"#FFFFFF"', description: "Core color at impact and the expanding ring" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; 0 freezes on the first frame" },+ ]}+/>diff --git a/content/docs/logo-stings/puzzle-snap.mdx b/content/docs/logo-stings/puzzle-snap.mdxnew file mode 100644index 00000000..7f9402bb--- /dev/null+++ b/content/docs/logo-stings/puzzle-snap.mdx@@ -0,0 +1,83 @@+---+title: Puzzle Snap+description: Geometric pieces spin in from scattered positions and snap into a mark with sparks, then the wordmark slides out beside it+component: puzzle-snap+vibe: playful+length: 38+useWhen:+ - "You have a wordmark but no animated mark, and the sting should build a simple geometric mark for you."+ - "The brand is friendly or modular, and pieces clicking together tell that story."+ - "You want four small hits in a row to sync clicks or a rhythmic sound to, one per piece."+avoidWhen:+ - "Your real logo must appear exactly as designed — the mark here is a fixed set of shapes, so wrap your own logo with `orbit-lock` or `spotlight`."+ - "The brand is calm or luxurious and the snapping reads as too toy-like — use `anamorphic-flare`."+ - "You want flat shapes tumbling into a full-frame frieze rather than a compact mark — use `bauhaus-build`."+ - "The mark should feel soft and squishy rather than mechanical — use `inflate`."+---++<ComponentPreview name="puzzle-snap" />++<InstallBlock name="puzzle-snap" />++## Usage++`PuzzleSnap` draws its own mark: a quarter circle, a dot, a wedge and a small+rounded square on a 2×2 grid. Each piece starts far off at a seeded angle,+drifts in while it spins, then gets yanked onto its slot over three frames and+throws a ring of six sparks. When the last piece lands the whole mark punches,+then slides left while your wordmark wipes in on its right.++```tsx+import { PuzzleSnap } from "@/components/remocn/puzzle-snap";++export const LogoSting = () => (+ <PuzzleSnap primaryColor="#E5322D" secondaryColor="#FFFFFF">+ <span+ style={{+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: "#FFFFFF",+ }}+ >+ remocn+ </span>+ </PuzzleSnap>+);+```++Pass only the wordmark as `children`, not a full lockup: the mark is the+sting's own drawing. Without `children` the mark stays centered and no slide+happens. The mark is 20% of the shorter side of the composition (144px at+720p), and the wordmark keeps its own size. Positions come from Remotion's+seeded `random()`, so the same `seed` always renders the same frames.++## Timing++At 30 fps, `speed={1}` and `square` on:++| Frames | Motion |+| --- | --- |+| 0–9 | Pieces launch one every 3 frames and fade in over 3 frames |+| 0–22 | Each piece drifts in for 10 frames with an ease-out, then snaps the last stretch in 3 frames |+| 13, 16, 19, 22 | Contact frames; each throws a spark ring that lasts 8 frames |+| 22–38 | The mark punches from 108% and springs back to full size |+| 24–35 | The mark slides from the center to the left |+| 26–37 | The wordmark wipes in from the left |++With `square={false}` there are three pieces and everything after the last+contact starts 3 frames earlier. The docs preview runs 66 frames. `speed`+scales the timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Wordmark revealed to the right of the assembled mark. Without it the mark settles alone in the center" },+ { name: "square", type: "boolean", default: "true", description: "Include the small square piece; false builds the mark from three pieces" },+ { name: "seed", type: "number", default: "3", description: "Seeds the start angle, distance and spin of each piece" },+ { name: "primaryColor", type: "string", default: '"#E5322D"', description: "Quarter circle and square" },+ { name: "secondaryColor", type: "string", default: '"#FFFFFF"', description: "Dot and wedge" },+ { name: "sparkColor", type: "string", default: '"#FFFFFF"', description: "Spark lines at each contact" },+ { name: "backgroundColor", type: "string", default: '"#111111"', description: "Full-frame background" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/logo-stings/spotlight.mdx b/content/docs/logo-stings/spotlight.mdxnew file mode 100644index 00000000..e4818861--- /dev/null+++ b/content/docs/logo-stings/spotlight.mdx@@ -0,0 +1,69 @@+---+title: Spotlight+description: A soft stage spotlight searches the dark, overshoots, lands on the logo, and the house lights come up+component: spotlight+vibe: premium+length: 50+useWhen:+ - "A launch, keynote or event video should open with a theatrical reveal, the logo waiting in the dark until the light finds it."+ - "Your logo is an image or component you already have, and the sting should light it rather than redraw it."+ - "You want a slower, confident reveal with an obvious landing beat around frame 26."+avoidWhen:+ - "The light should be a horizontal lens streak with a cinematic film feel — use `anamorphic-flare`."+ - "The reveal needs energy and an impact hit rather than a search — use `orbit-lock`."+ - "You need light rays as a looping background bed, not a one-shot reveal — use `shader-god-rays`."+ - "The scene is a product screen on a stage with a moving camera, not a logo — use `stage`."+---++<ComponentPreview name="spotlight" />++<InstallBlock name="spotlight" />++## Usage++`Spotlight` puts your logo on a dark stage, dimmed almost to black. A soft+cone of light hangs from above the top edge with a pool on the floor. It+searches the left side, swings past the logo to the right, then springs back+and lands on center. The logo brightens as the beam covers it, and once the+beam settles the house lights come up: a faint ambient glow fills the stage,+the beam eases off, and the logo holds at full brightness.++```tsx+import { Img, staticFile } from "remotion";+import { Spotlight } from "@/components/remocn/spotlight";++export const LogoSting = () => (+ <Spotlight beamColor="#FFFFFF" stageColor="#111111">+ <Img src={staticFile("logo.svg")} style={{ height: 120 }} />+ </Spotlight>+);+```++`children` are centered in the frame at their own size. Lighting is a CSS+`brightness()` filter on the children, so it works on images, SVG and text+alike, and their colors are never tinted by `beamColor`. The beam is drawn in+one SVG with a Gaussian blur and scales with the composition.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–5 | Beam fades on at the left of the stage |+| 0–12 | Beam searches from 14% to 27% of the width |+| 12–26 | Beam swings across, overshooting the logo to 74% |+| 26–49 | Beam springs back, passes center slightly and settles on the logo |+| 38–50 | House lights: ambient glow comes up, beam drops to 65%, the logo reaches full brightness |++The docs preview runs 80 frames. `speed` scales the timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "ReactNode", description: "Lockup the beam lands on, centered in the frame. Without it a placeholder lockup (a rounded mark and the word remocn) is shown" },+ { name: "dim", type: "number", default: "0.16", description: "Brightness of the unlit lockup, 0 to 1" },+ { name: "beamColor", type: "string", default: '"#FFFFFF"', description: "Light cone, floor pool and ambient glow" },+ { name: "stageColor", type: "string", default: '"#111111"', description: "Full-frame stage behind everything" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/meta.json b/content/docs/meta.jsonindex bfb9bad8..d0949035 100644--- a/content/docs/meta.json+++ b/content/docs/meta.json@@ -18,6 +18,9 @@"templates","effects","motion-graphics",+ "logo-stings",+ "camera",+ "graphic-looks","compositions"]}diff --git a/content/docs/motion-graphics/flow-field.mdx b/content/docs/motion-graphics/flow-field.mdxnew file mode 100644index 00000000..8ba50e06--- /dev/null+++ b/content/docs/motion-graphics/flow-field.mdx@@ -0,0 +1,103 @@+---+title: Flow Field+description: Hundreds of particles ride a seeded, slowly changing vector field and leave fine fading trails, as a seamless loop+component: flow-field+vibe: premium+length: sustained+useWhen:+ - "A title card, quote or hero shot needs a quiet, organic line texture behind it that keeps moving without drawing attention."+ - "A scene about data, AI, networks or motion needs a generative backdrop that feels alive but stays monochrome with a few accent strands."+ - "The background has to loop without a seam for any length of shot."+avoidWhen:+ - "The backdrop should be soft color fields rather than thin lines — use `shader-mesh-gradient`."+ - "The motion should read as clouds or smoke rather than strands — use `shader-perlin-noise`."+ - "The loop should be geometric and rule-based rather than organic — use `pendulum-wave`."+ - "The particles should break up an element and carry the cut — use `particle-dissolve`."+---++<ComponentPreview name="flow-field" />++<InstallBlock name="flow-field" />++## Usage++`FlowField` draws particles that follow a vector field across the frame. The+field angle at each point is a sum of four seeded sine waves, and it shifts+slowly over the loop. Each particle is born at a seeded position, sometimes+just outside the frame, and steps along the field for its life. Its+head moves first and the trail grows behind it; then the head stops and the+tail catches up, so trails grow in and drain out instead of popping. Births+are spread over the life, so the frame always holds a steady population.++Each trail is split into six age segments that get fainter and thinner+toward the tail. A seeded share of particles, `accentRatio`, is drawn in+`accent`.++```tsx+import { FlowField } from "@/components/remocn/flow-field";++export const Texture = () => <FlowField />;+```++The component fills its parent and paints its own `background`. Particle+speed and stroke width scale with the short side of the composition, and+`strokeWidth` is in px at 720p. Positions come from Remotion's seeded+`random()`, so a `seed` always produces the same field and every frame+renders the same way.++## Timing++The field and every particle's life cycle repeat every `loopFrames / speed`+frames, 300 frames (10 seconds) at the defaults. The last frame of the loop+flows into the first without a seam, so a `Sequence` of any multiple of the+period, or a Remotion `<Loop>` of that length, plays as a continuous+background.++A particle lives `loopFrames / round(loopFrames / lifeFrames)` frames, 150+at the defaults, so a whole number of lives fits in one loop. The trail is+capped at 60% of the life: the head travels for `life − trail` frames, then+holds while the tail drains.++There is no build-up: frame 0 already shows a full population.++## Performance++Each frame recomputes every visible trail from the particle's birth, so the+cost grows with `particles × lifeFrames`. The defaults render quickly; 800+particles with 300-frame lives is about five times heavier. Lower+`particles` before lowering `trailLength` if renders get slow.++## Variations++A high `trailLength` with a low `particles` count gives long, sparse strands.+`accentRatio={0}` keeps the field monochrome, and `accentRatio={1}` draws+everything in the accent. Change `seed` for a different field layout.++```tsx+<FlowField+ particles={160}+ trailLength={110}+ strokeWidth={2}+ accentRatio={0.25}+ background="#0b1020"+ color="#9fb4ff"+ accent="#ffffff"+ seed={5}+/>+```++<PropsTable title="Props"+ rows={[+ { name: "particles", type: "number", default: "300", description: "Particles in flight" },+ { name: "trailLength", type: "number", default: "72", description: "Trail length in frames of travel, capped at 60% of the particle life" },+ { name: "loopFrames", type: "number", default: "300", description: "Frames for one seamless loop of the field and the particle life cycles" },+ { name: "lifeFrames", type: "number", default: "150", description: "Particle lifetime in frames, adjusted so a whole number of lives fits in loopFrames" },+ { name: "accentRatio", type: "number", default: "0.1", description: "Share of particles drawn in the accent color, 0 to 1" },+ { name: "strokeWidth", type: "number", default: "1.4", description: "Trail width in px at 720p, at the head; older segments thin to half" },+ { name: "seed", type: "number", default: "1", description: "Seeds the field, the spawn points and which particles take the accent" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Trail color" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Color of the accent share of trails" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; the loop period is loopFrames / speed" },+ ]}+/>diff --git a/content/docs/motion-graphics/index.mdx b/content/docs/motion-graphics/index.mdxindex cc425978..308e0d6e 100644--- a/content/docs/motion-graphics/index.mdx+++ b/content/docs/motion-graphics/index.mdx@@ -45,3 +45,54 @@ Brand-agnostic geometry built the way motion designers build shape layers — dr},]}/>++## Generative Loops++Rule-driven systems that build or run on their own: pendulums, particles, cellular automata, times tables and growth spirals, for backgrounds and openers that keep moving.++<ComponentCardGrid+ items={[+ {+ name: "Pendulum Wave",+ description: "A row of pendulums with tuned periods drifts from a line into waves and braids, then realigns as a seamless loop",+ status: "stable",+ href: "/docs/motion-graphics/pendulum-wave",+ },+ {+ name: "Flow Field",+ description: "Hundreds of particles ride a seeded vector field and leave fine fading trails, as a seamless loop",+ status: "stable",+ href: "/docs/motion-graphics/flow-field",+ },+ {+ name: "Isometric Build",+ description: "An isometric grid springs up row by row into a stepped block sculpture with one accent tower",+ status: "stable",+ href: "/docs/motion-graphics/isometric-build",+ },+ {+ name: "Life Grid",+ description: "Conway's Game of Life on a seeded grid, newborn cells flashing in the accent",+ status: "stable",+ href: "/docs/motion-graphics/life-grid",+ },+ {+ name: "String Art",+ description: "Threads string a ring of pins as a times table, then morph from a cardioid through a nephroid and beyond",+ status: "stable",+ href: "/docs/motion-graphics/string-art",+ },+ {+ name: "Topo Lines",+ description: "Contour lines around seeded peaks breathe and drift, one line picked out in the accent, as a seamless loop",+ status: "stable",+ href: "/docs/motion-graphics/topo-lines",+ },+ {+ name: "Phyllotaxis",+ description: "Seeds spiral out at the golden angle into a sunflower head, then a Fibonacci arm pulses outward",+ status: "stable",+ href: "/docs/motion-graphics/phyllotaxis",+ },+ ]}+/>diff --git a/content/docs/motion-graphics/isometric-build.mdx b/content/docs/motion-graphics/isometric-build.mdxnew file mode 100644index 00000000..69e299d8--- /dev/null+++ b/content/docs/motion-graphics/isometric-build.mdx@@ -0,0 +1,100 @@+---+title: Isometric Build+description: An isometric tile grid springs up row by row into a stepped block sculpture with one accent tower, then holds+component: isometric-build+vibe: tech+length: 38+useWhen:+ - "An opener or section break should build something in about a second, a small city or stack that reads as infrastructure, platform or growth."+ - "A product story about building, scaling or assembling needs a flat, monochrome isometric visual with one highlighted piece."+ - "A beat should end on a still, composed object that can hold under a title or a caption."+avoidWhen:+ - "The stack should come apart to explain layers, with labels — use `exploded-view`."+ - "The blocks should rebuild a logo or pixel art — use `brick-mosaic`."+ - "Blocks should rise across the whole frame and carry the cut into the next scene — use `grid-wave`."+ - "The build should be flat 2D shapes rather than isometric volume — use `bauhaus-build`."+---++<ComponentPreview name="isometric-build" />++<InstallBlock name="isometric-build" />++## Usage++`IsometricBuild` lays out a `grid × grid` floor in true isometric projection+and raises a block on every tile. Block heights follow a mound that peaks in+the middle, with seeded variation, snapped to whole floors so the blocks+stack into one stepped sculpture. One interior tile, chosen by `seed`,+becomes the accent tower, 35% taller than `maxHeight`.++The build runs diagonal by diagonal from the front corner to the back. Each+block fades in and springs up from the floor, overshoots its height by about+12%, and settles. The side faces are the block color shaded toward the+background, and optional floor lines mark each storey.++```tsx+import { IsometricBuild } from "@/components/remocn/isometric-build";++export const Platform = () => <IsometricBuild />;+```++The component fills its parent and paints its own `background`. The diamond+and the tallest tower are fitted into 64% of the width and 80% of the+height, centered, so the object keeps its framing at any aspect ratio. The+spring is driven by the Remotion frame and the layout by the seed, so+renders are deterministic.++## Timing++At 30 fps, `speed={1}` and the defaults (`grid={5}`, `stagger={2}`):++| Frames | Motion |+| --- | --- |+| 0–2 | The front block starts to rise |+| 0–18 | Each diagonal starts `stagger` frames after the one in front, plus up to one `stagger` of seeded jitter |+| 8 | The front block peaks at about 112% of its height |+| ~20 | The front block settles |+| 16–18 | The back corner block starts |+| 38 | The last block settles; the sculpture holds still from here |++Each block's spring settles about 20 frames after it starts. The build ends+at roughly `(2 × (grid − 1) + 1) × stagger + 20` frames, so a larger grid or+stagger lengthens it: `grid={7}` at the default stagger finishes near frame+46. Divide by `speed` for faster builds. The component does not loop; after+the build it holds the finished sculpture for as long as the `Sequence`+runs.++## Variations++`gap` opens the seams between blocks; `gap={0}` merges them into one solid+mass. `floors={false}` drops the storey lines for a cleaner block. Raise+`maxHeight` for a taller skyline, and change `seed` to move the accent tower+and reshuffle the heights.++```tsx+<IsometricBuild+ grid={7}+ maxHeight={3}+ gap={0.1}+ floors={false}+ background="#f1eee7"+ color="#1c1a17"+ accent="#e4572e"+ seed={12}+/>+```++<PropsTable title="Props"+ rows={[+ { name: "grid", type: "number", default: "5", description: "Tiles per side, rounded, minimum 1; below 3 the accent tower takes the back corner tile" },+ { name: "maxHeight", type: "number", default: "2.2", description: "Tallest regular block in tile widths; the accent tower rises to 1.35×" },+ { name: "stagger", type: "number", default: "2", description: "Frames between consecutive diagonals starting to rise" },+ { name: "gap", type: "number", default: "0.04", description: "Gap between neighboring blocks as a share of a tile, clamped to 0–0.45" },+ { name: "floors", type: "boolean", default: "true", description: "Draws floor lines on the side faces" },+ { name: "seed", type: "number", default: "4", description: "Seeds the block heights, the start jitter and the accent tower position" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill; side faces are shaded toward it" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Block color" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Color of the single accent tower" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/motion-graphics/life-grid.mdx b/content/docs/motion-graphics/life-grid.mdxnew file mode 100644index 00000000..01890d38--- /dev/null+++ b/content/docs/motion-graphics/life-grid.mdx@@ -0,0 +1,97 @@+---+title: Life Grid+description: Conway's Game of Life runs on a seeded grid, newborn cells flashing in the accent and dying cells shrinking away+component: life-grid+vibe: tech+length: sustained+useWhen:+ - "A tech, AI or simulation story needs a background that visibly computes, with rule-based structures forming, colliding and dying."+ - "A pixel-grid look should stay alive behind a title for as long as the shot runs, without a visible loop point."+ - "A scene about emergence, growth or systems needs a literal, recognisable reference."+avoidWhen:+ - "The grid should be a pattern that resolves into a clean structure — use `truchet-flip`."+ - "The cells should rebuild a specific logo or image — use `brick-mosaic`."+ - "The motion should feel organic and continuous rather than stepped — use `flow-field`."+ - "Text should resolve out of scrambled characters — use `matrix-decode`."+---++<ComponentPreview name="life-grid" />++<InstallBlock name="life-grid" />++## Usage++`LifeGrid` plays Conway's Game of Life. A seeded first generation fills a+`density` share of the cells, and every next generation follows the standard+rules: a live cell with two or three live neighbors survives, and an empty+cell with exactly three is born. The board wraps at the edges, so patterns+leave one side and come back on the other, and the border never runs dry.++The step between generations is animated. A newborn cell pops in as an+accent tile with a small overshoot, then a tile in `color` grows from its+center and covers it. A dying cell shrinks to nothing in the first 60% of the+step. Surviving cells hold still. A faint lattice marks the empty cells.++```tsx+import { LifeGrid } from "@/components/remocn/life-grid";++export const Simulation = () => <LifeGrid />;+```++The component fills its parent and paints its own `background`. `cols` sets+the number of columns, the row count follows the composition aspect ratio,+and the square board is centered. Generations are computed once per seed,+grid size and density and cached for the render, so every frame is+deterministic and cheap after the first.++## Timing++At 30 fps, `speed={1}` and `framesPerGeneration={5}`:++| Frames | Motion |+| --- | --- |+| 0–5 | The seeded first generation holds still |+| 5 | Generation 1 begins: newborns pop in as accent tiles, dying cells start to shrink |+| 5–8 | Dying cells shrink away |+| 7–10 | The core of each newborn grows over its accent tile |+| every 5 frames | The next generation starts |++The simulation runs for as long as the composition: it precomputes+`durationInFrames × speed / framesPerGeneration` generations. It has no loop+point. Over a long run the board can settle into still lifes and blinkers;+try another `seed` or a higher `density` if a seed calms down too early.++## Variations++Fewer `cols` gives big, readable cells; more gives a fine texture.+`framesPerGeneration` slows the simulation for a calmer bed; at 1 the board+churns every frame. `showGrid={false}` removes the lattice, and `gap={0}`+merges neighboring cells into solid shapes.++```tsx+<LifeGrid+ cols={24}+ density={0.3}+ framesPerGeneration={8}+ gap={0.08}+ showGrid={false}+ background="#f6f5f1"+ color="#171717"+ accent="#2f6bff"+/>+```++<PropsTable title="Props"+ rows={[+ { name: "cols", type: "number", default: "48", description: "Columns, rounded, minimum 4; rows follow the frame aspect ratio" },+ { name: "density", type: "number", default: "0.24", description: "Share of cells alive in the seeded first generation, 0 to 1" },+ { name: "framesPerGeneration", type: "number", default: "5", description: "Frames each generation is held, minimum 1" },+ { name: "gap", type: "number", default: "0.16", description: "Gap between tiles as a fraction of the cell" },+ { name: "showGrid", type: "boolean", default: "true", description: "Draws the faint lattice of empty cells" },+ { name: "seed", type: "number", default: "7", description: "Seeds the first generation" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Living cells and the lattice" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Flash color of newborn cells" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; 0 holds the first generation" },+ ]}+/>diff --git a/content/docs/motion-graphics/meta.json b/content/docs/motion-graphics/meta.jsonindex 732f938d..8ad69acc 100644--- a/content/docs/motion-graphics/meta.json+++ b/content/docs/motion-graphics/meta.json@@ -8,7 +8,14 @@"truchet-flip","trim-burst","speed-lines",- "squiggle"+ "squiggle",+ "pendulum-wave",+ "flow-field",+ "isometric-build",+ "life-grid",+ "string-art",+ "topo-lines",+ "phyllotaxis"],"icon": "GeometricShapes01Icon"}diff --git a/content/docs/motion-graphics/pendulum-wave.mdx b/content/docs/motion-graphics/pendulum-wave.mdxnew file mode 100644index 00000000..284c52c1--- /dev/null+++ b/content/docs/motion-graphics/pendulum-wave.mdx@@ -0,0 +1,99 @@+---+title: Pendulum Wave+description: A row of pendulums with tuned periods drifts from a straight line into travelling waves and braids, then realigns, as a seamless loop+component: pendulum-wave+vibe: clean+length: sustained+useWhen:+ - "A scene needs a calm, hypnotic background loop that is clearly rule-based, with order dissolving into waves and snapping back into a line."+ - "A section about timing, rhythm, sync or periodic systems needs a visual that literally shows phases drifting apart and realigning."+ - "The loop has to repeat without a seam for as long as the shot lasts, at a known period."+avoidWhen:+ - "The loop should be a dense, organic texture rather than a row of distinct objects — use `flow-field`."+ - "The scene needs a one-shot accent that fires and clears rather than a running loop — use `trim-burst`."+ - "The background should be soft color rather than drawn geometry — use `shader-mesh-gradient`."+ - "The rhythm should read as a structure that builds and settles — use `truchet-flip`."+---++<ComponentPreview name="pendulum-wave" />++<InstallBlock name="pendulum-wave" />++## Usage++`PendulumWave` is the classic pendulum wave demo seen from the side. A row of+bobs swings up and down along vertical tracks. Pendulum `i` makes+`cycles + i` full swings per loop, so each one is slightly faster than its+left neighbor. At frame 0 every bob sits at the top of its track. The row+then slides into a travelling wave, breaks into braids and two- and+three-row patterns, and lines up again at the top on the last frame of the+loop.++A red line threads through the bobs as a smooth curve, so the wave reads as+one shape. Each bob leaves a faint smear of its last four frames, and bobs+low on the track are drawn up to 22% larger than bobs at the top, a small+depth cue. The faint guides are a center line, a dotted track per pendulum+and a tick at each end of every track.++```tsx+import { PendulumWave } from "@/components/remocn/pendulum-wave";++export const RhythmBed = () => <PendulumWave />;+```++The component fills its parent and paints its own `background`. The row+spans the middle 80% of the width and the bobs travel 30% of the height above+and below the center line. Strokes and bob sizes scale with the composition,+so 16:9, 1:1 and 9:16 look alike. Every frame is computed directly from the+Remotion frame, so seeking and rendering are deterministic.++## Timing++At 30 fps, `speed={1}` and the defaults (`cycles={10}`, `loopFrames={450}`):++| Frames | Motion |+| --- | --- |+| 0 | All 15 bobs line up at the top of their tracks |+| 0–90 | The line peels into a travelling wave, fastest bobs on the right |+| 90–220 | The wave tightens into braids and short-lived row patterns |+| 112 | Bobs repeat in groups of four: top, center, bottom, center |+| 225 | Bobs alternate top and bottom in a two-row zigzag |+| 225–450 | The sequence plays back in mirror order |+| 450 | All bobs line up at the top again, identical to frame 0 |++The loop period is `loopFrames / speed` frames: 450 frames, 15 seconds, at+the defaults. At `loopFrames / k` the bobs repeat in groups of `k` along the+row, so the patterns land on predictable frames. The loop closes exactly only when `cycles` is a+whole number. For a seamless background, make the `Sequence` a multiple of+the period, or wrap the component in a Remotion `<Loop>` of that length.++```tsx+import { Loop } from "remotion";+import { PendulumWave } from "@/components/remocn/pendulum-wave";++export const Background = () => (+ <Loop durationInFrames={300}>+ <PendulumWave count={21} cycles={8} loopFrames={300} showGuides={false} />+ </Loop>+);+```++## Variations++Raise `count` for a denser, faster-braiding row. Lower `cycles` for slower+swings; the difference between neighbors stays one swing per loop, so the+patterns keep the same timing. `showGuides={false}` leaves only the bobs and+the wave line. Set `accent` to `background` to hide the line.++<PropsTable title="Props"+ rows={[+ { name: "count", type: "number", default: "15", description: "Number of pendulums, rounded, minimum 2" },+ { name: "cycles", type: "number", default: "10", description: "Full swings of the slowest pendulum per loop; pendulum i makes cycles + i. Use a whole number for a seamless loop" },+ { name: "loopFrames", type: "number", default: "450", description: "Frames until every pendulum realigns at the top" },+ { name: "showGuides", type: "boolean", default: "true", description: "Draws the center line, dotted tracks and end ticks" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Bobs, smears and guides" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "The wave line threaded through the bobs" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; the loop period is loopFrames / speed" },+ ]}+/>diff --git a/content/docs/motion-graphics/phyllotaxis.mdx b/content/docs/motion-graphics/phyllotaxis.mdxnew file mode 100644index 00000000..824b7d83--- /dev/null+++ b/content/docs/motion-graphics/phyllotaxis.mdx@@ -0,0 +1,102 @@+---+title: Phyllotaxis+description: Seeds spiral out at the golden angle into a sunflower head, then one Fibonacci arm turns accent and pulses outward while the head slowly turns+component: phyllotaxis+vibe: clean+length: 74+useWhen:+ - "An opener or section break should grow something natural and precise in about two seconds, then keep a gentle idle motion."+ - "A story about growth, nature, design systems or the golden ratio needs a literal, recognisable pattern."+ - "One element of many needs to be singled out, with the accent arm drawing the eye along a spiral path."+avoidWhen:+ - "The figure should be built from straight threads and morph between shapes — use `string-art`."+ - "The dots should orbit on concentric rings as a shader background — use `shader-dot-orbit`."+ - "The moment calls for a one-shot burst that clears the frame — use `radial-burst`."+ - "The scene needs a texture with no focal point — use `flow-field`."+---++<ComponentPreview name="phyllotaxis" />++<InstallBlock name="phyllotaxis" />++## Usage++`Phyllotaxis` places seeds the way a sunflower head does: seed `i` sits at+`i × 137.508°`, the golden angle, at a radius proportional to `√i`. The+seeds pop in from the center outward, each with a small overshoot, and the+outer ones are drawn a little larger.++When the head is grown, every `arm`-th seed turns `accent` and swells+slightly, and a faint accent line connects them. With a Fibonacci number+these seeds line up into one spiral arm. Then a soft pulse travels outward+along the arm again and again, swelling each seed as it passes. The whole+head turns slowly the entire time.++```tsx+import { Phyllotaxis } from "@/components/remocn/phyllotaxis";++export const Growth = () => <Phyllotaxis />;+```++The component fills its parent and paints its own `background`. The head is+centered and its outer edge sits at 44% of the short side, so it keeps its+framing at any aspect ratio. Everything comes from the Remotion frame, so+renders are deterministic.++## Timing++At 30 fps, `speed={1}` and the defaults:++| Frames | Motion |+| --- | --- |+| 0–70 | Seeds pop in from the center outward; seed `i` starts at `growFrames × √(i / count)` and pops over 10 frames |+| 60–74 | The arm seeds turn accent, swell by 25% and the spine line fades in |+| 70–115 | The first pulse travels from the center to the rim |+| every 45 frames | The next pulse starts |+| 0 onward | The head turns at `rotation` degrees per second |++The square-root schedule moves the reveal front outward at a steady radial+speed, so the dense center does not flash in at once. The build is complete+at `growFrames + 14` frames, 74 at the defaults; after+that the pulse repeats every `pulseFrames` frames for as long as the+`Sequence` runs. The docs preview shows two pulses, 165 frames. Divide by+`speed` for faster playback; `rotation` is in degrees per second and scales+with `speed` as well.++The pulse cycle is seamless on its own. With the default `rotation` the head+keeps turning, so the idle never repeats exactly; set `rotation={0}` for a+loop of `pulseFrames` frames after frame 70.++## Variations++`arm` picks which seeds form the accent spiral. Fibonacci numbers (8, 13, 21,+34, 55) give a clean spiral arm; other values give curved spokes or scattered+dots. Lower `count` and raise `size` for a bold, graphic head with few+seeds.++```tsx+<Phyllotaxis+ count={180}+ size={1.4}+ arm={13}+ rotation={-6}+ background="#f6f1e7"+ color="#3d2c1e"+ accent="#e09f3e"+/>+```++<PropsTable title="Props"+ rows={[+ { name: "count", type: "number", default: "420", description: "Number of seeds, rounded, minimum 1" },+ { name: "size", type: "number", default: "1", description: "Seed size multiplier" },+ { name: "growFrames", type: "number", default: "60", description: "Frames until the last seed starts to pop in" },+ { name: "pulseFrames", type: "number", default: "45", description: "Frames per pulse along the accent arm once grown" },+ { name: "arm", type: "number", default: "21", description: "Every n-th seed forms the accent arm; a Fibonacci number reads as one spiral" },+ { name: "rotation", type: "number", default: "4", description: "Rotation of the head in degrees per second; 0 holds still, negative turns the other way" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Seed color" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Arm seeds and spine line" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/motion-graphics/string-art.mdx b/content/docs/motion-graphics/string-art.mdxnew file mode 100644index 00000000..6a7588bb--- /dev/null+++ b/content/docs/motion-graphics/string-art.mdx@@ -0,0 +1,114 @@+---+title: String Art+description: Threads are strung around a ring of pins as a times table, then the multiplier morphs the figure from a cardioid through a nephroid and beyond+component: string-art+vibe: tech+length: 288+useWhen:+ - "A math, algorithm or engineering story needs a precise generative figure that builds itself and then transforms."+ - "An intro or section break should draw something intricate from simple rules, with a readable label that shows the rule."+ - "A background needs fine linework that keeps a slow accent sweep running after the figure lands."+avoidWhen:+ - "The figure should be a natural spiral of dots rather than straight threads — use `phyllotaxis`."+ - "The scene needs a looping background with no build-up — use `flow-field`."+ - "The linework should look like a technical drawing of a product — use `blueprint`."+ - "The data is real and should be read as a chart — use `animated-line-chart`."+---++<ComponentPreview name="string-art" />++<InstallBlock name="string-art" />++## Usage++`StringArt` draws a modular times table. `pins` points sit on a ring, and a+thread runs from every pin `i` to pin `k × i`, wrapping around the ring. For+`k = 2` the threads envelope a cardioid, for `k = 3` a nephroid, and for+`k = 4` a three-cusp epicycloid. Pin 0 sits on the left, so the figures are+symmetric about the horizontal axis.++The pins fade in first. Then the threads are strung one pin after another,+each growing from its pin to its target. After a short pause the multiplier+walks from `from` to `to` one whole step at a time: each step eases through+the in-between tables, which morph smoothly, and then holds on the clean+figure. A short band of threads in `accent` rides along the stringing head+and keeps circling the ring after the figure lands. A monospaced label in+the corner shows the running rule, `i → k · i mod pins`.++```tsx+import { StringArt } from "@/components/remocn/string-art";++export const TimesTable = () => <StringArt />;+```++The component fills its parent and paints its own `background`. The ring+radius is 42% of the short side, centered, and strokes scale with the+composition. All geometry comes from the Remotion frame, so renders are+deterministic.++## Timing++At 30 fps, `speed={1}` and the defaults (`from={2}`, `to={4}`):++| Frames | Motion |+| --- | --- |+| 0–12 | The pins fade in |+| 0–60 | Threads are strung one pin after another, easing in and out, into a cardioid |+| 50–66 | The label fades in |+| 60–84 | The cardioid holds |+| 84–168 | The multiplier eases from 2 to 3; the figure morphs into a nephroid |+| 168–204 | The nephroid holds |+| 204–288 | The multiplier eases from 3 to 4 |+| 288 | The three-cusp figure lands and holds |+| 60 onward | The accent band circles the ring at 0.9 pins per frame, a lap every 222 frames |++`stringFrames` sets the stringing time and `morphFrames` the whole morph.+The morph starts 24 frames after the stringing ends and is divided into one+equal share per whole step between `from` and `to`. Each share spends 70%+easing and 30% holding. The figure stops changing at+`stringFrames + 24 + morphFrames − 0.3 × share` frames, 288 at the defaults,+and the docs preview adds a short hold at 340. Divide by `speed` for faster+playback. Only the accent band keeps moving after that; set `sweep={0}` for+a fully still end frame.++If `to − from` is not a whole number, the holds land on equal fractions of+the span rather than on whole multipliers.++## Variations++`from={1}` starts from the empty table and grows the cardioid out of+nothing. Higher multipliers give more cusps: `to={6}` ends on a five-cusp+figure. Fewer `pins` show individual threads; more give a solid envelope.+`showLabel={false}` drops the corner label.++```tsx+<StringArt+ pins={300}+ from={3}+ to={6}+ morphFrames={360}+ threadOpacity={0.3}+ showLabel={false}+ background="#0b1020"+ color="#c9d4ff"+ accent="#ffd166"+/>+```++<PropsTable title="Props"+ rows={[+ { name: "pins", type: "number", default: "200", description: "Pins around the ring, rounded, minimum 8" },+ { name: "from", type: "number", default: "2", description: "Multiplier at the start; 2 draws a cardioid" },+ { name: "to", type: "number", default: "4", description: "Multiplier at the end; 3 is a nephroid, 4 a three-cusp epicycloid" },+ { name: "stringFrames", type: "number", default: "60", description: "Frames for the threads to be strung, one pin after another" },+ { name: "morphFrames", type: "number", default: "240", description: "Frames for the multiplier to walk from from to to, holds included" },+ { name: "sweep", type: "number", default: "0.08", description: "Length of the accent band as a share of all threads; 0 disables it" },+ { name: "sweepSpeed", type: "number", default: "0.9", description: "Pins per frame the accent band travels once the threads are strung" },+ { name: "threadOpacity", type: "number", default: "0.42", description: "Thread opacity, 0 to 1" },+ { name: "showLabel", type: "boolean", default: "true", description: "Shows the running multiplier in the bottom-left corner" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Threads, pins and label text" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Accent band and the arrow in the label" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/motion-graphics/topo-lines.mdx b/content/docs/motion-graphics/topo-lines.mdxnew file mode 100644index 00000000..bde3c0b1--- /dev/null+++ b/content/docs/motion-graphics/topo-lines.mdx@@ -0,0 +1,103 @@+---+title: Topo Lines+description: Topographic contour lines around a few seeded peaks breathe and drift, with index contours and one line picked out in the accent, as a seamless loop+component: topo-lines+vibe: clean+length: sustained+useWhen:+ - "A title, quote or section card needs a quiet line texture behind it that moves slowly enough to read over."+ - "A story about terrain, exploration, maps, depth or data layers needs a survey-map look."+ - "The background has to loop without a seam for any length of shot, in any brand color."+avoidWhen:+ - "The backdrop should be flowing strands rather than closed contours — use `flow-field`."+ - "The layers should read as horizontal sediment rather than a map — use `shader-strata`."+ - "The background should be soft color with no lines — use `shader-mesh-gradient`."+ - "The scene needs a rule-based geometric loop with distinct objects — use `pendulum-wave`."+---++<ComponentPreview name="topo-lines" />++<InstallBlock name="topo-lines" />++## Usage++`TopoLines` draws the contour map of a seeded height field. The terrain is a+few cone-shaped peaks spread around the center, blended so they share outer+rings without creases, plus a little low ripple. Contours are evenly spaced+like a survey map. Every few contours an index line is drawn heavier, and+one contour is picked out in `accent`.++The terrain moves slowly. Each peak drifts on a small orbit, swells and+shrinks by about 5%, and its outline rotates through gentle two- and+three-lobed bulges. The rings tighten, merge, and pull apart, and after one+loop the field is back where it started.++```tsx+import { TopoLines } from "@/components/remocn/topo-lines";++export const MapBed = () => <TopoLines />;+```++The component fills its parent and paints its own `background`. The terrain+is laid out in units of the short side, so the peaks keep their shape at+16:9, 1:1 and 9:16, and line widths are in px at 720p. The contours are+traced with marching squares on a sampling grid each frame; everything comes+from the Remotion frame and the seed, so renders are deterministic.++## Timing++The terrain repeats every `loopFrames / speed` frames, 300 frames (10+seconds) at the defaults. The last frame flows into the first without a+seam, so a `Sequence` of any multiple of the period, or a Remotion `<Loop>`+of that length, plays as a continuous background. There is no build-up:+frame 0 already shows the full map.++## Performance++`resolution` is the number of sampling cells across the short side. The+default of 90 samples about 14,600 points per frame at 16:9; doubling it+quadruples the work. Lower it for drafts, raise it only if contours look+faceted at a large output size.++## Contours++`levels` contours are spread evenly over the same fixed height range, so+more levels means tighter spacing. They are counted from 0 at the lowest. `highlight` picks the accent contour+by that count, and `-1` turns it off. `indexEvery={4}` makes every fourth+contour an index line; `0` turns index lines off. The accent wins when both+apply to the same contour.++## Variations++`peaks={1}` gives a single hill of nested rings; three reads best as a+landscape. More `levels` tighten the spacing for a busier map.++```tsx+<TopoLines+ levels={24}+ peaks={2}+ highlight={14}+ indexEvery={5}+ loopFrames={450}+ background="#f1eee7"+ color="#3b3a36"+ accent="#d97757"+ seed={6}+/>+```++<PropsTable title="Props"+ rows={[+ { name: "levels", type: "number", default: "16", description: "Number of contours, rounded, minimum 1" },+ { name: "peaks", type: "number", default: "3", description: "Peaks in the height field, rounded; 1 to 3 reads best" },+ { name: "highlight", type: "number", default: "9", description: "Contour drawn in the accent, counted from 0 at the lowest; -1 disables it" },+ { name: "indexEvery", type: "number", default: "4", description: "Every n-th contour is a heavier index line; 0 disables them" },+ { name: "resolution", type: "number", default: "90", description: "Sampling cells across the short side, minimum 20; higher is smoother and slower" },+ { name: "loopFrames", type: "number", default: "300", description: "Frames per seamless loop of the terrain" },+ { name: "seed", type: "number", default: "2", description: "Seeds the peak layout, their motion and the ripples" },+ { name: "background", type: "string", default: '"#111111"', description: "Background fill" },+ { name: "color", type: "string", default: '"#FFFFFF"', description: "Contour and index line color" },+ { name: "accent", type: "string", default: '"#E5322D"', description: "Color of the highlighted contour" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier; the loop period is loopFrames / speed" },+ ]}+/>diff --git a/content/docs/social/logo-enter.mdx b/content/docs/social/logo-enter.mdxindex 9d45aacb..9786912b 100644--- a/content/docs/social/logo-enter.mdx+++ b/content/docs/social/logo-enter.mdx@@ -9,7 +9,7 @@ useWhen:- "A positioning or proof beat needs several marks to land as a stacked, overlapping group."- "You want logo chips that spring in and hold, with the exit owned by your `TransitionSeries` transition."avoidWhen:- - "You need a single product wordmark lockup — this is a multi-chip cluster, not one mark; build a lightweight lockup or resolve kinetic text (`kinetic-center-build`, `per-character-rise`) into the name."+ - "You need a single product logo or wordmark lockup — this is a multi-chip cluster, not one mark; use a logo sting (`orbit-lock`, `spotlight`, `anamorphic-flare`) or resolve kinetic text (`kinetic-center-build`, `per-character-rise`) into the name."- "You're depicting one specific brand's product UI — use the matching card (`chat-gpt`, `claude-code`, `v0`, `opencode`)."- "The logos must orbit or scatter in 3D rather than stack — compose your own layout; this one stacks on a single axis."---diff --git a/content/docs/transitions/hyperspace.mdx b/content/docs/transitions/hyperspace.mdxnew file mode 100644index 00000000..4814dab8--- /dev/null+++ b/content/docs/transitions/hyperspace.mdx@@ -0,0 +1,112 @@+---+title: Hyperspace+description: Stretch a starfield into radial streaks, tunnel forward through the scene and land on the next one through a white flash+component: hyperspace+vibe: tech+length: 56+useWhen:+ - "A launch, release or \"what's next\" moment should feel like a jump to somewhere new."+ - "The video is tech or sci-fi flavored and can carry a big, showy transition once."+ - "You want a long build-up into the cut: the stars spool up for most of the transition before the flash."+avoidWhen:+ - "The cut needs to be quick: the jump takes 56 frames to read; use `zoom-blur` or `whip-pan`."+ - "You want a spiral or shader tunnel instead of streaking stars; use `shader-spiral-pass`."+ - "The video is calm or editorial; use `fade-through` or `focus-pull`."+---++<ComponentPreview name="hyperspace" />++<InstallBlock name="hyperspace" />++## Usage++`hyperspace()` is a Remotion transition presentation. Pass it to a+`TransitionSeries.Transition` between two sequences. A starfield fades in over+the outgoing scene, which dims and pushes forward. The stars drift slowly, then+surge outward from the center as their streaks stretch with speed, and the+frame ramps to `flashColor` at 62% of the transition. The incoming scene lands+under the flash: the flash holds for a beat and dissolves while the scene eases+out of a slight zoom and blur, with a few streaks still coasting past.++The star layout is deterministic. Each scene renders once; the stars are one SVG+with up to `stars` lines, and the arrival adds a CSS blur for its first frames.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { hyperspace } from "@/components/remocn/hyperspace";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={90}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 56 })}+ presentation={hyperspace()}+ />+ <TransitionSeries.Sequence durationInFrames={90}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);+```++## Timing++| Progress | What happens |+| --- | --- |+| 0 to 0.62 | Stars fade in and spool up, the scene dims and pushes forward |+| 0.45 to 0.62 | Flash ramps up to full |+| 0.62 | Cut to the incoming scene under the flash |+| 0.62 to 1 | Flash dissolves, the scene settles out of zoom and blur |++## Variations++- `flash: false` swaps the white-out for a hard cut through the streaks at 62%.+- `accentRatio: 0` keeps every streak in `streakColor`; raise it to tint more stars with `accentColor`.+- Fewer `stars` (80 to 120) gives a sparser, calmer jump.++## Props++`hyperspace(props)` accepts:++<PropsTable+ rows={[+ {+ name: "stars",+ type: "number",+ default: "260",+ description: "Number of stars in the field.",+ },+ {+ name: "streakColor",+ type: "string",+ default: '"#FFFFFF"',+ description: "Main streak color.",+ },+ {+ name: "accentColor",+ type: "string",+ default: '"#E5322D"',+ description: "Color of the occasional tinted streak.",+ },+ {+ name: "accentRatio",+ type: "number",+ default: "0.14",+ description: "Share of stars drawn in accentColor, 0 to 1.",+ },+ {+ name: "flash",+ type: "boolean",+ default: "true",+ description: "Flash at the cut. false gives a hard cut through the streaks.",+ },+ {+ name: "flashColor",+ type: "string",+ default: '"#FFFFFF"',+ description: "Flash color.",+ },+ ]}+/>diff --git a/content/docs/transitions/index.mdx b/content/docs/transitions/index.mdxindex 0d2af7d1..5bf14f87 100644--- a/content/docs/transitions/index.mdx+++ b/content/docs/transitions/index.mdx@@ -134,6 +134,51 @@ Kinetic, interface-flavored transitions — typed wipes, scattering icons, and m]}/>+## Graphic Cuts++Bold, showy cuts built from plain CSS and SVG: shapes, slats, torn paper, streaks and light. No dependencies beyond Remotion.++<ComponentCardGrid+ items={[+ {+ name: "IrisWipe",+ description: "Close a cartoon iris on the subject, hold it as a dot, then open it on the next scene",+ status: "stable",+ href: "/docs/transitions/iris-wipe",+ },+ {+ name: "VenetianBlinds",+ description: "Turn the outgoing scene edge-on in staggered horizontal slats to reveal the next one",+ status: "stable",+ href: "/docs/transitions/venetian-blinds",+ },+ {+ name: "PaperTear",+ description: "Rip the frame down the middle and fling both torn halves apart on impact",+ status: "stable",+ href: "/docs/transitions/paper-tear",+ },+ {+ name: "PixelSort",+ description: "Melt the scene into glowing vertical streaks and drop the next one in column by column",+ status: "stable",+ href: "/docs/transitions/pixel-sort",+ },+ {+ name: "LightLeak",+ description: "Drift a warm analog light leak across the frame and hard-cut under its blow-out",+ status: "stable",+ href: "/docs/transitions/light-leak",+ },+ {+ name: "Hyperspace",+ description: "Stretch a starfield into streaks, tunnel forward and land on the next scene through a flash",+ status: "stable",+ href: "/docs/transitions/hyperspace",+ },+ ]}+/>+## CanvasPixel-level transitions. These read the actual pixels of both scenes through the experimental html-in-canvas browser API and post-process them per frame, which is what makes tearing, burning, and shattering possible at all. Chrome 149+ behind `chrome://flags/#canvas-draw-element` shows the real effect; every other browser degrades to a CSS approximation of the same edit, so previews and renders never break.diff --git a/content/docs/transitions/iris-wipe.mdx b/content/docs/transitions/iris-wipe.mdxnew file mode 100644index 00000000..d0c02301--- /dev/null+++ b/content/docs/transitions/iris-wipe.mdx@@ -0,0 +1,92 @@+---+title: Iris Wipe+description: Close a cartoon iris on the subject, hold it as a dot for a beat, then open it on the next scene+component: iris-wipe+vibe: playful+length: 36+useWhen:+ - "You want an old-cartoon \"that's all\" beat: the iris closes on a subject, lingers, and reopens somewhere new."+ - "The outgoing scene has a clear focal point you can aim the iris at with centerX and centerY."+ - "A chapter or section break needs a playful full stop rather than a seamless cut."+avoidWhen:+ - "The tone is serious or premium: the iris reads as a gag; use `fade-through` or `focus-pull`."+ - "The cut should feel fast and kinetic: the iris spends half its length closing; use `whip-pan`."+ - "You want the next scene to grow out of a shape with texture rather than a clean circle; use `smoke-dissolve`."+---++<ComponentPreview name="iris-wipe" />++<InstallBlock name="iris-wipe" />++## Usage++`irisWipe()` is a Remotion transition presentation. Pass it to a+`TransitionSeries.Transition` between two sequences. The first half of the+transition closes a circle on the outgoing scene: it rushes in from outside the+frame, slows into a small dot of `holdRadius`, then snaps shut. Everything+outside the circle is filled with `color`. The second half opens a circle on the+incoming scene from the same center. The closing radius follows one continuous+curve, so the iris never fully stops between the rush and the hold.++Both scenes render once per frame, so it is as cheap as a transition gets.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { irisWipe } from "@/components/remocn/iris-wipe";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 36 })}+ presentation={irisWipe({ centerX: 0.62, centerY: 0.4 })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);+```++## Timing++| Progress | What happens |+| --- | --- |+| 0 to 0.5 | Iris closes on the outgoing scene, lingers as a dot, snaps shut |+| 0.5 | Frame is fully `color` |+| 0.5 to 1 | Iris opens on the incoming scene from the same center |++## Props++`irisWipe(props)` accepts:++<PropsTable+ rows={[+ {+ name: "color",+ type: "string",+ default: '"#000000"',+ description: "Fill shown outside the iris while it is closed.",+ },+ {+ name: "centerX",+ type: "number",+ default: "0.5",+ description: "Horizontal iris center, 0 (left) to 1 (right).",+ },+ {+ name: "centerY",+ type: "number",+ default: "0.5",+ description: "Vertical iris center, 0 (top) to 1 (bottom).",+ },+ {+ name: "holdRadius",+ type: "number",+ default: "12",+ description: "Radius of the held dot, in CSS circle() percent of the frame (150 covers the whole frame). 0 skips the hold and closes straight down.",+ },+ ]}+/>diff --git a/content/docs/transitions/light-leak.mdx b/content/docs/transitions/light-leak.mdxnew file mode 100644index 00000000..f97f6c15--- /dev/null+++ b/content/docs/transitions/light-leak.mdx@@ -0,0 +1,89 @@+---+title: Light Leak+description: Drift a warm analog light leak across the frame, blow it out at the cut and cool off on the next scene+component: light-leak+vibe: premium+length: 20+useWhen:+ - "The video has a film, lifestyle or nostalgic look and the cut should feel like light hitting the negative."+ - "You want a warm, soft cut between two scenes that otherwise would hard-cut, such as a montage of shots."+ - "The palette can be tuned to the brand: the leak takes any list of colors."+avoidWhen:+ - "The video is a crisp UI or data piece where a warm burn looks out of place; use `fade-through`."+ - "You want the cut to feel like a camera move rather than light; use `whip-pan`."+ - "The scenes are both very bright: the blow-out loses contrast; use `focus-pull`."+---++<ComponentPreview name="light-leak" />++<InstallBlock name="light-leak" />++## Usage++`lightLeak()` is a Remotion transition presentation. Pass it to a+`TransitionSeries.Transition` between two sequences. A set of soft colored+flares drifts in from the `origin` edge and screen-blends over the picture+while the scene brightens. At the midpoint the frame peaks close to the last+color in `colors` and the scenes hard-cut underneath that blow-out. The leak+then keeps drifting across and cools off on the incoming scene.++Both scenes render once per frame. The cut is hidden by the blow-out, so it+works best short: 16 to 24 frames.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { lightLeak } from "@/components/remocn/light-leak";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 20 })}+ presentation={lightLeak({ origin: "right" })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);+```++## Colors++`colors` is a list, warmest first. The flares cycle through every color except+the last, and the last one is the blow-out tint the frame flashes to at the+cut. A single color is used for both the flares and the blow-out, and an empty+list falls back to the default palette.++```tsx+lightLeak({ colors: ["#7C3AED", "#2563EB", "#22D3EE", "#F0F9FF"] });+```++## Props++`lightLeak(props)` accepts:++<PropsTable+ rows={[+ {+ name: "colors",+ type: "string[]",+ default: '["#FF5A1F", "#E5322D", "#FFB347", "#FFF3E0"]',+ description: "Leak colors, warmest first. The last one is the blow-out tint.",+ },+ {+ name: "origin",+ type: '"left" | "right" | "top" | "bottom"',+ default: '"left"',+ description: "Edge the leak drifts in from.",+ },+ {+ name: "intensity",+ type: "number",+ default: "1",+ description: "Strength of the leak, the brightening and the blow-out, 0 to 1.",+ },+ ]}+/>diff --git a/content/docs/transitions/meta.json b/content/docs/transitions/meta.jsonindex 18f8fd86..0e20e434 100644--- a/content/docs/transitions/meta.json+++ b/content/docs/transitions/meta.json@@ -28,7 +28,13 @@"grid-wave","displacement","slide-swap",- "spring-settle"+ "spring-settle",+ "iris-wipe",+ "venetian-blinds",+ "paper-tear",+ "pixel-sort",+ "light-leak",+ "hyperspace"],"icon": "TransitionRightIcon"}diff --git a/content/docs/transitions/paper-tear.mdx b/content/docs/transitions/paper-tear.mdxnew file mode 100644index 00000000..d2514233--- /dev/null+++ b/content/docs/transitions/paper-tear.mdx@@ -0,0 +1,111 @@+---+title: Paper Tear+description: Rip the frame down the middle and fling both halves apart with fibrous torn edges, revealing the scene underneath+component: paper-tear+vibe: paper+length: 36+useWhen:+ - "A reveal should land as a physical hit: a product, a headline or a price punching through the old scene."+ - "The video already uses a paper or collage look and the cut should stay in that material."+ - "One big moment in the video deserves an impact; the shake, flash and debris sell it."+avoidWhen:+ - "The cut is routine and repeats often: the impact gets old fast; use `fade-through` or `whip-pan`."+ - "You want the old scene to destroy itself more slowly and organically; use `ember-burn`."+ - "The page should turn over rather than tear; use `page-turn`."+---++<ComponentPreview name="paper-tear" />++<InstallBlock name="paper-tear" />++## Usage++`paperTear()` is a Remotion transition presentation. Pass it to a+`TransitionSeries.Transition` between two sequences. The outgoing scene behaves+like a printed sheet: it trembles and leans toward camera, then a jagged rip+runs from top to bottom in a couple of frames. At the moment the rip completes+the camera jolts, a flash runs along the seam and paper scraps blow out of it.+Both halves then spring apart, pivoting on the frame edges so their torn sides+swing toward camera. Each half has a fibrous `edgeColor` border and casts a+shadow on the incoming scene, which is punched toward camera and settles back.++The rip shape comes from `seed` and `roughness` and is fully deterministic, so+the same seed always tears the same way.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { paperTear } from "@/components/remocn/paper-tear";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 36 })}+ presentation={paperTear({ seed: 3, roughness: 0.7 })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);+```++The outgoing scene is rendered up to three times per frame (two torn halves+plus an intact copy below the running rip), so it costs more than a plain+wipe.++## Timing++| Progress | What happens |+| --- | --- |+| 0 to 0.2 | The sheet strains: tremble and a slight lean toward camera |+| 0.2 to 0.28 | The rip runs from top to bottom |+| 0.28 | Impact: shake, seam flash, debris |+| 0.28 to 1 | The halves spring apart, the incoming scene settles |++## Variations++- `impact: 0` turns off the shake, flash and debris for a quiet tear.+- `impact: 2` doubles the shake and debris travel for a louder hit.+- `roughness: 0` gives a smooth wavy rip, `1` a ragged zig-zag.++## Props++`paperTear(props)` accepts:++<PropsTable+ rows={[+ {+ name: "impact",+ type: "number",+ default: "1",+ description: "Strength of the impact: shake, flash, debris and the incoming punch. 0 turns them off.",+ },+ {+ name: "seed",+ type: "number | string",+ default: "7",+ description: "Seed for the shape of the rip and the debris.",+ },+ {+ name: "edgeColor",+ type: "string",+ default: '"#FFFFFF"',+ description: "Color of the fibrous torn edge, the seam flash and the debris.",+ },+ {+ name: "roughness",+ type: "number",+ default: "0.5",+ description: "How jagged the rip is, 0 to 1.",+ },+ {+ name: "shadowColor",+ type: "string",+ default: '"rgba(0, 0, 0, 0.45)"',+ description: "Shadow the torn halves cast on the incoming scene.",+ },+ ]}+/>diff --git a/content/docs/transitions/pixel-sort.mdx b/content/docs/transitions/pixel-sort.mdxnew file mode 100644index 00000000..9fafb1e5--- /dev/null+++ b/content/docs/transitions/pixel-sort.mdx@@ -0,0 +1,84 @@+---+title: Pixel Sort+description: Melt the scene into glowing vertical streaks like glitch-art pixel sorting, then drop the next scene in column by column+component: pixel-sort+vibe: tech+length: 30+useWhen:+ - "The video has a glitch, generative or data-art look and the cut should feel like the image is being processed."+ - "A tech or AI product needs a transition that reads as digital rather than physical."+ - "You want a cut with lots of vertical motion to contrast with sideways camera moves elsewhere."+avoidWhen:+ - "The scenes are heavy React subtrees: each scene is painted once per column; lower columns or use `dither-dissolve`."+ - "You want a short, violent digital cut instead of a melt; use `glitch-cut`."+ - "The brand is calm or editorial; use `fade-through` or `venetian-blinds`."+---++<ComponentPreview name="pixel-sort" />++<InstallBlock name="pixel-sort" />++## Usage++`pixelSort()` is a Remotion transition presentation. Pass it to a+`TransitionSeries.Transition` between two sequences. The frame is sliced into+`columns` vertical strips. Each outgoing strip melts downward: it stretches from+a seeded point in the column while a bright `streakColor` smear builds over it,+with every column starting at a slightly different time. Halfway through, the+incoming scene falls in from above column by column as stretched streaks that+snap into the real image with a small overshoot.++The per-column timing, stretch and glow come from `seed`, so the result is+deterministic.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { pixelSort } from "@/components/remocn/pixel-sort";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 30 })}+ presentation={pixelSort({ columns: 32 })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);+```++This is the heaviest transition in its group: both scenes are rendered once per+column, so the default 40 columns means up to 80 copies of your scenes on a+transition frame. Keep scenes light, or drop `columns` to 16 to 24 if renders+slow down. Fewer, wider columns also read more blocky and graphic.++## Props++`pixelSort(props)` accepts:++<PropsTable+ rows={[+ {+ name: "columns",+ type: "number",+ default: "40",+ description: "Number of vertical columns the frame is sliced into. Rounded, minimum 2.",+ },+ {+ name: "seed",+ type: "number | string",+ default: "5",+ description: "Seed for per-column melt amount, glow and timing.",+ },+ {+ name: "streakColor",+ type: "string",+ default: '"#FFFFFF"',+ description: "Color of the bright smeared streaks.",+ },+ ]}+/>diff --git a/content/docs/transitions/venetian-blinds.mdx b/content/docs/transitions/venetian-blinds.mdxnew file mode 100644index 00000000..4cd69b8d--- /dev/null+++ b/content/docs/transitions/venetian-blinds.mdx@@ -0,0 +1,92 @@+---+title: Venetian Blinds+description: Split the outgoing scene into horizontal slats that turn edge-on in a staggered ripple to reveal the next one+component: venetian-blinds+vibe: premium+length: 26+useWhen:+ - "You want a graphic, editorial cut with visible structure, like a magazine spread or a brand reel."+ - "The outgoing scene is a full-bleed image or a bold layout that looks good sliced into strips."+ - "Consecutive cuts need variety: direction switches between top-down, bottom-up and center-out."+avoidWhen:+ - "The scene is a heavy React subtree: the outgoing scene is painted once per slat; keep slats low or use `fade-through`."+ - "The cut should feel like a camera move rather than a graphic device; use `push-through`."+ - "You want the slats to carry glitch energy instead of a clean turn; use `glitch-cut`."+---++<ComponentPreview name="venetian-blinds" />++<InstallBlock name="venetian-blinds" />++## Usage++`venetianBlinds()` is a Remotion transition presentation. Pass it to a+`TransitionSeries.Transition` between two sequences. The outgoing scene is cut+into `slats` horizontal strips. Each strip rotates around its own horizontal+axis until it is edge-on, picking up `shadeColor` as it turns away from the+light, and fades out just before it becomes a hairline. The strips start one+after another in a ripple whose spread is set by `stagger`. Behind them the+incoming scene settles from a slight 1.06 zoom to rest.++```tsx+import { TransitionSeries, linearTiming } from "@remotion/transitions";+import { venetianBlinds } from "@/components/remocn/venetian-blinds";++export const MyVideo = () => (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: 26 })}+ presentation={venetianBlinds({ direction: "center" })}+ />+ <TransitionSeries.Sequence durationInFrames={70}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+);+```++The outgoing scene is rendered once per slat (12 copies by default), so render+cost grows with `slats`. Keep the outgoing scene light, or lower `slats`, if+renders slow down.++## Variations++- `direction: "top-down"` (default) starts at the top slat, `"bottom-up"` at the bottom, `"center"` opens from the middle outward.+- `stagger: 0` turns every slat at once. Higher values stretch the ripple; at 0.9 each slat gets only a tenth of the transition to turn.+- A lighter `shadeColor` such as `"#FFFFFF"` makes the slats catch light instead of falling into shadow.++## Props++`venetianBlinds(props)` accepts:++<PropsTable+ rows={[+ {+ name: "slats",+ type: "number",+ default: "12",+ description: "Number of horizontal slats. Rounded, minimum 1.",+ },+ {+ name: "stagger",+ type: "number",+ default: "0.55",+ description: "Share of the transition spent rippling across the slats, 0 to 0.9.",+ },+ {+ name: "direction",+ type: '"top-down" | "bottom-up" | "center"',+ default: '"top-down"',+ description: "Which slat turns first.",+ },+ {+ name: "shadeColor",+ type: "string",+ default: '"#000000"',+ description: "Tint a slat picks up as it turns edge-on.",+ },+ ]}+/>diff --git a/lib/analytics.ts b/lib/analytics.tsindex ef6f3939..06d12999 100644--- a/lib/analytics.ts+++ b/lib/analytics.ts@@ -14,6 +14,7 @@ export type CtaId =| "hero_showcases"| "hero_saas_typography_badge"| "hero_motion_graphics_badge"+ | "hero_motion_pack_badge"| "hero_templates_badge"| "how_it_works_setup"| "final_cta"diff --git a/package.json b/package.jsonindex 000104b7..45911a8f 100644--- a/package.json+++ b/package.json@@ -33,6 +33,7 @@"manifest:build": "bun scripts/build-preview-manifest.mts && biome format --write registry/__manifest__.ts","manifest:check": "bun run manifest:build && git diff --quiet -- registry/__manifest__.ts || (echo 'registry/__manifest__.ts is out of sync with registry config sources. Run: bun run manifest:build and commit the result.' && exit 1)","studio": "remotion studio",+ "studio:motion-pack": "remotion studio src/remotion/motion-pack-root.tsx","remotion:browser": "bun scripts/ensure-browser.mts","bundle:remotion": "bun scripts/bundle-remotion.mts","render:demos": "bun scripts/render-demos.mts",diff --git a/registry-artifacts/accordion-unfold.json b/registry-artifacts/accordion-unfold.jsonnew file mode 100644index 00000000..963482a5--- /dev/null+++ b/registry-artifacts/accordion-unfold.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "accordion-unfold",+ "title": "Accordion Unfold",+ "description": "A tight paper zigzag unfolds sideways into a flat card with the logo printed across it.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/accordion-unfold/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type AccordionUnfoldProps = {\n /** Lockup printed across the card. Use a color that reads on `color`. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Number of vertical pleats. */\n panels?: number;\n /** Paper color of the card. */\n color?: string;\n /** Darkness of the panels facing away from the light, 0 to 1. */\n shade?: number;\n backgroundColor?: string;\n /** Fold angle of each pleat at the start, in degrees. */\n foldAngle?: number;\n speed?: number;\n};\n\nexport const accordionUnfoldDefaults = {\n panels: 6,\n color: \"#FFFFFF\",\n shade: 0.55,\n backgroundColor: \"#111111\",\n foldAngle: 82,\n speed: 1,\n};\n\nconst START = 4;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nexport function AccordionUnfold(props: AccordionUnfoldProps) {\n const { children, panels, color, shade, backgroundColor, foldAngle, speed } =\n { ...accordionUnfoldDefaults, ...props };\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const n = Math.max(2, Math.round(panels));\n const cardW = Math.round(Math.min(width * 0.66, height * 1.3));\n const cardH = Math.round(Math.min(height * 0.4, cardW * 0.4));\n const pw = cardW / n;\n\n const open = spring({\n frame: t - START,\n fps,\n config: { damping: 15, stiffness: 70, mass: 0.9 },\n });\n const theta = foldAngle * (1 - open);\n const rad = (theta * Math.PI) / 180;\n // Keep the pleated stack centered while its projected width grows.\n const shift = (cardW - cardW * Math.cos(rad)) / 2;\n const lift = interpolate(t, [0, START + 2], [0.92, 1], clamp);\n const appear = interpolate(t, [0, 3], [0, 1], clamp);\n const flat = Math.abs(theta) < 0.3;\n\n const print = (offset: number) => (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: -offset,\n width: cardW,\n height: cardH,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={backgroundColor}\n dot={color}\n text={backgroundColor}\n scale={0.8}\n />\n )}\n </div>\n );\n\n const panel = (i: number): React.ReactNode => {\n if (i >= n) return null;\n const angle = i === 0 ? theta : (i % 2 === 1 ? -2 : 2) * theta;\n const facing = i % 2 === 0 ? 1 : -1;\n const tilt = Math.abs(Math.sin(rad));\n const darkness = facing > 0 ? shade * tilt : shade * 0.25 * tilt;\n return (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: i === 0 ? 0 : pw,\n width: pw,\n height: cardH,\n transformOrigin: \"0% 50%\",\n transform: `rotateY(${angle}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n // A hair of bleed hides antialiased seams between pleats.\n width: pw + 1,\n overflow: \"hidden\",\n backgroundColor: color,\n backfaceVisibility: \"hidden\",\n }}\n >\n {print(i * pw)}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n facing > 0\n ? `linear-gradient(90deg, rgba(0,0,0,${darkness * 0.6}), rgba(0,0,0,${darkness}))`\n : `linear-gradient(90deg, rgba(255,255,255,${0.12 * tilt}), rgba(0,0,0,${darkness}))`,\n }}\n />\n </div>\n {panel(i + 1)}\n </div>\n );\n };\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n perspective: cardW * 1.8,\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: cardW,\n height: cardH,\n opacity: appear,\n transform: `translateX(${shift}px) scale(${lift})`,\n transformStyle: \"preserve-3d\",\n }}\n >\n {flat ? (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor: color,\n overflow: \"hidden\",\n }}\n >\n {print(0)}\n </div>\n ) : (\n panel(0)\n )}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/accordion-unfold.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/anamorphic-flare.json b/registry-artifacts/anamorphic-flare.jsonnew file mode 100644index 00000000..f5bb04d0--- /dev/null+++ b/registry-artifacts/anamorphic-flare.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "anamorphic-flare",+ "title": "Anamorphic Flare",+ "description": "A point of light grows into a cinematic anamorphic streak that sweeps the frame and reveals the logo in its wake.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/anamorphic-flare/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type AnamorphicFlareProps = {\n /** Lockup revealed behind the streak. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Warm tint of the streak glow and ghosts. */\n tint?: string;\n /** Color of the hot core line. */\n coreColor?: string;\n backgroundColor?: string;\n /** Number of ghost orbs mirrored across the frame center. */\n ghosts?: number;\n /** Vertical position of the streak, 0 to 1. */\n y?: number;\n seed?: number;\n speed?: number;\n};\n\nexport const anamorphicFlareDefaults = {\n tint: \"#E5322D\",\n coreColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n ghosts: 4,\n y: 0.5,\n seed: 2,\n speed: 1,\n};\n\nconst IGNITE = 6;\nconst CROSS_START = 4;\nconst CROSS_END = 26;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nexport function AnamorphicFlare(props: AnamorphicFlareProps) {\n const { children, tint, coreColor, backgroundColor, ghosts, y, seed, speed } =\n { ...anamorphicFlareDefaults, ...props };\n const uid = `anamorphic-flare-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const cy = y * height;\n const cx = width / 2;\n\n const head = interpolate(t, [CROSS_START, CROSS_END], [0.07, 1.12], {\n ...clamp,\n easing: Easing.bezier(0.45, 0, 0.4, 1),\n });\n const hx = head * width;\n const ignite = interpolate(t, [0, IGNITE], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const fade = interpolate(t, [CROSS_END - 6, CROSS_END + 2], [1, 0], clamp);\n const power = ignite * fade;\n const streakLen =\n width *\n interpolate(t, [0, 12], [0.04, 1.3], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n const coreH = Math.max(2, height * 0.004);\n const glowH = height * 0.05;\n const residual = interpolate(\n t,\n [CROSS_END - 2, CROSS_END + 14],\n [0, 0.14],\n clamp,\n );\n const soft = width * 0.08;\n const mask = `linear-gradient(90deg, #000 0px, #000 ${hx - soft}px, transparent ${hx}px)`;\n\n const ghostList = Array.from(\n { length: Math.max(0, Math.round(ghosts)) },\n (_, i) => {\n const k = -1.3 + random(`anamorphic-flare-${seed}-${i}-k`) * 2.2;\n return {\n x: cx - (hx - cx) * k,\n r: height * (0.025 + 0.07 * random(`anamorphic-flare-${seed}-${i}-r`)),\n o: 0.12 + 0.18 * random(`anamorphic-flare-${seed}-${i}-o`),\n dy: (random(`anamorphic-flare-${seed}-${i}-y`) - 0.5) * height * 0.05,\n };\n },\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <defs>\n <linearGradient id={`${uid}-trail`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0\" stopColor={tint} stopOpacity={0} />\n <stop offset=\"0.5\" stopColor={tint} stopOpacity={1} />\n <stop offset=\"1\" stopColor={tint} stopOpacity={0} />\n </linearGradient>\n </defs>\n <rect\n x={0}\n y={cy - 1}\n width={width}\n height={2}\n fill={`url(#${uid}-trail)`}\n opacity={residual}\n />\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n WebkitMaskImage: mask,\n maskImage: mask,\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={tint}\n dot={backgroundColor}\n text={coreColor}\n />\n )}\n </AbsoluteFill>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{\n position: \"absolute\",\n inset: 0,\n mixBlendMode: \"screen\",\n }}\n >\n <defs>\n <linearGradient id={`${uid}-core`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0\" stopColor={coreColor} stopOpacity={0} />\n <stop offset=\"0.5\" stopColor={coreColor} stopOpacity={1} />\n <stop offset=\"1\" stopColor={coreColor} stopOpacity={0} />\n </linearGradient>\n <radialGradient id={`${uid}-bloom`}>\n <stop offset=\"0\" stopColor={coreColor} stopOpacity={1} />\n <stop offset=\"0.25\" stopColor={tint} stopOpacity={0.7} />\n <stop offset=\"1\" stopColor={tint} stopOpacity={0} />\n </radialGradient>\n <radialGradient id={`${uid}-ghost`}>\n <stop offset=\"0\" stopColor={tint} stopOpacity={0.15} />\n <stop offset=\"0.8\" stopColor={tint} stopOpacity={0.5} />\n <stop offset=\"1\" stopColor={tint} stopOpacity={0} />\n </radialGradient>\n <filter\n id={`${uid}-blur`}\n x={-width}\n y={-height}\n width={width * 3}\n height={height * 3}\n filterUnits=\"userSpaceOnUse\"\n >\n <feGaussianBlur stdDeviation={glowH * 0.35} />\n </filter>\n </defs>\n <g opacity={power}>\n <rect\n x={hx - streakLen * 0.45}\n y={cy - glowH / 2}\n width={streakLen * 0.9}\n height={glowH}\n fill={`url(#${uid}-trail)`}\n opacity={0.55}\n filter={`url(#${uid}-blur)`}\n />\n <rect\n x={hx - streakLen / 2}\n y={cy - coreH / 2}\n width={streakLen}\n height={coreH}\n fill={`url(#${uid}-core)`}\n />\n <ellipse\n cx={hx}\n cy={cy}\n rx={height * 0.16}\n ry={height * 0.1}\n fill={`url(#${uid}-bloom)`}\n />\n {ghostList.map((g, i) => (\n <circle\n key={i}\n cx={g.x}\n cy={cy + g.dy}\n r={g.r}\n fill={`url(#${uid}-ghost)`}\n opacity={g.o * 2}\n />\n ))}\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/anamorphic-flare.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/blueprint.json b/registry-artifacts/blueprint.jsonnew file mode 100644index 00000000..d9638e39--- /dev/null+++ b/registry-artifacts/blueprint.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "blueprint",+ "title": "Blueprint",+ "description": "The product wipes left to right into a technical drawing: blueprint grid, white linework, dimension lines with ticks, labels and a red callout.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/blueprint/index.tsx",+ "content": "\"use client\";\n\nimport { type ReactNode, useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type BlueprintLabels = {\n width: string;\n height: string;\n callout: string;\n title: string;\n};\n\nexport type BlueprintProps = {\n /** Product to convert. Its silhouette and dark details become white linework. Defaults to a red device. */\n children?: ReactNode;\n /** Measured box around the product, as fractions of the frame [width, height]. */\n box?: [number, number];\n /** Point the red callout points at, as fractions of the box [x, y]. */\n calloutAt?: [number, number];\n blueprintColor?: string;\n lineColor?: string;\n calloutColor?: string;\n /** Ground behind the product before the wipe. */\n background?: string;\n productColor?: string;\n labels?: Partial<BlueprintLabels>;\n speed?: number;\n};\n\nexport const blueprintDefaults = {\n box: [0.17, 0.6] as [number, number],\n calloutAt: [0.5, 0.11] as [number, number],\n blueprintColor: \"#173C8F\",\n lineColor: \"#FFFFFF\",\n calloutColor: \"#E5322D\",\n background: \"#FFFFFF\",\n productColor: \"#E5322D\",\n labels: {\n width: \"71.6 mm\",\n height: \"147.5 mm\",\n callout: \"SENSOR\",\n title: \"DWG A-01 SCALE 1:1\",\n } as BlueprintLabels,\n speed: 1,\n};\n\nexport const blueprintLength = 45;\n\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst ease = (t: number, from: number, to: number) =>\n interpolate(t, [from, to], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n\nexport function Blueprint({\n children,\n box = blueprintDefaults.box,\n calloutAt = blueprintDefaults.calloutAt,\n blueprintColor = blueprintDefaults.blueprintColor,\n lineColor = blueprintDefaults.lineColor,\n calloutColor = blueprintDefaults.calloutColor,\n background = blueprintDefaults.background,\n productColor = blueprintDefaults.productColor,\n labels,\n speed = blueprintDefaults.speed,\n}: BlueprintProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const text = { ...blueprintDefaults.labels, ...labels };\n const t = (frame / fps) * 30 * speed;\n const u = Math.min(width, height) / 720;\n\n const cx = width * 0.47;\n const cy = height * 0.46;\n const bw = box[0] * width;\n const bh = box[1] * height;\n const x0 = cx - bw / 2;\n const x1 = cx + bw / 2;\n const y0 = cy - bh / 2;\n const y1 = cy + bh / 2;\n const radius = Math.min(bw, bh) * 0.16;\n const dot = { x: x0 + calloutAt[0] * bw, y: y0 + calloutAt[1] * bh };\n\n const wipe = interpolate(t, [6, 24], [-0.04, 1.04], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const wipeX = wipe * width;\n const outline = ease(t, 8, 28);\n const extension = ease(t, 22, 28);\n const dims = ease(t, 24, 32);\n const label = ease(t, 30, 36);\n const leader = ease(t, 32, 40);\n const bubble = interpolate(t, [36, 42], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.back(2)),\n });\n const calloutText = ease(t, 38, 44);\n\n const stroke = 2.4 * u;\n const thin = 1.2 * u;\n const tick = 7 * u;\n const dimY = y1 + 0.08 * height;\n const dimX = x1 + 0.06 * width;\n const half = (a: number, b: number, p: number) => [\n (a + b) / 2 - ((b - a) / 2) * p,\n (a + b) / 2 + ((b - a) / 2) * p,\n ];\n const [hx0, hx1] = half(x0, x1, dims);\n const [vy0, vy1] = half(y0, y1, dims);\n // Callout goes left of the product when the label fits, otherwise above it.\n const ring = Math.min(bw, bh) * 0.11;\n const labelWidth = text.callout.length * 11.8 * u + 26 * u;\n const sideways = x0 - 0.14 * width - labelWidth > 0.03 * width;\n const lead = sideways\n ? { x: x0 - 0.14 * width, y: y0 + 0.06 * height }\n : {\n x: Math.max(0.06 * width, dot.x - 0.1 * width),\n y: Math.max(0.08 * height, y0 - 0.1 * height),\n };\n const elbow = sideways\n ? `L ${lead.x + 0.06 * width} ${lead.y} H ${lead.x}`\n : `L ${lead.x} ${lead.y}`;\n const draw = (p: number) => ({\n pathLength: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1 - p,\n opacity: p > 0 ? 1 : 0,\n });\n const minor = 22 * u;\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n <filter\n id={`${id}-lines`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feMorphology\n in=\"SourceAlpha\"\n operator=\"dilate\"\n radius={1.6 * u}\n result=\"grown\"\n />\n <feComposite\n in=\"grown\"\n in2=\"SourceAlpha\"\n operator=\"out\"\n result=\"edge\"\n />\n <feColorMatrix\n in=\"SourceGraphic\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 -6 -1 4 -1.2\"\n result=\"dark\"\n />\n <feMorphology\n in=\"dark\"\n operator=\"dilate\"\n radius={1.6 * u}\n result=\"darkGrown\"\n />\n <feComposite\n in=\"darkGrown\"\n in2=\"dark\"\n operator=\"out\"\n result=\"darkEdge\"\n />\n <feMerge result=\"all\">\n <feMergeNode in=\"edge\" />\n <feMergeNode in=\"darkEdge\" />\n </feMerge>\n <feFlood floodColor={lineColor} />\n <feComposite in2=\"all\" operator=\"in\" />\n </filter>\n </defs>\n </svg>\n\n {/* Product, before the wipe. */}\n <AbsoluteFill>\n {children ? (\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n <div\n style={{\n transform: `translate(${cx - width / 2}px, ${cy - height / 2}px)`,\n }}\n >\n {children}\n </div>\n </AbsoluteFill>\n ) : (\n <svg width={width} height={height} aria-hidden>\n <rect\n x={x0}\n y={y0 + 10 * u}\n width={bw}\n height={bh}\n rx={radius}\n fill=\"#000\"\n opacity={0.12}\n style={{ filter: `blur(${14 * u}px)` }}\n />\n <rect\n x={x0}\n y={y0}\n width={bw}\n height={bh}\n rx={radius}\n fill={productColor}\n />\n <circle cx={dot.x} cy={dot.y} r={bw * 0.06} fill=\"#111111\" />\n </svg>\n )}\n </AbsoluteFill>\n\n {/* Technical drawing, revealed left to right. */}\n <AbsoluteFill style={{ clipPath: `inset(0 ${width - wipeX}px 0 0)` }}>\n <svg width={width} height={height} aria-hidden>\n <defs>\n <pattern\n id={`${id}-grid`}\n width={minor * 5}\n height={minor * 5}\n patternUnits=\"userSpaceOnUse\"\n >\n <path\n d={Array.from(\n { length: 5 },\n (_, i) =>\n `M ${i * minor} 0 V ${minor * 5} M 0 ${i * minor} H ${minor * 5}`,\n ).join(\" \")}\n stroke={lineColor}\n strokeOpacity={0.09}\n strokeWidth={u}\n />\n <path\n d={`M 0 0 V ${minor * 5} M 0 0 H ${minor * 5}`}\n stroke={lineColor}\n strokeOpacity={0.22}\n strokeWidth={u}\n />\n </pattern>\n </defs>\n <rect width={width} height={height} fill={blueprintColor} />\n <rect width={width} height={height} fill={`url(#${id}-grid)`} />\n </svg>\n {children ? (\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: `url(#${id}-lines)`,\n clipPath: `inset(0 ${width * (1 - outline)}px 0 0)`,\n }}\n >\n <div\n style={{\n transform: `translate(${cx - width / 2}px, ${cy - height / 2}px)`,\n }}\n >\n {children}\n </div>\n </AbsoluteFill>\n ) : null}\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <g fill=\"none\" stroke={lineColor} strokeLinecap=\"round\">\n {children ? null : (\n <>\n <rect\n x={x0}\n y={y0}\n width={bw}\n height={bh}\n rx={radius}\n strokeWidth={stroke}\n {...draw(outline)}\n />\n <rect\n x={x0 + bw * 0.07}\n y={y0 + bw * 0.07}\n width={bw * 0.86}\n height={bh - bw * 0.14}\n rx={radius * 0.7}\n strokeWidth={thin}\n strokeOpacity={0.7}\n {...draw(outline)}\n />\n <circle\n cx={dot.x}\n cy={dot.y}\n r={bw * 0.06}\n strokeWidth={stroke}\n {...draw(outline)}\n />\n </>\n )}\n {/* Center lines */}\n <path\n d={`M ${cx} ${y0 - 0.05 * height} V ${y1 + 0.05 * height} M ${x0 - 0.04 * width} ${cy} H ${x1 + 0.04 * width}`}\n strokeWidth={thin}\n strokeOpacity={0.55 * outline}\n strokeDasharray={`${14 * u} ${4 * u} ${3 * u} ${4 * u}`}\n />\n {/* Extension lines */}\n <path\n d={`M ${x0} ${y1 + 8 * u} V ${y1 + 8 * u + (dimY - y1) * extension} M ${x1} ${y1 + 8 * u} V ${y1 + 8 * u + (dimY - y1) * extension} M ${x1 + 8 * u} ${y0} H ${x1 + 8 * u + (dimX - x1) * extension} M ${x1 + 8 * u} ${y1} H ${x1 + 8 * u + (dimX - x1) * extension}`}\n strokeWidth={thin}\n strokeOpacity={0.8}\n />\n {/* Dimension lines with architectural ticks */}\n <path\n d={`M ${hx0} ${dimY} H ${hx1} M ${dimX} ${vy0} V ${vy1}`}\n strokeWidth={thin * 1.3}\n />\n {dims > 0.98\n ? [\n [x0, dimY],\n [x1, dimY],\n [dimX, y0],\n [dimX, y1],\n ].map(([x, y]) => (\n <line\n key={`${x}-${y}`}\n x1={x - tick}\n y1={y + tick}\n x2={x + tick}\n y2={y - tick}\n strokeWidth={stroke}\n />\n ))\n : null}\n </g>\n <g\n fontFamily={MONO}\n fontSize={17 * u}\n letterSpacing={1.5 * u}\n fill={lineColor}\n opacity={label}\n >\n <rect\n x={cx - 62 * u}\n y={dimY - 12 * u}\n width={124 * u}\n height={24 * u}\n fill={blueprintColor}\n />\n <text x={cx} y={dimY + 6 * u} textAnchor=\"middle\">\n {text.width}\n </text>\n {bh > 190 * u ? (\n <g transform={`translate(${dimX} ${cy}) rotate(-90)`}>\n <rect\n x={-66 * u}\n y={-12 * u}\n width={132 * u}\n height={24 * u}\n fill={blueprintColor}\n />\n <text y={6 * u} textAnchor=\"middle\">\n {text.height}\n </text>\n </g>\n ) : (\n <text x={dimX + 16 * u} y={cy + 6 * u}>\n {text.height}\n </text>\n )}\n <g\n transform={`translate(${width - 0.05 * width} ${height - 0.06 * height})`}\n >\n <rect\n x={-290 * u}\n y={-40 * u}\n width={290 * u}\n height={40 * u}\n fill=\"none\"\n stroke={lineColor}\n strokeWidth={thin}\n />\n <text x={-276 * u} y={-14 * u} fontSize={14 * u}>\n {text.title}\n </text>\n </g>\n </g>\n {/* Red callout */}\n <g\n stroke={calloutColor}\n fill=\"none\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n >\n <circle cx={dot.x} cy={dot.y} r={ring} {...draw(leader)} />\n <path\n d={`M ${dot.x - ring * 0.72} ${dot.y - ring * 0.72} ${elbow}`}\n {...draw(leader)}\n />\n <circle\n cx={lead.x}\n cy={lead.y}\n r={16 * u * bubble}\n fill={calloutColor}\n stroke=\"none\"\n />\n </g>\n <g fontFamily={MONO} opacity={calloutText}>\n <text\n x={lead.x}\n y={lead.y + 6 * u}\n textAnchor=\"middle\"\n fontSize={16 * u}\n fontWeight={700}\n fill={lineColor}\n >\n A\n </text>\n <text\n x={sideways ? lead.x - 26 * u : lead.x + 26 * u}\n y={lead.y + 6 * u}\n textAnchor={sideways ? \"end\" : \"start\"}\n fontSize={17 * u}\n letterSpacing={1.5 * u}\n fill={lineColor}\n >\n {text.callout}\n </text>\n </g>\n </svg>\n </AbsoluteFill>\n\n {/* Scan edge */}\n <AbsoluteFill\n style={{\n left: wipeX - 2 * u,\n width: 4 * u,\n backgroundColor: lineColor,\n boxShadow: `0 0 ${24 * u}px ${6 * u}px ${lineColor}`,\n opacity: wipe > 0 && wipe < 1 ? 0.9 : 0,\n }}\n />\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/blueprint.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/brick-mosaic.json b/registry-artifacts/brick-mosaic.jsonnew file mode 100644index 00000000..978cd726--- /dev/null+++ b/registry-artifacts/brick-mosaic.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "brick-mosaic",+ "title": "Brick Mosaic",+ "description": "Toy bricks drop in row by row from the bottom with a tiny bounce, rebuilding a pixel-art logo on a baseplate.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/brick-mosaic/index.tsx",+ "content": "\"use client\";\n\nimport { useId, useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type BrickMosaicProps = {\n /**\n * Pixel art to build. Either rows of characters looked up in `colors`\n * (unknown characters and spaces leave the cell empty) or a 2D grid of CSS\n * colors (\"\" for empty). Overrides `cols` and `rows`.\n */\n pattern?: string[] | string[][];\n /** Grid size of the default image. */\n cols?: number;\n rows?: number;\n /** Character to color map for string patterns. */\n colors?: Record<string, string>;\n /** Baseplate color behind the bricks. */\n background?: string;\n /** Frames between rows. */\n rowDelay?: number;\n speed?: number;\n};\n\nexport const brickMosaicDefaults = {\n cols: 24,\n rows: 14,\n colors: {\n \"#\": \"#E5322D\",\n \".\": \"#FFFFFF\",\n x: \"#111111\",\n } as Record<string, string>,\n background: \"#111111\",\n rowDelay: 3,\n speed: 1,\n};\n\nconst FALL = 7;\nconst HOP = 5;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction defaultPattern(cols: number, rows: number): string[] {\n const cx = (cols - 1) / 2;\n const cy = (rows - 1) / 2;\n const r = Math.min(cols, rows) * 0.4;\n return Array.from({ length: rows }, (_, y) =>\n Array.from({ length: cols }, (_, x) =>\n Math.hypot(x - cx, y - cy) <= r ? \"#\" : \".\",\n ).join(\"\"),\n );\n}\n\nexport function getBrickMosaicLength(rows: number, cols: number, rowDelay = 3) {\n return Math.ceil((rows - 1) * rowDelay + cols * 0.12 + 1.5 + FALL + HOP);\n}\n\nexport function BrickMosaic({\n pattern,\n cols = brickMosaicDefaults.cols,\n rows = brickMosaicDefaults.rows,\n colors = brickMosaicDefaults.colors,\n background = brickMosaicDefaults.background,\n rowDelay = brickMosaicDefaults.rowDelay,\n speed = brickMosaicDefaults.speed,\n}: BrickMosaicProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const t = (frame / fps) * 30 * speed;\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n\n const grid = useMemo(() => {\n const source = pattern ?? defaultPattern(cols, rows);\n return source.map((row) =>\n (typeof row === \"string\" ? row.split(\"\") : row).map((cell) =>\n typeof row === \"string\" ? (colors[cell] ?? \"\") : cell,\n ),\n );\n }, [pattern, cols, rows, colors]);\n const nRows = grid.length;\n const nCols = Math.max(1, ...grid.map((row) => row.length));\n const s = Math.min((W * 0.86) / nCols, (H * 0.86) / nRows);\n const ox = (W - s * nCols) / 2;\n const oy = (H - s * nRows) / 2;\n const gap = s * 0.04;\n const bevel = s * 0.09;\n const stud = s * 0.28;\n\n const bricks = grid.flatMap((row, r) =>\n row.map((color, col) => {\n if (!color) return null;\n const fromBottom = nRows - 1 - r;\n const start =\n fromBottom * rowDelay + col * 0.12 + random(`brick-${r}-${col}`) * 1.5;\n const local = t - start;\n if (local < 0) return null;\n let y = 0;\n if (local < FALL) {\n const p = local / FALL;\n y = -s * 1.8 * (1 - p * p);\n } else if (local < FALL + HOP) {\n const p = (local - FALL) / HOP;\n y = -s * 0.12 * 4 * p * (1 - p);\n }\n const opacity = interpolate(local, [0, 2], [0, 1], clamp);\n const x0 = ox + col * s + gap / 2;\n const y0 = oy + r * s + gap / 2 + y;\n const b = s - gap;\n return (\n <g\n key={`${r}-${col}`}\n transform={`translate(${x0} ${y0})`}\n opacity={opacity}\n >\n <rect width={b} height={b} rx={s * 0.06} fill={color} />\n <path\n d={`M 0 ${b} V 0 H ${b} L ${b - bevel} ${bevel} H ${bevel} V ${b - bevel} Z`}\n fill=\"#FFFFFF\"\n opacity={0.22}\n />\n <path\n d={`M ${b} 0 V ${b} H 0 L ${bevel} ${b - bevel} H ${b - bevel} V ${bevel} Z`}\n fill=\"#000000\"\n opacity={0.22}\n />\n <circle\n cx={b / 2 + s * 0.035}\n cy={b / 2 + s * 0.05}\n r={stud}\n fill=\"#000000\"\n opacity={0.28}\n />\n <circle cx={b / 2} cy={b / 2} r={stud} fill={color} />\n <circle cx={b / 2} cy={b / 2} r={stud} fill={`url(#${id}-stud)`} />\n </g>\n );\n }),\n );\n\n const landed = interpolate(t, [0, 10], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden>\n <defs>\n <linearGradient\n id={`${id}-stud`}\n x1=\"0.15\"\n y1=\"0.1\"\n x2=\"0.85\"\n y2=\"0.9\"\n >\n <stop offset=\"0\" stopColor=\"#FFFFFF\" stopOpacity={0.5} />\n <stop offset=\"0.45\" stopColor=\"#FFFFFF\" stopOpacity={0} />\n <stop offset=\"1\" stopColor=\"#000000\" stopOpacity={0.22} />\n </linearGradient>\n </defs>\n {/* Baseplate studs the bricks snap onto. */}\n <g fill=\"#FFFFFF\" opacity={0.07 * landed}>\n {grid.flatMap((row, r) =>\n row.map((_, col) => (\n <circle\n key={`${r}-${col}`}\n cx={ox + (col + 0.5) * s}\n cy={oy + (r + 0.5) * s}\n r={stud}\n />\n )),\n )}\n </g>\n {bricks}\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/brick-mosaic.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/cloth-reveal.json b/registry-artifacts/cloth-reveal.jsonnew file mode 100644index 00000000..3ad5c5f2--- /dev/null+++ b/registry-artifacts/cloth-reveal.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "cloth-reveal",+ "title": "Cloth Reveal",+ "description": "A satin sheet draped over the content is yanked from one corner, folding and fluttering as a simulated cloth before it clears the frame.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/cloth-reveal/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useId, useMemo } from \"react\";\nimport {\n AbsoluteFill,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type ClothRevealDirection = \"right\" | \"left\" | \"up\" | \"down\";\n\nexport type ClothRevealProps = {\n /** Content hidden under the sheet. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n clothColor?: string;\n /** Underside tint, seen where the sheet folds over. */\n undersideColor?: string;\n /** Background behind the children. */\n background?: string;\n /** Which way the sheet is yanked. */\n direction?: ClothRevealDirection;\n /** Frame (at 30fps) when the tug starts. */\n delay?: number;\n seed?: number;\n speed?: number;\n};\n\nexport const clothRevealDefaults = {\n clothColor: \"#E5322D\",\n undersideColor: \"#8E1A16\",\n background: \"#111111\",\n direction: \"right\" as ClothRevealDirection,\n delay: 6,\n seed: 2,\n speed: 1,\n};\n\nconst COLS = 40;\nconst ROWS = 24;\nconst FRAMES = 72;\nconst SUBSTEPS = 5;\nconst ITERATIONS = 12;\n\ntype Sim = { frames: Float32Array[]; heights: Float32Array };\n\nconst PATHS: Record<\n ClothRevealDirection,\n { corner: [number, number]; dir: [number, number] }\n> = {\n right: { corner: [1, 0], dir: [1, -0.32] },\n left: { corner: [0, 0], dir: [-1, -0.32] },\n up: { corner: [1, 0], dir: [0.4, -1] },\n down: { corner: [0, 1], dir: [-0.4, 1] },\n};\n\nconst smooth = (v: number) => {\n const t = Math.min(1, Math.max(0, v));\n return t * t * (3 - 2 * t);\n};\n\n// Verlet cloth in table space: x/y on the table, z up toward the camera. The\n// sheet rests on a soft bump (whatever it hides) with seeded wrinkles baked\n// into its rest shape, so frame 0 is already at equilibrium.\nfunction simulate(\n width: number,\n height: number,\n direction: ClothRevealDirection,\n delay: number,\n seed: number,\n): Sim {\n const n = COLS * ROWS;\n const pos = new Float64Array(n * 3);\n const prev = new Float64Array(n * 3);\n const floorZ = new Float64Array(n);\n const pinned = new Uint8Array(n);\n const unit = Math.min(width, height);\n const bump = (x: number, y: number) => {\n const dx = (x - width / 2) / (width * 0.3);\n const dy = (y - height / 2) / (height * 0.34);\n return unit * 0.09 * Math.exp(-(dx * dx + dy * dy) * 1.4);\n };\n // Folds radiate from the hidden object and deepen toward the hem, plus a\n // couple of long soft waves so the sheet never looks ironed.\n const folds = 7 + Math.floor(random(`cloth-${seed}-n`) * 4);\n const twist = random(`cloth-${seed}-t`) * Math.PI * 2;\n const waves = [0, 1].map((k) => ({\n a: random(`cloth-${seed}-a${k}`) * Math.PI,\n f: 0.8 + random(`cloth-${seed}-f${k}`) * 1.2,\n p: random(`cloth-${seed}-p${k}`) * Math.PI * 2,\n }));\n\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n const i = r * COLS + c;\n const u = c / (COLS - 1);\n const v = r / (ROWS - 1);\n const x = width * (-0.06 + u * 1.12);\n const y = height * (-0.08 + v * 1.16);\n const dx = (x - width / 2) / width;\n const dy = (y - height / 2) / width;\n const rho = Math.hypot(dx, dy);\n const theta = Math.atan2(dy, dx);\n const radial =\n (0.5 + 0.5 * Math.sin(theta * folds + twist + rho * 9)) ** 1.6 *\n smooth((rho - 0.12) / 0.35);\n let wave = 0;\n for (const w of waves) {\n const s = u * Math.cos(w.a) + v * Math.sin(w.a);\n wave += 0.5 + 0.5 * Math.sin(s * w.f * Math.PI * 2 + w.p);\n }\n floorZ[i] = unit * (0.045 * radial + 0.012 * wave);\n pos[i * 3] = x;\n pos[i * 3 + 1] = y;\n pos[i * 3 + 2] = floorZ[i] + bump(x, y);\n }\n }\n prev.set(pos);\n const heights = new Float32Array(n);\n for (let i = 0; i < n; i++) heights[i] = pos[i * 3 + 2];\n\n const links: number[] = [];\n const add = (a: number, b: number, stiff: number) => {\n const dx = pos[a * 3] - pos[b * 3];\n const dy = pos[a * 3 + 1] - pos[b * 3 + 1];\n const dz = pos[a * 3 + 2] - pos[b * 3 + 2];\n links.push(a, b, Math.hypot(dx, dy, dz), stiff);\n };\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n const i = r * COLS + c;\n if (c + 1 < COLS) add(i, i + 1, 1);\n if (r + 1 < ROWS) add(i, i + COLS, 1);\n if (c + 1 < COLS && r + 1 < ROWS) {\n add(i, i + COLS + 1, 0.7);\n add(i + 1, i + COLS, 0.7);\n }\n if (c + 2 < COLS) add(i, i + 2, 0.25);\n if (r + 2 < ROWS) add(i, i + COLS * 2, 0.25);\n }\n }\n\n // The hand pinches a small patch around the corner, not a single vertex.\n const path = PATHS[direction];\n const cc = path.corner[0] * (COLS - 1);\n const cr = path.corner[1] * (ROWS - 1);\n const grip: number[] = [];\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n if (Math.abs(c - cc) + Math.abs(r - cr) <= 3) grip.push(r * COLS + c);\n }\n }\n const gripStart = grip.map((i) => [\n pos[i * 3],\n pos[i * 3 + 1],\n pos[i * 3 + 2],\n ]);\n for (const i of grip) pinned[i] = 1;\n const len = Math.hypot(path.dir[0], path.dir[1]);\n const dir = [path.dir[0] / len, path.dir[1] / len];\n const reach = Math.abs(dir[0]) * width + Math.abs(dir[1]) * height;\n const g = unit * 0.006;\n const dt = 1 / SUBSTEPS;\n\n const hand = (t: number) => {\n const s = Math.max(0, t - delay);\n // Quick lift, then an accelerating yank that keeps going off-frame.\n const lift = unit * 0.5 * smooth(s / 9);\n const travel =\n s < 30\n ? reach * 1.25 * (s / 30) ** 2\n : reach * 1.25 * (1 + ((s - 30) * 2) / 30);\n return [dir[0] * travel, dir[1] * travel, lift];\n };\n\n const frames: Float32Array[] = [];\n const record = () => {\n const out = new Float32Array(n * 3);\n for (let i = 0; i < n * 3; i++) out[i] = pos[i];\n frames.push(out);\n };\n record();\n\n for (let f = 1; f <= FRAMES; f++) {\n for (let s = 1; s <= SUBSTEPS; s++) {\n const t = f - 1 + s * dt;\n const [hx, hy, hz] = hand(t);\n for (let i = 0; i < n; i++) {\n const k = i * 3;\n if (pinned[i]) continue;\n const z = pos[k + 2];\n const lifted = z - floorZ[i] - bump(pos[k], pos[k + 1]) > 1;\n const drag = lifted ? 0.985 : 0.6;\n const vx = (pos[k] - prev[k]) * drag;\n const vy = (pos[k + 1] - prev[k + 1]) * drag;\n const vz = (pos[k + 2] - prev[k + 2]) * 0.985;\n prev[k] = pos[k];\n prev[k + 1] = pos[k + 1];\n prev[k + 2] = z;\n // Flutter: a travelling ripple that only bites on fast-moving cloth.\n const speedXY = Math.hypot(vx, vy);\n const flutter =\n Math.sin(pos[k] * 0.02 + pos[k + 1] * 0.013 + t * 1.7) *\n speedXY *\n 0.06;\n pos[k] += vx;\n pos[k + 1] += vy;\n pos[k + 2] += vz + flutter - g * dt * dt;\n }\n grip.forEach((i, j) => {\n pos[i * 3] = gripStart[j][0] + hx;\n pos[i * 3 + 1] = gripStart[j][1] + hy;\n pos[i * 3 + 2] = gripStart[j][2] + hz;\n });\n for (let it = 0; it < ITERATIONS; it++) {\n for (let l = 0; l < links.length; l += 4) {\n const a = links[l];\n const b = links[l + 1];\n const rest = links[l + 2];\n const stiff = links[l + 3];\n const ka = a * 3;\n const kb = b * 3;\n const dx = pos[kb] - pos[ka];\n const dy = pos[kb + 1] - pos[ka + 1];\n const dz = pos[kb + 2] - pos[ka + 2];\n const d = Math.hypot(dx, dy, dz) || 1e-6;\n const wa = pinned[a] ? 0 : 1;\n const wb = pinned[b] ? 0 : 1;\n if (wa + wb === 0) continue;\n const diff = ((d - rest) / d / (wa + wb)) * stiff;\n pos[ka] += dx * diff * wa;\n pos[ka + 1] += dy * diff * wa;\n pos[ka + 2] += dz * diff * wa;\n pos[kb] -= dx * diff * wb;\n pos[kb + 1] -= dy * diff * wb;\n pos[kb + 2] -= dz * diff * wb;\n }\n for (let i = 0; i < n; i++) {\n const k = i * 3;\n const ground = floorZ[i] + bump(pos[k], pos[k + 1]);\n if (pos[k + 2] < ground) pos[k + 2] = ground;\n }\n }\n }\n record();\n }\n return { frames, heights };\n}\n\nfunction parseHex(hex: string): [number, number, number] {\n const h = hex.replace(\"#\", \"\");\n const full = h.length === 3 ? h.replace(/./g, (c) => c + c) : h.slice(0, 6);\n const v = Number.parseInt(full, 16);\n return [(v >> 16) & 255, (v >> 8) & 255, v & 255];\n}\n\n// Wordmark color for the placeholder: dark ink on light backgrounds.\nfunction placeholderText(background: string): string {\n const [r, g, b] = parseHex(background);\n return 0.299 * r + 0.587 * g + 0.114 * b > 150 ? \"#111111\" : \"#FFFFFF\";\n}\n\nconst LIGHT = (() => {\n const l = [-0.45, -0.6, 0.75];\n const m = Math.hypot(l[0], l[1], l[2]);\n return l.map((c) => c / m);\n})();\nconst HALF = (() => {\n const h = [LIGHT[0], LIGHT[1], LIGHT[2] + 1];\n const m = Math.hypot(h[0], h[1], h[2]);\n return h.map((c) => c / m);\n})();\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nexport function ClothReveal({\n children,\n clothColor = clothRevealDefaults.clothColor,\n undersideColor = clothRevealDefaults.undersideColor,\n background = clothRevealDefaults.background,\n direction = clothRevealDefaults.direction,\n delay = clothRevealDefaults.delay,\n seed = clothRevealDefaults.seed,\n speed = clothRevealDefaults.speed,\n}: ClothRevealProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const uid = `cloth-reveal-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const shadowId = `${uid}-shadow`;\n const softenId = `${uid}-soften`;\n const sim = useMemo(\n () => simulate(width, height, direction, delay, seed),\n [width, height, direction, delay, seed],\n );\n const t = Math.min(FRAMES, Math.max(0, (frame * speed * 30) / fps));\n const f0 = Math.floor(t);\n const f1 = Math.min(FRAMES, f0 + 1);\n const mix = t - f0;\n const A = sim.frames[f0];\n const B = sim.frames[f1];\n\n // Pinhole camera above the table: higher cloth projects larger.\n const camera = Math.max(width, height) * 1.6;\n const cx = width / 2;\n const cy = height / 2;\n const n = COLS * ROWS;\n const world = new Float64Array(n * 3);\n const screen = new Float64Array(n * 2);\n for (let i = 0; i < n * 3; i++) world[i] = A[i] + (B[i] - A[i]) * mix;\n for (let i = 0; i < n; i++) {\n const z = Math.min(world[i * 3 + 2], camera * 0.8);\n const s = camera / (camera - z);\n screen[i * 2] = cx + (world[i * 3] - cx) * s;\n screen[i * 2 + 1] = cy + (world[i * 3 + 1] - cy) * s;\n }\n\n const front = parseHex(clothColor);\n const back = parseHex(undersideColor);\n // Per-vertex normals from central differences; each quad averages its four\n // corners, which hides the mesh facets.\n const shades = new Float64Array(n * 3);\n const at = (c: number, r: number, k: number) =>\n world[\n (Math.min(ROWS - 1, Math.max(0, r)) * COLS +\n Math.min(COLS - 1, Math.max(0, c))) *\n 3 +\n k\n ];\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n const ux = at(c + 1, r, 0) - at(c - 1, r, 0);\n const uy = at(c + 1, r, 1) - at(c - 1, r, 1);\n const uz = at(c + 1, r, 2) - at(c - 1, r, 2);\n const vx = at(c, r + 1, 0) - at(c, r - 1, 0);\n const vy = at(c, r + 1, 1) - at(c, r - 1, 1);\n const vz = at(c, r + 1, 2) - at(c, r - 1, 2);\n let nx = uy * vz - uz * vy;\n let ny = uz * vx - ux * vz;\n let nz = ux * vy - uy * vx;\n const m = Math.hypot(nx, ny, nz) || 1;\n const flip = nz < 0 ? -1 : 1;\n nx = (nx / m) * flip;\n ny = (ny / m) * flip;\n nz = (nz / m) * flip;\n const diffuse = Math.max(\n 0,\n nx * LIGHT[0] + ny * LIGHT[1] + nz * LIGHT[2],\n );\n const spec =\n Math.max(0, nx * HALF[0] + ny * HALF[1] + nz * HALF[2]) ** 36 * 0.28;\n const base = flip < 0 ? back : front;\n const shade = 0.22 + 0.95 * diffuse;\n const i = r * COLS + c;\n for (let k = 0; k < 3; k++) {\n shades[i * 3 + k] = Math.min(255, base[k] * shade + 255 * spec);\n }\n }\n }\n\n const quads: { d: string; fill: string; z: number; shadow: string | null }[] =\n [];\n const offscreen = (x: number, y: number) =>\n x < -width * 0.1 ||\n x > width * 1.1 ||\n y < -height * 0.1 ||\n y > height * 1.1;\n\n for (let r = 0; r < ROWS - 1; r++) {\n for (let c = 0; c < COLS - 1; c++) {\n const ids = [\n r * COLS + c,\n r * COLS + c + 1,\n (r + 1) * COLS + c + 1,\n (r + 1) * COLS + c,\n ];\n const pts = ids.map((i) => [screen[i * 2], screen[i * 2 + 1]]);\n if (pts.every(([x, y]) => offscreen(x, y))) {\n const xs = pts.map((p) => p[0]);\n const ys = pts.map((p) => p[1]);\n const spans =\n (Math.min(...xs) < 0 && Math.max(...xs) > width) ||\n (Math.min(...ys) < 0 && Math.max(...ys) > height);\n if (!spans) continue;\n }\n const rgb = [0, 1, 2].map((k) =>\n Math.round(ids.reduce((sum, i) => sum + shades[i * 3 + k], 0) / 4),\n );\n const fill = `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`;\n const P = ids.map((i) => [\n world[i * 3],\n world[i * 3 + 1],\n world[i * 3 + 2],\n ]);\n const z = (P[0][2] + P[1][2] + P[2][2] + P[3][2]) / 4;\n const d = `M${pts.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(\"L\")}Z`;\n const lift = z - (sim.heights[ids[0]] ?? 0);\n const shadow =\n lift > 4\n ? `M${P.map(([x, y, h]) => `${(x + h * 0.35).toFixed(1)},${(y + h * 0.45).toFixed(1)}`).join(\"L\")}Z`\n : null;\n quads.push({ d, fill, z, shadow });\n }\n }\n quads.sort((a, b) => a.z - b.z);\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <AbsoluteFill style={{ alignItems: \"center\", justifyContent: \"center\" }}>\n {children ?? (\n <PlaceholderLockup\n mark={clothColor}\n dot={background}\n text={placeholderText(background)}\n />\n )}\n </AbsoluteFill>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <defs>\n <filter id={shadowId} x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\">\n <feGaussianBlur stdDeviation={Math.min(width, height) * 0.02} />\n </filter>\n {/* Normalized blur: blurring premultiplied color and then forcing\n alpha to 1 averages only covered pixels, which smooths the facet\n steps without bleeding the background in. The source alpha then\n restores the crisp silhouette. */}\n <filter\n id={softenId}\n filterUnits=\"userSpaceOnUse\"\n x={-width}\n y={-height}\n width={width * 3}\n height={height * 3}\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation={(width * 1.12) / (COLS - 1) / 2.2}\n result=\"blur\"\n />\n <feColorMatrix\n in=\"blur\"\n type=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1\"\n result=\"smooth\"\n />\n <feGaussianBlur\n in=\"SourceAlpha\"\n stdDeviation={Math.min(width, height) / 600}\n result=\"edge\"\n />\n <feComposite in=\"smooth\" in2=\"edge\" operator=\"in\" />\n </filter>\n </defs>\n <g filter={`url(#${shadowId})`} opacity={0.45}>\n {quads.map((q, i) =>\n q.shadow ? <path key={i} d={q.shadow} fill=\"#000000\" /> : null,\n )}\n </g>\n {/* Aliased quads share edges without hairline seams. */}\n <g filter={`url(#${softenId})`}>\n {quads.map((q, i) => (\n <path key={i} d={q.d} fill={q.fill} shapeRendering=\"crispEdges\" />\n ))}\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/cloth-reveal.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/comic-panels.json b/registry-artifacts/comic-panels.jsonnew file mode 100644index 00000000..135b2633--- /dev/null+++ b/registry-artifacts/comic-panels.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "comic-panels",+ "title": "Comic Panels",+ "description": "The frame cracks into a three-panel comic page with speed lines, red halftone and a starburst, then the action panel bursts into a full-frame POW.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/comic-panels/index.tsx",+ "content": "\"use client\";\n\nimport { type ReactNode, useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type ComicPanelsColors = {\n ink: string;\n paper: string;\n accent: string;\n};\n\nexport type ComicPanelsProps = {\n /** Hero content, framed in the top panel once the page cracks. Falls back to a placeholder \"remocn\" lockup. */\n children?: ReactNode;\n /** Optional word in the starburst, e.g. \"POW\". */\n word?: string;\n colors?: Partial<ComicPanelsColors>;\n /** Ink color. Overrides `colors.ink` when set. */\n ink?: string;\n /** Paper color. Overrides `colors.paper` when set. */\n paper?: string;\n /** Accent color. Overrides `colors.accent` when set. */\n accent?: string;\n /** Scale of `children` inside the top panel. */\n heroScale?: number;\n speed?: number;\n};\n\nexport const comicPanelsDefaults = {\n colors: {\n ink: \"#111111\",\n paper: \"#FFFFFF\",\n accent: \"#E5322D\",\n } as ComicPanelsColors,\n heroScale: 0.62,\n speed: 1,\n};\n\nexport const comicPanelsLength = 36;\n\nconst FONT =\n \"'Arial Black', Impact, Inter, -apple-system, 'Segoe UI', sans-serif\";\nconst SANS =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Placeholder hero shown when no children are passed.\nfunction PlaceholderLockup({ ink, accent }: { ink: string; accent: string }) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 }}>\n <div\n style={{\n width: 120,\n height: 120,\n borderRadius: 32,\n backgroundColor: accent,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36,\n height: 36,\n borderRadius: \"50%\",\n backgroundColor: ink,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: SANS,\n fontSize: 104,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: ink,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst ease = (\n t: number,\n from: number,\n to: number,\n easing: (n: number) => number = Easing.inOut(Easing.cubic),\n) => interpolate(t, [from, to], [0, 1], { ...clamp, easing });\n\ntype Pt = [number, number];\nconst poly = (points: Pt[]) => points.map((p) => p.join(\",\")).join(\" \");\n\nfunction starburst(spikes: number, outer: number, inner: number, seed: string) {\n const points: Pt[] = [];\n for (let i = 0; i < spikes * 2; i++) {\n const a =\n (i / (spikes * 2)) * Math.PI * 2 +\n (random(`${seed}-a-${i}`) - 0.5) * 0.12;\n const r =\n i % 2 === 0\n ? outer * (0.82 + 0.18 * random(`${seed}-r-${i}`))\n : inner * (0.9 + 0.1 * random(`${seed}-r-${i}`));\n points.push([Math.cos(a) * r, Math.sin(a) * r]);\n }\n return poly(points);\n}\n\nexport function ComicPanels({\n children,\n word,\n colors,\n ink,\n paper,\n accent,\n heroScale = comicPanelsDefaults.heroScale,\n speed = comicPanelsDefaults.speed,\n}: ComicPanelsProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const merged = { ...comicPanelsDefaults.colors, ...colors };\n const c: ComicPanelsColors = {\n ink: ink ?? merged.ink,\n paper: paper ?? merged.paper,\n accent: accent ?? merged.accent,\n };\n const t = (frame / fps) * 30 * speed;\n const u = Math.min(W, H) / 720;\n\n // Page geometry: one slanted horizontal gutter, one slanted vertical one.\n const a0 = 0.6 * H;\n const a1 = 0.5 * H;\n const yA = (x: number) => a0 + ((a1 - a0) * x) / W;\n const b0: Pt = [0.53 * W, yA(0.53 * W)];\n const b1: Pt = [0.46 * W, H];\n const gutter = 16 * u;\n const border = 5 * u;\n\n const margin = ease(t, 0, 8) * 22 * u;\n const crackA = ease(t, 2, 10, Easing.out(Easing.cubic));\n const crackB = ease(t, 8, 14, Easing.out(Easing.cubic));\n const slide2 = ease(t, 10, 18, Easing.out(Easing.exp));\n const slide3 = ease(t, 13, 21, Easing.out(Easing.exp));\n const burst = ease(t, 23, 34, Easing.in(Easing.cubic));\n const settle = ease(t, 30, 36, Easing.out(Easing.cubic));\n const shaking = t >= 22 && t < 31;\n const step = Math.floor(t / 2);\n const shake = shaking\n ? [\n (random(`comic-sx-${step}`) - 0.5) * 14 * u,\n (random(`comic-sy-${step}`) - 0.5) * 14 * u,\n ]\n : [0, 0];\n const jolt = `translate(${shake[0]} ${shake[1]})`;\n\n const left: Pt[] = [[0, a0], b0, b1, [0, H]];\n const right: Pt[] = [b0, [W, a1], [W, H], b1];\n const heroFocus: Pt = [W / 2, interpolate(crackA, [0, 1], [H / 2, 0.27 * H])];\n const heroS = interpolate(crackA, [0, 1], [1, heroScale]);\n\n // Speed lines: wedges from the hero focus, redrawn every 2 frames.\n const wedges = Array.from({ length: 56 }, (_, i) => {\n const a =\n (i / 56) * Math.PI * 2 + (random(`comic-w-${step}-${i}`) - 0.5) * 0.09;\n const spread = 0.008 + 0.014 * random(`comic-ws-${step}-${i}`);\n const r0 = (0.3 + 0.12 * random(`comic-wr-${step}-${i}`)) * W * heroS;\n const r1 = W * 1.2;\n const [fx, fy] = heroFocus;\n const at = (r: number, d: number): Pt => [\n fx + Math.cos(a + d) * r,\n fy + Math.sin(a + d) * r * 0.62,\n ];\n return poly([at(r0, 0), at(r1, -spread), at(r1, spread)]);\n });\n\n // Halftone: dots swell toward the panel's lower-left corner.\n const pitch = 20 * u;\n const dots: { x: number; y: number; r: number }[] = [];\n for (let y = a1 - pitch; y < H + pitch; y += pitch) {\n for (let x = 0; x < b0[0] + pitch; x += pitch) {\n const ox = (Math.round(y / pitch) % 2) * (pitch / 2);\n const d = Math.hypot(x + ox, H - y) / Math.hypot(b0[0], H - a0);\n const r = pitch * 0.5 * Math.max(0, Math.min(1, 1.15 - d));\n if (r > 0.6 * u) dots.push({ x: x + ox, y, r });\n }\n }\n\n const c3: Pt = [(b0[0] + W + W + b1[0]) / 4, (b0[1] + a1 + H + H) / 4];\n const outer = 0.4 * (H - a1);\n const pulse = 1 + 0.04 * Math.sin(t * 1.4);\n const center: Pt = [\n interpolate(burst, [0, 1], [c3[0], W / 2]),\n interpolate(burst, [0, 1], [c3[1], H / 2]),\n ];\n const redScale = interpolate(burst, [0, 1], [1, 9]) * pulse;\n const whiteScale =\n interpolate(burst, [0, 1], [1, (0.4 * H) / (outer * 0.62)]) *\n pulse *\n interpolate(settle, [0, 1], [1.08, 1]);\n const spin = interpolate(burst, [0, 1], [0, 14]);\n const burstLayer = (\n <g transform={`translate(${center[0]} ${center[1]}) rotate(${spin})`}>\n <polygon\n transform={`scale(${redScale})`}\n points={starburst(16, outer, outer * 0.68, \"comic-red\")}\n fill={c.accent}\n stroke={c.ink}\n strokeWidth={(border * 0.8) / redScale}\n strokeLinejoin=\"round\"\n />\n <polygon\n transform={`scale(${whiteScale})`}\n points={starburst(13, outer * 0.62, outer * 0.42, \"comic-white\")}\n fill={c.paper}\n stroke={c.ink}\n strokeWidth={(border * 0.8) / whiteScale}\n strokeLinejoin=\"round\"\n />\n {word ? (\n <g\n transform={`scale(${whiteScale}) rotate(-8)`}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fontFamily={FONT}\n fontWeight={900}\n fontSize={outer * 0.4}\n >\n <text x={outer * 0.03} y={outer * 0.03} fill={c.accent}>\n {word}\n </text>\n <text fill={c.ink}>{word}</text>\n </g>\n ) : null}\n </g>\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor: c.paper, overflow: \"hidden\" }}>\n <AbsoluteFill>\n <svg width={W} height={H} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n <clipPath id={`${id}-left`}>\n <polygon points={poly(left)} />\n </clipPath>\n <clipPath id={`${id}-right`}>\n <polygon points={poly(right)} />\n </clipPath>\n </defs>\n <g fill={c.ink} transform={jolt}>\n {wedges.map((points, i) => (\n <polygon key={i} points={points} />\n ))}\n </g>\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `translate(${heroFocus[0] - W / 2 + shake[0]}px, ${heroFocus[1] - H / 2 + shake[1]}px) scale(${heroS})`,\n }}\n >\n {children ?? <PlaceholderLockup ink={c.ink} accent={c.accent} />}\n </AbsoluteFill>\n <svg width={W} height={H} style={{ position: \"absolute\" }} aria-hidden>\n <g\n clipPath={`url(#${id}-left)`}\n transform={`translate(${(slide2 - 1) * b0[0]} 0)`}\n opacity={slide2 > 0 ? 1 : 0}\n >\n <polygon points={poly(left)} fill={c.paper} />\n <g fill={c.accent} transform={jolt}>\n {dots.map((d) => (\n <circle key={`${d.x}-${d.y}`} cx={d.x} cy={d.y} r={d.r} />\n ))}\n </g>\n </g>\n <g clipPath={`url(#${id}-right)`}>\n <g\n transform={`translate(${(1 - slide3) * (W - b1[0])} 0)`}\n opacity={slide3 > 0 ? 1 : 0}\n >\n <polygon points={poly(right)} fill={c.ink} />\n <g transform={jolt}>{burst === 0 ? burstLayer : null}</g>\n </g>\n </g>\n {/* Gutters: ink edges first, then the white channel on top. */}\n {[c.ink, c.paper].map((stroke, pass) => (\n <g\n key={stroke + pass}\n stroke={stroke}\n strokeWidth={pass === 0 ? gutter + border * 2 : gutter}\n strokeLinecap=\"butt\"\n >\n <line\n x1={-gutter}\n y1={yA(-gutter)}\n x2={-gutter + (W + 2 * gutter) * crackA}\n y2={yA(-gutter + (W + 2 * gutter) * crackA)}\n />\n <line\n x1={b0[0]}\n y1={b0[1]}\n x2={b0[0] + (b1[0] + (b1[0] - b0[0]) * 0.05 - b0[0]) * crackB}\n y2={b0[1] + (H * 1.05 - b0[1]) * crackB}\n />\n </g>\n ))}\n <path\n d={`M ${-W} ${-H} H ${2 * W} V ${2 * H} H ${-W} Z M ${margin} ${margin} V ${H - margin} H ${W - margin} V ${margin} Z`}\n fill={c.paper}\n />\n {margin > 0 ? (\n <rect\n x={margin}\n y={margin}\n width={W - margin * 2}\n height={H - margin * 2}\n fill=\"none\"\n stroke={c.ink}\n strokeWidth={border}\n />\n ) : null}\n </svg>\n </AbsoluteFill>\n {burst > 0 ? (\n <svg width={W} height={H} style={{ position: \"absolute\" }} aria-hidden>\n <g transform={jolt}>{burstLayer}</g>\n </svg>\n ) : null}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/comic-panels.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/dolly-zoom.json b/registry-artifacts/dolly-zoom.jsonnew file mode 100644index 00000000..3c7bde1a--- /dev/null+++ b/registry-artifacts/dolly-zoom.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "dolly-zoom",+ "title": "Dolly Zoom",+ "description": "The vertigo shot: a perspective corridor with a red door stretches deeper while the subject in the center holds its exact size.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/dolly-zoom/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type DollyZoomColors = {\n background: string;\n wall: string;\n wallAlt: string;\n floor: string;\n floorAlt: string;\n line: string;\n light: string;\n door: string;\n figure: string;\n};\n\nexport type DollyZoomProps = {\n /** Subject held at a constant size. Defaults to a standing figure. */\n children?: React.ReactNode;\n /** How far the camera dollies in while zooming out, 0 to 2. */\n intensity?: number;\n /** Play the move in reverse: background compresses toward the subject. */\n reverse?: boolean;\n colors?: Partial<DollyZoomColors>;\n /** Door color at the end of the corridor. Overrides `colors.door`. */\n doorColor?: string;\n /** Default figure color. Overrides `colors.figure`. */\n figureColor?: string;\n /** Corridor edge line color. Overrides `colors.line`. */\n lineColor?: string;\n speed?: number;\n};\n\nexport const dollyZoomDefaults = {\n intensity: 1,\n reverse: false,\n colors: {\n background: \"#0B0B0B\",\n wall: \"#1B1B1B\",\n wallAlt: \"#151515\",\n floor: \"#262626\",\n floorAlt: \"#1D1D1D\",\n line: \"#FFFFFF\",\n light: \"#FFFFFF\",\n door: \"#E5322D\",\n figure: \"#FFFFFF\",\n } satisfies DollyZoomColors,\n speed: 1,\n};\n\nconst START = 4;\nconst END = 36;\n// Corridor in world units. Screen y points down, so the floor is positive.\nconst HALF_W = 2;\nconst CEIL = -1.3;\nconst FLOOR = 1.7;\nconst SUBJECT_Z = 6;\nconst DOOR_Z = 14;\nconst NEAR = 0.25;\n\ntype Vec = [number, number, number];\n\nexport function DollyZoom({\n children,\n intensity = dollyZoomDefaults.intensity,\n reverse = dollyZoomDefaults.reverse,\n colors: colorOverrides,\n doorColor,\n figureColor,\n lineColor,\n speed = dollyZoomDefaults.speed,\n}: DollyZoomProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...dollyZoomDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n door: doorColor ?? baseColors.door,\n figure: figureColor ?? baseColors.figure,\n line: lineColor ?? baseColors.line,\n };\n const t = (frame * speed * 30) / fps;\n const move = interpolate(t, [START, END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.45, 0, 0.3, 1),\n });\n const amount = reverse ? 1 - move : move;\n\n // Focal length tracks the subject distance so the subject never changes size.\n const k = height * 0.19;\n const d0 = SUBJECT_Z;\n const d1 = d0 / (1 + 1.7 * Math.max(0, intensity));\n const dist = d0 + (d1 - d0) * amount;\n const cam = SUBJECT_Z - dist;\n const f = k * dist;\n const cx = width / 2;\n const cy = height / 2;\n\n const project = ([x, y, z]: Vec) => {\n const depth = Math.max(NEAR, z - cam);\n return [cx + (f * x) / depth, cy + (f * y) / depth] as const;\n };\n const poly = (pts: Vec[]) =>\n pts\n .map(project)\n .map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`)\n .join(\" \");\n\n const fog = (z: number) =>\n interpolate(z - cam, [1, DOOR_Z - cam], [1, 0.25], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const segments: React.ReactNode[] = [];\n // The corridor runs on behind the camera so its mouth never shows.\n const firstZ = Math.floor(cam);\n for (let z = DOOR_Z - 1; z >= firstZ; z--) {\n const z0 = Math.max(z, cam + NEAR);\n const z1 = z + 1;\n if (z1 <= z0) continue;\n const alt = z % 2 === 0;\n const L = -HALF_W;\n const R = HALF_W;\n segments.push(\n <g key={z}>\n <polygon\n points={poly([\n [L, FLOOR, z0],\n [R, FLOOR, z0],\n [R, FLOOR, z1],\n [L, FLOOR, z1],\n ])}\n fill={alt ? colors.floor : colors.floorAlt}\n />\n <polygon\n points={poly([\n [L, CEIL, z0],\n [R, CEIL, z0],\n [R, CEIL, z1],\n [L, CEIL, z1],\n ])}\n fill={colors.wallAlt}\n />\n <polygon\n points={poly([\n [L, CEIL, z0],\n [L, FLOOR, z0],\n [L, FLOOR, z1],\n [L, CEIL, z1],\n ])}\n fill={alt ? colors.wall : colors.wallAlt}\n />\n <polygon\n points={poly([\n [R, CEIL, z0],\n [R, FLOOR, z0],\n [R, FLOOR, z1],\n [R, CEIL, z1],\n ])}\n fill={alt ? colors.wall : colors.wallAlt}\n />\n <polygon\n points={poly([\n [-0.35, CEIL, z + 0.3],\n [0.35, CEIL, z + 0.3],\n [0.35, CEIL, z + 0.7],\n [-0.35, CEIL, z + 0.7],\n ])}\n fill={colors.light}\n opacity={0.75 * fog(z)}\n />\n {z >= cam + NEAR ? (\n <polygon\n points={poly([\n [L, CEIL, z],\n [R, CEIL, z],\n [R, FLOOR, z],\n [L, FLOOR, z],\n ])}\n fill=\"none\"\n stroke={colors.line}\n strokeOpacity={0.32 * fog(z)}\n strokeWidth={Math.max(1, (f / (z - cam)) * 0.012)}\n />\n ) : null}\n </g>,\n );\n }\n\n const edges: Vec[][] = [\n [\n [-HALF_W, CEIL, -4],\n [-HALF_W, CEIL, DOOR_Z],\n ],\n [\n [HALF_W, CEIL, -4],\n [HALF_W, CEIL, DOOR_Z],\n ],\n [\n [-HALF_W, FLOOR, -4],\n [-HALF_W, FLOOR, DOOR_Z],\n ],\n [\n [HALF_W, FLOOR, -4],\n [HALF_W, FLOOR, DOOR_Z],\n ],\n ];\n\n const doorW = 0.85;\n const doorTop = FLOOR - 2.3;\n const [, floorY] = project([0, FLOOR, SUBJECT_Z]);\n const figureH = k * 1.75;\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <polygon\n points={poly([\n [-HALF_W, CEIL, DOOR_Z],\n [HALF_W, CEIL, DOOR_Z],\n [HALF_W, FLOOR, DOOR_Z],\n [-HALF_W, FLOOR, DOOR_Z],\n ])}\n fill={colors.wallAlt}\n />\n <polygon\n points={poly([\n [-doorW, doorTop, DOOR_Z],\n [doorW, doorTop, DOOR_Z],\n [doorW, FLOOR, DOOR_Z],\n [-doorW, FLOOR, DOOR_Z],\n ])}\n fill={colors.door}\n />\n {segments}\n {edges.map((edge, i) => {\n const [a, b] = edge.map((p) =>\n project([p[0], p[1], Math.max(p[2], cam + NEAR)]),\n );\n return (\n <line\n key={i}\n x1={a[0]}\n y1={a[1]}\n x2={b[0]}\n y2={b[1]}\n stroke={colors.line}\n strokeOpacity={0.45}\n strokeWidth={1.5}\n />\n );\n })}\n </svg>\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%)\",\n }}\n />\n {children ? (\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n {children}\n </AbsoluteFill>\n ) : (\n <svg\n viewBox=\"0 0 60 175\"\n height={figureH}\n style={{\n position: \"absolute\",\n left: cx - (figureH * 60) / 175 / 2,\n top: floorY - figureH,\n }}\n aria-hidden\n >\n <g fill={colors.figure}>\n <circle cx={30} cy={14} r={12} />\n <path d=\"M12 34 Q30 26 48 34 L54 96 Q54 102 48 102 L44 102 L42 172 L33 172 L30 108 L27 172 L18 172 L16 102 L12 102 Q6 102 6 96 Z\" />\n </g>\n </svg>\n )}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/dolly-zoom.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/duotone-beat.json b/registry-artifacts/duotone-beat.jsonnew file mode 100644index 00000000..908f6bd2--- /dev/null+++ b/registry-artifacts/duotone-beat.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "duotone-beat",+ "title": "Duotone Beat",+ "description": "A two-ink halftone portrait swaps its ink pair on every beat, with a punch-in on the downbeat and a bar indicator.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/duotone-beat/index.tsx",+ "content": "\"use client\";\n\nimport { useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\n/** [shadow ink, highlight ink], hex colors. */\nexport type DuotonePalette = [string, string];\n\nexport type DuotoneBeatProps = {\n /** Portrait image. Without it a head-and-shoulders silhouette is drawn. */\n src?: string;\n /** Ink pairs, one per beat, cycled. Hex colors only (they feed an SVG LUT). */\n palettes?: DuotonePalette[];\n /** Frames per beat at 30fps. Ignored when `bpm` is set. */\n beatFrames?: number;\n bpm?: number;\n /** Beats per bar; the first beat of each bar gets the bigger punch-in. */\n beatsPerBar?: number;\n /** Scale added on the downbeat. Off-beats get a third of it. */\n punch?: number;\n showIndicator?: boolean;\n /** Halftone dot pitch in px at 720p for a printed look. 0 keeps smooth tones. */\n halftone?: number;\n speed?: number;\n};\n\nexport const duotoneBeatDefaults = {\n palettes: [\n [\"#111111\", \"#FFFFFF\"],\n [\"#111111\", \"#E5322D\"],\n [\"#E5322D\", \"#FFFFFF\"],\n [\"#E5322D\", \"#111111\"],\n ] as DuotonePalette[],\n beatFrames: 15,\n beatsPerBar: 4,\n punch: 0.07,\n showIndicator: true,\n halftone: 8,\n speed: 1,\n};\n\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const h = hex.replace(\"#\", \"\").trim();\n const full =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h.slice(0, 6);\n const n = Number.parseInt(full, 16);\n if (Number.isNaN(n)) return [0, 0, 0];\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n}\n\nfunction Ground({\n id,\n width,\n height,\n}: {\n id: string;\n width: number;\n height: number;\n}) {\n return (\n <svg width={width} height={height} aria-hidden>\n <defs>\n <radialGradient id={`${id}-ground`} cx=\"0.5\" cy=\"0.4\" r=\"0.8\">\n <stop offset=\"0\" stopColor=\"#FFFFFF\" />\n <stop offset=\"0.5\" stopColor=\"#F2F2F2\" />\n <stop offset=\"1\" stopColor=\"#C4C4C4\" />\n </radialGradient>\n </defs>\n <rect width={width} height={height} fill={`url(#${id}-ground)`} />\n </svg>\n );\n}\n\nfunction Portrait({\n id,\n width,\n height,\n}: {\n id: string;\n width: number;\n height: number;\n}) {\n const h = height;\n const cx = width / 2;\n const P = (x: number, y: number) => `${cx + x * h} ${y * h}`;\n const head = [\n `M ${P(0, 0.17)}`,\n `C ${P(0.075, 0.17)} ${P(0.118, 0.23)} ${P(0.118, 0.32)}`,\n `C ${P(0.118, 0.4)} ${P(0.095, 0.46)} ${P(0.06, 0.49)}`,\n `C ${P(0.035, 0.51)} ${P(-0.035, 0.51)} ${P(-0.06, 0.49)}`,\n `C ${P(-0.095, 0.46)} ${P(-0.118, 0.4)} ${P(-0.118, 0.32)}`,\n `C ${P(-0.118, 0.23)} ${P(-0.075, 0.17)} ${P(0, 0.17)} Z`,\n ].join(\" \");\n const hair = [\n `M ${P(-0.126, 0.34)}`,\n `C ${P(-0.14, 0.17)} ${P(-0.05, 0.125)} ${P(0.02, 0.135)}`,\n `C ${P(0.11, 0.14)} ${P(0.145, 0.21)} ${P(0.126, 0.32)}`,\n `C ${P(0.11, 0.245)} ${P(0.06, 0.215)} ${P(-0.01, 0.222)}`,\n `C ${P(-0.07, 0.228)} ${P(-0.105, 0.26)} ${P(-0.126, 0.34)} Z`,\n ].join(\" \");\n const torso = [\n `M ${P(-0.07, 0.585)}`,\n `C ${P(-0.13, 0.62)} ${P(-0.3, 0.63)} ${P(-0.36, 0.7)}`,\n `C ${P(-0.41, 0.76)} ${P(-0.43, 0.88)} ${P(-0.44, 1.01)}`,\n `L ${P(0.44, 1.01)}`,\n `C ${P(0.43, 0.88)} ${P(0.41, 0.76)} ${P(0.36, 0.7)}`,\n `C ${P(0.3, 0.63)} ${P(0.13, 0.62)} ${P(0.07, 0.585)} Z`,\n ].join(\" \");\n return (\n <svg width={width} height={height} aria-hidden>\n <defs>\n <linearGradient id={`${id}-skin`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0.2\">\n <stop offset=\"0\" stopColor=\"#121212\" />\n <stop offset=\"0.55\" stopColor=\"#3A3A3A\" />\n <stop offset=\"1\" stopColor=\"#9C9C9C\" />\n </linearGradient>\n <linearGradient id={`${id}-shirt`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0\" stopColor=\"#141414\" />\n <stop offset=\"0.6\" stopColor=\"#262626\" />\n <stop offset=\"1\" stopColor=\"#6A6A6A\" />\n </linearGradient>\n </defs>\n <path\n d={`M ${P(-0.055, 0.45)} L ${P(-0.065, 0.61)} L ${P(0.065, 0.61)} L ${P(0.055, 0.45)} Z`}\n fill=\"#0C0C0C\"\n />\n <path d={torso} fill={`url(#${id}-shirt)`} />\n <path\n d={`M ${P(-0.075, 0.59)} Q ${P(0, 0.67)} ${P(0.075, 0.59)}`}\n fill=\"none\"\n stroke=\"#7A7A7A\"\n strokeWidth={0.012 * h}\n />\n <ellipse\n cx={cx - 0.12 * h}\n cy={0.34 * h}\n rx={0.018 * h}\n ry={0.04 * h}\n fill=\"#161616\"\n />\n <ellipse\n cx={cx + 0.12 * h}\n cy={0.34 * h}\n rx={0.018 * h}\n ry={0.04 * h}\n fill=\"#8A8A8A\"\n />\n <path d={head} fill={`url(#${id}-skin)`} />\n <path d={hair} fill=\"#060606\" />\n {/* Rim light on the key side. */}\n <g\n fill=\"none\"\n stroke=\"#D6D6D6\"\n strokeWidth={0.007 * h}\n strokeLinecap=\"round\"\n style={{ filter: `blur(${0.003 * h}px)` }}\n >\n <path\n d={`M ${P(0.112, 0.27)} C ${P(0.118, 0.36)} ${P(0.105, 0.43)} ${P(0.07, 0.475)}`}\n />\n <path\n d={`M ${P(0.14, 0.625)} C ${P(0.3, 0.64)} ${P(0.39, 0.72)} ${P(0.42, 0.88)}`}\n />\n </g>\n </svg>\n );\n}\n\nexport function DuotoneBeat({\n src,\n palettes = duotoneBeatDefaults.palettes,\n beatFrames = duotoneBeatDefaults.beatFrames,\n bpm,\n beatsPerBar = duotoneBeatDefaults.beatsPerBar,\n punch = duotoneBeatDefaults.punch,\n showIndicator = duotoneBeatDefaults.showIndicator,\n halftone = duotoneBeatDefaults.halftone,\n speed = duotoneBeatDefaults.speed,\n}: DuotoneBeatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const u = Math.min(width, height) / 720;\n const t = (frame / fps) * 30 * speed;\n const period = Math.max(1, bpm ? (30 * 60) / bpm : beatFrames);\n const beat = Math.floor(t / period);\n const local = t - beat * period;\n const bar = Math.max(1, Math.round(beatsPerBar));\n const inBar = beat % bar;\n const list = palettes.length > 0 ? palettes : duotoneBeatDefaults.palettes;\n const [dark, light] = list[beat % list.length].map(hexToRgb);\n\n const strength = inBar === 0 ? punch : punch / 3;\n const scale = 1 + strength * Math.exp(-local / 3.2);\n const rise = interpolate(t, [0, 12], [0.22, 0], {\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const intro = interpolate(t, [0, 12], [0, 1], {\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const table = (i: number) => `${dark[i]} ${light[i]}`;\n // Halftone screen: a radial distance tile, thresholded against the gray.\n const pitch = halftone * u;\n const tile =\n pitch > 0\n ? `data:image/svg+xml;utf8,${encodeURIComponent(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${pitch}\" height=\"${pitch}\"><defs><radialGradient id=\"g\" r=\"0.71\"><stop offset=\"0\" stop-color=\"#000\"/><stop offset=\"1\" stop-color=\"#fff\"/></radialGradient></defs><rect width=\"${pitch}\" height=\"${pitch}\" fill=\"url(#g)\"/></svg>`,\n )}`\n : null;\n const lightHex = list[beat % list.length][1];\n const darkHex = list[beat % list.length][0];\n\n return (\n <AbsoluteFill style={{ overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter\n id={`${id}-duotone`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix type=\"saturate\" values=\"0\" result=\"gray\" />\n {tile ? (\n <>\n <feImage\n href={tile}\n x={0}\n y={0}\n width={pitch}\n height={pitch}\n result=\"dot\"\n />\n <feTile in=\"dot\" result=\"screen\" />\n {/* alpha: 8 - 8 + 1 = 1, color: 8 * (gray - screen) + 1 */}\n <feComposite\n in=\"gray\"\n in2=\"screen\"\n operator=\"arithmetic\"\n k1={0}\n k2={8}\n k3={-8}\n k4={1}\n />\n </>\n ) : null}\n <feComponentTransfer>\n <feFuncR type=\"table\" tableValues={table(0)} />\n <feFuncG type=\"table\" tableValues={table(1)} />\n <feFuncB type=\"table\" tableValues={table(2)} />\n </feComponentTransfer>\n </filter>\n </svg>\n <AbsoluteFill style={{ filter: `url(#${id}-duotone)` }}>\n <AbsoluteFill\n style={{\n backgroundColor: \"#FFFFFF\",\n transform: `scale(${scale})`,\n transformOrigin: \"50% 40%\",\n }}\n >\n {src ? (\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n transform: `scale(${1.12 - 0.12 * intro})`,\n }}\n />\n ) : (\n <>\n <Ground id={id} width={width} height={height} />\n <AbsoluteFill\n style={{ transform: `translateY(${rise * height}px)` }}\n >\n <Portrait id={id} width={width} height={height} />\n </AbsoluteFill>\n </>\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n {showIndicator ? (\n <div\n style={{\n position: \"absolute\",\n left: 48 * u,\n bottom: 44 * u,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10 * u,\n }}\n >\n {Array.from({ length: bar }, (_, i) => (\n <div\n key={i}\n style={{\n width: 26 * u,\n height: 26 * u,\n boxSizing: \"border-box\",\n border: `${2.5 * u}px solid ${darkHex}`,\n backgroundColor: i === inBar ? darkHex : \"transparent\",\n transform: `scale(${i === inBar ? 1 + 0.25 * Math.exp(-local / 3) : 1})`,\n }}\n />\n ))}\n <span\n style={{\n marginLeft: 10 * u,\n fontFamily: MONO,\n fontSize: 20 * u,\n fontWeight: 700,\n letterSpacing: 2 * u,\n color: darkHex,\n backgroundColor: lightHex,\n }}\n >\n {String(Math.round((30 * 60) / period))} BPM\n </span>\n </div>\n ) : null}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/duotone-beat.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/elements/accordion-unfold.json b/registry-artifacts/elements/accordion-unfold.jsonnew file mode 100644index 00000000..1ace38fd--- /dev/null+++ b/registry-artifacts/elements/accordion-unfold.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Accordion Unfold",+ "durationInFrames": 26,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "accordion-unfold",+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype AccordionUnfoldProps = {\n /** Lockup printed across the card. Use a color that reads on `color`. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Number of vertical pleats. */\n panels?: number;\n /** Paper color of the card. */\n color?: string;\n /** Darkness of the panels facing away from the light, 0 to 1. */\n shade?: number;\n backgroundColor?: string;\n /** Fold angle of each pleat at the start, in degrees. */\n foldAngle?: number;\n speed?: number;\n};\n\nconst accordionUnfoldDefaults = {\n panels: 6,\n color: \"#FFFFFF\",\n shade: 0.55,\n backgroundColor: \"#111111\",\n foldAngle: 82,\n speed: 1,\n};\n\nconst START = 4;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nfunction AccordionUnfoldBase(props: AccordionUnfoldProps) {\n const { children, panels, color, shade, backgroundColor, foldAngle, speed } =\n { ...accordionUnfoldDefaults, ...props };\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const n = Math.max(2, Math.round(panels));\n const cardW = Math.round(Math.min(width * 0.66, height * 1.3));\n const cardH = Math.round(Math.min(height * 0.4, cardW * 0.4));\n const pw = cardW / n;\n\n const open = spring({\n frame: t - START,\n fps,\n config: { damping: 15, stiffness: 70, mass: 0.9 },\n });\n const theta = foldAngle * (1 - open);\n const rad = (theta * Math.PI) / 180;\n // Keep the pleated stack centered while its projected width grows.\n const shift = (cardW - cardW * Math.cos(rad)) / 2;\n const lift = interpolate(t, [0, START + 2], [0.92, 1], clamp);\n const appear = interpolate(t, [0, 3], [0, 1], clamp);\n const flat = Math.abs(theta) < 0.3;\n\n const print = (offset: number) => (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: -offset,\n width: cardW,\n height: cardH,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={backgroundColor}\n dot={color}\n text={backgroundColor}\n scale={0.8}\n />\n )}\n </div>\n );\n\n const panel = (i: number): React.ReactNode => {\n if (i >= n) return null;\n const angle = i === 0 ? theta : (i % 2 === 1 ? -2 : 2) * theta;\n const facing = i % 2 === 0 ? 1 : -1;\n const tilt = Math.abs(Math.sin(rad));\n const darkness = facing > 0 ? shade * tilt : shade * 0.25 * tilt;\n return (\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: i === 0 ? 0 : pw,\n width: pw,\n height: cardH,\n transformOrigin: \"0% 50%\",\n transform: `rotateY(${angle}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n // A hair of bleed hides antialiased seams between pleats.\n width: pw + 1,\n overflow: \"hidden\",\n backgroundColor: color,\n backfaceVisibility: \"hidden\",\n }}\n >\n {print(i * pw)}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n facing > 0\n ? `linear-gradient(90deg, rgba(0,0,0,${darkness * 0.6}), rgba(0,0,0,${darkness}))`\n : `linear-gradient(90deg, rgba(255,255,255,${0.12 * tilt}), rgba(0,0,0,${darkness}))`,\n }}\n />\n </div>\n {panel(i + 1)}\n </div>\n );\n };\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n perspective: cardW * 1.8,\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: cardW,\n height: cardH,\n opacity: appear,\n transform: `translateX(${shift}px) scale(${lift})`,\n transformStyle: \"preserve-3d\",\n }}\n >\n {flat ? (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor: color,\n overflow: \"hidden\",\n }}\n >\n {print(0)}\n </div>\n ) : (\n panel(0)\n )}\n </div>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n panels: {\n type: \"number\",\n default: 6,\n min: 2,\n max: 12,\n step: 1,\n description: \"Panels\",\n hiddenFromList: false,\n },\n foldAngle: {\n type: \"number\",\n default: 82,\n min: 10,\n max: 89,\n step: 1,\n description: \"Fold angle\",\n hiddenFromList: false,\n },\n shade: {\n type: \"number\",\n default: 0.55,\n min: 0,\n max: 1,\n step: 0.05,\n description: \"Shade\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Paper\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"panels\",\"foldAngle\",\"shade\",\"color\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n panels: 6,\n foldAngle: 82,\n shade: 0.55,\n color: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype AccordionUnfoldElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AccordionUnfoldBase>;\n\nconst AccordionUnfoldInner = forwardRef<\n HTMLDivElement,\n AccordionUnfoldElementProps & { 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 ?? \"<AccordionUnfold>\"}\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 <AccordionUnfoldBase\n {...(componentProps as unknown as ComponentProps<typeof AccordionUnfoldBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AccordionUnfold = Interactive.withSchema({\n Component: AccordionUnfoldInner,\n componentName: \"<AccordionUnfold>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 26+}diff --git a/registry-artifacts/elements/anamorphic-flare.json b/registry-artifacts/elements/anamorphic-flare.jsonnew file mode 100644index 00000000..b20d42f4--- /dev/null+++ b/registry-artifacts/elements/anamorphic-flare.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Anamorphic Flare",+ "durationInFrames": 40,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "anamorphic-flare",+ "sourceCode": "import React, { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype AnamorphicFlareProps = {\n /** Lockup revealed behind the streak. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Warm tint of the streak glow and ghosts. */\n tint?: string;\n /** Color of the hot core line. */\n coreColor?: string;\n backgroundColor?: string;\n /** Number of ghost orbs mirrored across the frame center. */\n ghosts?: number;\n /** Vertical position of the streak, 0 to 1. */\n y?: number;\n seed?: number;\n speed?: number;\n};\n\nconst anamorphicFlareDefaults = {\n tint: \"#E5322D\",\n coreColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n ghosts: 4,\n y: 0.5,\n seed: 2,\n speed: 1,\n};\n\nconst IGNITE = 6;\nconst CROSS_START = 4;\nconst CROSS_END = 26;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nfunction AnamorphicFlareBase(props: AnamorphicFlareProps) {\n const { children, tint, coreColor, backgroundColor, ghosts, y, seed, speed } =\n { ...anamorphicFlareDefaults, ...props };\n const uid = `anamorphic-flare-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const cy = y * height;\n const cx = width / 2;\n\n const head = interpolate(t, [CROSS_START, CROSS_END], [0.07, 1.12], {\n ...clamp,\n easing: Easing.bezier(0.45, 0, 0.4, 1),\n });\n const hx = head * width;\n const ignite = interpolate(t, [0, IGNITE], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const fade = interpolate(t, [CROSS_END - 6, CROSS_END + 2], [1, 0], clamp);\n const power = ignite * fade;\n const streakLen =\n width *\n interpolate(t, [0, 12], [0.04, 1.3], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n const coreH = Math.max(2, height * 0.004);\n const glowH = height * 0.05;\n const residual = interpolate(\n t,\n [CROSS_END - 2, CROSS_END + 14],\n [0, 0.14],\n clamp,\n );\n const soft = width * 0.08;\n const mask = `linear-gradient(90deg, #000 0px, #000 ${hx - soft}px, transparent ${hx}px)`;\n\n const ghostList = Array.from(\n { length: Math.max(0, Math.round(ghosts)) },\n (_, i) => {\n const k = -1.3 + random(`anamorphic-flare-${seed}-${i}-k`) * 2.2;\n return {\n x: cx - (hx - cx) * k,\n r: height * (0.025 + 0.07 * random(`anamorphic-flare-${seed}-${i}-r`)),\n o: 0.12 + 0.18 * random(`anamorphic-flare-${seed}-${i}-o`),\n dy: (random(`anamorphic-flare-${seed}-${i}-y`) - 0.5) * height * 0.05,\n };\n },\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <defs>\n <linearGradient id={`${uid}-trail`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0\" stopColor={tint} stopOpacity={0} />\n <stop offset=\"0.5\" stopColor={tint} stopOpacity={1} />\n <stop offset=\"1\" stopColor={tint} stopOpacity={0} />\n </linearGradient>\n </defs>\n <rect\n x={0}\n y={cy - 1}\n width={width}\n height={2}\n fill={`url(#${uid}-trail)`}\n opacity={residual}\n />\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n WebkitMaskImage: mask,\n maskImage: mask,\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={tint}\n dot={backgroundColor}\n text={coreColor}\n />\n )}\n </AbsoluteFill>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{\n position: \"absolute\",\n inset: 0,\n mixBlendMode: \"screen\",\n }}\n >\n <defs>\n <linearGradient id={`${uid}-core`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0\" stopColor={coreColor} stopOpacity={0} />\n <stop offset=\"0.5\" stopColor={coreColor} stopOpacity={1} />\n <stop offset=\"1\" stopColor={coreColor} stopOpacity={0} />\n </linearGradient>\n <radialGradient id={`${uid}-bloom`}>\n <stop offset=\"0\" stopColor={coreColor} stopOpacity={1} />\n <stop offset=\"0.25\" stopColor={tint} stopOpacity={0.7} />\n <stop offset=\"1\" stopColor={tint} stopOpacity={0} />\n </radialGradient>\n <radialGradient id={`${uid}-ghost`}>\n <stop offset=\"0\" stopColor={tint} stopOpacity={0.15} />\n <stop offset=\"0.8\" stopColor={tint} stopOpacity={0.5} />\n <stop offset=\"1\" stopColor={tint} stopOpacity={0} />\n </radialGradient>\n <filter\n id={`${uid}-blur`}\n x={-width}\n y={-height}\n width={width * 3}\n height={height * 3}\n filterUnits=\"userSpaceOnUse\"\n >\n <feGaussianBlur stdDeviation={glowH * 0.35} />\n </filter>\n </defs>\n <g opacity={power}>\n <rect\n x={hx - streakLen * 0.45}\n y={cy - glowH / 2}\n width={streakLen * 0.9}\n height={glowH}\n fill={`url(#${uid}-trail)`}\n opacity={0.55}\n filter={`url(#${uid}-blur)`}\n />\n <rect\n x={hx - streakLen / 2}\n y={cy - coreH / 2}\n width={streakLen}\n height={coreH}\n fill={`url(#${uid}-core)`}\n />\n <ellipse\n cx={hx}\n cy={cy}\n rx={height * 0.16}\n ry={height * 0.1}\n fill={`url(#${uid}-bloom)`}\n />\n {ghostList.map((g, i) => (\n <circle\n key={i}\n cx={g.x}\n cy={cy + g.dy}\n r={g.r}\n fill={`url(#${uid}-ghost)`}\n opacity={g.o * 2}\n />\n ))}\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n ghosts: {\n type: \"number\",\n default: 4,\n min: 0,\n max: 8,\n step: 1,\n description: \"Ghosts\",\n hiddenFromList: false,\n },\n y: {\n type: \"number\",\n default: 0.5,\n min: 0.1,\n max: 0.9,\n step: 0.01,\n description: \"Streak height\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 2,\n min: 1,\n max: 99,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n tint: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Tint\",\n },\n coreColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Core\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"ghosts\",\"y\",\"seed\",\"tint\",\"coreColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n ghosts: 4,\n y: 0.5,\n seed: 2,\n tint: \"#E5322D\",\n coreColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype AnamorphicFlareElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AnamorphicFlareBase>;\n\nconst AnamorphicFlareInner = forwardRef<\n HTMLDivElement,\n AnamorphicFlareElementProps & { 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 ?? \"<AnamorphicFlare>\"}\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 <AnamorphicFlareBase\n {...(componentProps as unknown as ComponentProps<typeof AnamorphicFlareBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AnamorphicFlare = Interactive.withSchema({\n Component: AnamorphicFlareInner,\n componentName: \"<AnamorphicFlare>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 40+}diff --git a/registry-artifacts/elements/blueprint.json b/registry-artifacts/elements/blueprint.jsonnew file mode 100644index 00000000..8b852c3e--- /dev/null+++ b/registry-artifacts/elements/blueprint.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Blueprint",+ "durationInFrames": 45,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "blueprint",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype BlueprintLabels = {\n width: string;\n height: string;\n callout: string;\n title: string;\n};\n\ntype BlueprintProps = {\n /** Product to convert. Its silhouette and dark details become white linework. Defaults to a red device. */\n children?: ReactNode;\n /** Measured box around the product, as fractions of the frame [width, height]. */\n box?: [number, number];\n /** Point the red callout points at, as fractions of the box [x, y]. */\n calloutAt?: [number, number];\n blueprintColor?: string;\n lineColor?: string;\n calloutColor?: string;\n /** Ground behind the product before the wipe. */\n background?: string;\n productColor?: string;\n labels?: Partial<BlueprintLabels>;\n speed?: number;\n};\n\nconst blueprintDefaults = {\n box: [0.17, 0.6] as [number, number],\n calloutAt: [0.5, 0.11] as [number, number],\n blueprintColor: \"#173C8F\",\n lineColor: \"#FFFFFF\",\n calloutColor: \"#E5322D\",\n background: \"#FFFFFF\",\n productColor: \"#E5322D\",\n labels: {\n width: \"71.6 mm\",\n height: \"147.5 mm\",\n callout: \"SENSOR\",\n title: \"DWG A-01 SCALE 1:1\",\n } as BlueprintLabels,\n speed: 1,\n};\n\nconst blueprintLength = 45;\n\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst ease = (t: number, from: number, to: number) =>\n interpolate(t, [from, to], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n\nfunction BlueprintBase({\n children,\n box = blueprintDefaults.box,\n calloutAt = blueprintDefaults.calloutAt,\n blueprintColor = blueprintDefaults.blueprintColor,\n lineColor = blueprintDefaults.lineColor,\n calloutColor = blueprintDefaults.calloutColor,\n background = blueprintDefaults.background,\n productColor = blueprintDefaults.productColor,\n labels,\n speed = blueprintDefaults.speed,\n}: BlueprintProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const text = { ...blueprintDefaults.labels, ...labels };\n const t = (frame / fps) * 30 * speed;\n const u = Math.min(width, height) / 720;\n\n const cx = width * 0.47;\n const cy = height * 0.46;\n const bw = box[0] * width;\n const bh = box[1] * height;\n const x0 = cx - bw / 2;\n const x1 = cx + bw / 2;\n const y0 = cy - bh / 2;\n const y1 = cy + bh / 2;\n const radius = Math.min(bw, bh) * 0.16;\n const dot = { x: x0 + calloutAt[0] * bw, y: y0 + calloutAt[1] * bh };\n\n const wipe = interpolate(t, [6, 24], [-0.04, 1.04], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const wipeX = wipe * width;\n const outline = ease(t, 8, 28);\n const extension = ease(t, 22, 28);\n const dims = ease(t, 24, 32);\n const label = ease(t, 30, 36);\n const leader = ease(t, 32, 40);\n const bubble = interpolate(t, [36, 42], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.back(2)),\n });\n const calloutText = ease(t, 38, 44);\n\n const stroke = 2.4 * u;\n const thin = 1.2 * u;\n const tick = 7 * u;\n const dimY = y1 + 0.08 * height;\n const dimX = x1 + 0.06 * width;\n const half = (a: number, b: number, p: number) => [\n (a + b) / 2 - ((b - a) / 2) * p,\n (a + b) / 2 + ((b - a) / 2) * p,\n ];\n const [hx0, hx1] = half(x0, x1, dims);\n const [vy0, vy1] = half(y0, y1, dims);\n // Callout goes left of the product when the label fits, otherwise above it.\n const ring = Math.min(bw, bh) * 0.11;\n const labelWidth = text.callout.length * 11.8 * u + 26 * u;\n const sideways = x0 - 0.14 * width - labelWidth > 0.03 * width;\n const lead = sideways\n ? { x: x0 - 0.14 * width, y: y0 + 0.06 * height }\n : {\n x: Math.max(0.06 * width, dot.x - 0.1 * width),\n y: Math.max(0.08 * height, y0 - 0.1 * height),\n };\n const elbow = sideways\n ? `L ${lead.x + 0.06 * width} ${lead.y} H ${lead.x}`\n : `L ${lead.x} ${lead.y}`;\n const draw = (p: number) => ({\n pathLength: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1 - p,\n opacity: p > 0 ? 1 : 0,\n });\n const minor = 22 * u;\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n <filter\n id={`${id}-lines`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feMorphology\n in=\"SourceAlpha\"\n operator=\"dilate\"\n radius={1.6 * u}\n result=\"grown\"\n />\n <feComposite\n in=\"grown\"\n in2=\"SourceAlpha\"\n operator=\"out\"\n result=\"edge\"\n />\n <feColorMatrix\n in=\"SourceGraphic\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 -6 -1 4 -1.2\"\n result=\"dark\"\n />\n <feMorphology\n in=\"dark\"\n operator=\"dilate\"\n radius={1.6 * u}\n result=\"darkGrown\"\n />\n <feComposite\n in=\"darkGrown\"\n in2=\"dark\"\n operator=\"out\"\n result=\"darkEdge\"\n />\n <feMerge result=\"all\">\n <feMergeNode in=\"edge\" />\n <feMergeNode in=\"darkEdge\" />\n </feMerge>\n <feFlood floodColor={lineColor} />\n <feComposite in2=\"all\" operator=\"in\" />\n </filter>\n </defs>\n </svg>\n\n {/* Product, before the wipe. */}\n <AbsoluteFill>\n {children ? (\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n <div\n style={{\n transform: `translate(${cx - width / 2}px, ${cy - height / 2}px)`,\n }}\n >\n {children}\n </div>\n </AbsoluteFill>\n ) : (\n <svg width={width} height={height} aria-hidden>\n <rect\n x={x0}\n y={y0 + 10 * u}\n width={bw}\n height={bh}\n rx={radius}\n fill=\"#000\"\n opacity={0.12}\n style={{ filter: `blur(${14 * u}px)` }}\n />\n <rect\n x={x0}\n y={y0}\n width={bw}\n height={bh}\n rx={radius}\n fill={productColor}\n />\n <circle cx={dot.x} cy={dot.y} r={bw * 0.06} fill=\"#111111\" />\n </svg>\n )}\n </AbsoluteFill>\n\n {/* Technical drawing, revealed left to right. */}\n <AbsoluteFill style={{ clipPath: `inset(0 ${width - wipeX}px 0 0)` }}>\n <svg width={width} height={height} aria-hidden>\n <defs>\n <pattern\n id={`${id}-grid`}\n width={minor * 5}\n height={minor * 5}\n patternUnits=\"userSpaceOnUse\"\n >\n <path\n d={Array.from(\n { length: 5 },\n (_, i) =>\n `M ${i * minor} 0 V ${minor * 5} M 0 ${i * minor} H ${minor * 5}`,\n ).join(\" \")}\n stroke={lineColor}\n strokeOpacity={0.09}\n strokeWidth={u}\n />\n <path\n d={`M 0 0 V ${minor * 5} M 0 0 H ${minor * 5}`}\n stroke={lineColor}\n strokeOpacity={0.22}\n strokeWidth={u}\n />\n </pattern>\n </defs>\n <rect width={width} height={height} fill={blueprintColor} />\n <rect width={width} height={height} fill={`url(#${id}-grid)`} />\n </svg>\n {children ? (\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: `url(#${id}-lines)`,\n clipPath: `inset(0 ${width * (1 - outline)}px 0 0)`,\n }}\n >\n <div\n style={{\n transform: `translate(${cx - width / 2}px, ${cy - height / 2}px)`,\n }}\n >\n {children}\n </div>\n </AbsoluteFill>\n ) : null}\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <g fill=\"none\" stroke={lineColor} strokeLinecap=\"round\">\n {children ? null : (\n <>\n <rect\n x={x0}\n y={y0}\n width={bw}\n height={bh}\n rx={radius}\n strokeWidth={stroke}\n {...draw(outline)}\n />\n <rect\n x={x0 + bw * 0.07}\n y={y0 + bw * 0.07}\n width={bw * 0.86}\n height={bh - bw * 0.14}\n rx={radius * 0.7}\n strokeWidth={thin}\n strokeOpacity={0.7}\n {...draw(outline)}\n />\n <circle\n cx={dot.x}\n cy={dot.y}\n r={bw * 0.06}\n strokeWidth={stroke}\n {...draw(outline)}\n />\n </>\n )}\n {/* Center lines */}\n <path\n d={`M ${cx} ${y0 - 0.05 * height} V ${y1 + 0.05 * height} M ${x0 - 0.04 * width} ${cy} H ${x1 + 0.04 * width}`}\n strokeWidth={thin}\n strokeOpacity={0.55 * outline}\n strokeDasharray={`${14 * u} ${4 * u} ${3 * u} ${4 * u}`}\n />\n {/* Extension lines */}\n <path\n d={`M ${x0} ${y1 + 8 * u} V ${y1 + 8 * u + (dimY - y1) * extension} M ${x1} ${y1 + 8 * u} V ${y1 + 8 * u + (dimY - y1) * extension} M ${x1 + 8 * u} ${y0} H ${x1 + 8 * u + (dimX - x1) * extension} M ${x1 + 8 * u} ${y1} H ${x1 + 8 * u + (dimX - x1) * extension}`}\n strokeWidth={thin}\n strokeOpacity={0.8}\n />\n {/* Dimension lines with architectural ticks */}\n <path\n d={`M ${hx0} ${dimY} H ${hx1} M ${dimX} ${vy0} V ${vy1}`}\n strokeWidth={thin * 1.3}\n />\n {dims > 0.98\n ? [\n [x0, dimY],\n [x1, dimY],\n [dimX, y0],\n [dimX, y1],\n ].map(([x, y]) => (\n <line\n key={`${x}-${y}`}\n x1={x - tick}\n y1={y + tick}\n x2={x + tick}\n y2={y - tick}\n strokeWidth={stroke}\n />\n ))\n : null}\n </g>\n <g\n fontFamily={MONO}\n fontSize={17 * u}\n letterSpacing={1.5 * u}\n fill={lineColor}\n opacity={label}\n >\n <rect\n x={cx - 62 * u}\n y={dimY - 12 * u}\n width={124 * u}\n height={24 * u}\n fill={blueprintColor}\n />\n <text x={cx} y={dimY + 6 * u} textAnchor=\"middle\">\n {text.width}\n </text>\n {bh > 190 * u ? (\n <g transform={`translate(${dimX} ${cy}) rotate(-90)`}>\n <rect\n x={-66 * u}\n y={-12 * u}\n width={132 * u}\n height={24 * u}\n fill={blueprintColor}\n />\n <text y={6 * u} textAnchor=\"middle\">\n {text.height}\n </text>\n </g>\n ) : (\n <text x={dimX + 16 * u} y={cy + 6 * u}>\n {text.height}\n </text>\n )}\n <g\n transform={`translate(${width - 0.05 * width} ${height - 0.06 * height})`}\n >\n <rect\n x={-290 * u}\n y={-40 * u}\n width={290 * u}\n height={40 * u}\n fill=\"none\"\n stroke={lineColor}\n strokeWidth={thin}\n />\n <text x={-276 * u} y={-14 * u} fontSize={14 * u}>\n {text.title}\n </text>\n </g>\n </g>\n {/* Red callout */}\n <g\n stroke={calloutColor}\n fill=\"none\"\n strokeWidth={stroke}\n strokeLinecap=\"round\"\n >\n <circle cx={dot.x} cy={dot.y} r={ring} {...draw(leader)} />\n <path\n d={`M ${dot.x - ring * 0.72} ${dot.y - ring * 0.72} ${elbow}`}\n {...draw(leader)}\n />\n <circle\n cx={lead.x}\n cy={lead.y}\n r={16 * u * bubble}\n fill={calloutColor}\n stroke=\"none\"\n />\n </g>\n <g fontFamily={MONO} opacity={calloutText}>\n <text\n x={lead.x}\n y={lead.y + 6 * u}\n textAnchor=\"middle\"\n fontSize={16 * u}\n fontWeight={700}\n fill={lineColor}\n >\n A\n </text>\n <text\n x={sideways ? lead.x - 26 * u : lead.x + 26 * u}\n y={lead.y + 6 * u}\n textAnchor={sideways ? \"end\" : \"start\"}\n fontSize={17 * u}\n letterSpacing={1.5 * u}\n fill={lineColor}\n >\n {text.callout}\n </text>\n </g>\n </svg>\n </AbsoluteFill>\n\n {/* Scan edge */}\n <AbsoluteFill\n style={{\n left: wipeX - 2 * u,\n width: 4 * u,\n backgroundColor: lineColor,\n boxShadow: `0 0 ${24 * u}px ${6 * u}px ${lineColor}`,\n opacity: wipe > 0 && wipe < 1 ? 0.9 : 0,\n }}\n />\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n blueprintColor: {\n type: \"color\",\n default: \"#173C8F\",\n description: \"Blueprint\",\n },\n lineColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Lines\",\n },\n calloutColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Callout\",\n },\n productColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Product\",\n },\n background: {\n type: \"color\",\n default: \"#FFFFFF\",\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([\"blueprintColor\",\"lineColor\",\"calloutColor\",\"productColor\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n blueprintColor: \"#173C8F\",\n lineColor: \"#FFFFFF\",\n calloutColor: \"#E5322D\",\n productColor: \"#E5322D\",\n background: \"#FFFFFF\",\n speed: 1,\n};\n\ntype BlueprintElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BlueprintBase>;\n\nconst BlueprintInner = forwardRef<\n HTMLDivElement,\n BlueprintElementProps & { 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 ?? \"<Blueprint>\"}\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 <BlueprintBase\n {...(componentProps as unknown as ComponentProps<typeof BlueprintBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Blueprint = Interactive.withSchema({\n Component: BlueprintInner,\n componentName: \"<Blueprint>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 45+}diff --git a/registry-artifacts/elements/brick-mosaic.json b/registry-artifacts/elements/brick-mosaic.jsonnew file mode 100644index 00000000..51134bdb--- /dev/null+++ b/registry-artifacts/elements/brick-mosaic.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Brick Mosaic",+ "durationInFrames": 56,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "brick-mosaic",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype BrickMosaicProps = {\n /**\n * Pixel art to build. Either rows of characters looked up in `colors`\n * (unknown characters and spaces leave the cell empty) or a 2D grid of CSS\n * colors (\"\" for empty). Overrides `cols` and `rows`.\n */\n pattern?: string[] | string[][];\n /** Grid size of the default image. */\n cols?: number;\n rows?: number;\n /** Character to color map for string patterns. */\n colors?: Record<string, string>;\n /** Baseplate color behind the bricks. */\n background?: string;\n /** Frames between rows. */\n rowDelay?: number;\n speed?: number;\n};\n\nconst brickMosaicDefaults = {\n cols: 24,\n rows: 14,\n colors: {\n \"#\": \"#E5322D\",\n \".\": \"#FFFFFF\",\n x: \"#111111\",\n } as Record<string, string>,\n background: \"#111111\",\n rowDelay: 3,\n speed: 1,\n};\n\nconst FALL = 7;\nconst HOP = 5;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction defaultPattern(cols: number, rows: number): string[] {\n const cx = (cols - 1) / 2;\n const cy = (rows - 1) / 2;\n const r = Math.min(cols, rows) * 0.4;\n return Array.from({ length: rows }, (_, y) =>\n Array.from({ length: cols }, (_, x) =>\n Math.hypot(x - cx, y - cy) <= r ? \"#\" : \".\",\n ).join(\"\"),\n );\n}\n\nfunction getBrickMosaicLength(rows: number, cols: number, rowDelay = 3) {\n return Math.ceil((rows - 1) * rowDelay + cols * 0.12 + 1.5 + FALL + HOP);\n}\n\nfunction BrickMosaicBase({\n pattern,\n cols = brickMosaicDefaults.cols,\n rows = brickMosaicDefaults.rows,\n colors = brickMosaicDefaults.colors,\n background = brickMosaicDefaults.background,\n rowDelay = brickMosaicDefaults.rowDelay,\n speed = brickMosaicDefaults.speed,\n}: BrickMosaicProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const t = (frame / fps) * 30 * speed;\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n\n const grid = useMemo(() => {\n const source = pattern ?? defaultPattern(cols, rows);\n return source.map((row) =>\n (typeof row === \"string\" ? row.split(\"\") : row).map((cell) =>\n typeof row === \"string\" ? (colors[cell] ?? \"\") : cell,\n ),\n );\n }, [pattern, cols, rows, colors]);\n const nRows = grid.length;\n const nCols = Math.max(1, ...grid.map((row) => row.length));\n const s = Math.min((W * 0.86) / nCols, (H * 0.86) / nRows);\n const ox = (W - s * nCols) / 2;\n const oy = (H - s * nRows) / 2;\n const gap = s * 0.04;\n const bevel = s * 0.09;\n const stud = s * 0.28;\n\n const bricks = grid.flatMap((row, r) =>\n row.map((color, col) => {\n if (!color) return null;\n const fromBottom = nRows - 1 - r;\n const start =\n fromBottom * rowDelay + col * 0.12 + random(`brick-${r}-${col}`) * 1.5;\n const local = t - start;\n if (local < 0) return null;\n let y = 0;\n if (local < FALL) {\n const p = local / FALL;\n y = -s * 1.8 * (1 - p * p);\n } else if (local < FALL + HOP) {\n const p = (local - FALL) / HOP;\n y = -s * 0.12 * 4 * p * (1 - p);\n }\n const opacity = interpolate(local, [0, 2], [0, 1], clamp);\n const x0 = ox + col * s + gap / 2;\n const y0 = oy + r * s + gap / 2 + y;\n const b = s - gap;\n return (\n <g\n key={`${r}-${col}`}\n transform={`translate(${x0} ${y0})`}\n opacity={opacity}\n >\n <rect width={b} height={b} rx={s * 0.06} fill={color} />\n <path\n d={`M 0 ${b} V 0 H ${b} L ${b - bevel} ${bevel} H ${bevel} V ${b - bevel} Z`}\n fill=\"#FFFFFF\"\n opacity={0.22}\n />\n <path\n d={`M ${b} 0 V ${b} H 0 L ${bevel} ${b - bevel} H ${b - bevel} V ${bevel} Z`}\n fill=\"#000000\"\n opacity={0.22}\n />\n <circle\n cx={b / 2 + s * 0.035}\n cy={b / 2 + s * 0.05}\n r={stud}\n fill=\"#000000\"\n opacity={0.28}\n />\n <circle cx={b / 2} cy={b / 2} r={stud} fill={color} />\n <circle cx={b / 2} cy={b / 2} r={stud} fill={`url(#${id}-stud)`} />\n </g>\n );\n }),\n );\n\n const landed = interpolate(t, [0, 10], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden>\n <defs>\n <linearGradient\n id={`${id}-stud`}\n x1=\"0.15\"\n y1=\"0.1\"\n x2=\"0.85\"\n y2=\"0.9\"\n >\n <stop offset=\"0\" stopColor=\"#FFFFFF\" stopOpacity={0.5} />\n <stop offset=\"0.45\" stopColor=\"#FFFFFF\" stopOpacity={0} />\n <stop offset=\"1\" stopColor=\"#000000\" stopOpacity={0.22} />\n </linearGradient>\n </defs>\n {/* Baseplate studs the bricks snap onto. */}\n <g fill=\"#FFFFFF\" opacity={0.07 * landed}>\n {grid.flatMap((row, r) =>\n row.map((_, col) => (\n <circle\n key={`${r}-${col}`}\n cx={ox + (col + 0.5) * s}\n cy={oy + (r + 0.5) * s}\n r={stud}\n />\n )),\n )}\n </g>\n {bricks}\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n cols: {\n type: \"number\",\n default: 24,\n min: 6,\n max: 40,\n step: 1,\n description: \"Columns\",\n hiddenFromList: false,\n },\n rows: {\n type: \"number\",\n default: 14,\n min: 4,\n max: 24,\n step: 1,\n description: \"Rows\",\n hiddenFromList: false,\n },\n rowDelay: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 8,\n step: 1,\n description: \"Row delay\",\n hiddenFromList: false,\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Baseplate\",\n },\n speed: {\n 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([\"cols\",\"rows\",\"rowDelay\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n cols: 24,\n rows: 14,\n rowDelay: 3,\n background: \"#111111\",\n speed: 1,\n};\n\ntype BrickMosaicElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof BrickMosaicBase>;\n\nconst BrickMosaicInner = forwardRef<\n HTMLDivElement,\n BrickMosaicElementProps & { 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 ?? \"<BrickMosaic>\"}\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 <BrickMosaicBase\n {...(componentProps as unknown as ComponentProps<typeof BrickMosaicBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const BrickMosaic = Interactive.withSchema({\n Component: BrickMosaicInner,\n componentName: \"<BrickMosaic>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 56+}diff --git a/registry-artifacts/elements/cloth-reveal.json b/registry-artifacts/elements/cloth-reveal.jsonnew file mode 100644index 00000000..7692cd07--- /dev/null+++ b/registry-artifacts/elements/cloth-reveal.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Cloth Reveal",+ "durationInFrames": 34,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "cloth-reveal",+ "sourceCode": "import React, { forwardRef, useId, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype ClothRevealDirection = \"right\" | \"left\" | \"up\" | \"down\";\n\ntype ClothRevealProps = {\n /** Content hidden under the sheet. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n clothColor?: string;\n /** Underside tint, seen where the sheet folds over. */\n undersideColor?: string;\n /** Background behind the children. */\n background?: string;\n /** Which way the sheet is yanked. */\n direction?: ClothRevealDirection;\n /** Frame (at 30fps) when the tug starts. */\n delay?: number;\n seed?: number;\n speed?: number;\n};\n\nconst clothRevealDefaults = {\n clothColor: \"#E5322D\",\n undersideColor: \"#8E1A16\",\n background: \"#111111\",\n direction: \"right\" as ClothRevealDirection,\n delay: 6,\n seed: 2,\n speed: 1,\n};\n\nconst COLS = 40;\nconst ROWS = 24;\nconst FRAMES = 72;\nconst SUBSTEPS = 5;\nconst ITERATIONS = 12;\n\ntype Sim = { frames: Float32Array[]; heights: Float32Array };\n\nconst PATHS: Record<\n ClothRevealDirection,\n { corner: [number, number]; dir: [number, number] }\n> = {\n right: { corner: [1, 0], dir: [1, -0.32] },\n left: { corner: [0, 0], dir: [-1, -0.32] },\n up: { corner: [1, 0], dir: [0.4, -1] },\n down: { corner: [0, 1], dir: [-0.4, 1] },\n};\n\nconst smooth = (v: number) => {\n const t = Math.min(1, Math.max(0, v));\n return t * t * (3 - 2 * t);\n};\n\n// Verlet cloth in table space: x/y on the table, z up toward the camera. The\n// sheet rests on a soft bump (whatever it hides) with seeded wrinkles baked\n// into its rest shape, so frame 0 is already at equilibrium.\nfunction simulate(\n width: number,\n height: number,\n direction: ClothRevealDirection,\n delay: number,\n seed: number,\n): Sim {\n const n = COLS * ROWS;\n const pos = new Float64Array(n * 3);\n const prev = new Float64Array(n * 3);\n const floorZ = new Float64Array(n);\n const pinned = new Uint8Array(n);\n const unit = Math.min(width, height);\n const bump = (x: number, y: number) => {\n const dx = (x - width / 2) / (width * 0.3);\n const dy = (y - height / 2) / (height * 0.34);\n return unit * 0.09 * Math.exp(-(dx * dx + dy * dy) * 1.4);\n };\n // Folds radiate from the hidden object and deepen toward the hem, plus a\n // couple of long soft waves so the sheet never looks ironed.\n const folds = 7 + Math.floor(random(`cloth-${seed}-n`) * 4);\n const twist = random(`cloth-${seed}-t`) * Math.PI * 2;\n const waves = [0, 1].map((k) => ({\n a: random(`cloth-${seed}-a${k}`) * Math.PI,\n f: 0.8 + random(`cloth-${seed}-f${k}`) * 1.2,\n p: random(`cloth-${seed}-p${k}`) * Math.PI * 2,\n }));\n\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n const i = r * COLS + c;\n const u = c / (COLS - 1);\n const v = r / (ROWS - 1);\n const x = width * (-0.06 + u * 1.12);\n const y = height * (-0.08 + v * 1.16);\n const dx = (x - width / 2) / width;\n const dy = (y - height / 2) / width;\n const rho = Math.hypot(dx, dy);\n const theta = Math.atan2(dy, dx);\n const radial =\n (0.5 + 0.5 * Math.sin(theta * folds + twist + rho * 9)) ** 1.6 *\n smooth((rho - 0.12) / 0.35);\n let wave = 0;\n for (const w of waves) {\n const s = u * Math.cos(w.a) + v * Math.sin(w.a);\n wave += 0.5 + 0.5 * Math.sin(s * w.f * Math.PI * 2 + w.p);\n }\n floorZ[i] = unit * (0.045 * radial + 0.012 * wave);\n pos[i * 3] = x;\n pos[i * 3 + 1] = y;\n pos[i * 3 + 2] = floorZ[i] + bump(x, y);\n }\n }\n prev.set(pos);\n const heights = new Float32Array(n);\n for (let i = 0; i < n; i++) heights[i] = pos[i * 3 + 2];\n\n const links: number[] = [];\n const add = (a: number, b: number, stiff: number) => {\n const dx = pos[a * 3] - pos[b * 3];\n const dy = pos[a * 3 + 1] - pos[b * 3 + 1];\n const dz = pos[a * 3 + 2] - pos[b * 3 + 2];\n links.push(a, b, Math.hypot(dx, dy, dz), stiff);\n };\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n const i = r * COLS + c;\n if (c + 1 < COLS) add(i, i + 1, 1);\n if (r + 1 < ROWS) add(i, i + COLS, 1);\n if (c + 1 < COLS && r + 1 < ROWS) {\n add(i, i + COLS + 1, 0.7);\n add(i + 1, i + COLS, 0.7);\n }\n if (c + 2 < COLS) add(i, i + 2, 0.25);\n if (r + 2 < ROWS) add(i, i + COLS * 2, 0.25);\n }\n }\n\n // The hand pinches a small patch around the corner, not a single vertex.\n const path = PATHS[direction];\n const cc = path.corner[0] * (COLS - 1);\n const cr = path.corner[1] * (ROWS - 1);\n const grip: number[] = [];\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n if (Math.abs(c - cc) + Math.abs(r - cr) <= 3) grip.push(r * COLS + c);\n }\n }\n const gripStart = grip.map((i) => [\n pos[i * 3],\n pos[i * 3 + 1],\n pos[i * 3 + 2],\n ]);\n for (const i of grip) pinned[i] = 1;\n const len = Math.hypot(path.dir[0], path.dir[1]);\n const dir = [path.dir[0] / len, path.dir[1] / len];\n const reach = Math.abs(dir[0]) * width + Math.abs(dir[1]) * height;\n const g = unit * 0.006;\n const dt = 1 / SUBSTEPS;\n\n const hand = (t: number) => {\n const s = Math.max(0, t - delay);\n // Quick lift, then an accelerating yank that keeps going off-frame.\n const lift = unit * 0.5 * smooth(s / 9);\n const travel =\n s < 30\n ? reach * 1.25 * (s / 30) ** 2\n : reach * 1.25 * (1 + ((s - 30) * 2) / 30);\n return [dir[0] * travel, dir[1] * travel, lift];\n };\n\n const frames: Float32Array[] = [];\n const record = () => {\n const out = new Float32Array(n * 3);\n for (let i = 0; i < n * 3; i++) out[i] = pos[i];\n frames.push(out);\n };\n record();\n\n for (let f = 1; f <= FRAMES; f++) {\n for (let s = 1; s <= SUBSTEPS; s++) {\n const t = f - 1 + s * dt;\n const [hx, hy, hz] = hand(t);\n for (let i = 0; i < n; i++) {\n const k = i * 3;\n if (pinned[i]) continue;\n const z = pos[k + 2];\n const lifted = z - floorZ[i] - bump(pos[k], pos[k + 1]) > 1;\n const drag = lifted ? 0.985 : 0.6;\n const vx = (pos[k] - prev[k]) * drag;\n const vy = (pos[k + 1] - prev[k + 1]) * drag;\n const vz = (pos[k + 2] - prev[k + 2]) * 0.985;\n prev[k] = pos[k];\n prev[k + 1] = pos[k + 1];\n prev[k + 2] = z;\n // Flutter: a travelling ripple that only bites on fast-moving cloth.\n const speedXY = Math.hypot(vx, vy);\n const flutter =\n Math.sin(pos[k] * 0.02 + pos[k + 1] * 0.013 + t * 1.7) *\n speedXY *\n 0.06;\n pos[k] += vx;\n pos[k + 1] += vy;\n pos[k + 2] += vz + flutter - g * dt * dt;\n }\n grip.forEach((i, j) => {\n pos[i * 3] = gripStart[j][0] + hx;\n pos[i * 3 + 1] = gripStart[j][1] + hy;\n pos[i * 3 + 2] = gripStart[j][2] + hz;\n });\n for (let it = 0; it < ITERATIONS; it++) {\n for (let l = 0; l < links.length; l += 4) {\n const a = links[l];\n const b = links[l + 1];\n const rest = links[l + 2];\n const stiff = links[l + 3];\n const ka = a * 3;\n const kb = b * 3;\n const dx = pos[kb] - pos[ka];\n const dy = pos[kb + 1] - pos[ka + 1];\n const dz = pos[kb + 2] - pos[ka + 2];\n const d = Math.hypot(dx, dy, dz) || 1e-6;\n const wa = pinned[a] ? 0 : 1;\n const wb = pinned[b] ? 0 : 1;\n if (wa + wb === 0) continue;\n const diff = ((d - rest) / d / (wa + wb)) * stiff;\n pos[ka] += dx * diff * wa;\n pos[ka + 1] += dy * diff * wa;\n pos[ka + 2] += dz * diff * wa;\n pos[kb] -= dx * diff * wb;\n pos[kb + 1] -= dy * diff * wb;\n pos[kb + 2] -= dz * diff * wb;\n }\n for (let i = 0; i < n; i++) {\n const k = i * 3;\n const ground = floorZ[i] + bump(pos[k], pos[k + 1]);\n if (pos[k + 2] < ground) pos[k + 2] = ground;\n }\n }\n }\n record();\n }\n return { frames, heights };\n}\n\nfunction parseHex(hex: string): [number, number, number] {\n const h = hex.replace(\"#\", \"\");\n const full = h.length === 3 ? h.replace(/./g, (c) => c + c) : h.slice(0, 6);\n const v = Number.parseInt(full, 16);\n return [(v >> 16) & 255, (v >> 8) & 255, v & 255];\n}\n\n// Wordmark color for the placeholder: dark ink on light backgrounds.\nfunction placeholderText(background: string): string {\n const [r, g, b] = parseHex(background);\n return 0.299 * r + 0.587 * g + 0.114 * b > 150 ? \"#111111\" : \"#FFFFFF\";\n}\n\nconst LIGHT = (() => {\n const l = [-0.45, -0.6, 0.75];\n const m = Math.hypot(l[0], l[1], l[2]);\n return l.map((c) => c / m);\n})();\nconst HALF = (() => {\n const h = [LIGHT[0], LIGHT[1], LIGHT[2] + 1];\n const m = Math.hypot(h[0], h[1], h[2]);\n return h.map((c) => c / m);\n})();\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nfunction ClothRevealBase({\n children,\n clothColor = clothRevealDefaults.clothColor,\n undersideColor = clothRevealDefaults.undersideColor,\n background = clothRevealDefaults.background,\n direction = clothRevealDefaults.direction,\n delay = clothRevealDefaults.delay,\n seed = clothRevealDefaults.seed,\n speed = clothRevealDefaults.speed,\n}: ClothRevealProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const uid = `cloth-reveal-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const shadowId = `${uid}-shadow`;\n const softenId = `${uid}-soften`;\n const sim = useMemo(\n () => simulate(width, height, direction, delay, seed),\n [width, height, direction, delay, seed],\n );\n const t = Math.min(FRAMES, Math.max(0, (frame * speed * 30) / fps));\n const f0 = Math.floor(t);\n const f1 = Math.min(FRAMES, f0 + 1);\n const mix = t - f0;\n const A = sim.frames[f0];\n const B = sim.frames[f1];\n\n // Pinhole camera above the table: higher cloth projects larger.\n const camera = Math.max(width, height) * 1.6;\n const cx = width / 2;\n const cy = height / 2;\n const n = COLS * ROWS;\n const world = new Float64Array(n * 3);\n const screen = new Float64Array(n * 2);\n for (let i = 0; i < n * 3; i++) world[i] = A[i] + (B[i] - A[i]) * mix;\n for (let i = 0; i < n; i++) {\n const z = Math.min(world[i * 3 + 2], camera * 0.8);\n const s = camera / (camera - z);\n screen[i * 2] = cx + (world[i * 3] - cx) * s;\n screen[i * 2 + 1] = cy + (world[i * 3 + 1] - cy) * s;\n }\n\n const front = parseHex(clothColor);\n const back = parseHex(undersideColor);\n // Per-vertex normals from central differences; each quad averages its four\n // corners, which hides the mesh facets.\n const shades = new Float64Array(n * 3);\n const at = (c: number, r: number, k: number) =>\n world[\n (Math.min(ROWS - 1, Math.max(0, r)) * COLS +\n Math.min(COLS - 1, Math.max(0, c))) *\n 3 +\n k\n ];\n for (let r = 0; r < ROWS; r++) {\n for (let c = 0; c < COLS; c++) {\n const ux = at(c + 1, r, 0) - at(c - 1, r, 0);\n const uy = at(c + 1, r, 1) - at(c - 1, r, 1);\n const uz = at(c + 1, r, 2) - at(c - 1, r, 2);\n const vx = at(c, r + 1, 0) - at(c, r - 1, 0);\n const vy = at(c, r + 1, 1) - at(c, r - 1, 1);\n const vz = at(c, r + 1, 2) - at(c, r - 1, 2);\n let nx = uy * vz - uz * vy;\n let ny = uz * vx - ux * vz;\n let nz = ux * vy - uy * vx;\n const m = Math.hypot(nx, ny, nz) || 1;\n const flip = nz < 0 ? -1 : 1;\n nx = (nx / m) * flip;\n ny = (ny / m) * flip;\n nz = (nz / m) * flip;\n const diffuse = Math.max(\n 0,\n nx * LIGHT[0] + ny * LIGHT[1] + nz * LIGHT[2],\n );\n const spec =\n Math.max(0, nx * HALF[0] + ny * HALF[1] + nz * HALF[2]) ** 36 * 0.28;\n const base = flip < 0 ? back : front;\n const shade = 0.22 + 0.95 * diffuse;\n const i = r * COLS + c;\n for (let k = 0; k < 3; k++) {\n shades[i * 3 + k] = Math.min(255, base[k] * shade + 255 * spec);\n }\n }\n }\n\n const quads: { d: string; fill: string; z: number; shadow: string | null }[] =\n [];\n const offscreen = (x: number, y: number) =>\n x < -width * 0.1 ||\n x > width * 1.1 ||\n y < -height * 0.1 ||\n y > height * 1.1;\n\n for (let r = 0; r < ROWS - 1; r++) {\n for (let c = 0; c < COLS - 1; c++) {\n const ids = [\n r * COLS + c,\n r * COLS + c + 1,\n (r + 1) * COLS + c + 1,\n (r + 1) * COLS + c,\n ];\n const pts = ids.map((i) => [screen[i * 2], screen[i * 2 + 1]]);\n if (pts.every(([x, y]) => offscreen(x, y))) {\n const xs = pts.map((p) => p[0]);\n const ys = pts.map((p) => p[1]);\n const spans =\n (Math.min(...xs) < 0 && Math.max(...xs) > width) ||\n (Math.min(...ys) < 0 && Math.max(...ys) > height);\n if (!spans) continue;\n }\n const rgb = [0, 1, 2].map((k) =>\n Math.round(ids.reduce((sum, i) => sum + shades[i * 3 + k], 0) / 4),\n );\n const fill = `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`;\n const P = ids.map((i) => [\n world[i * 3],\n world[i * 3 + 1],\n world[i * 3 + 2],\n ]);\n const z = (P[0][2] + P[1][2] + P[2][2] + P[3][2]) / 4;\n const d = `M${pts.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(\"L\")}Z`;\n const lift = z - (sim.heights[ids[0]] ?? 0);\n const shadow =\n lift > 4\n ? `M${P.map(([x, y, h]) => `${(x + h * 0.35).toFixed(1)},${(y + h * 0.45).toFixed(1)}`).join(\"L\")}Z`\n : null;\n quads.push({ d, fill, z, shadow });\n }\n }\n quads.sort((a, b) => a.z - b.z);\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <AbsoluteFill style={{ alignItems: \"center\", justifyContent: \"center\" }}>\n {children ?? (\n <PlaceholderLockup\n mark={clothColor}\n dot={background}\n text={placeholderText(background)}\n />\n )}\n </AbsoluteFill>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <defs>\n <filter id={shadowId} x=\"-20%\" y=\"-20%\" width=\"140%\" height=\"140%\">\n <feGaussianBlur stdDeviation={Math.min(width, height) * 0.02} />\n </filter>\n {/* Normalized blur: blurring premultiplied color and then forcing\n alpha to 1 averages only covered pixels, which smooths the facet\n steps without bleeding the background in. The source alpha then\n restores the crisp silhouette. */}\n <filter\n id={softenId}\n filterUnits=\"userSpaceOnUse\"\n x={-width}\n y={-height}\n width={width * 3}\n height={height * 3}\n colorInterpolationFilters=\"sRGB\"\n >\n <feGaussianBlur\n in=\"SourceGraphic\"\n stdDeviation={(width * 1.12) / (COLS - 1) / 2.2}\n result=\"blur\"\n />\n <feColorMatrix\n in=\"blur\"\n type=\"matrix\"\n values=\"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1\"\n result=\"smooth\"\n />\n <feGaussianBlur\n in=\"SourceAlpha\"\n stdDeviation={Math.min(width, height) / 600}\n result=\"edge\"\n />\n <feComposite in=\"smooth\" in2=\"edge\" operator=\"in\" />\n </filter>\n </defs>\n <g filter={`url(#${shadowId})`} opacity={0.45}>\n {quads.map((q, i) =>\n q.shadow ? <path key={i} d={q.shadow} fill=\"#000000\" /> : null,\n )}\n </g>\n {/* Aliased quads share edges without hairline seams. */}\n <g filter={`url(#${softenId})`}>\n {quads.map((q, i) => (\n <path key={i} d={q.d} fill={q.fill} shapeRendering=\"crispEdges\" />\n ))}\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n direction: {\n type: \"enum\",\n default: \"right\",\n variants: {\n right: {},\n left: {},\n up: {},\n down: {},\n },\n description: \"Direction\",\n },\n clothColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Cloth\",\n },\n undersideColor: {\n type: \"color\",\n default: \"#8E1A16\",\n description: \"Underside\",\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n delay: {\n type: \"number\",\n default: 6,\n min: 0,\n max: 30,\n step: 1,\n description: \"Delay\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 2,\n min: 1,\n max: 24,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"direction\",\"clothColor\",\"undersideColor\",\"background\",\"delay\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n direction: \"right\",\n clothColor: \"#E5322D\",\n undersideColor: \"#8E1A16\",\n background: \"#111111\",\n delay: 6,\n seed: 2,\n speed: 1,\n};\n\ntype ClothRevealElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ClothRevealBase>;\n\nconst ClothRevealInner = forwardRef<\n HTMLDivElement,\n ClothRevealElementProps & { 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 ?? \"<ClothReveal>\"}\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 <ClothRevealBase\n {...(componentProps as unknown as ComponentProps<typeof ClothRevealBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ClothReveal = Interactive.withSchema({\n Component: ClothRevealInner,\n componentName: \"<ClothReveal>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 34+}diff --git a/registry-artifacts/elements/comic-panels.json b/registry-artifacts/elements/comic-panels.jsonnew file mode 100644index 00000000..87561aa2--- /dev/null+++ b/registry-artifacts/elements/comic-panels.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Comic Panels",+ "durationInFrames": 36,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "comic-panels",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype ComicPanelsColors = {\n ink: string;\n paper: string;\n accent: string;\n};\n\ntype ComicPanelsProps = {\n /** Hero content, framed in the top panel once the page cracks. Falls back to a placeholder \"remocn\" lockup. */\n children?: ReactNode;\n /** Optional word in the starburst, e.g. \"POW\". */\n word?: string;\n colors?: Partial<ComicPanelsColors>;\n /** Ink color. Overrides `colors.ink` when set. */\n ink?: string;\n /** Paper color. Overrides `colors.paper` when set. */\n paper?: string;\n /** Accent color. Overrides `colors.accent` when set. */\n accent?: string;\n /** Scale of `children` inside the top panel. */\n heroScale?: number;\n speed?: number;\n};\n\nconst comicPanelsDefaults = {\n colors: {\n ink: \"#111111\",\n paper: \"#FFFFFF\",\n accent: \"#E5322D\",\n } as ComicPanelsColors,\n heroScale: 0.62,\n speed: 1,\n};\n\nconst comicPanelsLength = 36;\n\nconst FONT =\n \"'Arial Black', Impact, Inter, -apple-system, 'Segoe UI', sans-serif\";\nconst SANS =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Placeholder hero shown when no children are passed.\nfunction PlaceholderLockup({ ink, accent }: { ink: string; accent: string }) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 }}>\n <div\n style={{\n width: 120,\n height: 120,\n borderRadius: 32,\n backgroundColor: accent,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36,\n height: 36,\n borderRadius: \"50%\",\n backgroundColor: ink,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: SANS,\n fontSize: 104,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: ink,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst ease = (\n t: number,\n from: number,\n to: number,\n easing: (n: number) => number = Easing.inOut(Easing.cubic),\n) => interpolate(t, [from, to], [0, 1], { ...clamp, easing });\n\ntype Pt = [number, number];\nconst poly = (points: Pt[]) => points.map((p) => p.join(\",\")).join(\" \");\n\nfunction starburst(spikes: number, outer: number, inner: number, seed: string) {\n const points: Pt[] = [];\n for (let i = 0; i < spikes * 2; i++) {\n const a =\n (i / (spikes * 2)) * Math.PI * 2 +\n (random(`${seed}-a-${i}`) - 0.5) * 0.12;\n const r =\n i % 2 === 0\n ? outer * (0.82 + 0.18 * random(`${seed}-r-${i}`))\n : inner * (0.9 + 0.1 * random(`${seed}-r-${i}`));\n points.push([Math.cos(a) * r, Math.sin(a) * r]);\n }\n return poly(points);\n}\n\nfunction ComicPanelsBase({\n children,\n word,\n colors,\n ink,\n paper,\n accent,\n heroScale = comicPanelsDefaults.heroScale,\n speed = comicPanelsDefaults.speed,\n}: ComicPanelsProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const merged = { ...comicPanelsDefaults.colors, ...colors };\n const c: ComicPanelsColors = {\n ink: ink ?? merged.ink,\n paper: paper ?? merged.paper,\n accent: accent ?? merged.accent,\n };\n const t = (frame / fps) * 30 * speed;\n const u = Math.min(W, H) / 720;\n\n // Page geometry: one slanted horizontal gutter, one slanted vertical one.\n const a0 = 0.6 * H;\n const a1 = 0.5 * H;\n const yA = (x: number) => a0 + ((a1 - a0) * x) / W;\n const b0: Pt = [0.53 * W, yA(0.53 * W)];\n const b1: Pt = [0.46 * W, H];\n const gutter = 16 * u;\n const border = 5 * u;\n\n const margin = ease(t, 0, 8) * 22 * u;\n const crackA = ease(t, 2, 10, Easing.out(Easing.cubic));\n const crackB = ease(t, 8, 14, Easing.out(Easing.cubic));\n const slide2 = ease(t, 10, 18, Easing.out(Easing.exp));\n const slide3 = ease(t, 13, 21, Easing.out(Easing.exp));\n const burst = ease(t, 23, 34, Easing.in(Easing.cubic));\n const settle = ease(t, 30, 36, Easing.out(Easing.cubic));\n const shaking = t >= 22 && t < 31;\n const step = Math.floor(t / 2);\n const shake = shaking\n ? [\n (random(`comic-sx-${step}`) - 0.5) * 14 * u,\n (random(`comic-sy-${step}`) - 0.5) * 14 * u,\n ]\n : [0, 0];\n const jolt = `translate(${shake[0]} ${shake[1]})`;\n\n const left: Pt[] = [[0, a0], b0, b1, [0, H]];\n const right: Pt[] = [b0, [W, a1], [W, H], b1];\n const heroFocus: Pt = [W / 2, interpolate(crackA, [0, 1], [H / 2, 0.27 * H])];\n const heroS = interpolate(crackA, [0, 1], [1, heroScale]);\n\n // Speed lines: wedges from the hero focus, redrawn every 2 frames.\n const wedges = Array.from({ length: 56 }, (_, i) => {\n const a =\n (i / 56) * Math.PI * 2 + (random(`comic-w-${step}-${i}`) - 0.5) * 0.09;\n const spread = 0.008 + 0.014 * random(`comic-ws-${step}-${i}`);\n const r0 = (0.3 + 0.12 * random(`comic-wr-${step}-${i}`)) * W * heroS;\n const r1 = W * 1.2;\n const [fx, fy] = heroFocus;\n const at = (r: number, d: number): Pt => [\n fx + Math.cos(a + d) * r,\n fy + Math.sin(a + d) * r * 0.62,\n ];\n return poly([at(r0, 0), at(r1, -spread), at(r1, spread)]);\n });\n\n // Halftone: dots swell toward the panel's lower-left corner.\n const pitch = 20 * u;\n const dots: { x: number; y: number; r: number }[] = [];\n for (let y = a1 - pitch; y < H + pitch; y += pitch) {\n for (let x = 0; x < b0[0] + pitch; x += pitch) {\n const ox = (Math.round(y / pitch) % 2) * (pitch / 2);\n const d = Math.hypot(x + ox, H - y) / Math.hypot(b0[0], H - a0);\n const r = pitch * 0.5 * Math.max(0, Math.min(1, 1.15 - d));\n if (r > 0.6 * u) dots.push({ x: x + ox, y, r });\n }\n }\n\n const c3: Pt = [(b0[0] + W + W + b1[0]) / 4, (b0[1] + a1 + H + H) / 4];\n const outer = 0.4 * (H - a1);\n const pulse = 1 + 0.04 * Math.sin(t * 1.4);\n const center: Pt = [\n interpolate(burst, [0, 1], [c3[0], W / 2]),\n interpolate(burst, [0, 1], [c3[1], H / 2]),\n ];\n const redScale = interpolate(burst, [0, 1], [1, 9]) * pulse;\n const whiteScale =\n interpolate(burst, [0, 1], [1, (0.4 * H) / (outer * 0.62)]) *\n pulse *\n interpolate(settle, [0, 1], [1.08, 1]);\n const spin = interpolate(burst, [0, 1], [0, 14]);\n const burstLayer = (\n <g transform={`translate(${center[0]} ${center[1]}) rotate(${spin})`}>\n <polygon\n transform={`scale(${redScale})`}\n points={starburst(16, outer, outer * 0.68, \"comic-red\")}\n fill={c.accent}\n stroke={c.ink}\n strokeWidth={(border * 0.8) / redScale}\n strokeLinejoin=\"round\"\n />\n <polygon\n transform={`scale(${whiteScale})`}\n points={starburst(13, outer * 0.62, outer * 0.42, \"comic-white\")}\n fill={c.paper}\n stroke={c.ink}\n strokeWidth={(border * 0.8) / whiteScale}\n strokeLinejoin=\"round\"\n />\n {word ? (\n <g\n transform={`scale(${whiteScale}) rotate(-8)`}\n textAnchor=\"middle\"\n dominantBaseline=\"central\"\n fontFamily={FONT}\n fontWeight={900}\n fontSize={outer * 0.4}\n >\n <text x={outer * 0.03} y={outer * 0.03} fill={c.accent}>\n {word}\n </text>\n <text fill={c.ink}>{word}</text>\n </g>\n ) : null}\n </g>\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor: c.paper, overflow: \"hidden\" }}>\n <AbsoluteFill>\n <svg width={W} height={H} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n <clipPath id={`${id}-left`}>\n <polygon points={poly(left)} />\n </clipPath>\n <clipPath id={`${id}-right`}>\n <polygon points={poly(right)} />\n </clipPath>\n </defs>\n <g fill={c.ink} transform={jolt}>\n {wedges.map((points, i) => (\n <polygon key={i} points={points} />\n ))}\n </g>\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `translate(${heroFocus[0] - W / 2 + shake[0]}px, ${heroFocus[1] - H / 2 + shake[1]}px) scale(${heroS})`,\n }}\n >\n {children ?? <PlaceholderLockup ink={c.ink} accent={c.accent} />}\n </AbsoluteFill>\n <svg width={W} height={H} style={{ position: \"absolute\" }} aria-hidden>\n <g\n clipPath={`url(#${id}-left)`}\n transform={`translate(${(slide2 - 1) * b0[0]} 0)`}\n opacity={slide2 > 0 ? 1 : 0}\n >\n <polygon points={poly(left)} fill={c.paper} />\n <g fill={c.accent} transform={jolt}>\n {dots.map((d) => (\n <circle key={`${d.x}-${d.y}`} cx={d.x} cy={d.y} r={d.r} />\n ))}\n </g>\n </g>\n <g clipPath={`url(#${id}-right)`}>\n <g\n transform={`translate(${(1 - slide3) * (W - b1[0])} 0)`}\n opacity={slide3 > 0 ? 1 : 0}\n >\n <polygon points={poly(right)} fill={c.ink} />\n <g transform={jolt}>{burst === 0 ? burstLayer : null}</g>\n </g>\n </g>\n {/* Gutters: ink edges first, then the white channel on top. */}\n {[c.ink, c.paper].map((stroke, pass) => (\n <g\n key={stroke + pass}\n stroke={stroke}\n strokeWidth={pass === 0 ? gutter + border * 2 : gutter}\n strokeLinecap=\"butt\"\n >\n <line\n x1={-gutter}\n y1={yA(-gutter)}\n x2={-gutter + (W + 2 * gutter) * crackA}\n y2={yA(-gutter + (W + 2 * gutter) * crackA)}\n />\n <line\n x1={b0[0]}\n y1={b0[1]}\n x2={b0[0] + (b1[0] + (b1[0] - b0[0]) * 0.05 - b0[0]) * crackB}\n y2={b0[1] + (H * 1.05 - b0[1]) * crackB}\n />\n </g>\n ))}\n <path\n d={`M ${-W} ${-H} H ${2 * W} V ${2 * H} H ${-W} Z M ${margin} ${margin} V ${H - margin} H ${W - margin} V ${margin} Z`}\n fill={c.paper}\n />\n {margin > 0 ? (\n <rect\n x={margin}\n y={margin}\n width={W - margin * 2}\n height={H - margin * 2}\n fill=\"none\"\n stroke={c.ink}\n strokeWidth={border}\n />\n ) : null}\n </svg>\n </AbsoluteFill>\n {burst > 0 ? (\n <svg width={W} height={H} style={{ position: \"absolute\" }} aria-hidden>\n <g transform={jolt}>{burstLayer}</g>\n </svg>\n ) : null}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n word: {\n type: \"text-content\",\n default: \"POW\",\n description: \"Word\",\n },\n heroScale: {\n type: \"number\",\n default: 0.62,\n min: 0.3,\n max: 1,\n step: 0.02,\n description: \"Hero scale\",\n hiddenFromList: false,\n },\n ink: {\n type: \"color\",\n default: \"#111111\",\n description: \"Ink\",\n },\n paper: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Paper\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent\",\n },\n speed: {\n 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([\"word\",\"heroScale\",\"ink\",\"paper\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n word: \"POW\",\n heroScale: 0.62,\n ink: \"#111111\",\n paper: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype ComicPanelsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ComicPanelsBase>;\n\nconst ComicPanelsInner = forwardRef<\n HTMLDivElement,\n ComicPanelsElementProps & { 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 ?? \"<ComicPanels>\"}\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 <ComicPanelsBase\n {...(componentProps as unknown as ComponentProps<typeof ComicPanelsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ComicPanels = Interactive.withSchema({\n Component: ComicPanelsInner,\n componentName: \"<ComicPanels>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 36+}diff --git a/registry-artifacts/elements/dolly-zoom.json b/registry-artifacts/elements/dolly-zoom.jsonnew file mode 100644index 00000000..f3576c0b--- /dev/null+++ b/registry-artifacts/elements/dolly-zoom.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Dolly Zoom",+ "durationInFrames": 36,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "dolly-zoom",+ "sourceCode": "import { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype DollyZoomColors = {\n background: string;\n wall: string;\n wallAlt: string;\n floor: string;\n floorAlt: string;\n line: string;\n light: string;\n door: string;\n figure: string;\n};\n\ntype DollyZoomProps = {\n /** Subject held at a constant size. Defaults to a standing figure. */\n children?: React.ReactNode;\n /** How far the camera dollies in while zooming out, 0 to 2. */\n intensity?: number;\n /** Play the move in reverse: background compresses toward the subject. */\n reverse?: boolean;\n colors?: Partial<DollyZoomColors>;\n /** Door color at the end of the corridor. Overrides `colors.door`. */\n doorColor?: string;\n /** Default figure color. Overrides `colors.figure`. */\n figureColor?: string;\n /** Corridor edge line color. Overrides `colors.line`. */\n lineColor?: string;\n speed?: number;\n};\n\nconst dollyZoomDefaults = {\n intensity: 1,\n reverse: false,\n colors: {\n background: \"#0B0B0B\",\n wall: \"#1B1B1B\",\n wallAlt: \"#151515\",\n floor: \"#262626\",\n floorAlt: \"#1D1D1D\",\n line: \"#FFFFFF\",\n light: \"#FFFFFF\",\n door: \"#E5322D\",\n figure: \"#FFFFFF\",\n } satisfies DollyZoomColors,\n speed: 1,\n};\n\nconst START = 4;\nconst END = 36;\n// Corridor in world units. Screen y points down, so the floor is positive.\nconst HALF_W = 2;\nconst CEIL = -1.3;\nconst FLOOR = 1.7;\nconst SUBJECT_Z = 6;\nconst DOOR_Z = 14;\nconst NEAR = 0.25;\n\ntype Vec = [number, number, number];\n\nfunction DollyZoomBase({\n children,\n intensity = dollyZoomDefaults.intensity,\n reverse = dollyZoomDefaults.reverse,\n colors: colorOverrides,\n doorColor,\n figureColor,\n lineColor,\n speed = dollyZoomDefaults.speed,\n}: DollyZoomProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...dollyZoomDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n door: doorColor ?? baseColors.door,\n figure: figureColor ?? baseColors.figure,\n line: lineColor ?? baseColors.line,\n };\n const t = (frame * speed * 30) / fps;\n const move = interpolate(t, [START, END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.45, 0, 0.3, 1),\n });\n const amount = reverse ? 1 - move : move;\n\n // Focal length tracks the subject distance so the subject never changes size.\n const k = height * 0.19;\n const d0 = SUBJECT_Z;\n const d1 = d0 / (1 + 1.7 * Math.max(0, intensity));\n const dist = d0 + (d1 - d0) * amount;\n const cam = SUBJECT_Z - dist;\n const f = k * dist;\n const cx = width / 2;\n const cy = height / 2;\n\n const project = ([x, y, z]: Vec) => {\n const depth = Math.max(NEAR, z - cam);\n return [cx + (f * x) / depth, cy + (f * y) / depth] as const;\n };\n const poly = (pts: Vec[]) =>\n pts\n .map(project)\n .map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`)\n .join(\" \");\n\n const fog = (z: number) =>\n interpolate(z - cam, [1, DOOR_Z - cam], [1, 0.25], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const segments: React.ReactNode[] = [];\n // The corridor runs on behind the camera so its mouth never shows.\n const firstZ = Math.floor(cam);\n for (let z = DOOR_Z - 1; z >= firstZ; z--) {\n const z0 = Math.max(z, cam + NEAR);\n const z1 = z + 1;\n if (z1 <= z0) continue;\n const alt = z % 2 === 0;\n const L = -HALF_W;\n const R = HALF_W;\n segments.push(\n <g key={z}>\n <polygon\n points={poly([\n [L, FLOOR, z0],\n [R, FLOOR, z0],\n [R, FLOOR, z1],\n [L, FLOOR, z1],\n ])}\n fill={alt ? colors.floor : colors.floorAlt}\n />\n <polygon\n points={poly([\n [L, CEIL, z0],\n [R, CEIL, z0],\n [R, CEIL, z1],\n [L, CEIL, z1],\n ])}\n fill={colors.wallAlt}\n />\n <polygon\n points={poly([\n [L, CEIL, z0],\n [L, FLOOR, z0],\n [L, FLOOR, z1],\n [L, CEIL, z1],\n ])}\n fill={alt ? colors.wall : colors.wallAlt}\n />\n <polygon\n points={poly([\n [R, CEIL, z0],\n [R, FLOOR, z0],\n [R, FLOOR, z1],\n [R, CEIL, z1],\n ])}\n fill={alt ? colors.wall : colors.wallAlt}\n />\n <polygon\n points={poly([\n [-0.35, CEIL, z + 0.3],\n [0.35, CEIL, z + 0.3],\n [0.35, CEIL, z + 0.7],\n [-0.35, CEIL, z + 0.7],\n ])}\n fill={colors.light}\n opacity={0.75 * fog(z)}\n />\n {z >= cam + NEAR ? (\n <polygon\n points={poly([\n [L, CEIL, z],\n [R, CEIL, z],\n [R, FLOOR, z],\n [L, FLOOR, z],\n ])}\n fill=\"none\"\n stroke={colors.line}\n strokeOpacity={0.32 * fog(z)}\n strokeWidth={Math.max(1, (f / (z - cam)) * 0.012)}\n />\n ) : null}\n </g>,\n );\n }\n\n const edges: Vec[][] = [\n [\n [-HALF_W, CEIL, -4],\n [-HALF_W, CEIL, DOOR_Z],\n ],\n [\n [HALF_W, CEIL, -4],\n [HALF_W, CEIL, DOOR_Z],\n ],\n [\n [-HALF_W, FLOOR, -4],\n [-HALF_W, FLOOR, DOOR_Z],\n ],\n [\n [HALF_W, FLOOR, -4],\n [HALF_W, FLOOR, DOOR_Z],\n ],\n ];\n\n const doorW = 0.85;\n const doorTop = FLOOR - 2.3;\n const [, floorY] = project([0, FLOOR, SUBJECT_Z]);\n const figureH = k * 1.75;\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <polygon\n points={poly([\n [-HALF_W, CEIL, DOOR_Z],\n [HALF_W, CEIL, DOOR_Z],\n [HALF_W, FLOOR, DOOR_Z],\n [-HALF_W, FLOOR, DOOR_Z],\n ])}\n fill={colors.wallAlt}\n />\n <polygon\n points={poly([\n [-doorW, doorTop, DOOR_Z],\n [doorW, doorTop, DOOR_Z],\n [doorW, FLOOR, DOOR_Z],\n [-doorW, FLOOR, DOOR_Z],\n ])}\n fill={colors.door}\n />\n {segments}\n {edges.map((edge, i) => {\n const [a, b] = edge.map((p) =>\n project([p[0], p[1], Math.max(p[2], cam + NEAR)]),\n );\n return (\n <line\n key={i}\n x1={a[0]}\n y1={a[1]}\n x2={b[0]}\n y2={b[1]}\n stroke={colors.line}\n strokeOpacity={0.45}\n strokeWidth={1.5}\n />\n );\n })}\n </svg>\n <AbsoluteFill\n style={{\n background:\n \"radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%)\",\n }}\n />\n {children ? (\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n {children}\n </AbsoluteFill>\n ) : (\n <svg\n viewBox=\"0 0 60 175\"\n height={figureH}\n style={{\n position: \"absolute\",\n left: cx - (figureH * 60) / 175 / 2,\n top: floorY - figureH,\n }}\n aria-hidden\n >\n <g fill={colors.figure}>\n <circle cx={30} cy={14} r={12} />\n <path d=\"M12 34 Q30 26 48 34 L54 96 Q54 102 48 102 L44 102 L42 172 L33 172 L30 108 L27 172 L18 172 L16 102 L12 102 Q6 102 6 96 Z\" />\n </g>\n </svg>\n )}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n intensity: {\n type: \"number\",\n default: 1,\n min: 0,\n max: 2,\n step: 0.1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n reverse: {\n type: \"boolean\",\n default: false,\n description: \"Reverse\",\n },\n doorColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Door\",\n },\n figureColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Figure\",\n },\n lineColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Lines\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"intensity\",\"reverse\",\"doorColor\",\"figureColor\",\"lineColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n intensity: 1,\n reverse: false,\n doorColor: \"#E5322D\",\n figureColor: \"#FFFFFF\",\n lineColor: \"#FFFFFF\",\n speed: 1,\n};\n\ntype DollyZoomElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DollyZoomBase>;\n\nconst DollyZoomInner = forwardRef<\n HTMLDivElement,\n DollyZoomElementProps & { 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 ?? \"<DollyZoom>\"}\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 <DollyZoomBase\n {...(componentProps as unknown as ComponentProps<typeof DollyZoomBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DollyZoom = Interactive.withSchema({\n Component: DollyZoomInner,\n componentName: \"<DollyZoom>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 36+}diff --git a/registry-artifacts/elements/duotone-beat.json b/registry-artifacts/elements/duotone-beat.jsonnew file mode 100644index 00000000..749a2fc4--- /dev/null+++ b/registry-artifacts/elements/duotone-beat.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Duotone Beat",+ "durationInFrames": 120,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "duotone-beat",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Img, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/** [shadow ink, highlight ink], hex colors. */\ntype DuotonePalette = [string, string];\n\ntype DuotoneBeatProps = {\n /** Portrait image. Without it a head-and-shoulders silhouette is drawn. */\n src?: string;\n /** Ink pairs, one per beat, cycled. Hex colors only (they feed an SVG LUT). */\n palettes?: DuotonePalette[];\n /** Frames per beat at 30fps. Ignored when `bpm` is set. */\n beatFrames?: number;\n bpm?: number;\n /** Beats per bar; the first beat of each bar gets the bigger punch-in. */\n beatsPerBar?: number;\n /** Scale added on the downbeat. Off-beats get a third of it. */\n punch?: number;\n showIndicator?: boolean;\n /** Halftone dot pitch in px at 720p for a printed look. 0 keeps smooth tones. */\n halftone?: number;\n speed?: number;\n};\n\nconst duotoneBeatDefaults = {\n palettes: [\n [\"#111111\", \"#FFFFFF\"],\n [\"#111111\", \"#E5322D\"],\n [\"#E5322D\", \"#FFFFFF\"],\n [\"#E5322D\", \"#111111\"],\n ] as DuotonePalette[],\n beatFrames: 15,\n beatsPerBar: 4,\n punch: 0.07,\n showIndicator: true,\n halftone: 8,\n speed: 1,\n};\n\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nfunction hexToRgb(hex: string): [number, number, number] {\n const h = hex.replace(\"#\", \"\").trim();\n const full =\n h.length === 3\n ? h\n .split(\"\")\n .map((c) => c + c)\n .join(\"\")\n : h.slice(0, 6);\n const n = Number.parseInt(full, 16);\n if (Number.isNaN(n)) return [0, 0, 0];\n return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];\n}\n\nfunction Ground({\n id,\n width,\n height,\n}: {\n id: string;\n width: number;\n height: number;\n}) {\n return (\n <svg width={width} height={height} aria-hidden>\n <defs>\n <radialGradient id={`${id}-ground`} cx=\"0.5\" cy=\"0.4\" r=\"0.8\">\n <stop offset=\"0\" stopColor=\"#FFFFFF\" />\n <stop offset=\"0.5\" stopColor=\"#F2F2F2\" />\n <stop offset=\"1\" stopColor=\"#C4C4C4\" />\n </radialGradient>\n </defs>\n <rect width={width} height={height} fill={`url(#${id}-ground)`} />\n </svg>\n );\n}\n\nfunction Portrait({\n id,\n width,\n height,\n}: {\n id: string;\n width: number;\n height: number;\n}) {\n const h = height;\n const cx = width / 2;\n const P = (x: number, y: number) => `${cx + x * h} ${y * h}`;\n const head = [\n `M ${P(0, 0.17)}`,\n `C ${P(0.075, 0.17)} ${P(0.118, 0.23)} ${P(0.118, 0.32)}`,\n `C ${P(0.118, 0.4)} ${P(0.095, 0.46)} ${P(0.06, 0.49)}`,\n `C ${P(0.035, 0.51)} ${P(-0.035, 0.51)} ${P(-0.06, 0.49)}`,\n `C ${P(-0.095, 0.46)} ${P(-0.118, 0.4)} ${P(-0.118, 0.32)}`,\n `C ${P(-0.118, 0.23)} ${P(-0.075, 0.17)} ${P(0, 0.17)} Z`,\n ].join(\" \");\n const hair = [\n `M ${P(-0.126, 0.34)}`,\n `C ${P(-0.14, 0.17)} ${P(-0.05, 0.125)} ${P(0.02, 0.135)}`,\n `C ${P(0.11, 0.14)} ${P(0.145, 0.21)} ${P(0.126, 0.32)}`,\n `C ${P(0.11, 0.245)} ${P(0.06, 0.215)} ${P(-0.01, 0.222)}`,\n `C ${P(-0.07, 0.228)} ${P(-0.105, 0.26)} ${P(-0.126, 0.34)} Z`,\n ].join(\" \");\n const torso = [\n `M ${P(-0.07, 0.585)}`,\n `C ${P(-0.13, 0.62)} ${P(-0.3, 0.63)} ${P(-0.36, 0.7)}`,\n `C ${P(-0.41, 0.76)} ${P(-0.43, 0.88)} ${P(-0.44, 1.01)}`,\n `L ${P(0.44, 1.01)}`,\n `C ${P(0.43, 0.88)} ${P(0.41, 0.76)} ${P(0.36, 0.7)}`,\n `C ${P(0.3, 0.63)} ${P(0.13, 0.62)} ${P(0.07, 0.585)} Z`,\n ].join(\" \");\n return (\n <svg width={width} height={height} aria-hidden>\n <defs>\n <linearGradient id={`${id}-skin`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0.2\">\n <stop offset=\"0\" stopColor=\"#121212\" />\n <stop offset=\"0.55\" stopColor=\"#3A3A3A\" />\n <stop offset=\"1\" stopColor=\"#9C9C9C\" />\n </linearGradient>\n <linearGradient id={`${id}-shirt`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"0\" stopColor=\"#141414\" />\n <stop offset=\"0.6\" stopColor=\"#262626\" />\n <stop offset=\"1\" stopColor=\"#6A6A6A\" />\n </linearGradient>\n </defs>\n <path\n d={`M ${P(-0.055, 0.45)} L ${P(-0.065, 0.61)} L ${P(0.065, 0.61)} L ${P(0.055, 0.45)} Z`}\n fill=\"#0C0C0C\"\n />\n <path d={torso} fill={`url(#${id}-shirt)`} />\n <path\n d={`M ${P(-0.075, 0.59)} Q ${P(0, 0.67)} ${P(0.075, 0.59)}`}\n fill=\"none\"\n stroke=\"#7A7A7A\"\n strokeWidth={0.012 * h}\n />\n <ellipse\n cx={cx - 0.12 * h}\n cy={0.34 * h}\n rx={0.018 * h}\n ry={0.04 * h}\n fill=\"#161616\"\n />\n <ellipse\n cx={cx + 0.12 * h}\n cy={0.34 * h}\n rx={0.018 * h}\n ry={0.04 * h}\n fill=\"#8A8A8A\"\n />\n <path d={head} fill={`url(#${id}-skin)`} />\n <path d={hair} fill=\"#060606\" />\n {/* Rim light on the key side. */}\n <g\n fill=\"none\"\n stroke=\"#D6D6D6\"\n strokeWidth={0.007 * h}\n strokeLinecap=\"round\"\n style={{ filter: `blur(${0.003 * h}px)` }}\n >\n <path\n d={`M ${P(0.112, 0.27)} C ${P(0.118, 0.36)} ${P(0.105, 0.43)} ${P(0.07, 0.475)}`}\n />\n <path\n d={`M ${P(0.14, 0.625)} C ${P(0.3, 0.64)} ${P(0.39, 0.72)} ${P(0.42, 0.88)}`}\n />\n </g>\n </svg>\n );\n}\n\nfunction DuotoneBeatBase({\n src,\n palettes = duotoneBeatDefaults.palettes,\n beatFrames = duotoneBeatDefaults.beatFrames,\n bpm,\n beatsPerBar = duotoneBeatDefaults.beatsPerBar,\n punch = duotoneBeatDefaults.punch,\n showIndicator = duotoneBeatDefaults.showIndicator,\n halftone = duotoneBeatDefaults.halftone,\n speed = duotoneBeatDefaults.speed,\n}: DuotoneBeatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const u = Math.min(width, height) / 720;\n const t = (frame / fps) * 30 * speed;\n const period = Math.max(1, bpm ? (30 * 60) / bpm : beatFrames);\n const beat = Math.floor(t / period);\n const local = t - beat * period;\n const bar = Math.max(1, Math.round(beatsPerBar));\n const inBar = beat % bar;\n const list = palettes.length > 0 ? palettes : duotoneBeatDefaults.palettes;\n const [dark, light] = list[beat % list.length].map(hexToRgb);\n\n const strength = inBar === 0 ? punch : punch / 3;\n const scale = 1 + strength * Math.exp(-local / 3.2);\n const rise = interpolate(t, [0, 12], [0.22, 0], {\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const intro = interpolate(t, [0, 12], [0, 1], {\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n const table = (i: number) => `${dark[i]} ${light[i]}`;\n // Halftone screen: a radial distance tile, thresholded against the gray.\n const pitch = halftone * u;\n const tile =\n pitch > 0\n ? `data:image/svg+xml;utf8,${encodeURIComponent(\n `<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"${pitch}\" height=\"${pitch}\"><defs><radialGradient id=\"g\" r=\"0.71\"><stop offset=\"0\" stop-color=\"#000\"/><stop offset=\"1\" stop-color=\"#fff\"/></radialGradient></defs><rect width=\"${pitch}\" height=\"${pitch}\" fill=\"url(#g)\"/></svg>`,\n )}`\n : null;\n const lightHex = list[beat % list.length][1];\n const darkHex = list[beat % list.length][0];\n\n return (\n <AbsoluteFill style={{ overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter\n id={`${id}-duotone`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix type=\"saturate\" values=\"0\" result=\"gray\" />\n {tile ? (\n <>\n <feImage\n href={tile}\n x={0}\n y={0}\n width={pitch}\n height={pitch}\n result=\"dot\"\n />\n <feTile in=\"dot\" result=\"screen\" />\n {/* alpha: 8 - 8 + 1 = 1, color: 8 * (gray - screen) + 1 */}\n <feComposite\n in=\"gray\"\n in2=\"screen\"\n operator=\"arithmetic\"\n k1={0}\n k2={8}\n k3={-8}\n k4={1}\n />\n </>\n ) : null}\n <feComponentTransfer>\n <feFuncR type=\"table\" tableValues={table(0)} />\n <feFuncG type=\"table\" tableValues={table(1)} />\n <feFuncB type=\"table\" tableValues={table(2)} />\n </feComponentTransfer>\n </filter>\n </svg>\n <AbsoluteFill style={{ filter: `url(#${id}-duotone)` }}>\n <AbsoluteFill\n style={{\n backgroundColor: \"#FFFFFF\",\n transform: `scale(${scale})`,\n transformOrigin: \"50% 40%\",\n }}\n >\n {src ? (\n <Img\n src={src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: \"cover\",\n transform: `scale(${1.12 - 0.12 * intro})`,\n }}\n />\n ) : (\n <>\n <Ground id={id} width={width} height={height} />\n <AbsoluteFill\n style={{ transform: `translateY(${rise * height}px)` }}\n >\n <Portrait id={id} width={width} height={height} />\n </AbsoluteFill>\n </>\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n {showIndicator ? (\n <div\n style={{\n position: \"absolute\",\n left: 48 * u,\n bottom: 44 * u,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10 * u,\n }}\n >\n {Array.from({ length: bar }, (_, i) => (\n <div\n key={i}\n style={{\n width: 26 * u,\n height: 26 * u,\n boxSizing: \"border-box\",\n border: `${2.5 * u}px solid ${darkHex}`,\n backgroundColor: i === inBar ? darkHex : \"transparent\",\n transform: `scale(${i === inBar ? 1 + 0.25 * Math.exp(-local / 3) : 1})`,\n }}\n />\n ))}\n <span\n style={{\n marginLeft: 10 * u,\n fontFamily: MONO,\n fontSize: 20 * u,\n fontWeight: 700,\n letterSpacing: 2 * u,\n color: darkHex,\n backgroundColor: lightHex,\n }}\n >\n {String(Math.round((30 * 60) / period))} BPM\n </span>\n </div>\n ) : null}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n beatFrames: {\n type: \"number\",\n default: 15,\n min: 4,\n max: 30,\n step: 1,\n description: \"Frames per beat\",\n hiddenFromList: false,\n },\n beatsPerBar: {\n type: \"number\",\n default: 4,\n min: 1,\n max: 8,\n step: 1,\n description: \"Beats per bar\",\n hiddenFromList: false,\n },\n punch: {\n type: \"number\",\n default: 0.07,\n min: 0,\n max: 0.2,\n step: 0.01,\n description: \"Punch\",\n hiddenFromList: false,\n },\n halftone: {\n type: \"number\",\n default: 8,\n min: 0,\n max: 20,\n step: 1,\n description: \"Halftone pitch\",\n hiddenFromList: false,\n },\n showIndicator: {\n type: \"boolean\",\n default: true,\n description: \"Bar indicator\",\n },\n speed: {\n 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([\"beatFrames\",\"beatsPerBar\",\"punch\",\"halftone\",\"showIndicator\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n beatFrames: 15,\n beatsPerBar: 4,\n punch: 0.07,\n halftone: 8,\n showIndicator: true,\n speed: 1,\n};\n\ntype DuotoneBeatElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DuotoneBeatBase>;\n\nconst DuotoneBeatInner = forwardRef<\n HTMLDivElement,\n DuotoneBeatElementProps & { 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 ?? \"<DuotoneBeat>\"}\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 <DuotoneBeatBase\n {...(componentProps as unknown as ComponentProps<typeof DuotoneBeatBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DuotoneBeat = Interactive.withSchema({\n Component: DuotoneBeatInner,\n componentName: \"<DuotoneBeat>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 120+}diff --git a/registry-artifacts/elements/exploded-view.json b/registry-artifacts/elements/exploded-view.jsonnew file mode 100644index 00000000..6aae7c2e--- /dev/null+++ b/registry-artifacts/elements/exploded-view.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Exploded View",+ "durationInFrames": 50,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "exploded-view",+ "sourceCode": "import { AbsoluteFill, Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype ExplodedViewColors = {\n background: string;\n top: string;\n left: string;\n right: string;\n highlightTop: string;\n highlightLeft: string;\n highlightRight: string;\n line: string;\n label: string;\n};\n\ntype ExplodedViewProps = {\n /** Number of slabs, 2 to 6. */\n layers?: number;\n /** One label per slab, top slab first. */\n labels?: string[];\n /** Index of the red slab, counted from the top. */\n highlight?: number;\n colors?: Partial<ExplodedViewColors>;\n /** Background color. Overrides `colors.background`. */\n backgroundColor?: string;\n /** Label text color. Overrides `colors.label`. */\n labelColor?: string;\n speed?: number;\n};\n\nconst explodedViewDefaults = {\n layers: 4,\n labels: [\"Interface\", \"Engine\", \"Storage\", \"Hardware\"],\n highlight: 1,\n colors: {\n background: \"#111111\",\n top: \"#F4F4F4\",\n left: \"#A6A6A6\",\n right: \"#747474\",\n highlightTop: \"#E5322D\",\n highlightLeft: \"#B5231F\",\n highlightRight: \"#8A1A17\",\n line: \"#FFFFFF\",\n label: \"#FFFFFF\",\n } satisfies ExplodedViewColors,\n speed: 1,\n};\n\nconst FONT = \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst OPEN = 3;\nconst CLOSE = 38;\nconst COS30 = Math.cos(Math.PI / 6);\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction ExplodedViewBase({\n layers = explodedViewDefaults.layers,\n labels = explodedViewDefaults.labels,\n highlight = explodedViewDefaults.highlight,\n colors: colorOverrides,\n backgroundColor,\n labelColor,\n speed = explodedViewDefaults.speed,\n}: ExplodedViewProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...explodedViewDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n background: backgroundColor ?? baseColors.background,\n label: labelColor ?? baseColors.label,\n };\n const n = Math.round(Math.min(6, Math.max(2, layers)));\n const t = (frame * speed * 30) / fps;\n\n const side = height * 0.36;\n const thick = height * 0.036;\n const gap = (height * 0.27) / (n - 1);\n const cx = width * 0.4;\n const cy = height * 0.5;\n\n const iso = (X: number, Y: number, Z: number) =>\n [(X - Y) * COS30, (X + Y) * 0.5 - Z] as const;\n const pts = (list: (readonly [number, number])[]) =>\n list.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(\" \");\n\n const close = spring({\n frame: t - CLOSE,\n fps: 30,\n config: { damping: 26, stiffness: 320, mass: 0.8 },\n });\n // Top slab leaves first; bottom one barely waits.\n const spread = Array.from({ length: n }, (_, i) => {\n const fromTop = n - 1 - i;\n const open = spring({\n frame: t - OPEN - fromTop * 1.5,\n fps: 30,\n config: { damping: 12, stiffness: 110 },\n });\n return Math.max(0, open * (1 - close));\n });\n const offsets: number[] = [];\n let z = 0;\n for (let i = 0; i < n; i++) {\n offsets.push(z);\n z += thick + (i < n - 1 ? gap * Math.max(spread[i + 1], 0) : 0);\n }\n const total = z;\n // The click: a short downward knock once the slabs meet again.\n const knock =\n interpolate(t, [CLOSE + 5, CLOSE + 7, CLOSE + 12], [0, 1, 0], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n }) *\n height *\n 0.008;\n const baseY = cy + side * 0.02 + total / 2 + knock;\n const labelOut = interpolate(t, [CLOSE - 5, CLOSE], [1, 0], clamp);\n const labelX = width * 0.66;\n const fontSize = height * 0.042;\n\n const slabs: React.ReactNode[] = [];\n const leaders: React.ReactNode[] = [];\n for (let i = 0; i < n; i++) {\n const fromTop = n - 1 - i;\n const hot = fromTop === highlight;\n const z0 = offsets[i];\n const z1 = z0 + thick;\n const h = side / 2;\n const top = [\n iso(-h, -h, z1),\n iso(h, -h, z1),\n iso(h, h, z1),\n iso(-h, h, z1),\n ];\n const left = [iso(-h, h, z1), iso(h, h, z1), iso(h, h, z0), iso(-h, h, z0)];\n const right = [\n iso(h, -h, z1),\n iso(h, h, z1),\n iso(h, h, z0),\n iso(h, -h, z0),\n ];\n const inset = h * 0.78;\n const inner = [\n iso(-inset, -inset, z1),\n iso(inset, -inset, z1),\n iso(inset, inset, z1),\n iso(-inset, inset, z1),\n ];\n const ink = hot ? \"#FFFFFF\" : \"#111111\";\n slabs.push(\n <g key={i}>\n <polygon\n points={pts(left)}\n fill={hot ? colors.highlightLeft : colors.left}\n />\n <polygon\n points={pts(right)}\n fill={hot ? colors.highlightRight : colors.right}\n />\n <polygon\n points={pts(top)}\n fill={hot ? colors.highlightTop : colors.top}\n />\n <polygon\n points={pts(inner)}\n fill=\"none\"\n stroke={ink}\n strokeOpacity={0.18}\n strokeWidth={height * 0.002}\n />\n {[-0.4, 0, 0.4].map((k) => {\n const a = iso(-inset * 0.7, k * inset, z1);\n const b = iso(inset * (fromTop % 2 ? 0.2 : 0.7), k * inset, z1);\n return (\n <line\n key={k}\n x1={a[0]}\n y1={a[1]}\n x2={b[0]}\n y2={b[1]}\n stroke={ink}\n strokeOpacity={0.22}\n strokeWidth={height * 0.006}\n strokeLinecap=\"round\"\n />\n );\n })}\n </g>,\n );\n\n const label = labels[fromTop];\n if (!label) continue;\n const anchor = iso(h, -h, (z0 + z1) / 2);\n const draw = interpolate(\n t,\n [14 + fromTop * 2.5, 24 + fromTop * 2.5],\n [0, 1],\n {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n },\n );\n const show =\n interpolate(t, [19 + fromTop * 2.5, 27 + fromTop * 2.5], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n }) * labelOut;\n const ax = cx + anchor[0] + height * 0.012;\n const ay = baseY + anchor[1];\n const length = (labelX - ax) * draw * labelOut;\n leaders.push(\n <g key={`l${i}`}>\n <circle\n cx={ax}\n cy={ay}\n r={height * 0.006}\n fill={colors.line}\n opacity={Math.min(1, draw * 3) * labelOut}\n />\n <line\n x1={ax}\n y1={ay}\n x2={ax + length}\n y2={ay}\n stroke={colors.line}\n strokeOpacity={0.6}\n strokeWidth={Math.max(1, height * 0.0022)}\n />\n <g\n opacity={show}\n transform={`translate(${labelX + height * 0.02 + (1 - show) * height * 0.03} ${ay})`}\n >\n <text\n y={-fontSize * 0.62}\n fill={hot ? colors.highlightTop : colors.label}\n fillOpacity={hot ? 1 : 0.5}\n fontFamily={FONT}\n fontSize={fontSize * 0.5}\n fontWeight={600}\n letterSpacing=\"0.12em\"\n >\n {`0${fromTop + 1}`}\n </text>\n <text\n y={fontSize * 0.42}\n fill={colors.label}\n fontFamily={FONT}\n fontSize={fontSize}\n fontWeight={700}\n letterSpacing=\"-0.02em\"\n >\n {label}\n </text>\n </g>\n </g>,\n );\n }\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <ellipse\n cx={cx}\n cy={baseY + side * 0.5 + height * 0.035}\n rx={side * COS30 * 1.05}\n ry={side * 0.16}\n fill=\"#000000\"\n opacity={0.5}\n />\n <g transform={`translate(${cx} ${baseY})`}>{slabs}</g>\n {leaders}\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n labels: {\n type: \"text-content\",\n default: \"Interface, Engine, Storage, Hardware\",\n description: \"Labels (comma-separated)\",\n },\n layers: {\n type: \"number\",\n default: 4,\n min: 2,\n max: 6,\n step: 1,\n description: \"Slabs\",\n hiddenFromList: false,\n },\n highlight: {\n type: \"number\",\n default: 1,\n min: 0,\n max: 5,\n step: 1,\n description: \"Highlighted slab\",\n hiddenFromList: false,\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n labelColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Labels\",\n },\n speed: {\n 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([\"labels\",\"layers\",\"highlight\",\"backgroundColor\",\"labelColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n labels: \"Interface, Engine, Storage, Hardware\",\n layers: 4,\n highlight: 1,\n backgroundColor: \"#111111\",\n labelColor: \"#FFFFFF\",\n speed: 1,\n};\n\ntype ExplodedViewElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ExplodedViewBase>;\n\nconst ExplodedViewInner = forwardRef<\n HTMLDivElement,\n ExplodedViewElementProps & { 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 ?? \"<ExplodedView>\"}\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 <ExplodedViewBase\n {...(componentProps as unknown as ComponentProps<typeof ExplodedViewBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ExplodedView = Interactive.withSchema({\n Component: ExplodedViewInner,\n componentName: \"<ExplodedView>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 50+}diff --git a/registry-artifacts/elements/flow-field.json b/registry-artifacts/elements/flow-field.jsonnew file mode 100644index 00000000..a254419b--- /dev/null+++ b/registry-artifacts/elements/flow-field.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Flow Field",+ "durationInFrames": 300,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "flow-field",+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype FlowFieldProps = {\n /** Number of particles in flight. */\n particles?: number;\n /** Trail length in simulation steps (frames). */\n trailLength?: number;\n /** Frames for one seamless loop of the field and the particle lifecycles. */\n loopFrames?: number;\n /** Particle lifetime in frames, rounded so it divides loopFrames. */\n lifeFrames?: number;\n /** Share of particles drawn in the accent color, 0 to 1. */\n accentRatio?: number;\n /** Trail width in px at 720p. */\n strokeWidth?: number;\n seed?: number;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nconst flowFieldDefaults: Required<FlowFieldProps> = {\n particles: 300,\n trailLength: 72,\n loopFrames: 300,\n lifeFrames: 150,\n accentRatio: 0.1,\n strokeWidth: 1.4,\n seed: 1,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst TAU = Math.PI * 2;\nconst WAVES = 4;\n// Distance per frame in units of the short side of the frame.\nconst STEP = 0.0042;\nconst BUCKETS = 6;\n\ntype Wave = {\n fx: number;\n fy: number;\n phase: number;\n drift: number;\n amp: number;\n};\n\nfunction makeField(seed: number) {\n const r = (key: string) => random(`flow-field-${seed}-${key}`);\n const base = r(\"base\") * TAU;\n const waves: Wave[] = Array.from({ length: WAVES }, (_, k) => ({\n fx: (r(`fx${k}`) * 2 - 1) * (0.9 + k * 0.8),\n fy: (r(`fy${k}`) * 2 - 1) * (0.9 + k * 0.8),\n phase: r(`ph${k}`) * TAU,\n drift: 0.6 + r(`dr${k}`) * 0.9,\n amp: 1.6 / (1 + k * 1.4),\n }));\n // Flow angle at (x, y). `tau` walks around a circle once per loop, so the\n // field at the end of the loop is exactly the field at the start.\n return (x: number, y: number, tau: number) => {\n let a = base;\n for (const w of waves) {\n a +=\n w.amp *\n Math.sin(\n w.fx * x + w.fy * y + w.phase + w.drift * Math.sin(tau + w.phase),\n );\n }\n return a;\n };\n}\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\nfunction FlowFieldBase({\n particles = flowFieldDefaults.particles,\n trailLength = flowFieldDefaults.trailLength,\n loopFrames = flowFieldDefaults.loopFrames,\n lifeFrames = flowFieldDefaults.lifeFrames,\n accentRatio = flowFieldDefaults.accentRatio,\n strokeWidth = flowFieldDefaults.strokeWidth,\n seed = flowFieldDefaults.seed,\n speed = flowFieldDefaults.speed,\n background = flowFieldDefaults.background,\n color = flowFieldDefaults.color,\n accent = flowFieldDefaults.accent,\n}: FlowFieldProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const field = useMemo(() => makeField(seed), [seed]);\n\n const unit = Math.min(width, height);\n const spanX = width / unit;\n const spanY = height / unit;\n const loop = Math.max(1, Math.round(loopFrames));\n const lives = Math.max(1, Math.round(loop / Math.max(1, lifeFrames)));\n const life = loop / lives;\n const trail = Math.max(2, Math.min(trailLength, life * 0.6));\n const travel = life - trail;\n const time = frame * speed;\n\n const paths = {\n color: new Array<string>(BUCKETS).fill(\"\"),\n accent: new Array<string>(BUCKETS).fill(\"\"),\n };\n const pts: number[] = [];\n\n for (let i = 0; i < particles; i++) {\n const offset = random(`flow-field-${seed}-off-${i}`) * life;\n const local = time + offset;\n const cycle = Math.floor(local / life);\n const age = local - cycle * life;\n // Head moves for `travel` frames, then stops while the tail catches up,\n // so trails grow in and drain out instead of popping.\n const head = Math.min(age, travel);\n const tail = Math.max(0, age - trail);\n if (head - tail < 0.05) continue;\n\n const slot = ((cycle % lives) + lives) % lives;\n const key = `flow-field-${seed}-p${i}-c${slot}`;\n let x = -0.08 + random(`${key}-x`) * (spanX + 0.16);\n let y = -0.08 + random(`${key}-y`) * (spanY + 0.16);\n const birth = time - age;\n\n pts.length = 0;\n pts.push(x, y);\n const steps = Math.ceil(head);\n for (let s = 0; s < steps; s++) {\n const a = field(x, y, (TAU * (birth + s)) / loop);\n x += Math.cos(a) * STEP;\n y += Math.sin(a) * STEP;\n pts.push(x, y);\n }\n const at = (k: number) => {\n const j = Math.min(Math.floor(k), steps - 1);\n const f = k - j;\n if (j < 0) return [pts[0], pts[1]];\n return [\n pts[j * 2] + (pts[j * 2 + 2] - pts[j * 2]) * f,\n pts[j * 2 + 1] + (pts[j * 2 + 3] - pts[j * 2 + 1]) * f,\n ];\n };\n\n const target =\n random(`flow-field-${seed}-accent-${i}`) < accentRatio\n ? paths.accent\n : paths.color;\n // Split the visible trail into age buckets; older buckets are fainter.\n for (let b = 0; b < BUCKETS; b++) {\n const from = Math.max(tail, age - (trail * (b + 1)) / BUCKETS);\n const to = Math.min(head, age - (trail * b) / BUCKETS);\n if (to - from <= 0.01) continue;\n const [fx, fy] = at(from);\n let d = `M ${fmt(fx * unit)} ${fmt(fy * unit)}`;\n for (let k = Math.floor(from) + 1; k < to; k++) {\n d += ` L ${fmt(pts[k * 2] * unit)} ${fmt(pts[k * 2 + 1] * unit)}`;\n }\n const [tx, ty] = at(to);\n d += ` L ${fmt(tx * unit)} ${fmt(ty * unit)} `;\n target[b] += d;\n }\n }\n\n const sw = (strokeWidth * unit) / 720;\n const layers = [\n { key: \"color\", paint: color, list: paths.color },\n { key: \"accent\", paint: accent, list: paths.accent },\n ];\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Flow field\"\n style={{ display: \"block\" }}\n >\n {layers.map((layer) => (\n <g\n key={layer.key}\n fill=\"none\"\n stroke={layer.paint}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n {layer.list.map((d, b) => (\n <path\n key={b}\n d={d}\n strokeOpacity={0.9 * (1 - b / BUCKETS) ** 1.4}\n strokeWidth={sw * (1 - (b / BUCKETS) * 0.5)}\n />\n ))}\n </g>\n ))}\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n particles: {\n type: \"number\",\n default: 300,\n min: 50,\n max: 800,\n step: 10,\n description: \"Particles\",\n hiddenFromList: false,\n },\n trailLength: {\n type: \"number\",\n default: 72,\n min: 8,\n max: 120,\n step: 1,\n description: \"Trail length\",\n hiddenFromList: false,\n },\n strokeWidth: {\n type: \"number\",\n default: 1.4,\n min: 0.5,\n max: 4,\n step: 0.1,\n description: \"Stroke width\",\n hiddenFromList: false,\n },\n accentRatio: {\n type: \"number\",\n default: 0.1,\n min: 0,\n max: 1,\n step: 0.05,\n description: \"Accent share\",\n hiddenFromList: false,\n },\n loopFrames: {\n type: \"number\",\n default: 300,\n min: 120,\n max: 600,\n step: 30,\n description: \"Loop frames\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 1,\n min: 1,\n max: 50,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Trails\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent\",\n },\n speed: {\n 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([\"particles\",\"trailLength\",\"strokeWidth\",\"accentRatio\",\"loopFrames\",\"seed\",\"background\",\"color\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n particles: 300,\n trailLength: 72,\n strokeWidth: 1.4,\n accentRatio: 0.1,\n loopFrames: 300,\n seed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype FlowFieldElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof FlowFieldBase>;\n\nconst FlowFieldInner = forwardRef<\n HTMLDivElement,\n FlowFieldElementProps & { 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 ?? \"<FlowField>\"}\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 <FlowFieldBase\n {...(componentProps as unknown as ComponentProps<typeof FlowFieldBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const FlowField = Interactive.withSchema({\n Component: FlowFieldInner,\n componentName: \"<FlowField>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 300+}diff --git a/registry-artifacts/elements/gravity-pile.json b/registry-artifacts/elements/gravity-pile.jsonnew file mode 100644index 00000000..f4e65f22--- /dev/null+++ b/registry-artifacts/elements/gravity-pile.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Gravity Pile",+ "durationInFrames": 64,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "gravity-pile",+ "sourceCode": "import React, { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype GravityPileColors = {\n background: string;\n shapes: string[];\n accent: string;\n floor: string;\n};\n\ntype GravityPileProps = {\n /** Number of falling bodies. */\n count?: number;\n seed?: number;\n /** Gravity multiplier. */\n gravity?: number;\n /** Optional nodes dropped as round bodies, landing on top of the heap. */\n items?: React.ReactNode[];\n colors?: Partial<GravityPileColors>;\n /** Color of the single accent body. Overrides `colors.accent`. */\n accentColor?: string;\n /** Background color. Overrides `colors.background`. */\n backgroundColor?: string;\n speed?: number;\n};\n\nconst gravityPileDefaults = {\n count: 30,\n seed: 7,\n gravity: 1,\n colors: {\n background: \"#111111\",\n shapes: [\"#FFFFFF\", \"#C9C9C9\", \"#7A7A7A\"],\n accent: \"#E5322D\",\n floor: \"#FFFFFF\",\n } satisfies GravityPileColors,\n speed: 1,\n};\n\ntype Kind = \"circle\" | \"square\" | \"triangle\" | \"item\";\ntype Body = { r: number; kind: Kind; color: number; accent: boolean };\ntype Sim = { bodies: Body[]; frames: Float32Array[]; floor: number };\n\nconst FRAMES = 150;\nconst SUBSTEPS = 10;\nconst ITERATIONS = 4;\nconst BOUNCE = 0.42;\nconst FRICTION = 0.12;\nconst DAMPING = 0.999;\nconst GRIP = 0.45;\nconst SETTLE_FROM = 46;\nconst SETTLE_FRAMES = 18;\n\n// Verlet integration with position-based circle contacts. Runs once per\n// (size, count, seed, gravity), records every frame, and the component only\n// reads the table back.\nfunction simulate(\n width: number,\n height: number,\n count: number,\n seed: number,\n gravity: number,\n itemCount: number,\n): Sim {\n const rnd = (key: string, i: number) =>\n random(`gravity-pile-${seed}-${key}-${i}`);\n const floor = height * 0.9;\n const g = (height / 200) * gravity;\n const dt = 1 / SUBSTEPS;\n // Weaker gravity means a slower rain, so the heap settles later.\n const settleFrom = SETTLE_FROM / Math.sqrt(Math.max(0.2, gravity));\n const kinds: Kind[] = [\"circle\", \"square\", \"triangle\"];\n const accentIndex = Math.max(0, count - itemCount - 3);\n const bodies: Body[] = Array.from({ length: count }, (_, i) => ({\n r: height * (0.036 + rnd(\"r\", i) * 0.032),\n kind: i >= count - itemCount ? \"item\" : kinds[Math.floor(rnd(\"k\", i) * 3)],\n color: Math.floor(rnd(\"c\", i) * 3),\n accent: i === accentIndex,\n }));\n const n = bodies.length;\n const x = new Float64Array(n);\n const y = new Float64Array(n);\n const px = new Float64Array(n);\n const py = new Float64Array(n);\n const angle = new Float64Array(n);\n const spin = new Float64Array(n);\n // Spawn in a tall column above the frame, rejecting overlaps so nothing\n // explodes apart on the first step.\n for (let i = 0; i < n; i++) {\n const r = bodies[i].r;\n const band = height * (0.1 + (i / Math.max(1, n)) * 2);\n for (let attempt = 0; attempt < 40; attempt++) {\n x[i] = width * (0.5 + (rnd(`x${attempt}`, i) - 0.5) * 0.26);\n y[i] = -r - band - rnd(`y${attempt}`, i) * height * 0.25;\n let clear = true;\n for (let j = 0; j < i && clear; j++) {\n const gap = bodies[i].r + bodies[j].r + 2;\n clear = (x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2 > gap * gap;\n }\n if (clear) break;\n }\n px[i] = x[i] - (rnd(\"vx\", i) - 0.5) * 0.6 * dt;\n py[i] = y[i] - height * 0.004 * dt;\n angle[i] = rnd(\"a\", i) * Math.PI * 2;\n spin[i] = (rnd(\"s\", i) - 0.5) * 0.02;\n }\n\n const frames: Float32Array[] = [];\n const record = () => {\n const out = new Float32Array(n * 3);\n for (let i = 0; i < n; i++) {\n out[i * 3] = x[i];\n out[i * 3 + 1] = y[i];\n out[i * 3 + 2] = angle[i];\n }\n frames.push(out);\n };\n record();\n\n for (let f = 1; f <= FRAMES; f++) {\n // Once damped out, the heap sleeps: no more solver creep.\n if (f > settleFrom + SETTLE_FRAMES) {\n frames.push(frames[frames.length - 1]);\n continue;\n }\n for (let s = 0; s < SUBSTEPS; s++) {\n // Late in the sim, bleed energy off so the heap comes fully to rest\n // instead of creeping forever.\n const settle = Math.min(1, Math.max(0, (f - settleFrom) / SETTLE_FRAMES));\n const damping = DAMPING - settle * 0.12;\n for (let i = 0; i < n; i++) {\n const vx = (x[i] - px[i]) * damping;\n const vy = (y[i] - py[i]) * damping;\n px[i] = x[i];\n py[i] = y[i];\n x[i] += vx;\n y[i] += vy + g * dt * dt;\n }\n for (let it = 0; it < ITERATIONS; it++) {\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++) {\n const dx = x[j] - x[i];\n const dy = y[j] - y[i];\n const min = bodies[i].r + bodies[j].r;\n const d2 = dx * dx + dy * dy;\n if (d2 >= min * min || d2 === 0) continue;\n const d = Math.sqrt(d2);\n const push = (min - d) / d;\n const mi = bodies[i].r ** 2;\n const mj = bodies[j].r ** 2;\n const wi = mj / (mi + mj);\n const wj = mi / (mi + mj);\n x[i] -= dx * push * wi;\n y[i] -= dy * push * wi;\n x[j] += dx * push * wj;\n y[j] += dy * push * wj;\n }\n }\n for (let i = 0; i < n; i++) {\n const r = bodies[i].r;\n if (y[i] + r > floor) {\n const vy = y[i] - py[i];\n y[i] = floor - r;\n // Reflect only real impacts so resting bodies do not buzz.\n py[i] = vy > g * dt * 4 ? y[i] + vy * BOUNCE : y[i];\n px[i] = x[i] - (x[i] - px[i]) * (1 - FRICTION);\n }\n if (x[i] - r < 0) {\n x[i] = r;\n px[i] = x[i] + (x[i] - px[i]) * BOUNCE;\n }\n if (x[i] + r > width) {\n x[i] = width - r;\n px[i] = x[i] + (x[i] - px[i]) * BOUNCE;\n }\n }\n }\n // Contact friction: damp relative sliding so bodies stack instead of\n // flowing apart like marbles.\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++) {\n const dx = x[j] - x[i];\n const dy = y[j] - y[i];\n const min = bodies[i].r + bodies[j].r + 0.5;\n const d2 = dx * dx + dy * dy;\n if (d2 >= min * min || d2 === 0) continue;\n const d = Math.sqrt(d2);\n const tx = -dy / d;\n const ty = dx / d;\n const rel =\n (x[j] - px[j] - (x[i] - px[i])) * tx +\n (y[j] - py[j] - (y[i] - py[i])) * ty;\n const mi = bodies[i].r ** 2;\n const mj = bodies[j].r ** 2;\n const k = rel * GRIP;\n px[i] -= tx * k * (mj / (mi + mj));\n py[i] -= ty * k * (mj / (mi + mj));\n px[j] += tx * k * (mi / (mi + mj));\n py[j] += ty * k * (mi / (mi + mj));\n }\n }\n for (let i = 0; i < n; i++) {\n const r = bodies[i].r;\n const vx = x[i] - px[i];\n // Bodies near the floor or the heap roll; free-falling ones keep spinning.\n const grounded =\n y[i] + r > floor - 1 || Math.abs(y[i] - py[i]) < g * dt;\n if (grounded) spin[i] = Math.abs(vx) > 0.05 ? vx / r : spin[i] * 0.8;\n angle[i] += spin[i];\n }\n }\n record();\n }\n return { bodies, frames, floor };\n}\n\nfunction Shape({ body, fill }: { body: Body; fill: string }) {\n const r = body.r;\n if (body.kind === \"circle\") return <circle r={r} fill={fill} />;\n if (body.kind === \"square\") {\n const h = r * 0.84;\n return (\n <rect\n x={-h}\n y={-h}\n width={h * 2}\n height={h * 2}\n rx={r * 0.12}\n fill={fill}\n />\n );\n }\n const c = r * 1.12;\n const pts = [0, 1, 2]\n .map((k) => {\n const a = -Math.PI / 2 + (k * Math.PI * 2) / 3;\n return `${(Math.cos(a) * c).toFixed(2)},${(Math.sin(a) * c + r * 0.12).toFixed(2)}`;\n })\n .join(\" \");\n return (\n <polygon\n points={pts}\n fill={fill}\n strokeLinejoin=\"round\"\n stroke={fill}\n strokeWidth={r * 0.14}\n />\n );\n}\n\nfunction GravityPileBase({\n count = gravityPileDefaults.count,\n seed = gravityPileDefaults.seed,\n gravity = gravityPileDefaults.gravity,\n items,\n colors: colorOverrides,\n accentColor,\n backgroundColor,\n speed = gravityPileDefaults.speed,\n}: GravityPileProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...gravityPileDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n accent: accentColor ?? baseColors.accent,\n background: backgroundColor ?? baseColors.background,\n };\n const itemCount = Math.min(\n items?.length ?? 0,\n Math.max(1, Math.round(count)),\n );\n const sim = useMemo(\n () =>\n simulate(\n width,\n height,\n Math.max(1, Math.round(count)),\n seed,\n gravity,\n itemCount,\n ),\n [width, height, count, seed, gravity, itemCount],\n );\n\n const t = Math.min(FRAMES, Math.max(0, (frame * speed * 30) / fps));\n const f0 = Math.floor(t);\n const f1 = Math.min(FRAMES, f0 + 1);\n const mix = t - f0;\n const a = sim.frames[f0];\n const b = sim.frames[f1];\n const n = sim.bodies.length;\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <line\n x1={0}\n x2={width}\n y1={sim.floor + 1}\n y2={sim.floor + 1}\n stroke={colors.floor}\n strokeOpacity={0.25}\n strokeWidth={2}\n />\n {sim.bodies.map((body, i) => {\n if (body.kind === \"item\") return null;\n const x = a[i * 3] + (b[i * 3] - a[i * 3]) * mix;\n const y = a[i * 3 + 1] + (b[i * 3 + 1] - a[i * 3 + 1]) * mix;\n const rot = a[i * 3 + 2] + (b[i * 3 + 2] - a[i * 3 + 2]) * mix;\n const fill = body.accent\n ? colors.accent\n : colors.shapes[body.color % colors.shapes.length];\n return (\n <g\n key={i}\n transform={`translate(${x.toFixed(2)} ${y.toFixed(2)}) rotate(${((rot * 180) / Math.PI).toFixed(2)})`}\n >\n <Shape body={body} fill={fill} />\n </g>\n );\n })}\n </svg>\n {items?.slice(0, itemCount).map((item, j) => {\n const i = n - itemCount + j;\n const body = sim.bodies[i];\n const x = a[i * 3] + (b[i * 3] - a[i * 3]) * mix;\n const y = a[i * 3 + 1] + (b[i * 3 + 1] - a[i * 3 + 1]) * mix;\n const rot = a[i * 3 + 2] + (b[i * 3 + 2] - a[i * 3 + 2]) * mix;\n return (\n <div\n key={j}\n style={{\n position: \"absolute\",\n left: x - body.r,\n top: y - body.r,\n width: body.r * 2,\n height: body.r * 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `rotate(${rot}rad)`,\n }}\n >\n {item}\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n count: {\n type: \"number\",\n default: 30,\n min: 4,\n max: 60,\n step: 1,\n description: \"Bodies\",\n hiddenFromList: false,\n },\n gravity: {\n type: \"number\",\n default: 1,\n min: 0.5,\n max: 2.5,\n step: 0.1,\n description: \"Gravity\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 7,\n min: 1,\n max: 40,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n accentColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"count\",\"gravity\",\"seed\",\"accentColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n count: 30,\n gravity: 1,\n seed: 7,\n accentColor: \"#E5322D\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype GravityPileElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof GravityPileBase>;\n\nconst GravityPileInner = forwardRef<\n HTMLDivElement,\n GravityPileElementProps & { 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 ?? \"<GravityPile>\"}\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 <GravityPileBase\n {...(componentProps as unknown as ComponentProps<typeof GravityPileBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const GravityPile = Interactive.withSchema({\n Component: GravityPileInner,\n componentName: \"<GravityPile>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 64+}diff --git a/registry-artifacts/elements/impact-shake.json b/registry-artifacts/elements/impact-shake.jsonnew file mode 100644index 00000000..63cd0927--- /dev/null+++ b/registry-artifacts/elements/impact-shake.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Impact Shake",+ "durationInFrames": 30,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "impact-shake",+ "sourceCode": "import React, { forwardRef, useId, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype ImpactShakeColors = {\n background: string;\n foreground: string;\n splitA: string;\n splitB: string;\n dust: string;\n};\n\ntype ImpactShakeProps = {\n /** The heavy subject. Defaults to a big white word. */\n children?: React.ReactNode;\n /** Word used when no children are passed. */\n text?: string;\n /** Shake, split and dust strength, 0 to 2. */\n intensity?: number;\n /** Frame (at 30fps) when the subject hits. */\n impact?: number;\n colors?: Partial<ImpactShakeColors>;\n /** Default word and flash color. Overrides `colors.foreground`. */\n foregroundColor?: string;\n /** Background color. Overrides `colors.background`. */\n backgroundColor?: string;\n seed?: number;\n speed?: number;\n};\n\nconst impactShakeDefaults = {\n text: \"LAUNCH\",\n intensity: 1,\n impact: 7,\n colors: {\n background: \"#111111\",\n foreground: \"#FFFFFF\",\n splitA: \"#FF2A2A\",\n splitB: \"#2A6BFF\",\n dust: \"#D9D9D9\",\n } satisfies ImpactShakeColors,\n seed: 1,\n speed: 1,\n};\n\nconst FONT = \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst DUST = 36;\n\n// Turns any content into a flat silhouette of one color, keeping its alpha.\nfunction tintMatrix(hex: string) {\n const v = Number.parseInt(hex.replace(\"#\", \"\").slice(0, 6), 16);\n const r = ((v >> 16) & 255) / 255;\n const g = ((v >> 8) & 255) / 255;\n const b = (v & 255) / 255;\n return `0 0 0 0 ${r} 0 0 0 0 ${g} 0 0 0 0 ${b} 0 0 0 1 0`;\n}\n\nfunction ImpactShakeBase({\n children,\n text = impactShakeDefaults.text,\n intensity = impactShakeDefaults.intensity,\n impact = impactShakeDefaults.impact,\n colors: colorOverrides,\n foregroundColor,\n backgroundColor,\n seed = impactShakeDefaults.seed,\n speed = impactShakeDefaults.speed,\n}: ImpactShakeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const uid = `impact-shake-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const baseColors = { ...impactShakeDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n foreground: foregroundColor ?? baseColors.foreground,\n background: backgroundColor ?? baseColors.background,\n };\n const t = (frame * speed * 30) / fps;\n const k = Math.max(0, intensity);\n const unit = height / 720;\n const since = t - impact;\n\n // Fall: pure acceleration into the hit, no easing out.\n const fall = interpolate(t, [0, impact], [-height * 0.85, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const falling = since < 0;\n const stretch = falling\n ? interpolate(t, [0, impact], [1, 1.18], { extrapolateRight: \"clamp\" })\n : 1;\n const squash = falling\n ? 0\n : 1 -\n spring({ frame: since, fps: 30, config: { damping: 9, stiffness: 260 } });\n const sx = falling\n ? 1 / Math.sqrt(stretch)\n : 1 + 0.16 * squash * Math.min(1, k);\n const sy = falling ? stretch : 1 - 0.2 * squash * Math.min(1, k);\n\n // Damped camera shake with incommensurate frequencies so it never looks looped.\n const decay = since >= 0 ? Math.exp(-since / 3.2) : 0;\n const phase = random(`impact-shake-${seed}`) * Math.PI * 2;\n const shakeX = decay * Math.sin(since * 2.9 + phase) * 26 * unit * k;\n const shakeY = decay * Math.cos(since * 3.7 + phase) * 34 * unit * k;\n const shakeR = decay * Math.sin(since * 2.3 + phase * 2) * 1.6 * k;\n\n const split =\n since >= 0 && since < 2 ? (1 - since / 2) * 18 * unit * k + 6 * unit : 0;\n const flash = interpolate(since, [0, 0.5, 2.5], [0, 0.12, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const floorY = height * 0.62;\n const dust = useMemo(\n () =>\n Array.from({ length: DUST }, (_, i) => {\n const key = `impact-shake-${seed}-dust-${i}`;\n const side = i % 2 === 0 ? -1 : 1;\n return {\n chip: i % 3 === 0,\n x0: (0.04 + random(`${key}-x`) * 0.24) * side,\n vx: side * (0.4 + random(`${key}-v`) * 1),\n vy: 0.3 + random(`${key}-u`) * 0.9,\n size: 0.5 + random(`${key}-s`) * 0.9,\n life: 11 + random(`${key}-l`) * 9,\n };\n }),\n [seed],\n );\n\n const subject = children ?? (\n <span\n style={{\n fontFamily: FONT,\n fontSize: height * 0.24,\n fontWeight: 900,\n letterSpacing: \"-0.05em\",\n lineHeight: 1,\n color: colors.foreground,\n }}\n >\n {text}\n </span>\n );\n\n const layer = (filter: string | undefined, dx: number, key: string) => (\n <AbsoluteFill\n key={key}\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter,\n transform: `translate(${dx}px, ${fall}px) scale(${sx}, ${sy})`,\n transformOrigin: `50% ${(floorY / height) * 100}%`,\n mixBlendMode: filter ? \"screen\" : undefined,\n }}\n >\n {subject}\n </AbsoluteFill>\n );\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter id={`${uid}-a`} colorInterpolationFilters=\"sRGB\">\n <feColorMatrix type=\"matrix\" values={tintMatrix(colors.splitA)} />\n </filter>\n <filter id={`${uid}-b`} colorInterpolationFilters=\"sRGB\">\n <feColorMatrix type=\"matrix\" values={tintMatrix(colors.splitB)} />\n </filter>\n </svg>\n <AbsoluteFill\n style={{\n transform: `translate(${shakeX}px, ${shakeY}px) rotate(${shakeR}deg) scale(${1 + decay * 0.04 * k})`,\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <filter\n id={`${uid}-puff`}\n x=\"-50%\"\n y=\"-50%\"\n width=\"200%\"\n height=\"200%\"\n >\n <feGaussianBlur stdDeviation={height * 0.007} />\n </filter>\n {since >= 0\n ? dust.map((p, i) => {\n const age = since;\n if (age > p.life) return null;\n const life = age / p.life;\n const spread = Math.max(0.4, k);\n if (p.chip) {\n // Debris: ballistic arc, small and bright.\n const x =\n width / 2 + p.x0 * width + p.vx * age * 10 * unit * spread;\n const y =\n floorY - p.vy * age * 16 * unit + age * age * 1.6 * unit;\n const size = p.size * 6 * unit;\n return (\n <rect\n key={i}\n x={x - size / 2}\n y={y - size / 2}\n width={size}\n height={size}\n fill={colors.dust}\n opacity={(1 - life) * 0.9}\n transform={`rotate(${age * 40 * p.vx} ${x} ${y})`}\n />\n );\n }\n // Puffs: burst outward against heavy drag, then hang and swell.\n const travel = 1 - Math.exp(-age / 3.5);\n const x =\n width / 2 +\n p.x0 * width +\n p.vx * travel * width * 0.16 * spread;\n const y = floorY - p.vy * travel * height * 0.07;\n const r =\n height * p.size * (0.015 + 0.05 * travel + 0.02 * life);\n return (\n <circle\n key={i}\n cx={x}\n cy={y}\n r={r}\n fill={colors.dust}\n opacity={(1 - life) ** 1.4 * 0.38}\n filter={`url(#${uid}-puff)`}\n />\n );\n })\n : null}\n </svg>\n {split > 0 ? (\n <>\n {layer(`url(#${uid}-a)`, -split, \"a\")}\n {layer(`url(#${uid}-b)`, split, \"b\")}\n </>\n ) : null}\n {layer(undefined, 0, \"main\")}\n </AbsoluteFill>\n <AbsoluteFill\n style={{ backgroundColor: colors.foreground, opacity: flash * k }}\n />\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"LAUNCH\",\n description: \"Text\",\n },\n intensity: {\n type: \"number\",\n default: 1,\n min: 0,\n max: 2,\n step: 0.1,\n description: \"Intensity\",\n hiddenFromList: false,\n },\n impact: {\n type: \"number\",\n default: 7,\n min: 2,\n max: 30,\n step: 1,\n description: \"Impact frame\",\n hiddenFromList: false,\n },\n foregroundColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Foreground\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n seed: {\n type: \"number\",\n default: 1,\n min: 1,\n max: 24,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"intensity\",\"impact\",\"foregroundColor\",\"backgroundColor\",\"seed\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"LAUNCH\",\n intensity: 1,\n impact: 7,\n foregroundColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n seed: 1,\n speed: 1,\n};\n\ntype ImpactShakeElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ImpactShakeBase>;\n\nconst ImpactShakeInner = forwardRef<\n HTMLDivElement,\n ImpactShakeElementProps & { 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 ?? \"<ImpactShake>\"}\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 <ImpactShakeBase\n {...(componentProps as unknown as ComponentProps<typeof ImpactShakeBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ImpactShake = Interactive.withSchema({\n Component: ImpactShakeInner,\n componentName: \"<ImpactShake>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 30+}diff --git a/registry-artifacts/elements/inflate.json b/registry-artifacts/elements/inflate.jsonnew file mode 100644index 00000000..e28b277e--- /dev/null+++ b/registry-artifacts/elements/inflate.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Inflate",+ "durationInFrames": 35,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "inflate",+ "sourceCode": "import { AbsoluteFill, Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype InflateProps = {\n /** Wordmark revealed beside the mark once it settles. */\n children?: React.ReactNode;\n backgroundColor?: string;\n /** Body color of the mark. */\n color?: string;\n /** Specular highlight color. */\n highlight?: string;\n /** Dot inside the mark. */\n dotColor?: string;\n speed?: number;\n};\n\nconst inflateDefaults = {\n backgroundColor: \"#111111\",\n color: \"#E5322D\",\n highlight: \"#FFFFFF\",\n dotColor: \"#111111\",\n speed: 1,\n};\n\nconst PUFF = 3;\nconst WOBBLE = 10;\nconst DOT = 15;\nconst SLIDE = 22;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction InflateBase(props: InflateProps) {\n const { children, backgroundColor, color, highlight, dotColor, speed } = {\n ...inflateDefaults,\n ...props,\n };\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const size = Math.round(Math.min(width, height) * 0.22);\n\n // Main puff: an underdamped spring overshoots the final size.\n const puff = spring({\n frame: t - PUFF,\n fps,\n config: { damping: 8, stiffness: 150, mass: 0.6 },\n });\n // After the peak the body squashes wide and rings out like a balloon.\n const w0 = t - WOBBLE;\n const wobble =\n w0 > 0 ? 0.2 * Math.exp(-w0 / 6) * Math.sin((w0 / 9) * Math.PI * 2) : 0;\n\n const grow = Math.max(0, puff);\n const sliverW = interpolate(t, [0, PUFF], [0.7, 1], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n const bodyH = size * (0.05 + 0.95 * grow) * (1 - wobble);\n const bodyW = size * (sliverW + (Math.max(1, grow) - 1) * 0.8) * (1 + wobble);\n const roundness = interpolate(t, [PUFF, PUFF + 7, 26], [0.5, 0.46, 0.27], {\n ...clamp,\n easing: Easing.inOut(Easing.quad),\n });\n const radius = Math.min(bodyW, bodyH) * roundness;\n const gloss = interpolate(t, [PUFF + 2, PUFF + 9], [0, 1], clamp);\n const appear = interpolate(t, [0, 2], [0, 1], clamp);\n\n const dot = spring({\n frame: t - DOT,\n fps,\n config: { damping: 10, stiffness: 220, mass: 0.5 },\n });\n const slide = interpolate(t, [SLIDE, SLIDE + 11], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const reveal = interpolate(t, [SLIDE + 2, SLIDE + 13], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size * 0.24,\n transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,\n }}\n >\n <div\n style={{\n width: size,\n height: size,\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n flexShrink: 0,\n width: bodyW,\n height: bodyH,\n borderRadius: radius,\n backgroundColor: color,\n opacity: appear,\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxShadow: `inset ${-size * 0.06}px ${-size * 0.08}px ${size * 0.14}px rgba(0,0,0,${0.28 * gloss})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: \"14%\",\n top: \"10%\",\n width: \"46%\",\n height: \"28%\",\n borderRadius: \"50%\",\n background: `radial-gradient(ellipse at 45% 40%, ${highlight} 0%, transparent 70%)`,\n opacity: 0.55 * gloss,\n transform: \"rotate(-18deg)\",\n }}\n />\n <div\n style={{\n width: size * 0.3,\n height: size * 0.3,\n borderRadius: \"50%\",\n backgroundColor: dotColor,\n transform: `scale(${dot})`,\n }}\n />\n </div>\n </div>\n {children && (\n <div\n style={{\n opacity: reveal,\n clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,\n transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,\n }}\n >\n {children}\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Body\",\n },\n highlight: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Highlight\",\n },\n dotColor: {\n type: \"color\",\n default: \"#111111\",\n description: \"Dot\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"color\",\"highlight\",\"dotColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#E5322D\",\n highlight: \"#FFFFFF\",\n dotColor: \"#111111\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype InflateElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof InflateBase>;\n\nconst InflateInner = forwardRef<\n HTMLDivElement,\n InflateElementProps & { 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 ?? \"<Inflate>\"}\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 <InflateBase\n {...(componentProps as unknown as ComponentProps<typeof InflateBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Inflate = Interactive.withSchema({\n Component: InflateInner,\n componentName: \"<Inflate>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 35+}diff --git a/registry-artifacts/elements/isometric-build.json b/registry-artifacts/elements/isometric-build.jsonnew file mode 100644index 00000000..ac5de232--- /dev/null+++ b/registry-artifacts/elements/isometric-build.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Isometric Build",+ "durationInFrames": 38,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "isometric-build",+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Interactive, Sequence, interpolate, random, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype IsometricBuildProps = {\n /** Tiles per side. */\n grid?: number;\n /** Tallest regular block, in tile widths. The accent tower rises above it. */\n maxHeight?: number;\n /** Frames between consecutive diagonals rising. */\n stagger?: number;\n seed?: number;\n speed?: number;\n background?: string;\n /** Block color; side faces are this color shaded toward the background. */\n color?: string;\n /** The single accent tower. */\n accent?: string;\n /** Draw floor lines on the block faces. */\n floors?: boolean;\n /** Gap between neighbouring blocks, as a share of a tile. */\n gap?: number;\n};\n\nconst isometricBuildDefaults: Required<IsometricBuildProps> = {\n grid: 5,\n maxHeight: 2.2,\n stagger: 2,\n seed: 4,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n floors: true,\n gap: 0.04,\n};\n\n// True isometric: tile half-height = half-width · tan 30°, unit vertical edge\n// matches the projected tile edge.\nconst ISO_Y = Math.tan(Math.PI / 6);\nconst ISO_Z = 1 / Math.cos(Math.PI / 6);\nconst FLOOR = 0.42;\nconst SHADE_LEFT = 0.32;\nconst SHADE_RIGHT = 0.6;\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\ntype Block = {\n i: number;\n j: number;\n height: number;\n accent: boolean;\n delay: number;\n};\n\nfunction makeBlocks(\n n: number,\n maxHeight: number,\n seed: number,\n stagger: number,\n) {\n const r = (key: string) => random(`isometric-build-${seed}-${key}`);\n const inner = Math.max(1, n - 2);\n const ai = n > 2 ? 1 + Math.floor(r(\"ai\") * inner) : 0;\n const aj = n > 2 ? 1 + Math.floor(r(\"aj\") * inner) : 0;\n const blocks: Block[] = [];\n // Painter order: back (i + j small) to front.\n for (let sum = 0; sum <= 2 * (n - 1); sum++) {\n for (let i = 0; i < n; i++) {\n const j = sum - i;\n if (j < 0 || j >= n) continue;\n const accent = i === ai && j === aj;\n // One compact mass: heights follow a mound that peaks in the middle,\n // with a little seeded variation, snapped to whole floors so the\n // blocks stack like a single stepped sculpture rather than noise.\n const c = (n - 1) / 2;\n const centre = 1 - Math.hypot(i - c, j - c) / (Math.hypot(c, c) || 1);\n const raw =\n maxHeight *\n (0.2 + 0.8 * centre ** 1.3) *\n (0.75 + 0.5 * r(`h${i}-${j}`));\n const h = Math.max(FLOOR, Math.round(raw / FLOOR) * FLOOR);\n blocks.push({\n i,\n j,\n accent,\n height: accent ? maxHeight * 1.35 : h,\n // Front rows rise first.\n delay: (2 * (n - 1) - sum) * stagger + r(`d${i}-${j}`) * stagger,\n });\n }\n }\n return blocks;\n}\n\nfunction IsometricBuildBase({\n grid = isometricBuildDefaults.grid,\n maxHeight = isometricBuildDefaults.maxHeight,\n stagger = isometricBuildDefaults.stagger,\n seed = isometricBuildDefaults.seed,\n speed = isometricBuildDefaults.speed,\n background = isometricBuildDefaults.background,\n color = isometricBuildDefaults.color,\n accent = isometricBuildDefaults.accent,\n floors = isometricBuildDefaults.floors,\n gap = isometricBuildDefaults.gap,\n}: IsometricBuildProps) {\n const inset = Math.min(0.45, Math.max(0, gap)) / 2;\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const n = Math.max(1, Math.round(grid));\n const blocks = useMemo(\n () => makeBlocks(n, maxHeight, seed, stagger),\n [n, maxHeight, seed, stagger],\n );\n\n const tallest = maxHeight * 1.35;\n // Fit the diamond plus the tallest tower into the frame.\n const a = Math.min(\n (width * 0.64) / (2 * n),\n (height * 0.8) / (2 * n * ISO_Y + tallest * ISO_Z),\n );\n const b = a * ISO_Y;\n const hz = a * ISO_Z;\n const top = (height - (2 * n * b + tallest * hz)) / 2 + tallest * hz;\n const cx = width / 2;\n const P = (u: number, v: number, z: number) =>\n `${fmt(cx + (u - v) * a)} ${fmt(top + (u + v) * b - z * hz)}`;\n const poly = (...pts: string[]) => `M ${pts.join(\" L \")} Z`;\n\n const unit = Math.min(width, height) / 720;\n const time = frame * speed;\n\n let ground = \"\";\n for (let k = 0; k <= n; k++) {\n ground += `M ${P(k, 0, 0)} L ${P(k, n, 0)} M ${P(0, k, 0)} L ${P(n, k, 0)} `;\n }\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Isometric city build\"\n style={{ display: \"block\" }}\n >\n <path\n d={ground}\n fill=\"none\"\n stroke={color}\n strokeOpacity={0.12}\n strokeWidth={unit}\n />\n {blocks.map((block) => {\n const s = spring({\n frame: time - block.delay,\n fps,\n config: { damping: 11, stiffness: 140, mass: 0.7 },\n });\n const opacity = interpolate(s, [0, 0.15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n if (opacity <= 0) return null;\n const h = Math.max(0.02, block.height * s);\n const u0 = block.i + inset;\n const u1 = block.i + 1 - inset;\n const v0 = block.j + inset;\n const v1 = block.j + 1 - inset;\n const fill = block.accent ? accent : color;\n const left = poly(\n P(u0, v1, 0),\n P(u1, v1, 0),\n P(u1, v1, h),\n P(u0, v1, h),\n );\n const right = poly(\n P(u1, v0, 0),\n P(u1, v1, 0),\n P(u1, v1, h),\n P(u1, v0, h),\n );\n const roof = poly(\n P(u0, v0, h),\n P(u1, v0, h),\n P(u1, v1, h),\n P(u0, v1, h),\n );\n let lines = \"\";\n if (floors) {\n for (let z = FLOOR; z < h - FLOOR * 0.5; z += FLOOR) {\n lines += `M ${P(u0, v1, z)} L ${P(u1, v1, z)} L ${P(u1, v0, z)} `;\n }\n }\n return (\n <g key={`${block.i}-${block.j}`} opacity={opacity}>\n <path d={left} fill={fill} />\n <path d={left} fill={background} fillOpacity={SHADE_LEFT} />\n <path d={right} fill={fill} />\n <path d={right} fill={background} fillOpacity={SHADE_RIGHT} />\n {lines ? (\n <path\n d={lines}\n fill=\"none\"\n stroke={background}\n strokeOpacity={0.35}\n strokeWidth={unit * 1.2}\n />\n ) : null}\n <path\n d={roof}\n fill={fill}\n stroke={background}\n strokeOpacity={0.5}\n strokeWidth={unit}\n strokeLinejoin=\"round\"\n />\n </g>\n );\n })}\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n grid: {\n type: \"number\",\n default: 5,\n min: 2,\n max: 9,\n step: 1,\n description: \"Tiles per side\",\n hiddenFromList: false,\n },\n maxHeight: {\n type: \"number\",\n default: 2.2,\n min: 0.5,\n max: 4,\n step: 0.1,\n description: \"Max height\",\n hiddenFromList: false,\n },\n stagger: {\n type: \"number\",\n default: 2,\n min: 0,\n max: 6,\n step: 0.5,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n gap: {\n type: \"number\",\n default: 0.04,\n min: 0,\n max: 0.3,\n step: 0.01,\n description: \"Gap\",\n hiddenFromList: false,\n },\n floors: {\n type: \"boolean\",\n default: true,\n description: \"Floor lines\",\n },\n seed: {\n type: \"number\",\n default: 4,\n min: 1,\n max: 50,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Blocks\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent tower\",\n },\n speed: {\n 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([\"grid\",\"maxHeight\",\"stagger\",\"gap\",\"floors\",\"seed\",\"background\",\"color\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n grid: 5,\n maxHeight: 2.2,\n stagger: 2,\n gap: 0.04,\n floors: true,\n seed: 4,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype IsometricBuildElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof IsometricBuildBase>;\n\nconst IsometricBuildInner = forwardRef<\n HTMLDivElement,\n IsometricBuildElementProps & { 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 ?? \"<IsometricBuild>\"}\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 <IsometricBuildBase\n {...(componentProps as unknown as ComponentProps<typeof IsometricBuildBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const IsometricBuild = Interactive.withSchema({\n Component: IsometricBuildInner,\n componentName: \"<IsometricBuild>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 38+}diff --git a/registry-artifacts/elements/life-grid.json b/registry-artifacts/elements/life-grid.jsonnew file mode 100644index 00000000..8efa7db7--- /dev/null+++ b/registry-artifacts/elements/life-grid.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Life Grid",+ "durationInFrames": 300,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "life-grid",+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype LifeGridProps = {\n /** Columns; rows follow the frame aspect ratio. */\n cols?: number;\n /** Share of cells alive in the seeded first generation, 0 to 1. */\n density?: number;\n /** Frames each generation is held. */\n framesPerGeneration?: number;\n /** Gap between tiles, as a fraction of the cell. */\n gap?: number;\n /** Draw the faint lattice of empty cells. */\n showGrid?: boolean;\n seed?: number;\n speed?: number;\n background?: string;\n /** Living cells. */\n color?: string;\n /** Flash color for newborn cells. */\n accent?: string;\n};\n\nconst lifeGridDefaults: Required<LifeGridProps> = {\n cols: 48,\n density: 0.24,\n framesPerGeneration: 5,\n gap: 0.16,\n showGrid: true,\n seed: 7,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\nconst grow = Easing.out(Easing.back(2));\nconst shrink = Easing.in(Easing.cubic);\nconst settle = Easing.inOut(Easing.cubic);\n\n// Generations are a pure function of the seed and grid size; computed once and\n// shared across frames (and component instances) of a render.\nconst cache = new Map<string, Uint8Array[]>();\n\nfunction generations(\n cols: number,\n rows: number,\n density: number,\n seed: number,\n count: number,\n) {\n const key = `${cols}x${rows}|${density}|${seed}`;\n const known = cache.get(key);\n if (known && known.length >= count) return known;\n const list: Uint8Array[] = known ?? [];\n if (list.length === 0) {\n const first = new Uint8Array(cols * rows);\n for (let i = 0; i < first.length; i++) {\n first[i] = random(`life-grid-${seed}-${i}`) < density ? 1 : 0;\n }\n list.push(first);\n }\n while (list.length < count) {\n const prev = list[list.length - 1];\n const next = new Uint8Array(cols * rows);\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n let n = 0;\n for (let dy = -1; dy <= 1; dy++) {\n for (let dx = -1; dx <= 1; dx++) {\n if (dx === 0 && dy === 0) continue;\n // Wrap around the edges (torus) so the board never runs dry at the border.\n const xx = (x + dx + cols) % cols;\n const yy = (y + dy + rows) % rows;\n n += prev[yy * cols + xx];\n }\n }\n const alive = prev[y * cols + x] === 1;\n next[y * cols + x] = n === 3 || (alive && n === 2) ? 1 : 0;\n }\n }\n list.push(next);\n }\n if (cache.size > 16) cache.clear();\n cache.set(key, list);\n return list;\n}\n\nfunction LifeGridBase({\n cols = lifeGridDefaults.cols,\n density = lifeGridDefaults.density,\n framesPerGeneration = lifeGridDefaults.framesPerGeneration,\n gap = lifeGridDefaults.gap,\n showGrid = lifeGridDefaults.showGrid,\n seed = lifeGridDefaults.seed,\n speed = lifeGridDefaults.speed,\n background = lifeGridDefaults.background,\n color = lifeGridDefaults.color,\n accent = lifeGridDefaults.accent,\n}: LifeGridProps) {\n const frame = useCurrentFrame();\n const { width, height, durationInFrames } = useVideoConfig();\n const nx = Math.max(4, Math.round(cols));\n const ny = Math.max(4, Math.round((nx * height) / width));\n const fpg = Math.max(1, framesPerGeneration);\n const total = Math.ceil((durationInFrames * Math.max(0, speed)) / fpg) + 2;\n const gens = useMemo(\n () => generations(nx, ny, density, seed, total),\n [nx, ny, density, seed, total],\n );\n\n const cell = Math.min(width / nx, height / ny);\n const ox = (width - cell * nx) / 2;\n const oy = (height - cell * ny) / 2;\n const tile = cell * (1 - gap);\n\n const time = Math.max(0, frame * speed);\n const g = Math.min(gens.length - 1, Math.floor(time / fpg));\n const local = Math.min(1, (time - g * fpg) / fpg);\n const now = gens[g];\n const before = g > 0 ? gens[g - 1] : now;\n\n const square = (index: number, size: number) => {\n const x = ox + (index % nx) * cell + (cell - size) / 2;\n const y = oy + Math.floor(index / nx) * cell + (cell - size) / 2;\n const s = fmt(size);\n return `M ${fmt(x)} ${fmt(y)} h ${s} v ${s} h ${-s} Z `;\n };\n\n const bornSize = tile * (0.35 + 0.65 * grow(local));\n const dyingSize = tile * (1 - shrink(Math.min(1, local * 1.6)));\n let lattice = \"\";\n let alive = \"\";\n let fresh = \"\";\n // Newborns pop in as accent tiles, then a white tile grows from their\n // centre: a crisp flash with no pink cross-fade in between.\n const coreSize =\n tile * settle(Math.min(1, Math.max(0, (local - 0.35) / 0.65)));\n for (let i = 0; i < now.length; i++) {\n if (showGrid) lattice += square(i, tile);\n if (now[i]) {\n if (!before[i] && g > 0) {\n fresh += square(i, bornSize);\n if (coreSize > 0.5) alive += square(i, coreSize);\n } else {\n alive += square(i, tile);\n }\n } else if (before[i] && dyingSize > 0.5) {\n alive += square(i, dyingSize);\n }\n }\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Game of Life grid\"\n style={{ display: \"block\" }}\n >\n {showGrid ? <path d={lattice} fill={color} fillOpacity={0.05} /> : null}\n <path d={fresh} fill={accent} />\n <path d={alive} fill={color} />\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n cols: {\n type: \"number\",\n default: 48,\n min: 12,\n max: 96,\n step: 2,\n description: \"Columns\",\n hiddenFromList: false,\n },\n density: {\n type: \"number\",\n default: 0.24,\n min: 0.05,\n max: 0.6,\n step: 0.01,\n description: \"Density\",\n hiddenFromList: false,\n },\n framesPerGeneration: {\n type: \"number\",\n default: 5,\n min: 1,\n max: 15,\n step: 1,\n description: \"Frames per generation\",\n hiddenFromList: false,\n },\n gap: {\n type: \"number\",\n default: 0.16,\n min: 0,\n max: 0.4,\n step: 0.01,\n description: \"Gap\",\n hiddenFromList: false,\n },\n showGrid: {\n type: \"boolean\",\n default: true,\n description: \"Lattice\",\n },\n seed: {\n type: \"number\",\n default: 7,\n min: 1,\n max: 50,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Cells\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Newborns\",\n },\n speed: {\n 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([\"cols\",\"density\",\"framesPerGeneration\",\"gap\",\"showGrid\",\"seed\",\"background\",\"color\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n cols: 48,\n density: 0.24,\n framesPerGeneration: 5,\n gap: 0.16,\n showGrid: true,\n seed: 7,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype LifeGridElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LifeGridBase>;\n\nconst LifeGridInner = forwardRef<\n HTMLDivElement,\n LifeGridElementProps & { 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 ?? \"<LifeGrid>\"}\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 <LifeGridBase\n {...(componentProps as unknown as ComponentProps<typeof LifeGridBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LifeGrid = Interactive.withSchema({\n Component: LifeGridInner,\n componentName: \"<LifeGrid>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 300+}diff --git a/registry-artifacts/elements/line-boil.json b/registry-artifacts/elements/line-boil.jsonnew file mode 100644index 00000000..ae80c4ba--- /dev/null+++ b/registry-artifacts/elements/line-boil.json@@ -0,0 +1,21 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [+ {+ "name": "@remotion/paths",+ "version": null+ }+ ],+ "dimensions": null,+ "displayName": "Line Boil",+ "durationInFrames": 40,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "line-boil",+ "sourceCode": "import { getLength, getPointAtLength } from \"@remotion/paths\";\nimport { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype LineBoilColors = {\n line: string;\n fill: string;\n background: string;\n};\n\ntype LineBoilProps = {\n /** Closed outline as SVG path data, any coordinate space. Fitted to the frame. Defaults to a 5-point star. */\n path?: string;\n /** Frames each drawing holds before the next one (\"on threes\" by default). */\n boilEvery?: number;\n /** Distinct drawings the boil cycles through. */\n drawings?: number;\n /** Wobble strength; 1 is a gentle hand-drawn boil. */\n amplitude?: number;\n /** Base line weight in px at 720p. */\n strokeWidth?: number;\n /** Shape size as a fraction of the short frame side. */\n size?: number;\n colors?: Partial<LineBoilColors>;\n /** Outline color. Overrides `colors.line` when set. */\n line?: string;\n /** Shape fill. Overrides `colors.fill` when set. */\n fill?: string;\n /** Background. Overrides `colors.background` when set. */\n background?: string;\n speed?: number;\n};\n\nconst starPath = (() => {\n const points = Array.from({ length: 10 }, (_, i) => {\n const r = i % 2 === 0 ? 100 : 40;\n const a = (-90 + i * 36) * (Math.PI / 180);\n return `${(100 + r * Math.cos(a)).toFixed(2)} ${(100 + r * Math.sin(a)).toFixed(2)}`;\n });\n return `M ${points.join(\" L \")} Z`;\n})();\n\nconst lineBoilDefaults = {\n path: starPath,\n boilEvery: 3,\n drawings: 3,\n amplitude: 1,\n strokeWidth: 9,\n size: 0.66,\n colors: {\n line: \"#111111\",\n fill: \"#E5322D\",\n background: \"#FFFFFF\",\n } as LineBoilColors,\n speed: 1,\n};\n\nconst SAMPLES = 160;\nconst DRAW_END = 22;\nconst FILL_START = 28;\nconst FILL_END = 40;\nconst lineBoilLength = FILL_END;\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype Point = { x: number; y: number };\n\n// Low-frequency integer harmonics keep the closed loop seamless while giving\n// the slow, rubbery wobble of a re-traced cel line.\nfunction boil(points: Point[], seed: string, amp: number): Point[] {\n const harmonics = [2, 4, 9, 15].map((k, j) => ({\n k,\n weight: [1, 0.7, 0.45, 0.3][j],\n px: random(`${seed}-px-${k}`) * Math.PI * 2,\n py: random(`${seed}-py-${k}`) * Math.PI * 2,\n }));\n return points.map((p, i) => {\n const s = i / points.length;\n let dx = 0;\n let dy = 0;\n for (const h of harmonics) {\n dx += h.weight * Math.sin(Math.PI * 2 * h.k * s + h.px);\n dy += h.weight * Math.sin(Math.PI * 2 * h.k * s + h.py);\n }\n const nx = random(`${seed}-nx-${i}`) - 0.5;\n const ny = random(`${seed}-ny-${i}`) - 0.5;\n return {\n x: p.x + amp * (dx * 0.6 + nx * 0.14),\n y: p.y + amp * (dy * 0.6 + ny * 0.14),\n };\n });\n}\n\nfunction LineBoilBase({\n path = lineBoilDefaults.path,\n boilEvery = lineBoilDefaults.boilEvery,\n drawings = lineBoilDefaults.drawings,\n amplitude = lineBoilDefaults.amplitude,\n strokeWidth = lineBoilDefaults.strokeWidth,\n size = lineBoilDefaults.size,\n colors,\n line: lineColor,\n fill: fillColor,\n background: backgroundColor,\n speed = lineBoilDefaults.speed,\n}: LineBoilProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const merged = { ...lineBoilDefaults.colors, ...colors };\n const palette: LineBoilColors = {\n line: lineColor ?? merged.line,\n fill: fillColor ?? merged.fill,\n background: backgroundColor ?? merged.background,\n };\n const t = (frame / fps) * 30 * speed;\n const unit = Math.min(width, height) / 720;\n\n const base = useMemo(() => {\n const length = getLength(path);\n const raw = Array.from(\n { length: SAMPLES },\n (_, i) =>\n getPointAtLength(path, (length * i) / SAMPLES) ?? { x: 0, y: 0 },\n );\n const xs = raw.map((p) => p.x);\n const ys = raw.map((p) => p.y);\n const minX = Math.min(...xs);\n const minY = Math.min(...ys);\n const bw = Math.max(...xs) - minX;\n const bh = Math.max(...ys) - minY;\n const scale = (size * Math.min(width, height)) / Math.max(bw, bh, 1e-6);\n const ox = width / 2 - (bw * scale) / 2;\n const oy = height / 2 - (bh * scale) / 2;\n return raw.map((p) => ({\n x: ox + (p.x - minX) * scale,\n y: oy + (p.y - minY) * scale,\n }));\n }, [path, size, width, height]);\n\n const drawing =\n Math.floor(t / Math.max(1, boilEvery)) % Math.max(1, drawings);\n const amp = amplitude * 6.5 * unit;\n const line = boil(base, `line-boil-${drawing}`, amp);\n const fillShape = boil(base, `line-boil-fill-${drawing}`, amp * 1.4);\n\n const draw = interpolate(t, [0, DRAW_END], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const visible = Math.round(draw * SAMPLES);\n const fill = interpolate(t, [FILL_START, FILL_END], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.back(1.6)),\n });\n\n const cx = base.reduce((sum, p) => sum + p.x, 0) / base.length;\n const cy = base.reduce((sum, p) => sum + p.y, 0) / base.length;\n const pressurePhase = random(`line-boil-pressure-${drawing}`) * Math.PI * 2;\n\n return (\n <AbsoluteFill style={{ backgroundColor: palette.background }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Boiling hand-drawn outline\"\n >\n {fill > 0 ? (\n <polygon\n points={fillShape.map((p) => `${p.x},${p.y}`).join(\" \")}\n fill={palette.fill}\n transform={`translate(${cx} ${cy}) scale(${fill}) translate(${-cx} ${-cy})`}\n />\n ) : null}\n <g stroke={palette.line} strokeLinecap=\"round\" fill=\"none\">\n {line.slice(0, visible).map((p, i) => {\n const next = line[(i + 1) % line.length];\n const s = i / SAMPLES;\n const pressure =\n 0.75 +\n 0.25 * Math.sin(Math.PI * 2 * 3 * s + pressurePhase) +\n 0.12 * Math.sin(Math.PI * 2 * 7 * s - pressurePhase);\n // Taper the pen in and out while the line is still being drawn.\n const taper =\n draw < 1 ? Math.min(1, (visible - i) / 10, (i + 4) / 10) : 1;\n return (\n <line\n key={i}\n x1={p.x}\n y1={p.y}\n x2={next.x}\n y2={next.y}\n strokeWidth={strokeWidth * unit * pressure * taper}\n />\n );\n })}\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n boilEvery: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 8,\n step: 1,\n description: \"Boil every\",\n hiddenFromList: false,\n },\n drawings: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 8,\n step: 1,\n description: \"Drawings\",\n hiddenFromList: false,\n },\n amplitude: {\n type: \"number\",\n default: 1,\n min: 0,\n max: 3,\n step: 0.1,\n description: \"Wobble\",\n hiddenFromList: false,\n },\n strokeWidth: {\n type: \"number\",\n default: 9,\n min: 2,\n max: 24,\n step: 1,\n description: \"Line weight\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n default: 0.66,\n min: 0.2,\n max: 0.9,\n step: 0.02,\n description: \"Size\",\n hiddenFromList: false,\n },\n line: {\n type: \"color\",\n default: \"#111111\",\n description: \"Line\",\n },\n fill: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Fill\",\n },\n background: {\n type: \"color\",\n default: \"#FFFFFF\",\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([\"boilEvery\",\"drawings\",\"amplitude\",\"strokeWidth\",\"size\",\"line\",\"fill\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n boilEvery: 3,\n drawings: 3,\n amplitude: 1,\n strokeWidth: 9,\n size: 0.66,\n line: \"#111111\",\n fill: \"#E5322D\",\n background: \"#FFFFFF\",\n speed: 1,\n};\n\ntype LineBoilElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LineBoilBase>;\n\nconst LineBoilInner = forwardRef<\n HTMLDivElement,\n LineBoilElementProps & { 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 ?? \"<LineBoil>\"}\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 <LineBoilBase\n {...(componentProps as unknown as ComponentProps<typeof LineBoilBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LineBoil = Interactive.withSchema({\n Component: LineBoilInner,\n componentName: \"<LineBoil>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 40+}diff --git a/registry-artifacts/elements/liquid-fill.json b/registry-artifacts/elements/liquid-fill.jsonnew file mode 100644index 00000000..ecab5c4d--- /dev/null+++ b/registry-artifacts/elements/liquid-fill.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Liquid Fill",+ "durationInFrames": 49,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "liquid-fill",+ "sourceCode": "import React, { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, interpolateColors, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype LiquidFillProps = {\n /** Wordmark revealed beside the mark once it is full. */\n children?: React.ReactNode;\n /** Mark outline as SVG path data inside a 100x100 box. Defaults to a rounded square. */\n shape?: string;\n backgroundColor?: string;\n liquidColor?: string;\n outlineColor?: string;\n /** Bubble outline color. */\n bubbleColor?: string;\n speed?: number;\n};\n\nconst ROUNDED_SQUARE =\n \"M 27 2 H 73 A 25 25 0 0 1 98 27 V 73 A 25 25 0 0 1 73 98 H 27 A 25 25 0 0 1 2 73 V 27 A 25 25 0 0 1 27 2 Z\";\n\nconst liquidFillDefaults = {\n shape: ROUNDED_SQUARE,\n backgroundColor: \"#111111\",\n liquidColor: \"#E5322D\",\n outlineColor: \"#FFFFFF\",\n bubbleColor: \"#FFFFFF\",\n speed: 1,\n};\n\nconst LAND = 9;\nconst FULL = 34;\nconst SLIDE = 36;\nconst BUBBLES = 6;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction LiquidFillBase(props: LiquidFillProps) {\n const {\n children,\n shape,\n backgroundColor,\n liquidColor,\n outlineColor,\n bubbleColor,\n speed,\n } = { ...liquidFillDefaults, ...props };\n const uid = `liquid-fill-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const size = Math.round(Math.min(width, height) * 0.24);\n\n // Drop falls from above the mark and lands on the floor of the shape.\n const fall = interpolate(t, [0, LAND], [0, 1], {\n ...clamp,\n easing: Easing.in(Easing.quad),\n });\n const dropY = -70 + fall * 142;\n const dropStretch = 1 + 0.5 * fall;\n\n const level = interpolate(t, [LAND, FULL], [100, -12], {\n ...clamp,\n easing: Easing.bezier(0.35, 0, 0.35, 1),\n });\n const since = Math.max(0, t - LAND);\n const amp =\n t < LAND\n ? 0\n : 7 * Math.exp(-since / 10) * (1 - (t - LAND) / (FULL - LAND + 6));\n const splash = t < LAND ? 0 : 14 * Math.exp(-since / 3.5);\n const surface = (x: number) =>\n level +\n Math.max(0, amp) *\n (Math.sin(x * 0.09 + since * 0.7) +\n 0.45 * Math.sin(x * 0.17 - since * 0.95 + 1.3)) -\n splash * Math.exp(-(((x - 50) / 10) ** 2)) +\n splash * 0.35 * Math.exp(-(((x - 50) / 26) ** 2));\n const xs = Array.from({ length: 27 }, (_, i) => -4 + i * 4.3);\n const wave = xs.map((x) => `${x.toFixed(2)} ${surface(x).toFixed(2)}`);\n const liquidPath = `M ${wave.join(\" L \")} L 110 110 L -10 110 Z`;\n const meniscusPath = `M ${wave.join(\" L \")}`;\n\n const solid = interpolate(t, [FULL - 2, FULL + 3], [0, 1], clamp);\n const stroke = interpolateColors(solid, [0, 1], [outlineColor, liquidColor]);\n\n const slide = interpolate(t, [SLIDE, SLIDE + 11], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const reveal = interpolate(t, [SLIDE + 2, SLIDE + 13], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const outlineIn = interpolate(t, [0, 5], [0, 1], clamp);\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size * 0.24,\n transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 100 100\"\n style={{ flexShrink: 0, overflow: \"visible\" }}\n >\n <defs>\n <clipPath id={`${uid}-clip`}>\n <path d={shape} />\n </clipPath>\n </defs>\n {t < LAND + 1 && (\n <path\n d=\"M 0 -7 C 3 -2 5 1 5 4 A 5 5 0 0 1 -5 4 C -5 1 -3 -2 0 -7 Z\"\n fill={liquidColor}\n transform={`translate(50 ${dropY}) scale(${1.6 / Math.sqrt(dropStretch)} ${1.6 * dropStretch})`}\n opacity={interpolate(\n t,\n [0, 2, LAND, LAND + 1],\n [0, 1, 1, 0],\n clamp,\n )}\n />\n )}\n <g clipPath={`url(#${uid}-clip)`}>\n {t >= LAND && <path d={liquidPath} fill={liquidColor} />}\n {t >= LAND && solid < 1 && (\n <path\n d={meniscusPath}\n fill=\"none\"\n stroke=\"#FFFFFF\"\n strokeOpacity={0.35 * (1 - solid)}\n strokeWidth={1.4}\n />\n )}\n {Array.from({ length: BUBBLES }, (_, i) => {\n const start = LAND + 2 + random(`liquid-fill-b-${i}`) * 16;\n const age = t - start;\n if (age < 0) return null;\n const bx = 20 + random(`liquid-fill-x-${i}`) * 60;\n const by = 98 - age * (2.4 + random(`liquid-fill-v-${i}`) * 2);\n const r = 1.2 + random(`liquid-fill-r-${i}`) * 2;\n if (by < surface(bx) + r + 1) return null;\n return (\n <circle\n key={i}\n cx={bx + Math.sin(age * 0.6 + i) * 1.5}\n cy={by}\n r={r}\n fill=\"none\"\n stroke={bubbleColor}\n strokeOpacity={0.7 * (1 - solid)}\n strokeWidth={0.8}\n />\n );\n })}\n </g>\n <path\n d={shape}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={3}\n opacity={outlineIn}\n />\n </svg>\n {children && (\n <div\n style={{\n opacity: reveal,\n clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,\n transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,\n }}\n >\n {children}\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n liquidColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Liquid\",\n },\n outlineColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Outline\",\n },\n bubbleColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Bubbles\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"liquidColor\",\"outlineColor\",\"bubbleColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n liquidColor: \"#E5322D\",\n outlineColor: \"#FFFFFF\",\n bubbleColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype LiquidFillElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LiquidFillBase>;\n\nconst LiquidFillInner = forwardRef<\n HTMLDivElement,\n LiquidFillElementProps & { 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 ?? \"<LiquidFill>\"}\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 <LiquidFillBase\n {...(componentProps as unknown as ComponentProps<typeof LiquidFillBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LiquidFill = Interactive.withSchema({\n Component: LiquidFillInner,\n componentName: \"<LiquidFill>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 49+}diff --git a/registry-artifacts/elements/long-shadow.json b/registry-artifacts/elements/long-shadow.jsonnew file mode 100644index 00000000..4ee0d804--- /dev/null+++ b/registry-artifacts/elements/long-shadow.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Long Shadow",+ "durationInFrames": 48,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "long-shadow",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype LongShadowProps = {\n /** Flat icon or mark that casts the shadow. Defaults to a red check badge. */\n children?: ReactNode;\n /** Shadow direction in degrees at the start (0 = right, 90 = down). */\n angleFrom?: number;\n /** Shadow direction after the light swings. */\n angleTo?: number;\n shadowColor?: string;\n background?: string;\n /** Fade the shadow toward its far end, 0 to 1. */\n fade?: number;\n /** Colors of the default badge. */\n iconColor?: string;\n checkColor?: string;\n speed?: number;\n};\n\nconst longShadowDefaults = {\n angleFrom: 45,\n angleTo: 135,\n shadowColor: \"#ECEAE6\",\n background: \"#FFFFFF\",\n fade: 0,\n iconColor: \"#E5322D\",\n checkColor: \"#FFFFFF\",\n speed: 1,\n};\n\nconst longShadowLength = 48;\n\n// Log-doubling extrusion: each pass unions the silhouette with itself shifted by\n// twice the previous distance, so 10 passes stack 1024 copies.\nconst PASSES = 10;\nconst COPIES = 2 ** PASSES - 1;\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction Badge({\n size,\n iconColor,\n checkColor,\n}: {\n size: number;\n iconColor: string;\n checkColor: string;\n}) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 100 100\" aria-hidden>\n <circle cx={50} cy={50} r={49} fill={iconColor} />\n <path\n d=\"M 29 52 L 44 66 L 72 36\"\n fill=\"none\"\n stroke={checkColor}\n strokeWidth={11}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction LongShadowBase({\n children,\n angleFrom = longShadowDefaults.angleFrom,\n angleTo = longShadowDefaults.angleTo,\n shadowColor = longShadowDefaults.shadowColor,\n background = longShadowDefaults.background,\n fade = longShadowDefaults.fade,\n iconColor = longShadowDefaults.iconColor,\n checkColor = longShadowDefaults.checkColor,\n speed = longShadowDefaults.speed,\n}: LongShadowProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const t = (frame / fps) * 30 * speed;\n const unit = Math.min(width, height) / 720;\n\n const pop = spring({\n frame: t,\n fps: 30,\n config: { damping: 13, stiffness: 170, mass: 0.8 },\n });\n const grow = interpolate(t, [7, 22], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const swing = spring({\n frame: t - 24,\n fps: 30,\n config: { damping: 11, stiffness: 70, mass: 0.9 },\n });\n const angle = angleFrom + (angleTo - angleFrom) * swing;\n const rad = (angle * Math.PI) / 180;\n const length = Math.hypot(width, height) * grow;\n const step = length / COPIES;\n const dx = Math.cos(rad) * step;\n const dy = Math.sin(rad) * step;\n\n const content = children ?? (\n <Badge\n size={Math.min(width, height) * 0.34}\n iconColor={iconColor}\n checkColor={checkColor}\n />\n );\n const mask =\n fade > 0\n ? `linear-gradient(${angle + 90}deg, #000 50%, rgba(0,0,0,${1 - Math.min(1, fade)}) 100%)`\n : undefined;\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter\n id={`${id}-extrude`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix\n in=\"SourceAlpha\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0\"\n result=\"m0\"\n />\n {Array.from({ length: PASSES }, (_, i) => (\n <feOffset\n key={`o${i}`}\n in={`m${i}`}\n dx={dx * 2 ** i}\n dy={dy * 2 ** i}\n result={`o${i}`}\n />\n )).flatMap((offset, i) => [\n offset,\n <feMerge key={`m${i}`} result={`m${i + 1}`}>\n <feMergeNode in={`m${i}`} />\n <feMergeNode in={`o${i}`} />\n </feMerge>,\n ])}\n {/* feOffset snaps to whole pixels; a hair of blur hides the steps. */}\n <feGaussianBlur\n in={`m${PASSES}`}\n stdDeviation={0.8 * unit}\n result=\"soft\"\n />\n <feFlood floodColor={shadowColor} />\n <feComposite in2=\"soft\" operator=\"in\" />\n </filter>\n </svg>\n <AbsoluteFill\n style={{\n transform: `scale(${pop})`,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: `url(#${id}-extrude)`,\n opacity: grow > 0 ? 1 : 0,\n maskImage: mask,\n WebkitMaskImage: mask,\n }}\n >\n {content}\n </AbsoluteFill>\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n {content}\n </AbsoluteFill>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n angleFrom: {\n type: \"number\",\n default: 45,\n min: 0,\n max: 360,\n step: 5,\n description: \"Start angle\",\n hiddenFromList: false,\n },\n angleTo: {\n type: \"number\",\n default: 135,\n min: 0,\n max: 360,\n step: 5,\n description: \"End angle\",\n hiddenFromList: false,\n },\n fade: {\n type: \"number\",\n default: 0,\n min: 0,\n max: 1,\n step: 0.05,\n description: \"Fade\",\n hiddenFromList: false,\n },\n shadowColor: {\n type: \"color\",\n default: \"#ECEAE6\",\n description: \"Shadow\",\n },\n background: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Background\",\n },\n iconColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Badge\",\n },\n checkColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Check\",\n },\n speed: {\n 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([\"angleFrom\",\"angleTo\",\"fade\",\"shadowColor\",\"background\",\"iconColor\",\"checkColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n angleFrom: 45,\n angleTo: 135,\n fade: 0,\n shadowColor: \"#ECEAE6\",\n background: \"#FFFFFF\",\n iconColor: \"#E5322D\",\n checkColor: \"#FFFFFF\",\n speed: 1,\n};\n\ntype LongShadowElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LongShadowBase>;\n\nconst LongShadowInner = forwardRef<\n HTMLDivElement,\n LongShadowElementProps & { 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 ?? \"<LongShadow>\"}\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 <LongShadowBase\n {...(componentProps as unknown as ComponentProps<typeof LongShadowBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LongShadow = Interactive.withSchema({\n Component: LongShadowInner,\n componentName: \"<LongShadow>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 48+}diff --git a/registry-artifacts/elements/neon-sign.json b/registry-artifacts/elements/neon-sign.jsonnew file mode 100644index 00000000..ed0018f0--- /dev/null+++ b/registry-artifacts/elements/neon-sign.json@@ -0,0 +1,21 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [+ {+ "name": "@remotion/paths",+ "version": null+ }+ ],+ "dimensions": null,+ "displayName": "Neon Sign",+ "durationInFrames": 40,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "neon-sign",+ "sourceCode": "import { getBoundingBox, getSubpaths } from \"@remotion/paths\";\nimport { forwardRef, useId, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype NeonSignProps = {\n /** SVG path data for the tube. Each subpath (M command) flickers on its own. */\n path?: string;\n /** viewBox for the path. Defaults to the path's bounding box. */\n viewBox?: string;\n /** Tube color when lit. */\n color?: string;\n /** Color of the halo and the glow on the wall. */\n glowColor?: string;\n /** Unlit glass tube. */\n tubeColor?: string;\n /** Color of the hot core inside the tube. */\n coreColor?: string;\n backgroundColor?: string;\n /** Tube thickness in path units. */\n strokeWidth?: number;\n /** Share of the frame width the sign spans. */\n fit?: number;\n seed?: number;\n speed?: number;\n};\n\n// Handwritten \"hello\" with an underline swash, one subpath per tube.\nconst HELLO = [\n \"M 30 132 C 52 112 74 70 70 46 C 67 28 50 30 47 52 C 44 76 42 112 40 140 C 46 116 58 100 72 100 C 86 100 84 122 86 134 C 88 144 100 144 110 132\",\n \"M 110 132 C 124 124 142 110 136 98 C 130 88 112 96 112 116 C 112 138 134 146 156 130\",\n \"M 156 130 C 176 110 196 66 190 46 C 186 32 170 36 168 60 C 166 90 168 126 172 136 C 176 146 188 142 196 132\",\n \"M 196 132 C 216 110 232 66 226 46 C 222 32 206 36 204 60 C 202 90 204 126 208 136 C 212 146 224 142 232 132\",\n \"M 232 132 C 238 116 248 100 262 100 C 278 100 280 124 268 136 C 256 146 242 136 248 118 C 252 106 268 104 290 104\",\n \"M 52 170 C 120 160 210 162 296 152\",\n].join(\" \");\n\nconst neonSignDefaults = {\n path: HELLO,\n color: \"#E5322D\",\n glowColor: \"#E5322D\",\n tubeColor: \"#2A2A2A\",\n coreColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n strokeWidth: 6,\n fit: 0.62,\n seed: 7,\n speed: 1,\n};\n\nconst FIRST = 3;\nconst STEP = 3.4;\nconst STUTTER = 7;\n// Whole sign drops out once after everything is lit, then holds.\nconst BUZZ: [number, number][] = [\n [29, 0.1],\n [30, 0],\n [31, 0.55],\n [32, 0.2],\n];\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction segmentLevel(t: number, i: number, seed: number) {\n const onset = FIRST + i * STEP + random(`neon-sign-${seed}-${i}`) * 2;\n if (t < onset) return 0;\n if (t < onset + STUTTER) {\n const tick = Math.floor(t);\n const v = random(`neon-sign-${seed}-${i}-${tick}`);\n const ramp = (t - onset) / STUTTER;\n return v < 0.5 - ramp * 0.3 ? 0.04 : 0.55 + 0.45 * v;\n }\n return 1;\n}\n\nfunction NeonSignBase(props: NeonSignProps) {\n const {\n path,\n viewBox,\n color,\n glowColor,\n tubeColor,\n coreColor,\n backgroundColor,\n strokeWidth,\n fit,\n seed,\n speed,\n } = { ...neonSignDefaults, ...props };\n const uid = `neon-sign-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n\n const segments = useMemo(() => getSubpaths(path), [path]);\n const box = useMemo(() => {\n if (viewBox) {\n const [x, y, w, h] = viewBox.split(/[\\s,]+/).map(Number);\n return { x, y, w, h };\n }\n const b = getBoundingBox(path);\n const pad = strokeWidth * 6;\n return {\n x: b.x1 - pad,\n y: b.y1 - pad,\n w: b.width + pad * 2,\n h: b.height + pad * 2,\n };\n }, [path, viewBox, strokeWidth]);\n\n const tick = Math.floor(t);\n const buzz = BUZZ.find(([f]) => f === tick)?.[1] ?? 1;\n const levels = segments.map((_, i) => segmentLevel(t, i, seed) * buzz);\n const average =\n levels.reduce((a, b) => a + b, 0) / Math.max(1, levels.length);\n\n const scale = Math.min((width * fit) / box.w, (height * 0.7) / box.h);\n const drawW = box.w * scale;\n const drawH = box.h * scale;\n const settle = interpolate(t, [32, 40], [0.85, 1], clamp);\n\n return (\n <AbsoluteFill style={{ backgroundColor }}>\n <AbsoluteFill\n style={{\n background: `radial-gradient(ellipse ${drawW * 0.75}px ${drawH * 0.85}px at 50% 50%, ${glowColor} 0%, transparent 100%)`,\n opacity: 0.28 * average * settle,\n }}\n />\n <AbsoluteFill style={{ alignItems: \"center\", justifyContent: \"center\" }}>\n <svg\n width={drawW}\n height={drawH}\n viewBox={`${box.x} ${box.y} ${box.w} ${box.h}`}\n style={{ overflow: \"visible\" }}\n >\n <defs>\n <filter\n id={`${uid}-wide`}\n filterUnits=\"userSpaceOnUse\"\n x={box.x - box.w}\n y={box.y - box.h}\n width={box.w * 3}\n height={box.h * 3}\n >\n <feGaussianBlur stdDeviation={strokeWidth * 2.2} />\n </filter>\n <filter\n id={`${uid}-near`}\n filterUnits=\"userSpaceOnUse\"\n x={box.x - box.w}\n y={box.y - box.h}\n width={box.w * 3}\n height={box.h * 3}\n >\n <feGaussianBlur stdDeviation={strokeWidth * 0.6} />\n </filter>\n </defs>\n <g fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n {segments.map((d, i) => (\n <path\n key={`tube-${i}`}\n d={d}\n stroke={tubeColor}\n strokeWidth={strokeWidth}\n />\n ))}\n {segments.map((d, i) => {\n const level = levels[i];\n if (level <= 0) return null;\n return (\n <g key={`lit-${i}`}>\n <path\n d={d}\n stroke={glowColor}\n strokeWidth={strokeWidth * 3}\n opacity={0.7 * level}\n filter={`url(#${uid}-wide)`}\n />\n <path\n d={d}\n stroke={color}\n strokeWidth={strokeWidth * 1.6}\n opacity={0.9 * level}\n filter={`url(#${uid}-near)`}\n />\n <path\n d={d}\n stroke={color}\n strokeWidth={strokeWidth}\n opacity={level}\n />\n <path\n d={d}\n stroke={coreColor}\n strokeWidth={strokeWidth * 0.36}\n opacity={0.9 * level}\n />\n </g>\n );\n })}\n </g>\n </svg>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n strokeWidth: {\n type: \"number\",\n default: 6,\n min: 2,\n max: 14,\n step: 1,\n description: \"Tube width\",\n hiddenFromList: false,\n },\n fit: {\n type: \"number\",\n default: 0.62,\n min: 0.3,\n max: 0.9,\n step: 0.01,\n description: \"Fit\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 7,\n min: 1,\n max: 99,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Tube\",\n },\n glowColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Glow\",\n },\n tubeColor: {\n type: \"color\",\n default: \"#2A2A2A\",\n description: \"Unlit tube\",\n },\n coreColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Core\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"strokeWidth\",\"fit\",\"seed\",\"color\",\"glowColor\",\"tubeColor\",\"coreColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n strokeWidth: 6,\n fit: 0.62,\n seed: 7,\n color: \"#E5322D\",\n glowColor: \"#E5322D\",\n tubeColor: \"#2A2A2A\",\n coreColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype NeonSignElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof NeonSignBase>;\n\nconst NeonSignInner = forwardRef<\n HTMLDivElement,\n NeonSignElementProps & { 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 ?? \"<NeonSign>\"}\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 <NeonSignBase\n {...(componentProps as unknown as ComponentProps<typeof NeonSignBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const NeonSign = Interactive.withSchema({\n Component: NeonSignInner,\n componentName: \"<NeonSign>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 40+}diff --git a/registry-artifacts/elements/orbit-lock.json b/registry-artifacts/elements/orbit-lock.jsonnew file mode 100644index 00000000..de03868b--- /dev/null+++ b/registry-artifacts/elements/orbit-lock.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Orbit Lock",+ "durationInFrames": 50,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "orbit-lock",+ "sourceCode": "import React, { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, interpolateColors, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype OrbitLockProps = {\n /** Lockup revealed after the moons collide with the core. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Number of moons orbiting the core. */\n moons?: number;\n backgroundColor?: string;\n coreColor?: string;\n moonColor?: string;\n /** Ring flash released on impact. */\n flashColor?: string;\n /** Orbit tilt in degrees: 0 is a flat circle, 80 is nearly edge-on. */\n tilt?: number;\n speed?: number;\n};\n\nconst orbitLockDefaults = {\n moons: 3,\n backgroundColor: \"#111111\",\n coreColor: \"#E5322D\",\n moonColor: \"#FFFFFF\",\n flashColor: \"#FFFFFF\",\n tilt: 64,\n speed: 1,\n};\n\nconst IMPACT = 30;\nconst TURNS = 1.9;\nconst TRAIL = 10;\nconst TRAIL_STEP = 0.4;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype Moon = { x: number; y: number; z: number };\n\nfunction moonAt(\n t: number,\n index: number,\n count: number,\n outer: number,\n inner: number,\n tilt: number,\n): Moon {\n const p = Math.min(1, Math.max(0, t / IMPACT));\n // Orbit radius collapses late; angular speed ramps up as it tightens.\n const r = inner + (outer - inner) * (1 - Easing.in(Easing.cubic)(p));\n const theta =\n (index / count) * Math.PI * 2 +\n Math.PI * 2 * TURNS * Easing.in(Easing.quad)(p);\n const plane = (index / count) * Math.PI + Math.PI / 9;\n const lx = r * Math.cos(theta);\n const ly = r * Math.sin(theta) * Math.cos(tilt);\n return {\n x: lx * Math.cos(plane) - ly * Math.sin(plane),\n y: lx * Math.sin(plane) + ly * Math.cos(plane),\n z: r * Math.sin(theta) * Math.sin(tilt),\n };\n}\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nfunction OrbitLockBase(props: OrbitLockProps) {\n const {\n children,\n moons,\n backgroundColor,\n coreColor,\n moonColor,\n flashColor,\n tilt,\n speed,\n } = { ...orbitLockDefaults, ...props };\n const uid = `orbit-lock-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const s = Math.min(width, height);\n const cx = width / 2;\n const cy = height / 2;\n const count = Math.max(1, Math.round(moons));\n const tiltRad = (Math.min(85, Math.max(0, tilt)) * Math.PI) / 180;\n\n const core = s * 0.055;\n const outer = s * 0.36;\n const moonR = s * 0.02;\n const p = Math.min(1, t / IMPACT);\n\n const corePulse = 1 + 0.3 * p ** 4;\n const burst = interpolate(t, [IMPACT, IMPACT + 2, IMPACT + 6], [1, 1.6, 0], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const coreScale = t < IMPACT ? corePulse : corePulse * burst;\n const coreFill = interpolateColors(\n t,\n [IMPACT - 2, IMPACT + 1],\n [coreColor, flashColor],\n );\n\n const ring = interpolate(t, [IMPACT, IMPACT + 16], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const ringVisible = t >= IMPACT && ring < 1;\n const orbitOpacity = interpolate(\n t,\n [0, 6, IMPACT - 4, IMPACT],\n [0, 0.16, 0.1, 0],\n clamp,\n );\n const orbitR = core + (outer - core) * (1 - Easing.in(Easing.cubic)(p));\n\n const pop = spring({\n frame: t - IMPACT - 3,\n fps,\n config: { damping: 11, stiffness: 170, mass: 0.7 },\n });\n\n const bodies = Array.from({ length: count }, (_, i) => {\n const head = moonAt(t, i, count, outer, core, tiltRad);\n const trail = Array.from({ length: TRAIL }, (_, k) =>\n moonAt(t - (k + 1) * TRAIL_STEP, i, count, outer, core, tiltRad),\n );\n return { i, head, trail };\n });\n const showMoons = t < IMPACT && t >= 0;\n const appear = interpolate(t, [0, 5], [0, 1], clamp);\n\n const renderMoon = ({ i, head, trail }: (typeof bodies)[number]) => {\n const depth = 1 + (0.18 * head.z) / outer;\n const points = [head, ...trail];\n // Tapered ribbon through the recent positions, fading toward the tail.\n const left: string[] = [];\n const right: string[] = [];\n points.forEach((pt, k) => {\n const prev = points[Math.max(0, k - 1)];\n const next = points[Math.min(points.length - 1, k + 1)];\n const dx = prev.x - next.x;\n const dy = prev.y - next.y;\n const len = Math.hypot(dx, dy) || 1;\n const half = moonR * depth * 0.9 * (1 - k / points.length);\n const nx = (-dy / len) * half;\n const ny = (dx / len) * half;\n left.push(`${cx + pt.x + nx},${cy + pt.y + ny}`);\n right.unshift(`${cx + pt.x - nx},${cy + pt.y - ny}`);\n });\n const tail = points[points.length - 1];\n const gradId = `${uid}-trail-${i}`;\n return (\n <g key={i} opacity={appear}>\n <defs>\n <linearGradient\n id={gradId}\n gradientUnits=\"userSpaceOnUse\"\n x1={cx + head.x}\n y1={cy + head.y}\n x2={cx + tail.x}\n y2={cy + tail.y}\n >\n <stop offset=\"0\" stopColor={moonColor} stopOpacity={0.6} />\n <stop offset=\"1\" stopColor={moonColor} stopOpacity={0} />\n </linearGradient>\n </defs>\n <polygon\n points={[...left, ...right].join(\" \")}\n fill={`url(#${gradId})`}\n />\n <circle\n cx={cx + head.x}\n cy={cy + head.y}\n r={moonR * depth}\n fill={moonColor}\n />\n </g>\n );\n };\n\n return (\n <AbsoluteFill style={{ backgroundColor }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n >\n {Array.from({ length: count }, (_, i) => (\n <ellipse\n key={i}\n cx={cx}\n cy={cy}\n rx={orbitR}\n ry={orbitR * Math.cos(tiltRad)}\n transform={`rotate(${(i / count) * 180 + 20} ${cx} ${cy})`}\n fill=\"none\"\n stroke={moonColor}\n strokeOpacity={orbitOpacity}\n strokeWidth={1.5}\n />\n ))}\n {showMoons && bodies.filter((b) => b.head.z < 0).map(renderMoon)}\n {coreScale > 0 && (\n <circle\n cx={cx}\n cy={cy}\n r={core * coreScale * appear}\n fill={coreFill}\n />\n )}\n {showMoons && bodies.filter((b) => b.head.z >= 0).map(renderMoon)}\n {ringVisible && (\n <circle\n cx={cx}\n cy={cy}\n r={core + ring * s * 0.62}\n fill=\"none\"\n stroke={flashColor}\n strokeWidth={Math.max(1, s * 0.03 * (1 - ring))}\n opacity={1 - ring}\n />\n )}\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: interpolate(t, [IMPACT + 3, IMPACT + 6], [0, 1], clamp),\n transform: `scale(${0.55 + 0.45 * pop})`,\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={coreColor}\n dot={backgroundColor}\n text={moonColor}\n />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n moons: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 8,\n step: 1,\n description: \"Moons\",\n hiddenFromList: false,\n },\n tilt: {\n type: \"number\",\n default: 64,\n min: 0,\n max: 85,\n step: 1,\n description: \"Orbit tilt\",\n hiddenFromList: false,\n },\n coreColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Core\",\n },\n moonColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Moons\",\n },\n flashColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Flash\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"moons\",\"tilt\",\"coreColor\",\"moonColor\",\"flashColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n moons: 3,\n tilt: 64,\n coreColor: \"#E5322D\",\n moonColor: \"#FFFFFF\",\n flashColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype OrbitLockElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof OrbitLockBase>;\n\nconst OrbitLockInner = forwardRef<\n HTMLDivElement,\n OrbitLockElementProps & { 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 ?? \"<OrbitLock>\"}\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 <OrbitLockBase\n {...(componentProps as unknown as ComponentProps<typeof OrbitLockBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const OrbitLock = Interactive.withSchema({\n Component: OrbitLockInner,\n componentName: \"<OrbitLock>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 50+}diff --git a/registry-artifacts/elements/parallax-depth.json b/registry-artifacts/elements/parallax-depth.jsonnew file mode 100644index 00000000..bf850cb1--- /dev/null+++ b/registry-artifacts/elements/parallax-depth.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Parallax Depth",+ "durationInFrames": 60,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "parallax-depth",+ "sourceCode": "import React, { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype ParallaxDepthLayer = {\n /** Full-frame content of the layer. Leave room past the edges for the truck. */\n content: React.ReactNode;\n /** Distance from the camera. 1 is nearest; larger values move less. */\n depth: number;\n};\n\ntype ParallaxDepthColors = {\n sky: string;\n sun: string;\n far: string;\n mid: string;\n near: string;\n};\n\ntype ParallaxDepthProps = {\n /** Custom layers. Falls back to the built-in sun and hills landscape. */\n layers?: ParallaxDepthLayer[];\n /** Sideways camera travel at depth 1, as a fraction of the frame width. */\n distance?: number;\n /** Push-in toward the scene, in depth units. */\n push?: number;\n /** Truck direction: 1 moves the camera right, -1 left. */\n direction?: 1 | -1;\n colors?: Partial<ParallaxDepthColors>;\n /** Sky color. Overrides `colors.sky`. */\n skyColor?: string;\n /** Sun color. Overrides `colors.sun`. */\n sunColor?: string;\n seed?: number;\n speed?: number;\n};\n\nconst parallaxDepthDefaults = {\n distance: 0.5,\n push: 0.16,\n direction: 1 as 1 | -1,\n colors: {\n sky: \"#111111\",\n sun: \"#E5322D\",\n far: \"#2C2C2C\",\n mid: \"#555555\",\n near: \"#8E8E8E\",\n } satisfies ParallaxDepthColors,\n seed: 3,\n speed: 1,\n};\n\nconst DURATION = 60;\n\n// A ridge line built from a few seeded sine octaves, spanning three widths so it\n// never runs out while the camera trucks.\nfunction hillPath(\n width: number,\n height: number,\n base: number,\n amp: number,\n waves: number,\n seed: string,\n) {\n const octaves = [0, 1, 2].map((o) => ({\n f: (waves * (o + 1) * (0.8 + random(`${seed}-f${o}`) * 0.4)) / width,\n a: amp / (o * 1.7 + 1),\n p: random(`${seed}-p${o}`) * Math.PI * 2,\n }));\n const steps = 120;\n const x0 = -width;\n const x1 = width * 2;\n let d = `M ${x0} ${height * 2}`;\n for (let i = 0; i <= steps; i++) {\n const x = x0 + ((x1 - x0) * i) / steps;\n let y = base;\n for (const o of octaves)\n y -= o.a * (0.5 + 0.5 * Math.sin(x * o.f * 6.283 + o.p));\n d += ` L ${x.toFixed(1)} ${y.toFixed(1)}`;\n }\n return `${d} L ${x1} ${height * 2} Z`;\n}\n\nfunction useLandscape(colors: ParallaxDepthColors, seed: number) {\n const { width, height } = useVideoConfig();\n return useMemo<ParallaxDepthLayer[]>(() => {\n const svg = (children: React.ReactNode) => (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n aria-hidden\n >\n {children}\n </svg>\n );\n const hill = (\n base: number,\n amp: number,\n waves: number,\n fill: string,\n key: string,\n ) => (\n <path\n d={hillPath(\n width,\n height,\n height * base,\n height * amp,\n waves,\n `${seed}-${key}`,\n )}\n fill={fill}\n />\n );\n return [\n {\n depth: 9,\n content: svg(\n <circle\n cx={width * 0.6}\n cy={height * 0.4}\n r={height * 0.17}\n fill={colors.sun}\n />,\n ),\n },\n { depth: 6, content: svg(hill(0.6, 0.24, 2.2, colors.far, \"far\")) },\n { depth: 2.6, content: svg(hill(0.76, 0.16, 1.2, colors.mid, \"mid\")) },\n { depth: 1.2, content: svg(hill(0.92, 0.14, 0.9, colors.near, \"near\")) },\n ];\n }, [width, height, colors.sun, colors.far, colors.mid, colors.near, seed]);\n}\n\nfunction ParallaxDepthBase({\n layers,\n distance = parallaxDepthDefaults.distance,\n push = parallaxDepthDefaults.push,\n direction = parallaxDepthDefaults.direction,\n colors: colorOverrides,\n skyColor,\n sunColor,\n seed = parallaxDepthDefaults.seed,\n speed = parallaxDepthDefaults.speed,\n}: ParallaxDepthProps) {\n const frame = useCurrentFrame();\n const { width, fps } = useVideoConfig();\n const baseColors = { ...parallaxDepthDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n sky: skyColor ?? baseColors.sky,\n sun: sunColor ?? baseColors.sun,\n };\n const landscape = useLandscape(colors, seed);\n const stack = [...(layers ?? landscape)].sort((a, b) => b.depth - a.depth);\n\n const t = (frame * speed * 30) / fps;\n const move = interpolate(t, [0, DURATION], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.45, 0, 0.2, 1),\n });\n const camX = (move - 0.5) * distance * width * direction;\n const camZ = move * push;\n\n return (\n <AbsoluteFill style={{ backgroundColor: colors.sky, overflow: \"hidden\" }}>\n {stack.map((layer, i) => {\n const depth = Math.max(0.2, layer.depth);\n // Pinhole camera: scale and offset both fall off with 1 / depth.\n const scale = depth / Math.max(0.05, depth - camZ);\n const x = (-camX * scale) / depth;\n return (\n <AbsoluteFill\n key={i}\n style={{\n transform: `translateX(${x}px) scale(${scale})`,\n transformOrigin: \"50% 55%\",\n }}\n >\n {layer.content}\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n distance: {\n type: \"number\",\n default: 0.5,\n min: 0,\n max: 1.2,\n step: 0.05,\n description: \"Truck distance\",\n hiddenFromList: false,\n },\n push: {\n type: \"number\",\n default: 0.16,\n min: 0,\n max: 0.6,\n step: 0.02,\n description: \"Push-in\",\n hiddenFromList: false,\n },\n direction: {\n type: \"enum\",\n default: \"right\",\n variants: {\n right: {},\n left: {},\n },\n description: \"Direction\",\n },\n seed: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 24,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n skyColor: {\n type: \"color\",\n default: \"#111111\",\n description: \"Sky\",\n },\n sunColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Sun\",\n },\n speed: {\n 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([\"distance\",\"push\",\"direction\",\"seed\",\"skyColor\",\"sunColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n distance: 0.5,\n push: 0.16,\n direction: \"right\",\n seed: 3,\n skyColor: \"#111111\",\n sunColor: \"#E5322D\",\n speed: 1,\n};\n\ntype ParallaxDepthElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ParallaxDepthBase>;\n\nconst ParallaxDepthInner = forwardRef<\n HTMLDivElement,\n ParallaxDepthElementProps & { 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 ?? \"<ParallaxDepth>\"}\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 <ParallaxDepthBase\n {...(componentProps as unknown as ComponentProps<typeof ParallaxDepthBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ParallaxDepth = Interactive.withSchema({\n Component: ParallaxDepthInner,\n componentName: \"<ParallaxDepth>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 60+}diff --git a/registry-artifacts/elements/pendulum-wave.json b/registry-artifacts/elements/pendulum-wave.jsonnew file mode 100644index 00000000..f6829333--- /dev/null+++ b/registry-artifacts/elements/pendulum-wave.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Pendulum Wave",+ "durationInFrames": 450,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "pendulum-wave",+ "sourceCode": "import { AbsoluteFill, Interactive, Sequence, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype PendulumWaveProps = {\n /** Number of pendulums. */\n count?: number;\n /** Swings the slowest pendulum makes per loop; pendulum i makes cycles + i. */\n cycles?: number;\n /** Frames until every pendulum realigns. */\n loopFrames?: number;\n speed?: number;\n background?: string;\n /** Bobs and guides. */\n color?: string;\n /** The wave line threaded through the bobs. */\n accent?: string;\n /** Draw the faint per-pendulum tracks and centre line. */\n showGuides?: boolean;\n};\n\nconst pendulumWaveDefaults: Required<PendulumWaveProps> = {\n count: 15,\n cycles: 10,\n loopFrames: 450,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n showGuides: true,\n};\n\nconst TAU = Math.PI * 2;\nconst SMEAR_FRAMES = 4;\nconst SMEAR_SAMPLES = 6;\n\ntype Point = { x: number; y: number };\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\n// Catmull-Rom through the bobs so the wave reads as one continuous curve.\nfunction smoothPath(points: Point[]) {\n if (points.length < 2) return \"\";\n let d = `M ${fmt(points[0].x)} ${fmt(points[0].y)}`;\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[i - 1] ?? points[i];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[i + 2] ?? p2;\n const c1x = p1.x + (p2.x - p0.x) / 6;\n const c1y = p1.y + (p2.y - p0.y) / 6;\n const c2x = p2.x - (p3.x - p1.x) / 6;\n const c2y = p2.y - (p3.y - p1.y) / 6;\n d += ` C ${fmt(c1x)} ${fmt(c1y)} ${fmt(c2x)} ${fmt(c2y)} ${fmt(p2.x)} ${fmt(p2.y)}`;\n }\n return d;\n}\n\nconst circle = (x: number, y: number, r: number) =>\n `M ${fmt(x - r)} ${fmt(y)} a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(r * 2)} 0 a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(-r * 2)} 0`;\n\nfunction PendulumWaveBase({\n count = pendulumWaveDefaults.count,\n cycles = pendulumWaveDefaults.cycles,\n loopFrames = pendulumWaveDefaults.loopFrames,\n speed = pendulumWaveDefaults.speed,\n background = pendulumWaveDefaults.background,\n color = pendulumWaveDefaults.color,\n accent = pendulumWaveDefaults.accent,\n showGuides = pendulumWaveDefaults.showGuides,\n}: PendulumWaveProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const n = Math.max(2, Math.round(count));\n const loop = Math.max(1, loopFrames);\n const time = frame * speed;\n\n const marginX = width * 0.1;\n const gap = (width - marginX * 2) / (n - 1);\n const amp = height * 0.3;\n const cy = height / 2;\n const r0 = Math.min(gap * 0.3, height * 0.022);\n const unit = Math.min(width, height) / 720;\n\n // Phase of pendulum i: 2π · t · (cycles + i) / T. At t = 0 and t = T all\n // pendulums sit at the top extreme, so the loop closes on a straight line.\n const phaseAt = (i: number, t: number) => (TAU * t * (cycles + i)) / loop;\n\n const bobs = Array.from({ length: n }, (_, i) => {\n const c = Math.cos(phaseAt(i, time));\n // Fake depth: bobs swinging toward the viewer (lower) read slightly bigger.\n return { x: marginX + i * gap, y: cy - amp * c, r: r0 * (1 - 0.22 * c) };\n });\n\n let smear = \"\";\n for (let i = 0; i < n; i++) {\n const x = fmt(bobs[i].x);\n for (let s = 0; s <= SMEAR_SAMPLES; s++) {\n const t = time - (SMEAR_FRAMES * speed * s) / SMEAR_SAMPLES;\n const y = fmt(cy - amp * Math.cos(phaseAt(i, t)));\n smear += `${s === 0 ? \"M\" : \"L\"} ${x} ${y} `;\n }\n }\n\n const tracks = bobs\n .map((b) => `M ${fmt(b.x)} ${fmt(cy - amp)} V ${fmt(cy + amp)}`)\n .join(\" \");\n const ticks = bobs\n .map(\n (b) =>\n circle(b.x, cy - amp, 2.2 * unit) + circle(b.x, cy + amp, 2.2 * unit),\n )\n .join(\" \");\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Pendulum wave\"\n style={{ display: \"block\" }}\n >\n {showGuides ? (\n <g stroke={color} fill=\"none\">\n <path\n d={`M ${fmt(marginX - gap)} ${cy} H ${fmt(width - marginX + gap)}`}\n strokeOpacity={0.14}\n strokeWidth={unit}\n />\n <path\n d={tracks}\n strokeOpacity={0.08}\n strokeWidth={unit}\n strokeDasharray={`${2 * unit} ${6 * unit}`}\n />\n <path d={ticks} fill={color} fillOpacity={0.25} stroke=\"none\" />\n </g>\n ) : null}\n <path\n d={smoothPath(bobs)}\n fill=\"none\"\n stroke={accent}\n strokeWidth={2.5 * unit}\n strokeLinecap=\"round\"\n strokeOpacity={0.85}\n />\n <path\n d={smear}\n fill=\"none\"\n stroke={color}\n strokeOpacity={0.13}\n strokeWidth={r0 * 0.9}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d={bobs.map((b) => circle(b.x, b.y, b.r)).join(\" \")}\n fill={color}\n />\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n count: {\n type: \"number\",\n default: 15,\n min: 2,\n max: 40,\n step: 1,\n description: \"Pendulums\",\n hiddenFromList: false,\n },\n cycles: {\n type: \"number\",\n default: 10,\n min: 1,\n max: 30,\n step: 1,\n description: \"Swings of the slowest\",\n hiddenFromList: false,\n },\n loopFrames: {\n type: \"number\",\n default: 450,\n min: 90,\n max: 900,\n step: 30,\n description: \"Loop frames\",\n hiddenFromList: false,\n },\n showGuides: {\n type: \"boolean\",\n default: true,\n description: \"Guides\",\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Bobs\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Wave line\",\n },\n speed: {\n 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([\"count\",\"cycles\",\"loopFrames\",\"showGuides\",\"background\",\"color\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n count: 15,\n cycles: 10,\n loopFrames: 450,\n showGuides: true,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype PendulumWaveElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PendulumWaveBase>;\n\nconst PendulumWaveInner = forwardRef<\n HTMLDivElement,\n PendulumWaveElementProps & { 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 ?? \"<PendulumWave>\"}\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 <PendulumWaveBase\n {...(componentProps as unknown as ComponentProps<typeof PendulumWaveBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PendulumWave = Interactive.withSchema({\n Component: PendulumWaveInner,\n componentName: \"<PendulumWave>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 450+}diff --git a/registry-artifacts/elements/phyllotaxis.json b/registry-artifacts/elements/phyllotaxis.jsonnew file mode 100644index 00000000..b92621e9--- /dev/null+++ b/registry-artifacts/elements/phyllotaxis.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Phyllotaxis",+ "durationInFrames": 74,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "phyllotaxis",+ "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 PhyllotaxisProps = {\n /** Number of seeds. */\n count?: number;\n /** Seed size multiplier. */\n size?: number;\n /** Frames for all seeds to spiral out. */\n growFrames?: number;\n /** Frames per pulse along the accent arm once grown. */\n pulseFrames?: number;\n /** Arm spacing: every n-th seed forms one parastichy (a Fibonacci number reads best). */\n arm?: number;\n /** Slow rotation of the head in degrees per second; 0 holds still. */\n rotation?: number;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nconst phyllotaxisDefaults: Required<PhyllotaxisProps> = {\n count: 420,\n size: 1,\n growFrames: 60,\n pulseFrames: 45,\n arm: 21,\n rotation: 4,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst GOLDEN = (137.508 * Math.PI) / 180;\nconst POP = 10;\nconst pop = Easing.out(Easing.back(2.2));\nconst clamp = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst fmt = (n: number) => Math.round(n * 10) / 10;\nconst dot = (x: number, y: number, r: number) =>\n `M ${fmt(x - r)} ${fmt(y)} a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(r * 2)} 0 a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(-r * 2)} 0 `;\n\nfunction PhyllotaxisBase({\n count = phyllotaxisDefaults.count,\n size = phyllotaxisDefaults.size,\n growFrames = phyllotaxisDefaults.growFrames,\n pulseFrames = phyllotaxisDefaults.pulseFrames,\n arm = phyllotaxisDefaults.arm,\n rotation = phyllotaxisDefaults.rotation,\n speed = phyllotaxisDefaults.speed,\n background = phyllotaxisDefaults.background,\n color = phyllotaxisDefaults.color,\n accent = phyllotaxisDefaults.accent,\n}: PhyllotaxisProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const n = Math.max(1, Math.round(count));\n const step = Math.max(1, Math.round(arm));\n const time = frame * speed;\n const cx = width / 2;\n const cy = height / 2;\n const maxR = Math.min(width, height) * 0.44;\n const c = maxR / Math.sqrt(n);\n const spin = (rotation * Math.PI * time) / 180 / fps;\n\n // Seeds appear in order with a little overshoot; the reveal eases so the\n // dense centre does not flash in all at once.\n const grown = (i: number) => {\n const at = growFrames * Math.sqrt(i / n);\n return pop(Math.min(1, Math.max(0, (time - at) / POP)));\n };\n const armIn = interpolate(time, [growFrames, growFrames + 14], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const since = time - growFrames - 10;\n const pulse = since > 0 ? (since / Math.max(1, pulseFrames)) % 1 : -1;\n\n let plain = \"\";\n let red = \"\";\n let spine = \"\";\n for (let i = 1; i <= n; i++) {\n const s = grown(i);\n if (s <= 0) continue;\n const radius = c * Math.sqrt(i);\n const theta = i * GOLDEN + spin;\n const x = cx + Math.cos(theta) * radius;\n const y = cy + Math.sin(theta) * radius;\n // Outer seeds are a touch larger, like a sunflower head.\n const base = c * 0.42 * size * (0.55 + 0.45 * Math.sqrt(i / n));\n const onArm = i % step === 0 && armIn > 0;\n if (!onArm) {\n plain += dot(x, y, base * s);\n continue;\n }\n // Pulse travels outward along the arm as a soft gaussian bump.\n const u = Math.sqrt(i / n);\n const bump =\n pulse >= 0 ? Math.exp(-(((u - pulse * 1.4 + 0.2) / 0.09) ** 2)) : 0;\n red += dot(x, y, base * s * (1 + 0.25 * armIn + bump * 0.9));\n spine += `${spine ? \"L\" : \"M\"} ${fmt(x)} ${fmt(y)} `;\n }\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"PhyllotaxisBase spiral\"\n style={{ display: \"block\" }}\n >\n <path d={plain} fill={color} />\n {spine ? (\n <path\n d={spine}\n fill=\"none\"\n stroke={accent}\n strokeOpacity={0.35 * armIn}\n strokeWidth={Math.min(width, height) / 720}\n />\n ) : null}\n <path d={red} fill={color} fillOpacity={1 - armIn} />\n <path d={red} fill={accent} fillOpacity={armIn} />\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n count: {\n type: \"number\",\n default: 420,\n min: 50,\n max: 1200,\n step: 10,\n description: \"Seeds\",\n hiddenFromList: false,\n },\n size: {\n type: \"number\",\n default: 1,\n min: 0.3,\n max: 2,\n step: 0.05,\n description: \"Seed size\",\n hiddenFromList: false,\n },\n arm: {\n type: \"number\",\n default: 21,\n min: 1,\n max: 89,\n step: 1,\n description: \"Arm spacing\",\n hiddenFromList: false,\n },\n growFrames: {\n type: \"number\",\n default: 60,\n min: 15,\n max: 150,\n step: 5,\n description: \"Grow frames\",\n hiddenFromList: false,\n },\n pulseFrames: {\n type: \"number\",\n default: 45,\n min: 15,\n max: 120,\n step: 5,\n description: \"Pulse frames\",\n hiddenFromList: false,\n },\n rotation: {\n type: \"number\",\n default: 4,\n min: -30,\n max: 30,\n step: 1,\n description: \"Rotation °/s\",\n hiddenFromList: false,\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Seeds\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Arm\",\n },\n speed: {\n 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([\"count\",\"size\",\"arm\",\"growFrames\",\"pulseFrames\",\"rotation\",\"background\",\"color\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n count: 420,\n size: 1,\n arm: 21,\n growFrames: 60,\n pulseFrames: 45,\n rotation: 4,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype PhyllotaxisElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PhyllotaxisBase>;\n\nconst PhyllotaxisInner = forwardRef<\n HTMLDivElement,\n PhyllotaxisElementProps & { 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 ?? \"<Phyllotaxis>\"}\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 <PhyllotaxisBase\n {...(componentProps as unknown as ComponentProps<typeof PhyllotaxisBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Phyllotaxis = Interactive.withSchema({\n Component: PhyllotaxisInner,\n componentName: \"<Phyllotaxis>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 74+}diff --git a/registry-artifacts/elements/puzzle-snap.json b/registry-artifacts/elements/puzzle-snap.jsonnew file mode 100644index 00000000..29dba31d--- /dev/null+++ b/registry-artifacts/elements/puzzle-snap.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Puzzle Snap",+ "durationInFrames": 38,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "puzzle-snap",+ "sourceCode": "import { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype PuzzleSnapProps = {\n /** Wordmark revealed beside the assembled mark. */\n children?: React.ReactNode;\n backgroundColor?: string;\n /** Fill of the quarter circle and the small square. */\n primaryColor?: string;\n /** Fill of the dot and the wedge. */\n secondaryColor?: string;\n /** Spark burst color. */\n sparkColor?: string;\n /** Include the small square piece. */\n square?: boolean;\n /** Seed for the scattered start positions. */\n seed?: number;\n speed?: number;\n};\n\nconst puzzleSnapDefaults = {\n backgroundColor: \"#111111\",\n primaryColor: \"#E5322D\",\n secondaryColor: \"#FFFFFF\",\n sparkColor: \"#FFFFFF\",\n square: true,\n seed: 3,\n speed: 1,\n};\n\nconst STAGGER = 3;\nconst DRIFT = 10;\nconst SNAP = 3;\nconst SPARK = 8;\nconst SLIDE = 11;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype Piece = {\n key: string;\n /** Pivot / contact point in mark units (0..2). */\n px: number;\n py: number;\n render: (c: number) => React.ReactNode;\n};\n\nfunction PuzzleSnapBase(props: PuzzleSnapProps) {\n const {\n children,\n backgroundColor,\n primaryColor,\n secondaryColor,\n sparkColor,\n square,\n seed,\n speed,\n } = { ...puzzleSnapDefaults, ...props };\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const s = Math.min(width, height);\n const size = Math.round(s * 0.2);\n const c = size / 2;\n const gap = c * 0.08;\n\n const pieces: Piece[] = [\n {\n key: \"quarter\",\n px: 0.6,\n py: 0.6,\n render: (u) => (\n <path\n d={`M ${u - gap} ${u - gap} L 0 ${u - gap} A ${u - gap} ${u - gap} 0 0 1 ${u - gap} 0 Z`}\n fill={primaryColor}\n />\n ),\n },\n {\n key: \"dot\",\n px: 1.5,\n py: 0.5,\n render: (u) => (\n <circle cx={u * 1.5} cy={u * 0.5} r={u * 0.36} fill={secondaryColor} />\n ),\n },\n {\n key: \"wedge\",\n px: 0.65,\n py: 1.35,\n render: (u) => (\n <path\n d={`M ${u - gap} ${u + gap} L ${u - gap} ${2 * u} L 0 ${2 * u} Z`}\n fill={secondaryColor}\n />\n ),\n },\n ...(square\n ? [\n {\n key: \"square\",\n px: 1.5,\n py: 1.5,\n render: (u: number) => (\n <rect\n x={u * 1.18}\n y={u * 1.18}\n width={u * 0.64}\n height={u * 0.64}\n rx={u * 0.08}\n fill={primaryColor}\n />\n ),\n },\n ]\n : []),\n ];\n const lastContact = (pieces.length - 1) * STAGGER + DRIFT + SNAP;\n\n const punch = spring({\n frame: t - lastContact,\n fps,\n config: { damping: 9, stiffness: 260, mass: 0.5 },\n });\n const markScale = t < lastContact ? 1 : 1 + 0.08 * (1 - punch);\n const slide = interpolate(\n t,\n [lastContact + 2, lastContact + 2 + SLIDE],\n [0, 1],\n {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n },\n );\n const reveal = interpolate(\n t,\n [lastContact + 4, lastContact + 4 + SLIDE],\n [0, 1],\n { ...clamp, easing: Easing.out(Easing.cubic) },\n );\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size * 0.24,\n // Shift the row so the mark sits dead center until it slides over.\n transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n style={{\n flexShrink: 0,\n overflow: \"visible\",\n transform: `scale(${markScale})`,\n }}\n >\n {pieces.map((piece, i) => {\n const local = t - i * STAGGER;\n const angle = random(`puzzle-snap-${seed}-${i}-a`) * Math.PI * 2;\n const dist =\n s * (0.42 + 0.22 * random(`puzzle-snap-${seed}-${i}-d`));\n const spin =\n (random(`puzzle-snap-${seed}-${i}-r`) > 0.5 ? 1 : -1) *\n (120 + 160 * random(`puzzle-snap-${seed}-${i}-s`));\n // Drift most of the way in, then get yanked onto the slot.\n const remain =\n local < DRIFT\n ? interpolate(local, [0, DRIFT], [1, 0.2], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n })\n : interpolate(local, [DRIFT, DRIFT + SNAP], [0.2, 0], {\n ...clamp,\n easing: Easing.in(Easing.quad),\n });\n const ox = Math.cos(angle) * dist * remain;\n const oy = Math.sin(angle) * dist * remain;\n const pivotX = piece.px * c;\n const pivotY = piece.py * c;\n const opacity = interpolate(local, [0, 3], [0, 1], clamp);\n const sparkT = (local - DRIFT - SNAP) / SPARK;\n return (\n <g key={piece.key}>\n <g\n opacity={opacity}\n transform={`translate(${ox} ${oy}) rotate(${spin * remain} ${pivotX} ${pivotY})`}\n >\n {piece.render(c)}\n </g>\n {sparkT >= 0 &&\n sparkT < 1 &&\n Array.from({ length: 6 }, (_, k) => {\n const a =\n (k / 6) * Math.PI * 2 +\n random(`puzzle-snap-${seed}-${i}-spark`) * Math.PI;\n const e = Easing.out(Easing.cubic)(sparkT);\n const r0 = c * (0.45 + 0.4 * e);\n const r1 = r0 + c * 0.28 * (1 - 0.5 * e);\n return (\n <line\n key={k}\n x1={pivotX + Math.cos(a) * r0}\n y1={pivotY + Math.sin(a) * r0}\n x2={pivotX + Math.cos(a) * r1}\n y2={pivotY + Math.sin(a) * r1}\n stroke={sparkColor}\n strokeWidth={Math.max(1, c * 0.05 * (1 - sparkT))}\n strokeLinecap=\"round\"\n opacity={1 - sparkT}\n />\n );\n })}\n </g>\n );\n })}\n </svg>\n {children && (\n <div\n style={{\n opacity: reveal,\n clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,\n transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,\n }}\n >\n {children}\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n square: {\n type: \"boolean\",\n default: true,\n description: \"Square piece\",\n },\n seed: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 99,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n primaryColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Primary\",\n },\n secondaryColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Secondary\",\n },\n sparkColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Sparks\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"square\",\"seed\",\"primaryColor\",\"secondaryColor\",\"sparkColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n square: true,\n seed: 3,\n primaryColor: \"#E5322D\",\n secondaryColor: \"#FFFFFF\",\n sparkColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype PuzzleSnapElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof PuzzleSnapBase>;\n\nconst PuzzleSnapInner = forwardRef<\n HTMLDivElement,\n PuzzleSnapElementProps & { 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 ?? \"<PuzzleSnap>\"}\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 <PuzzleSnapBase\n {...(componentProps as unknown as ComponentProps<typeof PuzzleSnapBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const PuzzleSnap = Interactive.withSchema({\n Component: PuzzleSnapInner,\n componentName: \"<PuzzleSnap>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 38+}diff --git a/registry-artifacts/elements/riso-print.json b/registry-artifacts/elements/riso-print.jsonnew file mode 100644index 00000000..5c17e55d--- /dev/null+++ b/registry-artifacts/elements/riso-print.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Riso Print",+ "durationInFrames": 34,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "riso-print",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype RisoPrintProps = {\n /** Subject printed in both inks. Dark tones go to the key plate, warm tones to the accent plate. */\n children?: ReactNode;\n /** [key ink, accent ink]. */\n inks?: [string, string];\n /** Key ink. Overrides `inks[0]` when set. */\n keyInk?: string;\n /** Accent ink. Overrides `inks[1]` when set. */\n accentInk?: string;\n paper?: string;\n /** Final misregistration of the accent plate, in px at 720p. */\n offset?: [number, number];\n /** Ink speckle and paper tooth, 0 to 1. */\n grain?: number;\n /** Stop-motion wobble of the accent plate after it settles, in px at 720p. 0 disables. */\n jitter?: number;\n /** Print registration marks in the corners. */\n marks?: boolean;\n speed?: number;\n};\n\nconst risoPrintDefaults = {\n inks: [\"#111111\", \"#E5322D\"] as [string, string],\n paper: \"#F2F0EA\",\n offset: [7, -5] as [number, number],\n grain: 0.5,\n jitter: 1.2,\n marks: true,\n speed: 1,\n};\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// Coverage = A - channel: the key plate takes everything without red (blacks,\n// blues), the accent plate everything without green (reds, blacks). Black\n// therefore prints in both plates, like a rich black on a real riso.\nconst plateMatrix = (channel: 0 | 1) => {\n const k = 1.4;\n const r = channel === 0 ? -k : 0;\n const g = channel === 1 ? -k : 0;\n return `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${r} ${g} 0 ${k} -0.2`;\n};\n\nfunction PosterPlate({\n plate,\n width,\n height,\n}: {\n plate: 0 | 1;\n width: number;\n height: number;\n}) {\n const s = Math.min(width, height);\n const cx = width / 2;\n const cy = height / 2;\n return (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n role=\"img\"\n aria-label=\"Geometric poster\"\n >\n {plate === 0 ? (\n <g fill=\"#000\">\n <rect\n x={cx - 0.42 * s}\n y={cy - 0.1 * s}\n width={0.36 * s}\n height={0.36 * s}\n />\n {[0, 1, 2].map((i) => (\n <rect\n key={i}\n x={cx + 0.2 * s}\n y={cy + 0.2 * s + i * 0.045 * s}\n width={(0.3 - i * 0.07) * s}\n height={0.018 * s}\n />\n ))}\n </g>\n ) : (\n <g fill=\"#000\">\n <circle cx={cx + 0.08 * s} cy={cy - 0.04 * s} r={0.26 * s} />\n <rect\n x={cx - 0.46 * s}\n y={cy - 0.34 * s}\n width={0.07 * s}\n height={0.07 * s}\n />\n </g>\n )}\n </svg>\n );\n}\n\nfunction Marks({ width, height }: { width: number; height: number }) {\n const s = Math.min(width, height);\n const m = 0.06 * s;\n const r = 0.018 * s;\n const points = [\n [m, m],\n [width - m, m],\n [m, height - m],\n [width - m, height - m],\n ];\n return (\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0 }}\n role=\"img\"\n aria-label=\"Registration marks\"\n >\n {points.map(([x, y]) => (\n <g key={`${x}-${y}`} stroke=\"#000\" strokeWidth={0.0035 * s} fill=\"none\">\n <circle cx={x} cy={y} r={r} />\n <line x1={x - r * 1.7} y1={y} x2={x + r * 1.7} y2={y} />\n <line x1={x} y1={y - r * 1.7} x2={x} y2={y + r * 1.7} />\n </g>\n ))}\n </svg>\n );\n}\n\nfunction RisoPrintBase({\n children,\n inks: inksProp = risoPrintDefaults.inks,\n keyInk,\n accentInk,\n paper = risoPrintDefaults.paper,\n offset = risoPrintDefaults.offset,\n grain = risoPrintDefaults.grain,\n jitter = risoPrintDefaults.jitter,\n marks = risoPrintDefaults.marks,\n speed = risoPrintDefaults.speed,\n}: RisoPrintProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const inks: [string, string] = [\n keyInk ?? inksProp[0],\n accentInk ?? inksProp[1],\n ];\n const unit = Math.min(width, height) / 720;\n const t = (frame / fps) * 30 * speed;\n const g = Math.max(0, Math.min(1, grain));\n\n // Key plate: the ink hits the paper.\n const press = interpolate(t, [0, 8], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n\n // Accent plate: slides in off-register, wobbles, settles a hair off.\n const slide = spring({\n frame: t - 4,\n fps: 30,\n config: { damping: 9, stiffness: 120, mass: 0.8 },\n });\n const step = Math.floor(t / 4);\n const jitterIn = interpolate(t, [26, 34], [0, 1], clamp);\n const jx = (random(`riso-jx-${step}`) - 0.5) * 2 * jitter * unit * jitterIn;\n const jy = (random(`riso-jy-${step}`) - 0.5) * 2 * jitter * unit * jitterIn;\n const ax = interpolate(slide, [0, 1], [-0.22 * width, offset[0] * unit]) + jx;\n const ay = interpolate(slide, [0, 1], [0.08 * height, offset[1] * unit]) + jy;\n const arot = interpolate(slide, [0, 1], [-4, 0.35]);\n const aopacity = interpolate(t, [4, 8], [0, 1], clamp);\n\n const speckle = `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${-5 * g} 0 0 0 ${1 + 5 * g * 0.56}`;\n const plates = [\n {\n ink: inks[0],\n transform: `scale(${interpolate(press, [0, 1], [1.035, 1])})`,\n opacity: press * 0.94,\n },\n {\n ink: inks[1],\n transform: `translate(${ax}px, ${ay}px) rotate(${arot}deg)`,\n opacity: aopacity * 0.9,\n },\n ];\n\n return (\n <AbsoluteFill style={{ backgroundColor: paper, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n {plates.map((plate, i) => (\n <filter\n key={plate.ink + i}\n id={`${id}-plate-${i}`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix\n in=\"SourceGraphic\"\n type=\"matrix\"\n values={plateMatrix(i as 0 | 1)}\n result=\"coverage\"\n />\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={0.9 / unit}\n numOctaves={2}\n seed={7 + i * 13}\n result=\"noise\"\n />\n <feColorMatrix\n in=\"noise\"\n type=\"matrix\"\n values={speckle}\n result=\"mask\"\n />\n <feComposite\n in=\"coverage\"\n in2=\"mask\"\n operator=\"in\"\n result=\"inked\"\n />\n <feFlood floodColor={plate.ink} result=\"ink\" />\n <feComposite in=\"ink\" in2=\"inked\" operator=\"in\" />\n </filter>\n ))}\n <filter\n id={`${id}-paper`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={0.65 / unit}\n numOctaves={3}\n seed={3}\n />\n <feColorMatrix\n type=\"matrix\"\n values={`0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0 0.12 ${0.5 * g} 0 0 0 ${-0.18 * g}`}\n />\n </filter>\n </defs>\n </svg>\n {plates.map((plate, i) => (\n <AbsoluteFill\n key={plate.ink + i}\n style={{\n filter: `url(#${id}-plate-${i})`,\n mixBlendMode: \"multiply\",\n opacity: plate.opacity,\n transform: plate.transform,\n }}\n >\n {children ? (\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n {children}\n </AbsoluteFill>\n ) : (\n <PosterPlate plate={i as 0 | 1} width={width} height={height} />\n )}\n {marks ? <Marks width={width} height={height} /> : null}\n </AbsoluteFill>\n ))}\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0, mixBlendMode: \"multiply\" }}\n aria-hidden\n >\n <rect\n width={width}\n height={height}\n fill=\"#fff\"\n filter={`url(#${id}-paper)`}\n />\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n keyInk: {\n type: \"color\",\n default: \"#111111\",\n description: \"Key ink\",\n },\n accentInk: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent ink\",\n },\n paper: {\n type: \"color\",\n default: \"#F2F0EA\",\n description: \"Paper\",\n },\n grain: {\n type: \"number\",\n default: 0.5,\n min: 0,\n max: 1,\n step: 0.05,\n description: \"Grain\",\n hiddenFromList: false,\n },\n jitter: {\n type: \"number\",\n default: 1.2,\n min: 0,\n max: 6,\n step: 0.1,\n description: \"Jitter\",\n hiddenFromList: false,\n },\n marks: {\n type: \"boolean\",\n default: true,\n description: \"Registration marks\",\n },\n speed: {\n 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([\"keyInk\",\"accentInk\",\"paper\",\"grain\",\"jitter\",\"marks\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n keyInk: \"#111111\",\n accentInk: \"#E5322D\",\n paper: \"#F2F0EA\",\n grain: 0.5,\n jitter: 1.2,\n marks: true,\n speed: 1,\n};\n\ntype RisoPrintElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RisoPrintBase>;\n\nconst RisoPrintInner = forwardRef<\n HTMLDivElement,\n RisoPrintElementProps & { 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 ?? \"<RisoPrint>\"}\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 <RisoPrintBase\n {...(componentProps as unknown as ComponentProps<typeof RisoPrintBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RisoPrint = Interactive.withSchema({\n Component: RisoPrintInner,\n componentName: \"<RisoPrint>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 34+}diff --git a/registry-artifacts/elements/spotlight.json b/registry-artifacts/elements/spotlight.jsonnew file mode 100644index 00000000..43e616bb--- /dev/null+++ b/registry-artifacts/elements/spotlight.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Spotlight",+ "durationInFrames": 50,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "spotlight",+ "sourceCode": "import React, { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, spring, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype SpotlightProps = {\n /** Lockup the beam lands on. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Color of the light cone and floor pool. */\n beamColor?: string;\n /** Dark stage behind everything. */\n stageColor?: string;\n /** Brightness of the unlit lockup, 0 to 1. */\n dim?: number;\n speed?: number;\n};\n\nconst spotlightDefaults = {\n beamColor: \"#FFFFFF\",\n stageColor: \"#111111\",\n dim: 0.16,\n speed: 1,\n};\n\nconst SEARCH = 12;\nconst SWING = 26;\nconst HOUSE = 38;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nfunction SpotlightBase(props: SpotlightProps) {\n const { children, beamColor, stageColor, dim, speed } = {\n ...spotlightDefaults,\n ...props,\n };\n const uid = `spotlight-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n\n // Beam target, as a fraction of the width: search left, overshoot right, land.\n let target: number;\n if (t < SEARCH) {\n target = interpolate(t, [0, SEARCH], [0.14, 0.27], {\n ...clamp,\n easing: Easing.inOut(Easing.sin),\n });\n } else if (t < SWING) {\n target = interpolate(t, [SEARCH, SWING], [0.27, 0.74], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n } else {\n const land = spring({\n frame: t - SWING,\n fps,\n config: { damping: 11, stiffness: 120, mass: 0.8 },\n });\n target = 0.74 + (0.5 - 0.74) * land;\n }\n\n const tx = target * width;\n const apexX = width / 2;\n const apexY = -height * 0.12;\n const floorY = height * 0.8;\n const spread = width * 0.27;\n const apexHalf = width * 0.012;\n\n const beamOn = interpolate(t, [0, 5], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n const house = interpolate(t, [HOUSE, HOUSE + 12], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.sin),\n });\n const coverage = Math.max(0, 1 - Math.abs(target - 0.5) / 0.3);\n const lit = Math.max(\n dim,\n dim + (1 - dim) * Easing.inOut(Easing.quad)(coverage) * beamOn,\n );\n const brightness =\n t >= SWING + 10 ? Math.max(lit, Math.min(1, lit + house)) : lit;\n const blur = width * 0.012;\n\n return (\n <AbsoluteFill style={{ backgroundColor: stageColor }}>\n <AbsoluteFill\n style={{\n background: `radial-gradient(ellipse 80% 70% at 50% 40%, ${beamColor} 0%, transparent 70%)`,\n opacity: 0.09 * house,\n }}\n />\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <defs>\n <linearGradient\n id={`${uid}-beam`}\n gradientUnits=\"userSpaceOnUse\"\n x1={0}\n y1={apexY}\n x2={0}\n y2={floorY}\n >\n <stop offset=\"0\" stopColor={beamColor} stopOpacity={0.55} />\n <stop offset=\"0.6\" stopColor={beamColor} stopOpacity={0.2} />\n <stop offset=\"1\" stopColor={beamColor} stopOpacity={0.12} />\n </linearGradient>\n <radialGradient id={`${uid}-pool`}>\n <stop offset=\"0\" stopColor={beamColor} stopOpacity={0.45} />\n <stop offset=\"0.6\" stopColor={beamColor} stopOpacity={0.14} />\n <stop offset=\"1\" stopColor={beamColor} stopOpacity={0} />\n </radialGradient>\n <filter\n id={`${uid}-soft`}\n x={-width}\n y={-height}\n width={width * 3}\n height={height * 3}\n filterUnits=\"userSpaceOnUse\"\n >\n <feGaussianBlur stdDeviation={blur} />\n </filter>\n </defs>\n <g opacity={beamOn * (1 - 0.35 * house)}>\n <ellipse\n cx={tx}\n cy={floorY}\n rx={spread * 1.25}\n ry={height * 0.07}\n fill={`url(#${uid}-pool)`}\n />\n <polygon\n points={`${apexX - apexHalf},${apexY} ${apexX + apexHalf},${apexY} ${tx + spread},${floorY} ${tx - spread},${floorY}`}\n fill={`url(#${uid}-beam)`}\n filter={`url(#${uid}-soft)`}\n />\n </g>\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: `brightness(${brightness})`,\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={beamColor}\n dot={stageColor}\n text={beamColor}\n />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n dim: {\n type: \"number\",\n default: 0.16,\n min: 0,\n max: 0.6,\n step: 0.01,\n description: \"Unlit brightness\",\n hiddenFromList: false,\n },\n beamColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Beam\",\n },\n stageColor: {\n type: \"color\",\n default: \"#111111\",\n description: \"Stage\",\n },\n speed: {\n 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([\"dim\",\"beamColor\",\"stageColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n dim: 0.16,\n beamColor: \"#FFFFFF\",\n stageColor: \"#111111\",\n speed: 1,\n};\n\ntype SpotlightElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SpotlightBase>;\n\nconst SpotlightInner = forwardRef<\n HTMLDivElement,\n SpotlightElementProps & { 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 ?? \"<Spotlight>\"}\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 <SpotlightBase\n {...(componentProps as unknown as ComponentProps<typeof SpotlightBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Spotlight = Interactive.withSchema({\n Component: SpotlightInner,\n componentName: \"<Spotlight>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 50+}diff --git a/registry-artifacts/elements/string-art.json b/registry-artifacts/elements/string-art.jsonnew file mode 100644index 00000000..99006bfc--- /dev/null+++ b/registry-artifacts/elements/string-art.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "String Art",+ "durationInFrames": 288,+ "initialProps": null,+ "installationMode": "wrapped",+ "slug": "string-art",+ "sourceCode": "import { AbsoluteFill, Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport type StringArtProps = {\n /** Pins around the ring. */\n pins?: number;\n /** Multiplier at the start (2 draws a cardioid). */\n from?: number;\n /** Multiplier at the end (3 is a nephroid, 4 a three-cusp epicycloid). */\n to?: number;\n /** Frames for the threads to be strung, one pin after another. */\n stringFrames?: number;\n /** Frames for the multiplier to drift from `from` to `to`. */\n morphFrames?: number;\n /** Length of the accent sweep, as a share of all threads; 0 disables. */\n sweep?: number;\n /** Pins per frame the accent sweep travels once the threads are strung. */\n sweepSpeed?: number;\n /** Thread opacity, 0 to 1. */\n threadOpacity?: number;\n /** Show the running multiplier in the corner. */\n showLabel?: boolean;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nexport const stringArtDefaults: Required<StringArtProps> = {\n pins: 200,\n from: 2,\n to: 4,\n stringFrames: 60,\n morphFrames: 240,\n sweep: 0.08,\n sweepSpeed: 0.9,\n threadOpacity: 0.42,\n showLabel: true,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst TAU = Math.PI * 2;\nconst MORPH_DELAY = 24;\n// Share of each integer step spent holding on the clean integer figure.\nconst HOLD = 0.3;\nconst SWEEP_BUCKETS = 4;\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\nexport function StringArt({\n pins = stringArtDefaults.pins,\n from = stringArtDefaults.from,\n to = stringArtDefaults.to,\n stringFrames: stringFramesProp = stringArtDefaults.stringFrames,\n morphFrames: morphFramesProp = stringArtDefaults.morphFrames,\n sweep = stringArtDefaults.sweep,\n sweepSpeed = stringArtDefaults.sweepSpeed,\n threadOpacity = stringArtDefaults.threadOpacity,\n showLabel = stringArtDefaults.showLabel,\n speed = stringArtDefaults.speed,\n background = stringArtDefaults.background,\n color = stringArtDefaults.color,\n accent = stringArtDefaults.accent,\n}: StringArtProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const n = Math.max(8, Math.round(pins));\n const unit = Math.min(width, height) / 720;\n const radius = Math.min(width, height) * 0.42;\n const cx = width / 2;\n const cy = height / 2;\n const time = frame * speed;\n // interpolate() needs a strictly increasing range.\n const stringFrames = Math.max(1, stringFramesProp);\n const morphFrames = Math.max(1, morphFramesProp);\n\n const strung = interpolate(time, [0, stringFrames], [0, n], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const morphStart = stringFrames + MORPH_DELAY;\n // The multiplier walks through each integer table (cardioid, nephroid, ...)\n // with an eased step and a short hold on every clean figure.\n const span = to - from;\n const steps = Math.max(1, Math.ceil(Math.abs(span) - 1e-6));\n const u =\n interpolate(time, [morphStart, morphStart + morphFrames], [0, steps], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }) - 1e-9;\n const step = Math.max(0, Math.floor(u));\n const within = Easing.inOut(Easing.cubic)(\n Math.min(1, Math.max(0, (u - step) / (1 - HOLD))),\n );\n const k = from + (span * Math.min(steps, step + within)) / steps;\n\n // Pin 0 sits on the left so the cardioid cusp points left and the figure is\n // symmetric about the horizontal axis. Angles stay continuous in k, so the\n // pattern morphs smoothly instead of snapping between integer tables.\n const point = (index: number) => {\n const a = Math.PI + (TAU * index) / n;\n return { x: cx + Math.cos(a) * radius, y: cy + Math.sin(a) * radius };\n };\n const xy = (p: { x: number; y: number }) => `${fmt(p.x)} ${fmt(p.y)}`;\n\n let threads = \"\";\n const accents: string[] = new Array(SWEEP_BUCKETS).fill(\"\");\n const whole = Math.floor(strung);\n // The accent sweep rides the stringing head, then keeps circling the ring.\n const head = strung + Math.max(0, time - stringFrames) * sweepSpeed;\n const tail = Math.max(0, sweep) * n;\n for (let i = 0; i < Math.ceil(strung); i++) {\n const start = point(i);\n const end = point(k * i);\n // The thread being strung right now grows from its pin to the target.\n const f = i < whole ? 1 : strung - whole;\n const tip = {\n x: start.x + (end.x - start.x) * f,\n y: start.y + (end.y - start.y) * f,\n };\n const d = `M ${xy(start)} L ${xy(tip)} `;\n const behind = (((head - i) % n) + n) % n;\n if (tail > 0 && behind < tail) {\n accents[\n Math.min(SWEEP_BUCKETS - 1, Math.floor((behind / tail) * SWEEP_BUCKETS))\n ] += d;\n } else threads += d;\n }\n\n let pinDots = \"\";\n const pr = 1.6 * unit;\n for (let i = 0; i < n; i++) {\n const { x, y } = point(i);\n pinDots += `M ${fmt(x - pr)} ${fmt(y)} a ${fmt(pr)} ${fmt(pr)} 0 1 0 ${fmt(pr * 2)} 0 a ${fmt(pr)} ${fmt(pr)} 0 1 0 ${fmt(-pr * 2)} 0 `;\n }\n const pinsIn = interpolate(time, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const labelIn = interpolate(\n time,\n [stringFrames - 10, stringFrames + 6],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"String art times table\"\n style={{ display: \"block\" }}\n >\n <path d={pinDots} fill={color} fillOpacity={0.55 * pinsIn} />\n <path\n d={threads}\n fill=\"none\"\n stroke={color}\n strokeOpacity={threadOpacity}\n strokeWidth={unit}\n strokeLinecap=\"round\"\n />\n <g fill=\"none\" stroke={accent} strokeLinecap=\"round\">\n {accents.map((d, b) => (\n <path\n key={b}\n d={d}\n strokeOpacity={1 - b / SWEEP_BUCKETS}\n strokeWidth={unit * (1.6 - b * 0.15)}\n />\n ))}\n </g>\n </svg>\n {showLabel ? (\n <div\n style={{\n position: \"absolute\",\n left: width * 0.06,\n bottom: height * 0.08,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n fontSize: 22 * unit,\n letterSpacing: \"0.04em\",\n color,\n opacity: 0.7 * labelIn,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n <span style={{ color: accent }}>i → </span>\n {k.toFixed(2)} · i mod {n}\n </div>\n ) : null}\n </AbsoluteFill>\n );\n}"+ },+ "durationInFrames": 288+}diff --git a/registry-artifacts/elements/synthwave.json b/registry-artifacts/elements/synthwave.jsonnew file mode 100644index 00000000..5923edb8--- /dev/null+++ b/registry-artifacts/elements/synthwave.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Synthwave",+ "durationInFrames": 120,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "synthwave",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype SynthwaveColors = {\n skyTop: string;\n skyHorizon: string;\n sunTop: string;\n sunBottom: string;\n grid: string;\n floor: string;\n mountainsBack: string;\n mountainsFront: string;\n};\n\ntype SynthwaveProps = {\n colors?: Partial<SynthwaveColors>;\n /** Grid line color. Overrides `colors.grid` when set. */\n grid?: string;\n /** Top of the sun gradient. Overrides `colors.sunTop` when set. */\n sunTop?: string;\n /** Bottom of the sun gradient. Overrides `colors.sunBottom` when set. */\n sunBottom?: string;\n /** Sky glow at the horizon. Overrides `colors.skyHorizon` when set. */\n skyHorizon?: string;\n /** Grid rows that pass the viewer per second. */\n gridSpeed?: number;\n /** Horizon height as a fraction of the frame. */\n horizon?: number;\n /** Scroll the sun stripes downward. */\n sunStripes?: boolean;\n speed?: number;\n};\n\nconst synthwaveDefaults = {\n colors: {\n skyTop: \"#08080B\",\n skyHorizon: \"#3B0C10\",\n sunTop: \"#FFC46B\",\n sunBottom: \"#E5322D\",\n grid: \"#E5322D\",\n floor: \"#0A0A0C\",\n mountainsBack: \"#2A0A0E\",\n mountainsFront: \"#111111\",\n } as SynthwaveColors,\n gridSpeed: 2,\n horizon: 0.6,\n sunStripes: true,\n speed: 1,\n};\n\n/** Frames until the sun and mountains are in place; the grid loops forever. */\nconst synthwaveLength = 40;\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction ridge(\n seed: string,\n width: number,\n base: number,\n peak: number,\n count: number,\n) {\n // Spans well past both edges so the slide never exposes an end.\n const points: string[] = [`${-0.4 * width},${base}`];\n for (let i = 0; i <= count; i++) {\n const x = -0.4 * width + (i / count) * 1.8 * width;\n const center = Math.min(1, Math.abs(x - width / 2) / (0.45 * width));\n const valley = 0.18 + 0.82 * center * center;\n const jag = 0.45 + 0.55 * random(`${seed}-${i}`);\n const y = base - peak * valley * (i % 2 === 0 ? jag : jag * 0.45);\n points.push(`${x},${y}`);\n }\n points.push(`${1.4 * width},${base}`);\n return points.join(\" \");\n}\n\nfunction SynthwaveBase({\n colors,\n grid,\n sunTop,\n sunBottom,\n skyHorizon,\n gridSpeed = synthwaveDefaults.gridSpeed,\n horizon = synthwaveDefaults.horizon,\n sunStripes = synthwaveDefaults.sunStripes,\n speed = synthwaveDefaults.speed,\n}: SynthwaveProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const merged = { ...synthwaveDefaults.colors, ...colors };\n const c: SynthwaveColors = {\n ...merged,\n grid: grid ?? merged.grid,\n sunTop: sunTop ?? merged.sunTop,\n sunBottom: sunBottom ?? merged.sunBottom,\n skyHorizon: skyHorizon ?? merged.skyHorizon,\n };\n const u = Math.min(W, H) / 720;\n const t = (frame / fps) * 30 * speed;\n const cx = W / 2;\n const yh = horizon * H;\n const floorDepth = H - yh;\n\n // Floor: screen y = yh + floorDepth / z, so z = 1 is the bottom edge.\n const rowGap = 0.5;\n const phase = ((((t / 30) * gridSpeed) % 1) + 1) % 1;\n const rows: { y: number; o: number }[] = [];\n for (let k = 0; k < 70; k++) {\n const z = 0.7 + (k + 1 - phase) * rowGap;\n const y = yh + floorDepth / z;\n if (y > H + 4 * u) continue;\n rows.push({ y, o: interpolate(z, [1, 14, 30], [1, 0.35, 0], clamp) });\n }\n const columns = Array.from({ length: 23 }, (_, i) => i - 11);\n const colSpread = W * 0.16;\n const nearZ = 0.35;\n\n const rise = interpolate(t, [0, 40], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const R = 0.27 * H;\n const sunY = interpolate(rise, [0, 1], [yh + R * 1.05, yh - R * 0.42]);\n const stripePhase = sunStripes ? (((t / 36) % 1) + 1) % 1 : 0;\n const stripes = Array.from({ length: 7 }, (_, i) => {\n const p = (i + stripePhase) / 7;\n const y = sunY + R * (-0.05 + p * 1.05);\n const h = R * (0.012 + 0.09 * p);\n return { y: y - h / 2, h };\n });\n\n const back = useMemo(\n () => ridge(\"synthwave-back\", W, yh, 0.26 * H, 27),\n [W, H, yh],\n );\n const front = useMemo(\n () => ridge(\"synthwave-front\", W, yh, 0.15 * H, 39),\n [W, H, yh],\n );\n // Ranges slide in sideways while rising from behind the horizon.\n const slideBack = interpolate(t, [4, 34], [1, 0], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const slideFront = interpolate(t, [8, 38], [1, 0], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const stars = Array.from({ length: 70 }, (_, i) => ({\n x: random(`synthwave-sx-${i}`) * W,\n y: random(`synthwave-sy-${i}`) * yh * 0.8,\n r: (0.6 + random(`synthwave-sr-${i}`) * 1.4) * u,\n o:\n 0.25 +\n 0.5 * (0.5 + 0.5 * Math.sin(t * 0.15 + random(`synthwave-sp-${i}`) * 9)),\n }));\n\n return (\n <AbsoluteFill style={{ backgroundColor: c.floor, overflow: \"hidden\" }}>\n <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden>\n <defs>\n <linearGradient id={`${id}-sky`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0\" stopColor={c.skyTop} />\n <stop offset=\"0.55\" stopColor={c.skyTop} />\n <stop offset=\"1\" stopColor={c.skyHorizon} />\n </linearGradient>\n <linearGradient id={`${id}-sun`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0.1\" stopColor={c.sunTop} />\n <stop offset=\"0.85\" stopColor={c.sunBottom} />\n </linearGradient>\n <linearGradient id={`${id}-floor`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0\" stopColor={c.skyHorizon} />\n <stop offset=\"0.25\" stopColor={c.floor} />\n </linearGradient>\n <mask id={`${id}-stripes`}>\n <rect width={W} height={H} fill=\"#fff\" />\n {stripes.map((s, i) => (\n <rect key={i} x={0} y={s.y} width={W} height={s.h} fill=\"#000\" />\n ))}\n </mask>\n <clipPath id={`${id}-above`}>\n <rect width={W} height={yh} />\n </clipPath>\n <filter\n id={`${id}-glow`}\n x=\"-20%\"\n y=\"-20%\"\n width=\"140%\"\n height=\"140%\"\n >\n <feGaussianBlur stdDeviation={4 * u} result=\"blur\" />\n <feMerge>\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n <filter\n id={`${id}-haze`}\n x=\"-50%\"\n y=\"-50%\"\n width=\"200%\"\n height=\"200%\"\n >\n <feGaussianBlur stdDeviation={30 * u} />\n </filter>\n </defs>\n\n <rect width={W} height={yh} fill={`url(#${id}-sky)`} />\n <g fill=\"#FFFFFF\">\n {stars.map((s, i) => (\n <circle key={i} cx={s.x} cy={s.y} r={s.r} opacity={s.o} />\n ))}\n </g>\n\n <g clipPath={`url(#${id}-above)`}>\n <circle\n cx={cx}\n cy={sunY}\n r={R * 1.15}\n fill={c.sunBottom}\n opacity={0.45}\n filter={`url(#${id}-haze)`}\n />\n <circle\n cx={cx}\n cy={sunY}\n r={R}\n fill={`url(#${id}-sun)`}\n mask={`url(#${id}-stripes)`}\n />\n <polygon\n points={back}\n fill={c.mountainsBack}\n transform={`translate(${-0.25 * W * slideBack} ${0.3 * H * slideBack})`}\n />\n <g\n transform={`translate(${0.25 * W * slideFront} ${0.2 * H * slideFront})`}\n >\n <polygon points={front} fill={c.mountainsFront} />\n <polyline\n points={front}\n fill=\"none\"\n stroke={c.grid}\n strokeWidth={1.5 * u}\n strokeOpacity={0.55}\n strokeLinejoin=\"round\"\n />\n </g>\n </g>\n\n <rect y={yh} width={W} height={H - yh} fill={`url(#${id}-floor)`} />\n <g\n stroke={c.grid}\n strokeWidth={2.2 * u}\n filter={`url(#${id}-glow)`}\n fill=\"none\"\n >\n {columns.map((j) => (\n <line\n key={j}\n x1={cx}\n y1={yh}\n x2={cx + (j * colSpread) / nearZ}\n y2={yh + floorDepth / nearZ}\n />\n ))}\n {rows.map((row, i) => (\n <line\n key={i}\n x1={0}\n y1={row.y}\n x2={W}\n y2={row.y}\n strokeOpacity={row.o}\n />\n ))}\n <line x1={0} y1={yh} x2={W} y2={yh} strokeWidth={3 * u} />\n </g>\n {/* Haze that swallows the converging lines at the horizon. */}\n <rect\n y={yh - 6 * u}\n width={W}\n height={0.12 * H}\n fill={c.skyHorizon}\n opacity={0.5}\n filter={`url(#${id}-haze)`}\n />\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n gridSpeed: {\n type: \"number\",\n default: 2,\n min: 0,\n max: 6,\n step: 0.25,\n description: \"Grid speed\",\n hiddenFromList: false,\n },\n horizon: {\n type: \"number\",\n default: 0.6,\n min: 0.4,\n max: 0.8,\n step: 0.01,\n description: \"Horizon\",\n hiddenFromList: false,\n },\n sunStripes: {\n type: \"boolean\",\n default: true,\n description: \"Scrolling sun stripes\",\n },\n grid: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Grid\",\n },\n sunTop: {\n type: \"color\",\n default: \"#FFC46B\",\n description: \"Sun top\",\n },\n sunBottom: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Sun bottom\",\n },\n skyHorizon: {\n type: \"color\",\n default: \"#3B0C10\",\n description: \"Horizon glow\",\n },\n speed: {\n 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([\"gridSpeed\",\"horizon\",\"sunStripes\",\"grid\",\"sunTop\",\"sunBottom\",\"skyHorizon\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n gridSpeed: 2,\n horizon: 0.6,\n sunStripes: true,\n grid: \"#E5322D\",\n sunTop: \"#FFC46B\",\n sunBottom: \"#E5322D\",\n skyHorizon: \"#3B0C10\",\n speed: 1,\n};\n\ntype SynthwaveElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof SynthwaveBase>;\n\nconst SynthwaveInner = forwardRef<\n HTMLDivElement,\n SynthwaveElementProps & { 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 ?? \"<Synthwave>\"}\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 <SynthwaveBase\n {...(componentProps as unknown as ComponentProps<typeof SynthwaveBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Synthwave = Interactive.withSchema({\n Component: SynthwaveInner,\n componentName: \"<Synthwave>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 120+}diff --git a/registry-artifacts/elements/tiny-planet.json b/registry-artifacts/elements/tiny-planet.jsonnew file mode 100644index 00000000..628c6734--- /dev/null+++ b/registry-artifacts/elements/tiny-planet.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Tiny Planet",+ "durationInFrames": 40,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "tiny-planet",+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype TinyPlanetColors = {\n sky: string;\n ground: string;\n near: string;\n far: string;\n window: string;\n sun: string;\n};\n\ntype TinyPlanetProps = {\n /** Buildings in the front row; the back row gets a matching count. */\n buildings?: number;\n seed?: number;\n /** Planet spin once bent, in degrees per frame at 30fps. */\n spin?: number;\n colors?: Partial<TinyPlanetColors>;\n /** Sky color. Overrides `colors.sky`. */\n skyColor?: string;\n /** Sun color. Overrides `colors.sun`. */\n sunColor?: string;\n /** Front-row building color. Overrides `colors.near`. */\n buildingColor?: string;\n /** Ground color. Overrides `colors.ground`. */\n groundColor?: string;\n speed?: number;\n};\n\nconst tinyPlanetDefaults = {\n buildings: 26,\n seed: 4,\n spin: 0.7,\n colors: {\n sky: \"#111111\",\n ground: \"#262626\",\n near: \"#FFFFFF\",\n far: \"#6B6B6B\",\n window: \"#111111\",\n sun: \"#E5322D\",\n } satisfies TinyPlanetColors,\n speed: 1,\n};\n\nconst BEND_START = 8;\nconst BEND_END = 40;\nconst SPIN_RAMP = 14;\n\ntype Block = { s0: number; s1: number; h: number; row: 0 | 1; spire: number };\n\nfunction makeCity(length: number, height: number, count: number, seed: number) {\n const blocks: Block[] = [];\n for (const row of [1, 0] as const) {\n const n = row === 1 ? Math.round(count * 0.8) : count;\n const slot = length / n;\n for (let i = 0; i < n; i++) {\n const key = `tiny-planet-${seed}-${row}-${i}`;\n const w = slot * (0.55 + random(`${key}-w`) * 0.4);\n const start =\n i * slot + random(`${key}-x`) * (slot - w) + (row ? slot * 0.5 : 0);\n const tall = random(`${key}-h`);\n const h = row\n ? height * (0.13 + tall * 0.16)\n : height * (0.05 + tall * tall * 0.15);\n const spire = random(`${key}-s`) < 0.18 ? height * 0.04 : 0;\n blocks.push({\n s0: start - length / 2,\n s1: start + w - length / 2,\n h,\n row,\n spire,\n });\n }\n }\n return blocks;\n}\n\nfunction TinyPlanetBase({\n buildings = tinyPlanetDefaults.buildings,\n seed = tinyPlanetDefaults.seed,\n spin = tinyPlanetDefaults.spin,\n colors: colorOverrides,\n skyColor,\n sunColor,\n buildingColor,\n groundColor,\n speed = tinyPlanetDefaults.speed,\n}: TinyPlanetProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...tinyPlanetDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n sky: skyColor ?? baseColors.sky,\n sun: sunColor ?? baseColors.sun,\n near: buildingColor ?? baseColors.near,\n ground: groundColor ?? baseColors.ground,\n };\n const t = (frame * speed * 30) / fps;\n\n // The skyline strip is exactly as long as the planet's circumference.\n const length = width;\n const radius = length / (2 * Math.PI);\n const city = useMemo(\n () => makeCity(length, height, Math.max(4, Math.round(buildings)), seed),\n [length, height, buildings, seed],\n );\n\n const bend = interpolate(t, [BEND_START, BEND_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.cubic),\n });\n // Spin eases in while the strip closes, then turns at a steady rate.\n const spinT = Math.max(0, t - (BEND_END - SPIN_RAMP));\n const turn =\n spinT < SPIN_RAMP\n ? (spin * spinT * spinT) / (2 * SPIN_RAMP)\n : spin * (spinT - SPIN_RAMP / 2);\n const rot = (turn * Math.PI) / 180;\n\n const kappa = Math.max(1e-5, bend / radius);\n const horizon = height * 0.7;\n const tallest = height * 0.33;\n const finalScale = (height * 0.43) / (radius + tallest);\n const scale = 1 + (finalScale - 1) * bend;\n const anchorY = horizon + (height / 2 - finalScale * radius - horizon) * bend;\n\n // Bend: arc-length s and height h onto a circle of curvature kappa whose\n // top sits at the pivot. kappa -> 0 is the flat skyline.\n const map = (s: number, h: number): [number, number] => {\n const a = kappa * s + rot * bend;\n const rr = 1 / kappa + h;\n const x = Math.sin(a) * rr;\n const y = 1 / kappa - Math.cos(a) * rr;\n return [width / 2 + x * scale, anchorY + y * scale];\n };\n const P = (s: number, h: number) =>\n map(s, h)\n .map((v) => v.toFixed(1))\n .join(\",\");\n\n const steps = 160;\n const depth = Math.min(1 / kappa, height * 3);\n let ground = \"\";\n for (let i = 0; i <= steps; i++) {\n const s = -length / 2 + (length * i) / steps;\n ground += `${i ? \"L\" : \"M\"}${P(s, 0)}`;\n }\n for (let i = steps; i >= 0; i--) {\n const s = -length / 2 + (length * i) / steps;\n ground += `L${P(s, -depth)}`;\n }\n\n const sunX = interpolate(bend, [0, 1], [width * 0.7, width * 0.8]);\n const sunY = interpolate(bend, [0, 1], [height * 0.36, height * 0.2]);\n const sunR = height * interpolate(bend, [0, 1], [0.12, 0.075]);\n\n return (\n <AbsoluteFill style={{ backgroundColor: colors.sky, overflow: \"hidden\" }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <circle cx={sunX} cy={sunY} r={sunR} fill={colors.sun} />\n {city.map((b, i) => {\n const sub = 4;\n const top: string[] = [];\n for (let k = 0; k <= sub; k++)\n top.push(P(b.s0 + ((b.s1 - b.s0) * k) / sub, b.h));\n const mid = (b.s0 + b.s1) / 2;\n const spire = b.spire\n ? ` M${P(mid - 1.5, b.h)} L${P(mid, b.h + b.spire)} L${P(mid + 1.5, b.h)}`\n : \"\";\n const d = `M${P(b.s0, -2)} L${top.join(\" L\")} L${P(b.s1, -2)} Z${spire}`;\n return (\n <path\n key={i}\n d={d}\n fill={b.row ? colors.far : colors.near}\n stroke={b.row ? colors.far : colors.near}\n strokeWidth={b.spire ? 2 * scale : 0}\n />\n );\n })}\n {city.map((b, i) => {\n if (b.row || b.h < height * 0.09) return null;\n const cols = Math.max(1, Math.floor((b.s1 - b.s0) / (height * 0.03)));\n const rows = Math.floor(b.h / (height * 0.04));\n const cells: string[] = [];\n for (let r = 0; r < rows; r++) {\n for (let c = 0; c < cols; c++) {\n if (random(`tiny-planet-${seed}-win-${i}-${r}-${c}`) < 0.55)\n continue;\n const s = b.s0 + ((b.s1 - b.s0) * (c + 0.5)) / cols;\n const h = b.h - height * 0.03 - r * height * 0.04;\n const ws = height * 0.006;\n cells.push(\n `M${P(s - ws, h)} L${P(s + ws, h)} L${P(s + ws, h - ws * 2.2)} L${P(s - ws, h - ws * 2.2)} Z`,\n );\n }\n }\n return (\n <path key={`w${i}`} d={cells.join(\" \")} fill={colors.window} />\n );\n })}\n <path d={ground} fill={colors.ground} />\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n buildings: {\n type: \"number\",\n default: 26,\n min: 8,\n max: 48,\n step: 1,\n description: \"Buildings\",\n hiddenFromList: false,\n },\n spin: {\n type: \"number\",\n default: 0.7,\n min: 0,\n max: 3,\n step: 0.1,\n description: \"Spin\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 4,\n min: 1,\n max: 24,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n skyColor: {\n type: \"color\",\n default: \"#111111\",\n description: \"Sky\",\n },\n sunColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Sun\",\n },\n buildingColor: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Buildings\",\n },\n groundColor: {\n type: \"color\",\n default: \"#262626\",\n description: \"Ground\",\n },\n speed: {\n 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([\"buildings\",\"spin\",\"seed\",\"skyColor\",\"sunColor\",\"buildingColor\",\"groundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n buildings: 26,\n spin: 0.7,\n seed: 4,\n skyColor: \"#111111\",\n sunColor: \"#E5322D\",\n buildingColor: \"#FFFFFF\",\n groundColor: \"#262626\",\n speed: 1,\n};\n\ntype TinyPlanetElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TinyPlanetBase>;\n\nconst TinyPlanetInner = forwardRef<\n HTMLDivElement,\n TinyPlanetElementProps & { 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 ?? \"<TinyPlanet>\"}\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 <TinyPlanetBase\n {...(componentProps as unknown as ComponentProps<typeof TinyPlanetBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TinyPlanet = Interactive.withSchema({\n Component: TinyPlanetInner,\n componentName: \"<TinyPlanet>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 40+}diff --git a/registry-artifacts/elements/topo-lines.json b/registry-artifacts/elements/topo-lines.jsonnew file mode 100644index 00000000..852db2c3--- /dev/null+++ b/registry-artifacts/elements/topo-lines.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Topo Lines",+ "durationInFrames": 300,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "topo-lines",+ "sourceCode": "import { forwardRef, useImperativeHandle, useMemo, useRef, type ComponentProps } from \"react\";\nimport { AbsoluteFill, Interactive, Sequence, random, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype TopoLinesProps = {\n /** Number of contour levels. */\n levels?: number;\n /** Number of peaks in the height field (1 to 3 reads best). */\n peaks?: number;\n /** Contour drawn in the accent, counted from the lowest; -1 disables. */\n highlight?: number;\n /** Every n-th contour is a heavier index line; 0 disables. */\n indexEvery?: number;\n /** Sampling cells across the short side; higher is smoother and slower. */\n resolution?: number;\n /** Frames per seamless loop of the breathing field. */\n loopFrames?: number;\n seed?: number;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nconst topoLinesDefaults: Required<TopoLinesProps> = {\n levels: 16,\n peaks: 3,\n highlight: 9,\n indexEvery: 4,\n resolution: 90,\n loopFrames: 300,\n seed: 2,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst TAU = Math.PI * 2;\n\n// Cone height falls from 1 to 0 over this distance (short side = 1), so\n// contours are evenly spaced like a real survey map.\nconst REACH = 0.95;\n// Smooth-max softness: peaks merge into shared outer rings without creases.\nconst SOFT = 0.045;\n\ntype Peak = {\n x: number;\n y: number;\n amp: number;\n phase: number;\n orbit: number;\n lobes: [number, number];\n};\ntype Ripple = { fx: number; fy: number; phase: number };\n\nfunction makeTerrain(seed: number, peaks: number, w: number, h: number) {\n const r = (k: string) => random(`topo-lines-${seed}-${k}`);\n const m = Math.max(1, Math.round(peaks));\n const turn = r(\"turn\") * TAU;\n const list: Peak[] = Array.from({ length: m }, (_, k) => {\n // Spread peaks around the centre so each keeps its own nest of rings.\n const a = turn + (k * TAU) / m + (r(`j${k}`) - 0.5) * 0.8;\n const spread = m === 1 ? 0.06 : 0.24 + r(`d${k}`) * 0.06;\n return {\n x: w / 2 + Math.cos(a) * spread * w,\n y: h / 2 + Math.sin(a) * spread * h * 1.1,\n amp: k === 0 ? 1 : 0.7 + r(`a${k}`) * 0.22,\n phase: r(`p${k}`) * TAU,\n orbit: 0.025 + r(`o${k}`) * 0.025,\n lobes: [r(`l2${k}`) * TAU, r(`l3${k}`) * TAU],\n };\n });\n const ripples: Ripple[] = Array.from({ length: 3 }, (_, k) => ({\n fx: (r(`rx${k}`) * 2 - 1) * (3 + k * 2),\n fy: (r(`ry${k}`) * 2 - 1) * (3 + k * 2),\n phase: r(`rp${k}`) * TAU,\n }));\n // Height at (x, y). `tau` walks once around a circle per loop: peaks drift\n // on small orbits, breathe, and their low harmonics rotate a whole number\n // of times, so the last frame matches the first.\n return (x: number, y: number, tau: number) => {\n let sum = 0;\n for (const p of list) {\n const px = p.x + Math.cos(tau + p.phase) * p.orbit;\n const py = p.y + Math.sin(tau + p.phase) * p.orbit;\n const dx = x - px;\n const dy = y - py;\n const theta = Math.atan2(dy, dx);\n const warp =\n 1 +\n 0.14 * Math.sin(2 * theta + p.lobes[0] + tau) +\n 0.08 * Math.sin(3 * theta + p.lobes[1] - tau);\n const amp = p.amp * (1 + 0.05 * Math.sin(tau + p.phase));\n const v = amp - (Math.hypot(dx, dy) * warp) / REACH;\n sum += Math.exp(v / SOFT);\n }\n let v = SOFT * Math.log(sum);\n for (const q of ripples) {\n v +=\n 0.03 *\n Math.sin(q.fx * x + q.fy * y + q.phase + Math.sin(tau + q.phase) * 1.4);\n }\n return v;\n };\n}\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\nfunction TopoLinesBase({\n levels = topoLinesDefaults.levels,\n peaks = topoLinesDefaults.peaks,\n highlight = topoLinesDefaults.highlight,\n indexEvery = topoLinesDefaults.indexEvery,\n resolution = topoLinesDefaults.resolution,\n loopFrames = topoLinesDefaults.loopFrames,\n seed = topoLinesDefaults.seed,\n speed = topoLinesDefaults.speed,\n background = topoLinesDefaults.background,\n color = topoLinesDefaults.color,\n accent = topoLinesDefaults.accent,\n}: TopoLinesProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const unit = Math.min(width, height);\n const w = width / unit;\n const h = height / unit;\n const terrain = useMemo(\n () => makeTerrain(seed, peaks, w, h),\n [seed, peaks, w, h],\n );\n const tau = (TAU * frame * speed) / Math.max(1, loopFrames);\n\n const step = 1 / Math.max(20, resolution);\n const nx = Math.ceil(w / step) + 1;\n const ny = Math.ceil(h / step) + 1;\n const field = new Float32Array(nx * ny);\n for (let j = 0; j < ny; j++) {\n for (let i = 0; i < nx; i++) {\n field[j * nx + i] = terrain(i * step, j * step, tau);\n }\n }\n\n const count = Math.max(1, Math.round(levels));\n const thresholds = Array.from(\n { length: count },\n (_, l) => 0.04 + (l * 0.9) / count,\n );\n const paths = { plain: \"\", index: \"\", accent: \"\" };\n const s = step * unit;\n const X = (i: number) => fmt(i * s);\n const Y = (j: number) => fmt(j * s);\n\n // Marching squares. Segments that share a cell edge land on the same\n // interpolated point, so round caps make them read as continuous curves.\n for (let j = 0; j < ny - 1; j++) {\n for (let i = 0; i < nx - 1; i++) {\n const a = field[j * nx + i];\n const b = field[j * nx + i + 1];\n const c = field[(j + 1) * nx + i + 1];\n const d = field[(j + 1) * nx + i];\n const lo = Math.min(a, b, c, d);\n const hi = Math.max(a, b, c, d);\n for (let l = 0; l < count; l++) {\n const t = thresholds[l];\n if (t < lo || t >= hi) continue;\n const code =\n (a > t ? 8 : 0) | (b > t ? 4 : 0) | (c > t ? 2 : 0) | (d > t ? 1 : 0);\n const top = () => `${X(i + (t - a) / (b - a))} ${Y(j)}`;\n const right = () => `${X(i + 1)} ${Y(j + (t - b) / (c - b))}`;\n const bottom = () => `${X(i + (t - d) / (c - d))} ${Y(j + 1)}`;\n const left = () => `${X(i)} ${Y(j + (t - a) / (d - a))}`;\n let seg = \"\";\n switch (code) {\n case 1:\n case 14:\n seg = `M ${left()} L ${bottom()} `;\n break;\n case 2:\n case 13:\n seg = `M ${bottom()} L ${right()} `;\n break;\n case 3:\n case 12:\n seg = `M ${left()} L ${right()} `;\n break;\n case 4:\n case 11:\n seg = `M ${top()} L ${right()} `;\n break;\n case 6:\n case 9:\n seg = `M ${top()} L ${bottom()} `;\n break;\n case 7:\n case 8:\n seg = `M ${left()} L ${top()} `;\n break;\n case 5:\n seg = `M ${left()} L ${top()} M ${bottom()} L ${right()} `;\n break;\n case 10:\n seg = `M ${top()} L ${right()} M ${left()} L ${bottom()} `;\n break;\n }\n if (l === highlight) paths.accent += seg;\n else if (indexEvery > 0 && (l + 1) % indexEvery === 0)\n paths.index += seg;\n else paths.plain += seg;\n }\n }\n }\n\n const px = unit / 720;\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Topographic contour lines\"\n style={{ display: \"block\" }}\n >\n <g fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path\n d={paths.plain}\n stroke={color}\n strokeOpacity={0.38}\n strokeWidth={1.1 * px}\n />\n <path\n d={paths.index}\n stroke={color}\n strokeOpacity={0.85}\n strokeWidth={1.8 * px}\n />\n <path d={paths.accent} stroke={accent} strokeWidth={2.6 * px} />\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n levels: {\n type: \"number\",\n default: 16,\n min: 4,\n max: 32,\n step: 1,\n description: \"Contours\",\n hiddenFromList: false,\n },\n peaks: {\n type: \"number\",\n default: 3,\n min: 1,\n max: 5,\n step: 1,\n description: \"Peaks\",\n hiddenFromList: false,\n },\n highlight: {\n type: \"number\",\n default: 9,\n min: -1,\n max: 31,\n step: 1,\n description: \"Accent contour\",\n hiddenFromList: false,\n },\n indexEvery: {\n type: \"number\",\n default: 4,\n min: 0,\n max: 8,\n step: 1,\n description: \"Index line every\",\n hiddenFromList: false,\n },\n loopFrames: {\n type: \"number\",\n default: 300,\n min: 90,\n max: 900,\n step: 30,\n description: \"Loop frames\",\n hiddenFromList: false,\n },\n seed: {\n type: \"number\",\n default: 2,\n min: 1,\n max: 50,\n step: 1,\n description: \"Seed\",\n hiddenFromList: false,\n },\n background: {\n type: \"color\",\n default: \"#111111\",\n description: \"Background\",\n },\n color: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Contours\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent\",\n },\n speed: {\n 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([\"levels\",\"peaks\",\"highlight\",\"indexEvery\",\"loopFrames\",\"seed\",\"background\",\"color\",\"accent\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n levels: 16,\n peaks: 3,\n highlight: 9,\n indexEvery: 4,\n loopFrames: 300,\n seed: 2,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n speed: 1,\n};\n\ntype TopoLinesElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TopoLinesBase>;\n\nconst TopoLinesInner = forwardRef<\n HTMLDivElement,\n TopoLinesElementProps & { 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 ?? \"<TopoLines>\"}\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 <TopoLinesBase\n {...(componentProps as unknown as ComponentProps<typeof TopoLinesBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TopoLines = Interactive.withSchema({\n Component: TopoLinesInner,\n componentName: \"<TopoLines>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 300+}diff --git a/registry-artifacts/elements/turntable.json b/registry-artifacts/elements/turntable.jsonnew file mode 100644index 00000000..9ddb0cd3--- /dev/null+++ b/registry-artifacts/elements/turntable.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Turntable",+ "durationInFrames": 64,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "turntable",+ "sourceCode": "import { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport React, { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ntype TurntableColors = {\n background: string;\n front: string;\n back: string;\n edge: string;\n mark: string;\n shadow: string;\n};\n\ntype TurntableProps = {\n /** Front face content. Defaults to a red card with a mark. */\n children?: React.ReactNode;\n /** Back face content. Defaults to a dark card. */\n back?: React.ReactNode;\n /** Card thickness in px at 720p. */\n thickness?: number;\n /** Full rotations per spin. */\n turns?: number;\n /** Camera tilt in degrees; positive looks down on the card. */\n tilt?: number;\n colors?: Partial<TurntableColors>;\n /** Default front face color. Overrides `colors.front`. */\n frontColor?: string;\n /** Card edge color. Overrides `colors.edge`. */\n edgeColor?: string;\n /** Default back face color. Overrides `colors.back`. */\n backColor?: string;\n /** Stage background. Overrides `colors.background`. */\n backgroundColor?: string;\n speed?: number;\n};\n\nconst turntableDefaults = {\n thickness: 22,\n turns: 1,\n tilt: 8,\n colors: {\n background: \"#111111\",\n front: \"#E5322D\",\n back: \"#F2F2F2\",\n edge: \"#A3201C\",\n mark: \"#FFFFFF\",\n shadow: \"#000000\",\n } satisfies TurntableColors,\n speed: 1,\n};\n\nconst START = 6;\nconst END = 64;\n\nfunction DefaultFront({ colors }: { colors: TurntableColors }) {\n return (\n <AbsoluteFill\n style={{\n backgroundColor: colors.front,\n padding: \"9%\",\n justifyContent: \"space-between\",\n }}\n >\n <div\n style={{\n width: \"22%\",\n aspectRatio: \"1\",\n borderRadius: \"50%\",\n border: `0.6em solid ${colors.mark}`,\n }}\n />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"0.5em\" }}>\n <div\n style={{\n height: \"0.9em\",\n width: \"62%\",\n background: colors.mark,\n borderRadius: 99,\n }}\n />\n <div\n style={{\n height: \"0.9em\",\n width: \"38%\",\n background: colors.mark,\n opacity: 0.55,\n borderRadius: 99,\n }}\n />\n </div>\n </AbsoluteFill>\n );\n}\n\nfunction DefaultBack({ colors }: { colors: TurntableColors }) {\n return (\n <AbsoluteFill style={{ backgroundColor: colors.back }}>\n <div\n style={{\n position: \"absolute\",\n top: \"16%\",\n left: 0,\n right: 0,\n height: \"18%\",\n background: \"#111111\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n right: \"9%\",\n bottom: \"12%\",\n width: \"16%\",\n aspectRatio: \"1\",\n borderRadius: \"28%\",\n background: colors.front,\n }}\n />\n </AbsoluteFill>\n );\n}\n\nfunction TurntableBase({\n children,\n back,\n thickness = turntableDefaults.thickness,\n turns = turntableDefaults.turns,\n tilt = turntableDefaults.tilt,\n colors: colorOverrides,\n frontColor,\n edgeColor,\n backColor,\n backgroundColor,\n speed = turntableDefaults.speed,\n}: TurntableProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...turntableDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n front: frontColor ?? baseColors.front,\n edge: edgeColor ?? baseColors.edge,\n back: backColor ?? baseColors.back,\n background: backgroundColor ?? baseColors.background,\n };\n const t = (frame * speed * 30) / fps;\n const unit = height / 720;\n\n const cardH = height * 0.46;\n const cardW = cardH * 1.58;\n const depth = thickness * unit;\n const radius = Math.min(cardH * 0.06, depth * 1.2);\n\n const spin = interpolate(t, [START, END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.55, 0, 0.25, 1),\n });\n const angle = spin * 360 * turns;\n const rad = (angle * Math.PI) / 180;\n const cos = Math.cos(rad);\n const sin = Math.sin(rad);\n\n // Lambert-ish shading for each face from a key light front-left.\n const light = (nx: number, nz: number) =>\n 0.55 + 0.45 * Math.max(0, nz * 0.85 - nx * 0.5);\n const frontShade = light(sin, cos);\n const backShade = light(-sin, -cos);\n const sideShade = light(cos, -sin);\n const sheen = 50 + sin * 120;\n\n const footprint = Math.abs(cos) * cardW + Math.abs(sin) * depth;\n const shadowW = Math.max(footprint, depth * 3);\n const floorY = height / 2 + cardH / 2 + height * 0.075;\n\n const face = (\n content: React.ReactNode,\n transform: string,\n shade: number,\n ): React.ReactNode => (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n overflow: \"hidden\",\n backfaceVisibility: \"hidden\",\n transform,\n fontSize: cardH / 30,\n }}\n >\n {content}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `linear-gradient(105deg, rgba(255,255,255,0) ${sheen - 22}%, rgba(255,255,255,0.22) ${sheen}%, rgba(255,255,255,0) ${sheen + 22}%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#000\",\n opacity: 1 - shade,\n }}\n />\n </div>\n );\n\n const slab = (\n w: number,\n h: number,\n transform: string,\n shade: number,\n key: string,\n ) => (\n <div\n key={key}\n style={{\n position: \"absolute\",\n left: (cardW - w) / 2,\n top: (cardH - h) / 2,\n width: w,\n height: h,\n background: colors.edge,\n filter: `brightness(${shade})`,\n transform,\n }}\n />\n );\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor: colors.background,\n overflow: \"hidden\",\n background: `radial-gradient(ellipse 60% 40% at 50% ${(floorY / height) * 100}%, rgba(255,255,255,0.07), rgba(255,255,255,0) 70%), ${colors.background}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: width / 2 - shadowW / 2,\n top: floorY - height * 0.025,\n width: shadowW,\n height: height * 0.05,\n borderRadius: \"50%\",\n background: colors.shadow,\n opacity: 0.45 + 0.35 * Math.abs(cos),\n filter: `blur(${height * 0.018}px)`,\n }}\n />\n <AbsoluteFill\n style={{\n perspective: height * 2.4,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: cardW,\n height: cardH,\n position: \"relative\",\n transformStyle: \"preserve-3d\",\n transform: `rotateX(${-tilt}deg) rotateY(${angle}deg)`,\n }}\n >\n {slab(\n depth,\n cardH - radius * 2,\n `rotateY(90deg) translateZ(${cardW / 2}px)`,\n sideShade,\n \"r\",\n )}\n {slab(\n depth,\n cardH - radius * 2,\n `rotateY(-90deg) translateZ(${cardW / 2}px)`,\n light(-cos, sin),\n \"l\",\n )}\n {slab(\n cardW - radius * 2,\n depth,\n `rotateX(90deg) translateZ(${cardH / 2}px)`,\n 1.1,\n \"t\",\n )}\n {slab(\n cardW - radius * 2,\n depth,\n `rotateX(-90deg) translateZ(${cardH / 2}px)`,\n 0.6,\n \"b\",\n )}\n {face(\n children ?? <DefaultFront colors={colors} />,\n `translateZ(${depth / 2}px)`,\n frontShade,\n )}\n {face(\n back ?? <DefaultBack colors={colors} />,\n `rotateY(180deg) translateZ(${depth / 2}px)`,\n backShade,\n )}\n </div>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n turns: {\n type: \"number\",\n default: 1,\n min: 0.5,\n max: 3,\n step: 0.5,\n description: \"Turns\",\n hiddenFromList: false,\n },\n thickness: {\n type: \"number\",\n default: 22,\n min: 2,\n max: 60,\n step: 1,\n description: \"Thickness\",\n hiddenFromList: false,\n },\n tilt: {\n type: \"number\",\n default: 8,\n min: -20,\n max: 30,\n step: 1,\n description: \"Tilt\",\n hiddenFromList: false,\n },\n frontColor: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Front\",\n },\n edgeColor: {\n type: \"color\",\n default: \"#A3201C\",\n description: \"Edge\",\n },\n backColor: {\n type: \"color\",\n default: \"#F2F2F2\",\n description: \"Back\",\n },\n backgroundColor: {\n type: \"color\",\n default: \"#111111\",\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([\"turns\",\"thickness\",\"tilt\",\"frontColor\",\"edgeColor\",\"backColor\",\"backgroundColor\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n turns: 1,\n thickness: 22,\n tilt: 8,\n frontColor: \"#E5322D\",\n edgeColor: \"#A3201C\",\n backColor: \"#F2F2F2\",\n backgroundColor: \"#111111\",\n speed: 1,\n};\n\ntype TurntableElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TurntableBase>;\n\nconst TurntableInner = forwardRef<\n HTMLDivElement,\n TurntableElementProps & { 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 ?? \"<Turntable>\"}\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 <TurntableBase\n {...(componentProps as unknown as ComponentProps<typeof TurntableBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const Turntable = Interactive.withSchema({\n Component: TurntableInner,\n componentName: \"<Turntable>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 64+}diff --git a/registry-artifacts/elements/x-ray-scan.json b/registry-artifacts/elements/x-ray-scan.jsonnew file mode 100644index 00000000..d1c65d94--- /dev/null+++ b/registry-artifacts/elements/x-ray-scan.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "X-Ray Scan",+ "durationInFrames": 32,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "x-ray-scan",+ "sourceCode": "import { forwardRef, useId, useImperativeHandle, useRef, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, useVideoConfig, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\ntype XRayScanColors = {\n background: string;\n shell: string;\n detail: string;\n xray: string;\n line: string;\n accent: string;\n};\n\ntype XRayScanProps = {\n /** Exterior shown ahead of the bar. Defaults to the back of a phone. */\n outside?: ReactNode;\n /** Interior revealed behind the bar. Defaults to white-line phone internals. */\n inside?: ReactNode;\n colors?: Partial<XRayScanColors>;\n /** Phone shell color. Overrides `colors.shell` when set. */\n shell?: string;\n /** Highlighted internal part. Overrides `colors.accent` when set. */\n accent?: string;\n /** Scan line and interior line art. Overrides `colors.line` when set. */\n line?: string;\n /** Background. Overrides `colors.background` when set. */\n background?: string;\n /** \"horizontal\" sweeps left to right, \"vertical\" top to bottom. */\n direction?: \"horizontal\" | \"vertical\";\n speed?: number;\n};\n\nconst xRayScanDefaults = {\n colors: {\n background: \"#111111\",\n shell: \"#E5322D\",\n detail: \"#111111\",\n xray: \"#07080A\",\n line: \"#FFFFFF\",\n accent: \"#E5322D\",\n } as XRayScanColors,\n direction: \"horizontal\" as const,\n speed: 1,\n};\n\nconst xRayScanLength = 32;\n\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\ntype Device = { x: number; y: number; w: number; h: number; r: number };\n\nfunction Outside({ id, d, c }: { id: string; d: Device; c: XRayScanColors }) {\n const lens = d.w * 0.085;\n return (\n <>\n <defs>\n <linearGradient id={`${id}-gloss`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n <stop offset=\"0\" stopColor=\"#FFFFFF\" stopOpacity={0.22} />\n <stop offset=\"0.45\" stopColor=\"#FFFFFF\" stopOpacity={0} />\n <stop offset=\"1\" stopColor=\"#000000\" stopOpacity={0.18} />\n </linearGradient>\n </defs>\n <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} fill={c.shell} />\n <rect\n x={d.x}\n y={d.y}\n width={d.w}\n height={d.h}\n rx={d.r}\n fill={`url(#${id}-gloss)`}\n />\n <rect\n x={d.x + d.w * 0.07}\n y={d.y + d.w * 0.07}\n width={d.w * 0.4}\n height={d.w * 0.4}\n rx={d.w * 0.1}\n fill={c.detail}\n opacity={0.92}\n />\n {[\n [0.17, 0.17],\n [0.37, 0.17],\n [0.17, 0.37],\n ].map(([fx, fy]) => (\n <g key={`${fx}${fy}`}>\n <circle\n cx={d.x + d.w * fx}\n cy={d.y + d.w * fy}\n r={lens}\n fill=\"#000\"\n stroke=\"#2A2A2A\"\n strokeWidth={lens * 0.25}\n />\n <circle\n cx={d.x + d.w * fx - lens * 0.3}\n cy={d.y + d.w * fy - lens * 0.3}\n r={lens * 0.18}\n fill=\"#FFFFFF\"\n opacity={0.6}\n />\n </g>\n ))}\n <circle\n cx={d.x + d.w / 2}\n cy={d.y + d.h * 0.5}\n r={d.w * 0.07}\n fill={c.detail}\n opacity={0.85}\n />\n </>\n );\n}\n\nfunction Inside({ d, c, u }: { d: Device; c: XRayScanColors; u: number }) {\n const X = (f: number) => d.x + d.w * f;\n const Y = (f: number) => d.y + d.h * f;\n const pins = (x: number, y: number, w: number, h: number, n: number) =>\n Array.from({ length: n }, (_, i) => {\n const px = x + ((i + 0.5) / n) * w;\n return `M ${px} ${y - 4 * u} V ${y} M ${px} ${y + h} V ${y + h + 4 * u}`;\n }).join(\" \");\n return (\n <>\n <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} fill={c.xray} />\n <g fill=\"none\" stroke={c.line} strokeWidth={2 * u} strokeLinejoin=\"round\">\n <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} />\n <rect\n x={X(0.04)}\n y={Y(0.02)}\n width={d.w * 0.92}\n height={d.h * 0.96}\n rx={d.r * 0.82}\n strokeOpacity={0.4}\n />\n {/* Camera ring */}\n {[\n [0.17, 0.17],\n [0.37, 0.17],\n [0.17, 0.37],\n ].map(([fx, fy]) => (\n <g key={`${fx}${fy}`}>\n <circle cx={X(fx)} cy={d.y + d.w * fy} r={d.w * 0.085} />\n <circle\n cx={X(fx)}\n cy={d.y + d.w * fy}\n r={d.w * 0.045}\n strokeOpacity={0.6}\n />\n </g>\n ))}\n {/* Logic board */}\n <path\n d={`M ${X(0.52)} ${Y(0.05)} H ${X(0.9)} V ${Y(0.36)} H ${X(0.1)} V ${Y(0.27)} H ${X(0.52)} Z`}\n />\n <rect\n x={X(0.6)}\n y={Y(0.08)}\n width={d.w * 0.22}\n height={d.h * 0.07}\n rx={2 * u}\n />\n <path\n d={pins(X(0.6), Y(0.08), d.w * 0.22, d.h * 0.07, 6)}\n strokeOpacity={0.6}\n strokeWidth={1.3 * u}\n />\n <rect\n x={X(0.16)}\n y={Y(0.295)}\n width={d.w * 0.16}\n height={d.h * 0.04}\n rx={2 * u}\n strokeOpacity={0.8}\n />\n <rect\n x={X(0.38)}\n y={Y(0.295)}\n width={d.w * 0.12}\n height={d.h * 0.04}\n rx={2 * u}\n strokeOpacity={0.8}\n />\n {/* Battery with wireless coil */}\n <rect\n x={X(0.12)}\n y={Y(0.4)}\n width={d.w * 0.76}\n height={d.h * 0.44}\n rx={6 * u}\n />\n <path\n d={`M ${X(0.42)} ${Y(0.4)} V ${Y(0.385)} H ${X(0.58)} V ${Y(0.4)}`}\n />\n {[0.26, 0.2, 0.14].map((f) => (\n <circle\n key={f}\n cx={X(0.5)}\n cy={Y(0.62)}\n r={d.w * f}\n strokeOpacity={0.45}\n />\n ))}\n <path\n d={`M ${X(0.5)} ${Y(0.47)} V ${Y(0.5)} M ${X(0.485)} ${Y(0.485)} H ${X(0.515)}`}\n />\n {/* Flex cable, speaker and port */}\n <path\n d={`M ${X(0.86)} ${Y(0.36)} V ${Y(0.38)} H ${X(0.92)} V ${Y(0.89)} H ${X(0.66)}`}\n strokeOpacity={0.6}\n />\n <rect\n x={X(0.38)}\n y={Y(0.935)}\n width={d.w * 0.24}\n height={d.h * 0.025}\n rx={d.h * 0.0125}\n />\n {Array.from({ length: 6 }, (_, i) => (\n <circle key={i} cx={X(0.14 + i * 0.035)} cy={Y(0.947)} r={1.8 * u} />\n ))}\n </g>\n {/* The one part in red: the SoC */}\n <g stroke={c.accent} strokeWidth={2.4 * u} fill=\"none\">\n <rect\n x={X(0.6)}\n y={Y(0.17)}\n width={d.w * 0.22}\n height={d.w * 0.22}\n rx={3 * u}\n fill={c.accent}\n fillOpacity={0.22}\n />\n <path\n d={pins(X(0.6), Y(0.17), d.w * 0.22, d.w * 0.22, 5)}\n strokeWidth={1.4 * u}\n />\n </g>\n <text\n x={X(0.5)}\n y={Y(0.79)}\n textAnchor=\"middle\"\n fontFamily={MONO}\n fontSize={12 * u}\n letterSpacing={2 * u}\n fill={c.line}\n opacity={0.7}\n >\n Li-ion 4500 mAh\n </text>\n </>\n );\n}\n\nfunction XRayScanBase({\n outside,\n inside,\n colors,\n shell,\n accent,\n line,\n background,\n direction = xRayScanDefaults.direction,\n speed = xRayScanDefaults.speed,\n}: XRayScanProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const merged = { ...xRayScanDefaults.colors, ...colors };\n const c: XRayScanColors = {\n ...merged,\n shell: shell ?? merged.shell,\n accent: accent ?? merged.accent,\n line: line ?? merged.line,\n background: background ?? merged.background,\n };\n const t = (frame / fps) * 30 * speed;\n const u = Math.min(W, H) / 720;\n const vertical = direction === \"vertical\";\n\n const dh = 0.8 * H;\n const dw = dh * 0.49;\n const d: Device = {\n x: (W - dw) / 2,\n y: (H - dh) / 2,\n w: dw,\n h: dh,\n r: dw * 0.17,\n };\n const span = vertical ? H : W;\n const start = vertical ? d.y - 0.1 * H : d.x - 0.12 * W;\n const end = vertical ? d.y + d.h + 0.1 * H : d.x + d.w + 0.12 * W;\n const bar = interpolate(t, [5, 32], [start, end], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n });\n const scanning = t > 5 && t < 32;\n const band = 0.12 * span;\n const behind = vertical\n ? `inset(0 0 ${H - bar}px 0)`\n : `inset(0 ${W - bar}px 0 0)`;\n const ahead = vertical ? `inset(${bar}px 0 0 0)` : `inset(0 0 0 ${bar}px)`;\n const hot = vertical\n ? `inset(${Math.max(0, bar - band)}px 0 ${H - bar}px 0)`\n : `inset(0 ${W - bar}px 0 ${Math.max(0, bar - band)}px)`;\n const trail = vertical ? \"to top\" : \"to left\";\n\n const insideLayer = inside ?? (\n <svg width={W} height={H} aria-hidden>\n <Inside d={d} c={c} u={u} />\n </svg>\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor: c.background, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter id={`${id}-glow`} x=\"-10%\" y=\"-10%\" width=\"120%\" height=\"120%\">\n <feGaussianBlur stdDeviation={3 * u} result=\"blur\" />\n <feMerge>\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n </svg>\n <AbsoluteFill style={{ clipPath: ahead }}>\n {outside ?? (\n <svg width={W} height={H} aria-hidden>\n <Outside id={id} d={d} c={c} />\n </svg>\n )}\n </AbsoluteFill>\n <AbsoluteFill style={{ clipPath: behind }}>{insideLayer}</AbsoluteFill>\n {/* Fresh exposure glows brighter just behind the bar. */}\n <AbsoluteFill\n style={{\n clipPath: hot,\n filter: `url(#${id}-glow)`,\n opacity: scanning ? 0.9 : 0,\n }}\n >\n {insideLayer}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n clipPath: behind,\n opacity: scanning ? 1 : 0,\n background: `linear-gradient(${trail}, ${c.line}2E 0px, transparent ${band}px)`,\n backgroundPosition: vertical ? `0 ${bar - H}px` : `${bar - W}px 0`,\n backgroundRepeat: \"no-repeat\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: vertical ? 0 : bar - 1.5 * u,\n top: vertical ? bar - 1.5 * u : 0,\n width: vertical ? W : 3 * u,\n height: vertical ? 3 * u : H,\n backgroundColor: c.line,\n boxShadow: `0 0 ${16 * u}px ${4 * u}px ${c.line}AA, 0 0 ${60 * u}px ${12 * u}px ${c.line}33`,\n opacity: scanning ? 1 : 0,\n }}\n />\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n direction: {\n type: \"enum\",\n default: \"horizontal\",\n variants: {\n horizontal: {},\n vertical: {},\n },\n description: \"Direction\",\n },\n shell: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Shell\",\n },\n accent: {\n type: \"color\",\n default: \"#E5322D\",\n description: \"Accent part\",\n },\n line: {\n type: \"color\",\n default: \"#FFFFFF\",\n description: \"Scan line\",\n },\n background: {\n type: \"color\",\n default: \"#111111\",\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([\"direction\",\"shell\",\"accent\",\"line\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n direction: \"horizontal\",\n shell: \"#E5322D\",\n accent: \"#E5322D\",\n line: \"#FFFFFF\",\n background: \"#111111\",\n speed: 1,\n};\n\ntype XRayScanElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof XRayScanBase>;\n\nconst XRayScanInner = forwardRef<\n HTMLDivElement,\n XRayScanElementProps & { 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 ?? \"<XRayScan>\"}\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 <XRayScanBase\n {...(componentProps as unknown as ComponentProps<typeof XRayScanBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const XRayScan = Interactive.withSchema({\n Component: XRayScanInner,\n componentName: \"<XRayScan>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 32+}diff --git a/registry-artifacts/exploded-view.json b/registry-artifacts/exploded-view.jsonnew file mode 100644index 00000000..9a0c16fb--- /dev/null+++ b/registry-artifacts/exploded-view.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "exploded-view",+ "title": "Exploded View",+ "description": "An isometric stack of slabs springs apart with leader lines and labels, holds, then clicks back together.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/exploded-view/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type ExplodedViewColors = {\n background: string;\n top: string;\n left: string;\n right: string;\n highlightTop: string;\n highlightLeft: string;\n highlightRight: string;\n line: string;\n label: string;\n};\n\nexport type ExplodedViewProps = {\n /** Number of slabs, 2 to 6. */\n layers?: number;\n /** One label per slab, top slab first. */\n labels?: string[];\n /** Index of the red slab, counted from the top. */\n highlight?: number;\n colors?: Partial<ExplodedViewColors>;\n /** Background color. Overrides `colors.background`. */\n backgroundColor?: string;\n /** Label text color. Overrides `colors.label`. */\n labelColor?: string;\n speed?: number;\n};\n\nexport const explodedViewDefaults = {\n layers: 4,\n labels: [\"Interface\", \"Engine\", \"Storage\", \"Hardware\"],\n highlight: 1,\n colors: {\n background: \"#111111\",\n top: \"#F4F4F4\",\n left: \"#A6A6A6\",\n right: \"#747474\",\n highlightTop: \"#E5322D\",\n highlightLeft: \"#B5231F\",\n highlightRight: \"#8A1A17\",\n line: \"#FFFFFF\",\n label: \"#FFFFFF\",\n } satisfies ExplodedViewColors,\n speed: 1,\n};\n\nconst FONT = \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst OPEN = 3;\nconst CLOSE = 38;\nconst COS30 = Math.cos(Math.PI / 6);\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport function ExplodedView({\n layers = explodedViewDefaults.layers,\n labels = explodedViewDefaults.labels,\n highlight = explodedViewDefaults.highlight,\n colors: colorOverrides,\n backgroundColor,\n labelColor,\n speed = explodedViewDefaults.speed,\n}: ExplodedViewProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...explodedViewDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n background: backgroundColor ?? baseColors.background,\n label: labelColor ?? baseColors.label,\n };\n const n = Math.round(Math.min(6, Math.max(2, layers)));\n const t = (frame * speed * 30) / fps;\n\n const side = height * 0.36;\n const thick = height * 0.036;\n const gap = (height * 0.27) / (n - 1);\n const cx = width * 0.4;\n const cy = height * 0.5;\n\n const iso = (X: number, Y: number, Z: number) =>\n [(X - Y) * COS30, (X + Y) * 0.5 - Z] as const;\n const pts = (list: (readonly [number, number])[]) =>\n list.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(\" \");\n\n const close = spring({\n frame: t - CLOSE,\n fps: 30,\n config: { damping: 26, stiffness: 320, mass: 0.8 },\n });\n // Top slab leaves first; bottom one barely waits.\n const spread = Array.from({ length: n }, (_, i) => {\n const fromTop = n - 1 - i;\n const open = spring({\n frame: t - OPEN - fromTop * 1.5,\n fps: 30,\n config: { damping: 12, stiffness: 110 },\n });\n return Math.max(0, open * (1 - close));\n });\n const offsets: number[] = [];\n let z = 0;\n for (let i = 0; i < n; i++) {\n offsets.push(z);\n z += thick + (i < n - 1 ? gap * Math.max(spread[i + 1], 0) : 0);\n }\n const total = z;\n // The click: a short downward knock once the slabs meet again.\n const knock =\n interpolate(t, [CLOSE + 5, CLOSE + 7, CLOSE + 12], [0, 1, 0], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n }) *\n height *\n 0.008;\n const baseY = cy + side * 0.02 + total / 2 + knock;\n const labelOut = interpolate(t, [CLOSE - 5, CLOSE], [1, 0], clamp);\n const labelX = width * 0.66;\n const fontSize = height * 0.042;\n\n const slabs: React.ReactNode[] = [];\n const leaders: React.ReactNode[] = [];\n for (let i = 0; i < n; i++) {\n const fromTop = n - 1 - i;\n const hot = fromTop === highlight;\n const z0 = offsets[i];\n const z1 = z0 + thick;\n const h = side / 2;\n const top = [\n iso(-h, -h, z1),\n iso(h, -h, z1),\n iso(h, h, z1),\n iso(-h, h, z1),\n ];\n const left = [iso(-h, h, z1), iso(h, h, z1), iso(h, h, z0), iso(-h, h, z0)];\n const right = [\n iso(h, -h, z1),\n iso(h, h, z1),\n iso(h, h, z0),\n iso(h, -h, z0),\n ];\n const inset = h * 0.78;\n const inner = [\n iso(-inset, -inset, z1),\n iso(inset, -inset, z1),\n iso(inset, inset, z1),\n iso(-inset, inset, z1),\n ];\n const ink = hot ? \"#FFFFFF\" : \"#111111\";\n slabs.push(\n <g key={i}>\n <polygon\n points={pts(left)}\n fill={hot ? colors.highlightLeft : colors.left}\n />\n <polygon\n points={pts(right)}\n fill={hot ? colors.highlightRight : colors.right}\n />\n <polygon\n points={pts(top)}\n fill={hot ? colors.highlightTop : colors.top}\n />\n <polygon\n points={pts(inner)}\n fill=\"none\"\n stroke={ink}\n strokeOpacity={0.18}\n strokeWidth={height * 0.002}\n />\n {[-0.4, 0, 0.4].map((k) => {\n const a = iso(-inset * 0.7, k * inset, z1);\n const b = iso(inset * (fromTop % 2 ? 0.2 : 0.7), k * inset, z1);\n return (\n <line\n key={k}\n x1={a[0]}\n y1={a[1]}\n x2={b[0]}\n y2={b[1]}\n stroke={ink}\n strokeOpacity={0.22}\n strokeWidth={height * 0.006}\n strokeLinecap=\"round\"\n />\n );\n })}\n </g>,\n );\n\n const label = labels[fromTop];\n if (!label) continue;\n const anchor = iso(h, -h, (z0 + z1) / 2);\n const draw = interpolate(\n t,\n [14 + fromTop * 2.5, 24 + fromTop * 2.5],\n [0, 1],\n {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n },\n );\n const show =\n interpolate(t, [19 + fromTop * 2.5, 27 + fromTop * 2.5], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n }) * labelOut;\n const ax = cx + anchor[0] + height * 0.012;\n const ay = baseY + anchor[1];\n const length = (labelX - ax) * draw * labelOut;\n leaders.push(\n <g key={`l${i}`}>\n <circle\n cx={ax}\n cy={ay}\n r={height * 0.006}\n fill={colors.line}\n opacity={Math.min(1, draw * 3) * labelOut}\n />\n <line\n x1={ax}\n y1={ay}\n x2={ax + length}\n y2={ay}\n stroke={colors.line}\n strokeOpacity={0.6}\n strokeWidth={Math.max(1, height * 0.0022)}\n />\n <g\n opacity={show}\n transform={`translate(${labelX + height * 0.02 + (1 - show) * height * 0.03} ${ay})`}\n >\n <text\n y={-fontSize * 0.62}\n fill={hot ? colors.highlightTop : colors.label}\n fillOpacity={hot ? 1 : 0.5}\n fontFamily={FONT}\n fontSize={fontSize * 0.5}\n fontWeight={600}\n letterSpacing=\"0.12em\"\n >\n {`0${fromTop + 1}`}\n </text>\n <text\n y={fontSize * 0.42}\n fill={colors.label}\n fontFamily={FONT}\n fontSize={fontSize}\n fontWeight={700}\n letterSpacing=\"-0.02em\"\n >\n {label}\n </text>\n </g>\n </g>,\n );\n }\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <ellipse\n cx={cx}\n cy={baseY + side * 0.5 + height * 0.035}\n rx={side * COS30 * 1.05}\n ry={side * 0.16}\n fill=\"#000000\"\n opacity={0.5}\n />\n <g transform={`translate(${cx} ${baseY})`}>{slabs}</g>\n {leaders}\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/exploded-view.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/flow-field.json b/registry-artifacts/flow-field.jsonnew file mode 100644index 00000000..a8efffad--- /dev/null+++ b/registry-artifacts/flow-field.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "flow-field",+ "title": "Flow Field",+ "description": "Hundreds of particles ride a seeded noise field, leaving silky fading trails in a seamless loop.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/flow-field/index.tsx",+ "content": "\"use client\";\n\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type FlowFieldProps = {\n /** Number of particles in flight. */\n particles?: number;\n /** Trail length in simulation steps (frames). */\n trailLength?: number;\n /** Frames for one seamless loop of the field and the particle lifecycles. */\n loopFrames?: number;\n /** Particle lifetime in frames, rounded so it divides loopFrames. */\n lifeFrames?: number;\n /** Share of particles drawn in the accent color, 0 to 1. */\n accentRatio?: number;\n /** Trail width in px at 720p. */\n strokeWidth?: number;\n seed?: number;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nexport const flowFieldDefaults: Required<FlowFieldProps> = {\n particles: 300,\n trailLength: 72,\n loopFrames: 300,\n lifeFrames: 150,\n accentRatio: 0.1,\n strokeWidth: 1.4,\n seed: 1,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst TAU = Math.PI * 2;\nconst WAVES = 4;\n// Distance per frame in units of the short side of the frame.\nconst STEP = 0.0042;\nconst BUCKETS = 6;\n\ntype Wave = {\n fx: number;\n fy: number;\n phase: number;\n drift: number;\n amp: number;\n};\n\nfunction makeField(seed: number) {\n const r = (key: string) => random(`flow-field-${seed}-${key}`);\n const base = r(\"base\") * TAU;\n const waves: Wave[] = Array.from({ length: WAVES }, (_, k) => ({\n fx: (r(`fx${k}`) * 2 - 1) * (0.9 + k * 0.8),\n fy: (r(`fy${k}`) * 2 - 1) * (0.9 + k * 0.8),\n phase: r(`ph${k}`) * TAU,\n drift: 0.6 + r(`dr${k}`) * 0.9,\n amp: 1.6 / (1 + k * 1.4),\n }));\n // Flow angle at (x, y). `tau` walks around a circle once per loop, so the\n // field at the end of the loop is exactly the field at the start.\n return (x: number, y: number, tau: number) => {\n let a = base;\n for (const w of waves) {\n a +=\n w.amp *\n Math.sin(\n w.fx * x + w.fy * y + w.phase + w.drift * Math.sin(tau + w.phase),\n );\n }\n return a;\n };\n}\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\nexport function FlowField({\n particles = flowFieldDefaults.particles,\n trailLength = flowFieldDefaults.trailLength,\n loopFrames = flowFieldDefaults.loopFrames,\n lifeFrames = flowFieldDefaults.lifeFrames,\n accentRatio = flowFieldDefaults.accentRatio,\n strokeWidth = flowFieldDefaults.strokeWidth,\n seed = flowFieldDefaults.seed,\n speed = flowFieldDefaults.speed,\n background = flowFieldDefaults.background,\n color = flowFieldDefaults.color,\n accent = flowFieldDefaults.accent,\n}: FlowFieldProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const field = useMemo(() => makeField(seed), [seed]);\n\n const unit = Math.min(width, height);\n const spanX = width / unit;\n const spanY = height / unit;\n const loop = Math.max(1, Math.round(loopFrames));\n const lives = Math.max(1, Math.round(loop / Math.max(1, lifeFrames)));\n const life = loop / lives;\n const trail = Math.max(2, Math.min(trailLength, life * 0.6));\n const travel = life - trail;\n const time = frame * speed;\n\n const paths = {\n color: new Array<string>(BUCKETS).fill(\"\"),\n accent: new Array<string>(BUCKETS).fill(\"\"),\n };\n const pts: number[] = [];\n\n for (let i = 0; i < particles; i++) {\n const offset = random(`flow-field-${seed}-off-${i}`) * life;\n const local = time + offset;\n const cycle = Math.floor(local / life);\n const age = local - cycle * life;\n // Head moves for `travel` frames, then stops while the tail catches up,\n // so trails grow in and drain out instead of popping.\n const head = Math.min(age, travel);\n const tail = Math.max(0, age - trail);\n if (head - tail < 0.05) continue;\n\n const slot = ((cycle % lives) + lives) % lives;\n const key = `flow-field-${seed}-p${i}-c${slot}`;\n let x = -0.08 + random(`${key}-x`) * (spanX + 0.16);\n let y = -0.08 + random(`${key}-y`) * (spanY + 0.16);\n const birth = time - age;\n\n pts.length = 0;\n pts.push(x, y);\n const steps = Math.ceil(head);\n for (let s = 0; s < steps; s++) {\n const a = field(x, y, (TAU * (birth + s)) / loop);\n x += Math.cos(a) * STEP;\n y += Math.sin(a) * STEP;\n pts.push(x, y);\n }\n const at = (k: number) => {\n const j = Math.min(Math.floor(k), steps - 1);\n const f = k - j;\n if (j < 0) return [pts[0], pts[1]];\n return [\n pts[j * 2] + (pts[j * 2 + 2] - pts[j * 2]) * f,\n pts[j * 2 + 1] + (pts[j * 2 + 3] - pts[j * 2 + 1]) * f,\n ];\n };\n\n const target =\n random(`flow-field-${seed}-accent-${i}`) < accentRatio\n ? paths.accent\n : paths.color;\n // Split the visible trail into age buckets; older buckets are fainter.\n for (let b = 0; b < BUCKETS; b++) {\n const from = Math.max(tail, age - (trail * (b + 1)) / BUCKETS);\n const to = Math.min(head, age - (trail * b) / BUCKETS);\n if (to - from <= 0.01) continue;\n const [fx, fy] = at(from);\n let d = `M ${fmt(fx * unit)} ${fmt(fy * unit)}`;\n for (let k = Math.floor(from) + 1; k < to; k++) {\n d += ` L ${fmt(pts[k * 2] * unit)} ${fmt(pts[k * 2 + 1] * unit)}`;\n }\n const [tx, ty] = at(to);\n d += ` L ${fmt(tx * unit)} ${fmt(ty * unit)} `;\n target[b] += d;\n }\n }\n\n const sw = (strokeWidth * unit) / 720;\n const layers = [\n { key: \"color\", paint: color, list: paths.color },\n { key: \"accent\", paint: accent, list: paths.accent },\n ];\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Flow field\"\n style={{ display: \"block\" }}\n >\n {layers.map((layer) => (\n <g\n key={layer.key}\n fill=\"none\"\n stroke={layer.paint}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n {layer.list.map((d, b) => (\n <path\n key={b}\n d={d}\n strokeOpacity={0.9 * (1 - b / BUCKETS) ** 1.4}\n strokeWidth={sw * (1 - (b / BUCKETS) * 0.5)}\n />\n ))}\n </g>\n ))}\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/flow-field.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/gravity-pile.json b/registry-artifacts/gravity-pile.jsonnew file mode 100644index 00000000..a1cf7605--- /dev/null+++ b/registry-artifacts/gravity-pile.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "gravity-pile",+ "title": "Gravity Pile",+ "description": "Seeded circles, squares and triangles rain down, bounce off the floor and each other, and settle into a heap.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/gravity-pile/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type GravityPileColors = {\n background: string;\n shapes: string[];\n accent: string;\n floor: string;\n};\n\nexport type GravityPileProps = {\n /** Number of falling bodies. */\n count?: number;\n seed?: number;\n /** Gravity multiplier. */\n gravity?: number;\n /** Optional nodes dropped as round bodies, landing on top of the heap. */\n items?: React.ReactNode[];\n colors?: Partial<GravityPileColors>;\n /** Color of the single accent body. Overrides `colors.accent`. */\n accentColor?: string;\n /** Background color. Overrides `colors.background`. */\n backgroundColor?: string;\n speed?: number;\n};\n\nexport const gravityPileDefaults = {\n count: 30,\n seed: 7,\n gravity: 1,\n colors: {\n background: \"#111111\",\n shapes: [\"#FFFFFF\", \"#C9C9C9\", \"#7A7A7A\"],\n accent: \"#E5322D\",\n floor: \"#FFFFFF\",\n } satisfies GravityPileColors,\n speed: 1,\n};\n\ntype Kind = \"circle\" | \"square\" | \"triangle\" | \"item\";\ntype Body = { r: number; kind: Kind; color: number; accent: boolean };\ntype Sim = { bodies: Body[]; frames: Float32Array[]; floor: number };\n\nconst FRAMES = 150;\nconst SUBSTEPS = 10;\nconst ITERATIONS = 4;\nconst BOUNCE = 0.42;\nconst FRICTION = 0.12;\nconst DAMPING = 0.999;\nconst GRIP = 0.45;\nconst SETTLE_FROM = 46;\nconst SETTLE_FRAMES = 18;\n\n// Verlet integration with position-based circle contacts. Runs once per\n// (size, count, seed, gravity), records every frame, and the component only\n// reads the table back.\nfunction simulate(\n width: number,\n height: number,\n count: number,\n seed: number,\n gravity: number,\n itemCount: number,\n): Sim {\n const rnd = (key: string, i: number) =>\n random(`gravity-pile-${seed}-${key}-${i}`);\n const floor = height * 0.9;\n const g = (height / 200) * gravity;\n const dt = 1 / SUBSTEPS;\n // Weaker gravity means a slower rain, so the heap settles later.\n const settleFrom = SETTLE_FROM / Math.sqrt(Math.max(0.2, gravity));\n const kinds: Kind[] = [\"circle\", \"square\", \"triangle\"];\n const accentIndex = Math.max(0, count - itemCount - 3);\n const bodies: Body[] = Array.from({ length: count }, (_, i) => ({\n r: height * (0.036 + rnd(\"r\", i) * 0.032),\n kind: i >= count - itemCount ? \"item\" : kinds[Math.floor(rnd(\"k\", i) * 3)],\n color: Math.floor(rnd(\"c\", i) * 3),\n accent: i === accentIndex,\n }));\n const n = bodies.length;\n const x = new Float64Array(n);\n const y = new Float64Array(n);\n const px = new Float64Array(n);\n const py = new Float64Array(n);\n const angle = new Float64Array(n);\n const spin = new Float64Array(n);\n // Spawn in a tall column above the frame, rejecting overlaps so nothing\n // explodes apart on the first step.\n for (let i = 0; i < n; i++) {\n const r = bodies[i].r;\n const band = height * (0.1 + (i / Math.max(1, n)) * 2);\n for (let attempt = 0; attempt < 40; attempt++) {\n x[i] = width * (0.5 + (rnd(`x${attempt}`, i) - 0.5) * 0.26);\n y[i] = -r - band - rnd(`y${attempt}`, i) * height * 0.25;\n let clear = true;\n for (let j = 0; j < i && clear; j++) {\n const gap = bodies[i].r + bodies[j].r + 2;\n clear = (x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2 > gap * gap;\n }\n if (clear) break;\n }\n px[i] = x[i] - (rnd(\"vx\", i) - 0.5) * 0.6 * dt;\n py[i] = y[i] - height * 0.004 * dt;\n angle[i] = rnd(\"a\", i) * Math.PI * 2;\n spin[i] = (rnd(\"s\", i) - 0.5) * 0.02;\n }\n\n const frames: Float32Array[] = [];\n const record = () => {\n const out = new Float32Array(n * 3);\n for (let i = 0; i < n; i++) {\n out[i * 3] = x[i];\n out[i * 3 + 1] = y[i];\n out[i * 3 + 2] = angle[i];\n }\n frames.push(out);\n };\n record();\n\n for (let f = 1; f <= FRAMES; f++) {\n // Once damped out, the heap sleeps: no more solver creep.\n if (f > settleFrom + SETTLE_FRAMES) {\n frames.push(frames[frames.length - 1]);\n continue;\n }\n for (let s = 0; s < SUBSTEPS; s++) {\n // Late in the sim, bleed energy off so the heap comes fully to rest\n // instead of creeping forever.\n const settle = Math.min(1, Math.max(0, (f - settleFrom) / SETTLE_FRAMES));\n const damping = DAMPING - settle * 0.12;\n for (let i = 0; i < n; i++) {\n const vx = (x[i] - px[i]) * damping;\n const vy = (y[i] - py[i]) * damping;\n px[i] = x[i];\n py[i] = y[i];\n x[i] += vx;\n y[i] += vy + g * dt * dt;\n }\n for (let it = 0; it < ITERATIONS; it++) {\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++) {\n const dx = x[j] - x[i];\n const dy = y[j] - y[i];\n const min = bodies[i].r + bodies[j].r;\n const d2 = dx * dx + dy * dy;\n if (d2 >= min * min || d2 === 0) continue;\n const d = Math.sqrt(d2);\n const push = (min - d) / d;\n const mi = bodies[i].r ** 2;\n const mj = bodies[j].r ** 2;\n const wi = mj / (mi + mj);\n const wj = mi / (mi + mj);\n x[i] -= dx * push * wi;\n y[i] -= dy * push * wi;\n x[j] += dx * push * wj;\n y[j] += dy * push * wj;\n }\n }\n for (let i = 0; i < n; i++) {\n const r = bodies[i].r;\n if (y[i] + r > floor) {\n const vy = y[i] - py[i];\n y[i] = floor - r;\n // Reflect only real impacts so resting bodies do not buzz.\n py[i] = vy > g * dt * 4 ? y[i] + vy * BOUNCE : y[i];\n px[i] = x[i] - (x[i] - px[i]) * (1 - FRICTION);\n }\n if (x[i] - r < 0) {\n x[i] = r;\n px[i] = x[i] + (x[i] - px[i]) * BOUNCE;\n }\n if (x[i] + r > width) {\n x[i] = width - r;\n px[i] = x[i] + (x[i] - px[i]) * BOUNCE;\n }\n }\n }\n // Contact friction: damp relative sliding so bodies stack instead of\n // flowing apart like marbles.\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j < n; j++) {\n const dx = x[j] - x[i];\n const dy = y[j] - y[i];\n const min = bodies[i].r + bodies[j].r + 0.5;\n const d2 = dx * dx + dy * dy;\n if (d2 >= min * min || d2 === 0) continue;\n const d = Math.sqrt(d2);\n const tx = -dy / d;\n const ty = dx / d;\n const rel =\n (x[j] - px[j] - (x[i] - px[i])) * tx +\n (y[j] - py[j] - (y[i] - py[i])) * ty;\n const mi = bodies[i].r ** 2;\n const mj = bodies[j].r ** 2;\n const k = rel * GRIP;\n px[i] -= tx * k * (mj / (mi + mj));\n py[i] -= ty * k * (mj / (mi + mj));\n px[j] += tx * k * (mi / (mi + mj));\n py[j] += ty * k * (mi / (mi + mj));\n }\n }\n for (let i = 0; i < n; i++) {\n const r = bodies[i].r;\n const vx = x[i] - px[i];\n // Bodies near the floor or the heap roll; free-falling ones keep spinning.\n const grounded =\n y[i] + r > floor - 1 || Math.abs(y[i] - py[i]) < g * dt;\n if (grounded) spin[i] = Math.abs(vx) > 0.05 ? vx / r : spin[i] * 0.8;\n angle[i] += spin[i];\n }\n }\n record();\n }\n return { bodies, frames, floor };\n}\n\nfunction Shape({ body, fill }: { body: Body; fill: string }) {\n const r = body.r;\n if (body.kind === \"circle\") return <circle r={r} fill={fill} />;\n if (body.kind === \"square\") {\n const h = r * 0.84;\n return (\n <rect\n x={-h}\n y={-h}\n width={h * 2}\n height={h * 2}\n rx={r * 0.12}\n fill={fill}\n />\n );\n }\n const c = r * 1.12;\n const pts = [0, 1, 2]\n .map((k) => {\n const a = -Math.PI / 2 + (k * Math.PI * 2) / 3;\n return `${(Math.cos(a) * c).toFixed(2)},${(Math.sin(a) * c + r * 0.12).toFixed(2)}`;\n })\n .join(\" \");\n return (\n <polygon\n points={pts}\n fill={fill}\n strokeLinejoin=\"round\"\n stroke={fill}\n strokeWidth={r * 0.14}\n />\n );\n}\n\nexport function GravityPile({\n count = gravityPileDefaults.count,\n seed = gravityPileDefaults.seed,\n gravity = gravityPileDefaults.gravity,\n items,\n colors: colorOverrides,\n accentColor,\n backgroundColor,\n speed = gravityPileDefaults.speed,\n}: GravityPileProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...gravityPileDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n accent: accentColor ?? baseColors.accent,\n background: backgroundColor ?? baseColors.background,\n };\n const itemCount = Math.min(\n items?.length ?? 0,\n Math.max(1, Math.round(count)),\n );\n const sim = useMemo(\n () =>\n simulate(\n width,\n height,\n Math.max(1, Math.round(count)),\n seed,\n gravity,\n itemCount,\n ),\n [width, height, count, seed, gravity, itemCount],\n );\n\n const t = Math.min(FRAMES, Math.max(0, (frame * speed * 30) / fps));\n const f0 = Math.floor(t);\n const f1 = Math.min(FRAMES, f0 + 1);\n const mix = t - f0;\n const a = sim.frames[f0];\n const b = sim.frames[f1];\n const n = sim.bodies.length;\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <line\n x1={0}\n x2={width}\n y1={sim.floor + 1}\n y2={sim.floor + 1}\n stroke={colors.floor}\n strokeOpacity={0.25}\n strokeWidth={2}\n />\n {sim.bodies.map((body, i) => {\n if (body.kind === \"item\") return null;\n const x = a[i * 3] + (b[i * 3] - a[i * 3]) * mix;\n const y = a[i * 3 + 1] + (b[i * 3 + 1] - a[i * 3 + 1]) * mix;\n const rot = a[i * 3 + 2] + (b[i * 3 + 2] - a[i * 3 + 2]) * mix;\n const fill = body.accent\n ? colors.accent\n : colors.shapes[body.color % colors.shapes.length];\n return (\n <g\n key={i}\n transform={`translate(${x.toFixed(2)} ${y.toFixed(2)}) rotate(${((rot * 180) / Math.PI).toFixed(2)})`}\n >\n <Shape body={body} fill={fill} />\n </g>\n );\n })}\n </svg>\n {items?.slice(0, itemCount).map((item, j) => {\n const i = n - itemCount + j;\n const body = sim.bodies[i];\n const x = a[i * 3] + (b[i * 3] - a[i * 3]) * mix;\n const y = a[i * 3 + 1] + (b[i * 3 + 1] - a[i * 3 + 1]) * mix;\n const rot = a[i * 3 + 2] + (b[i * 3 + 2] - a[i * 3 + 2]) * mix;\n return (\n <div\n key={j}\n style={{\n position: \"absolute\",\n left: x - body.r,\n top: y - body.r,\n width: body.r * 2,\n height: body.r * 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `rotate(${rot}rad)`,\n }}\n >\n {item}\n </div>\n );\n })}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/gravity-pile.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/hyperspace.json b/registry-artifacts/hyperspace.jsonnew file mode 100644index 00000000..fcc562c9--- /dev/null+++ b/registry-artifacts/hyperspace.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "hyperspace",+ "title": "Hyperspace",+ "description": "A deterministic starfield stretches into radial streaks, the scene tunnels forward and a white flash at the cut reveals the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/hyperspace/index.tsx",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useVideoConfig,\n} from \"remotion\";\n\nexport type HyperspaceProps = {\n /** Number of stars in the field. */\n stars?: number;\n /** Main streak color. */\n streakColor?: string;\n /** Color of the occasional tinted streak. */\n accentColor?: string;\n /** Share of stars drawn in `accentColor`, 0 to 1. */\n accentRatio?: number;\n /** White flash at the cut. Set false for a hard cut through the streaks. */\n flash?: boolean;\n /** Flash color. */\n flashColor?: string;\n};\n\nexport const hyperspaceDefaults: Required<HyperspaceProps> = {\n stars: 260,\n streakColor: \"#FFFFFF\",\n accentColor: \"#E5322D\",\n accentRatio: 0.14,\n flash: true,\n flashColor: \"#FFFFFF\",\n};\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// Log-radius travel. Stars live on rays from the center and their radius grows\n// as exp(travel), which reads as perspective: slow near the vanishing point,\n// rushing at the edges.\nconst JUMP = 3.2;\nconst COAST = 1.1;\nconst CUT = 0.62;\n// Slow drift the stars cover before the jump kicks in.\nconst SPOOL = 0.22;\nconst MAX_TAIL = 0.94;\n\ntype Star = { angle: number; logR: number; accent: boolean; weight: number };\n\nfunction travelAt(p: number) {\n if (p <= CUT) {\n // Spool up: a slow linear drift that hands over to a quartic surge, so the\n // field starts moving gently instead of lurching.\n const t = p / CUT;\n return { travel: SPOOL * t + (JUMP - SPOOL) * t ** 4, speed: t ** 3 };\n }\n const q = (p - CUT) / (1 - CUT);\n const ease = 1 - (1 - q) ** 2;\n return { travel: JUMP + COAST * ease, speed: 0.7 * (1 - q) };\n}\n\nfunction Starfield({\n stars,\n progress,\n streakColor,\n accentColor,\n opacity,\n stride,\n}: {\n stars: Star[];\n progress: number;\n streakColor: string;\n accentColor: string;\n opacity: number;\n stride: number;\n}) {\n const { width, height } = useVideoConfig();\n const cx = width / 2;\n const cy = height / 2;\n const diag = Math.hypot(width, height) / 2;\n const unit = Math.min(width, height) / 720;\n const { travel, speed } = travelAt(progress);\n // Streak length grows with speed squared.\n const tail = Math.min(MAX_TAIL, 0.006 + MAX_TAIL * speed ** 2);\n\n const lines: React.ReactNode[] = [];\n stars.forEach((star, i) => {\n if (i % stride !== 0) return;\n const r = Math.exp(star.logR + travel);\n const r0 = r * (1 - tail);\n if (r0 > diag * 1.05) return;\n const near = Math.min(1, r / (diag * 0.12));\n const alpha = (0.25 + 0.75 * near) * opacity;\n const cos = Math.cos(star.angle);\n const sin = Math.sin(star.angle);\n lines.push(\n <line\n key={i}\n x1={cx + cos * r0}\n y1={cy + sin * r0}\n x2={cx + cos * r}\n y2={cy + sin * r}\n stroke={star.accent ? accentColor : streakColor}\n strokeOpacity={alpha}\n strokeWidth={(0.8 + star.weight * 2.4 * near) * unit}\n strokeLinecap=\"round\"\n />,\n );\n });\n\n return (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n {lines}\n </svg>\n );\n}\n\nconst HyperspacePresentation: React.FC<\n TransitionPresentationComponentProps<HyperspaceProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n stars: count,\n streakColor,\n accentColor,\n accentRatio,\n flash,\n flashColor,\n } = { ...hyperspaceDefaults, ...passedProps };\n const { width, height } = useVideoConfig();\n const diag = Math.hypot(width, height) / 2;\n const p = presentationProgress;\n\n const stars = useMemo<Star[]>(() => {\n const minLog = Math.log(Math.max(2, diag * 0.015));\n const maxLog = Math.log(diag);\n return Array.from({ length: Math.max(0, Math.round(count)) }, (_, i) => ({\n angle: random(`hyperspace-a-${i}`) * Math.PI * 2,\n logR: minLog + random(`hyperspace-r-${i}`) * (maxLog - minLog),\n accent: random(`hyperspace-c-${i}`) < accentRatio,\n weight: random(`hyperspace-w-${i}`),\n }));\n }, [count, accentRatio, diag]);\n\n if (presentationDirection === \"exiting\") {\n const t = Math.min(1, p / CUT);\n // Quartic push: barely moves while the stars spool up, then surges.\n const push = 1 + 0.42 * t ** 4;\n const dim = interpolate(t, [0, 1], [1, 0.45], {\n ...clamp,\n easing: Easing.in(Easing.quad),\n });\n const fieldIn = interpolate(t, [0, 0.45], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.quad),\n });\n const white = flash\n ? interpolate(t, [0.72, 1], [0, 1], {\n ...clamp,\n easing: Easing.in(Easing.quad),\n })\n : 0;\n return (\n <AbsoluteFill style={{ backgroundColor: \"#000000\", overflow: \"hidden\" }}>\n <AbsoluteFill\n style={{ transform: `scale(${push})`, filter: `brightness(${dim})` }}\n >\n {children}\n </AbsoluteFill>\n <Starfield\n stars={stars}\n progress={Math.min(p, CUT)}\n streakColor={streakColor}\n accentColor={accentColor}\n opacity={fieldIn}\n stride={1}\n />\n <AbsoluteFill style={{ backgroundColor: flashColor, opacity: white }} />\n </AbsoluteFill>\n );\n }\n\n if (p < CUT) {\n return <AbsoluteFill style={{ opacity: 0 }}>{children}</AbsoluteFill>;\n }\n\n // Arrival: the flash holds for a beat, then dissolves slowly while the scene\n // eases out of a slight zoom and soft focus, so the landing feels calm\n // after the jump.\n const q = (p - CUT) / (1 - CUT);\n const unit = Math.min(width, height);\n const soft = Easing.bezier(0.22, 1, 0.36, 1);\n const settle = interpolate(q, [0, 1], [1.06, 1], { ...clamp, easing: soft });\n const blur = interpolate(q, [0, 0.75], [unit * 0.018, 0], {\n ...clamp,\n easing: soft,\n });\n const white = flash\n ? interpolate(q, [0, 0.1, 1], [1, 1, 0], {\n ...clamp,\n easing: Easing.inOut(Easing.sin),\n })\n : 0;\n const fade = interpolate(q, [0, 0.45], [0.8, 0], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n return (\n <AbsoluteFill style={{ overflow: \"hidden\" }}>\n <AbsoluteFill\n style={{\n transform: `scale(${settle})`,\n filter: blur > 0.1 ? `blur(${blur}px)` : undefined,\n }}\n >\n {children}\n </AbsoluteFill>\n <Starfield\n stars={stars}\n progress={p}\n streakColor={streakColor}\n accentColor={accentColor}\n opacity={fade}\n stride={5}\n />\n <AbsoluteFill style={{ backgroundColor: flashColor, opacity: white }} />\n </AbsoluteFill>\n );\n};\n\nexport function hyperspace(\n props: HyperspaceProps = {},\n): TransitionPresentation<HyperspaceProps> {\n return { component: HyperspacePresentation, props };\n}\n",+ "type": "registry:component",+ "target": "components/remocn/hyperspace.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/impact-shake.json b/registry-artifacts/impact-shake.jsonnew file mode 100644index 00000000..b4d898b8--- /dev/null+++ b/registry-artifacts/impact-shake.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "impact-shake",+ "title": "Impact Shake",+ "description": "Heavy content slams in from above with squash, a damped camera jolt, a two-frame RGB split and dust puffs kicking out sideways.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/impact-shake/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useId, useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type ImpactShakeColors = {\n background: string;\n foreground: string;\n splitA: string;\n splitB: string;\n dust: string;\n};\n\nexport type ImpactShakeProps = {\n /** The heavy subject. Defaults to a big white word. */\n children?: React.ReactNode;\n /** Word used when no children are passed. */\n text?: string;\n /** Shake, split and dust strength, 0 to 2. */\n intensity?: number;\n /** Frame (at 30fps) when the subject hits. */\n impact?: number;\n colors?: Partial<ImpactShakeColors>;\n /** Default word and flash color. Overrides `colors.foreground`. */\n foregroundColor?: string;\n /** Background color. Overrides `colors.background`. */\n backgroundColor?: string;\n seed?: number;\n speed?: number;\n};\n\nexport const impactShakeDefaults = {\n text: \"LAUNCH\",\n intensity: 1,\n impact: 7,\n colors: {\n background: \"#111111\",\n foreground: \"#FFFFFF\",\n splitA: \"#FF2A2A\",\n splitB: \"#2A6BFF\",\n dust: \"#D9D9D9\",\n } satisfies ImpactShakeColors,\n seed: 1,\n speed: 1,\n};\n\nconst FONT = \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst DUST = 36;\n\n// Turns any content into a flat silhouette of one color, keeping its alpha.\nfunction tintMatrix(hex: string) {\n const v = Number.parseInt(hex.replace(\"#\", \"\").slice(0, 6), 16);\n const r = ((v >> 16) & 255) / 255;\n const g = ((v >> 8) & 255) / 255;\n const b = (v & 255) / 255;\n return `0 0 0 0 ${r} 0 0 0 0 ${g} 0 0 0 0 ${b} 0 0 0 1 0`;\n}\n\nexport function ImpactShake({\n children,\n text = impactShakeDefaults.text,\n intensity = impactShakeDefaults.intensity,\n impact = impactShakeDefaults.impact,\n colors: colorOverrides,\n foregroundColor,\n backgroundColor,\n seed = impactShakeDefaults.seed,\n speed = impactShakeDefaults.speed,\n}: ImpactShakeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const uid = `impact-shake-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const baseColors = { ...impactShakeDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n foreground: foregroundColor ?? baseColors.foreground,\n background: backgroundColor ?? baseColors.background,\n };\n const t = (frame * speed * 30) / fps;\n const k = Math.max(0, intensity);\n const unit = height / 720;\n const since = t - impact;\n\n // Fall: pure acceleration into the hit, no easing out.\n const fall = interpolate(t, [0, impact], [-height * 0.85, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.in(Easing.quad),\n });\n const falling = since < 0;\n const stretch = falling\n ? interpolate(t, [0, impact], [1, 1.18], { extrapolateRight: \"clamp\" })\n : 1;\n const squash = falling\n ? 0\n : 1 -\n spring({ frame: since, fps: 30, config: { damping: 9, stiffness: 260 } });\n const sx = falling\n ? 1 / Math.sqrt(stretch)\n : 1 + 0.16 * squash * Math.min(1, k);\n const sy = falling ? stretch : 1 - 0.2 * squash * Math.min(1, k);\n\n // Damped camera shake with incommensurate frequencies so it never looks looped.\n const decay = since >= 0 ? Math.exp(-since / 3.2) : 0;\n const phase = random(`impact-shake-${seed}`) * Math.PI * 2;\n const shakeX = decay * Math.sin(since * 2.9 + phase) * 26 * unit * k;\n const shakeY = decay * Math.cos(since * 3.7 + phase) * 34 * unit * k;\n const shakeR = decay * Math.sin(since * 2.3 + phase * 2) * 1.6 * k;\n\n const split =\n since >= 0 && since < 2 ? (1 - since / 2) * 18 * unit * k + 6 * unit : 0;\n const flash = interpolate(since, [0, 0.5, 2.5], [0, 0.12, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const floorY = height * 0.62;\n const dust = useMemo(\n () =>\n Array.from({ length: DUST }, (_, i) => {\n const key = `impact-shake-${seed}-dust-${i}`;\n const side = i % 2 === 0 ? -1 : 1;\n return {\n chip: i % 3 === 0,\n x0: (0.04 + random(`${key}-x`) * 0.24) * side,\n vx: side * (0.4 + random(`${key}-v`) * 1),\n vy: 0.3 + random(`${key}-u`) * 0.9,\n size: 0.5 + random(`${key}-s`) * 0.9,\n life: 11 + random(`${key}-l`) * 9,\n };\n }),\n [seed],\n );\n\n const subject = children ?? (\n <span\n style={{\n fontFamily: FONT,\n fontSize: height * 0.24,\n fontWeight: 900,\n letterSpacing: \"-0.05em\",\n lineHeight: 1,\n color: colors.foreground,\n }}\n >\n {text}\n </span>\n );\n\n const layer = (filter: string | undefined, dx: number, key: string) => (\n <AbsoluteFill\n key={key}\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter,\n transform: `translate(${dx}px, ${fall}px) scale(${sx}, ${sy})`,\n transformOrigin: `50% ${(floorY / height) * 100}%`,\n mixBlendMode: filter ? \"screen\" : undefined,\n }}\n >\n {subject}\n </AbsoluteFill>\n );\n\n return (\n <AbsoluteFill\n style={{ backgroundColor: colors.background, overflow: \"hidden\" }}\n >\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter id={`${uid}-a`} colorInterpolationFilters=\"sRGB\">\n <feColorMatrix type=\"matrix\" values={tintMatrix(colors.splitA)} />\n </filter>\n <filter id={`${uid}-b`} colorInterpolationFilters=\"sRGB\">\n <feColorMatrix type=\"matrix\" values={tintMatrix(colors.splitB)} />\n </filter>\n </svg>\n <AbsoluteFill\n style={{\n transform: `translate(${shakeX}px, ${shakeY}px) rotate(${shakeR}deg) scale(${1 + decay * 0.04 * k})`,\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <filter\n id={`${uid}-puff`}\n x=\"-50%\"\n y=\"-50%\"\n width=\"200%\"\n height=\"200%\"\n >\n <feGaussianBlur stdDeviation={height * 0.007} />\n </filter>\n {since >= 0\n ? dust.map((p, i) => {\n const age = since;\n if (age > p.life) return null;\n const life = age / p.life;\n const spread = Math.max(0.4, k);\n if (p.chip) {\n // Debris: ballistic arc, small and bright.\n const x =\n width / 2 + p.x0 * width + p.vx * age * 10 * unit * spread;\n const y =\n floorY - p.vy * age * 16 * unit + age * age * 1.6 * unit;\n const size = p.size * 6 * unit;\n return (\n <rect\n key={i}\n x={x - size / 2}\n y={y - size / 2}\n width={size}\n height={size}\n fill={colors.dust}\n opacity={(1 - life) * 0.9}\n transform={`rotate(${age * 40 * p.vx} ${x} ${y})`}\n />\n );\n }\n // Puffs: burst outward against heavy drag, then hang and swell.\n const travel = 1 - Math.exp(-age / 3.5);\n const x =\n width / 2 +\n p.x0 * width +\n p.vx * travel * width * 0.16 * spread;\n const y = floorY - p.vy * travel * height * 0.07;\n const r =\n height * p.size * (0.015 + 0.05 * travel + 0.02 * life);\n return (\n <circle\n key={i}\n cx={x}\n cy={y}\n r={r}\n fill={colors.dust}\n opacity={(1 - life) ** 1.4 * 0.38}\n filter={`url(#${uid}-puff)`}\n />\n );\n })\n : null}\n </svg>\n {split > 0 ? (\n <>\n {layer(`url(#${uid}-a)`, -split, \"a\")}\n {layer(`url(#${uid}-b)`, split, \"b\")}\n </>\n ) : null}\n {layer(undefined, 0, \"main\")}\n </AbsoluteFill>\n <AbsoluteFill\n style={{ backgroundColor: colors.foreground, opacity: flash * k }}\n />\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/impact-shake.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/inflate.json b/registry-artifacts/inflate.jsonnew file mode 100644index 00000000..c3de534e--- /dev/null+++ b/registry-artifacts/inflate.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "inflate",+ "title": "Inflate",+ "description": "A deflated red sliver puffs up like a balloon toy, overshoots, squashes wide and settles into a glossy rounded mark.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/inflate/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type InflateProps = {\n /** Wordmark revealed beside the mark once it settles. */\n children?: React.ReactNode;\n backgroundColor?: string;\n /** Body color of the mark. */\n color?: string;\n /** Specular highlight color. */\n highlight?: string;\n /** Dot inside the mark. */\n dotColor?: string;\n speed?: number;\n};\n\nexport const inflateDefaults = {\n backgroundColor: \"#111111\",\n color: \"#E5322D\",\n highlight: \"#FFFFFF\",\n dotColor: \"#111111\",\n speed: 1,\n};\n\nconst PUFF = 3;\nconst WOBBLE = 10;\nconst DOT = 15;\nconst SLIDE = 22;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport function Inflate(props: InflateProps) {\n const { children, backgroundColor, color, highlight, dotColor, speed } = {\n ...inflateDefaults,\n ...props,\n };\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const size = Math.round(Math.min(width, height) * 0.22);\n\n // Main puff: an underdamped spring overshoots the final size.\n const puff = spring({\n frame: t - PUFF,\n fps,\n config: { damping: 8, stiffness: 150, mass: 0.6 },\n });\n // After the peak the body squashes wide and rings out like a balloon.\n const w0 = t - WOBBLE;\n const wobble =\n w0 > 0 ? 0.2 * Math.exp(-w0 / 6) * Math.sin((w0 / 9) * Math.PI * 2) : 0;\n\n const grow = Math.max(0, puff);\n const sliverW = interpolate(t, [0, PUFF], [0.7, 1], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n const bodyH = size * (0.05 + 0.95 * grow) * (1 - wobble);\n const bodyW = size * (sliverW + (Math.max(1, grow) - 1) * 0.8) * (1 + wobble);\n const roundness = interpolate(t, [PUFF, PUFF + 7, 26], [0.5, 0.46, 0.27], {\n ...clamp,\n easing: Easing.inOut(Easing.quad),\n });\n const radius = Math.min(bodyW, bodyH) * roundness;\n const gloss = interpolate(t, [PUFF + 2, PUFF + 9], [0, 1], clamp);\n const appear = interpolate(t, [0, 2], [0, 1], clamp);\n\n const dot = spring({\n frame: t - DOT,\n fps,\n config: { damping: 10, stiffness: 220, mass: 0.5 },\n });\n const slide = interpolate(t, [SLIDE, SLIDE + 11], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const reveal = interpolate(t, [SLIDE + 2, SLIDE + 13], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size * 0.24,\n transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,\n }}\n >\n <div\n style={{\n width: size,\n height: size,\n flexShrink: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n flexShrink: 0,\n width: bodyW,\n height: bodyH,\n borderRadius: radius,\n backgroundColor: color,\n opacity: appear,\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n boxShadow: `inset ${-size * 0.06}px ${-size * 0.08}px ${size * 0.14}px rgba(0,0,0,${0.28 * gloss})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: \"14%\",\n top: \"10%\",\n width: \"46%\",\n height: \"28%\",\n borderRadius: \"50%\",\n background: `radial-gradient(ellipse at 45% 40%, ${highlight} 0%, transparent 70%)`,\n opacity: 0.55 * gloss,\n transform: \"rotate(-18deg)\",\n }}\n />\n <div\n style={{\n width: size * 0.3,\n height: size * 0.3,\n borderRadius: \"50%\",\n backgroundColor: dotColor,\n transform: `scale(${dot})`,\n }}\n />\n </div>\n </div>\n {children && (\n <div\n style={{\n opacity: reveal,\n clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,\n transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,\n }}\n >\n {children}\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/inflate.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/iris-wipe.json b/registry-artifacts/iris-wipe.jsonnew file mode 100644index 00000000..d024f137--- /dev/null+++ b/registry-artifacts/iris-wipe.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "iris-wipe",+ "title": "Iris Wipe",+ "description": "An old-cartoon iris closes on the subject, holds a beat as a dot, then opens on the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/iris-wipe/index.tsx",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nexport type IrisWipeProps = {\n /** Fill shown outside the iris while it is closed. */\n color?: string;\n /** Horizontal iris center, 0 to 1. */\n centerX?: number;\n /** Vertical iris center, 0 to 1. */\n centerY?: number;\n /** Radius of the held dot, as a percentage of the frame diagonal. */\n holdRadius?: number;\n};\n\nexport const irisWipeDefaults: Required<IrisWipeProps> = {\n color: \"#000000\",\n centerX: 0.5,\n centerY: 0.5,\n holdRadius: 12,\n};\n\n// circle() percentages resolve against the diagonal / sqrt(2), so 150% covers\n// the frame from any center point.\nconst COVER = 150;\n// Progress at which the iris is fully shut and starts opening on the next scene.\nconst CUT = 0.5;\n\n// One smooth curve instead of keyframes: the circle rushes in from off-frame,\n// lingers as a slowly shrinking dot and snaps shut, without ever standing\n// still. Easing each keyframe segment separately drops the speed to zero at\n// every key, which reads as a stall.\nfunction closingRadius(u: number, hold: number) {\n return hold * (1 - u ** 3) + (COVER - hold) * (1 - u) ** 5;\n}\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst IrisWipePresentation: React.FC<\n TransitionPresentationComponentProps<IrisWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { color, centerX, centerY, holdRadius } = {\n ...irisWipeDefaults,\n ...passedProps,\n };\n const p = presentationProgress;\n const at = `${centerX * 100}% ${centerY * 100}%`;\n\n if (presentationDirection === \"exiting\") {\n const radius = closingRadius(Math.min(1, p / CUT), holdRadius);\n return (\n <AbsoluteFill style={{ backgroundColor: color }}>\n <AbsoluteFill style={{ clipPath: `circle(${radius}% at ${at})` }}>\n {children}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n }\n\n const radius = interpolate(p, [CUT, 1], [0, COVER], {\n ...clamp,\n easing: Easing.bezier(0.45, 0, 0.75, 0.6),\n });\n return (\n <AbsoluteFill style={{ clipPath: `circle(${radius}% at ${at})` }}>\n {children}\n </AbsoluteFill>\n );\n};\n\nexport function irisWipe(\n props: IrisWipeProps = {},\n): TransitionPresentation<IrisWipeProps> {\n return { component: IrisWipePresentation, props };\n}\n",+ "type": "registry:component",+ "target": "components/remocn/iris-wipe.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/isometric-build.json b/registry-artifacts/isometric-build.jsonnew file mode 100644index 00000000..5da91a06--- /dev/null+++ b/registry-artifacts/isometric-build.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "isometric-build",+ "title": "Isometric Build",+ "description": "An isometric tile grid springs up row by row into a stepped block sculpture with one accent tower, then holds.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/isometric-build/index.tsx",+ "content": "\"use client\";\n\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n random,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type IsometricBuildProps = {\n /** Tiles per side. */\n grid?: number;\n /** Tallest regular block, in tile widths. The accent tower rises above it. */\n maxHeight?: number;\n /** Frames between consecutive diagonals rising. */\n stagger?: number;\n seed?: number;\n speed?: number;\n background?: string;\n /** Block color; side faces are this color shaded toward the background. */\n color?: string;\n /** The single accent tower. */\n accent?: string;\n /** Draw floor lines on the block faces. */\n floors?: boolean;\n /** Gap between neighbouring blocks, as a share of a tile. */\n gap?: number;\n};\n\nexport const isometricBuildDefaults: Required<IsometricBuildProps> = {\n grid: 5,\n maxHeight: 2.2,\n stagger: 2,\n seed: 4,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n floors: true,\n gap: 0.04,\n};\n\n// True isometric: tile half-height = half-width · tan 30°, unit vertical edge\n// matches the projected tile edge.\nconst ISO_Y = Math.tan(Math.PI / 6);\nconst ISO_Z = 1 / Math.cos(Math.PI / 6);\nconst FLOOR = 0.42;\nconst SHADE_LEFT = 0.32;\nconst SHADE_RIGHT = 0.6;\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\ntype Block = {\n i: number;\n j: number;\n height: number;\n accent: boolean;\n delay: number;\n};\n\nfunction makeBlocks(\n n: number,\n maxHeight: number,\n seed: number,\n stagger: number,\n) {\n const r = (key: string) => random(`isometric-build-${seed}-${key}`);\n const inner = Math.max(1, n - 2);\n const ai = n > 2 ? 1 + Math.floor(r(\"ai\") * inner) : 0;\n const aj = n > 2 ? 1 + Math.floor(r(\"aj\") * inner) : 0;\n const blocks: Block[] = [];\n // Painter order: back (i + j small) to front.\n for (let sum = 0; sum <= 2 * (n - 1); sum++) {\n for (let i = 0; i < n; i++) {\n const j = sum - i;\n if (j < 0 || j >= n) continue;\n const accent = i === ai && j === aj;\n // One compact mass: heights follow a mound that peaks in the middle,\n // with a little seeded variation, snapped to whole floors so the\n // blocks stack like a single stepped sculpture rather than noise.\n const c = (n - 1) / 2;\n const centre = 1 - Math.hypot(i - c, j - c) / (Math.hypot(c, c) || 1);\n const raw =\n maxHeight *\n (0.2 + 0.8 * centre ** 1.3) *\n (0.75 + 0.5 * r(`h${i}-${j}`));\n const h = Math.max(FLOOR, Math.round(raw / FLOOR) * FLOOR);\n blocks.push({\n i,\n j,\n accent,\n height: accent ? maxHeight * 1.35 : h,\n // Front rows rise first.\n delay: (2 * (n - 1) - sum) * stagger + r(`d${i}-${j}`) * stagger,\n });\n }\n }\n return blocks;\n}\n\nexport function IsometricBuild({\n grid = isometricBuildDefaults.grid,\n maxHeight = isometricBuildDefaults.maxHeight,\n stagger = isometricBuildDefaults.stagger,\n seed = isometricBuildDefaults.seed,\n speed = isometricBuildDefaults.speed,\n background = isometricBuildDefaults.background,\n color = isometricBuildDefaults.color,\n accent = isometricBuildDefaults.accent,\n floors = isometricBuildDefaults.floors,\n gap = isometricBuildDefaults.gap,\n}: IsometricBuildProps) {\n const inset = Math.min(0.45, Math.max(0, gap)) / 2;\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const n = Math.max(1, Math.round(grid));\n const blocks = useMemo(\n () => makeBlocks(n, maxHeight, seed, stagger),\n [n, maxHeight, seed, stagger],\n );\n\n const tallest = maxHeight * 1.35;\n // Fit the diamond plus the tallest tower into the frame.\n const a = Math.min(\n (width * 0.64) / (2 * n),\n (height * 0.8) / (2 * n * ISO_Y + tallest * ISO_Z),\n );\n const b = a * ISO_Y;\n const hz = a * ISO_Z;\n const top = (height - (2 * n * b + tallest * hz)) / 2 + tallest * hz;\n const cx = width / 2;\n const P = (u: number, v: number, z: number) =>\n `${fmt(cx + (u - v) * a)} ${fmt(top + (u + v) * b - z * hz)}`;\n const poly = (...pts: string[]) => `M ${pts.join(\" L \")} Z`;\n\n const unit = Math.min(width, height) / 720;\n const time = frame * speed;\n\n let ground = \"\";\n for (let k = 0; k <= n; k++) {\n ground += `M ${P(k, 0, 0)} L ${P(k, n, 0)} M ${P(0, k, 0)} L ${P(n, k, 0)} `;\n }\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Isometric city build\"\n style={{ display: \"block\" }}\n >\n <path\n d={ground}\n fill=\"none\"\n stroke={color}\n strokeOpacity={0.12}\n strokeWidth={unit}\n />\n {blocks.map((block) => {\n const s = spring({\n frame: time - block.delay,\n fps,\n config: { damping: 11, stiffness: 140, mass: 0.7 },\n });\n const opacity = interpolate(s, [0, 0.15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n if (opacity <= 0) return null;\n const h = Math.max(0.02, block.height * s);\n const u0 = block.i + inset;\n const u1 = block.i + 1 - inset;\n const v0 = block.j + inset;\n const v1 = block.j + 1 - inset;\n const fill = block.accent ? accent : color;\n const left = poly(\n P(u0, v1, 0),\n P(u1, v1, 0),\n P(u1, v1, h),\n P(u0, v1, h),\n );\n const right = poly(\n P(u1, v0, 0),\n P(u1, v1, 0),\n P(u1, v1, h),\n P(u1, v0, h),\n );\n const roof = poly(\n P(u0, v0, h),\n P(u1, v0, h),\n P(u1, v1, h),\n P(u0, v1, h),\n );\n let lines = \"\";\n if (floors) {\n for (let z = FLOOR; z < h - FLOOR * 0.5; z += FLOOR) {\n lines += `M ${P(u0, v1, z)} L ${P(u1, v1, z)} L ${P(u1, v0, z)} `;\n }\n }\n return (\n <g key={`${block.i}-${block.j}`} opacity={opacity}>\n <path d={left} fill={fill} />\n <path d={left} fill={background} fillOpacity={SHADE_LEFT} />\n <path d={right} fill={fill} />\n <path d={right} fill={background} fillOpacity={SHADE_RIGHT} />\n {lines ? (\n <path\n d={lines}\n fill=\"none\"\n stroke={background}\n strokeOpacity={0.35}\n strokeWidth={unit * 1.2}\n />\n ) : null}\n <path\n d={roof}\n fill={fill}\n stroke={background}\n strokeOpacity={0.5}\n strokeWidth={unit}\n strokeLinejoin=\"round\"\n />\n </g>\n );\n })}\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/isometric-build.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/life-grid.json b/registry-artifacts/life-grid.jsonnew file mode 100644index 00000000..9a56824f--- /dev/null+++ b/registry-artifacts/life-grid.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "life-grid",+ "title": "Life Grid",+ "description": "Conway's Game of Life plays out on a seeded grid, with newborn cells flashing in the accent.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/life-grid/index.tsx",+ "content": "\"use client\";\n\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type LifeGridProps = {\n /** Columns; rows follow the frame aspect ratio. */\n cols?: number;\n /** Share of cells alive in the seeded first generation, 0 to 1. */\n density?: number;\n /** Frames each generation is held. */\n framesPerGeneration?: number;\n /** Gap between tiles, as a fraction of the cell. */\n gap?: number;\n /** Draw the faint lattice of empty cells. */\n showGrid?: boolean;\n seed?: number;\n speed?: number;\n background?: string;\n /** Living cells. */\n color?: string;\n /** Flash color for newborn cells. */\n accent?: string;\n};\n\nexport const lifeGridDefaults: Required<LifeGridProps> = {\n cols: 48,\n density: 0.24,\n framesPerGeneration: 5,\n gap: 0.16,\n showGrid: true,\n seed: 7,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\nconst grow = Easing.out(Easing.back(2));\nconst shrink = Easing.in(Easing.cubic);\nconst settle = Easing.inOut(Easing.cubic);\n\n// Generations are a pure function of the seed and grid size; computed once and\n// shared across frames (and component instances) of a render.\nconst cache = new Map<string, Uint8Array[]>();\n\nfunction generations(\n cols: number,\n rows: number,\n density: number,\n seed: number,\n count: number,\n) {\n const key = `${cols}x${rows}|${density}|${seed}`;\n const known = cache.get(key);\n if (known && known.length >= count) return known;\n const list: Uint8Array[] = known ?? [];\n if (list.length === 0) {\n const first = new Uint8Array(cols * rows);\n for (let i = 0; i < first.length; i++) {\n first[i] = random(`life-grid-${seed}-${i}`) < density ? 1 : 0;\n }\n list.push(first);\n }\n while (list.length < count) {\n const prev = list[list.length - 1];\n const next = new Uint8Array(cols * rows);\n for (let y = 0; y < rows; y++) {\n for (let x = 0; x < cols; x++) {\n let n = 0;\n for (let dy = -1; dy <= 1; dy++) {\n for (let dx = -1; dx <= 1; dx++) {\n if (dx === 0 && dy === 0) continue;\n // Wrap around the edges (torus) so the board never runs dry at the border.\n const xx = (x + dx + cols) % cols;\n const yy = (y + dy + rows) % rows;\n n += prev[yy * cols + xx];\n }\n }\n const alive = prev[y * cols + x] === 1;\n next[y * cols + x] = n === 3 || (alive && n === 2) ? 1 : 0;\n }\n }\n list.push(next);\n }\n if (cache.size > 16) cache.clear();\n cache.set(key, list);\n return list;\n}\n\nexport function LifeGrid({\n cols = lifeGridDefaults.cols,\n density = lifeGridDefaults.density,\n framesPerGeneration = lifeGridDefaults.framesPerGeneration,\n gap = lifeGridDefaults.gap,\n showGrid = lifeGridDefaults.showGrid,\n seed = lifeGridDefaults.seed,\n speed = lifeGridDefaults.speed,\n background = lifeGridDefaults.background,\n color = lifeGridDefaults.color,\n accent = lifeGridDefaults.accent,\n}: LifeGridProps) {\n const frame = useCurrentFrame();\n const { width, height, durationInFrames } = useVideoConfig();\n const nx = Math.max(4, Math.round(cols));\n const ny = Math.max(4, Math.round((nx * height) / width));\n const fpg = Math.max(1, framesPerGeneration);\n const total = Math.ceil((durationInFrames * Math.max(0, speed)) / fpg) + 2;\n const gens = useMemo(\n () => generations(nx, ny, density, seed, total),\n [nx, ny, density, seed, total],\n );\n\n const cell = Math.min(width / nx, height / ny);\n const ox = (width - cell * nx) / 2;\n const oy = (height - cell * ny) / 2;\n const tile = cell * (1 - gap);\n\n const time = Math.max(0, frame * speed);\n const g = Math.min(gens.length - 1, Math.floor(time / fpg));\n const local = Math.min(1, (time - g * fpg) / fpg);\n const now = gens[g];\n const before = g > 0 ? gens[g - 1] : now;\n\n const square = (index: number, size: number) => {\n const x = ox + (index % nx) * cell + (cell - size) / 2;\n const y = oy + Math.floor(index / nx) * cell + (cell - size) / 2;\n const s = fmt(size);\n return `M ${fmt(x)} ${fmt(y)} h ${s} v ${s} h ${-s} Z `;\n };\n\n const bornSize = tile * (0.35 + 0.65 * grow(local));\n const dyingSize = tile * (1 - shrink(Math.min(1, local * 1.6)));\n let lattice = \"\";\n let alive = \"\";\n let fresh = \"\";\n // Newborns pop in as accent tiles, then a white tile grows from their\n // centre: a crisp flash with no pink cross-fade in between.\n const coreSize =\n tile * settle(Math.min(1, Math.max(0, (local - 0.35) / 0.65)));\n for (let i = 0; i < now.length; i++) {\n if (showGrid) lattice += square(i, tile);\n if (now[i]) {\n if (!before[i] && g > 0) {\n fresh += square(i, bornSize);\n if (coreSize > 0.5) alive += square(i, coreSize);\n } else {\n alive += square(i, tile);\n }\n } else if (before[i] && dyingSize > 0.5) {\n alive += square(i, dyingSize);\n }\n }\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Game of Life grid\"\n style={{ display: \"block\" }}\n >\n {showGrid ? <path d={lattice} fill={color} fillOpacity={0.05} /> : null}\n <path d={fresh} fill={accent} />\n <path d={alive} fill={color} />\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/life-grid.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/light-leak.json b/registry-artifacts/light-leak.jsonnew file mode 100644index 00000000..94cd5da6--- /dev/null+++ b/registry-artifacts/light-leak.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "light-leak",+ "title": "Light Leak",+ "description": "A warm analog light leak drifts in from an edge and blows the frame out to near-white at the cut, then cools off to reveal the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/light-leak/index.tsx",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate, useVideoConfig } from \"remotion\";\n\nexport type LightLeakOrigin = \"left\" | \"right\" | \"top\" | \"bottom\";\n\nexport type LightLeakProps = {\n /** Leak colors, warmest first. The last one is the blow-out tint. */\n colors?: string[];\n /** Edge the leak drifts in from. */\n origin?: LightLeakOrigin;\n /** Strength of the leak and the blow-out, 0 to 1. */\n intensity?: number;\n};\n\nexport const lightLeakDefaults: Required<LightLeakProps> = {\n colors: [\"#FF5A1F\", \"#E5322D\", \"#FFB347\", \"#FFF3E0\"],\n origin: \"left\",\n intensity: 1,\n};\n\n// Each flare: offset along the drift axis, position across it, size, strength.\nconst FLARES = [\n { along: 0, across: 0.3, size: 0.85, alpha: 1 },\n { along: -0.18, across: 0.78, size: 0.7, alpha: 0.85 },\n { along: 0.12, across: 0.55, size: 0.55, alpha: 0.9 },\n { along: -0.32, across: 0.12, size: 0.6, alpha: 0.7 },\n { along: 0.05, across: 0.95, size: 0.5, alpha: 0.6 },\n];\n// Heat of the leak: ramps into the cut, then cools off more slowly.\nfunction heat(p: number) {\n if (p <= 0.5) return Easing.in(Easing.quad)(p / 0.5);\n return 1 - Easing.out(Easing.quad)((p - 0.5) / 0.5);\n}\n\nfunction Leak({\n p,\n colors,\n origin,\n intensity,\n}: {\n p: number;\n colors: string[];\n origin: LightLeakOrigin;\n intensity: number;\n}) {\n const { width, height } = useVideoConfig();\n const k = heat(p) * intensity;\n const span = Math.max(width, height);\n const drift = interpolate(p, [0, 1], [-0.25, 1.05], {\n easing: Easing.bezier(0.3, 0.1, 0.5, 0.9),\n });\n const palette = colors.length > 0 ? colors : lightLeakDefaults.colors;\n const blowout = palette[palette.length - 1];\n // A narrow peak right at the cut takes the frame to near-white.\n const flash = Math.exp(-(((p - 0.5) / 0.1) ** 2)) * intensity;\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {FLARES.map((f, i) => {\n let along = drift + f.along;\n if (origin === \"right\" || origin === \"bottom\") along = 1 - along;\n const horizontal = origin === \"left\" || origin === \"right\";\n const x = (horizontal ? along : f.across) * width;\n const y = (horizontal ? f.across : along) * height;\n const color = palette[i % Math.max(1, palette.length - 1)];\n return (\n <AbsoluteFill\n key={f.across}\n style={{\n mixBlendMode: \"screen\",\n // sqrt keeps the leak hot as it enters; drift, not fade, sells it.\n opacity: Math.min(1, Math.sqrt(k) * f.alpha * 1.1),\n background: `radial-gradient(circle ${span * f.size}px at ${x}px ${y}px, color-mix(in srgb, ${color} 55%, ${blowout}) 0%, ${color} 22%, color-mix(in srgb, ${color} 55%, transparent) 45%, transparent 72%)`,\n }}\n />\n );\n })}\n <AbsoluteFill\n style={{ backgroundColor: blowout, opacity: Math.min(0.96, flash) }}\n />\n </AbsoluteFill>\n );\n}\n\nconst LightLeakPresentation: React.FC<\n TransitionPresentationComponentProps<LightLeakProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { colors, origin, intensity } = {\n ...lightLeakDefaults,\n ...passedProps,\n };\n const p = presentationProgress;\n const k = heat(p) * intensity;\n // Hard cut under the blow-out: the incoming scene owns the frame from 0.5.\n const visible = presentationDirection === \"exiting\" ? p < 0.5 : p >= 0.5;\n\n return (\n <AbsoluteFill style={{ opacity: visible ? 1 : 0 }}>\n <AbsoluteFill\n style={{\n // Squared so the picture only burns out close to the cut.\n filter: `brightness(${1 + k * k * 1.6}) saturate(${1 + k * 0.4})`,\n }}\n >\n {children}\n </AbsoluteFill>\n {visible && k > 0.001 ? (\n <Leak p={p} colors={colors} origin={origin} intensity={intensity} />\n ) : null}\n </AbsoluteFill>\n );\n};\n\nexport function lightLeak(\n props: LightLeakProps = {},\n): TransitionPresentation<LightLeakProps> {\n return { component: LightLeakPresentation, props };\n}\n",+ "type": "registry:component",+ "target": "components/remocn/light-leak.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/line-boil.json b/registry-artifacts/line-boil.jsonnew file mode 100644index 00000000..f5b65550--- /dev/null+++ b/registry-artifacts/line-boil.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "line-boil",+ "title": "Line Boil",+ "description": "A hand-drawn outline boils like a cel animation, redrawn every few frames with a varying pen weight, then fills with color while it keeps boiling.",+ "dependencies": ["remotion", "@remotion/paths"],+ "files": [+ {+ "path": "registry/remocn/line-boil/index.tsx",+ "content": "\"use client\";\n\nimport { getLength, getPointAtLength } from \"@remotion/paths\";\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type LineBoilColors = {\n line: string;\n fill: string;\n background: string;\n};\n\nexport type LineBoilProps = {\n /** Closed outline as SVG path data, any coordinate space. Fitted to the frame. Defaults to a 5-point star. */\n path?: string;\n /** Frames each drawing holds before the next one (\"on threes\" by default). */\n boilEvery?: number;\n /** Distinct drawings the boil cycles through. */\n drawings?: number;\n /** Wobble strength; 1 is a gentle hand-drawn boil. */\n amplitude?: number;\n /** Base line weight in px at 720p. */\n strokeWidth?: number;\n /** Shape size as a fraction of the short frame side. */\n size?: number;\n colors?: Partial<LineBoilColors>;\n /** Outline color. Overrides `colors.line` when set. */\n line?: string;\n /** Shape fill. Overrides `colors.fill` when set. */\n fill?: string;\n /** Background. Overrides `colors.background` when set. */\n background?: string;\n speed?: number;\n};\n\nconst starPath = (() => {\n const points = Array.from({ length: 10 }, (_, i) => {\n const r = i % 2 === 0 ? 100 : 40;\n const a = (-90 + i * 36) * (Math.PI / 180);\n return `${(100 + r * Math.cos(a)).toFixed(2)} ${(100 + r * Math.sin(a)).toFixed(2)}`;\n });\n return `M ${points.join(\" L \")} Z`;\n})();\n\nexport const lineBoilDefaults = {\n path: starPath,\n boilEvery: 3,\n drawings: 3,\n amplitude: 1,\n strokeWidth: 9,\n size: 0.66,\n colors: {\n line: \"#111111\",\n fill: \"#E5322D\",\n background: \"#FFFFFF\",\n } as LineBoilColors,\n speed: 1,\n};\n\nconst SAMPLES = 160;\nconst DRAW_END = 22;\nconst FILL_START = 28;\nconst FILL_END = 40;\nexport const lineBoilLength = FILL_END;\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype Point = { x: number; y: number };\n\n// Low-frequency integer harmonics keep the closed loop seamless while giving\n// the slow, rubbery wobble of a re-traced cel line.\nfunction boil(points: Point[], seed: string, amp: number): Point[] {\n const harmonics = [2, 4, 9, 15].map((k, j) => ({\n k,\n weight: [1, 0.7, 0.45, 0.3][j],\n px: random(`${seed}-px-${k}`) * Math.PI * 2,\n py: random(`${seed}-py-${k}`) * Math.PI * 2,\n }));\n return points.map((p, i) => {\n const s = i / points.length;\n let dx = 0;\n let dy = 0;\n for (const h of harmonics) {\n dx += h.weight * Math.sin(Math.PI * 2 * h.k * s + h.px);\n dy += h.weight * Math.sin(Math.PI * 2 * h.k * s + h.py);\n }\n const nx = random(`${seed}-nx-${i}`) - 0.5;\n const ny = random(`${seed}-ny-${i}`) - 0.5;\n return {\n x: p.x + amp * (dx * 0.6 + nx * 0.14),\n y: p.y + amp * (dy * 0.6 + ny * 0.14),\n };\n });\n}\n\nexport function LineBoil({\n path = lineBoilDefaults.path,\n boilEvery = lineBoilDefaults.boilEvery,\n drawings = lineBoilDefaults.drawings,\n amplitude = lineBoilDefaults.amplitude,\n strokeWidth = lineBoilDefaults.strokeWidth,\n size = lineBoilDefaults.size,\n colors,\n line: lineColor,\n fill: fillColor,\n background: backgroundColor,\n speed = lineBoilDefaults.speed,\n}: LineBoilProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const merged = { ...lineBoilDefaults.colors, ...colors };\n const palette: LineBoilColors = {\n line: lineColor ?? merged.line,\n fill: fillColor ?? merged.fill,\n background: backgroundColor ?? merged.background,\n };\n const t = (frame / fps) * 30 * speed;\n const unit = Math.min(width, height) / 720;\n\n const base = useMemo(() => {\n const length = getLength(path);\n const raw = Array.from(\n { length: SAMPLES },\n (_, i) =>\n getPointAtLength(path, (length * i) / SAMPLES) ?? { x: 0, y: 0 },\n );\n const xs = raw.map((p) => p.x);\n const ys = raw.map((p) => p.y);\n const minX = Math.min(...xs);\n const minY = Math.min(...ys);\n const bw = Math.max(...xs) - minX;\n const bh = Math.max(...ys) - minY;\n const scale = (size * Math.min(width, height)) / Math.max(bw, bh, 1e-6);\n const ox = width / 2 - (bw * scale) / 2;\n const oy = height / 2 - (bh * scale) / 2;\n return raw.map((p) => ({\n x: ox + (p.x - minX) * scale,\n y: oy + (p.y - minY) * scale,\n }));\n }, [path, size, width, height]);\n\n const drawing =\n Math.floor(t / Math.max(1, boilEvery)) % Math.max(1, drawings);\n const amp = amplitude * 6.5 * unit;\n const line = boil(base, `line-boil-${drawing}`, amp);\n const fillShape = boil(base, `line-boil-fill-${drawing}`, amp * 1.4);\n\n const draw = interpolate(t, [0, DRAW_END], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const visible = Math.round(draw * SAMPLES);\n const fill = interpolate(t, [FILL_START, FILL_END], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.back(1.6)),\n });\n\n const cx = base.reduce((sum, p) => sum + p.x, 0) / base.length;\n const cy = base.reduce((sum, p) => sum + p.y, 0) / base.length;\n const pressurePhase = random(`line-boil-pressure-${drawing}`) * Math.PI * 2;\n\n return (\n <AbsoluteFill style={{ backgroundColor: palette.background }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Boiling hand-drawn outline\"\n >\n {fill > 0 ? (\n <polygon\n points={fillShape.map((p) => `${p.x},${p.y}`).join(\" \")}\n fill={palette.fill}\n transform={`translate(${cx} ${cy}) scale(${fill}) translate(${-cx} ${-cy})`}\n />\n ) : null}\n <g stroke={palette.line} strokeLinecap=\"round\" fill=\"none\">\n {line.slice(0, visible).map((p, i) => {\n const next = line[(i + 1) % line.length];\n const s = i / SAMPLES;\n const pressure =\n 0.75 +\n 0.25 * Math.sin(Math.PI * 2 * 3 * s + pressurePhase) +\n 0.12 * Math.sin(Math.PI * 2 * 7 * s - pressurePhase);\n // Taper the pen in and out while the line is still being drawn.\n const taper =\n draw < 1 ? Math.min(1, (visible - i) / 10, (i + 4) / 10) : 1;\n return (\n <line\n key={i}\n x1={p.x}\n y1={p.y}\n x2={next.x}\n y2={next.y}\n strokeWidth={strokeWidth * unit * pressure * taper}\n />\n );\n })}\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/line-boil.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/liquid-fill.json b/registry-artifacts/liquid-fill.jsonnew file mode 100644index 00000000..d4dab554--- /dev/null+++ b/registry-artifacts/liquid-fill.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "liquid-fill",+ "title": "Liquid Fill",+ "description": "A drop falls into an outlined mark and liquid rises with a sloshing, damping surface and bubbles until the mark is solid.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/liquid-fill/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n interpolateColors,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type LiquidFillProps = {\n /** Wordmark revealed beside the mark once it is full. */\n children?: React.ReactNode;\n /** Mark outline as SVG path data inside a 100x100 box. Defaults to a rounded square. */\n shape?: string;\n backgroundColor?: string;\n liquidColor?: string;\n outlineColor?: string;\n /** Bubble outline color. */\n bubbleColor?: string;\n speed?: number;\n};\n\nconst ROUNDED_SQUARE =\n \"M 27 2 H 73 A 25 25 0 0 1 98 27 V 73 A 25 25 0 0 1 73 98 H 27 A 25 25 0 0 1 2 73 V 27 A 25 25 0 0 1 27 2 Z\";\n\nexport const liquidFillDefaults = {\n shape: ROUNDED_SQUARE,\n backgroundColor: \"#111111\",\n liquidColor: \"#E5322D\",\n outlineColor: \"#FFFFFF\",\n bubbleColor: \"#FFFFFF\",\n speed: 1,\n};\n\nconst LAND = 9;\nconst FULL = 34;\nconst SLIDE = 36;\nconst BUBBLES = 6;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport function LiquidFill(props: LiquidFillProps) {\n const {\n children,\n shape,\n backgroundColor,\n liquidColor,\n outlineColor,\n bubbleColor,\n speed,\n } = { ...liquidFillDefaults, ...props };\n const uid = `liquid-fill-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const size = Math.round(Math.min(width, height) * 0.24);\n\n // Drop falls from above the mark and lands on the floor of the shape.\n const fall = interpolate(t, [0, LAND], [0, 1], {\n ...clamp,\n easing: Easing.in(Easing.quad),\n });\n const dropY = -70 + fall * 142;\n const dropStretch = 1 + 0.5 * fall;\n\n const level = interpolate(t, [LAND, FULL], [100, -12], {\n ...clamp,\n easing: Easing.bezier(0.35, 0, 0.35, 1),\n });\n const since = Math.max(0, t - LAND);\n const amp =\n t < LAND\n ? 0\n : 7 * Math.exp(-since / 10) * (1 - (t - LAND) / (FULL - LAND + 6));\n const splash = t < LAND ? 0 : 14 * Math.exp(-since / 3.5);\n const surface = (x: number) =>\n level +\n Math.max(0, amp) *\n (Math.sin(x * 0.09 + since * 0.7) +\n 0.45 * Math.sin(x * 0.17 - since * 0.95 + 1.3)) -\n splash * Math.exp(-(((x - 50) / 10) ** 2)) +\n splash * 0.35 * Math.exp(-(((x - 50) / 26) ** 2));\n const xs = Array.from({ length: 27 }, (_, i) => -4 + i * 4.3);\n const wave = xs.map((x) => `${x.toFixed(2)} ${surface(x).toFixed(2)}`);\n const liquidPath = `M ${wave.join(\" L \")} L 110 110 L -10 110 Z`;\n const meniscusPath = `M ${wave.join(\" L \")}`;\n\n const solid = interpolate(t, [FULL - 2, FULL + 3], [0, 1], clamp);\n const stroke = interpolateColors(solid, [0, 1], [outlineColor, liquidColor]);\n\n const slide = interpolate(t, [SLIDE, SLIDE + 11], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n const reveal = interpolate(t, [SLIDE + 2, SLIDE + 13], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const outlineIn = interpolate(t, [0, 5], [0, 1], clamp);\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size * 0.24,\n transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 100 100\"\n style={{ flexShrink: 0, overflow: \"visible\" }}\n >\n <defs>\n <clipPath id={`${uid}-clip`}>\n <path d={shape} />\n </clipPath>\n </defs>\n {t < LAND + 1 && (\n <path\n d=\"M 0 -7 C 3 -2 5 1 5 4 A 5 5 0 0 1 -5 4 C -5 1 -3 -2 0 -7 Z\"\n fill={liquidColor}\n transform={`translate(50 ${dropY}) scale(${1.6 / Math.sqrt(dropStretch)} ${1.6 * dropStretch})`}\n opacity={interpolate(\n t,\n [0, 2, LAND, LAND + 1],\n [0, 1, 1, 0],\n clamp,\n )}\n />\n )}\n <g clipPath={`url(#${uid}-clip)`}>\n {t >= LAND && <path d={liquidPath} fill={liquidColor} />}\n {t >= LAND && solid < 1 && (\n <path\n d={meniscusPath}\n fill=\"none\"\n stroke=\"#FFFFFF\"\n strokeOpacity={0.35 * (1 - solid)}\n strokeWidth={1.4}\n />\n )}\n {Array.from({ length: BUBBLES }, (_, i) => {\n const start = LAND + 2 + random(`liquid-fill-b-${i}`) * 16;\n const age = t - start;\n if (age < 0) return null;\n const bx = 20 + random(`liquid-fill-x-${i}`) * 60;\n const by = 98 - age * (2.4 + random(`liquid-fill-v-${i}`) * 2);\n const r = 1.2 + random(`liquid-fill-r-${i}`) * 2;\n if (by < surface(bx) + r + 1) return null;\n return (\n <circle\n key={i}\n cx={bx + Math.sin(age * 0.6 + i) * 1.5}\n cy={by}\n r={r}\n fill=\"none\"\n stroke={bubbleColor}\n strokeOpacity={0.7 * (1 - solid)}\n strokeWidth={0.8}\n />\n );\n })}\n </g>\n <path\n d={shape}\n fill=\"none\"\n stroke={stroke}\n strokeWidth={3}\n opacity={outlineIn}\n />\n </svg>\n {children && (\n <div\n style={{\n opacity: reveal,\n clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,\n transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,\n }}\n >\n {children}\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/liquid-fill.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/long-shadow.json b/registry-artifacts/long-shadow.jsonnew file mode 100644index 00000000..538fbea6--- /dev/null+++ b/registry-artifacts/long-shadow.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "long-shadow",+ "title": "Long Shadow",+ "description": "A flat icon casts a long shadow to the frame edge, then the light swings and the shadow sweeps around on a spring.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/long-shadow/index.tsx",+ "content": "\"use client\";\n\nimport { type ReactNode, useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type LongShadowProps = {\n /** Flat icon or mark that casts the shadow. Defaults to a red check badge. */\n children?: ReactNode;\n /** Shadow direction in degrees at the start (0 = right, 90 = down). */\n angleFrom?: number;\n /** Shadow direction after the light swings. */\n angleTo?: number;\n shadowColor?: string;\n background?: string;\n /** Fade the shadow toward its far end, 0 to 1. */\n fade?: number;\n /** Colors of the default badge. */\n iconColor?: string;\n checkColor?: string;\n speed?: number;\n};\n\nexport const longShadowDefaults = {\n angleFrom: 45,\n angleTo: 135,\n shadowColor: \"#ECEAE6\",\n background: \"#FFFFFF\",\n fade: 0,\n iconColor: \"#E5322D\",\n checkColor: \"#FFFFFF\",\n speed: 1,\n};\n\nexport const longShadowLength = 48;\n\n// Log-doubling extrusion: each pass unions the silhouette with itself shifted by\n// twice the previous distance, so 10 passes stack 1024 copies.\nconst PASSES = 10;\nconst COPIES = 2 ** PASSES - 1;\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction Badge({\n size,\n iconColor,\n checkColor,\n}: {\n size: number;\n iconColor: string;\n checkColor: string;\n}) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 100 100\" aria-hidden>\n <circle cx={50} cy={50} r={49} fill={iconColor} />\n <path\n d=\"M 29 52 L 44 66 L 72 36\"\n fill=\"none\"\n stroke={checkColor}\n strokeWidth={11}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function LongShadow({\n children,\n angleFrom = longShadowDefaults.angleFrom,\n angleTo = longShadowDefaults.angleTo,\n shadowColor = longShadowDefaults.shadowColor,\n background = longShadowDefaults.background,\n fade = longShadowDefaults.fade,\n iconColor = longShadowDefaults.iconColor,\n checkColor = longShadowDefaults.checkColor,\n speed = longShadowDefaults.speed,\n}: LongShadowProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const t = (frame / fps) * 30 * speed;\n const unit = Math.min(width, height) / 720;\n\n const pop = spring({\n frame: t,\n fps: 30,\n config: { damping: 13, stiffness: 170, mass: 0.8 },\n });\n const grow = interpolate(t, [7, 22], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const swing = spring({\n frame: t - 24,\n fps: 30,\n config: { damping: 11, stiffness: 70, mass: 0.9 },\n });\n const angle = angleFrom + (angleTo - angleFrom) * swing;\n const rad = (angle * Math.PI) / 180;\n const length = Math.hypot(width, height) * grow;\n const step = length / COPIES;\n const dx = Math.cos(rad) * step;\n const dy = Math.sin(rad) * step;\n\n const content = children ?? (\n <Badge\n size={Math.min(width, height) * 0.34}\n iconColor={iconColor}\n checkColor={checkColor}\n />\n );\n const mask =\n fade > 0\n ? `linear-gradient(${angle + 90}deg, #000 50%, rgba(0,0,0,${1 - Math.min(1, fade)}) 100%)`\n : undefined;\n\n return (\n <AbsoluteFill style={{ backgroundColor: background, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter\n id={`${id}-extrude`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix\n in=\"SourceAlpha\"\n type=\"matrix\"\n values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0\"\n result=\"m0\"\n />\n {Array.from({ length: PASSES }, (_, i) => (\n <feOffset\n key={`o${i}`}\n in={`m${i}`}\n dx={dx * 2 ** i}\n dy={dy * 2 ** i}\n result={`o${i}`}\n />\n )).flatMap((offset, i) => [\n offset,\n <feMerge key={`m${i}`} result={`m${i + 1}`}>\n <feMergeNode in={`m${i}`} />\n <feMergeNode in={`o${i}`} />\n </feMerge>,\n ])}\n {/* feOffset snaps to whole pixels; a hair of blur hides the steps. */}\n <feGaussianBlur\n in={`m${PASSES}`}\n stdDeviation={0.8 * unit}\n result=\"soft\"\n />\n <feFlood floodColor={shadowColor} />\n <feComposite in2=\"soft\" operator=\"in\" />\n </filter>\n </svg>\n <AbsoluteFill\n style={{\n transform: `scale(${pop})`,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: `url(#${id}-extrude)`,\n opacity: grow > 0 ? 1 : 0,\n maskImage: mask,\n WebkitMaskImage: mask,\n }}\n >\n {content}\n </AbsoluteFill>\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n {content}\n </AbsoluteFill>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/long-shadow.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/neon-sign.json b/registry-artifacts/neon-sign.jsonnew file mode 100644index 00000000..b98380e1--- /dev/null+++ b/registry-artifacts/neon-sign.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "neon-sign",+ "title": "Neon Sign",+ "description": "A glass neon tube stutters alive segment by segment with a hot white core and wall glow, buzzes off once, then holds lit.",+ "dependencies": ["remotion", "@remotion/paths"],+ "files": [+ {+ "path": "registry/remocn/neon-sign/index.tsx",+ "content": "\"use client\";\n\nimport { getBoundingBox, getSubpaths } from \"@remotion/paths\";\nimport { useId, useMemo } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type NeonSignProps = {\n /** SVG path data for the tube. Each subpath (M command) flickers on its own. */\n path?: string;\n /** viewBox for the path. Defaults to the path's bounding box. */\n viewBox?: string;\n /** Tube color when lit. */\n color?: string;\n /** Color of the halo and the glow on the wall. */\n glowColor?: string;\n /** Unlit glass tube. */\n tubeColor?: string;\n /** Color of the hot core inside the tube. */\n coreColor?: string;\n backgroundColor?: string;\n /** Tube thickness in path units. */\n strokeWidth?: number;\n /** Share of the frame width the sign spans. */\n fit?: number;\n seed?: number;\n speed?: number;\n};\n\n// Handwritten \"hello\" with an underline swash, one subpath per tube.\nconst HELLO = [\n \"M 30 132 C 52 112 74 70 70 46 C 67 28 50 30 47 52 C 44 76 42 112 40 140 C 46 116 58 100 72 100 C 86 100 84 122 86 134 C 88 144 100 144 110 132\",\n \"M 110 132 C 124 124 142 110 136 98 C 130 88 112 96 112 116 C 112 138 134 146 156 130\",\n \"M 156 130 C 176 110 196 66 190 46 C 186 32 170 36 168 60 C 166 90 168 126 172 136 C 176 146 188 142 196 132\",\n \"M 196 132 C 216 110 232 66 226 46 C 222 32 206 36 204 60 C 202 90 204 126 208 136 C 212 146 224 142 232 132\",\n \"M 232 132 C 238 116 248 100 262 100 C 278 100 280 124 268 136 C 256 146 242 136 248 118 C 252 106 268 104 290 104\",\n \"M 52 170 C 120 160 210 162 296 152\",\n].join(\" \");\n\nexport const neonSignDefaults = {\n path: HELLO,\n color: \"#E5322D\",\n glowColor: \"#E5322D\",\n tubeColor: \"#2A2A2A\",\n coreColor: \"#FFFFFF\",\n backgroundColor: \"#111111\",\n strokeWidth: 6,\n fit: 0.62,\n seed: 7,\n speed: 1,\n};\n\nconst FIRST = 3;\nconst STEP = 3.4;\nconst STUTTER = 7;\n// Whole sign drops out once after everything is lit, then holds.\nconst BUZZ: [number, number][] = [\n [29, 0.1],\n [30, 0],\n [31, 0.55],\n [32, 0.2],\n];\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction segmentLevel(t: number, i: number, seed: number) {\n const onset = FIRST + i * STEP + random(`neon-sign-${seed}-${i}`) * 2;\n if (t < onset) return 0;\n if (t < onset + STUTTER) {\n const tick = Math.floor(t);\n const v = random(`neon-sign-${seed}-${i}-${tick}`);\n const ramp = (t - onset) / STUTTER;\n return v < 0.5 - ramp * 0.3 ? 0.04 : 0.55 + 0.45 * v;\n }\n return 1;\n}\n\nexport function NeonSign(props: NeonSignProps) {\n const {\n path,\n viewBox,\n color,\n glowColor,\n tubeColor,\n coreColor,\n backgroundColor,\n strokeWidth,\n fit,\n seed,\n speed,\n } = { ...neonSignDefaults, ...props };\n const uid = `neon-sign-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n\n const segments = useMemo(() => getSubpaths(path), [path]);\n const box = useMemo(() => {\n if (viewBox) {\n const [x, y, w, h] = viewBox.split(/[\\s,]+/).map(Number);\n return { x, y, w, h };\n }\n const b = getBoundingBox(path);\n const pad = strokeWidth * 6;\n return {\n x: b.x1 - pad,\n y: b.y1 - pad,\n w: b.width + pad * 2,\n h: b.height + pad * 2,\n };\n }, [path, viewBox, strokeWidth]);\n\n const tick = Math.floor(t);\n const buzz = BUZZ.find(([f]) => f === tick)?.[1] ?? 1;\n const levels = segments.map((_, i) => segmentLevel(t, i, seed) * buzz);\n const average =\n levels.reduce((a, b) => a + b, 0) / Math.max(1, levels.length);\n\n const scale = Math.min((width * fit) / box.w, (height * 0.7) / box.h);\n const drawW = box.w * scale;\n const drawH = box.h * scale;\n const settle = interpolate(t, [32, 40], [0.85, 1], clamp);\n\n return (\n <AbsoluteFill style={{ backgroundColor }}>\n <AbsoluteFill\n style={{\n background: `radial-gradient(ellipse ${drawW * 0.75}px ${drawH * 0.85}px at 50% 50%, ${glowColor} 0%, transparent 100%)`,\n opacity: 0.28 * average * settle,\n }}\n />\n <AbsoluteFill style={{ alignItems: \"center\", justifyContent: \"center\" }}>\n <svg\n width={drawW}\n height={drawH}\n viewBox={`${box.x} ${box.y} ${box.w} ${box.h}`}\n style={{ overflow: \"visible\" }}\n >\n <defs>\n <filter\n id={`${uid}-wide`}\n filterUnits=\"userSpaceOnUse\"\n x={box.x - box.w}\n y={box.y - box.h}\n width={box.w * 3}\n height={box.h * 3}\n >\n <feGaussianBlur stdDeviation={strokeWidth * 2.2} />\n </filter>\n <filter\n id={`${uid}-near`}\n filterUnits=\"userSpaceOnUse\"\n x={box.x - box.w}\n y={box.y - box.h}\n width={box.w * 3}\n height={box.h * 3}\n >\n <feGaussianBlur stdDeviation={strokeWidth * 0.6} />\n </filter>\n </defs>\n <g fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n {segments.map((d, i) => (\n <path\n key={`tube-${i}`}\n d={d}\n stroke={tubeColor}\n strokeWidth={strokeWidth}\n />\n ))}\n {segments.map((d, i) => {\n const level = levels[i];\n if (level <= 0) return null;\n return (\n <g key={`lit-${i}`}>\n <path\n d={d}\n stroke={glowColor}\n strokeWidth={strokeWidth * 3}\n opacity={0.7 * level}\n filter={`url(#${uid}-wide)`}\n />\n <path\n d={d}\n stroke={color}\n strokeWidth={strokeWidth * 1.6}\n opacity={0.9 * level}\n filter={`url(#${uid}-near)`}\n />\n <path\n d={d}\n stroke={color}\n strokeWidth={strokeWidth}\n opacity={level}\n />\n <path\n d={d}\n stroke={coreColor}\n strokeWidth={strokeWidth * 0.36}\n opacity={0.9 * level}\n />\n </g>\n );\n })}\n </g>\n </svg>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/neon-sign.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/orbit-lock.json b/registry-artifacts/orbit-lock.jsonnew file mode 100644index 00000000..1d6dea12--- /dev/null+++ b/registry-artifacts/orbit-lock.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "orbit-lock",+ "title": "Orbit Lock",+ "description": "Three moons ride tilted, shrinking orbits into a red core that bursts into a ring flash and springs the logo into place.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/orbit-lock/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type OrbitLockProps = {\n /** Lockup revealed after the moons collide with the core. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Number of moons orbiting the core. */\n moons?: number;\n backgroundColor?: string;\n coreColor?: string;\n moonColor?: string;\n /** Ring flash released on impact. */\n flashColor?: string;\n /** Orbit tilt in degrees: 0 is a flat circle, 80 is nearly edge-on. */\n tilt?: number;\n speed?: number;\n};\n\nexport const orbitLockDefaults = {\n moons: 3,\n backgroundColor: \"#111111\",\n coreColor: \"#E5322D\",\n moonColor: \"#FFFFFF\",\n flashColor: \"#FFFFFF\",\n tilt: 64,\n speed: 1,\n};\n\nconst IMPACT = 30;\nconst TURNS = 1.9;\nconst TRAIL = 10;\nconst TRAIL_STEP = 0.4;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype Moon = { x: number; y: number; z: number };\n\nfunction moonAt(\n t: number,\n index: number,\n count: number,\n outer: number,\n inner: number,\n tilt: number,\n): Moon {\n const p = Math.min(1, Math.max(0, t / IMPACT));\n // Orbit radius collapses late; angular speed ramps up as it tightens.\n const r = inner + (outer - inner) * (1 - Easing.in(Easing.cubic)(p));\n const theta =\n (index / count) * Math.PI * 2 +\n Math.PI * 2 * TURNS * Easing.in(Easing.quad)(p);\n const plane = (index / count) * Math.PI + Math.PI / 9;\n const lx = r * Math.cos(theta);\n const ly = r * Math.sin(theta) * Math.cos(tilt);\n return {\n x: lx * Math.cos(plane) - ly * Math.sin(plane),\n y: lx * Math.sin(plane) + ly * Math.cos(plane),\n z: r * Math.sin(theta) * Math.sin(tilt),\n };\n}\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nexport function OrbitLock(props: OrbitLockProps) {\n const {\n children,\n moons,\n backgroundColor,\n coreColor,\n moonColor,\n flashColor,\n tilt,\n speed,\n } = { ...orbitLockDefaults, ...props };\n const uid = `orbit-lock-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const s = Math.min(width, height);\n const cx = width / 2;\n const cy = height / 2;\n const count = Math.max(1, Math.round(moons));\n const tiltRad = (Math.min(85, Math.max(0, tilt)) * Math.PI) / 180;\n\n const core = s * 0.055;\n const outer = s * 0.36;\n const moonR = s * 0.02;\n const p = Math.min(1, t / IMPACT);\n\n const corePulse = 1 + 0.3 * p ** 4;\n const burst = interpolate(t, [IMPACT, IMPACT + 2, IMPACT + 6], [1, 1.6, 0], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const coreScale = t < IMPACT ? corePulse : corePulse * burst;\n const coreFill = interpolateColors(\n t,\n [IMPACT - 2, IMPACT + 1],\n [coreColor, flashColor],\n );\n\n const ring = interpolate(t, [IMPACT, IMPACT + 16], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const ringVisible = t >= IMPACT && ring < 1;\n const orbitOpacity = interpolate(\n t,\n [0, 6, IMPACT - 4, IMPACT],\n [0, 0.16, 0.1, 0],\n clamp,\n );\n const orbitR = core + (outer - core) * (1 - Easing.in(Easing.cubic)(p));\n\n const pop = spring({\n frame: t - IMPACT - 3,\n fps,\n config: { damping: 11, stiffness: 170, mass: 0.7 },\n });\n\n const bodies = Array.from({ length: count }, (_, i) => {\n const head = moonAt(t, i, count, outer, core, tiltRad);\n const trail = Array.from({ length: TRAIL }, (_, k) =>\n moonAt(t - (k + 1) * TRAIL_STEP, i, count, outer, core, tiltRad),\n );\n return { i, head, trail };\n });\n const showMoons = t < IMPACT && t >= 0;\n const appear = interpolate(t, [0, 5], [0, 1], clamp);\n\n const renderMoon = ({ i, head, trail }: (typeof bodies)[number]) => {\n const depth = 1 + (0.18 * head.z) / outer;\n const points = [head, ...trail];\n // Tapered ribbon through the recent positions, fading toward the tail.\n const left: string[] = [];\n const right: string[] = [];\n points.forEach((pt, k) => {\n const prev = points[Math.max(0, k - 1)];\n const next = points[Math.min(points.length - 1, k + 1)];\n const dx = prev.x - next.x;\n const dy = prev.y - next.y;\n const len = Math.hypot(dx, dy) || 1;\n const half = moonR * depth * 0.9 * (1 - k / points.length);\n const nx = (-dy / len) * half;\n const ny = (dx / len) * half;\n left.push(`${cx + pt.x + nx},${cy + pt.y + ny}`);\n right.unshift(`${cx + pt.x - nx},${cy + pt.y - ny}`);\n });\n const tail = points[points.length - 1];\n const gradId = `${uid}-trail-${i}`;\n return (\n <g key={i} opacity={appear}>\n <defs>\n <linearGradient\n id={gradId}\n gradientUnits=\"userSpaceOnUse\"\n x1={cx + head.x}\n y1={cy + head.y}\n x2={cx + tail.x}\n y2={cy + tail.y}\n >\n <stop offset=\"0\" stopColor={moonColor} stopOpacity={0.6} />\n <stop offset=\"1\" stopColor={moonColor} stopOpacity={0} />\n </linearGradient>\n </defs>\n <polygon\n points={[...left, ...right].join(\" \")}\n fill={`url(#${gradId})`}\n />\n <circle\n cx={cx + head.x}\n cy={cy + head.y}\n r={moonR * depth}\n fill={moonColor}\n />\n </g>\n );\n };\n\n return (\n <AbsoluteFill style={{ backgroundColor }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n >\n {Array.from({ length: count }, (_, i) => (\n <ellipse\n key={i}\n cx={cx}\n cy={cy}\n rx={orbitR}\n ry={orbitR * Math.cos(tiltRad)}\n transform={`rotate(${(i / count) * 180 + 20} ${cx} ${cy})`}\n fill=\"none\"\n stroke={moonColor}\n strokeOpacity={orbitOpacity}\n strokeWidth={1.5}\n />\n ))}\n {showMoons && bodies.filter((b) => b.head.z < 0).map(renderMoon)}\n {coreScale > 0 && (\n <circle\n cx={cx}\n cy={cy}\n r={core * coreScale * appear}\n fill={coreFill}\n />\n )}\n {showMoons && bodies.filter((b) => b.head.z >= 0).map(renderMoon)}\n {ringVisible && (\n <circle\n cx={cx}\n cy={cy}\n r={core + ring * s * 0.62}\n fill=\"none\"\n stroke={flashColor}\n strokeWidth={Math.max(1, s * 0.03 * (1 - ring))}\n opacity={1 - ring}\n />\n )}\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: interpolate(t, [IMPACT + 3, IMPACT + 6], [0, 1], clamp),\n transform: `scale(${0.55 + 0.45 * pop})`,\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={coreColor}\n dot={backgroundColor}\n text={moonColor}\n />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/orbit-lock.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/paper-tear.json b/registry-artifacts/paper-tear.jsonnew file mode 100644index 00000000..8ae21101--- /dev/null+++ b/registry-artifacts/paper-tear.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "paper-tear",+ "title": "Paper Tear",+ "description": "A jagged rip runs down the frame, then both halves peel apart on a spring with white fibrous torn edges, revealing the scene underneath.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/paper-tear/index.tsx",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n spring,\n useVideoConfig,\n} from \"remotion\";\n\nexport type PaperTearProps = {\n /** Strength of the impact: shake, flash and debris. 0 turns them off. */\n impact?: number;\n /** Seed for the shape of the rip. */\n seed?: number | string;\n /** Color of the fibrous torn edge. */\n edgeColor?: string;\n /** How jagged the rip is, 0 to 1. */\n roughness?: number;\n /** Shadow the torn halves cast on the incoming scene. */\n shadowColor?: string;\n};\n\nexport const paperTearDefaults: Required<PaperTearProps> = {\n impact: 1,\n seed: 7,\n edgeColor: \"#FFFFFF\",\n roughness: 0.5,\n shadowColor: \"rgba(0, 0, 0, 0.45)\",\n};\n\n// Timeline, as shares of the transition: the paper strains, then the rip\n// tears through the whole frame in a couple of frames (the impact), then the\n// halves are flung apart.\nconst STRAIN = 0.2;\nconst IMPACT = 0.28;\nconst SEGMENTS = 44;\nconst DEBRIS = 28;\nconst ripEase = Easing.in(Easing.quad);\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype TearPoint = { x: number; y: number; left: number; right: number };\n\nfunction buildTear(\n seed: number | string,\n roughness: number,\n width: number,\n height: number,\n): TearPoint[] {\n const r = Math.min(1, Math.max(0, roughness));\n const unit = Math.min(width, height);\n const tilt = (random(`tear-tilt-${seed}`) - 0.5) * width * 0.08;\n const phaseA = random(`tear-pa-${seed}`) * Math.PI * 2;\n const phaseB = random(`tear-pb-${seed}`) * Math.PI * 2;\n const fiber = unit * (0.008 + r * 0.012);\n const points: TearPoint[] = [];\n for (let i = 0; i <= SEGMENTS; i++) {\n const t = i / SEGMENTS;\n const wander =\n Math.sin(t * Math.PI * 2.2 + phaseA) * width * 0.025 +\n Math.sin(t * Math.PI * 5.3 + phaseB) * width * 0.012;\n // Alternate the jitter sign so the rip zig-zags instead of drifting.\n const zig = (i % 2 === 0 ? 1 : -1) * random(`tear-z-${seed}-${i}`);\n points.push({\n x:\n width / 2 +\n tilt * (t - 0.5) +\n wander * (0.4 + r) +\n zig * unit * 0.022 * r,\n y: -unit * 0.05 + t * (height + unit * 0.1),\n left: fiber * (0.35 + random(`tear-l-${seed}-${i}`) * 1.3),\n right: fiber * (0.2 + random(`tear-r-${seed}-${i}`) * 0.9),\n });\n }\n return points;\n}\n\ntype Shard = {\n x: number;\n y: number;\n vx: number;\n vy: number;\n spin: number;\n size: number;\n shape: string;\n};\n\n// Paper scraps blown out of the seam at the moment of impact.\nfunction buildDebris(\n seed: number | string,\n tear: TearPoint[],\n unit: number,\n): Shard[] {\n return Array.from({ length: DEBRIS }, (_, i) => {\n const r = (k: string) => random(`tear-debris-${seed}-${i}-${k}`);\n const at = tear[Math.floor(r(\"at\") * tear.length)];\n const side = r(\"side\") < 0.5 ? -1 : 1;\n const corners = Array.from({ length: 4 }, (_, k) => {\n const a = (k / 4) * Math.PI * 2 + r(`a${k}`) * 1.2;\n const d = 0.55 + r(`d${k}`) * 0.45;\n return `${(50 + Math.cos(a) * 50 * d).toFixed(0)}% ${(50 + Math.sin(a) * 50 * d).toFixed(0)}%`;\n });\n return {\n x: at.x,\n y: at.y,\n vx: side * unit * (0.25 + r(\"vx\") * 0.9),\n vy: -unit * (0.1 + r(\"vy\") * 0.55),\n spin: (r(\"spin\") - 0.5) * 1440,\n size: unit * (0.008 + r(\"size\") ** 2 * 0.026),\n shape: `polygon(${corners.join(\",\")})`,\n };\n });\n}\n\n// Damped camera jolt that starts at the impact.\nfunction shakeAt(p: number, unit: number, impact: number) {\n const t = p - IMPACT;\n if (t < 0 || impact <= 0) return { x: 0, y: 0, amp: 0 };\n const decay = Math.exp(-t * 11);\n const amp = unit * 0.03 * impact * decay;\n return {\n x: Math.sin(t * 95) * amp,\n y: Math.cos(t * 120 + 0.6) * amp * 0.7,\n amp,\n };\n}\n\nconst px = (x: number, y: number) => `${x}px ${y}px`;\n\nconst PaperTearPresentation: React.FC<\n TransitionPresentationComponentProps<PaperTearProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { width, height, fps } = useVideoConfig();\n const { seed, edgeColor, roughness, shadowColor, impact } = {\n ...paperTearDefaults,\n ...passedProps,\n };\n const tear = useMemo(\n () => buildTear(seed, roughness, width, height),\n [seed, roughness, width, height],\n );\n const unit = Math.min(width, height);\n const debris = useMemo(\n () => buildDebris(seed, tear, unit),\n [seed, tear, unit],\n );\n const p = presentationProgress;\n const shake = shakeAt(p, unit, impact);\n\n if (presentationDirection === \"entering\") {\n // The next scene is punched toward camera by the hit and settles back.\n const scale = interpolate(p, [IMPACT, 1], [1 + 0.1 * impact, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n return (\n <AbsoluteFill\n style={{\n transform: `translate(${shake.x}px, ${shake.y}px) scale(${scale})`,\n }}\n >\n {children}\n </AbsoluteFill>\n );\n }\n\n // Strain: the sheet trembles and leans toward camera before it gives way.\n const strain = interpolate(p, [0, STRAIN, IMPACT], [0, 1, 1], {\n ...clamp,\n easing: Easing.in(Easing.cubic),\n });\n const tremble =\n p < IMPACT ? Math.sin(p * 260) * unit * 0.004 * strain * impact : 0;\n const lean = 1 + 0.025 * strain * (p < IMPACT ? 1 : 0);\n const front =\n -unit * 0.1 +\n ripEase(interpolate(p, [STRAIN, IMPACT], [0, 1], clamp)) *\n (height + unit * 0.25);\n // The torn fibres open up a short distance behind the running rip front.\n const open = (y: number) =>\n interpolate(front - y, [0, unit * 0.12], [0, 1], clamp);\n\n const pad = unit;\n const edge = tear.map((t) => px(t.x, t.y));\n const leftInk = tear.map((t) => px(t.x - t.left * open(t.y), t.y));\n const rightInk = tear.map((t) => px(t.x + t.right * open(t.y), t.y));\n const leftOuter = [px(-pad, height + pad), px(-pad, -pad)];\n const rightOuter = [px(width + pad, height + pad), px(width + pad, -pad)];\n const poly = (pts: string[]) => `polygon(${pts.join(\",\")})`;\n const leftPaper = poly([...edge, ...leftOuter]);\n const rightPaper = poly([...edge, ...rightOuter]);\n const leftPrint = poly([...leftInk, ...leftOuter]);\n const rightPrint = poly([...rightInk, ...rightOuter]);\n\n const peelFrames = 30;\n // A stiff spring right after the impact flings the halves apart.\n const peel = spring({\n frame: Math.max(0, (p - IMPACT) / (1 - IMPACT)) * peelFrames,\n fps,\n durationInFrames: peelFrames,\n config: { damping: 15, stiffness: 150, mass: 0.8 },\n });\n const maxX = Math.max(...tear.map((t) => t.x));\n const minX = Math.min(...tear.map((t) => t.x));\n // The inner edges swing toward camera as the halves part, so travel gets\n // headroom for the perspective growth. Pivoting on the outer edges keeps\n // the frame border sealed (a flat rotate would expose the top or bottom).\n const leftTravel = (maxX + unit * 0.12) * 1.3;\n const rightTravel = (width - minX + unit * 0.12) * 1.3;\n const curl = peel * 24;\n const lens = `perspective(${unit * 2.6}px)`;\n // Grow the shadow from zero so the closed rip shows no dark seam.\n const cast = interpolate(p, [IMPACT, IMPACT + 0.1], [0, 1], clamp);\n const shadow = `drop-shadow(0 ${unit * 0.012 * cast}px ${unit * 0.04 * cast}px ${shadowColor})`;\n\n const half = (\n paper: string,\n print: string,\n transform: string,\n origin: string,\n ) => (\n <AbsoluteFill\n style={{\n transform,\n transformOrigin: origin,\n filter: cast > 0 ? shadow : undefined,\n }}\n >\n <AbsoluteFill style={{ clipPath: paper, backgroundColor: edgeColor }} />\n <AbsoluteFill style={{ clipPath: print }}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n\n // Flash along the seam and scraps of paper blown out of it.\n const flash =\n impact > 0\n ? interpolate(p, [IMPACT - 0.03, IMPACT, IMPACT + 0.14], [0, 1, 0], {\n ...clamp,\n }) * Math.min(1, impact)\n : 0;\n const seam = tear.map((t) => `${t.x},${t.y}`).join(\" \");\n const age = p - IMPACT;\n const gravity = unit * 2.6;\n // Debris time runs in \"seconds\" of the transition so it reads physical.\n const dt = age * 1.1;\n\n return (\n <AbsoluteFill\n style={{\n zIndex: 2,\n // Overscan just enough that the jolt never exposes the frame edge.\n transform: `translate(${shake.x + tremble}px, ${shake.y}px) scale(${\n lean + (2.2 * shake.amp) / unit\n })`,\n }}\n >\n {front < height + unit * 0.05 ? (\n // Below the running rip the sheet is still whole. Cover the seam with\n // an intact copy so the split halves never show an anti-aliased hairline.\n <AbsoluteFill\n style={{\n clipPath: poly([\n px(-pad, front),\n px(width + pad, front),\n px(width + pad, height + pad),\n px(-pad, height + pad),\n ]),\n zIndex: 1,\n }}\n >\n {children}\n </AbsoluteFill>\n ) : null}\n {half(\n leftPaper,\n leftPrint,\n `${lens} translateX(${-peel * leftTravel}px) rotateY(${-curl}deg)`,\n \"0% 50%\",\n )}\n {half(\n rightPaper,\n rightPrint,\n `${lens} translateX(${peel * rightTravel}px) rotateY(${curl}deg)`,\n \"100% 50%\",\n )}\n {flash > 0.01 ? (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n aria-hidden\n >\n <polyline\n points={seam}\n fill=\"none\"\n stroke={edgeColor}\n strokeOpacity={flash * 0.35}\n strokeWidth={unit * 0.06 * flash}\n strokeLinejoin=\"round\"\n />\n <polyline\n points={seam}\n fill=\"none\"\n stroke={edgeColor}\n strokeOpacity={flash}\n strokeWidth={unit * 0.012}\n strokeLinejoin=\"round\"\n />\n </svg>\n ) : null}\n {impact > 0 && age > 0\n ? debris.map((shard, i) => {\n const fade = interpolate(age, [0.35, 0.6], [1, 0], clamp);\n if (fade <= 0) return null;\n const x = shard.x + shard.vx * dt * impact;\n const y =\n shard.y + shard.vy * dt * impact + 0.5 * gravity * dt * dt;\n const size = shard.size * (0.5 + 0.5 * Math.min(1, impact));\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x - size / 2,\n top: y - size / 2,\n width: size,\n height: size,\n backgroundColor: edgeColor,\n clipPath: shard.shape,\n opacity: fade,\n transform: `rotate(${shard.spin * dt}deg)`,\n }}\n />\n );\n })\n : null}\n </AbsoluteFill>\n );\n};\n\nexport function paperTear(\n props: PaperTearProps = {},\n): TransitionPresentation<PaperTearProps> {\n return { component: PaperTearPresentation, props };\n}\n",+ "type": "registry:component",+ "target": "components/remocn/paper-tear.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/parallax-depth.json b/registry-artifacts/parallax-depth.jsonnew file mode 100644index 00000000..b7307519--- /dev/null+++ b/registry-artifacts/parallax-depth.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "parallax-depth",+ "title": "Parallax Depth",+ "description": "A flat landscape built from depth layers trucks sideways with a gentle push-in, near layers sliding faster than far ones.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/parallax-depth/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type ParallaxDepthLayer = {\n /** Full-frame content of the layer. Leave room past the edges for the truck. */\n content: React.ReactNode;\n /** Distance from the camera. 1 is nearest; larger values move less. */\n depth: number;\n};\n\nexport type ParallaxDepthColors = {\n sky: string;\n sun: string;\n far: string;\n mid: string;\n near: string;\n};\n\nexport type ParallaxDepthProps = {\n /** Custom layers. Falls back to the built-in sun and hills landscape. */\n layers?: ParallaxDepthLayer[];\n /** Sideways camera travel at depth 1, as a fraction of the frame width. */\n distance?: number;\n /** Push-in toward the scene, in depth units. */\n push?: number;\n /** Truck direction: 1 moves the camera right, -1 left. */\n direction?: 1 | -1;\n colors?: Partial<ParallaxDepthColors>;\n /** Sky color. Overrides `colors.sky`. */\n skyColor?: string;\n /** Sun color. Overrides `colors.sun`. */\n sunColor?: string;\n seed?: number;\n speed?: number;\n};\n\nexport const parallaxDepthDefaults = {\n distance: 0.5,\n push: 0.16,\n direction: 1 as 1 | -1,\n colors: {\n sky: \"#111111\",\n sun: \"#E5322D\",\n far: \"#2C2C2C\",\n mid: \"#555555\",\n near: \"#8E8E8E\",\n } satisfies ParallaxDepthColors,\n seed: 3,\n speed: 1,\n};\n\nconst DURATION = 60;\n\n// A ridge line built from a few seeded sine octaves, spanning three widths so it\n// never runs out while the camera trucks.\nfunction hillPath(\n width: number,\n height: number,\n base: number,\n amp: number,\n waves: number,\n seed: string,\n) {\n const octaves = [0, 1, 2].map((o) => ({\n f: (waves * (o + 1) * (0.8 + random(`${seed}-f${o}`) * 0.4)) / width,\n a: amp / (o * 1.7 + 1),\n p: random(`${seed}-p${o}`) * Math.PI * 2,\n }));\n const steps = 120;\n const x0 = -width;\n const x1 = width * 2;\n let d = `M ${x0} ${height * 2}`;\n for (let i = 0; i <= steps; i++) {\n const x = x0 + ((x1 - x0) * i) / steps;\n let y = base;\n for (const o of octaves)\n y -= o.a * (0.5 + 0.5 * Math.sin(x * o.f * 6.283 + o.p));\n d += ` L ${x.toFixed(1)} ${y.toFixed(1)}`;\n }\n return `${d} L ${x1} ${height * 2} Z`;\n}\n\nfunction useLandscape(colors: ParallaxDepthColors, seed: number) {\n const { width, height } = useVideoConfig();\n return useMemo<ParallaxDepthLayer[]>(() => {\n const svg = (children: React.ReactNode) => (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n aria-hidden\n >\n {children}\n </svg>\n );\n const hill = (\n base: number,\n amp: number,\n waves: number,\n fill: string,\n key: string,\n ) => (\n <path\n d={hillPath(\n width,\n height,\n height * base,\n height * amp,\n waves,\n `${seed}-${key}`,\n )}\n fill={fill}\n />\n );\n return [\n {\n depth: 9,\n content: svg(\n <circle\n cx={width * 0.6}\n cy={height * 0.4}\n r={height * 0.17}\n fill={colors.sun}\n />,\n ),\n },\n { depth: 6, content: svg(hill(0.6, 0.24, 2.2, colors.far, \"far\")) },\n { depth: 2.6, content: svg(hill(0.76, 0.16, 1.2, colors.mid, \"mid\")) },\n { depth: 1.2, content: svg(hill(0.92, 0.14, 0.9, colors.near, \"near\")) },\n ];\n }, [width, height, colors.sun, colors.far, colors.mid, colors.near, seed]);\n}\n\nexport function ParallaxDepth({\n layers,\n distance = parallaxDepthDefaults.distance,\n push = parallaxDepthDefaults.push,\n direction = parallaxDepthDefaults.direction,\n colors: colorOverrides,\n skyColor,\n sunColor,\n seed = parallaxDepthDefaults.seed,\n speed = parallaxDepthDefaults.speed,\n}: ParallaxDepthProps) {\n const frame = useCurrentFrame();\n const { width, fps } = useVideoConfig();\n const baseColors = { ...parallaxDepthDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n sky: skyColor ?? baseColors.sky,\n sun: sunColor ?? baseColors.sun,\n };\n const landscape = useLandscape(colors, seed);\n const stack = [...(layers ?? landscape)].sort((a, b) => b.depth - a.depth);\n\n const t = (frame * speed * 30) / fps;\n const move = interpolate(t, [0, DURATION], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.45, 0, 0.2, 1),\n });\n const camX = (move - 0.5) * distance * width * direction;\n const camZ = move * push;\n\n return (\n <AbsoluteFill style={{ backgroundColor: colors.sky, overflow: \"hidden\" }}>\n {stack.map((layer, i) => {\n const depth = Math.max(0.2, layer.depth);\n // Pinhole camera: scale and offset both fall off with 1 / depth.\n const scale = depth / Math.max(0.05, depth - camZ);\n const x = (-camX * scale) / depth;\n return (\n <AbsoluteFill\n key={i}\n style={{\n transform: `translateX(${x}px) scale(${scale})`,\n transformOrigin: \"50% 55%\",\n }}\n >\n {layer.content}\n </AbsoluteFill>\n );\n })}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/parallax-depth.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/pendulum-wave.json b/registry-artifacts/pendulum-wave.jsonnew file mode 100644index 00000000..114a6937--- /dev/null+++ b/registry-artifacts/pendulum-wave.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "pendulum-wave",+ "title": "Pendulum Wave",+ "description": "A row of pendulums with tuned periods drifts from a straight line into waves and braids, then realigns for a seamless loop.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/pendulum-wave/index.tsx",+ "content": "\"use client\";\n\nimport { AbsoluteFill, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport type PendulumWaveProps = {\n /** Number of pendulums. */\n count?: number;\n /** Swings the slowest pendulum makes per loop; pendulum i makes cycles + i. */\n cycles?: number;\n /** Frames until every pendulum realigns. */\n loopFrames?: number;\n speed?: number;\n background?: string;\n /** Bobs and guides. */\n color?: string;\n /** The wave line threaded through the bobs. */\n accent?: string;\n /** Draw the faint per-pendulum tracks and centre line. */\n showGuides?: boolean;\n};\n\nexport const pendulumWaveDefaults: Required<PendulumWaveProps> = {\n count: 15,\n cycles: 10,\n loopFrames: 450,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n showGuides: true,\n};\n\nconst TAU = Math.PI * 2;\nconst SMEAR_FRAMES = 4;\nconst SMEAR_SAMPLES = 6;\n\ntype Point = { x: number; y: number };\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\n// Catmull-Rom through the bobs so the wave reads as one continuous curve.\nfunction smoothPath(points: Point[]) {\n if (points.length < 2) return \"\";\n let d = `M ${fmt(points[0].x)} ${fmt(points[0].y)}`;\n for (let i = 0; i < points.length - 1; i++) {\n const p0 = points[i - 1] ?? points[i];\n const p1 = points[i];\n const p2 = points[i + 1];\n const p3 = points[i + 2] ?? p2;\n const c1x = p1.x + (p2.x - p0.x) / 6;\n const c1y = p1.y + (p2.y - p0.y) / 6;\n const c2x = p2.x - (p3.x - p1.x) / 6;\n const c2y = p2.y - (p3.y - p1.y) / 6;\n d += ` C ${fmt(c1x)} ${fmt(c1y)} ${fmt(c2x)} ${fmt(c2y)} ${fmt(p2.x)} ${fmt(p2.y)}`;\n }\n return d;\n}\n\nconst circle = (x: number, y: number, r: number) =>\n `M ${fmt(x - r)} ${fmt(y)} a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(r * 2)} 0 a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(-r * 2)} 0`;\n\nexport function PendulumWave({\n count = pendulumWaveDefaults.count,\n cycles = pendulumWaveDefaults.cycles,\n loopFrames = pendulumWaveDefaults.loopFrames,\n speed = pendulumWaveDefaults.speed,\n background = pendulumWaveDefaults.background,\n color = pendulumWaveDefaults.color,\n accent = pendulumWaveDefaults.accent,\n showGuides = pendulumWaveDefaults.showGuides,\n}: PendulumWaveProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const n = Math.max(2, Math.round(count));\n const loop = Math.max(1, loopFrames);\n const time = frame * speed;\n\n const marginX = width * 0.1;\n const gap = (width - marginX * 2) / (n - 1);\n const amp = height * 0.3;\n const cy = height / 2;\n const r0 = Math.min(gap * 0.3, height * 0.022);\n const unit = Math.min(width, height) / 720;\n\n // Phase of pendulum i: 2π · t · (cycles + i) / T. At t = 0 and t = T all\n // pendulums sit at the top extreme, so the loop closes on a straight line.\n const phaseAt = (i: number, t: number) => (TAU * t * (cycles + i)) / loop;\n\n const bobs = Array.from({ length: n }, (_, i) => {\n const c = Math.cos(phaseAt(i, time));\n // Fake depth: bobs swinging toward the viewer (lower) read slightly bigger.\n return { x: marginX + i * gap, y: cy - amp * c, r: r0 * (1 - 0.22 * c) };\n });\n\n let smear = \"\";\n for (let i = 0; i < n; i++) {\n const x = fmt(bobs[i].x);\n for (let s = 0; s <= SMEAR_SAMPLES; s++) {\n const t = time - (SMEAR_FRAMES * speed * s) / SMEAR_SAMPLES;\n const y = fmt(cy - amp * Math.cos(phaseAt(i, t)));\n smear += `${s === 0 ? \"M\" : \"L\"} ${x} ${y} `;\n }\n }\n\n const tracks = bobs\n .map((b) => `M ${fmt(b.x)} ${fmt(cy - amp)} V ${fmt(cy + amp)}`)\n .join(\" \");\n const ticks = bobs\n .map(\n (b) =>\n circle(b.x, cy - amp, 2.2 * unit) + circle(b.x, cy + amp, 2.2 * unit),\n )\n .join(\" \");\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Pendulum wave\"\n style={{ display: \"block\" }}\n >\n {showGuides ? (\n <g stroke={color} fill=\"none\">\n <path\n d={`M ${fmt(marginX - gap)} ${cy} H ${fmt(width - marginX + gap)}`}\n strokeOpacity={0.14}\n strokeWidth={unit}\n />\n <path\n d={tracks}\n strokeOpacity={0.08}\n strokeWidth={unit}\n strokeDasharray={`${2 * unit} ${6 * unit}`}\n />\n <path d={ticks} fill={color} fillOpacity={0.25} stroke=\"none\" />\n </g>\n ) : null}\n <path\n d={smoothPath(bobs)}\n fill=\"none\"\n stroke={accent}\n strokeWidth={2.5 * unit}\n strokeLinecap=\"round\"\n strokeOpacity={0.85}\n />\n <path\n d={smear}\n fill=\"none\"\n stroke={color}\n strokeOpacity={0.13}\n strokeWidth={r0 * 0.9}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d={bobs.map((b) => circle(b.x, b.y, b.r)).join(\" \")}\n fill={color}\n />\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/pendulum-wave.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/phyllotaxis.json b/registry-artifacts/phyllotaxis.jsonnew file mode 100644index 00000000..d89a83f1--- /dev/null+++ b/registry-artifacts/phyllotaxis.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "phyllotaxis",+ "title": "Phyllotaxis",+ "description": "Seeds spiral out at the golden angle into a sunflower head, then an accent Fibonacci arm pulses outward.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/phyllotaxis/index.tsx",+ "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type PhyllotaxisProps = {\n /** Number of seeds. */\n count?: number;\n /** Seed size multiplier. */\n size?: number;\n /** Frames for all seeds to spiral out. */\n growFrames?: number;\n /** Frames per pulse along the accent arm once grown. */\n pulseFrames?: number;\n /** Arm spacing: every n-th seed forms one parastichy (a Fibonacci number reads best). */\n arm?: number;\n /** Slow rotation of the head in degrees per second; 0 holds still. */\n rotation?: number;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nexport const phyllotaxisDefaults: Required<PhyllotaxisProps> = {\n count: 420,\n size: 1,\n growFrames: 60,\n pulseFrames: 45,\n arm: 21,\n rotation: 4,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst GOLDEN = (137.508 * Math.PI) / 180;\nconst POP = 10;\nconst pop = Easing.out(Easing.back(2.2));\nconst clamp = { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" } as const;\nconst fmt = (n: number) => Math.round(n * 10) / 10;\nconst dot = (x: number, y: number, r: number) =>\n `M ${fmt(x - r)} ${fmt(y)} a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(r * 2)} 0 a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(-r * 2)} 0 `;\n\nexport function Phyllotaxis({\n count = phyllotaxisDefaults.count,\n size = phyllotaxisDefaults.size,\n growFrames = phyllotaxisDefaults.growFrames,\n pulseFrames = phyllotaxisDefaults.pulseFrames,\n arm = phyllotaxisDefaults.arm,\n rotation = phyllotaxisDefaults.rotation,\n speed = phyllotaxisDefaults.speed,\n background = phyllotaxisDefaults.background,\n color = phyllotaxisDefaults.color,\n accent = phyllotaxisDefaults.accent,\n}: PhyllotaxisProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const n = Math.max(1, Math.round(count));\n const step = Math.max(1, Math.round(arm));\n const time = frame * speed;\n const cx = width / 2;\n const cy = height / 2;\n const maxR = Math.min(width, height) * 0.44;\n const c = maxR / Math.sqrt(n);\n const spin = (rotation * Math.PI * time) / 180 / fps;\n\n // Seeds appear in order with a little overshoot; the reveal eases so the\n // dense centre does not flash in all at once.\n const grown = (i: number) => {\n const at = growFrames * Math.sqrt(i / n);\n return pop(Math.min(1, Math.max(0, (time - at) / POP)));\n };\n const armIn = interpolate(time, [growFrames, growFrames + 14], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const since = time - growFrames - 10;\n const pulse = since > 0 ? (since / Math.max(1, pulseFrames)) % 1 : -1;\n\n let plain = \"\";\n let red = \"\";\n let spine = \"\";\n for (let i = 1; i <= n; i++) {\n const s = grown(i);\n if (s <= 0) continue;\n const radius = c * Math.sqrt(i);\n const theta = i * GOLDEN + spin;\n const x = cx + Math.cos(theta) * radius;\n const y = cy + Math.sin(theta) * radius;\n // Outer seeds are a touch larger, like a sunflower head.\n const base = c * 0.42 * size * (0.55 + 0.45 * Math.sqrt(i / n));\n const onArm = i % step === 0 && armIn > 0;\n if (!onArm) {\n plain += dot(x, y, base * s);\n continue;\n }\n // Pulse travels outward along the arm as a soft gaussian bump.\n const u = Math.sqrt(i / n);\n const bump =\n pulse >= 0 ? Math.exp(-(((u - pulse * 1.4 + 0.2) / 0.09) ** 2)) : 0;\n red += dot(x, y, base * s * (1 + 0.25 * armIn + bump * 0.9));\n spine += `${spine ? \"L\" : \"M\"} ${fmt(x)} ${fmt(y)} `;\n }\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Phyllotaxis spiral\"\n style={{ display: \"block\" }}\n >\n <path d={plain} fill={color} />\n {spine ? (\n <path\n d={spine}\n fill=\"none\"\n stroke={accent}\n strokeOpacity={0.35 * armIn}\n strokeWidth={Math.min(width, height) / 720}\n />\n ) : null}\n <path d={red} fill={color} fillOpacity={1 - armIn} />\n <path d={red} fill={accent} fillOpacity={armIn} />\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/phyllotaxis.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/pixel-sort.json b/registry-artifacts/pixel-sort.jsonnew file mode 100644index 00000000..cc6d53fa--- /dev/null+++ b/registry-artifacts/pixel-sort.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "pixel-sort",+ "title": "Pixel Sort",+ "description": "The scene melts into seeded vertical streaks like glitch-art pixel sorting, then the next scene's columns fall in and snap into place.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/pixel-sort/index.tsx",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useVideoConfig,\n} from \"remotion\";\n\nexport type PixelSortProps = {\n /** Number of vertical columns the frame is sliced into. */\n columns?: number;\n /** Seed for per-column melt amount and timing. */\n seed?: number | string;\n /** Color of the bright smeared streaks. */\n streakColor?: string;\n};\n\nexport const pixelSortDefaults: Required<PixelSortProps> = {\n columns: 40,\n seed: 5,\n streakColor: \"#FFFFFF\",\n};\n\n// Outgoing columns melt over MELT; incoming ones drop in (DROP) and snap (SNAP).\nconst MELT = 0.42;\nconst DROP = 0.14;\nconst SNAP = 0.12;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\nconst meltEase = Easing.in(Easing.cubic);\nconst snapEase = Easing.out(Easing.back(1.6));\n\ntype Column = {\n left: number;\n width: number;\n meltAt: number;\n amount: number;\n glow: number;\n streakFrom: number;\n snapAt: number;\n};\n\nconst PixelSortPresentation: React.FC<\n TransitionPresentationComponentProps<PixelSortProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { width, height } = useVideoConfig();\n const { columns, seed, streakColor } = {\n ...pixelSortDefaults,\n ...passedProps,\n };\n const count = Math.max(2, Math.round(columns));\n\n const layout = useMemo<Column[]>(\n () =>\n Array.from({ length: count }, (_, i) => {\n const r = (key: string) => random(`pixel-sort-${seed}-${key}-${i}`);\n const left = Math.floor((i * width) / count);\n const right = Math.floor(((i + 1) * width) / count);\n return {\n left,\n // 1px overlap keeps resting columns seamless.\n width: right - left + (i < count - 1 ? 1 : 0),\n meltAt: r(\"m\") * 0.2,\n amount: 0.25 + r(\"a\") ** 2 * 1.6,\n glow: 0.15 + r(\"g\") * 0.75,\n streakFrom: 10 + r(\"s\") * 50,\n snapAt: 0.5 + r(\"t\") * (1 - 0.5 - DROP - SNAP) + DROP,\n };\n }),\n [count, seed, width],\n );\n\n const p = presentationProgress;\n const exiting = presentationDirection === \"exiting\";\n\n return (\n <AbsoluteFill>\n {layout.map((c) => {\n let stretch: number;\n let shift: number;\n let streak: number;\n let opacity = 1;\n let origin = \"50% 0%\";\n if (exiting) {\n const m = meltEase(\n interpolate(p, [c.meltAt, c.meltAt + MELT], [0, 1], clamp),\n );\n // Stretch around the streak start so the column never tears open.\n stretch = 1 + m * c.amount * 4;\n shift = 0;\n origin = `50% ${c.streakFrom}%`;\n streak = m * c.glow;\n } else {\n const drop = interpolate(\n p,\n [c.snapAt - DROP, c.snapAt],\n [0, 1],\n clamp,\n );\n const snap = snapEase(\n interpolate(p, [c.snapAt, c.snapAt + SNAP], [0, 1], clamp),\n );\n if (drop <= 0) return null;\n // A smeared streak falls in from above, then snaps to the real image.\n stretch = interpolate(snap, [0, 1], [1 + c.amount * 3, 1]);\n shift = -(1 - Easing.out(Easing.cubic)(drop)) * height * 1.1;\n streak = (1 - Math.min(1, Math.max(0, snap))) * Math.max(0.5, c.glow);\n opacity = interpolate(drop, [0, 0.3], [0, 1], clamp);\n }\n return (\n <div\n key={c.left}\n style={{\n position: \"absolute\",\n left: c.left,\n top: 0,\n width: c.width,\n height,\n overflow: \"hidden\",\n opacity,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -c.left,\n top: 0,\n width,\n height,\n transformOrigin: origin,\n transform: `translateY(${shift}px) scaleY(${stretch})`,\n }}\n >\n {children}\n </div>\n {streak > 0.002 ? (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n opacity: streak,\n background: `linear-gradient(to bottom, transparent ${c.streakFrom}%, ${streakColor} ${c.streakFrom + 30}%, transparent 100%)`,\n }}\n />\n ) : null}\n </div>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nexport function pixelSort(\n props: PixelSortProps = {},\n): TransitionPresentation<PixelSortProps> {\n return { component: PixelSortPresentation, props };\n}\n",+ "type": "registry:component",+ "target": "components/remocn/pixel-sort.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/puzzle-snap.json b/registry-artifacts/puzzle-snap.jsonnew file mode 100644index 00000000..459a1168--- /dev/null+++ b/registry-artifacts/puzzle-snap.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "puzzle-snap",+ "title": "Puzzle Snap",+ "description": "Geometric pieces spin in from scattered positions and magnet-snap into a mark with a spark burst, then the mark slides aside for the wordmark.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/puzzle-snap/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type PuzzleSnapProps = {\n /** Wordmark revealed beside the assembled mark. */\n children?: React.ReactNode;\n backgroundColor?: string;\n /** Fill of the quarter circle and the small square. */\n primaryColor?: string;\n /** Fill of the dot and the wedge. */\n secondaryColor?: string;\n /** Spark burst color. */\n sparkColor?: string;\n /** Include the small square piece. */\n square?: boolean;\n /** Seed for the scattered start positions. */\n seed?: number;\n speed?: number;\n};\n\nexport const puzzleSnapDefaults = {\n backgroundColor: \"#111111\",\n primaryColor: \"#E5322D\",\n secondaryColor: \"#FFFFFF\",\n sparkColor: \"#FFFFFF\",\n square: true,\n seed: 3,\n speed: 1,\n};\n\nconst STAGGER = 3;\nconst DRIFT = 10;\nconst SNAP = 3;\nconst SPARK = 8;\nconst SLIDE = 11;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\ntype Piece = {\n key: string;\n /** Pivot / contact point in mark units (0..2). */\n px: number;\n py: number;\n render: (c: number) => React.ReactNode;\n};\n\nexport function PuzzleSnap(props: PuzzleSnapProps) {\n const {\n children,\n backgroundColor,\n primaryColor,\n secondaryColor,\n sparkColor,\n square,\n seed,\n speed,\n } = { ...puzzleSnapDefaults, ...props };\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n const s = Math.min(width, height);\n const size = Math.round(s * 0.2);\n const c = size / 2;\n const gap = c * 0.08;\n\n const pieces: Piece[] = [\n {\n key: \"quarter\",\n px: 0.6,\n py: 0.6,\n render: (u) => (\n <path\n d={`M ${u - gap} ${u - gap} L 0 ${u - gap} A ${u - gap} ${u - gap} 0 0 1 ${u - gap} 0 Z`}\n fill={primaryColor}\n />\n ),\n },\n {\n key: \"dot\",\n px: 1.5,\n py: 0.5,\n render: (u) => (\n <circle cx={u * 1.5} cy={u * 0.5} r={u * 0.36} fill={secondaryColor} />\n ),\n },\n {\n key: \"wedge\",\n px: 0.65,\n py: 1.35,\n render: (u) => (\n <path\n d={`M ${u - gap} ${u + gap} L ${u - gap} ${2 * u} L 0 ${2 * u} Z`}\n fill={secondaryColor}\n />\n ),\n },\n ...(square\n ? [\n {\n key: \"square\",\n px: 1.5,\n py: 1.5,\n render: (u: number) => (\n <rect\n x={u * 1.18}\n y={u * 1.18}\n width={u * 0.64}\n height={u * 0.64}\n rx={u * 0.08}\n fill={primaryColor}\n />\n ),\n },\n ]\n : []),\n ];\n const lastContact = (pieces.length - 1) * STAGGER + DRIFT + SNAP;\n\n const punch = spring({\n frame: t - lastContact,\n fps,\n config: { damping: 9, stiffness: 260, mass: 0.5 },\n });\n const markScale = t < lastContact ? 1 : 1 + 0.08 * (1 - punch);\n const slide = interpolate(\n t,\n [lastContact + 2, lastContact + 2 + SLIDE],\n [0, 1],\n {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n },\n );\n const reveal = interpolate(\n t,\n [lastContact + 4, lastContact + 4 + SLIDE],\n [0, 1],\n { ...clamp, easing: Easing.out(Easing.cubic) },\n );\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: size * 0.24,\n // Shift the row so the mark sits dead center until it slides over.\n transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox={`0 0 ${size} ${size}`}\n style={{\n flexShrink: 0,\n overflow: \"visible\",\n transform: `scale(${markScale})`,\n }}\n >\n {pieces.map((piece, i) => {\n const local = t - i * STAGGER;\n const angle = random(`puzzle-snap-${seed}-${i}-a`) * Math.PI * 2;\n const dist =\n s * (0.42 + 0.22 * random(`puzzle-snap-${seed}-${i}-d`));\n const spin =\n (random(`puzzle-snap-${seed}-${i}-r`) > 0.5 ? 1 : -1) *\n (120 + 160 * random(`puzzle-snap-${seed}-${i}-s`));\n // Drift most of the way in, then get yanked onto the slot.\n const remain =\n local < DRIFT\n ? interpolate(local, [0, DRIFT], [1, 0.2], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n })\n : interpolate(local, [DRIFT, DRIFT + SNAP], [0.2, 0], {\n ...clamp,\n easing: Easing.in(Easing.quad),\n });\n const ox = Math.cos(angle) * dist * remain;\n const oy = Math.sin(angle) * dist * remain;\n const pivotX = piece.px * c;\n const pivotY = piece.py * c;\n const opacity = interpolate(local, [0, 3], [0, 1], clamp);\n const sparkT = (local - DRIFT - SNAP) / SPARK;\n return (\n <g key={piece.key}>\n <g\n opacity={opacity}\n transform={`translate(${ox} ${oy}) rotate(${spin * remain} ${pivotX} ${pivotY})`}\n >\n {piece.render(c)}\n </g>\n {sparkT >= 0 &&\n sparkT < 1 &&\n Array.from({ length: 6 }, (_, k) => {\n const a =\n (k / 6) * Math.PI * 2 +\n random(`puzzle-snap-${seed}-${i}-spark`) * Math.PI;\n const e = Easing.out(Easing.cubic)(sparkT);\n const r0 = c * (0.45 + 0.4 * e);\n const r1 = r0 + c * 0.28 * (1 - 0.5 * e);\n return (\n <line\n key={k}\n x1={pivotX + Math.cos(a) * r0}\n y1={pivotY + Math.sin(a) * r0}\n x2={pivotX + Math.cos(a) * r1}\n y2={pivotY + Math.sin(a) * r1}\n stroke={sparkColor}\n strokeWidth={Math.max(1, c * 0.05 * (1 - sparkT))}\n strokeLinecap=\"round\"\n opacity={1 - sparkT}\n />\n );\n })}\n </g>\n );\n })}\n </svg>\n {children && (\n <div\n style={{\n opacity: reveal,\n clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,\n transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,\n }}\n >\n {children}\n </div>\n )}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/puzzle-snap.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.jsonindex 235823c1..5bba8479 100644--- a/registry-artifacts/registry.json+++ b/registry-artifacts/registry.json@@ -3663,6 +3663,538 @@],"type": "registry:component"},+ {+ "name": "iris-wipe",+ "title": "Iris Wipe",+ "description": "An old-cartoon iris closes on the subject, holds a beat as a dot, then opens on the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/iris-wipe/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/iris-wipe.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "venetian-blinds",+ "title": "Venetian Blinds",+ "description": "The outgoing scene splits into horizontal slats that turn edge-on in a staggered ripple, revealing the next scene behind them.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/venetian-blinds/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/venetian-blinds.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "paper-tear",+ "title": "Paper Tear",+ "description": "A jagged rip runs down the frame, then both halves peel apart on a spring with white fibrous torn edges, revealing the scene underneath.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/paper-tear/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/paper-tear.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "pixel-sort",+ "title": "Pixel Sort",+ "description": "The scene melts into seeded vertical streaks like glitch-art pixel sorting, then the next scene's columns fall in and snap into place.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/pixel-sort/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/pixel-sort.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "light-leak",+ "title": "Light Leak",+ "description": "A warm analog light leak drifts in from an edge and blows the frame out to near-white at the cut, then cools off to reveal the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/light-leak/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/light-leak.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "orbit-lock",+ "title": "Orbit Lock",+ "description": "Three moons ride tilted, shrinking orbits into a red core that bursts into a ring flash and springs the logo into place.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/orbit-lock/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/orbit-lock.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "puzzle-snap",+ "title": "Puzzle Snap",+ "description": "Geometric pieces spin in from scattered positions and magnet-snap into a mark with a spark burst, then the mark slides aside for the wordmark.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/puzzle-snap/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/puzzle-snap.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "spotlight",+ "title": "Spotlight",+ "description": "A soft spotlight cone searches the dark stage, overshoots, and lands on the logo before the house lights lift.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/spotlight/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/spotlight.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "neon-sign",+ "title": "Neon Sign",+ "description": "A glass neon tube stutters alive segment by segment with a hot white core and wall glow, buzzes off once, then holds lit.",+ "dependencies": ["remotion", "@remotion/paths"],+ "files": [+ {+ "path": "registry/remocn/neon-sign/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/neon-sign.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "inflate",+ "title": "Inflate",+ "description": "A deflated red sliver puffs up like a balloon toy, overshoots, squashes wide and settles into a glossy rounded mark.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/inflate/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/inflate.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "liquid-fill",+ "title": "Liquid Fill",+ "description": "A drop falls into an outlined mark and liquid rises with a sloshing, damping surface and bubbles until the mark is solid.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/liquid-fill/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/liquid-fill.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "accordion-unfold",+ "title": "Accordion Unfold",+ "description": "A tight paper zigzag unfolds sideways into a flat card with the logo printed across it.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/accordion-unfold/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/accordion-unfold.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "anamorphic-flare",+ "title": "Anamorphic Flare",+ "description": "A point of light grows into a cinematic anamorphic streak that sweeps the frame and reveals the logo in its wake.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/anamorphic-flare/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/anamorphic-flare.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "pendulum-wave",+ "title": "Pendulum Wave",+ "description": "A row of pendulums with tuned periods drifts from a straight line into waves and braids, then realigns for a seamless loop.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/pendulum-wave/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/pendulum-wave.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "flow-field",+ "title": "Flow Field",+ "description": "Hundreds of particles ride a seeded noise field, leaving silky fading trails in a seamless loop.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/flow-field/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/flow-field.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "isometric-build",+ "title": "Isometric Build",+ "description": "An isometric tile grid springs up row by row into a stepped block sculpture with one accent tower, then holds.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/isometric-build/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/isometric-build.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "life-grid",+ "title": "Life Grid",+ "description": "Conway's Game of Life plays out on a seeded grid, with newborn cells flashing in the accent.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/life-grid/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/life-grid.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "string-art",+ "title": "String Art",+ "description": "Threads string a ring of pins times-table style while the multiplier morphs from cardioid to nephroid and beyond.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/string-art/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/string-art.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "topo-lines",+ "title": "Topo Lines",+ "description": "Topographic contour lines around a few seeded peaks breathe and shift in a seamless loop, one contour picked out in the accent color.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/topo-lines/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/topo-lines.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "phyllotaxis",+ "title": "Phyllotaxis",+ "description": "Seeds spiral out at the golden angle into a sunflower head, then an accent Fibonacci arm pulses outward.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/phyllotaxis/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/phyllotaxis.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "hyperspace",+ "title": "Hyperspace",+ "description": "A deterministic starfield stretches into radial streaks, the scene tunnels forward and a white flash at the cut reveals the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/hyperspace/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/hyperspace.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "parallax-depth",+ "title": "Parallax Depth",+ "description": "A flat landscape built from depth layers trucks sideways with a gentle push-in, near layers sliding faster than far ones.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/parallax-depth/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/parallax-depth.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "dolly-zoom",+ "title": "Dolly Zoom",+ "description": "The vertigo shot: a perspective corridor with a red door stretches deeper while the subject in the center holds its exact size.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/dolly-zoom/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/dolly-zoom.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "turntable",+ "title": "Turntable",+ "description": "A product card spins on an invisible turntable through front, edge and back in real 3D, with face shading and a breathing floor shadow.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/turntable/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/turntable.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "gravity-pile",+ "title": "Gravity Pile",+ "description": "Seeded circles, squares and triangles rain down, bounce off the floor and each other, and settle into a heap.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/gravity-pile/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/gravity-pile.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "cloth-reveal",+ "title": "Cloth Reveal",+ "description": "A satin sheet draped over the content is yanked from one corner, folding and fluttering as a simulated cloth before it clears the frame.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/cloth-reveal/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/cloth-reveal.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "exploded-view",+ "title": "Exploded View",+ "description": "An isometric stack of slabs springs apart with leader lines and labels, holds, then clicks back together.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/exploded-view/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/exploded-view.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "tiny-planet",+ "title": "Tiny Planet",+ "description": "A seeded flat skyline bends into a tiny planet through a polar remap, then slowly spins beside a red sun.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/tiny-planet/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/tiny-planet.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "impact-shake",+ "title": "Impact Shake",+ "description": "Heavy content slams in from above with squash, a damped camera jolt, a two-frame RGB split and dust puffs kicking out sideways.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/impact-shake/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/impact-shake.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "riso-print",+ "title": "Riso Print",+ "description": "A two-ink risograph print: the accent plate slides in off-register, wobbles and settles a hair out of alignment over grainy paper.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/riso-print/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/riso-print.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "line-boil",+ "title": "Line Boil",+ "description": "A hand-drawn outline boils like a cel animation, redrawn every few frames with a varying pen weight, then fills with color while it keeps boiling.",+ "dependencies": ["remotion", "@remotion/paths"],+ "files": [+ {+ "path": "registry/remocn/line-boil/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/line-boil.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "blueprint",+ "title": "Blueprint",+ "description": "The product wipes left to right into a technical drawing: blueprint grid, white linework, dimension lines with ticks, labels and a red callout.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/blueprint/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/blueprint.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "duotone-beat",+ "title": "Duotone Beat",+ "description": "A two-ink halftone portrait swaps its ink pair on every beat, with a punch-in on the downbeat and a bar indicator.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/duotone-beat/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/duotone-beat.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "comic-panels",+ "title": "Comic Panels",+ "description": "The frame cracks into a three-panel comic page with speed lines, red halftone and a starburst, then the action panel bursts into a full-frame POW.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/comic-panels/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/comic-panels.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "long-shadow",+ "title": "Long Shadow",+ "description": "A flat icon casts a long shadow to the frame edge, then the light swings and the shadow sweeps around on a spring.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/long-shadow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/long-shadow.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "synthwave",+ "title": "Synthwave",+ "description": "A retro neon horizon: a scrolling perspective grid, a rising striped sun and mountain ranges that slide in.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/synthwave/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/synthwave.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "brick-mosaic",+ "title": "Brick Mosaic",+ "description": "Toy bricks drop in row by row from the bottom with a tiny bounce, rebuilding a pixel-art logo on a baseplate.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/brick-mosaic/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/brick-mosaic.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "x-ray-scan",+ "title": "X-Ray Scan",+ "description": "A glowing scanner bar sweeps across a device, turning the shell dark and revealing white-line internals with one part in red.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/x-ray-scan/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/x-ray-scan.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "remocn-ui","title": "remocn UI Core",diff --git a/registry-artifacts/riso-print.json b/registry-artifacts/riso-print.jsonnew file mode 100644index 00000000..29ac7378--- /dev/null+++ b/registry-artifacts/riso-print.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "riso-print",+ "title": "Riso Print",+ "description": "A two-ink risograph print: the accent plate slides in off-register, wobbles and settles a hair out of alignment over grainy paper.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/riso-print/index.tsx",+ "content": "\"use client\";\n\nimport { type ReactNode, useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type RisoPrintProps = {\n /** Subject printed in both inks. Dark tones go to the key plate, warm tones to the accent plate. */\n children?: ReactNode;\n /** [key ink, accent ink]. */\n inks?: [string, string];\n /** Key ink. Overrides `inks[0]` when set. */\n keyInk?: string;\n /** Accent ink. Overrides `inks[1]` when set. */\n accentInk?: string;\n paper?: string;\n /** Final misregistration of the accent plate, in px at 720p. */\n offset?: [number, number];\n /** Ink speckle and paper tooth, 0 to 1. */\n grain?: number;\n /** Stop-motion wobble of the accent plate after it settles, in px at 720p. 0 disables. */\n jitter?: number;\n /** Print registration marks in the corners. */\n marks?: boolean;\n speed?: number;\n};\n\nexport const risoPrintDefaults = {\n inks: [\"#111111\", \"#E5322D\"] as [string, string],\n paper: \"#F2F0EA\",\n offset: [7, -5] as [number, number],\n grain: 0.5,\n jitter: 1.2,\n marks: true,\n speed: 1,\n};\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\n// Coverage = A - channel: the key plate takes everything without red (blacks,\n// blues), the accent plate everything without green (reds, blacks). Black\n// therefore prints in both plates, like a rich black on a real riso.\nconst plateMatrix = (channel: 0 | 1) => {\n const k = 1.4;\n const r = channel === 0 ? -k : 0;\n const g = channel === 1 ? -k : 0;\n return `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${r} ${g} 0 ${k} -0.2`;\n};\n\nfunction PosterPlate({\n plate,\n width,\n height,\n}: {\n plate: 0 | 1;\n width: number;\n height: number;\n}) {\n const s = Math.min(width, height);\n const cx = width / 2;\n const cy = height / 2;\n return (\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n role=\"img\"\n aria-label=\"Geometric poster\"\n >\n {plate === 0 ? (\n <g fill=\"#000\">\n <rect\n x={cx - 0.42 * s}\n y={cy - 0.1 * s}\n width={0.36 * s}\n height={0.36 * s}\n />\n {[0, 1, 2].map((i) => (\n <rect\n key={i}\n x={cx + 0.2 * s}\n y={cy + 0.2 * s + i * 0.045 * s}\n width={(0.3 - i * 0.07) * s}\n height={0.018 * s}\n />\n ))}\n </g>\n ) : (\n <g fill=\"#000\">\n <circle cx={cx + 0.08 * s} cy={cy - 0.04 * s} r={0.26 * s} />\n <rect\n x={cx - 0.46 * s}\n y={cy - 0.34 * s}\n width={0.07 * s}\n height={0.07 * s}\n />\n </g>\n )}\n </svg>\n );\n}\n\nfunction Marks({ width, height }: { width: number; height: number }) {\n const s = Math.min(width, height);\n const m = 0.06 * s;\n const r = 0.018 * s;\n const points = [\n [m, m],\n [width - m, m],\n [m, height - m],\n [width - m, height - m],\n ];\n return (\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0 }}\n role=\"img\"\n aria-label=\"Registration marks\"\n >\n {points.map(([x, y]) => (\n <g key={`${x}-${y}`} stroke=\"#000\" strokeWidth={0.0035 * s} fill=\"none\">\n <circle cx={x} cy={y} r={r} />\n <line x1={x - r * 1.7} y1={y} x2={x + r * 1.7} y2={y} />\n <line x1={x} y1={y - r * 1.7} x2={x} y2={y + r * 1.7} />\n </g>\n ))}\n </svg>\n );\n}\n\nexport function RisoPrint({\n children,\n inks: inksProp = risoPrintDefaults.inks,\n keyInk,\n accentInk,\n paper = risoPrintDefaults.paper,\n offset = risoPrintDefaults.offset,\n grain = risoPrintDefaults.grain,\n jitter = risoPrintDefaults.jitter,\n marks = risoPrintDefaults.marks,\n speed = risoPrintDefaults.speed,\n}: RisoPrintProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const inks: [string, string] = [\n keyInk ?? inksProp[0],\n accentInk ?? inksProp[1],\n ];\n const unit = Math.min(width, height) / 720;\n const t = (frame / fps) * 30 * speed;\n const g = Math.max(0, Math.min(1, grain));\n\n // Key plate: the ink hits the paper.\n const press = interpolate(t, [0, 8], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n\n // Accent plate: slides in off-register, wobbles, settles a hair off.\n const slide = spring({\n frame: t - 4,\n fps: 30,\n config: { damping: 9, stiffness: 120, mass: 0.8 },\n });\n const step = Math.floor(t / 4);\n const jitterIn = interpolate(t, [26, 34], [0, 1], clamp);\n const jx = (random(`riso-jx-${step}`) - 0.5) * 2 * jitter * unit * jitterIn;\n const jy = (random(`riso-jy-${step}`) - 0.5) * 2 * jitter * unit * jitterIn;\n const ax = interpolate(slide, [0, 1], [-0.22 * width, offset[0] * unit]) + jx;\n const ay = interpolate(slide, [0, 1], [0.08 * height, offset[1] * unit]) + jy;\n const arot = interpolate(slide, [0, 1], [-4, 0.35]);\n const aopacity = interpolate(t, [4, 8], [0, 1], clamp);\n\n const speckle = `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${-5 * g} 0 0 0 ${1 + 5 * g * 0.56}`;\n const plates = [\n {\n ink: inks[0],\n transform: `scale(${interpolate(press, [0, 1], [1.035, 1])})`,\n opacity: press * 0.94,\n },\n {\n ink: inks[1],\n transform: `translate(${ax}px, ${ay}px) rotate(${arot}deg)`,\n opacity: aopacity * 0.9,\n },\n ];\n\n return (\n <AbsoluteFill style={{ backgroundColor: paper, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <defs>\n {plates.map((plate, i) => (\n <filter\n key={plate.ink + i}\n id={`${id}-plate-${i}`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feColorMatrix\n in=\"SourceGraphic\"\n type=\"matrix\"\n values={plateMatrix(i as 0 | 1)}\n result=\"coverage\"\n />\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={0.9 / unit}\n numOctaves={2}\n seed={7 + i * 13}\n result=\"noise\"\n />\n <feColorMatrix\n in=\"noise\"\n type=\"matrix\"\n values={speckle}\n result=\"mask\"\n />\n <feComposite\n in=\"coverage\"\n in2=\"mask\"\n operator=\"in\"\n result=\"inked\"\n />\n <feFlood floodColor={plate.ink} result=\"ink\" />\n <feComposite in=\"ink\" in2=\"inked\" operator=\"in\" />\n </filter>\n ))}\n <filter\n id={`${id}-paper`}\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n colorInterpolationFilters=\"sRGB\"\n >\n <feTurbulence\n type=\"fractalNoise\"\n baseFrequency={0.65 / unit}\n numOctaves={3}\n seed={3}\n />\n <feColorMatrix\n type=\"matrix\"\n values={`0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0 0.12 ${0.5 * g} 0 0 0 ${-0.18 * g}`}\n />\n </filter>\n </defs>\n </svg>\n {plates.map((plate, i) => (\n <AbsoluteFill\n key={plate.ink + i}\n style={{\n filter: `url(#${id}-plate-${i})`,\n mixBlendMode: \"multiply\",\n opacity: plate.opacity,\n transform: plate.transform,\n }}\n >\n {children ? (\n <AbsoluteFill\n style={{ alignItems: \"center\", justifyContent: \"center\" }}\n >\n {children}\n </AbsoluteFill>\n ) : (\n <PosterPlate plate={i as 0 | 1} width={width} height={height} />\n )}\n {marks ? <Marks width={width} height={height} /> : null}\n </AbsoluteFill>\n ))}\n <svg\n width={width}\n height={height}\n style={{ position: \"absolute\", inset: 0, mixBlendMode: \"multiply\" }}\n aria-hidden\n >\n <rect\n width={width}\n height={height}\n fill=\"#fff\"\n filter={`url(#${id}-paper)`}\n />\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/riso-print.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/spotlight.json b/registry-artifacts/spotlight.jsonnew file mode 100644index 00000000..fa03c536--- /dev/null+++ b/registry-artifacts/spotlight.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "spotlight",+ "title": "Spotlight",+ "description": "A soft spotlight cone searches the dark stage, overshoots, and lands on the logo before the house lights lift.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/spotlight/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport { useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type SpotlightProps = {\n /** Lockup the beam lands on. Falls back to a placeholder \"remocn\" lockup. */\n children?: React.ReactNode;\n /** Color of the light cone and floor pool. */\n beamColor?: string;\n /** Dark stage behind everything. */\n stageColor?: string;\n /** Brightness of the unlit lockup, 0 to 1. */\n dim?: number;\n speed?: number;\n};\n\nexport const spotlightDefaults = {\n beamColor: \"#FFFFFF\",\n stageColor: \"#111111\",\n dim: 0.16,\n speed: 1,\n};\n\nconst SEARCH = 12;\nconst SWING = 26;\nconst HOUSE = 38;\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst PLACEHOLDER_FONT =\n \"-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif\";\n\n// Neutral lockup shown when no children are passed.\nfunction PlaceholderLockup({\n mark,\n dot,\n text,\n scale = 1,\n}: {\n mark: string;\n dot: string;\n text: string;\n scale?: number;\n}) {\n return (\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 28 * scale }}>\n <div\n style={{\n width: 120 * scale,\n height: 120 * scale,\n borderRadius: 32 * scale,\n backgroundColor: mark,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 36 * scale,\n height: 36 * scale,\n borderRadius: \"50%\",\n backgroundColor: dot,\n }}\n />\n </div>\n <span\n style={{\n fontFamily: PLACEHOLDER_FONT,\n fontSize: 104 * scale,\n fontWeight: 800,\n letterSpacing: \"-0.04em\",\n color: text,\n }}\n >\n remocn\n </span>\n </div>\n );\n}\n\nexport function Spotlight(props: SpotlightProps) {\n const { children, beamColor, stageColor, dim, speed } = {\n ...spotlightDefaults,\n ...props,\n };\n const uid = `spotlight-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = frame * Math.max(0, speed);\n\n // Beam target, as a fraction of the width: search left, overshoot right, land.\n let target: number;\n if (t < SEARCH) {\n target = interpolate(t, [0, SEARCH], [0.14, 0.27], {\n ...clamp,\n easing: Easing.inOut(Easing.sin),\n });\n } else if (t < SWING) {\n target = interpolate(t, [SEARCH, SWING], [0.27, 0.74], {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n } else {\n const land = spring({\n frame: t - SWING,\n fps,\n config: { damping: 11, stiffness: 120, mass: 0.8 },\n });\n target = 0.74 + (0.5 - 0.74) * land;\n }\n\n const tx = target * width;\n const apexX = width / 2;\n const apexY = -height * 0.12;\n const floorY = height * 0.8;\n const spread = width * 0.27;\n const apexHalf = width * 0.012;\n\n const beamOn = interpolate(t, [0, 5], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.quad),\n });\n const house = interpolate(t, [HOUSE, HOUSE + 12], [0, 1], {\n ...clamp,\n easing: Easing.inOut(Easing.sin),\n });\n const coverage = Math.max(0, 1 - Math.abs(target - 0.5) / 0.3);\n const lit = Math.max(\n dim,\n dim + (1 - dim) * Easing.inOut(Easing.quad)(coverage) * beamOn,\n );\n const brightness =\n t >= SWING + 10 ? Math.max(lit, Math.min(1, lit + house)) : lit;\n const blur = width * 0.012;\n\n return (\n <AbsoluteFill style={{ backgroundColor: stageColor }}>\n <AbsoluteFill\n style={{\n background: `radial-gradient(ellipse 80% 70% at 50% 40%, ${beamColor} 0%, transparent 70%)`,\n opacity: 0.09 * house,\n }}\n />\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n >\n <defs>\n <linearGradient\n id={`${uid}-beam`}\n gradientUnits=\"userSpaceOnUse\"\n x1={0}\n y1={apexY}\n x2={0}\n y2={floorY}\n >\n <stop offset=\"0\" stopColor={beamColor} stopOpacity={0.55} />\n <stop offset=\"0.6\" stopColor={beamColor} stopOpacity={0.2} />\n <stop offset=\"1\" stopColor={beamColor} stopOpacity={0.12} />\n </linearGradient>\n <radialGradient id={`${uid}-pool`}>\n <stop offset=\"0\" stopColor={beamColor} stopOpacity={0.45} />\n <stop offset=\"0.6\" stopColor={beamColor} stopOpacity={0.14} />\n <stop offset=\"1\" stopColor={beamColor} stopOpacity={0} />\n </radialGradient>\n <filter\n id={`${uid}-soft`}\n x={-width}\n y={-height}\n width={width * 3}\n height={height * 3}\n filterUnits=\"userSpaceOnUse\"\n >\n <feGaussianBlur stdDeviation={blur} />\n </filter>\n </defs>\n <g opacity={beamOn * (1 - 0.35 * house)}>\n <ellipse\n cx={tx}\n cy={floorY}\n rx={spread * 1.25}\n ry={height * 0.07}\n fill={`url(#${uid}-pool)`}\n />\n <polygon\n points={`${apexX - apexHalf},${apexY} ${apexX + apexHalf},${apexY} ${tx + spread},${floorY} ${tx - spread},${floorY}`}\n fill={`url(#${uid}-beam)`}\n filter={`url(#${uid}-soft)`}\n />\n </g>\n </svg>\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n filter: `brightness(${brightness})`,\n }}\n >\n {children ?? (\n <PlaceholderLockup\n mark={beamColor}\n dot={stageColor}\n text={beamColor}\n />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/spotlight.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/string-art.json b/registry-artifacts/string-art.jsonnew file mode 100644index 00000000..4d003b47--- /dev/null+++ b/registry-artifacts/string-art.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "string-art",+ "title": "String Art",+ "description": "Threads string a ring of pins times-table style while the multiplier morphs from cardioid to nephroid and beyond.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/string-art/index.tsx",+ "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type StringArtProps = {\n /** Pins around the ring. */\n pins?: number;\n /** Multiplier at the start (2 draws a cardioid). */\n from?: number;\n /** Multiplier at the end (3 is a nephroid, 4 a three-cusp epicycloid). */\n to?: number;\n /** Frames for the threads to be strung, one pin after another. */\n stringFrames?: number;\n /** Frames for the multiplier to drift from `from` to `to`. */\n morphFrames?: number;\n /** Length of the accent sweep, as a share of all threads; 0 disables. */\n sweep?: number;\n /** Pins per frame the accent sweep travels once the threads are strung. */\n sweepSpeed?: number;\n /** Thread opacity, 0 to 1. */\n threadOpacity?: number;\n /** Show the running multiplier in the corner. */\n showLabel?: boolean;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nexport const stringArtDefaults: Required<StringArtProps> = {\n pins: 200,\n from: 2,\n to: 4,\n stringFrames: 60,\n morphFrames: 240,\n sweep: 0.08,\n sweepSpeed: 0.9,\n threadOpacity: 0.42,\n showLabel: true,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst TAU = Math.PI * 2;\nconst MORPH_DELAY = 24;\n// Share of each integer step spent holding on the clean integer figure.\nconst HOLD = 0.3;\nconst SWEEP_BUCKETS = 4;\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\nexport function StringArt({\n pins = stringArtDefaults.pins,\n from = stringArtDefaults.from,\n to = stringArtDefaults.to,\n stringFrames: stringFramesProp = stringArtDefaults.stringFrames,\n morphFrames: morphFramesProp = stringArtDefaults.morphFrames,\n sweep = stringArtDefaults.sweep,\n sweepSpeed = stringArtDefaults.sweepSpeed,\n threadOpacity = stringArtDefaults.threadOpacity,\n showLabel = stringArtDefaults.showLabel,\n speed = stringArtDefaults.speed,\n background = stringArtDefaults.background,\n color = stringArtDefaults.color,\n accent = stringArtDefaults.accent,\n}: StringArtProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const n = Math.max(8, Math.round(pins));\n const unit = Math.min(width, height) / 720;\n const radius = Math.min(width, height) * 0.42;\n const cx = width / 2;\n const cy = height / 2;\n const time = frame * speed;\n // interpolate() needs a strictly increasing range.\n const stringFrames = Math.max(1, stringFramesProp);\n const morphFrames = Math.max(1, morphFramesProp);\n\n const strung = interpolate(time, [0, stringFrames], [0, n], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.quad),\n });\n const morphStart = stringFrames + MORPH_DELAY;\n // The multiplier walks through each integer table (cardioid, nephroid, ...)\n // with an eased step and a short hold on every clean figure.\n const span = to - from;\n const steps = Math.max(1, Math.ceil(Math.abs(span) - 1e-6));\n const u =\n interpolate(time, [morphStart, morphStart + morphFrames], [0, steps], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }) - 1e-9;\n const step = Math.max(0, Math.floor(u));\n const within = Easing.inOut(Easing.cubic)(\n Math.min(1, Math.max(0, (u - step) / (1 - HOLD))),\n );\n const k = from + (span * Math.min(steps, step + within)) / steps;\n\n // Pin 0 sits on the left so the cardioid cusp points left and the figure is\n // symmetric about the horizontal axis. Angles stay continuous in k, so the\n // pattern morphs smoothly instead of snapping between integer tables.\n const point = (index: number) => {\n const a = Math.PI + (TAU * index) / n;\n return { x: cx + Math.cos(a) * radius, y: cy + Math.sin(a) * radius };\n };\n const xy = (p: { x: number; y: number }) => `${fmt(p.x)} ${fmt(p.y)}`;\n\n let threads = \"\";\n const accents: string[] = new Array(SWEEP_BUCKETS).fill(\"\");\n const whole = Math.floor(strung);\n // The accent sweep rides the stringing head, then keeps circling the ring.\n const head = strung + Math.max(0, time - stringFrames) * sweepSpeed;\n const tail = Math.max(0, sweep) * n;\n for (let i = 0; i < Math.ceil(strung); i++) {\n const start = point(i);\n const end = point(k * i);\n // The thread being strung right now grows from its pin to the target.\n const f = i < whole ? 1 : strung - whole;\n const tip = {\n x: start.x + (end.x - start.x) * f,\n y: start.y + (end.y - start.y) * f,\n };\n const d = `M ${xy(start)} L ${xy(tip)} `;\n const behind = (((head - i) % n) + n) % n;\n if (tail > 0 && behind < tail) {\n accents[\n Math.min(SWEEP_BUCKETS - 1, Math.floor((behind / tail) * SWEEP_BUCKETS))\n ] += d;\n } else threads += d;\n }\n\n let pinDots = \"\";\n const pr = 1.6 * unit;\n for (let i = 0; i < n; i++) {\n const { x, y } = point(i);\n pinDots += `M ${fmt(x - pr)} ${fmt(y)} a ${fmt(pr)} ${fmt(pr)} 0 1 0 ${fmt(pr * 2)} 0 a ${fmt(pr)} ${fmt(pr)} 0 1 0 ${fmt(-pr * 2)} 0 `;\n }\n const pinsIn = interpolate(time, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const labelIn = interpolate(\n time,\n [stringFrames - 10, stringFrames + 6],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"String art times table\"\n style={{ display: \"block\" }}\n >\n <path d={pinDots} fill={color} fillOpacity={0.55 * pinsIn} />\n <path\n d={threads}\n fill=\"none\"\n stroke={color}\n strokeOpacity={threadOpacity}\n strokeWidth={unit}\n strokeLinecap=\"round\"\n />\n <g fill=\"none\" stroke={accent} strokeLinecap=\"round\">\n {accents.map((d, b) => (\n <path\n key={b}\n d={d}\n strokeOpacity={1 - b / SWEEP_BUCKETS}\n strokeWidth={unit * (1.6 - b * 0.15)}\n />\n ))}\n </g>\n </svg>\n {showLabel ? (\n <div\n style={{\n position: \"absolute\",\n left: width * 0.06,\n bottom: height * 0.08,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n fontSize: 22 * unit,\n letterSpacing: \"0.04em\",\n color,\n opacity: 0.7 * labelIn,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n <span style={{ color: accent }}>i → </span>\n {k.toFixed(2)} · i mod {n}\n </div>\n ) : null}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/string-art.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/synthwave.json b/registry-artifacts/synthwave.jsonnew file mode 100644index 00000000..18d3adc4--- /dev/null+++ b/registry-artifacts/synthwave.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "synthwave",+ "title": "Synthwave",+ "description": "A retro neon horizon: a scrolling perspective grid, a rising striped sun and mountain ranges that slide in.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/synthwave/index.tsx",+ "content": "\"use client\";\n\nimport { useId, useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type SynthwaveColors = {\n skyTop: string;\n skyHorizon: string;\n sunTop: string;\n sunBottom: string;\n grid: string;\n floor: string;\n mountainsBack: string;\n mountainsFront: string;\n};\n\nexport type SynthwaveProps = {\n colors?: Partial<SynthwaveColors>;\n /** Grid line color. Overrides `colors.grid` when set. */\n grid?: string;\n /** Top of the sun gradient. Overrides `colors.sunTop` when set. */\n sunTop?: string;\n /** Bottom of the sun gradient. Overrides `colors.sunBottom` when set. */\n sunBottom?: string;\n /** Sky glow at the horizon. Overrides `colors.skyHorizon` when set. */\n skyHorizon?: string;\n /** Grid rows that pass the viewer per second. */\n gridSpeed?: number;\n /** Horizon height as a fraction of the frame. */\n horizon?: number;\n /** Scroll the sun stripes downward. */\n sunStripes?: boolean;\n speed?: number;\n};\n\nexport const synthwaveDefaults = {\n colors: {\n skyTop: \"#08080B\",\n skyHorizon: \"#3B0C10\",\n sunTop: \"#FFC46B\",\n sunBottom: \"#E5322D\",\n grid: \"#E5322D\",\n floor: \"#0A0A0C\",\n mountainsBack: \"#2A0A0E\",\n mountainsFront: \"#111111\",\n } as SynthwaveColors,\n gridSpeed: 2,\n horizon: 0.6,\n sunStripes: true,\n speed: 1,\n};\n\n/** Frames until the sun and mountains are in place; the grid loops forever. */\nexport const synthwaveLength = 40;\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction ridge(\n seed: string,\n width: number,\n base: number,\n peak: number,\n count: number,\n) {\n // Spans well past both edges so the slide never exposes an end.\n const points: string[] = [`${-0.4 * width},${base}`];\n for (let i = 0; i <= count; i++) {\n const x = -0.4 * width + (i / count) * 1.8 * width;\n const center = Math.min(1, Math.abs(x - width / 2) / (0.45 * width));\n const valley = 0.18 + 0.82 * center * center;\n const jag = 0.45 + 0.55 * random(`${seed}-${i}`);\n const y = base - peak * valley * (i % 2 === 0 ? jag : jag * 0.45);\n points.push(`${x},${y}`);\n }\n points.push(`${1.4 * width},${base}`);\n return points.join(\" \");\n}\n\nexport function Synthwave({\n colors,\n grid,\n sunTop,\n sunBottom,\n skyHorizon,\n gridSpeed = synthwaveDefaults.gridSpeed,\n horizon = synthwaveDefaults.horizon,\n sunStripes = synthwaveDefaults.sunStripes,\n speed = synthwaveDefaults.speed,\n}: SynthwaveProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const merged = { ...synthwaveDefaults.colors, ...colors };\n const c: SynthwaveColors = {\n ...merged,\n grid: grid ?? merged.grid,\n sunTop: sunTop ?? merged.sunTop,\n sunBottom: sunBottom ?? merged.sunBottom,\n skyHorizon: skyHorizon ?? merged.skyHorizon,\n };\n const u = Math.min(W, H) / 720;\n const t = (frame / fps) * 30 * speed;\n const cx = W / 2;\n const yh = horizon * H;\n const floorDepth = H - yh;\n\n // Floor: screen y = yh + floorDepth / z, so z = 1 is the bottom edge.\n const rowGap = 0.5;\n const phase = ((((t / 30) * gridSpeed) % 1) + 1) % 1;\n const rows: { y: number; o: number }[] = [];\n for (let k = 0; k < 70; k++) {\n const z = 0.7 + (k + 1 - phase) * rowGap;\n const y = yh + floorDepth / z;\n if (y > H + 4 * u) continue;\n rows.push({ y, o: interpolate(z, [1, 14, 30], [1, 0.35, 0], clamp) });\n }\n const columns = Array.from({ length: 23 }, (_, i) => i - 11);\n const colSpread = W * 0.16;\n const nearZ = 0.35;\n\n const rise = interpolate(t, [0, 40], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const R = 0.27 * H;\n const sunY = interpolate(rise, [0, 1], [yh + R * 1.05, yh - R * 0.42]);\n const stripePhase = sunStripes ? (((t / 36) % 1) + 1) % 1 : 0;\n const stripes = Array.from({ length: 7 }, (_, i) => {\n const p = (i + stripePhase) / 7;\n const y = sunY + R * (-0.05 + p * 1.05);\n const h = R * (0.012 + 0.09 * p);\n return { y: y - h / 2, h };\n });\n\n const back = useMemo(\n () => ridge(\"synthwave-back\", W, yh, 0.26 * H, 27),\n [W, H, yh],\n );\n const front = useMemo(\n () => ridge(\"synthwave-front\", W, yh, 0.15 * H, 39),\n [W, H, yh],\n );\n // Ranges slide in sideways while rising from behind the horizon.\n const slideBack = interpolate(t, [4, 34], [1, 0], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const slideFront = interpolate(t, [8, 38], [1, 0], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n const stars = Array.from({ length: 70 }, (_, i) => ({\n x: random(`synthwave-sx-${i}`) * W,\n y: random(`synthwave-sy-${i}`) * yh * 0.8,\n r: (0.6 + random(`synthwave-sr-${i}`) * 1.4) * u,\n o:\n 0.25 +\n 0.5 * (0.5 + 0.5 * Math.sin(t * 0.15 + random(`synthwave-sp-${i}`) * 9)),\n }));\n\n return (\n <AbsoluteFill style={{ backgroundColor: c.floor, overflow: \"hidden\" }}>\n <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden>\n <defs>\n <linearGradient id={`${id}-sky`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0\" stopColor={c.skyTop} />\n <stop offset=\"0.55\" stopColor={c.skyTop} />\n <stop offset=\"1\" stopColor={c.skyHorizon} />\n </linearGradient>\n <linearGradient id={`${id}-sun`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0.1\" stopColor={c.sunTop} />\n <stop offset=\"0.85\" stopColor={c.sunBottom} />\n </linearGradient>\n <linearGradient id={`${id}-floor`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0\" stopColor={c.skyHorizon} />\n <stop offset=\"0.25\" stopColor={c.floor} />\n </linearGradient>\n <mask id={`${id}-stripes`}>\n <rect width={W} height={H} fill=\"#fff\" />\n {stripes.map((s, i) => (\n <rect key={i} x={0} y={s.y} width={W} height={s.h} fill=\"#000\" />\n ))}\n </mask>\n <clipPath id={`${id}-above`}>\n <rect width={W} height={yh} />\n </clipPath>\n <filter\n id={`${id}-glow`}\n x=\"-20%\"\n y=\"-20%\"\n width=\"140%\"\n height=\"140%\"\n >\n <feGaussianBlur stdDeviation={4 * u} result=\"blur\" />\n <feMerge>\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n <filter\n id={`${id}-haze`}\n x=\"-50%\"\n y=\"-50%\"\n width=\"200%\"\n height=\"200%\"\n >\n <feGaussianBlur stdDeviation={30 * u} />\n </filter>\n </defs>\n\n <rect width={W} height={yh} fill={`url(#${id}-sky)`} />\n <g fill=\"#FFFFFF\">\n {stars.map((s, i) => (\n <circle key={i} cx={s.x} cy={s.y} r={s.r} opacity={s.o} />\n ))}\n </g>\n\n <g clipPath={`url(#${id}-above)`}>\n <circle\n cx={cx}\n cy={sunY}\n r={R * 1.15}\n fill={c.sunBottom}\n opacity={0.45}\n filter={`url(#${id}-haze)`}\n />\n <circle\n cx={cx}\n cy={sunY}\n r={R}\n fill={`url(#${id}-sun)`}\n mask={`url(#${id}-stripes)`}\n />\n <polygon\n points={back}\n fill={c.mountainsBack}\n transform={`translate(${-0.25 * W * slideBack} ${0.3 * H * slideBack})`}\n />\n <g\n transform={`translate(${0.25 * W * slideFront} ${0.2 * H * slideFront})`}\n >\n <polygon points={front} fill={c.mountainsFront} />\n <polyline\n points={front}\n fill=\"none\"\n stroke={c.grid}\n strokeWidth={1.5 * u}\n strokeOpacity={0.55}\n strokeLinejoin=\"round\"\n />\n </g>\n </g>\n\n <rect y={yh} width={W} height={H - yh} fill={`url(#${id}-floor)`} />\n <g\n stroke={c.grid}\n strokeWidth={2.2 * u}\n filter={`url(#${id}-glow)`}\n fill=\"none\"\n >\n {columns.map((j) => (\n <line\n key={j}\n x1={cx}\n y1={yh}\n x2={cx + (j * colSpread) / nearZ}\n y2={yh + floorDepth / nearZ}\n />\n ))}\n {rows.map((row, i) => (\n <line\n key={i}\n x1={0}\n y1={row.y}\n x2={W}\n y2={row.y}\n strokeOpacity={row.o}\n />\n ))}\n <line x1={0} y1={yh} x2={W} y2={yh} strokeWidth={3 * u} />\n </g>\n {/* Haze that swallows the converging lines at the horizon. */}\n <rect\n y={yh - 6 * u}\n width={W}\n height={0.12 * H}\n fill={c.skyHorizon}\n opacity={0.5}\n filter={`url(#${id}-haze)`}\n />\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/synthwave.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/tiny-planet.json b/registry-artifacts/tiny-planet.jsonnew file mode 100644index 00000000..cf11a5c4--- /dev/null+++ b/registry-artifacts/tiny-planet.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "tiny-planet",+ "title": "Tiny Planet",+ "description": "A seeded flat skyline bends into a tiny planet through a polar remap, then slowly spins beside a red sun.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/tiny-planet/index.tsx",+ "content": "\"use client\";\n\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TinyPlanetColors = {\n sky: string;\n ground: string;\n near: string;\n far: string;\n window: string;\n sun: string;\n};\n\nexport type TinyPlanetProps = {\n /** Buildings in the front row; the back row gets a matching count. */\n buildings?: number;\n seed?: number;\n /** Planet spin once bent, in degrees per frame at 30fps. */\n spin?: number;\n colors?: Partial<TinyPlanetColors>;\n /** Sky color. Overrides `colors.sky`. */\n skyColor?: string;\n /** Sun color. Overrides `colors.sun`. */\n sunColor?: string;\n /** Front-row building color. Overrides `colors.near`. */\n buildingColor?: string;\n /** Ground color. Overrides `colors.ground`. */\n groundColor?: string;\n speed?: number;\n};\n\nexport const tinyPlanetDefaults = {\n buildings: 26,\n seed: 4,\n spin: 0.7,\n colors: {\n sky: \"#111111\",\n ground: \"#262626\",\n near: \"#FFFFFF\",\n far: \"#6B6B6B\",\n window: \"#111111\",\n sun: \"#E5322D\",\n } satisfies TinyPlanetColors,\n speed: 1,\n};\n\nconst BEND_START = 8;\nconst BEND_END = 40;\nconst SPIN_RAMP = 14;\n\ntype Block = { s0: number; s1: number; h: number; row: 0 | 1; spire: number };\n\nfunction makeCity(length: number, height: number, count: number, seed: number) {\n const blocks: Block[] = [];\n for (const row of [1, 0] as const) {\n const n = row === 1 ? Math.round(count * 0.8) : count;\n const slot = length / n;\n for (let i = 0; i < n; i++) {\n const key = `tiny-planet-${seed}-${row}-${i}`;\n const w = slot * (0.55 + random(`${key}-w`) * 0.4);\n const start =\n i * slot + random(`${key}-x`) * (slot - w) + (row ? slot * 0.5 : 0);\n const tall = random(`${key}-h`);\n const h = row\n ? height * (0.13 + tall * 0.16)\n : height * (0.05 + tall * tall * 0.15);\n const spire = random(`${key}-s`) < 0.18 ? height * 0.04 : 0;\n blocks.push({\n s0: start - length / 2,\n s1: start + w - length / 2,\n h,\n row,\n spire,\n });\n }\n }\n return blocks;\n}\n\nexport function TinyPlanet({\n buildings = tinyPlanetDefaults.buildings,\n seed = tinyPlanetDefaults.seed,\n spin = tinyPlanetDefaults.spin,\n colors: colorOverrides,\n skyColor,\n sunColor,\n buildingColor,\n groundColor,\n speed = tinyPlanetDefaults.speed,\n}: TinyPlanetProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...tinyPlanetDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n sky: skyColor ?? baseColors.sky,\n sun: sunColor ?? baseColors.sun,\n near: buildingColor ?? baseColors.near,\n ground: groundColor ?? baseColors.ground,\n };\n const t = (frame * speed * 30) / fps;\n\n // The skyline strip is exactly as long as the planet's circumference.\n const length = width;\n const radius = length / (2 * Math.PI);\n const city = useMemo(\n () => makeCity(length, height, Math.max(4, Math.round(buildings)), seed),\n [length, height, buildings, seed],\n );\n\n const bend = interpolate(t, [BEND_START, BEND_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.cubic),\n });\n // Spin eases in while the strip closes, then turns at a steady rate.\n const spinT = Math.max(0, t - (BEND_END - SPIN_RAMP));\n const turn =\n spinT < SPIN_RAMP\n ? (spin * spinT * spinT) / (2 * SPIN_RAMP)\n : spin * (spinT - SPIN_RAMP / 2);\n const rot = (turn * Math.PI) / 180;\n\n const kappa = Math.max(1e-5, bend / radius);\n const horizon = height * 0.7;\n const tallest = height * 0.33;\n const finalScale = (height * 0.43) / (radius + tallest);\n const scale = 1 + (finalScale - 1) * bend;\n const anchorY = horizon + (height / 2 - finalScale * radius - horizon) * bend;\n\n // Bend: arc-length s and height h onto a circle of curvature kappa whose\n // top sits at the pivot. kappa -> 0 is the flat skyline.\n const map = (s: number, h: number): [number, number] => {\n const a = kappa * s + rot * bend;\n const rr = 1 / kappa + h;\n const x = Math.sin(a) * rr;\n const y = 1 / kappa - Math.cos(a) * rr;\n return [width / 2 + x * scale, anchorY + y * scale];\n };\n const P = (s: number, h: number) =>\n map(s, h)\n .map((v) => v.toFixed(1))\n .join(\",\");\n\n const steps = 160;\n const depth = Math.min(1 / kappa, height * 3);\n let ground = \"\";\n for (let i = 0; i <= steps; i++) {\n const s = -length / 2 + (length * i) / steps;\n ground += `${i ? \"L\" : \"M\"}${P(s, 0)}`;\n }\n for (let i = steps; i >= 0; i--) {\n const s = -length / 2 + (length * i) / steps;\n ground += `L${P(s, -depth)}`;\n }\n\n const sunX = interpolate(bend, [0, 1], [width * 0.7, width * 0.8]);\n const sunY = interpolate(bend, [0, 1], [height * 0.36, height * 0.2]);\n const sunR = height * interpolate(bend, [0, 1], [0.12, 0.075]);\n\n return (\n <AbsoluteFill style={{ backgroundColor: colors.sky, overflow: \"hidden\" }}>\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ position: \"absolute\", inset: 0 }}\n aria-hidden\n >\n <circle cx={sunX} cy={sunY} r={sunR} fill={colors.sun} />\n {city.map((b, i) => {\n const sub = 4;\n const top: string[] = [];\n for (let k = 0; k <= sub; k++)\n top.push(P(b.s0 + ((b.s1 - b.s0) * k) / sub, b.h));\n const mid = (b.s0 + b.s1) / 2;\n const spire = b.spire\n ? ` M${P(mid - 1.5, b.h)} L${P(mid, b.h + b.spire)} L${P(mid + 1.5, b.h)}`\n : \"\";\n const d = `M${P(b.s0, -2)} L${top.join(\" L\")} L${P(b.s1, -2)} Z${spire}`;\n return (\n <path\n key={i}\n d={d}\n fill={b.row ? colors.far : colors.near}\n stroke={b.row ? colors.far : colors.near}\n strokeWidth={b.spire ? 2 * scale : 0}\n />\n );\n })}\n {city.map((b, i) => {\n if (b.row || b.h < height * 0.09) return null;\n const cols = Math.max(1, Math.floor((b.s1 - b.s0) / (height * 0.03)));\n const rows = Math.floor(b.h / (height * 0.04));\n const cells: string[] = [];\n for (let r = 0; r < rows; r++) {\n for (let c = 0; c < cols; c++) {\n if (random(`tiny-planet-${seed}-win-${i}-${r}-${c}`) < 0.55)\n continue;\n const s = b.s0 + ((b.s1 - b.s0) * (c + 0.5)) / cols;\n const h = b.h - height * 0.03 - r * height * 0.04;\n const ws = height * 0.006;\n cells.push(\n `M${P(s - ws, h)} L${P(s + ws, h)} L${P(s + ws, h - ws * 2.2)} L${P(s - ws, h - ws * 2.2)} Z`,\n );\n }\n }\n return (\n <path key={`w${i}`} d={cells.join(\" \")} fill={colors.window} />\n );\n })}\n <path d={ground} fill={colors.ground} />\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/tiny-planet.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/topo-lines.json b/registry-artifacts/topo-lines.jsonnew file mode 100644index 00000000..cb5c2a6a--- /dev/null+++ b/registry-artifacts/topo-lines.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "topo-lines",+ "title": "Topo Lines",+ "description": "Topographic contour lines around a few seeded peaks breathe and shift in a seamless loop, one contour picked out in the accent color.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/topo-lines/index.tsx",+ "content": "\"use client\";\n\nimport { useMemo } from \"react\";\nimport {\n AbsoluteFill,\n random,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TopoLinesProps = {\n /** Number of contour levels. */\n levels?: number;\n /** Number of peaks in the height field (1 to 3 reads best). */\n peaks?: number;\n /** Contour drawn in the accent, counted from the lowest; -1 disables. */\n highlight?: number;\n /** Every n-th contour is a heavier index line; 0 disables. */\n indexEvery?: number;\n /** Sampling cells across the short side; higher is smoother and slower. */\n resolution?: number;\n /** Frames per seamless loop of the breathing field. */\n loopFrames?: number;\n seed?: number;\n speed?: number;\n background?: string;\n color?: string;\n accent?: string;\n};\n\nexport const topoLinesDefaults: Required<TopoLinesProps> = {\n levels: 16,\n peaks: 3,\n highlight: 9,\n indexEvery: 4,\n resolution: 90,\n loopFrames: 300,\n seed: 2,\n speed: 1,\n background: \"#111111\",\n color: \"#FFFFFF\",\n accent: \"#E5322D\",\n};\n\nconst TAU = Math.PI * 2;\n\n// Cone height falls from 1 to 0 over this distance (short side = 1), so\n// contours are evenly spaced like a real survey map.\nconst REACH = 0.95;\n// Smooth-max softness: peaks merge into shared outer rings without creases.\nconst SOFT = 0.045;\n\ntype Peak = {\n x: number;\n y: number;\n amp: number;\n phase: number;\n orbit: number;\n lobes: [number, number];\n};\ntype Ripple = { fx: number; fy: number; phase: number };\n\nfunction makeTerrain(seed: number, peaks: number, w: number, h: number) {\n const r = (k: string) => random(`topo-lines-${seed}-${k}`);\n const m = Math.max(1, Math.round(peaks));\n const turn = r(\"turn\") * TAU;\n const list: Peak[] = Array.from({ length: m }, (_, k) => {\n // Spread peaks around the centre so each keeps its own nest of rings.\n const a = turn + (k * TAU) / m + (r(`j${k}`) - 0.5) * 0.8;\n const spread = m === 1 ? 0.06 : 0.24 + r(`d${k}`) * 0.06;\n return {\n x: w / 2 + Math.cos(a) * spread * w,\n y: h / 2 + Math.sin(a) * spread * h * 1.1,\n amp: k === 0 ? 1 : 0.7 + r(`a${k}`) * 0.22,\n phase: r(`p${k}`) * TAU,\n orbit: 0.025 + r(`o${k}`) * 0.025,\n lobes: [r(`l2${k}`) * TAU, r(`l3${k}`) * TAU],\n };\n });\n const ripples: Ripple[] = Array.from({ length: 3 }, (_, k) => ({\n fx: (r(`rx${k}`) * 2 - 1) * (3 + k * 2),\n fy: (r(`ry${k}`) * 2 - 1) * (3 + k * 2),\n phase: r(`rp${k}`) * TAU,\n }));\n // Height at (x, y). `tau` walks once around a circle per loop: peaks drift\n // on small orbits, breathe, and their low harmonics rotate a whole number\n // of times, so the last frame matches the first.\n return (x: number, y: number, tau: number) => {\n let sum = 0;\n for (const p of list) {\n const px = p.x + Math.cos(tau + p.phase) * p.orbit;\n const py = p.y + Math.sin(tau + p.phase) * p.orbit;\n const dx = x - px;\n const dy = y - py;\n const theta = Math.atan2(dy, dx);\n const warp =\n 1 +\n 0.14 * Math.sin(2 * theta + p.lobes[0] + tau) +\n 0.08 * Math.sin(3 * theta + p.lobes[1] - tau);\n const amp = p.amp * (1 + 0.05 * Math.sin(tau + p.phase));\n const v = amp - (Math.hypot(dx, dy) * warp) / REACH;\n sum += Math.exp(v / SOFT);\n }\n let v = SOFT * Math.log(sum);\n for (const q of ripples) {\n v +=\n 0.03 *\n Math.sin(q.fx * x + q.fy * y + q.phase + Math.sin(tau + q.phase) * 1.4);\n }\n return v;\n };\n}\n\nconst fmt = (n: number) => Math.round(n * 10) / 10;\n\nexport function TopoLines({\n levels = topoLinesDefaults.levels,\n peaks = topoLinesDefaults.peaks,\n highlight = topoLinesDefaults.highlight,\n indexEvery = topoLinesDefaults.indexEvery,\n resolution = topoLinesDefaults.resolution,\n loopFrames = topoLinesDefaults.loopFrames,\n seed = topoLinesDefaults.seed,\n speed = topoLinesDefaults.speed,\n background = topoLinesDefaults.background,\n color = topoLinesDefaults.color,\n accent = topoLinesDefaults.accent,\n}: TopoLinesProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const unit = Math.min(width, height);\n const w = width / unit;\n const h = height / unit;\n const terrain = useMemo(\n () => makeTerrain(seed, peaks, w, h),\n [seed, peaks, w, h],\n );\n const tau = (TAU * frame * speed) / Math.max(1, loopFrames);\n\n const step = 1 / Math.max(20, resolution);\n const nx = Math.ceil(w / step) + 1;\n const ny = Math.ceil(h / step) + 1;\n const field = new Float32Array(nx * ny);\n for (let j = 0; j < ny; j++) {\n for (let i = 0; i < nx; i++) {\n field[j * nx + i] = terrain(i * step, j * step, tau);\n }\n }\n\n const count = Math.max(1, Math.round(levels));\n const thresholds = Array.from(\n { length: count },\n (_, l) => 0.04 + (l * 0.9) / count,\n );\n const paths = { plain: \"\", index: \"\", accent: \"\" };\n const s = step * unit;\n const X = (i: number) => fmt(i * s);\n const Y = (j: number) => fmt(j * s);\n\n // Marching squares. Segments that share a cell edge land on the same\n // interpolated point, so round caps make them read as continuous curves.\n for (let j = 0; j < ny - 1; j++) {\n for (let i = 0; i < nx - 1; i++) {\n const a = field[j * nx + i];\n const b = field[j * nx + i + 1];\n const c = field[(j + 1) * nx + i + 1];\n const d = field[(j + 1) * nx + i];\n const lo = Math.min(a, b, c, d);\n const hi = Math.max(a, b, c, d);\n for (let l = 0; l < count; l++) {\n const t = thresholds[l];\n if (t < lo || t >= hi) continue;\n const code =\n (a > t ? 8 : 0) | (b > t ? 4 : 0) | (c > t ? 2 : 0) | (d > t ? 1 : 0);\n const top = () => `${X(i + (t - a) / (b - a))} ${Y(j)}`;\n const right = () => `${X(i + 1)} ${Y(j + (t - b) / (c - b))}`;\n const bottom = () => `${X(i + (t - d) / (c - d))} ${Y(j + 1)}`;\n const left = () => `${X(i)} ${Y(j + (t - a) / (d - a))}`;\n let seg = \"\";\n switch (code) {\n case 1:\n case 14:\n seg = `M ${left()} L ${bottom()} `;\n break;\n case 2:\n case 13:\n seg = `M ${bottom()} L ${right()} `;\n break;\n case 3:\n case 12:\n seg = `M ${left()} L ${right()} `;\n break;\n case 4:\n case 11:\n seg = `M ${top()} L ${right()} `;\n break;\n case 6:\n case 9:\n seg = `M ${top()} L ${bottom()} `;\n break;\n case 7:\n case 8:\n seg = `M ${left()} L ${top()} `;\n break;\n case 5:\n seg = `M ${left()} L ${top()} M ${bottom()} L ${right()} `;\n break;\n case 10:\n seg = `M ${top()} L ${right()} M ${left()} L ${bottom()} `;\n break;\n }\n if (l === highlight) paths.accent += seg;\n else if (indexEvery > 0 && (l + 1) % indexEvery === 0)\n paths.index += seg;\n else paths.plain += seg;\n }\n }\n }\n\n const px = unit / 720;\n return (\n <AbsoluteFill style={{ backgroundColor: background }}>\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${width} ${height}`}\n role=\"img\"\n aria-label=\"Topographic contour lines\"\n style={{ display: \"block\" }}\n >\n <g fill=\"none\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n <path\n d={paths.plain}\n stroke={color}\n strokeOpacity={0.38}\n strokeWidth={1.1 * px}\n />\n <path\n d={paths.index}\n stroke={color}\n strokeOpacity={0.85}\n strokeWidth={1.8 * px}\n />\n <path d={paths.accent} stroke={accent} strokeWidth={2.6 * px} />\n </g>\n </svg>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/topo-lines.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/turntable.json b/registry-artifacts/turntable.jsonnew file mode 100644index 00000000..baa7f7d7--- /dev/null+++ b/registry-artifacts/turntable.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "turntable",+ "title": "Turntable",+ "description": "A product card spins on an invisible turntable through front, edge and back in real 3D, with face shading and a breathing floor shadow.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/turntable/index.tsx",+ "content": "\"use client\";\n\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TurntableColors = {\n background: string;\n front: string;\n back: string;\n edge: string;\n mark: string;\n shadow: string;\n};\n\nexport type TurntableProps = {\n /** Front face content. Defaults to a red card with a mark. */\n children?: React.ReactNode;\n /** Back face content. Defaults to a dark card. */\n back?: React.ReactNode;\n /** Card thickness in px at 720p. */\n thickness?: number;\n /** Full rotations per spin. */\n turns?: number;\n /** Camera tilt in degrees; positive looks down on the card. */\n tilt?: number;\n colors?: Partial<TurntableColors>;\n /** Default front face color. Overrides `colors.front`. */\n frontColor?: string;\n /** Card edge color. Overrides `colors.edge`. */\n edgeColor?: string;\n /** Default back face color. Overrides `colors.back`. */\n backColor?: string;\n /** Stage background. Overrides `colors.background`. */\n backgroundColor?: string;\n speed?: number;\n};\n\nexport const turntableDefaults = {\n thickness: 22,\n turns: 1,\n tilt: 8,\n colors: {\n background: \"#111111\",\n front: \"#E5322D\",\n back: \"#F2F2F2\",\n edge: \"#A3201C\",\n mark: \"#FFFFFF\",\n shadow: \"#000000\",\n } satisfies TurntableColors,\n speed: 1,\n};\n\nconst START = 6;\nconst END = 64;\n\nfunction DefaultFront({ colors }: { colors: TurntableColors }) {\n return (\n <AbsoluteFill\n style={{\n backgroundColor: colors.front,\n padding: \"9%\",\n justifyContent: \"space-between\",\n }}\n >\n <div\n style={{\n width: \"22%\",\n aspectRatio: \"1\",\n borderRadius: \"50%\",\n border: `0.6em solid ${colors.mark}`,\n }}\n />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: \"0.5em\" }}>\n <div\n style={{\n height: \"0.9em\",\n width: \"62%\",\n background: colors.mark,\n borderRadius: 99,\n }}\n />\n <div\n style={{\n height: \"0.9em\",\n width: \"38%\",\n background: colors.mark,\n opacity: 0.55,\n borderRadius: 99,\n }}\n />\n </div>\n </AbsoluteFill>\n );\n}\n\nfunction DefaultBack({ colors }: { colors: TurntableColors }) {\n return (\n <AbsoluteFill style={{ backgroundColor: colors.back }}>\n <div\n style={{\n position: \"absolute\",\n top: \"16%\",\n left: 0,\n right: 0,\n height: \"18%\",\n background: \"#111111\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n right: \"9%\",\n bottom: \"12%\",\n width: \"16%\",\n aspectRatio: \"1\",\n borderRadius: \"28%\",\n background: colors.front,\n }}\n />\n </AbsoluteFill>\n );\n}\n\nexport function Turntable({\n children,\n back,\n thickness = turntableDefaults.thickness,\n turns = turntableDefaults.turns,\n tilt = turntableDefaults.tilt,\n colors: colorOverrides,\n frontColor,\n edgeColor,\n backColor,\n backgroundColor,\n speed = turntableDefaults.speed,\n}: TurntableProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const baseColors = { ...turntableDefaults.colors, ...colorOverrides };\n const colors = {\n ...baseColors,\n front: frontColor ?? baseColors.front,\n edge: edgeColor ?? baseColors.edge,\n back: backColor ?? baseColors.back,\n background: backgroundColor ?? baseColors.background,\n };\n const t = (frame * speed * 30) / fps;\n const unit = height / 720;\n\n const cardH = height * 0.46;\n const cardW = cardH * 1.58;\n const depth = thickness * unit;\n const radius = Math.min(cardH * 0.06, depth * 1.2);\n\n const spin = interpolate(t, [START, END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.55, 0, 0.25, 1),\n });\n const angle = spin * 360 * turns;\n const rad = (angle * Math.PI) / 180;\n const cos = Math.cos(rad);\n const sin = Math.sin(rad);\n\n // Lambert-ish shading for each face from a key light front-left.\n const light = (nx: number, nz: number) =>\n 0.55 + 0.45 * Math.max(0, nz * 0.85 - nx * 0.5);\n const frontShade = light(sin, cos);\n const backShade = light(-sin, -cos);\n const sideShade = light(cos, -sin);\n const sheen = 50 + sin * 120;\n\n const footprint = Math.abs(cos) * cardW + Math.abs(sin) * depth;\n const shadowW = Math.max(footprint, depth * 3);\n const floorY = height / 2 + cardH / 2 + height * 0.075;\n\n const face = (\n content: React.ReactNode,\n transform: string,\n shade: number,\n ): React.ReactNode => (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: radius,\n overflow: \"hidden\",\n backfaceVisibility: \"hidden\",\n transform,\n fontSize: cardH / 30,\n }}\n >\n {content}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `linear-gradient(105deg, rgba(255,255,255,0) ${sheen - 22}%, rgba(255,255,255,0.22) ${sheen}%, rgba(255,255,255,0) ${sheen + 22}%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#000\",\n opacity: 1 - shade,\n }}\n />\n </div>\n );\n\n const slab = (\n w: number,\n h: number,\n transform: string,\n shade: number,\n key: string,\n ) => (\n <div\n key={key}\n style={{\n position: \"absolute\",\n left: (cardW - w) / 2,\n top: (cardH - h) / 2,\n width: w,\n height: h,\n background: colors.edge,\n filter: `brightness(${shade})`,\n transform,\n }}\n />\n );\n\n return (\n <AbsoluteFill\n style={{\n backgroundColor: colors.background,\n overflow: \"hidden\",\n background: `radial-gradient(ellipse 60% 40% at 50% ${(floorY / height) * 100}%, rgba(255,255,255,0.07), rgba(255,255,255,0) 70%), ${colors.background}`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: width / 2 - shadowW / 2,\n top: floorY - height * 0.025,\n width: shadowW,\n height: height * 0.05,\n borderRadius: \"50%\",\n background: colors.shadow,\n opacity: 0.45 + 0.35 * Math.abs(cos),\n filter: `blur(${height * 0.018}px)`,\n }}\n />\n <AbsoluteFill\n style={{\n perspective: height * 2.4,\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: cardW,\n height: cardH,\n position: \"relative\",\n transformStyle: \"preserve-3d\",\n transform: `rotateX(${-tilt}deg) rotateY(${angle}deg)`,\n }}\n >\n {slab(\n depth,\n cardH - radius * 2,\n `rotateY(90deg) translateZ(${cardW / 2}px)`,\n sideShade,\n \"r\",\n )}\n {slab(\n depth,\n cardH - radius * 2,\n `rotateY(-90deg) translateZ(${cardW / 2}px)`,\n light(-cos, sin),\n \"l\",\n )}\n {slab(\n cardW - radius * 2,\n depth,\n `rotateX(90deg) translateZ(${cardH / 2}px)`,\n 1.1,\n \"t\",\n )}\n {slab(\n cardW - radius * 2,\n depth,\n `rotateX(-90deg) translateZ(${cardH / 2}px)`,\n 0.6,\n \"b\",\n )}\n {face(\n children ?? <DefaultFront colors={colors} />,\n `translateZ(${depth / 2}px)`,\n frontShade,\n )}\n {face(\n back ?? <DefaultBack colors={colors} />,\n `rotateY(180deg) translateZ(${depth / 2}px)`,\n backShade,\n )}\n </div>\n </AbsoluteFill>\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/turntable.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/venetian-blinds.json b/registry-artifacts/venetian-blinds.jsonnew file mode 100644index 00000000..a79becaa--- /dev/null+++ b/registry-artifacts/venetian-blinds.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "venetian-blinds",+ "title": "Venetian Blinds",+ "description": "The outgoing scene splits into horizontal slats that turn edge-on in a staggered ripple, revealing the next scene behind them.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "registry/remocn/venetian-blinds/index.tsx",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate, useVideoConfig } from \"remotion\";\n\nexport type VenetianBlindsDirection = \"top-down\" | \"bottom-up\" | \"center\";\n\nexport type VenetianBlindsProps = {\n /** Number of horizontal slats. */\n slats?: number;\n /** Share of the transition spent rippling across slats, 0 to 0.9. */\n stagger?: number;\n /** Which slat turns first. */\n direction?: VenetianBlindsDirection;\n /** Tint a slat picks up as it turns away from the light. */\n shadeColor?: string;\n};\n\nexport const venetianBlindsDefaults: Required<VenetianBlindsProps> = {\n slats: 12,\n stagger: 0.55,\n direction: \"top-down\",\n shadeColor: \"#000000\",\n};\n\nconst turnEase = Easing.bezier(0.55, 0, 0.35, 1);\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction slatDelay(\n index: number,\n count: number,\n direction: VenetianBlindsDirection,\n) {\n if (count <= 1) return 0;\n const t = index / (count - 1);\n if (direction === \"bottom-up\") return 1 - t;\n if (direction === \"center\") return Math.abs(t - 0.5) * 2;\n return t;\n}\n\nconst VenetianBlindsPresentation: React.FC<\n TransitionPresentationComponentProps<VenetianBlindsProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { width, height } = useVideoConfig();\n const { slats, stagger, direction, shadeColor } = {\n ...venetianBlindsDefaults,\n ...passedProps,\n };\n const p = presentationProgress;\n\n if (presentationDirection === \"entering\") {\n // The incoming scene settles back a touch as the blinds open on it.\n const scale = interpolate(p, [0, 1], [1.06, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n return (\n <AbsoluteFill style={{ transform: `scale(${scale})` }}>\n {children}\n </AbsoluteFill>\n );\n }\n\n const count = Math.max(1, Math.round(slats));\n const spread = Math.min(0.9, Math.max(0, stagger));\n\n return (\n <AbsoluteFill\n style={{\n zIndex: 2,\n perspective: height * 2.2,\n perspectiveOrigin: \"50% 50%\",\n }}\n >\n {Array.from({ length: count }, (_, i) => {\n const top = Math.floor((i * height) / count);\n const bottom = Math.floor(((i + 1) * height) / count);\n const start = slatDelay(i, count, direction) * spread;\n const local = turnEase(\n interpolate(p, [start, start + 1 - spread], [0, 1], clamp),\n );\n const angle = local * 90;\n // Fade out near edge-on so the last sliver never reads as a hairline.\n const fade = interpolate(angle, [76, 88], [1, 0], clamp);\n if (fade <= 0) return null;\n return (\n <div\n key={top}\n style={{\n position: \"absolute\",\n left: 0,\n top,\n width,\n // 1px overlap hides hairline seams between resting slats.\n height: bottom - top + (i < count - 1 ? 1 : 0),\n overflow: \"hidden\",\n transformOrigin: \"50% 50%\",\n transform: `rotateX(${angle}deg)`,\n backfaceVisibility: \"hidden\",\n opacity: fade,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: -top,\n width,\n height,\n }}\n >\n {children}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundColor: shadeColor,\n opacity: Math.sin((angle * Math.PI) / 180) * 0.75,\n }}\n />\n </div>\n );\n })}\n </AbsoluteFill>\n );\n};\n\nexport function venetianBlinds(\n props: VenetianBlindsProps = {},\n): TransitionPresentation<VenetianBlindsProps> {\n return { component: VenetianBlindsPresentation, props };\n}\n",+ "type": "registry:component",+ "target": "components/remocn/venetian-blinds.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/x-ray-scan.json b/registry-artifacts/x-ray-scan.jsonnew file mode 100644index 00000000..e261b018--- /dev/null+++ b/registry-artifacts/x-ray-scan.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "x-ray-scan",+ "title": "X-Ray Scan",+ "description": "A glowing scanner bar sweeps across a device, turning the shell dark and revealing white-line internals with one part in red.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/x-ray-scan/index.tsx",+ "content": "\"use client\";\n\nimport { type ReactNode, useId } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type XRayScanColors = {\n background: string;\n shell: string;\n detail: string;\n xray: string;\n line: string;\n accent: string;\n};\n\nexport type XRayScanProps = {\n /** Exterior shown ahead of the bar. Defaults to the back of a phone. */\n outside?: ReactNode;\n /** Interior revealed behind the bar. Defaults to white-line phone internals. */\n inside?: ReactNode;\n colors?: Partial<XRayScanColors>;\n /** Phone shell color. Overrides `colors.shell` when set. */\n shell?: string;\n /** Highlighted internal part. Overrides `colors.accent` when set. */\n accent?: string;\n /** Scan line and interior line art. Overrides `colors.line` when set. */\n line?: string;\n /** Background. Overrides `colors.background` when set. */\n background?: string;\n /** \"horizontal\" sweeps left to right, \"vertical\" top to bottom. */\n direction?: \"horizontal\" | \"vertical\";\n speed?: number;\n};\n\nexport const xRayScanDefaults = {\n colors: {\n background: \"#111111\",\n shell: \"#E5322D\",\n detail: \"#111111\",\n xray: \"#07080A\",\n line: \"#FFFFFF\",\n accent: \"#E5322D\",\n } as XRayScanColors,\n direction: \"horizontal\" as const,\n speed: 1,\n};\n\nexport const xRayScanLength = 32;\n\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\ntype Device = { x: number; y: number; w: number; h: number; r: number };\n\nfunction Outside({ id, d, c }: { id: string; d: Device; c: XRayScanColors }) {\n const lens = d.w * 0.085;\n return (\n <>\n <defs>\n <linearGradient id={`${id}-gloss`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n <stop offset=\"0\" stopColor=\"#FFFFFF\" stopOpacity={0.22} />\n <stop offset=\"0.45\" stopColor=\"#FFFFFF\" stopOpacity={0} />\n <stop offset=\"1\" stopColor=\"#000000\" stopOpacity={0.18} />\n </linearGradient>\n </defs>\n <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} fill={c.shell} />\n <rect\n x={d.x}\n y={d.y}\n width={d.w}\n height={d.h}\n rx={d.r}\n fill={`url(#${id}-gloss)`}\n />\n <rect\n x={d.x + d.w * 0.07}\n y={d.y + d.w * 0.07}\n width={d.w * 0.4}\n height={d.w * 0.4}\n rx={d.w * 0.1}\n fill={c.detail}\n opacity={0.92}\n />\n {[\n [0.17, 0.17],\n [0.37, 0.17],\n [0.17, 0.37],\n ].map(([fx, fy]) => (\n <g key={`${fx}${fy}`}>\n <circle\n cx={d.x + d.w * fx}\n cy={d.y + d.w * fy}\n r={lens}\n fill=\"#000\"\n stroke=\"#2A2A2A\"\n strokeWidth={lens * 0.25}\n />\n <circle\n cx={d.x + d.w * fx - lens * 0.3}\n cy={d.y + d.w * fy - lens * 0.3}\n r={lens * 0.18}\n fill=\"#FFFFFF\"\n opacity={0.6}\n />\n </g>\n ))}\n <circle\n cx={d.x + d.w / 2}\n cy={d.y + d.h * 0.5}\n r={d.w * 0.07}\n fill={c.detail}\n opacity={0.85}\n />\n </>\n );\n}\n\nfunction Inside({ d, c, u }: { d: Device; c: XRayScanColors; u: number }) {\n const X = (f: number) => d.x + d.w * f;\n const Y = (f: number) => d.y + d.h * f;\n const pins = (x: number, y: number, w: number, h: number, n: number) =>\n Array.from({ length: n }, (_, i) => {\n const px = x + ((i + 0.5) / n) * w;\n return `M ${px} ${y - 4 * u} V ${y} M ${px} ${y + h} V ${y + h + 4 * u}`;\n }).join(\" \");\n return (\n <>\n <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} fill={c.xray} />\n <g fill=\"none\" stroke={c.line} strokeWidth={2 * u} strokeLinejoin=\"round\">\n <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} />\n <rect\n x={X(0.04)}\n y={Y(0.02)}\n width={d.w * 0.92}\n height={d.h * 0.96}\n rx={d.r * 0.82}\n strokeOpacity={0.4}\n />\n {/* Camera ring */}\n {[\n [0.17, 0.17],\n [0.37, 0.17],\n [0.17, 0.37],\n ].map(([fx, fy]) => (\n <g key={`${fx}${fy}`}>\n <circle cx={X(fx)} cy={d.y + d.w * fy} r={d.w * 0.085} />\n <circle\n cx={X(fx)}\n cy={d.y + d.w * fy}\n r={d.w * 0.045}\n strokeOpacity={0.6}\n />\n </g>\n ))}\n {/* Logic board */}\n <path\n d={`M ${X(0.52)} ${Y(0.05)} H ${X(0.9)} V ${Y(0.36)} H ${X(0.1)} V ${Y(0.27)} H ${X(0.52)} Z`}\n />\n <rect\n x={X(0.6)}\n y={Y(0.08)}\n width={d.w * 0.22}\n height={d.h * 0.07}\n rx={2 * u}\n />\n <path\n d={pins(X(0.6), Y(0.08), d.w * 0.22, d.h * 0.07, 6)}\n strokeOpacity={0.6}\n strokeWidth={1.3 * u}\n />\n <rect\n x={X(0.16)}\n y={Y(0.295)}\n width={d.w * 0.16}\n height={d.h * 0.04}\n rx={2 * u}\n strokeOpacity={0.8}\n />\n <rect\n x={X(0.38)}\n y={Y(0.295)}\n width={d.w * 0.12}\n height={d.h * 0.04}\n rx={2 * u}\n strokeOpacity={0.8}\n />\n {/* Battery with wireless coil */}\n <rect\n x={X(0.12)}\n y={Y(0.4)}\n width={d.w * 0.76}\n height={d.h * 0.44}\n rx={6 * u}\n />\n <path\n d={`M ${X(0.42)} ${Y(0.4)} V ${Y(0.385)} H ${X(0.58)} V ${Y(0.4)}`}\n />\n {[0.26, 0.2, 0.14].map((f) => (\n <circle\n key={f}\n cx={X(0.5)}\n cy={Y(0.62)}\n r={d.w * f}\n strokeOpacity={0.45}\n />\n ))}\n <path\n d={`M ${X(0.5)} ${Y(0.47)} V ${Y(0.5)} M ${X(0.485)} ${Y(0.485)} H ${X(0.515)}`}\n />\n {/* Flex cable, speaker and port */}\n <path\n d={`M ${X(0.86)} ${Y(0.36)} V ${Y(0.38)} H ${X(0.92)} V ${Y(0.89)} H ${X(0.66)}`}\n strokeOpacity={0.6}\n />\n <rect\n x={X(0.38)}\n y={Y(0.935)}\n width={d.w * 0.24}\n height={d.h * 0.025}\n rx={d.h * 0.0125}\n />\n {Array.from({ length: 6 }, (_, i) => (\n <circle key={i} cx={X(0.14 + i * 0.035)} cy={Y(0.947)} r={1.8 * u} />\n ))}\n </g>\n {/* The one part in red: the SoC */}\n <g stroke={c.accent} strokeWidth={2.4 * u} fill=\"none\">\n <rect\n x={X(0.6)}\n y={Y(0.17)}\n width={d.w * 0.22}\n height={d.w * 0.22}\n rx={3 * u}\n fill={c.accent}\n fillOpacity={0.22}\n />\n <path\n d={pins(X(0.6), Y(0.17), d.w * 0.22, d.w * 0.22, 5)}\n strokeWidth={1.4 * u}\n />\n </g>\n <text\n x={X(0.5)}\n y={Y(0.79)}\n textAnchor=\"middle\"\n fontFamily={MONO}\n fontSize={12 * u}\n letterSpacing={2 * u}\n fill={c.line}\n opacity={0.7}\n >\n Li-ion 4500 mAh\n </text>\n </>\n );\n}\n\nexport function XRayScan({\n outside,\n inside,\n colors,\n shell,\n accent,\n line,\n background,\n direction = xRayScanDefaults.direction,\n speed = xRayScanDefaults.speed,\n}: XRayScanProps) {\n const frame = useCurrentFrame();\n const { width: W, height: H, fps } = useVideoConfig();\n const id = useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n const merged = { ...xRayScanDefaults.colors, ...colors };\n const c: XRayScanColors = {\n ...merged,\n shell: shell ?? merged.shell,\n accent: accent ?? merged.accent,\n line: line ?? merged.line,\n background: background ?? merged.background,\n };\n const t = (frame / fps) * 30 * speed;\n const u = Math.min(W, H) / 720;\n const vertical = direction === \"vertical\";\n\n const dh = 0.8 * H;\n const dw = dh * 0.49;\n const d: Device = {\n x: (W - dw) / 2,\n y: (H - dh) / 2,\n w: dw,\n h: dh,\n r: dw * 0.17,\n };\n const span = vertical ? H : W;\n const start = vertical ? d.y - 0.1 * H : d.x - 0.12 * W;\n const end = vertical ? d.y + d.h + 0.1 * H : d.x + d.w + 0.12 * W;\n const bar = interpolate(t, [5, 32], [start, end], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.sin),\n });\n const scanning = t > 5 && t < 32;\n const band = 0.12 * span;\n const behind = vertical\n ? `inset(0 0 ${H - bar}px 0)`\n : `inset(0 ${W - bar}px 0 0)`;\n const ahead = vertical ? `inset(${bar}px 0 0 0)` : `inset(0 0 0 ${bar}px)`;\n const hot = vertical\n ? `inset(${Math.max(0, bar - band)}px 0 ${H - bar}px 0)`\n : `inset(0 ${W - bar}px 0 ${Math.max(0, bar - band)}px)`;\n const trail = vertical ? \"to top\" : \"to left\";\n\n const insideLayer = inside ?? (\n <svg width={W} height={H} aria-hidden>\n <Inside d={d} c={c} u={u} />\n </svg>\n );\n\n return (\n <AbsoluteFill style={{ backgroundColor: c.background, overflow: \"hidden\" }}>\n <svg width={0} height={0} style={{ position: \"absolute\" }} aria-hidden>\n <filter id={`${id}-glow`} x=\"-10%\" y=\"-10%\" width=\"120%\" height=\"120%\">\n <feGaussianBlur stdDeviation={3 * u} result=\"blur\" />\n <feMerge>\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"blur\" />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n </svg>\n <AbsoluteFill style={{ clipPath: ahead }}>\n {outside ?? (\n <svg width={W} height={H} aria-hidden>\n <Outside id={id} d={d} c={c} />\n </svg>\n )}\n </AbsoluteFill>\n <AbsoluteFill style={{ clipPath: behind }}>{insideLayer}</AbsoluteFill>\n {/* Fresh exposure glows brighter just behind the bar. */}\n <AbsoluteFill\n style={{\n clipPath: hot,\n filter: `url(#${id}-glow)`,\n opacity: scanning ? 0.9 : 0,\n }}\n >\n {insideLayer}\n </AbsoluteFill>\n <AbsoluteFill\n style={{\n clipPath: behind,\n opacity: scanning ? 1 : 0,\n background: `linear-gradient(${trail}, ${c.line}2E 0px, transparent ${band}px)`,\n backgroundPosition: vertical ? `0 ${bar - H}px` : `${bar - W}px 0`,\n backgroundRepeat: \"no-repeat\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: vertical ? 0 : bar - 1.5 * u,\n top: vertical ? bar - 1.5 * u : 0,\n width: vertical ? W : 3 * u,\n height: vertical ? 3 * u : H,\n backgroundColor: c.line,\n boxShadow: `0 0 ${16 * u}px ${4 * u}px ${c.line}AA, 0 0 ${60 * u}px ${12 * u}px ${c.line}33`,\n opacity: scanning ? 1 : 0,\n }}\n />\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/x-ray-scan.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex c1e9c734..f6dc7eab 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -3863,6 +3863,390 @@ const registry: Record<string, RegistryEntry> = {(m) => m.captionDropConfig,),},+ "iris-wipe": {+ load: () =>+ import("@/components/docs/examples/iris-wipe-example").then((m) => ({+ default: m.IrisWipeExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/iris-wipe/config").then(+ (m) => m.irisWipeConfig,+ ),+ },+ "venetian-blinds": {+ load: () =>+ import("@/components/docs/examples/venetian-blinds-example").then(+ (m) => ({+ default: m.VenetianBlindsExampleScene,+ }),+ ),+ loadConfig: () =>+ import("@/registry/remocn/venetian-blinds/config").then(+ (m) => m.venetianBlindsConfig,+ ),+ },+ "paper-tear": {+ load: () =>+ import("@/components/docs/examples/paper-tear-example").then((m) => ({+ default: m.PaperTearExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/paper-tear/config").then(+ (m) => m.paperTearConfig,+ ),+ },+ "pixel-sort": {+ load: () =>+ import("@/components/docs/examples/pixel-sort-example").then((m) => ({+ default: m.PixelSortExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/pixel-sort/config").then(+ (m) => m.pixelSortConfig,+ ),+ },+ "light-leak": {+ load: () =>+ import("@/components/docs/examples/light-leak-example").then((m) => ({+ default: m.LightLeakExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/light-leak/config").then(+ (m) => m.lightLeakConfig,+ ),+ },+ hyperspace: {+ load: () =>+ import("@/components/docs/examples/hyperspace-example").then((m) => ({+ default: m.HyperspaceExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/hyperspace/config").then(+ (m) => m.hyperspaceConfig,+ ),+ },+ "orbit-lock": {+ load: () =>+ import("@/components/docs/examples/orbit-lock-example").then((m) => ({+ default: m.OrbitLockExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/orbit-lock/config").then(+ (m) => m.orbitLockConfig,+ ),+ },+ "puzzle-snap": {+ load: () =>+ import("@/components/docs/examples/puzzle-snap-example").then((m) => ({+ default: m.PuzzleSnapExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/puzzle-snap/config").then(+ (m) => m.puzzleSnapConfig,+ ),+ },+ spotlight: {+ load: () =>+ import("@/components/docs/examples/spotlight-example").then((m) => ({+ default: m.SpotlightExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/spotlight/config").then(+ (m) => m.spotlightConfig,+ ),+ },+ "neon-sign": {+ load: () =>+ import("@/registry/remocn/neon-sign").then((m) => ({+ default: m.NeonSign,+ })),+ loadConfig: () =>+ import("@/registry/remocn/neon-sign/config").then(+ (m) => m.neonSignConfig,+ ),+ },+ inflate: {+ load: () =>+ import("@/components/docs/examples/inflate-example").then((m) => ({+ default: m.InflateExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/inflate/config").then((m) => m.inflateConfig),+ },+ "liquid-fill": {+ load: () =>+ import("@/components/docs/examples/liquid-fill-example").then((m) => ({+ default: m.LiquidFillExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/liquid-fill/config").then(+ (m) => m.liquidFillConfig,+ ),+ },+ "accordion-unfold": {+ load: () =>+ import("@/components/docs/examples/accordion-unfold-example").then(+ (m) => ({+ default: m.AccordionUnfoldExampleScene,+ }),+ ),+ loadConfig: () =>+ import("@/registry/remocn/accordion-unfold/config").then(+ (m) => m.accordionUnfoldConfig,+ ),+ },+ "anamorphic-flare": {+ load: () =>+ import("@/components/docs/examples/anamorphic-flare-example").then(+ (m) => ({+ default: m.AnamorphicFlareExampleScene,+ }),+ ),+ loadConfig: () =>+ import("@/registry/remocn/anamorphic-flare/config").then(+ (m) => m.anamorphicFlareConfig,+ ),+ },+ "pendulum-wave": {+ load: () =>+ import("@/registry/remocn/pendulum-wave").then((m) => ({+ default: m.PendulumWave,+ })),+ loadConfig: () =>+ import("@/registry/remocn/pendulum-wave/config").then(+ (m) => m.pendulumWaveConfig,+ ),+ },+ "flow-field": {+ load: () =>+ import("@/registry/remocn/flow-field").then((m) => ({+ default: m.FlowField,+ })),+ loadConfig: () =>+ import("@/registry/remocn/flow-field/config").then(+ (m) => m.flowFieldConfig,+ ),+ },+ "isometric-build": {+ load: () =>+ import("@/registry/remocn/isometric-build").then((m) => ({+ default: m.IsometricBuild,+ })),+ loadConfig: () =>+ import("@/registry/remocn/isometric-build/config").then(+ (m) => m.isometricBuildConfig,+ ),+ },+ "life-grid": {+ load: () =>+ import("@/registry/remocn/life-grid").then((m) => ({+ default: m.LifeGrid,+ })),+ loadConfig: () =>+ import("@/registry/remocn/life-grid/config").then(+ (m) => m.lifeGridConfig,+ ),+ },+ "string-art": {+ load: () =>+ import("@/registry/remocn/string-art").then((m) => ({+ default: m.StringArt,+ })),+ loadConfig: () =>+ import("@/registry/remocn/string-art/config").then(+ (m) => m.stringArtConfig,+ ),+ },+ "topo-lines": {+ load: () =>+ import("@/registry/remocn/topo-lines").then((m) => ({+ default: m.TopoLines,+ })),+ loadConfig: () =>+ import("@/registry/remocn/topo-lines/config").then(+ (m) => m.topoLinesConfig,+ ),+ },+ phyllotaxis: {+ load: () =>+ import("@/registry/remocn/phyllotaxis").then((m) => ({+ default: m.Phyllotaxis,+ })),+ loadConfig: () =>+ import("@/registry/remocn/phyllotaxis/config").then(+ (m) => m.phyllotaxisConfig,+ ),+ },+ "parallax-depth": {+ load: () =>+ import("@/components/docs/examples/parallax-depth-example").then((m) => ({+ default: m.ParallaxDepthExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/parallax-depth/config").then(+ (m) => m.parallaxDepthConfig,+ ),+ },+ "dolly-zoom": {+ load: () =>+ import("@/components/docs/examples/dolly-zoom-example").then((m) => ({+ default: m.DollyZoomExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/dolly-zoom/config").then(+ (m) => m.dollyZoomConfig,+ ),+ },+ turntable: {+ load: () =>+ import("@/components/docs/examples/turntable-example").then((m) => ({+ default: m.TurntableExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/turntable/config").then(+ (m) => m.turntableConfig,+ ),+ },+ "tiny-planet": {+ load: () =>+ import("@/components/docs/examples/tiny-planet-example").then((m) => ({+ default: m.TinyPlanetExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/tiny-planet/config").then(+ (m) => m.tinyPlanetConfig,+ ),+ },+ "exploded-view": {+ load: () =>+ import("@/components/docs/examples/exploded-view-example").then((m) => ({+ default: m.ExplodedViewExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/exploded-view/config").then(+ (m) => m.explodedViewConfig,+ ),+ },+ "gravity-pile": {+ load: () =>+ import("@/components/docs/examples/gravity-pile-example").then((m) => ({+ default: m.GravityPileExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/gravity-pile/config").then(+ (m) => m.gravityPileConfig,+ ),+ },+ "cloth-reveal": {+ load: () =>+ import("@/components/docs/examples/cloth-reveal-example").then((m) => ({+ default: m.ClothRevealExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/cloth-reveal/config").then(+ (m) => m.clothRevealConfig,+ ),+ },+ "impact-shake": {+ load: () =>+ import("@/components/docs/examples/impact-shake-example").then((m) => ({+ default: m.ImpactShakeExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/impact-shake/config").then(+ (m) => m.impactShakeConfig,+ ),+ },+ "riso-print": {+ load: () =>+ import("@/components/docs/examples/riso-print-example").then((m) => ({+ default: m.RisoPrintExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/riso-print/config").then(+ (m) => m.risoPrintConfig,+ ),+ },+ "line-boil": {+ load: () =>+ import("@/components/docs/examples/line-boil-example").then((m) => ({+ default: m.LineBoilExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/line-boil/config").then(+ (m) => m.lineBoilConfig,+ ),+ },+ blueprint: {+ load: () =>+ import("@/registry/remocn/blueprint").then((m) => ({+ default: m.Blueprint,+ })),+ loadConfig: () =>+ import("@/registry/remocn/blueprint/config").then(+ (m) => m.blueprintConfig,+ ),+ },+ "duotone-beat": {+ load: () =>+ import("@/registry/remocn/duotone-beat").then((m) => ({+ default: m.DuotoneBeat,+ })),+ loadConfig: () =>+ import("@/registry/remocn/duotone-beat/config").then(+ (m) => m.duotoneBeatConfig,+ ),+ },+ "comic-panels": {+ load: () =>+ import("@/components/docs/examples/comic-panels-example").then((m) => ({+ default: m.ComicPanelsExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/comic-panels/config").then(+ (m) => m.comicPanelsConfig,+ ),+ },+ "long-shadow": {+ load: () =>+ import("@/registry/remocn/long-shadow").then((m) => ({+ default: m.LongShadow,+ })),+ loadConfig: () =>+ import("@/registry/remocn/long-shadow/config").then(+ (m) => m.longShadowConfig,+ ),+ },+ synthwave: {+ load: () =>+ import("@/components/docs/examples/synthwave-example").then((m) => ({+ default: m.SynthwaveExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/synthwave/config").then(+ (m) => m.synthwaveConfig,+ ),+ },+ "brick-mosaic": {+ load: () =>+ import("@/registry/remocn/brick-mosaic").then((m) => ({+ default: m.BrickMosaic,+ })),+ loadConfig: () =>+ import("@/registry/remocn/brick-mosaic/config").then(+ (m) => m.brickMosaicConfig,+ ),+ },+ "x-ray-scan": {+ load: () =>+ import("@/components/docs/examples/x-ray-scan-example").then((m) => ({+ default: m.XRayScanExampleScene,+ })),+ loadConfig: () =>+ import("@/registry/remocn/x-ray-scan/config").then(+ (m) => m.xRayScanConfig,+ ),+ },};const configCache = new Map<string, Promise<ResolvedComponentConfig>>();diff --git a/registry/__manifest__.ts b/registry/__manifest__.tsindex 210da206..d8c38698 100644--- a/registry/__manifest__.ts+++ b/registry/__manifest__.ts@@ -35,6 +35,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "accordion-unfold": {+ durationInFrames: 66,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ panels: 6,+ foldAngle: 82,+ shade: 0.55,+ color: "#FFFFFF",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"agent-run": {durationInFrames: 355,fps: 30,@@ -71,6 +89,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "anamorphic-flare": {+ durationInFrames: 70,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ ghosts: 4,+ y: 0.5,+ seed: 2,+ tint: "#E5322D",+ coreColor: "#FFFFFF",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"animated-bar-chart": {durationInFrames: 90,fps: 30,@@ -173,6 +210,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ blueprint: {+ durationInFrames: 75,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#173C8F",+ },+ defaults: {+ blueprintColor: "#173C8F",+ lineColor: "#FFFFFF",+ calloutColor: "#E5322D",+ productColor: "#E5322D",+ background: "#FFFFFF",+ speed: 1,+ },+ },"blur-in": {durationInFrames: 120,fps: 30,@@ -235,6 +290,23 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "brick-mosaic": {+ durationInFrames: 85,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ cols: 24,+ rows: 14,+ rowDelay: 3,+ background: "#111111",+ speed: 1,+ },+ },button: {durationInFrames: 120,fps: 30,@@ -1137,6 +1209,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "cloth-reveal": {+ durationInFrames: 60,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ direction: "right",+ clothColor: "#E5322D",+ undersideColor: "#8E1A16",+ background: "#111111",+ delay: 6,+ seed: 2,+ speed: 1,+ },+ },"code-morph": {durationInFrames: 138,fps: 30,@@ -1177,6 +1268,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "comic-panels": {+ durationInFrames: 66,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#FFFFFF",+ },+ defaults: {+ word: "POW",+ heroScale: 0.62,+ ink: "#111111",+ paper: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },"command-menu": {durationInFrames: 120,fps: 30,@@ -1368,6 +1477,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "dolly-zoom": {+ durationInFrames: 66,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#0B0B0B",+ },+ defaults: {+ intensity: 1,+ reverse: false,+ doorColor: "#E5322D",+ figureColor: "#FFFFFF",+ lineColor: "#FFFFFF",+ speed: 1,+ },+ },drawer: {durationInFrames: 120,fps: 30,@@ -1432,6 +1559,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "duotone-beat": {+ durationInFrames: 120,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#FFFFFF",+ },+ defaults: {+ beatFrames: 15,+ beatsPerBar: 4,+ punch: 0.07,+ halftone: 8,+ showIndicator: true,+ speed: 1,+ },+ },"echo-stack": {durationInFrames: 120,fps: 30,@@ -1488,6 +1633,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "exploded-view": {+ durationInFrames: 70,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ labels: "Interface, Engine, Storage, Hardware",+ layers: 4,+ highlight: 1,+ backgroundColor: "#111111",+ labelColor: "#FFFFFF",+ speed: 1,+ },+ },"extrude-pop": {durationInFrames: 90,fps: 30,@@ -1525,6 +1688,28 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "flow-field": {+ durationInFrames: 300,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ particles: 300,+ trailLength: 72,+ strokeWidth: 1.4,+ accentRatio: 0.1,+ loopFrames: 300,+ seed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },"focus-blur-resolve": {durationInFrames: 90,fps: 30,@@ -1763,6 +1948,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "gravity-pile": {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ count: 30,+ gravity: 1,+ seed: 7,+ accentColor: "#E5322D",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"grid-wave": {durationInFrames: 84,fps: 30,@@ -1861,6 +2064,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ hyperspace: {+ durationInFrames: 124,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#0a0a0a",+ },+ defaults: {+ stars: 260,+ streakColor: "#FFFFFF",+ accentColor: "#E5322D",+ accentRatio: 0.14,+ flash: true,+ flashColor: "#FFFFFF",+ speed: 1,+ },+ },"icon-activity": {durationInFrames: 90,fps: 30,@@ -3278,6 +3500,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "impact-shake": {+ durationInFrames: 50,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ text: "LAUNCH",+ intensity: 1,+ impact: 7,+ foregroundColor: "#FFFFFF",+ backgroundColor: "#111111",+ seed: 1,+ speed: 1,+ },+ },"infinite-bento-pan": {durationInFrames: 300,fps: 30,@@ -3313,6 +3554,23 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ inflate: {+ durationInFrames: 66,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ color: "#E5322D",+ highlight: "#FFFFFF",+ dotColor: "#111111",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"ink-arrow": {durationInFrames: 150,fps: 30,@@ -3447,6 +3705,45 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "iris-wipe": {+ durationInFrames: 104,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#efe9dc",+ },+ defaults: {+ color: "#000000",+ centerX: 0.5,+ centerY: 0.5,+ holdRadius: 12,+ speed: 1,+ },+ },+ "isometric-build": {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ grid: 5,+ maxHeight: 2.2,+ stagger: 2,+ gap: 0.04,+ floors: true,+ seed: 4,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },keystroke: {durationInFrames: 180,fps: 30,@@ -3554,6 +3851,66 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "life-grid": {+ durationInFrames: 300,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ cols: 48,+ density: 0.24,+ framesPerGeneration: 5,+ gap: 0.16,+ showGrid: true,+ seed: 7,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },+ "light-leak": {+ durationInFrames: 120,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#0a0a0a",+ },+ defaults: {+ origin: "left",+ intensity: 1,+ leakColor: "#FF5A1F",+ blowoutColor: "#FFF3E0",+ speed: 1,+ },+ },+ "line-boil": {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#FFFFFF",+ },+ defaults: {+ boilEvery: 3,+ drawings: 3,+ amplitude: 1,+ strokeWidth: 9,+ size: 0.66,+ line: "#111111",+ fill: "#E5322D",+ background: "#FFFFFF",+ speed: 1,+ },+ },"line-by-line-slide": {durationInFrames: 90,fps: 30,@@ -3572,6 +3929,23 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "liquid-fill": {+ durationInFrames: 78,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ liquidColor: "#E5322D",+ outlineColor: "#FFFFFF",+ bubbleColor: "#FFFFFF",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"live-code-compilation": {durationInFrames: 260,fps: 30,@@ -3600,6 +3974,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "long-shadow": {+ durationInFrames: 70,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#FFFFFF",+ },+ defaults: {+ angleFrom: 45,+ angleTo: 135,+ fade: 0,+ shadowColor: "#ECEAE6",+ background: "#FFFFFF",+ iconColor: "#E5322D",+ checkColor: "#FFFFFF",+ speed: 1,+ },+ },"marker-highlight": {durationInFrames: 90,fps: 30,@@ -3707,6 +4101,27 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "neon-sign": {+ durationInFrames: 70,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ strokeWidth: 6,+ fit: 0.62,+ seed: 7,+ color: "#E5322D",+ glowColor: "#E5322D",+ tubeColor: "#2A2A2A",+ coreColor: "#FFFFFF",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"number-wheel": {durationInFrames: 112,fps: 30,@@ -3743,6 +4158,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "orbit-lock": {+ durationInFrames: 78,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ moons: 3,+ tilt: 64,+ coreColor: "#E5322D",+ moonColor: "#FFFFFF",+ flashColor: "#FFFFFF",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"outline-fill-track-text": {durationInFrames: 80,fps: 30,@@ -3826,6 +4260,23 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "paper-tear": {+ durationInFrames: 104,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#0a0a0a",+ },+ defaults: {+ impact: 1,+ roughness: 0.5,+ seed: 7,+ edgeColor: "#FFFFFF",+ speed: 1,+ },+ },"paper-wobble": {durationInFrames: 90,fps: 30,@@ -3843,6 +4294,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "parallax-depth": {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ distance: 0.5,+ push: 0.16,+ direction: "right",+ seed: 3,+ skyColor: "#111111",+ sunColor: "#E5322D",+ speed: 1,+ },+ },"particle-dissolve": {durationInFrames: 84,fps: 30,@@ -3882,6 +4352,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "pendulum-wave": {+ durationInFrames: 450,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ count: 15,+ cycles: 10,+ loopFrames: 450,+ showGuides: true,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },"per-character-rise": {durationInFrames: 60,fps: 30,@@ -3993,6 +4483,44 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ phyllotaxis: {+ durationInFrames: 165,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ count: 420,+ size: 1,+ arm: 21,+ growFrames: 60,+ pulseFrames: 45,+ rotation: 4,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },+ "pixel-sort": {+ durationInFrames: 110,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#0a0a0a",+ },+ defaults: {+ columns: 40,+ seed: 5,+ streakColor: "#FFFFFF",+ speed: 1,+ },+ },"pixelate-region": {durationInFrames: 90,fps: 30,@@ -4074,6 +4602,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "puzzle-snap": {+ durationInFrames: 66,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ square: true,+ seed: 3,+ primaryColor: "#E5322D",+ secondaryColor: "#FFFFFF",+ sparkColor: "#FFFFFF",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"radial-burst": {durationInFrames: 120,fps: 30,@@ -4215,6 +4762,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "riso-print": {+ durationInFrames: 75,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#F2F0EA",+ },+ defaults: {+ keyInk: "#111111",+ accentInk: "#E5322D",+ paper: "#F2F0EA",+ grain: 0.5,+ jitter: 1.2,+ marks: true,+ speed: 1,+ },+ },"rolling-number": {durationInFrames: 150,fps: 30,@@ -5518,6 +6084,22 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ spotlight: {+ durationInFrames: 80,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ dim: 0.16,+ beamColor: "#FFFFFF",+ stageColor: "#111111",+ speed: 1,+ },+ },"spring-scale-in": {durationInFrames: 60,fps: 30,@@ -5682,6 +6264,29 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "string-art": {+ durationInFrames: 340,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ pins: 200,+ from: 2,+ to: 4,+ morphFrames: 240,+ sweep: 0.08,+ threadOpacity: 0.42,+ showLabel: true,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },"stripe-type": {durationInFrames: 100,fps: 30,@@ -5754,6 +6359,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ synthwave: {+ durationInFrames: 120,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#08080B",+ },+ defaults: {+ gridSpeed: 2,+ horizon: 0.6,+ sunStripes: true,+ grid: "#E5322D",+ sunTop: "#FFC46B",+ sunBottom: "#E5322D",+ skyHorizon: "#3B0C10",+ speed: 1,+ },+ },tabs: {durationInFrames: 120,fps: 30,@@ -5807,6 +6432,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "tiny-planet": {+ durationInFrames: 100,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ buildings: 26,+ spin: 0.7,+ seed: 4,+ skyColor: "#111111",+ sunColor: "#E5322D",+ buildingColor: "#FFFFFF",+ groundColor: "#262626",+ speed: 1,+ },+ },toast: {durationInFrames: 120,fps: 30,@@ -5874,6 +6519,28 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "topo-lines": {+ durationInFrames: 300,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ levels: 16,+ peaks: 3,+ highlight: 9,+ indexEvery: 4,+ loopFrames: 300,+ seed: 2,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ speed: 1,+ },+ },"tracking-in": {durationInFrames: 90,fps: 30,@@ -5940,6 +6607,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ turntable: {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ turns: 1,+ thickness: 22,+ tilt: 8,+ frontColor: "#E5322D",+ edgeColor: "#A3201C",+ backColor: "#F2F2F2",+ backgroundColor: "#111111",+ speed: 1,+ },+ },"tv-power-off": {durationInFrames: 62,fps: 30,@@ -6122,6 +6809,23 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "venetian-blinds": {+ durationInFrames: 114,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#0a0a0a",+ },+ defaults: {+ slats: 12,+ stagger: 0.55,+ direction: "top-down",+ shadeColor: "#000000",+ speed: 1,+ },+ },"vhs-filter": {durationInFrames: 90,fps: 30,@@ -6280,6 +6984,24 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "x-ray-scan": {+ durationInFrames: 65,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#111111",+ },+ defaults: {+ direction: "horizontal",+ shell: "#E5322D",+ accent: "#E5322D",+ line: "#FFFFFF",+ background: "#111111",+ speed: 1,+ },+ },"zoom-blur": {durationInFrames: 114,fps: 30,diff --git a/registry/remocn/accordion-unfold/config.ts b/registry/remocn/accordion-unfold/config.tsnew file mode 100644index 00000000..7ac7a35e--- /dev/null+++ b/registry/remocn/accordion-unfold/config.ts@@ -0,0 +1,48 @@+import { accordionUnfoldExampleCode } from "@/components/docs/examples/accordion-unfold-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const accordionUnfoldConfig: ComponentConfig = {+ componentName: "AccordionUnfold",+ importPath: "@/components/remocn/accordion-unfold",+ controls: {+ panels: {+ type: "number",+ default: 6,+ min: 2,+ max: 12,+ step: 1,+ description: "Panels",+ hiddenFromList: false,+ },+ foldAngle: {+ type: "number",+ default: 82,+ min: 10,+ max: 89,+ step: 1,+ description: "Fold angle",+ hiddenFromList: false,+ },+ shade: {+ type: "number",+ default: 0.55,+ min: 0,+ max: 1,+ step: 0.05,+ description: "Shade",+ hiddenFromList: false,+ },+ color: { type: "color", default: "#FFFFFF", description: "Paper" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 66,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: accordionUnfoldExampleCode,+};diff --git a/registry/remocn/accordion-unfold/index.tsx b/registry/remocn/accordion-unfold/index.tsxnew file mode 100644index 00000000..273b0cb1--- /dev/null+++ b/registry/remocn/accordion-unfold/index.tsx@@ -0,0 +1,225 @@+"use client";++import type React from "react";+import {+ AbsoluteFill,+ interpolate,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type AccordionUnfoldProps = {+ /** Lockup printed across the card. Use a color that reads on `color`. Falls back to a placeholder "remocn" lockup. */+ children?: React.ReactNode;+ /** Number of vertical pleats. */+ panels?: number;+ /** Paper color of the card. */+ color?: string;+ /** Darkness of the panels facing away from the light, 0 to 1. */+ shade?: number;+ backgroundColor?: string;+ /** Fold angle of each pleat at the start, in degrees. */+ foldAngle?: number;+ speed?: number;+};++export const accordionUnfoldDefaults = {+ panels: 6,+ color: "#FFFFFF",+ shade: 0.55,+ backgroundColor: "#111111",+ foldAngle: 82,+ speed: 1,+};++const START = 4;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++const PLACEHOLDER_FONT =+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif";++// Neutral lockup shown when no children are passed.+function PlaceholderLockup({+ mark,+ dot,+ text,+ scale = 1,+}: {+ mark: string;+ dot: string;+ text: string;+ scale?: number;+}) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 * scale }}>+ <div+ style={{+ width: 120 * scale,+ height: 120 * scale,+ borderRadius: 32 * scale,+ backgroundColor: mark,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36 * scale,+ height: 36 * scale,+ borderRadius: "50%",+ backgroundColor: dot,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: PLACEHOLDER_FONT,+ fontSize: 104 * scale,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: text,+ }}+ >+ remocn+ </span>+ </div>+ );+}++export function AccordionUnfold(props: AccordionUnfoldProps) {+ const { children, panels, color, shade, backgroundColor, foldAngle, speed } =+ { ...accordionUnfoldDefaults, ...props };+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const t = frame * Math.max(0, speed);+ const n = Math.max(2, Math.round(panels));+ const cardW = Math.round(Math.min(width * 0.66, height * 1.3));+ const cardH = Math.round(Math.min(height * 0.4, cardW * 0.4));+ const pw = cardW / n;++ const open = spring({+ frame: t - START,+ fps,+ config: { damping: 15, stiffness: 70, mass: 0.9 },+ });+ const theta = foldAngle * (1 - open);+ const rad = (theta * Math.PI) / 180;+ // Keep the pleated stack centered while its projected width grows.+ const shift = (cardW - cardW * Math.cos(rad)) / 2;+ const lift = interpolate(t, [0, START + 2], [0.92, 1], clamp);+ const appear = interpolate(t, [0, 3], [0, 1], clamp);+ const flat = Math.abs(theta) < 0.3;++ const print = (offset: number) => (+ <div+ style={{+ position: "absolute",+ top: 0,+ left: -offset,+ width: cardW,+ height: cardH,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ {children ?? (+ <PlaceholderLockup+ mark={backgroundColor}+ dot={color}+ text={backgroundColor}+ scale={0.8}+ />+ )}+ </div>+ );++ const panel = (i: number): React.ReactNode => {+ if (i >= n) return null;+ const angle = i === 0 ? theta : (i % 2 === 1 ? -2 : 2) * theta;+ const facing = i % 2 === 0 ? 1 : -1;+ const tilt = Math.abs(Math.sin(rad));+ const darkness = facing > 0 ? shade * tilt : shade * 0.25 * tilt;+ return (+ <div+ style={{+ position: "absolute",+ top: 0,+ left: i === 0 ? 0 : pw,+ width: pw,+ height: cardH,+ transformOrigin: "0% 50%",+ transform: `rotateY(${angle}deg)`,+ transformStyle: "preserve-3d",+ }}+ >+ <div+ style={{+ position: "absolute",+ inset: 0,+ // A hair of bleed hides antialiased seams between pleats.+ width: pw + 1,+ overflow: "hidden",+ backgroundColor: color,+ backfaceVisibility: "hidden",+ }}+ >+ {print(i * pw)}+ <div+ style={{+ position: "absolute",+ inset: 0,+ background:+ facing > 0+ ? `linear-gradient(90deg, rgba(0,0,0,${darkness * 0.6}), rgba(0,0,0,${darkness}))`+ : `linear-gradient(90deg, rgba(255,255,255,${0.12 * tilt}), rgba(0,0,0,${darkness}))`,+ }}+ />+ </div>+ {panel(i + 1)}+ </div>+ );+ };++ return (+ <AbsoluteFill+ style={{+ backgroundColor,+ alignItems: "center",+ justifyContent: "center",+ perspective: cardW * 1.8,+ }}+ >+ <div+ style={{+ position: "relative",+ width: cardW,+ height: cardH,+ opacity: appear,+ transform: `translateX(${shift}px) scale(${lift})`,+ transformStyle: "preserve-3d",+ }}+ >+ {flat ? (+ <div+ style={{+ position: "absolute",+ inset: 0,+ backgroundColor: color,+ overflow: "hidden",+ }}+ >+ {print(0)}+ </div>+ ) : (+ panel(0)+ )}+ </div>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/anamorphic-flare/config.ts b/registry/remocn/anamorphic-flare/config.tsnew file mode 100644index 00000000..abac944d--- /dev/null+++ b/registry/remocn/anamorphic-flare/config.ts@@ -0,0 +1,49 @@+import { anamorphicFlareExampleCode } from "@/components/docs/examples/anamorphic-flare-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const anamorphicFlareConfig: ComponentConfig = {+ componentName: "AnamorphicFlare",+ importPath: "@/components/remocn/anamorphic-flare",+ controls: {+ ghosts: {+ type: "number",+ default: 4,+ min: 0,+ max: 8,+ step: 1,+ description: "Ghosts",+ hiddenFromList: false,+ },+ y: {+ type: "number",+ default: 0.5,+ min: 0.1,+ max: 0.9,+ step: 0.01,+ description: "Streak height",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 2,+ min: 1,+ max: 99,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ tint: { type: "color", default: "#E5322D", description: "Tint" },+ coreColor: { type: "color", default: "#FFFFFF", description: "Core" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 70,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: anamorphicFlareExampleCode,+};diff --git a/registry/remocn/anamorphic-flare/index.tsx b/registry/remocn/anamorphic-flare/index.tsxnew file mode 100644index 00000000..92bd10bd--- /dev/null+++ b/registry/remocn/anamorphic-flare/index.tsx@@ -0,0 +1,266 @@+"use client";++import type React from "react";+import { useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type AnamorphicFlareProps = {+ /** Lockup revealed behind the streak. Falls back to a placeholder "remocn" lockup. */+ children?: React.ReactNode;+ /** Warm tint of the streak glow and ghosts. */+ tint?: string;+ /** Color of the hot core line. */+ coreColor?: string;+ backgroundColor?: string;+ /** Number of ghost orbs mirrored across the frame center. */+ ghosts?: number;+ /** Vertical position of the streak, 0 to 1. */+ y?: number;+ seed?: number;+ speed?: number;+};++export const anamorphicFlareDefaults = {+ tint: "#E5322D",+ coreColor: "#FFFFFF",+ backgroundColor: "#111111",+ ghosts: 4,+ y: 0.5,+ seed: 2,+ speed: 1,+};++const IGNITE = 6;+const CROSS_START = 4;+const CROSS_END = 26;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++const PLACEHOLDER_FONT =+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif";++// Neutral lockup shown when no children are passed.+function PlaceholderLockup({+ mark,+ dot,+ text,+ scale = 1,+}: {+ mark: string;+ dot: string;+ text: string;+ scale?: number;+}) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 * scale }}>+ <div+ style={{+ width: 120 * scale,+ height: 120 * scale,+ borderRadius: 32 * scale,+ backgroundColor: mark,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36 * scale,+ height: 36 * scale,+ borderRadius: "50%",+ backgroundColor: dot,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: PLACEHOLDER_FONT,+ fontSize: 104 * scale,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: text,+ }}+ >+ remocn+ </span>+ </div>+ );+}++export function AnamorphicFlare(props: AnamorphicFlareProps) {+ const { children, tint, coreColor, backgroundColor, ghosts, y, seed, speed } =+ { ...anamorphicFlareDefaults, ...props };+ const uid = `anamorphic-flare-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const t = frame * Math.max(0, speed);+ const cy = y * height;+ const cx = width / 2;++ const head = interpolate(t, [CROSS_START, CROSS_END], [0.07, 1.12], {+ ...clamp,+ easing: Easing.bezier(0.45, 0, 0.4, 1),+ });+ const hx = head * width;+ const ignite = interpolate(t, [0, IGNITE], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const fade = interpolate(t, [CROSS_END - 6, CROSS_END + 2], [1, 0], clamp);+ const power = ignite * fade;+ const streakLen =+ width *+ interpolate(t, [0, 12], [0.04, 1.3], {+ ...clamp,+ easing: Easing.out(Easing.quad),+ });+ const coreH = Math.max(2, height * 0.004);+ const glowH = height * 0.05;+ const residual = interpolate(+ t,+ [CROSS_END - 2, CROSS_END + 14],+ [0, 0.14],+ clamp,+ );+ const soft = width * 0.08;+ const mask = `linear-gradient(90deg, #000 0px, #000 ${hx - soft}px, transparent ${hx}px)`;++ const ghostList = Array.from(+ { length: Math.max(0, Math.round(ghosts)) },+ (_, i) => {+ const k = -1.3 + random(`anamorphic-flare-${seed}-${i}-k`) * 2.2;+ return {+ x: cx - (hx - cx) * k,+ r: height * (0.025 + 0.07 * random(`anamorphic-flare-${seed}-${i}-r`)),+ o: 0.12 + 0.18 * random(`anamorphic-flare-${seed}-${i}-o`),+ dy: (random(`anamorphic-flare-${seed}-${i}-y`) - 0.5) * height * 0.05,+ };+ },+ );++ return (+ <AbsoluteFill style={{ backgroundColor }}>+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ >+ <defs>+ <linearGradient id={`${uid}-trail`} x1="0" y1="0" x2="1" y2="0">+ <stop offset="0" stopColor={tint} stopOpacity={0} />+ <stop offset="0.5" stopColor={tint} stopOpacity={1} />+ <stop offset="1" stopColor={tint} stopOpacity={0} />+ </linearGradient>+ </defs>+ <rect+ x={0}+ y={cy - 1}+ width={width}+ height={2}+ fill={`url(#${uid}-trail)`}+ opacity={residual}+ />+ </svg>+ <AbsoluteFill+ style={{+ alignItems: "center",+ justifyContent: "center",+ WebkitMaskImage: mask,+ maskImage: mask,+ }}+ >+ {children ?? (+ <PlaceholderLockup+ mark={tint}+ dot={backgroundColor}+ text={coreColor}+ />+ )}+ </AbsoluteFill>+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{+ position: "absolute",+ inset: 0,+ mixBlendMode: "screen",+ }}+ >+ <defs>+ <linearGradient id={`${uid}-core`} x1="0" y1="0" x2="1" y2="0">+ <stop offset="0" stopColor={coreColor} stopOpacity={0} />+ <stop offset="0.5" stopColor={coreColor} stopOpacity={1} />+ <stop offset="1" stopColor={coreColor} stopOpacity={0} />+ </linearGradient>+ <radialGradient id={`${uid}-bloom`}>+ <stop offset="0" stopColor={coreColor} stopOpacity={1} />+ <stop offset="0.25" stopColor={tint} stopOpacity={0.7} />+ <stop offset="1" stopColor={tint} stopOpacity={0} />+ </radialGradient>+ <radialGradient id={`${uid}-ghost`}>+ <stop offset="0" stopColor={tint} stopOpacity={0.15} />+ <stop offset="0.8" stopColor={tint} stopOpacity={0.5} />+ <stop offset="1" stopColor={tint} stopOpacity={0} />+ </radialGradient>+ <filter+ id={`${uid}-blur`}+ x={-width}+ y={-height}+ width={width * 3}+ height={height * 3}+ filterUnits="userSpaceOnUse"+ >+ <feGaussianBlur stdDeviation={glowH * 0.35} />+ </filter>+ </defs>+ <g opacity={power}>+ <rect+ x={hx - streakLen * 0.45}+ y={cy - glowH / 2}+ width={streakLen * 0.9}+ height={glowH}+ fill={`url(#${uid}-trail)`}+ opacity={0.55}+ filter={`url(#${uid}-blur)`}+ />+ <rect+ x={hx - streakLen / 2}+ y={cy - coreH / 2}+ width={streakLen}+ height={coreH}+ fill={`url(#${uid}-core)`}+ />+ <ellipse+ cx={hx}+ cy={cy}+ rx={height * 0.16}+ ry={height * 0.1}+ fill={`url(#${uid}-bloom)`}+ />+ {ghostList.map((g, i) => (+ <circle+ key={i}+ cx={g.x}+ cy={cy + g.dy}+ r={g.r}+ fill={`url(#${uid}-ghost)`}+ opacity={g.o * 2}+ />+ ))}+ </g>+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/blueprint/config.ts b/registry/remocn/blueprint/config.tsnew file mode 100644index 00000000..e43f381f--- /dev/null+++ b/registry/remocn/blueprint/config.ts@@ -0,0 +1,34 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const blueprintConfig: ComponentConfig = {+ componentName: "Blueprint",+ importPath: "@/components/remocn/blueprint",+ controls: {+ blueprintColor: {+ type: "color",+ default: "#173C8F",+ description: "Blueprint",+ },+ lineColor: { type: "color", default: "#FFFFFF", description: "Lines" },+ calloutColor: {+ type: "color",+ default: "#E5322D",+ description: "Callout",+ },+ productColor: {+ type: "color",+ default: "#E5322D",+ description: "Product",+ },+ background: {+ type: "color",+ default: "#FFFFFF",+ description: "Background",+ },+ },+ durationInFrames: 75,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#173C8F" },+};diff --git a/registry/remocn/blueprint/index.tsx b/registry/remocn/blueprint/index.tsxnew file mode 100644index 00000000..5eddbc29--- /dev/null+++ b/registry/remocn/blueprint/index.tsx@@ -0,0 +1,466 @@+"use client";++import { type ReactNode, useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type BlueprintLabels = {+ width: string;+ height: string;+ callout: string;+ title: string;+};++export type BlueprintProps = {+ /** Product to convert. Its silhouette and dark details become white linework. Defaults to a red device. */+ children?: ReactNode;+ /** Measured box around the product, as fractions of the frame [width, height]. */+ box?: [number, number];+ /** Point the red callout points at, as fractions of the box [x, y]. */+ calloutAt?: [number, number];+ blueprintColor?: string;+ lineColor?: string;+ calloutColor?: string;+ /** Ground behind the product before the wipe. */+ background?: string;+ productColor?: string;+ labels?: Partial<BlueprintLabels>;+ speed?: number;+};++export const blueprintDefaults = {+ box: [0.17, 0.6] as [number, number],+ calloutAt: [0.5, 0.11] as [number, number],+ blueprintColor: "#173C8F",+ lineColor: "#FFFFFF",+ calloutColor: "#E5322D",+ background: "#FFFFFF",+ productColor: "#E5322D",+ labels: {+ width: "71.6 mm",+ height: "147.5 mm",+ callout: "SENSOR",+ title: "DWG A-01 SCALE 1:1",+ } as BlueprintLabels,+ speed: 1,+};++export const blueprintLength = 45;++const MONO = "ui-monospace, 'SF Mono', Menlo, Consolas, monospace";+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};+const ease = (t: number, from: number, to: number) =>+ interpolate(t, [from, to], [0, 1], {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });++export function Blueprint({+ children,+ box = blueprintDefaults.box,+ calloutAt = blueprintDefaults.calloutAt,+ blueprintColor = blueprintDefaults.blueprintColor,+ lineColor = blueprintDefaults.lineColor,+ calloutColor = blueprintDefaults.calloutColor,+ background = blueprintDefaults.background,+ productColor = blueprintDefaults.productColor,+ labels,+ speed = blueprintDefaults.speed,+}: BlueprintProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const text = { ...blueprintDefaults.labels, ...labels };+ const t = (frame / fps) * 30 * speed;+ const u = Math.min(width, height) / 720;++ const cx = width * 0.47;+ const cy = height * 0.46;+ const bw = box[0] * width;+ const bh = box[1] * height;+ const x0 = cx - bw / 2;+ const x1 = cx + bw / 2;+ const y0 = cy - bh / 2;+ const y1 = cy + bh / 2;+ const radius = Math.min(bw, bh) * 0.16;+ const dot = { x: x0 + calloutAt[0] * bw, y: y0 + calloutAt[1] * bh };++ const wipe = interpolate(t, [6, 24], [-0.04, 1.04], {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });+ const wipeX = wipe * width;+ const outline = ease(t, 8, 28);+ const extension = ease(t, 22, 28);+ const dims = ease(t, 24, 32);+ const label = ease(t, 30, 36);+ const leader = ease(t, 32, 40);+ const bubble = interpolate(t, [36, 42], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.back(2)),+ });+ const calloutText = ease(t, 38, 44);++ const stroke = 2.4 * u;+ const thin = 1.2 * u;+ const tick = 7 * u;+ const dimY = y1 + 0.08 * height;+ const dimX = x1 + 0.06 * width;+ const half = (a: number, b: number, p: number) => [+ (a + b) / 2 - ((b - a) / 2) * p,+ (a + b) / 2 + ((b - a) / 2) * p,+ ];+ const [hx0, hx1] = half(x0, x1, dims);+ const [vy0, vy1] = half(y0, y1, dims);+ // Callout goes left of the product when the label fits, otherwise above it.+ const ring = Math.min(bw, bh) * 0.11;+ const labelWidth = text.callout.length * 11.8 * u + 26 * u;+ const sideways = x0 - 0.14 * width - labelWidth > 0.03 * width;+ const lead = sideways+ ? { x: x0 - 0.14 * width, y: y0 + 0.06 * height }+ : {+ x: Math.max(0.06 * width, dot.x - 0.1 * width),+ y: Math.max(0.08 * height, y0 - 0.1 * height),+ };+ const elbow = sideways+ ? `L ${lead.x + 0.06 * width} ${lead.y} H ${lead.x}`+ : `L ${lead.x} ${lead.y}`;+ const draw = (p: number) => ({+ pathLength: 1,+ strokeDasharray: 1,+ strokeDashoffset: 1 - p,+ opacity: p > 0 ? 1 : 0,+ });+ const minor = 22 * u;++ return (+ <AbsoluteFill style={{ backgroundColor: background, overflow: "hidden" }}>+ <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>+ <defs>+ <filter+ id={`${id}-lines`}+ x="0"+ y="0"+ width="1"+ height="1"+ colorInterpolationFilters="sRGB"+ >+ <feMorphology+ in="SourceAlpha"+ operator="dilate"+ radius={1.6 * u}+ result="grown"+ />+ <feComposite+ in="grown"+ in2="SourceAlpha"+ operator="out"+ result="edge"+ />+ <feColorMatrix+ in="SourceGraphic"+ type="matrix"+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3 -6 -1 4 -1.2"+ result="dark"+ />+ <feMorphology+ in="dark"+ operator="dilate"+ radius={1.6 * u}+ result="darkGrown"+ />+ <feComposite+ in="darkGrown"+ in2="dark"+ operator="out"+ result="darkEdge"+ />+ <feMerge result="all">+ <feMergeNode in="edge" />+ <feMergeNode in="darkEdge" />+ </feMerge>+ <feFlood floodColor={lineColor} />+ <feComposite in2="all" operator="in" />+ </filter>+ </defs>+ </svg>++ {/* Product, before the wipe. */}+ <AbsoluteFill>+ {children ? (+ <AbsoluteFill+ style={{ alignItems: "center", justifyContent: "center" }}+ >+ <div+ style={{+ transform: `translate(${cx - width / 2}px, ${cy - height / 2}px)`,+ }}+ >+ {children}+ </div>+ </AbsoluteFill>+ ) : (+ <svg width={width} height={height} aria-hidden>+ <rect+ x={x0}+ y={y0 + 10 * u}+ width={bw}+ height={bh}+ rx={radius}+ fill="#000"+ opacity={0.12}+ style={{ filter: `blur(${14 * u}px)` }}+ />+ <rect+ x={x0}+ y={y0}+ width={bw}+ height={bh}+ rx={radius}+ fill={productColor}+ />+ <circle cx={dot.x} cy={dot.y} r={bw * 0.06} fill="#111111" />+ </svg>+ )}+ </AbsoluteFill>++ {/* Technical drawing, revealed left to right. */}+ <AbsoluteFill style={{ clipPath: `inset(0 ${width - wipeX}px 0 0)` }}>+ <svg width={width} height={height} aria-hidden>+ <defs>+ <pattern+ id={`${id}-grid`}+ width={minor * 5}+ height={minor * 5}+ patternUnits="userSpaceOnUse"+ >+ <path+ d={Array.from(+ { length: 5 },+ (_, i) =>+ `M ${i * minor} 0 V ${minor * 5} M 0 ${i * minor} H ${minor * 5}`,+ ).join(" ")}+ stroke={lineColor}+ strokeOpacity={0.09}+ strokeWidth={u}+ />+ <path+ d={`M 0 0 V ${minor * 5} M 0 0 H ${minor * 5}`}+ stroke={lineColor}+ strokeOpacity={0.22}+ strokeWidth={u}+ />+ </pattern>+ </defs>+ <rect width={width} height={height} fill={blueprintColor} />+ <rect width={width} height={height} fill={`url(#${id}-grid)`} />+ </svg>+ {children ? (+ <AbsoluteFill+ style={{+ alignItems: "center",+ justifyContent: "center",+ filter: `url(#${id}-lines)`,+ clipPath: `inset(0 ${width * (1 - outline)}px 0 0)`,+ }}+ >+ <div+ style={{+ transform: `translate(${cx - width / 2}px, ${cy - height / 2}px)`,+ }}+ >+ {children}+ </div>+ </AbsoluteFill>+ ) : null}+ <svg+ width={width}+ height={height}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <g fill="none" stroke={lineColor} strokeLinecap="round">+ {children ? null : (+ <>+ <rect+ x={x0}+ y={y0}+ width={bw}+ height={bh}+ rx={radius}+ strokeWidth={stroke}+ {...draw(outline)}+ />+ <rect+ x={x0 + bw * 0.07}+ y={y0 + bw * 0.07}+ width={bw * 0.86}+ height={bh - bw * 0.14}+ rx={radius * 0.7}+ strokeWidth={thin}+ strokeOpacity={0.7}+ {...draw(outline)}+ />+ <circle+ cx={dot.x}+ cy={dot.y}+ r={bw * 0.06}+ strokeWidth={stroke}+ {...draw(outline)}+ />+ </>+ )}+ {/* Center lines */}+ <path+ d={`M ${cx} ${y0 - 0.05 * height} V ${y1 + 0.05 * height} M ${x0 - 0.04 * width} ${cy} H ${x1 + 0.04 * width}`}+ strokeWidth={thin}+ strokeOpacity={0.55 * outline}+ strokeDasharray={`${14 * u} ${4 * u} ${3 * u} ${4 * u}`}+ />+ {/* Extension lines */}+ <path+ d={`M ${x0} ${y1 + 8 * u} V ${y1 + 8 * u + (dimY - y1) * extension} M ${x1} ${y1 + 8 * u} V ${y1 + 8 * u + (dimY - y1) * extension} M ${x1 + 8 * u} ${y0} H ${x1 + 8 * u + (dimX - x1) * extension} M ${x1 + 8 * u} ${y1} H ${x1 + 8 * u + (dimX - x1) * extension}`}+ strokeWidth={thin}+ strokeOpacity={0.8}+ />+ {/* Dimension lines with architectural ticks */}+ <path+ d={`M ${hx0} ${dimY} H ${hx1} M ${dimX} ${vy0} V ${vy1}`}+ strokeWidth={thin * 1.3}+ />+ {dims > 0.98+ ? [+ [x0, dimY],+ [x1, dimY],+ [dimX, y0],+ [dimX, y1],+ ].map(([x, y]) => (+ <line+ key={`${x}-${y}`}+ x1={x - tick}+ y1={y + tick}+ x2={x + tick}+ y2={y - tick}+ strokeWidth={stroke}+ />+ ))+ : null}+ </g>+ <g+ fontFamily={MONO}+ fontSize={17 * u}+ letterSpacing={1.5 * u}+ fill={lineColor}+ opacity={label}+ >+ <rect+ x={cx - 62 * u}+ y={dimY - 12 * u}+ width={124 * u}+ height={24 * u}+ fill={blueprintColor}+ />+ <text x={cx} y={dimY + 6 * u} textAnchor="middle">+ {text.width}+ </text>+ {bh > 190 * u ? (+ <g transform={`translate(${dimX} ${cy}) rotate(-90)`}>+ <rect+ x={-66 * u}+ y={-12 * u}+ width={132 * u}+ height={24 * u}+ fill={blueprintColor}+ />+ <text y={6 * u} textAnchor="middle">+ {text.height}+ </text>+ </g>+ ) : (+ <text x={dimX + 16 * u} y={cy + 6 * u}>+ {text.height}+ </text>+ )}+ <g+ transform={`translate(${width - 0.05 * width} ${height - 0.06 * height})`}+ >+ <rect+ x={-290 * u}+ y={-40 * u}+ width={290 * u}+ height={40 * u}+ fill="none"+ stroke={lineColor}+ strokeWidth={thin}+ />+ <text x={-276 * u} y={-14 * u} fontSize={14 * u}>+ {text.title}+ </text>+ </g>+ </g>+ {/* Red callout */}+ <g+ stroke={calloutColor}+ fill="none"+ strokeWidth={stroke}+ strokeLinecap="round"+ >+ <circle cx={dot.x} cy={dot.y} r={ring} {...draw(leader)} />+ <path+ d={`M ${dot.x - ring * 0.72} ${dot.y - ring * 0.72} ${elbow}`}+ {...draw(leader)}+ />+ <circle+ cx={lead.x}+ cy={lead.y}+ r={16 * u * bubble}+ fill={calloutColor}+ stroke="none"+ />+ </g>+ <g fontFamily={MONO} opacity={calloutText}>+ <text+ x={lead.x}+ y={lead.y + 6 * u}+ textAnchor="middle"+ fontSize={16 * u}+ fontWeight={700}+ fill={lineColor}+ >+ A+ </text>+ <text+ x={sideways ? lead.x - 26 * u : lead.x + 26 * u}+ y={lead.y + 6 * u}+ textAnchor={sideways ? "end" : "start"}+ fontSize={17 * u}+ letterSpacing={1.5 * u}+ fill={lineColor}+ >+ {text.callout}+ </text>+ </g>+ </svg>+ </AbsoluteFill>++ {/* Scan edge */}+ <AbsoluteFill+ style={{+ left: wipeX - 2 * u,+ width: 4 * u,+ backgroundColor: lineColor,+ boxShadow: `0 0 ${24 * u}px ${6 * u}px ${lineColor}`,+ opacity: wipe > 0 && wipe < 1 ? 0.9 : 0,+ }}+ />+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/brick-mosaic/config.ts b/registry/remocn/brick-mosaic/config.tsnew file mode 100644index 00000000..12093ce4--- /dev/null+++ b/registry/remocn/brick-mosaic/config.ts@@ -0,0 +1,62 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";+import { brickMosaicDefaults, getBrickMosaicLength } from ".";++const HOLD = 29;++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" && Number.isFinite(value) ? value : fallback;++function durationOf(values: Record<string, unknown>) {+ const motion = getBrickMosaicLength(+ numberOr(values.rows, brickMosaicDefaults.rows),+ numberOr(values.cols, brickMosaicDefaults.cols),+ numberOr(values.rowDelay, brickMosaicDefaults.rowDelay),+ );+ const speed = numberOr(values.speed, 1);+ return Math.ceil(motion / (speed > 0 ? speed : 1)) + HOLD;+}++export const brickMosaicConfig: ComponentConfig = {+ componentName: "BrickMosaic",+ importPath: "@/components/remocn/brick-mosaic",+ controls: {+ cols: {+ type: "number",+ default: 24,+ min: 6,+ max: 40,+ step: 1,+ description: "Columns",+ hiddenFromList: false,+ },+ rows: {+ type: "number",+ default: 14,+ min: 4,+ max: 24,+ step: 1,+ description: "Rows",+ hiddenFromList: false,+ },+ rowDelay: {+ type: "number",+ default: 3,+ min: 1,+ max: 8,+ step: 1,+ description: "Row delay",+ hiddenFromList: false,+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Baseplate",+ },+ },+ durationInFrames: 85,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/brick-mosaic/index.tsx b/registry/remocn/brick-mosaic/index.tsxnew file mode 100644index 00000000..6f0cc268--- /dev/null+++ b/registry/remocn/brick-mosaic/index.tsx@@ -0,0 +1,187 @@+"use client";++import { useId, useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type BrickMosaicProps = {+ /**+ * Pixel art to build. Either rows of characters looked up in `colors`+ * (unknown characters and spaces leave the cell empty) or a 2D grid of CSS+ * colors ("" for empty). Overrides `cols` and `rows`.+ */+ pattern?: string[] | string[][];+ /** Grid size of the default image. */+ cols?: number;+ rows?: number;+ /** Character to color map for string patterns. */+ colors?: Record<string, string>;+ /** Baseplate color behind the bricks. */+ background?: string;+ /** Frames between rows. */+ rowDelay?: number;+ speed?: number;+};++export const brickMosaicDefaults = {+ cols: 24,+ rows: 14,+ colors: {+ "#": "#E5322D",+ ".": "#FFFFFF",+ x: "#111111",+ } as Record<string, string>,+ background: "#111111",+ rowDelay: 3,+ speed: 1,+};++const FALL = 7;+const HOP = 5;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++function defaultPattern(cols: number, rows: number): string[] {+ const cx = (cols - 1) / 2;+ const cy = (rows - 1) / 2;+ const r = Math.min(cols, rows) * 0.4;+ return Array.from({ length: rows }, (_, y) =>+ Array.from({ length: cols }, (_, x) =>+ Math.hypot(x - cx, y - cy) <= r ? "#" : ".",+ ).join(""),+ );+}++export function getBrickMosaicLength(rows: number, cols: number, rowDelay = 3) {+ return Math.ceil((rows - 1) * rowDelay + cols * 0.12 + 1.5 + FALL + HOP);+}++export function BrickMosaic({+ pattern,+ cols = brickMosaicDefaults.cols,+ rows = brickMosaicDefaults.rows,+ colors = brickMosaicDefaults.colors,+ background = brickMosaicDefaults.background,+ rowDelay = brickMosaicDefaults.rowDelay,+ speed = brickMosaicDefaults.speed,+}: BrickMosaicProps) {+ const frame = useCurrentFrame();+ const { width: W, height: H, fps } = useVideoConfig();+ const t = (frame / fps) * 30 * speed;+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");++ const grid = useMemo(() => {+ const source = pattern ?? defaultPattern(cols, rows);+ return source.map((row) =>+ (typeof row === "string" ? row.split("") : row).map((cell) =>+ typeof row === "string" ? (colors[cell] ?? "") : cell,+ ),+ );+ }, [pattern, cols, rows, colors]);+ const nRows = grid.length;+ const nCols = Math.max(1, ...grid.map((row) => row.length));+ const s = Math.min((W * 0.86) / nCols, (H * 0.86) / nRows);+ const ox = (W - s * nCols) / 2;+ const oy = (H - s * nRows) / 2;+ const gap = s * 0.04;+ const bevel = s * 0.09;+ const stud = s * 0.28;++ const bricks = grid.flatMap((row, r) =>+ row.map((color, col) => {+ if (!color) return null;+ const fromBottom = nRows - 1 - r;+ const start =+ fromBottom * rowDelay + col * 0.12 + random(`brick-${r}-${col}`) * 1.5;+ const local = t - start;+ if (local < 0) return null;+ let y = 0;+ if (local < FALL) {+ const p = local / FALL;+ y = -s * 1.8 * (1 - p * p);+ } else if (local < FALL + HOP) {+ const p = (local - FALL) / HOP;+ y = -s * 0.12 * 4 * p * (1 - p);+ }+ const opacity = interpolate(local, [0, 2], [0, 1], clamp);+ const x0 = ox + col * s + gap / 2;+ const y0 = oy + r * s + gap / 2 + y;+ const b = s - gap;+ return (+ <g+ key={`${r}-${col}`}+ transform={`translate(${x0} ${y0})`}+ opacity={opacity}+ >+ <rect width={b} height={b} rx={s * 0.06} fill={color} />+ <path+ d={`M 0 ${b} V 0 H ${b} L ${b - bevel} ${bevel} H ${bevel} V ${b - bevel} Z`}+ fill="#FFFFFF"+ opacity={0.22}+ />+ <path+ d={`M ${b} 0 V ${b} H 0 L ${bevel} ${b - bevel} H ${b - bevel} V ${bevel} Z`}+ fill="#000000"+ opacity={0.22}+ />+ <circle+ cx={b / 2 + s * 0.035}+ cy={b / 2 + s * 0.05}+ r={stud}+ fill="#000000"+ opacity={0.28}+ />+ <circle cx={b / 2} cy={b / 2} r={stud} fill={color} />+ <circle cx={b / 2} cy={b / 2} r={stud} fill={`url(#${id}-stud)`} />+ </g>+ );+ }),+ );++ const landed = interpolate(t, [0, 10], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });++ return (+ <AbsoluteFill style={{ backgroundColor: background, overflow: "hidden" }}>+ <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden>+ <defs>+ <linearGradient+ id={`${id}-stud`}+ x1="0.15"+ y1="0.1"+ x2="0.85"+ y2="0.9"+ >+ <stop offset="0" stopColor="#FFFFFF" stopOpacity={0.5} />+ <stop offset="0.45" stopColor="#FFFFFF" stopOpacity={0} />+ <stop offset="1" stopColor="#000000" stopOpacity={0.22} />+ </linearGradient>+ </defs>+ {/* Baseplate studs the bricks snap onto. */}+ <g fill="#FFFFFF" opacity={0.07 * landed}>+ {grid.flatMap((row, r) =>+ row.map((_, col) => (+ <circle+ key={`${r}-${col}`}+ cx={ox + (col + 0.5) * s}+ cy={oy + (r + 0.5) * s}+ r={stud}+ />+ )),+ )}+ </g>+ {bricks}+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/cloth-reveal/config.ts b/registry/remocn/cloth-reveal/config.tsnew file mode 100644index 00000000..ee9a06fe--- /dev/null+++ b/registry/remocn/cloth-reveal/config.ts@@ -0,0 +1,62 @@+import { clothRevealExampleCode } from "@/components/docs/examples/cloth-reveal-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++// At the defaults the yank clears the frame about 28 frames after the tug starts.+const PULL = 28;+const HOLD = 30;++function durationOf(values: Record<string, unknown>) {+ const delay = typeof values.delay === "number" ? values.delay : 6;+ const speed =+ typeof values.speed === "number" && values.speed > 0 ? values.speed : 1;+ return Math.ceil((delay + PULL) / speed) + HOLD;+}++export const clothRevealConfig: ComponentConfig = {+ componentName: "ClothReveal",+ importPath: "@/components/remocn/cloth-reveal",+ controls: {+ direction: {+ type: "enum",+ default: "right",+ variants: { right: {}, left: {}, up: {}, down: {} },+ description: "Direction",+ },+ clothColor: { type: "color", default: "#E5322D", description: "Cloth" },+ undersideColor: {+ type: "color",+ default: "#8E1A16",+ description: "Underside",+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ delay: {+ type: "number",+ default: 6,+ min: 0,+ max: 30,+ step: 1,+ description: "Delay",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 2,+ min: 1,+ max: 24,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ },+ durationInFrames: 60,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: clothRevealExampleCode,+};diff --git a/registry/remocn/cloth-reveal/index.tsx b/registry/remocn/cloth-reveal/index.tsxnew file mode 100644index 00000000..84213907--- /dev/null+++ b/registry/remocn/cloth-reveal/index.tsx@@ -0,0 +1,525 @@+"use client";++import type React from "react";+import { useId, useMemo } from "react";+import {+ AbsoluteFill,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type ClothRevealDirection = "right" | "left" | "up" | "down";++export type ClothRevealProps = {+ /** Content hidden under the sheet. Falls back to a placeholder "remocn" lockup. */+ children?: React.ReactNode;+ clothColor?: string;+ /** Underside tint, seen where the sheet folds over. */+ undersideColor?: string;+ /** Background behind the children. */+ background?: string;+ /** Which way the sheet is yanked. */+ direction?: ClothRevealDirection;+ /** Frame (at 30fps) when the tug starts. */+ delay?: number;+ seed?: number;+ speed?: number;+};++export const clothRevealDefaults = {+ clothColor: "#E5322D",+ undersideColor: "#8E1A16",+ background: "#111111",+ direction: "right" as ClothRevealDirection,+ delay: 6,+ seed: 2,+ speed: 1,+};++const COLS = 40;+const ROWS = 24;+const FRAMES = 72;+const SUBSTEPS = 5;+const ITERATIONS = 12;++type Sim = { frames: Float32Array[]; heights: Float32Array };++const PATHS: Record<+ ClothRevealDirection,+ { corner: [number, number]; dir: [number, number] }+> = {+ right: { corner: [1, 0], dir: [1, -0.32] },+ left: { corner: [0, 0], dir: [-1, -0.32] },+ up: { corner: [1, 0], dir: [0.4, -1] },+ down: { corner: [0, 1], dir: [-0.4, 1] },+};++const smooth = (v: number) => {+ const t = Math.min(1, Math.max(0, v));+ return t * t * (3 - 2 * t);+};++// Verlet cloth in table space: x/y on the table, z up toward the camera. The+// sheet rests on a soft bump (whatever it hides) with seeded wrinkles baked+// into its rest shape, so frame 0 is already at equilibrium.+function simulate(+ width: number,+ height: number,+ direction: ClothRevealDirection,+ delay: number,+ seed: number,+): Sim {+ const n = COLS * ROWS;+ const pos = new Float64Array(n * 3);+ const prev = new Float64Array(n * 3);+ const floorZ = new Float64Array(n);+ const pinned = new Uint8Array(n);+ const unit = Math.min(width, height);+ const bump = (x: number, y: number) => {+ const dx = (x - width / 2) / (width * 0.3);+ const dy = (y - height / 2) / (height * 0.34);+ return unit * 0.09 * Math.exp(-(dx * dx + dy * dy) * 1.4);+ };+ // Folds radiate from the hidden object and deepen toward the hem, plus a+ // couple of long soft waves so the sheet never looks ironed.+ const folds = 7 + Math.floor(random(`cloth-${seed}-n`) * 4);+ const twist = random(`cloth-${seed}-t`) * Math.PI * 2;+ const waves = [0, 1].map((k) => ({+ a: random(`cloth-${seed}-a${k}`) * Math.PI,+ f: 0.8 + random(`cloth-${seed}-f${k}`) * 1.2,+ p: random(`cloth-${seed}-p${k}`) * Math.PI * 2,+ }));++ for (let r = 0; r < ROWS; r++) {+ for (let c = 0; c < COLS; c++) {+ const i = r * COLS + c;+ const u = c / (COLS - 1);+ const v = r / (ROWS - 1);+ const x = width * (-0.06 + u * 1.12);+ const y = height * (-0.08 + v * 1.16);+ const dx = (x - width / 2) / width;+ const dy = (y - height / 2) / width;+ const rho = Math.hypot(dx, dy);+ const theta = Math.atan2(dy, dx);+ const radial =+ (0.5 + 0.5 * Math.sin(theta * folds + twist + rho * 9)) ** 1.6 *+ smooth((rho - 0.12) / 0.35);+ let wave = 0;+ for (const w of waves) {+ const s = u * Math.cos(w.a) + v * Math.sin(w.a);+ wave += 0.5 + 0.5 * Math.sin(s * w.f * Math.PI * 2 + w.p);+ }+ floorZ[i] = unit * (0.045 * radial + 0.012 * wave);+ pos[i * 3] = x;+ pos[i * 3 + 1] = y;+ pos[i * 3 + 2] = floorZ[i] + bump(x, y);+ }+ }+ prev.set(pos);+ const heights = new Float32Array(n);+ for (let i = 0; i < n; i++) heights[i] = pos[i * 3 + 2];++ const links: number[] = [];+ const add = (a: number, b: number, stiff: number) => {+ const dx = pos[a * 3] - pos[b * 3];+ const dy = pos[a * 3 + 1] - pos[b * 3 + 1];+ const dz = pos[a * 3 + 2] - pos[b * 3 + 2];+ links.push(a, b, Math.hypot(dx, dy, dz), stiff);+ };+ for (let r = 0; r < ROWS; r++) {+ for (let c = 0; c < COLS; c++) {+ const i = r * COLS + c;+ if (c + 1 < COLS) add(i, i + 1, 1);+ if (r + 1 < ROWS) add(i, i + COLS, 1);+ if (c + 1 < COLS && r + 1 < ROWS) {+ add(i, i + COLS + 1, 0.7);+ add(i + 1, i + COLS, 0.7);+ }+ if (c + 2 < COLS) add(i, i + 2, 0.25);+ if (r + 2 < ROWS) add(i, i + COLS * 2, 0.25);+ }+ }++ // The hand pinches a small patch around the corner, not a single vertex.+ const path = PATHS[direction];+ const cc = path.corner[0] * (COLS - 1);+ const cr = path.corner[1] * (ROWS - 1);+ const grip: number[] = [];+ for (let r = 0; r < ROWS; r++) {+ for (let c = 0; c < COLS; c++) {+ if (Math.abs(c - cc) + Math.abs(r - cr) <= 3) grip.push(r * COLS + c);+ }+ }+ const gripStart = grip.map((i) => [+ pos[i * 3],+ pos[i * 3 + 1],+ pos[i * 3 + 2],+ ]);+ for (const i of grip) pinned[i] = 1;+ const len = Math.hypot(path.dir[0], path.dir[1]);+ const dir = [path.dir[0] / len, path.dir[1] / len];+ const reach = Math.abs(dir[0]) * width + Math.abs(dir[1]) * height;+ const g = unit * 0.006;+ const dt = 1 / SUBSTEPS;++ const hand = (t: number) => {+ const s = Math.max(0, t - delay);+ // Quick lift, then an accelerating yank that keeps going off-frame.+ const lift = unit * 0.5 * smooth(s / 9);+ const travel =+ s < 30+ ? reach * 1.25 * (s / 30) ** 2+ : reach * 1.25 * (1 + ((s - 30) * 2) / 30);+ return [dir[0] * travel, dir[1] * travel, lift];+ };++ const frames: Float32Array[] = [];+ const record = () => {+ const out = new Float32Array(n * 3);+ for (let i = 0; i < n * 3; i++) out[i] = pos[i];+ frames.push(out);+ };+ record();++ for (let f = 1; f <= FRAMES; f++) {+ for (let s = 1; s <= SUBSTEPS; s++) {+ const t = f - 1 + s * dt;+ const [hx, hy, hz] = hand(t);+ for (let i = 0; i < n; i++) {+ const k = i * 3;+ if (pinned[i]) continue;+ const z = pos[k + 2];+ const lifted = z - floorZ[i] - bump(pos[k], pos[k + 1]) > 1;+ const drag = lifted ? 0.985 : 0.6;+ const vx = (pos[k] - prev[k]) * drag;+ const vy = (pos[k + 1] - prev[k + 1]) * drag;+ const vz = (pos[k + 2] - prev[k + 2]) * 0.985;+ prev[k] = pos[k];+ prev[k + 1] = pos[k + 1];+ prev[k + 2] = z;+ // Flutter: a travelling ripple that only bites on fast-moving cloth.+ const speedXY = Math.hypot(vx, vy);+ const flutter =+ Math.sin(pos[k] * 0.02 + pos[k + 1] * 0.013 + t * 1.7) *+ speedXY *+ 0.06;+ pos[k] += vx;+ pos[k + 1] += vy;+ pos[k + 2] += vz + flutter - g * dt * dt;+ }+ grip.forEach((i, j) => {+ pos[i * 3] = gripStart[j][0] + hx;+ pos[i * 3 + 1] = gripStart[j][1] + hy;+ pos[i * 3 + 2] = gripStart[j][2] + hz;+ });+ for (let it = 0; it < ITERATIONS; it++) {+ for (let l = 0; l < links.length; l += 4) {+ const a = links[l];+ const b = links[l + 1];+ const rest = links[l + 2];+ const stiff = links[l + 3];+ const ka = a * 3;+ const kb = b * 3;+ const dx = pos[kb] - pos[ka];+ const dy = pos[kb + 1] - pos[ka + 1];+ const dz = pos[kb + 2] - pos[ka + 2];+ const d = Math.hypot(dx, dy, dz) || 1e-6;+ const wa = pinned[a] ? 0 : 1;+ const wb = pinned[b] ? 0 : 1;+ if (wa + wb === 0) continue;+ const diff = ((d - rest) / d / (wa + wb)) * stiff;+ pos[ka] += dx * diff * wa;+ pos[ka + 1] += dy * diff * wa;+ pos[ka + 2] += dz * diff * wa;+ pos[kb] -= dx * diff * wb;+ pos[kb + 1] -= dy * diff * wb;+ pos[kb + 2] -= dz * diff * wb;+ }+ for (let i = 0; i < n; i++) {+ const k = i * 3;+ const ground = floorZ[i] + bump(pos[k], pos[k + 1]);+ if (pos[k + 2] < ground) pos[k + 2] = ground;+ }+ }+ }+ record();+ }+ return { frames, heights };+}++function parseHex(hex: string): [number, number, number] {+ const h = hex.replace("#", "");+ const full = h.length === 3 ? h.replace(/./g, (c) => c + c) : h.slice(0, 6);+ const v = Number.parseInt(full, 16);+ return [(v >> 16) & 255, (v >> 8) & 255, v & 255];+}++// Wordmark color for the placeholder: dark ink on light backgrounds.+function placeholderText(background: string): string {+ const [r, g, b] = parseHex(background);+ return 0.299 * r + 0.587 * g + 0.114 * b > 150 ? "#111111" : "#FFFFFF";+}++const LIGHT = (() => {+ const l = [-0.45, -0.6, 0.75];+ const m = Math.hypot(l[0], l[1], l[2]);+ return l.map((c) => c / m);+})();+const HALF = (() => {+ const h = [LIGHT[0], LIGHT[1], LIGHT[2] + 1];+ const m = Math.hypot(h[0], h[1], h[2]);+ return h.map((c) => c / m);+})();++const PLACEHOLDER_FONT =+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif";++// Neutral lockup shown when no children are passed.+function PlaceholderLockup({+ mark,+ dot,+ text,+ scale = 1,+}: {+ mark: string;+ dot: string;+ text: string;+ scale?: number;+}) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 * scale }}>+ <div+ style={{+ width: 120 * scale,+ height: 120 * scale,+ borderRadius: 32 * scale,+ backgroundColor: mark,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36 * scale,+ height: 36 * scale,+ borderRadius: "50%",+ backgroundColor: dot,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: PLACEHOLDER_FONT,+ fontSize: 104 * scale,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: text,+ }}+ >+ remocn+ </span>+ </div>+ );+}++export function ClothReveal({+ children,+ clothColor = clothRevealDefaults.clothColor,+ undersideColor = clothRevealDefaults.undersideColor,+ background = clothRevealDefaults.background,+ direction = clothRevealDefaults.direction,+ delay = clothRevealDefaults.delay,+ seed = clothRevealDefaults.seed,+ speed = clothRevealDefaults.speed,+}: ClothRevealProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const uid = `cloth-reveal-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const shadowId = `${uid}-shadow`;+ const softenId = `${uid}-soften`;+ const sim = useMemo(+ () => simulate(width, height, direction, delay, seed),+ [width, height, direction, delay, seed],+ );+ const t = Math.min(FRAMES, Math.max(0, (frame * speed * 30) / fps));+ const f0 = Math.floor(t);+ const f1 = Math.min(FRAMES, f0 + 1);+ const mix = t - f0;+ const A = sim.frames[f0];+ const B = sim.frames[f1];++ // Pinhole camera above the table: higher cloth projects larger.+ const camera = Math.max(width, height) * 1.6;+ const cx = width / 2;+ const cy = height / 2;+ const n = COLS * ROWS;+ const world = new Float64Array(n * 3);+ const screen = new Float64Array(n * 2);+ for (let i = 0; i < n * 3; i++) world[i] = A[i] + (B[i] - A[i]) * mix;+ for (let i = 0; i < n; i++) {+ const z = Math.min(world[i * 3 + 2], camera * 0.8);+ const s = camera / (camera - z);+ screen[i * 2] = cx + (world[i * 3] - cx) * s;+ screen[i * 2 + 1] = cy + (world[i * 3 + 1] - cy) * s;+ }++ const front = parseHex(clothColor);+ const back = parseHex(undersideColor);+ // Per-vertex normals from central differences; each quad averages its four+ // corners, which hides the mesh facets.+ const shades = new Float64Array(n * 3);+ const at = (c: number, r: number, k: number) =>+ world[+ (Math.min(ROWS - 1, Math.max(0, r)) * COLS ++ Math.min(COLS - 1, Math.max(0, c))) *+ 3 ++ k+ ];+ for (let r = 0; r < ROWS; r++) {+ for (let c = 0; c < COLS; c++) {+ const ux = at(c + 1, r, 0) - at(c - 1, r, 0);+ const uy = at(c + 1, r, 1) - at(c - 1, r, 1);+ const uz = at(c + 1, r, 2) - at(c - 1, r, 2);+ const vx = at(c, r + 1, 0) - at(c, r - 1, 0);+ const vy = at(c, r + 1, 1) - at(c, r - 1, 1);+ const vz = at(c, r + 1, 2) - at(c, r - 1, 2);+ let nx = uy * vz - uz * vy;+ let ny = uz * vx - ux * vz;+ let nz = ux * vy - uy * vx;+ const m = Math.hypot(nx, ny, nz) || 1;+ const flip = nz < 0 ? -1 : 1;+ nx = (nx / m) * flip;+ ny = (ny / m) * flip;+ nz = (nz / m) * flip;+ const diffuse = Math.max(+ 0,+ nx * LIGHT[0] + ny * LIGHT[1] + nz * LIGHT[2],+ );+ const spec =+ Math.max(0, nx * HALF[0] + ny * HALF[1] + nz * HALF[2]) ** 36 * 0.28;+ const base = flip < 0 ? back : front;+ const shade = 0.22 + 0.95 * diffuse;+ const i = r * COLS + c;+ for (let k = 0; k < 3; k++) {+ shades[i * 3 + k] = Math.min(255, base[k] * shade + 255 * spec);+ }+ }+ }++ const quads: { d: string; fill: string; z: number; shadow: string | null }[] =+ [];+ const offscreen = (x: number, y: number) =>+ x < -width * 0.1 ||+ x > width * 1.1 ||+ y < -height * 0.1 ||+ y > height * 1.1;++ for (let r = 0; r < ROWS - 1; r++) {+ for (let c = 0; c < COLS - 1; c++) {+ const ids = [+ r * COLS + c,+ r * COLS + c + 1,+ (r + 1) * COLS + c + 1,+ (r + 1) * COLS + c,+ ];+ const pts = ids.map((i) => [screen[i * 2], screen[i * 2 + 1]]);+ if (pts.every(([x, y]) => offscreen(x, y))) {+ const xs = pts.map((p) => p[0]);+ const ys = pts.map((p) => p[1]);+ const spans =+ (Math.min(...xs) < 0 && Math.max(...xs) > width) ||+ (Math.min(...ys) < 0 && Math.max(...ys) > height);+ if (!spans) continue;+ }+ const rgb = [0, 1, 2].map((k) =>+ Math.round(ids.reduce((sum, i) => sum + shades[i * 3 + k], 0) / 4),+ );+ const fill = `rgb(${rgb[0]},${rgb[1]},${rgb[2]})`;+ const P = ids.map((i) => [+ world[i * 3],+ world[i * 3 + 1],+ world[i * 3 + 2],+ ]);+ const z = (P[0][2] + P[1][2] + P[2][2] + P[3][2]) / 4;+ const d = `M${pts.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join("L")}Z`;+ const lift = z - (sim.heights[ids[0]] ?? 0);+ const shadow =+ lift > 4+ ? `M${P.map(([x, y, h]) => `${(x + h * 0.35).toFixed(1)},${(y + h * 0.45).toFixed(1)}`).join("L")}Z`+ : null;+ quads.push({ d, fill, z, shadow });+ }+ }+ quads.sort((a, b) => a.z - b.z);++ return (+ <AbsoluteFill style={{ backgroundColor: background, overflow: "hidden" }}>+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center" }}>+ {children ?? (+ <PlaceholderLockup+ mark={clothColor}+ dot={background}+ text={placeholderText(background)}+ />+ )}+ </AbsoluteFill>+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <defs>+ <filter id={shadowId} x="-20%" y="-20%" width="140%" height="140%">+ <feGaussianBlur stdDeviation={Math.min(width, height) * 0.02} />+ </filter>+ {/* Normalized blur: blurring premultiplied color and then forcing+ alpha to 1 averages only covered pixels, which smooths the facet+ steps without bleeding the background in. The source alpha then+ restores the crisp silhouette. */}+ <filter+ id={softenId}+ filterUnits="userSpaceOnUse"+ x={-width}+ y={-height}+ width={width * 3}+ height={height * 3}+ colorInterpolationFilters="sRGB"+ >+ <feGaussianBlur+ in="SourceGraphic"+ stdDeviation={(width * 1.12) / (COLS - 1) / 2.2}+ result="blur"+ />+ <feColorMatrix+ in="blur"+ type="matrix"+ values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1"+ result="smooth"+ />+ <feGaussianBlur+ in="SourceAlpha"+ stdDeviation={Math.min(width, height) / 600}+ result="edge"+ />+ <feComposite in="smooth" in2="edge" operator="in" />+ </filter>+ </defs>+ <g filter={`url(#${shadowId})`} opacity={0.45}>+ {quads.map((q, i) =>+ q.shadow ? <path key={i} d={q.shadow} fill="#000000" /> : null,+ )}+ </g>+ {/* Aliased quads share edges without hairline seams. */}+ <g filter={`url(#${softenId})`}>+ {quads.map((q, i) => (+ <path key={i} d={q.d} fill={q.fill} shapeRendering="crispEdges" />+ ))}+ </g>+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/comic-panels/config.ts b/registry/remocn/comic-panels/config.tsnew file mode 100644index 00000000..50c8164e--- /dev/null+++ b/registry/remocn/comic-panels/config.ts@@ -0,0 +1,28 @@+import { comicPanelsExampleCode } from "@/components/docs/examples/comic-panels-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const comicPanelsConfig: ComponentConfig = {+ componentName: "ComicPanels",+ importPath: "@/components/remocn/comic-panels",+ controls: {+ word: { type: "text-content", default: "POW", description: "Word" },+ heroScale: {+ type: "number",+ default: 0.62,+ min: 0.3,+ max: 1,+ step: 0.02,+ description: "Hero scale",+ hiddenFromList: false,+ },+ ink: { type: "color", default: "#111111", description: "Ink" },+ paper: { type: "color", default: "#FFFFFF", description: "Paper" },+ accent: { type: "color", default: "#E5322D", description: "Accent" },+ },+ durationInFrames: 66,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#FFFFFF" },+ snippet: comicPanelsExampleCode,+};diff --git a/registry/remocn/comic-panels/index.tsx b/registry/remocn/comic-panels/index.tsxnew file mode 100644index 00000000..1e6a2e41--- /dev/null+++ b/registry/remocn/comic-panels/index.tsx@@ -0,0 +1,344 @@+"use client";++import { type ReactNode, useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type ComicPanelsColors = {+ ink: string;+ paper: string;+ accent: string;+};++export type ComicPanelsProps = {+ /** Hero content, framed in the top panel once the page cracks. Falls back to a placeholder "remocn" lockup. */+ children?: ReactNode;+ /** Optional word in the starburst, e.g. "POW". */+ word?: string;+ colors?: Partial<ComicPanelsColors>;+ /** Ink color. Overrides `colors.ink` when set. */+ ink?: string;+ /** Paper color. Overrides `colors.paper` when set. */+ paper?: string;+ /** Accent color. Overrides `colors.accent` when set. */+ accent?: string;+ /** Scale of `children` inside the top panel. */+ heroScale?: number;+ speed?: number;+};++export const comicPanelsDefaults = {+ colors: {+ ink: "#111111",+ paper: "#FFFFFF",+ accent: "#E5322D",+ } as ComicPanelsColors,+ heroScale: 0.62,+ speed: 1,+};++export const comicPanelsLength = 36;++const FONT =+ "'Arial Black', Impact, Inter, -apple-system, 'Segoe UI', sans-serif";+const SANS =+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif";++// Placeholder hero shown when no children are passed.+function PlaceholderLockup({ ink, accent }: { ink: string; accent: string }) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 }}>+ <div+ style={{+ width: 120,+ height: 120,+ borderRadius: 32,+ backgroundColor: accent,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36,+ height: 36,+ borderRadius: "50%",+ backgroundColor: ink,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: SANS,+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: ink,+ }}+ >+ remocn+ </span>+ </div>+ );+}+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};+const ease = (+ t: number,+ from: number,+ to: number,+ easing: (n: number) => number = Easing.inOut(Easing.cubic),+) => interpolate(t, [from, to], [0, 1], { ...clamp, easing });++type Pt = [number, number];+const poly = (points: Pt[]) => points.map((p) => p.join(",")).join(" ");++function starburst(spikes: number, outer: number, inner: number, seed: string) {+ const points: Pt[] = [];+ for (let i = 0; i < spikes * 2; i++) {+ const a =+ (i / (spikes * 2)) * Math.PI * 2 ++ (random(`${seed}-a-${i}`) - 0.5) * 0.12;+ const r =+ i % 2 === 0+ ? outer * (0.82 + 0.18 * random(`${seed}-r-${i}`))+ : inner * (0.9 + 0.1 * random(`${seed}-r-${i}`));+ points.push([Math.cos(a) * r, Math.sin(a) * r]);+ }+ return poly(points);+}++export function ComicPanels({+ children,+ word,+ colors,+ ink,+ paper,+ accent,+ heroScale = comicPanelsDefaults.heroScale,+ speed = comicPanelsDefaults.speed,+}: ComicPanelsProps) {+ const frame = useCurrentFrame();+ const { width: W, height: H, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const merged = { ...comicPanelsDefaults.colors, ...colors };+ const c: ComicPanelsColors = {+ ink: ink ?? merged.ink,+ paper: paper ?? merged.paper,+ accent: accent ?? merged.accent,+ };+ const t = (frame / fps) * 30 * speed;+ const u = Math.min(W, H) / 720;++ // Page geometry: one slanted horizontal gutter, one slanted vertical one.+ const a0 = 0.6 * H;+ const a1 = 0.5 * H;+ const yA = (x: number) => a0 + ((a1 - a0) * x) / W;+ const b0: Pt = [0.53 * W, yA(0.53 * W)];+ const b1: Pt = [0.46 * W, H];+ const gutter = 16 * u;+ const border = 5 * u;++ const margin = ease(t, 0, 8) * 22 * u;+ const crackA = ease(t, 2, 10, Easing.out(Easing.cubic));+ const crackB = ease(t, 8, 14, Easing.out(Easing.cubic));+ const slide2 = ease(t, 10, 18, Easing.out(Easing.exp));+ const slide3 = ease(t, 13, 21, Easing.out(Easing.exp));+ const burst = ease(t, 23, 34, Easing.in(Easing.cubic));+ const settle = ease(t, 30, 36, Easing.out(Easing.cubic));+ const shaking = t >= 22 && t < 31;+ const step = Math.floor(t / 2);+ const shake = shaking+ ? [+ (random(`comic-sx-${step}`) - 0.5) * 14 * u,+ (random(`comic-sy-${step}`) - 0.5) * 14 * u,+ ]+ : [0, 0];+ const jolt = `translate(${shake[0]} ${shake[1]})`;++ const left: Pt[] = [[0, a0], b0, b1, [0, H]];+ const right: Pt[] = [b0, [W, a1], [W, H], b1];+ const heroFocus: Pt = [W / 2, interpolate(crackA, [0, 1], [H / 2, 0.27 * H])];+ const heroS = interpolate(crackA, [0, 1], [1, heroScale]);++ // Speed lines: wedges from the hero focus, redrawn every 2 frames.+ const wedges = Array.from({ length: 56 }, (_, i) => {+ const a =+ (i / 56) * Math.PI * 2 + (random(`comic-w-${step}-${i}`) - 0.5) * 0.09;+ const spread = 0.008 + 0.014 * random(`comic-ws-${step}-${i}`);+ const r0 = (0.3 + 0.12 * random(`comic-wr-${step}-${i}`)) * W * heroS;+ const r1 = W * 1.2;+ const [fx, fy] = heroFocus;+ const at = (r: number, d: number): Pt => [+ fx + Math.cos(a + d) * r,+ fy + Math.sin(a + d) * r * 0.62,+ ];+ return poly([at(r0, 0), at(r1, -spread), at(r1, spread)]);+ });++ // Halftone: dots swell toward the panel's lower-left corner.+ const pitch = 20 * u;+ const dots: { x: number; y: number; r: number }[] = [];+ for (let y = a1 - pitch; y < H + pitch; y += pitch) {+ for (let x = 0; x < b0[0] + pitch; x += pitch) {+ const ox = (Math.round(y / pitch) % 2) * (pitch / 2);+ const d = Math.hypot(x + ox, H - y) / Math.hypot(b0[0], H - a0);+ const r = pitch * 0.5 * Math.max(0, Math.min(1, 1.15 - d));+ if (r > 0.6 * u) dots.push({ x: x + ox, y, r });+ }+ }++ const c3: Pt = [(b0[0] + W + W + b1[0]) / 4, (b0[1] + a1 + H + H) / 4];+ const outer = 0.4 * (H - a1);+ const pulse = 1 + 0.04 * Math.sin(t * 1.4);+ const center: Pt = [+ interpolate(burst, [0, 1], [c3[0], W / 2]),+ interpolate(burst, [0, 1], [c3[1], H / 2]),+ ];+ const redScale = interpolate(burst, [0, 1], [1, 9]) * pulse;+ const whiteScale =+ interpolate(burst, [0, 1], [1, (0.4 * H) / (outer * 0.62)]) *+ pulse *+ interpolate(settle, [0, 1], [1.08, 1]);+ const spin = interpolate(burst, [0, 1], [0, 14]);+ const burstLayer = (+ <g transform={`translate(${center[0]} ${center[1]}) rotate(${spin})`}>+ <polygon+ transform={`scale(${redScale})`}+ points={starburst(16, outer, outer * 0.68, "comic-red")}+ fill={c.accent}+ stroke={c.ink}+ strokeWidth={(border * 0.8) / redScale}+ strokeLinejoin="round"+ />+ <polygon+ transform={`scale(${whiteScale})`}+ points={starburst(13, outer * 0.62, outer * 0.42, "comic-white")}+ fill={c.paper}+ stroke={c.ink}+ strokeWidth={(border * 0.8) / whiteScale}+ strokeLinejoin="round"+ />+ {word ? (+ <g+ transform={`scale(${whiteScale}) rotate(-8)`}+ textAnchor="middle"+ dominantBaseline="central"+ fontFamily={FONT}+ fontWeight={900}+ fontSize={outer * 0.4}+ >+ <text x={outer * 0.03} y={outer * 0.03} fill={c.accent}>+ {word}+ </text>+ <text fill={c.ink}>{word}</text>+ </g>+ ) : null}+ </g>+ );++ return (+ <AbsoluteFill style={{ backgroundColor: c.paper, overflow: "hidden" }}>+ <AbsoluteFill>+ <svg width={W} height={H} style={{ position: "absolute" }} aria-hidden>+ <defs>+ <clipPath id={`${id}-left`}>+ <polygon points={poly(left)} />+ </clipPath>+ <clipPath id={`${id}-right`}>+ <polygon points={poly(right)} />+ </clipPath>+ </defs>+ <g fill={c.ink} transform={jolt}>+ {wedges.map((points, i) => (+ <polygon key={i} points={points} />+ ))}+ </g>+ </svg>+ <AbsoluteFill+ style={{+ alignItems: "center",+ justifyContent: "center",+ transform: `translate(${heroFocus[0] - W / 2 + shake[0]}px, ${heroFocus[1] - H / 2 + shake[1]}px) scale(${heroS})`,+ }}+ >+ {children ?? <PlaceholderLockup ink={c.ink} accent={c.accent} />}+ </AbsoluteFill>+ <svg width={W} height={H} style={{ position: "absolute" }} aria-hidden>+ <g+ clipPath={`url(#${id}-left)`}+ transform={`translate(${(slide2 - 1) * b0[0]} 0)`}+ opacity={slide2 > 0 ? 1 : 0}+ >+ <polygon points={poly(left)} fill={c.paper} />+ <g fill={c.accent} transform={jolt}>+ {dots.map((d) => (+ <circle key={`${d.x}-${d.y}`} cx={d.x} cy={d.y} r={d.r} />+ ))}+ </g>+ </g>+ <g clipPath={`url(#${id}-right)`}>+ <g+ transform={`translate(${(1 - slide3) * (W - b1[0])} 0)`}+ opacity={slide3 > 0 ? 1 : 0}+ >+ <polygon points={poly(right)} fill={c.ink} />+ <g transform={jolt}>{burst === 0 ? burstLayer : null}</g>+ </g>+ </g>+ {/* Gutters: ink edges first, then the white channel on top. */}+ {[c.ink, c.paper].map((stroke, pass) => (+ <g+ key={stroke + pass}+ stroke={stroke}+ strokeWidth={pass === 0 ? gutter + border * 2 : gutter}+ strokeLinecap="butt"+ >+ <line+ x1={-gutter}+ y1={yA(-gutter)}+ x2={-gutter + (W + 2 * gutter) * crackA}+ y2={yA(-gutter + (W + 2 * gutter) * crackA)}+ />+ <line+ x1={b0[0]}+ y1={b0[1]}+ x2={b0[0] + (b1[0] + (b1[0] - b0[0]) * 0.05 - b0[0]) * crackB}+ y2={b0[1] + (H * 1.05 - b0[1]) * crackB}+ />+ </g>+ ))}+ <path+ d={`M ${-W} ${-H} H ${2 * W} V ${2 * H} H ${-W} Z M ${margin} ${margin} V ${H - margin} H ${W - margin} V ${margin} Z`}+ fill={c.paper}+ />+ {margin > 0 ? (+ <rect+ x={margin}+ y={margin}+ width={W - margin * 2}+ height={H - margin * 2}+ fill="none"+ stroke={c.ink}+ strokeWidth={border}+ />+ ) : null}+ </svg>+ </AbsoluteFill>+ {burst > 0 ? (+ <svg width={W} height={H} style={{ position: "absolute" }} aria-hidden>+ <g transform={jolt}>{burstLayer}</g>+ </svg>+ ) : null}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/dolly-zoom/config.ts b/registry/remocn/dolly-zoom/config.tsnew file mode 100644index 00000000..00dfd983--- /dev/null+++ b/registry/remocn/dolly-zoom/config.ts@@ -0,0 +1,28 @@+import { dollyZoomExampleCode } from "@/components/docs/examples/dolly-zoom-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const dollyZoomConfig: ComponentConfig = {+ componentName: "DollyZoom",+ importPath: "@/components/remocn/dolly-zoom",+ controls: {+ intensity: {+ type: "number",+ default: 1,+ min: 0,+ max: 2,+ step: 0.1,+ description: "Intensity",+ hiddenFromList: false,+ },+ reverse: { type: "boolean", default: false, description: "Reverse" },+ doorColor: { type: "color", default: "#E5322D", description: "Door" },+ figureColor: { type: "color", default: "#FFFFFF", description: "Figure" },+ lineColor: { type: "color", default: "#FFFFFF", description: "Lines" },+ },+ durationInFrames: 66,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#0B0B0B" },+ snippet: dollyZoomExampleCode,+};diff --git a/registry/remocn/dolly-zoom/index.tsx b/registry/remocn/dolly-zoom/index.tsxnew file mode 100644index 00000000..e1c069cd--- /dev/null+++ b/registry/remocn/dolly-zoom/index.tsx@@ -0,0 +1,302 @@+"use client";++import type React from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type DollyZoomColors = {+ background: string;+ wall: string;+ wallAlt: string;+ floor: string;+ floorAlt: string;+ line: string;+ light: string;+ door: string;+ figure: string;+};++export type DollyZoomProps = {+ /** Subject held at a constant size. Defaults to a standing figure. */+ children?: React.ReactNode;+ /** How far the camera dollies in while zooming out, 0 to 2. */+ intensity?: number;+ /** Play the move in reverse: background compresses toward the subject. */+ reverse?: boolean;+ colors?: Partial<DollyZoomColors>;+ /** Door color at the end of the corridor. Overrides `colors.door`. */+ doorColor?: string;+ /** Default figure color. Overrides `colors.figure`. */+ figureColor?: string;+ /** Corridor edge line color. Overrides `colors.line`. */+ lineColor?: string;+ speed?: number;+};++export const dollyZoomDefaults = {+ intensity: 1,+ reverse: false,+ colors: {+ background: "#0B0B0B",+ wall: "#1B1B1B",+ wallAlt: "#151515",+ floor: "#262626",+ floorAlt: "#1D1D1D",+ line: "#FFFFFF",+ light: "#FFFFFF",+ door: "#E5322D",+ figure: "#FFFFFF",+ } satisfies DollyZoomColors,+ speed: 1,+};++const START = 4;+const END = 36;+// Corridor in world units. Screen y points down, so the floor is positive.+const HALF_W = 2;+const CEIL = -1.3;+const FLOOR = 1.7;+const SUBJECT_Z = 6;+const DOOR_Z = 14;+const NEAR = 0.25;++type Vec = [number, number, number];++export function DollyZoom({+ children,+ intensity = dollyZoomDefaults.intensity,+ reverse = dollyZoomDefaults.reverse,+ colors: colorOverrides,+ doorColor,+ figureColor,+ lineColor,+ speed = dollyZoomDefaults.speed,+}: DollyZoomProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const baseColors = { ...dollyZoomDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ door: doorColor ?? baseColors.door,+ figure: figureColor ?? baseColors.figure,+ line: lineColor ?? baseColors.line,+ };+ const t = (frame * speed * 30) / fps;+ const move = interpolate(t, [START, END], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.bezier(0.45, 0, 0.3, 1),+ });+ const amount = reverse ? 1 - move : move;++ // Focal length tracks the subject distance so the subject never changes size.+ const k = height * 0.19;+ const d0 = SUBJECT_Z;+ const d1 = d0 / (1 + 1.7 * Math.max(0, intensity));+ const dist = d0 + (d1 - d0) * amount;+ const cam = SUBJECT_Z - dist;+ const f = k * dist;+ const cx = width / 2;+ const cy = height / 2;++ const project = ([x, y, z]: Vec) => {+ const depth = Math.max(NEAR, z - cam);+ return [cx + (f * x) / depth, cy + (f * y) / depth] as const;+ };+ const poly = (pts: Vec[]) =>+ pts+ .map(project)+ .map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`)+ .join(" ");++ const fog = (z: number) =>+ interpolate(z - cam, [1, DOOR_Z - cam], [1, 0.25], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ });++ const segments: React.ReactNode[] = [];+ // The corridor runs on behind the camera so its mouth never shows.+ const firstZ = Math.floor(cam);+ for (let z = DOOR_Z - 1; z >= firstZ; z--) {+ const z0 = Math.max(z, cam + NEAR);+ const z1 = z + 1;+ if (z1 <= z0) continue;+ const alt = z % 2 === 0;+ const L = -HALF_W;+ const R = HALF_W;+ segments.push(+ <g key={z}>+ <polygon+ points={poly([+ [L, FLOOR, z0],+ [R, FLOOR, z0],+ [R, FLOOR, z1],+ [L, FLOOR, z1],+ ])}+ fill={alt ? colors.floor : colors.floorAlt}+ />+ <polygon+ points={poly([+ [L, CEIL, z0],+ [R, CEIL, z0],+ [R, CEIL, z1],+ [L, CEIL, z1],+ ])}+ fill={colors.wallAlt}+ />+ <polygon+ points={poly([+ [L, CEIL, z0],+ [L, FLOOR, z0],+ [L, FLOOR, z1],+ [L, CEIL, z1],+ ])}+ fill={alt ? colors.wall : colors.wallAlt}+ />+ <polygon+ points={poly([+ [R, CEIL, z0],+ [R, FLOOR, z0],+ [R, FLOOR, z1],+ [R, CEIL, z1],+ ])}+ fill={alt ? colors.wall : colors.wallAlt}+ />+ <polygon+ points={poly([+ [-0.35, CEIL, z + 0.3],+ [0.35, CEIL, z + 0.3],+ [0.35, CEIL, z + 0.7],+ [-0.35, CEIL, z + 0.7],+ ])}+ fill={colors.light}+ opacity={0.75 * fog(z)}+ />+ {z >= cam + NEAR ? (+ <polygon+ points={poly([+ [L, CEIL, z],+ [R, CEIL, z],+ [R, FLOOR, z],+ [L, FLOOR, z],+ ])}+ fill="none"+ stroke={colors.line}+ strokeOpacity={0.32 * fog(z)}+ strokeWidth={Math.max(1, (f / (z - cam)) * 0.012)}+ />+ ) : null}+ </g>,+ );+ }++ const edges: Vec[][] = [+ [+ [-HALF_W, CEIL, -4],+ [-HALF_W, CEIL, DOOR_Z],+ ],+ [+ [HALF_W, CEIL, -4],+ [HALF_W, CEIL, DOOR_Z],+ ],+ [+ [-HALF_W, FLOOR, -4],+ [-HALF_W, FLOOR, DOOR_Z],+ ],+ [+ [HALF_W, FLOOR, -4],+ [HALF_W, FLOOR, DOOR_Z],+ ],+ ];++ const doorW = 0.85;+ const doorTop = FLOOR - 2.3;+ const [, floorY] = project([0, FLOOR, SUBJECT_Z]);+ const figureH = k * 1.75;++ return (+ <AbsoluteFill+ style={{ backgroundColor: colors.background, overflow: "hidden" }}+ >+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <polygon+ points={poly([+ [-HALF_W, CEIL, DOOR_Z],+ [HALF_W, CEIL, DOOR_Z],+ [HALF_W, FLOOR, DOOR_Z],+ [-HALF_W, FLOOR, DOOR_Z],+ ])}+ fill={colors.wallAlt}+ />+ <polygon+ points={poly([+ [-doorW, doorTop, DOOR_Z],+ [doorW, doorTop, DOOR_Z],+ [doorW, FLOOR, DOOR_Z],+ [-doorW, FLOOR, DOOR_Z],+ ])}+ fill={colors.door}+ />+ {segments}+ {edges.map((edge, i) => {+ const [a, b] = edge.map((p) =>+ project([p[0], p[1], Math.max(p[2], cam + NEAR)]),+ );+ return (+ <line+ key={i}+ x1={a[0]}+ y1={a[1]}+ x2={b[0]}+ y2={b[1]}+ stroke={colors.line}+ strokeOpacity={0.45}+ strokeWidth={1.5}+ />+ );+ })}+ </svg>+ <AbsoluteFill+ style={{+ background:+ "radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,0.55) 100%)",+ }}+ />+ {children ? (+ <AbsoluteFill+ style={{ alignItems: "center", justifyContent: "center" }}+ >+ {children}+ </AbsoluteFill>+ ) : (+ <svg+ viewBox="0 0 60 175"+ height={figureH}+ style={{+ position: "absolute",+ left: cx - (figureH * 60) / 175 / 2,+ top: floorY - figureH,+ }}+ aria-hidden+ >+ <g fill={colors.figure}>+ <circle cx={30} cy={14} r={12} />+ <path d="M12 34 Q30 26 48 34 L54 96 Q54 102 48 102 L44 102 L42 172 L33 172 L30 108 L27 172 L18 172 L16 102 L12 102 Q6 102 6 96 Z" />+ </g>+ </svg>+ )}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/duotone-beat/config.ts b/registry/remocn/duotone-beat/config.tsnew file mode 100644index 00000000..4d419e8a--- /dev/null+++ b/registry/remocn/duotone-beat/config.ts@@ -0,0 +1,54 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const duotoneBeatConfig: ComponentConfig = {+ componentName: "DuotoneBeat",+ importPath: "@/components/remocn/duotone-beat",+ controls: {+ beatFrames: {+ type: "number",+ default: 15,+ min: 4,+ max: 30,+ step: 1,+ description: "Frames per beat",+ hiddenFromList: false,+ },+ beatsPerBar: {+ type: "number",+ default: 4,+ min: 1,+ max: 8,+ step: 1,+ description: "Beats per bar",+ hiddenFromList: false,+ },+ punch: {+ type: "number",+ default: 0.07,+ min: 0,+ max: 0.2,+ step: 0.01,+ description: "Punch",+ hiddenFromList: false,+ },+ halftone: {+ type: "number",+ default: 8,+ min: 0,+ max: 20,+ step: 1,+ description: "Halftone pitch",+ hiddenFromList: false,+ },+ showIndicator: {+ type: "boolean",+ default: true,+ description: "Bar indicator",+ },+ },+ durationInFrames: 120,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#FFFFFF" },+};diff --git a/registry/remocn/duotone-beat/index.tsx b/registry/remocn/duotone-beat/index.tsxnew file mode 100644index 00000000..daceb7cc--- /dev/null+++ b/registry/remocn/duotone-beat/index.tsx@@ -0,0 +1,342 @@+"use client";++import { useId } from "react";+import {+ AbsoluteFill,+ Easing,+ Img,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++/** [shadow ink, highlight ink], hex colors. */+export type DuotonePalette = [string, string];++export type DuotoneBeatProps = {+ /** Portrait image. Without it a head-and-shoulders silhouette is drawn. */+ src?: string;+ /** Ink pairs, one per beat, cycled. Hex colors only (they feed an SVG LUT). */+ palettes?: DuotonePalette[];+ /** Frames per beat at 30fps. Ignored when `bpm` is set. */+ beatFrames?: number;+ bpm?: number;+ /** Beats per bar; the first beat of each bar gets the bigger punch-in. */+ beatsPerBar?: number;+ /** Scale added on the downbeat. Off-beats get a third of it. */+ punch?: number;+ showIndicator?: boolean;+ /** Halftone dot pitch in px at 720p for a printed look. 0 keeps smooth tones. */+ halftone?: number;+ speed?: number;+};++export const duotoneBeatDefaults = {+ palettes: [+ ["#111111", "#FFFFFF"],+ ["#111111", "#E5322D"],+ ["#E5322D", "#FFFFFF"],+ ["#E5322D", "#111111"],+ ] as DuotonePalette[],+ beatFrames: 15,+ beatsPerBar: 4,+ punch: 0.07,+ showIndicator: true,+ halftone: 8,+ speed: 1,+};++const MONO = "ui-monospace, 'SF Mono', Menlo, Consolas, monospace";++function hexToRgb(hex: string): [number, number, number] {+ const h = hex.replace("#", "").trim();+ const full =+ h.length === 3+ ? h+ .split("")+ .map((c) => c + c)+ .join("")+ : h.slice(0, 6);+ const n = Number.parseInt(full, 16);+ if (Number.isNaN(n)) return [0, 0, 0];+ return [((n >> 16) & 255) / 255, ((n >> 8) & 255) / 255, (n & 255) / 255];+}++function Ground({+ id,+ width,+ height,+}: {+ id: string;+ width: number;+ height: number;+}) {+ return (+ <svg width={width} height={height} aria-hidden>+ <defs>+ <radialGradient id={`${id}-ground`} cx="0.5" cy="0.4" r="0.8">+ <stop offset="0" stopColor="#FFFFFF" />+ <stop offset="0.5" stopColor="#F2F2F2" />+ <stop offset="1" stopColor="#C4C4C4" />+ </radialGradient>+ </defs>+ <rect width={width} height={height} fill={`url(#${id}-ground)`} />+ </svg>+ );+}++function Portrait({+ id,+ width,+ height,+}: {+ id: string;+ width: number;+ height: number;+}) {+ const h = height;+ const cx = width / 2;+ const P = (x: number, y: number) => `${cx + x * h} ${y * h}`;+ const head = [+ `M ${P(0, 0.17)}`,+ `C ${P(0.075, 0.17)} ${P(0.118, 0.23)} ${P(0.118, 0.32)}`,+ `C ${P(0.118, 0.4)} ${P(0.095, 0.46)} ${P(0.06, 0.49)}`,+ `C ${P(0.035, 0.51)} ${P(-0.035, 0.51)} ${P(-0.06, 0.49)}`,+ `C ${P(-0.095, 0.46)} ${P(-0.118, 0.4)} ${P(-0.118, 0.32)}`,+ `C ${P(-0.118, 0.23)} ${P(-0.075, 0.17)} ${P(0, 0.17)} Z`,+ ].join(" ");+ const hair = [+ `M ${P(-0.126, 0.34)}`,+ `C ${P(-0.14, 0.17)} ${P(-0.05, 0.125)} ${P(0.02, 0.135)}`,+ `C ${P(0.11, 0.14)} ${P(0.145, 0.21)} ${P(0.126, 0.32)}`,+ `C ${P(0.11, 0.245)} ${P(0.06, 0.215)} ${P(-0.01, 0.222)}`,+ `C ${P(-0.07, 0.228)} ${P(-0.105, 0.26)} ${P(-0.126, 0.34)} Z`,+ ].join(" ");+ const torso = [+ `M ${P(-0.07, 0.585)}`,+ `C ${P(-0.13, 0.62)} ${P(-0.3, 0.63)} ${P(-0.36, 0.7)}`,+ `C ${P(-0.41, 0.76)} ${P(-0.43, 0.88)} ${P(-0.44, 1.01)}`,+ `L ${P(0.44, 1.01)}`,+ `C ${P(0.43, 0.88)} ${P(0.41, 0.76)} ${P(0.36, 0.7)}`,+ `C ${P(0.3, 0.63)} ${P(0.13, 0.62)} ${P(0.07, 0.585)} Z`,+ ].join(" ");+ return (+ <svg width={width} height={height} aria-hidden>+ <defs>+ <linearGradient id={`${id}-skin`} x1="0" y1="0" x2="1" y2="0.2">+ <stop offset="0" stopColor="#121212" />+ <stop offset="0.55" stopColor="#3A3A3A" />+ <stop offset="1" stopColor="#9C9C9C" />+ </linearGradient>+ <linearGradient id={`${id}-shirt`} x1="0" y1="0" x2="1" y2="0">+ <stop offset="0" stopColor="#141414" />+ <stop offset="0.6" stopColor="#262626" />+ <stop offset="1" stopColor="#6A6A6A" />+ </linearGradient>+ </defs>+ <path+ d={`M ${P(-0.055, 0.45)} L ${P(-0.065, 0.61)} L ${P(0.065, 0.61)} L ${P(0.055, 0.45)} Z`}+ fill="#0C0C0C"+ />+ <path d={torso} fill={`url(#${id}-shirt)`} />+ <path+ d={`M ${P(-0.075, 0.59)} Q ${P(0, 0.67)} ${P(0.075, 0.59)}`}+ fill="none"+ stroke="#7A7A7A"+ strokeWidth={0.012 * h}+ />+ <ellipse+ cx={cx - 0.12 * h}+ cy={0.34 * h}+ rx={0.018 * h}+ ry={0.04 * h}+ fill="#161616"+ />+ <ellipse+ cx={cx + 0.12 * h}+ cy={0.34 * h}+ rx={0.018 * h}+ ry={0.04 * h}+ fill="#8A8A8A"+ />+ <path d={head} fill={`url(#${id}-skin)`} />+ <path d={hair} fill="#060606" />+ {/* Rim light on the key side. */}+ <g+ fill="none"+ stroke="#D6D6D6"+ strokeWidth={0.007 * h}+ strokeLinecap="round"+ style={{ filter: `blur(${0.003 * h}px)` }}+ >+ <path+ d={`M ${P(0.112, 0.27)} C ${P(0.118, 0.36)} ${P(0.105, 0.43)} ${P(0.07, 0.475)}`}+ />+ <path+ d={`M ${P(0.14, 0.625)} C ${P(0.3, 0.64)} ${P(0.39, 0.72)} ${P(0.42, 0.88)}`}+ />+ </g>+ </svg>+ );+}++export function DuotoneBeat({+ src,+ palettes = duotoneBeatDefaults.palettes,+ beatFrames = duotoneBeatDefaults.beatFrames,+ bpm,+ beatsPerBar = duotoneBeatDefaults.beatsPerBar,+ punch = duotoneBeatDefaults.punch,+ showIndicator = duotoneBeatDefaults.showIndicator,+ halftone = duotoneBeatDefaults.halftone,+ speed = duotoneBeatDefaults.speed,+}: DuotoneBeatProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const u = Math.min(width, height) / 720;+ const t = (frame / fps) * 30 * speed;+ const period = Math.max(1, bpm ? (30 * 60) / bpm : beatFrames);+ const beat = Math.floor(t / period);+ const local = t - beat * period;+ const bar = Math.max(1, Math.round(beatsPerBar));+ const inBar = beat % bar;+ const list = palettes.length > 0 ? palettes : duotoneBeatDefaults.palettes;+ const [dark, light] = list[beat % list.length].map(hexToRgb);++ const strength = inBar === 0 ? punch : punch / 3;+ const scale = 1 + strength * Math.exp(-local / 3.2);+ const rise = interpolate(t, [0, 12], [0.22, 0], {+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.cubic),+ });+ const intro = interpolate(t, [0, 12], [0, 1], {+ extrapolateRight: "clamp",+ easing: Easing.out(Easing.cubic),+ });+ const table = (i: number) => `${dark[i]} ${light[i]}`;+ // Halftone screen: a radial distance tile, thresholded against the gray.+ const pitch = halftone * u;+ const tile =+ pitch > 0+ ? `data:image/svg+xml;utf8,${encodeURIComponent(+ `<svg xmlns="http://www.w3.org/2000/svg" width="${pitch}" height="${pitch}"><defs><radialGradient id="g" r="0.71"><stop offset="0" stop-color="#000"/><stop offset="1" stop-color="#fff"/></radialGradient></defs><rect width="${pitch}" height="${pitch}" fill="url(#g)"/></svg>`,+ )}`+ : null;+ const lightHex = list[beat % list.length][1];+ const darkHex = list[beat % list.length][0];++ return (+ <AbsoluteFill style={{ overflow: "hidden" }}>+ <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>+ <filter+ id={`${id}-duotone`}+ x="0"+ y="0"+ width="1"+ height="1"+ colorInterpolationFilters="sRGB"+ >+ <feColorMatrix type="saturate" values="0" result="gray" />+ {tile ? (+ <>+ <feImage+ href={tile}+ x={0}+ y={0}+ width={pitch}+ height={pitch}+ result="dot"+ />+ <feTile in="dot" result="screen" />+ {/* alpha: 8 - 8 + 1 = 1, color: 8 * (gray - screen) + 1 */}+ <feComposite+ in="gray"+ in2="screen"+ operator="arithmetic"+ k1={0}+ k2={8}+ k3={-8}+ k4={1}+ />+ </>+ ) : null}+ <feComponentTransfer>+ <feFuncR type="table" tableValues={table(0)} />+ <feFuncG type="table" tableValues={table(1)} />+ <feFuncB type="table" tableValues={table(2)} />+ </feComponentTransfer>+ </filter>+ </svg>+ <AbsoluteFill style={{ filter: `url(#${id}-duotone)` }}>+ <AbsoluteFill+ style={{+ backgroundColor: "#FFFFFF",+ transform: `scale(${scale})`,+ transformOrigin: "50% 40%",+ }}+ >+ {src ? (+ <Img+ src={src}+ style={{+ width: "100%",+ height: "100%",+ objectFit: "cover",+ transform: `scale(${1.12 - 0.12 * intro})`,+ }}+ />+ ) : (+ <>+ <Ground id={id} width={width} height={height} />+ <AbsoluteFill+ style={{ transform: `translateY(${rise * height}px)` }}+ >+ <Portrait id={id} width={width} height={height} />+ </AbsoluteFill>+ </>+ )}+ </AbsoluteFill>+ </AbsoluteFill>+ {showIndicator ? (+ <div+ style={{+ position: "absolute",+ left: 48 * u,+ bottom: 44 * u,+ display: "flex",+ alignItems: "center",+ gap: 10 * u,+ }}+ >+ {Array.from({ length: bar }, (_, i) => (+ <div+ key={i}+ style={{+ width: 26 * u,+ height: 26 * u,+ boxSizing: "border-box",+ border: `${2.5 * u}px solid ${darkHex}`,+ backgroundColor: i === inBar ? darkHex : "transparent",+ transform: `scale(${i === inBar ? 1 + 0.25 * Math.exp(-local / 3) : 1})`,+ }}+ />+ ))}+ <span+ style={{+ marginLeft: 10 * u,+ fontFamily: MONO,+ fontSize: 20 * u,+ fontWeight: 700,+ letterSpacing: 2 * u,+ color: darkHex,+ backgroundColor: lightHex,+ }}+ >+ {String(Math.round((30 * 60) / period))} BPM+ </span>+ </div>+ ) : null}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/exploded-view/config.ts b/registry/remocn/exploded-view/config.tsnew file mode 100644index 00000000..38991e9b--- /dev/null+++ b/registry/remocn/exploded-view/config.ts@@ -0,0 +1,44 @@+import { explodedViewExampleCode } from "@/components/docs/examples/exploded-view-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const explodedViewConfig: ComponentConfig = {+ componentName: "ExplodedView",+ importPath: "@/components/remocn/exploded-view",+ controls: {+ labels: {+ type: "text-content",+ default: "Interface, Engine, Storage, Hardware",+ description: "Labels (comma-separated)",+ },+ layers: {+ type: "number",+ default: 4,+ min: 2,+ max: 6,+ step: 1,+ description: "Slabs",+ hiddenFromList: false,+ },+ highlight: {+ type: "number",+ default: 1,+ min: 0,+ max: 5,+ step: 1,+ description: "Highlighted slab",+ hiddenFromList: false,+ },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ labelColor: { type: "color", default: "#FFFFFF", description: "Labels" },+ },+ durationInFrames: 70,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: explodedViewExampleCode,+};diff --git a/registry/remocn/exploded-view/index.tsx b/registry/remocn/exploded-view/index.tsxnew file mode 100644index 00000000..a586e865--- /dev/null+++ b/registry/remocn/exploded-view/index.tsx@@ -0,0 +1,295 @@+"use client";++import type React from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type ExplodedViewColors = {+ background: string;+ top: string;+ left: string;+ right: string;+ highlightTop: string;+ highlightLeft: string;+ highlightRight: string;+ line: string;+ label: string;+};++export type ExplodedViewProps = {+ /** Number of slabs, 2 to 6. */+ layers?: number;+ /** One label per slab, top slab first. */+ labels?: string[];+ /** Index of the red slab, counted from the top. */+ highlight?: number;+ colors?: Partial<ExplodedViewColors>;+ /** Background color. Overrides `colors.background`. */+ backgroundColor?: string;+ /** Label text color. Overrides `colors.label`. */+ labelColor?: string;+ speed?: number;+};++export const explodedViewDefaults = {+ layers: 4,+ labels: ["Interface", "Engine", "Storage", "Hardware"],+ highlight: 1,+ colors: {+ background: "#111111",+ top: "#F4F4F4",+ left: "#A6A6A6",+ right: "#747474",+ highlightTop: "#E5322D",+ highlightLeft: "#B5231F",+ highlightRight: "#8A1A17",+ line: "#FFFFFF",+ label: "#FFFFFF",+ } satisfies ExplodedViewColors,+ speed: 1,+};++const FONT = "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";+const OPEN = 3;+const CLOSE = 38;+const COS30 = Math.cos(Math.PI / 6);+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++export function ExplodedView({+ layers = explodedViewDefaults.layers,+ labels = explodedViewDefaults.labels,+ highlight = explodedViewDefaults.highlight,+ colors: colorOverrides,+ backgroundColor,+ labelColor,+ speed = explodedViewDefaults.speed,+}: ExplodedViewProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const baseColors = { ...explodedViewDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ background: backgroundColor ?? baseColors.background,+ label: labelColor ?? baseColors.label,+ };+ const n = Math.round(Math.min(6, Math.max(2, layers)));+ const t = (frame * speed * 30) / fps;++ const side = height * 0.36;+ const thick = height * 0.036;+ const gap = (height * 0.27) / (n - 1);+ const cx = width * 0.4;+ const cy = height * 0.5;++ const iso = (X: number, Y: number, Z: number) =>+ [(X - Y) * COS30, (X + Y) * 0.5 - Z] as const;+ const pts = (list: (readonly [number, number])[]) =>+ list.map(([x, y]) => `${x.toFixed(1)},${y.toFixed(1)}`).join(" ");++ const close = spring({+ frame: t - CLOSE,+ fps: 30,+ config: { damping: 26, stiffness: 320, mass: 0.8 },+ });+ // Top slab leaves first; bottom one barely waits.+ const spread = Array.from({ length: n }, (_, i) => {+ const fromTop = n - 1 - i;+ const open = spring({+ frame: t - OPEN - fromTop * 1.5,+ fps: 30,+ config: { damping: 12, stiffness: 110 },+ });+ return Math.max(0, open * (1 - close));+ });+ const offsets: number[] = [];+ let z = 0;+ for (let i = 0; i < n; i++) {+ offsets.push(z);+ z += thick + (i < n - 1 ? gap * Math.max(spread[i + 1], 0) : 0);+ }+ const total = z;+ // The click: a short downward knock once the slabs meet again.+ const knock =+ interpolate(t, [CLOSE + 5, CLOSE + 7, CLOSE + 12], [0, 1, 0], {+ ...clamp,+ easing: Easing.out(Easing.quad),+ }) *+ height *+ 0.008;+ const baseY = cy + side * 0.02 + total / 2 + knock;+ const labelOut = interpolate(t, [CLOSE - 5, CLOSE], [1, 0], clamp);+ const labelX = width * 0.66;+ const fontSize = height * 0.042;++ const slabs: React.ReactNode[] = [];+ const leaders: React.ReactNode[] = [];+ for (let i = 0; i < n; i++) {+ const fromTop = n - 1 - i;+ const hot = fromTop === highlight;+ const z0 = offsets[i];+ const z1 = z0 + thick;+ const h = side / 2;+ const top = [+ iso(-h, -h, z1),+ iso(h, -h, z1),+ iso(h, h, z1),+ iso(-h, h, z1),+ ];+ const left = [iso(-h, h, z1), iso(h, h, z1), iso(h, h, z0), iso(-h, h, z0)];+ const right = [+ iso(h, -h, z1),+ iso(h, h, z1),+ iso(h, h, z0),+ iso(h, -h, z0),+ ];+ const inset = h * 0.78;+ const inner = [+ iso(-inset, -inset, z1),+ iso(inset, -inset, z1),+ iso(inset, inset, z1),+ iso(-inset, inset, z1),+ ];+ const ink = hot ? "#FFFFFF" : "#111111";+ slabs.push(+ <g key={i}>+ <polygon+ points={pts(left)}+ fill={hot ? colors.highlightLeft : colors.left}+ />+ <polygon+ points={pts(right)}+ fill={hot ? colors.highlightRight : colors.right}+ />+ <polygon+ points={pts(top)}+ fill={hot ? colors.highlightTop : colors.top}+ />+ <polygon+ points={pts(inner)}+ fill="none"+ stroke={ink}+ strokeOpacity={0.18}+ strokeWidth={height * 0.002}+ />+ {[-0.4, 0, 0.4].map((k) => {+ const a = iso(-inset * 0.7, k * inset, z1);+ const b = iso(inset * (fromTop % 2 ? 0.2 : 0.7), k * inset, z1);+ return (+ <line+ key={k}+ x1={a[0]}+ y1={a[1]}+ x2={b[0]}+ y2={b[1]}+ stroke={ink}+ strokeOpacity={0.22}+ strokeWidth={height * 0.006}+ strokeLinecap="round"+ />+ );+ })}+ </g>,+ );++ const label = labels[fromTop];+ if (!label) continue;+ const anchor = iso(h, -h, (z0 + z1) / 2);+ const draw = interpolate(+ t,+ [14 + fromTop * 2.5, 24 + fromTop * 2.5],+ [0, 1],+ {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ },+ );+ const show =+ interpolate(t, [19 + fromTop * 2.5, 27 + fromTop * 2.5], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ }) * labelOut;+ const ax = cx + anchor[0] + height * 0.012;+ const ay = baseY + anchor[1];+ const length = (labelX - ax) * draw * labelOut;+ leaders.push(+ <g key={`l${i}`}>+ <circle+ cx={ax}+ cy={ay}+ r={height * 0.006}+ fill={colors.line}+ opacity={Math.min(1, draw * 3) * labelOut}+ />+ <line+ x1={ax}+ y1={ay}+ x2={ax + length}+ y2={ay}+ stroke={colors.line}+ strokeOpacity={0.6}+ strokeWidth={Math.max(1, height * 0.0022)}+ />+ <g+ opacity={show}+ transform={`translate(${labelX + height * 0.02 + (1 - show) * height * 0.03} ${ay})`}+ >+ <text+ y={-fontSize * 0.62}+ fill={hot ? colors.highlightTop : colors.label}+ fillOpacity={hot ? 1 : 0.5}+ fontFamily={FONT}+ fontSize={fontSize * 0.5}+ fontWeight={600}+ letterSpacing="0.12em"+ >+ {`0${fromTop + 1}`}+ </text>+ <text+ y={fontSize * 0.42}+ fill={colors.label}+ fontFamily={FONT}+ fontSize={fontSize}+ fontWeight={700}+ letterSpacing="-0.02em"+ >+ {label}+ </text>+ </g>+ </g>,+ );+ }++ return (+ <AbsoluteFill+ style={{ backgroundColor: colors.background, overflow: "hidden" }}+ >+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <ellipse+ cx={cx}+ cy={baseY + side * 0.5 + height * 0.035}+ rx={side * COS30 * 1.05}+ ry={side * 0.16}+ fill="#000000"+ opacity={0.5}+ />+ <g transform={`translate(${cx} ${baseY})`}>{slabs}</g>+ {leaders}+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/flow-field/config.ts b/registry/remocn/flow-field/config.tsnew file mode 100644index 00000000..ca981891--- /dev/null+++ b/registry/remocn/flow-field/config.ts@@ -0,0 +1,85 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" ? value : fallback;++// One full loop, so the preview wraps without a seam.+function durationOf(values: Record<string, unknown>) {+ const speed = numberOr(values.speed, 1);+ const loopFrames = numberOr(values.loopFrames, 300);+ return speed > 0 ? Math.max(1, Math.round(loopFrames / speed)) : 300;+}++export const flowFieldConfig: ComponentConfig = {+ componentName: "FlowField",+ importPath: "@/components/remocn/flow-field",+ controls: {+ particles: {+ type: "number",+ default: 300,+ min: 50,+ max: 800,+ step: 10,+ description: "Particles",+ hiddenFromList: false,+ },+ trailLength: {+ type: "number",+ default: 72,+ min: 8,+ max: 120,+ step: 1,+ description: "Trail length",+ hiddenFromList: false,+ },+ strokeWidth: {+ type: "number",+ default: 1.4,+ min: 0.5,+ max: 4,+ step: 0.1,+ description: "Stroke width",+ hiddenFromList: false,+ },+ accentRatio: {+ type: "number",+ default: 0.1,+ min: 0,+ max: 1,+ step: 0.05,+ description: "Accent share",+ hiddenFromList: false,+ },+ loopFrames: {+ type: "number",+ default: 300,+ min: 120,+ max: 600,+ step: 30,+ description: "Loop frames",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 1,+ min: 1,+ max: 50,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Trails" },+ accent: { type: "color", default: "#E5322D", description: "Accent" },+ },+ durationInFrames: 300,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/flow-field/index.tsx b/registry/remocn/flow-field/index.tsxnew file mode 100644index 00000000..b685284e--- /dev/null+++ b/registry/remocn/flow-field/index.tsx@@ -0,0 +1,212 @@+"use client";++import { useMemo } from "react";+import {+ AbsoluteFill,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type FlowFieldProps = {+ /** Number of particles in flight. */+ particles?: number;+ /** Trail length in simulation steps (frames). */+ trailLength?: number;+ /** Frames for one seamless loop of the field and the particle lifecycles. */+ loopFrames?: number;+ /** Particle lifetime in frames, rounded so it divides loopFrames. */+ lifeFrames?: number;+ /** Share of particles drawn in the accent color, 0 to 1. */+ accentRatio?: number;+ /** Trail width in px at 720p. */+ strokeWidth?: number;+ seed?: number;+ speed?: number;+ background?: string;+ color?: string;+ accent?: string;+};++export const flowFieldDefaults: Required<FlowFieldProps> = {+ particles: 300,+ trailLength: 72,+ loopFrames: 300,+ lifeFrames: 150,+ accentRatio: 0.1,+ strokeWidth: 1.4,+ seed: 1,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+};++const TAU = Math.PI * 2;+const WAVES = 4;+// Distance per frame in units of the short side of the frame.+const STEP = 0.0042;+const BUCKETS = 6;++type Wave = {+ fx: number;+ fy: number;+ phase: number;+ drift: number;+ amp: number;+};++function makeField(seed: number) {+ const r = (key: string) => random(`flow-field-${seed}-${key}`);+ const base = r("base") * TAU;+ const waves: Wave[] = Array.from({ length: WAVES }, (_, k) => ({+ fx: (r(`fx${k}`) * 2 - 1) * (0.9 + k * 0.8),+ fy: (r(`fy${k}`) * 2 - 1) * (0.9 + k * 0.8),+ phase: r(`ph${k}`) * TAU,+ drift: 0.6 + r(`dr${k}`) * 0.9,+ amp: 1.6 / (1 + k * 1.4),+ }));+ // Flow angle at (x, y). `tau` walks around a circle once per loop, so the+ // field at the end of the loop is exactly the field at the start.+ return (x: number, y: number, tau: number) => {+ let a = base;+ for (const w of waves) {+ a +=+ w.amp *+ Math.sin(+ w.fx * x + w.fy * y + w.phase + w.drift * Math.sin(tau + w.phase),+ );+ }+ return a;+ };+}++const fmt = (n: number) => Math.round(n * 10) / 10;++export function FlowField({+ particles = flowFieldDefaults.particles,+ trailLength = flowFieldDefaults.trailLength,+ loopFrames = flowFieldDefaults.loopFrames,+ lifeFrames = flowFieldDefaults.lifeFrames,+ accentRatio = flowFieldDefaults.accentRatio,+ strokeWidth = flowFieldDefaults.strokeWidth,+ seed = flowFieldDefaults.seed,+ speed = flowFieldDefaults.speed,+ background = flowFieldDefaults.background,+ color = flowFieldDefaults.color,+ accent = flowFieldDefaults.accent,+}: FlowFieldProps) {+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const field = useMemo(() => makeField(seed), [seed]);++ const unit = Math.min(width, height);+ const spanX = width / unit;+ const spanY = height / unit;+ const loop = Math.max(1, Math.round(loopFrames));+ const lives = Math.max(1, Math.round(loop / Math.max(1, lifeFrames)));+ const life = loop / lives;+ const trail = Math.max(2, Math.min(trailLength, life * 0.6));+ const travel = life - trail;+ const time = frame * speed;++ const paths = {+ color: new Array<string>(BUCKETS).fill(""),+ accent: new Array<string>(BUCKETS).fill(""),+ };+ const pts: number[] = [];++ for (let i = 0; i < particles; i++) {+ const offset = random(`flow-field-${seed}-off-${i}`) * life;+ const local = time + offset;+ const cycle = Math.floor(local / life);+ const age = local - cycle * life;+ // Head moves for `travel` frames, then stops while the tail catches up,+ // so trails grow in and drain out instead of popping.+ const head = Math.min(age, travel);+ const tail = Math.max(0, age - trail);+ if (head - tail < 0.05) continue;++ const slot = ((cycle % lives) + lives) % lives;+ const key = `flow-field-${seed}-p${i}-c${slot}`;+ let x = -0.08 + random(`${key}-x`) * (spanX + 0.16);+ let y = -0.08 + random(`${key}-y`) * (spanY + 0.16);+ const birth = time - age;++ pts.length = 0;+ pts.push(x, y);+ const steps = Math.ceil(head);+ for (let s = 0; s < steps; s++) {+ const a = field(x, y, (TAU * (birth + s)) / loop);+ x += Math.cos(a) * STEP;+ y += Math.sin(a) * STEP;+ pts.push(x, y);+ }+ const at = (k: number) => {+ const j = Math.min(Math.floor(k), steps - 1);+ const f = k - j;+ if (j < 0) return [pts[0], pts[1]];+ return [+ pts[j * 2] + (pts[j * 2 + 2] - pts[j * 2]) * f,+ pts[j * 2 + 1] + (pts[j * 2 + 3] - pts[j * 2 + 1]) * f,+ ];+ };++ const target =+ random(`flow-field-${seed}-accent-${i}`) < accentRatio+ ? paths.accent+ : paths.color;+ // Split the visible trail into age buckets; older buckets are fainter.+ for (let b = 0; b < BUCKETS; b++) {+ const from = Math.max(tail, age - (trail * (b + 1)) / BUCKETS);+ const to = Math.min(head, age - (trail * b) / BUCKETS);+ if (to - from <= 0.01) continue;+ const [fx, fy] = at(from);+ let d = `M ${fmt(fx * unit)} ${fmt(fy * unit)}`;+ for (let k = Math.floor(from) + 1; k < to; k++) {+ d += ` L ${fmt(pts[k * 2] * unit)} ${fmt(pts[k * 2 + 1] * unit)}`;+ }+ const [tx, ty] = at(to);+ d += ` L ${fmt(tx * unit)} ${fmt(ty * unit)} `;+ target[b] += d;+ }+ }++ const sw = (strokeWidth * unit) / 720;+ const layers = [+ { key: "color", paint: color, list: paths.color },+ { key: "accent", paint: accent, list: paths.accent },+ ];++ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Flow field"+ style={{ display: "block" }}+ >+ {layers.map((layer) => (+ <g+ key={layer.key}+ fill="none"+ stroke={layer.paint}+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ {layer.list.map((d, b) => (+ <path+ key={b}+ d={d}+ strokeOpacity={0.9 * (1 - b / BUCKETS) ** 1.4}+ strokeWidth={sw * (1 - (b / BUCKETS) * 0.5)}+ />+ ))}+ </g>+ ))}+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/gravity-pile/config.ts b/registry/remocn/gravity-pile/config.tsnew file mode 100644index 00000000..a15974fb--- /dev/null+++ b/registry/remocn/gravity-pile/config.ts@@ -0,0 +1,61 @@+import { gravityPileExampleCode } from "@/components/docs/examples/gravity-pile-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const HOLD = 26;++// The heap goes to sleep 18 frames after it starts settling, and weaker+// gravity starts that later (see `simulate` in the component).+function durationOf(values: Record<string, unknown>) {+ const gravity = typeof values.gravity === "number" ? values.gravity : 1;+ const speed =+ typeof values.speed === "number" && values.speed > 0 ? values.speed : 1;+ const settled = Math.min(150, 46 / Math.sqrt(Math.max(0.2, gravity)) + 18);+ return Math.ceil(settled / speed) + HOLD;+}++export const gravityPileConfig: ComponentConfig = {+ componentName: "GravityPile",+ importPath: "@/components/remocn/gravity-pile",+ controls: {+ count: {+ type: "number",+ default: 30,+ min: 4,+ max: 60,+ step: 1,+ description: "Bodies",+ hiddenFromList: false,+ },+ gravity: {+ type: "number",+ default: 1,+ min: 0.5,+ max: 2.5,+ step: 0.1,+ description: "Gravity",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 7,+ min: 1,+ max: 40,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ accentColor: { type: "color", default: "#E5322D", description: "Accent" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 90,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: gravityPileExampleCode,+};diff --git a/registry/remocn/gravity-pile/index.tsx b/registry/remocn/gravity-pile/index.tsxnew file mode 100644index 00000000..c9af2321--- /dev/null+++ b/registry/remocn/gravity-pile/index.tsx@@ -0,0 +1,367 @@+"use client";++import type React from "react";+import { useMemo } from "react";+import {+ AbsoluteFill,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type GravityPileColors = {+ background: string;+ shapes: string[];+ accent: string;+ floor: string;+};++export type GravityPileProps = {+ /** Number of falling bodies. */+ count?: number;+ seed?: number;+ /** Gravity multiplier. */+ gravity?: number;+ /** Optional nodes dropped as round bodies, landing on top of the heap. */+ items?: React.ReactNode[];+ colors?: Partial<GravityPileColors>;+ /** Color of the single accent body. Overrides `colors.accent`. */+ accentColor?: string;+ /** Background color. Overrides `colors.background`. */+ backgroundColor?: string;+ speed?: number;+};++export const gravityPileDefaults = {+ count: 30,+ seed: 7,+ gravity: 1,+ colors: {+ background: "#111111",+ shapes: ["#FFFFFF", "#C9C9C9", "#7A7A7A"],+ accent: "#E5322D",+ floor: "#FFFFFF",+ } satisfies GravityPileColors,+ speed: 1,+};++type Kind = "circle" | "square" | "triangle" | "item";+type Body = { r: number; kind: Kind; color: number; accent: boolean };+type Sim = { bodies: Body[]; frames: Float32Array[]; floor: number };++const FRAMES = 150;+const SUBSTEPS = 10;+const ITERATIONS = 4;+const BOUNCE = 0.42;+const FRICTION = 0.12;+const DAMPING = 0.999;+const GRIP = 0.45;+const SETTLE_FROM = 46;+const SETTLE_FRAMES = 18;++// Verlet integration with position-based circle contacts. Runs once per+// (size, count, seed, gravity), records every frame, and the component only+// reads the table back.+function simulate(+ width: number,+ height: number,+ count: number,+ seed: number,+ gravity: number,+ itemCount: number,+): Sim {+ const rnd = (key: string, i: number) =>+ random(`gravity-pile-${seed}-${key}-${i}`);+ const floor = height * 0.9;+ const g = (height / 200) * gravity;+ const dt = 1 / SUBSTEPS;+ // Weaker gravity means a slower rain, so the heap settles later.+ const settleFrom = SETTLE_FROM / Math.sqrt(Math.max(0.2, gravity));+ const kinds: Kind[] = ["circle", "square", "triangle"];+ const accentIndex = Math.max(0, count - itemCount - 3);+ const bodies: Body[] = Array.from({ length: count }, (_, i) => ({+ r: height * (0.036 + rnd("r", i) * 0.032),+ kind: i >= count - itemCount ? "item" : kinds[Math.floor(rnd("k", i) * 3)],+ color: Math.floor(rnd("c", i) * 3),+ accent: i === accentIndex,+ }));+ const n = bodies.length;+ const x = new Float64Array(n);+ const y = new Float64Array(n);+ const px = new Float64Array(n);+ const py = new Float64Array(n);+ const angle = new Float64Array(n);+ const spin = new Float64Array(n);+ // Spawn in a tall column above the frame, rejecting overlaps so nothing+ // explodes apart on the first step.+ for (let i = 0; i < n; i++) {+ const r = bodies[i].r;+ const band = height * (0.1 + (i / Math.max(1, n)) * 2);+ for (let attempt = 0; attempt < 40; attempt++) {+ x[i] = width * (0.5 + (rnd(`x${attempt}`, i) - 0.5) * 0.26);+ y[i] = -r - band - rnd(`y${attempt}`, i) * height * 0.25;+ let clear = true;+ for (let j = 0; j < i && clear; j++) {+ const gap = bodies[i].r + bodies[j].r + 2;+ clear = (x[i] - x[j]) ** 2 + (y[i] - y[j]) ** 2 > gap * gap;+ }+ if (clear) break;+ }+ px[i] = x[i] - (rnd("vx", i) - 0.5) * 0.6 * dt;+ py[i] = y[i] - height * 0.004 * dt;+ angle[i] = rnd("a", i) * Math.PI * 2;+ spin[i] = (rnd("s", i) - 0.5) * 0.02;+ }++ const frames: Float32Array[] = [];+ const record = () => {+ const out = new Float32Array(n * 3);+ for (let i = 0; i < n; i++) {+ out[i * 3] = x[i];+ out[i * 3 + 1] = y[i];+ out[i * 3 + 2] = angle[i];+ }+ frames.push(out);+ };+ record();++ for (let f = 1; f <= FRAMES; f++) {+ // Once damped out, the heap sleeps: no more solver creep.+ if (f > settleFrom + SETTLE_FRAMES) {+ frames.push(frames[frames.length - 1]);+ continue;+ }+ for (let s = 0; s < SUBSTEPS; s++) {+ // Late in the sim, bleed energy off so the heap comes fully to rest+ // instead of creeping forever.+ const settle = Math.min(1, Math.max(0, (f - settleFrom) / SETTLE_FRAMES));+ const damping = DAMPING - settle * 0.12;+ for (let i = 0; i < n; i++) {+ const vx = (x[i] - px[i]) * damping;+ const vy = (y[i] - py[i]) * damping;+ px[i] = x[i];+ py[i] = y[i];+ x[i] += vx;+ y[i] += vy + g * dt * dt;+ }+ for (let it = 0; it < ITERATIONS; it++) {+ for (let i = 0; i < n; i++) {+ for (let j = i + 1; j < n; j++) {+ const dx = x[j] - x[i];+ const dy = y[j] - y[i];+ const min = bodies[i].r + bodies[j].r;+ const d2 = dx * dx + dy * dy;+ if (d2 >= min * min || d2 === 0) continue;+ const d = Math.sqrt(d2);+ const push = (min - d) / d;+ const mi = bodies[i].r ** 2;+ const mj = bodies[j].r ** 2;+ const wi = mj / (mi + mj);+ const wj = mi / (mi + mj);+ x[i] -= dx * push * wi;+ y[i] -= dy * push * wi;+ x[j] += dx * push * wj;+ y[j] += dy * push * wj;+ }+ }+ for (let i = 0; i < n; i++) {+ const r = bodies[i].r;+ if (y[i] + r > floor) {+ const vy = y[i] - py[i];+ y[i] = floor - r;+ // Reflect only real impacts so resting bodies do not buzz.+ py[i] = vy > g * dt * 4 ? y[i] + vy * BOUNCE : y[i];+ px[i] = x[i] - (x[i] - px[i]) * (1 - FRICTION);+ }+ if (x[i] - r < 0) {+ x[i] = r;+ px[i] = x[i] + (x[i] - px[i]) * BOUNCE;+ }+ if (x[i] + r > width) {+ x[i] = width - r;+ px[i] = x[i] + (x[i] - px[i]) * BOUNCE;+ }+ }+ }+ // Contact friction: damp relative sliding so bodies stack instead of+ // flowing apart like marbles.+ for (let i = 0; i < n; i++) {+ for (let j = i + 1; j < n; j++) {+ const dx = x[j] - x[i];+ const dy = y[j] - y[i];+ const min = bodies[i].r + bodies[j].r + 0.5;+ const d2 = dx * dx + dy * dy;+ if (d2 >= min * min || d2 === 0) continue;+ const d = Math.sqrt(d2);+ const tx = -dy / d;+ const ty = dx / d;+ const rel =+ (x[j] - px[j] - (x[i] - px[i])) * tx ++ (y[j] - py[j] - (y[i] - py[i])) * ty;+ const mi = bodies[i].r ** 2;+ const mj = bodies[j].r ** 2;+ const k = rel * GRIP;+ px[i] -= tx * k * (mj / (mi + mj));+ py[i] -= ty * k * (mj / (mi + mj));+ px[j] += tx * k * (mi / (mi + mj));+ py[j] += ty * k * (mi / (mi + mj));+ }+ }+ for (let i = 0; i < n; i++) {+ const r = bodies[i].r;+ const vx = x[i] - px[i];+ // Bodies near the floor or the heap roll; free-falling ones keep spinning.+ const grounded =+ y[i] + r > floor - 1 || Math.abs(y[i] - py[i]) < g * dt;+ if (grounded) spin[i] = Math.abs(vx) > 0.05 ? vx / r : spin[i] * 0.8;+ angle[i] += spin[i];+ }+ }+ record();+ }+ return { bodies, frames, floor };+}++function Shape({ body, fill }: { body: Body; fill: string }) {+ const r = body.r;+ if (body.kind === "circle") return <circle r={r} fill={fill} />;+ if (body.kind === "square") {+ const h = r * 0.84;+ return (+ <rect+ x={-h}+ y={-h}+ width={h * 2}+ height={h * 2}+ rx={r * 0.12}+ fill={fill}+ />+ );+ }+ const c = r * 1.12;+ const pts = [0, 1, 2]+ .map((k) => {+ const a = -Math.PI / 2 + (k * Math.PI * 2) / 3;+ return `${(Math.cos(a) * c).toFixed(2)},${(Math.sin(a) * c + r * 0.12).toFixed(2)}`;+ })+ .join(" ");+ return (+ <polygon+ points={pts}+ fill={fill}+ strokeLinejoin="round"+ stroke={fill}+ strokeWidth={r * 0.14}+ />+ );+}++export function GravityPile({+ count = gravityPileDefaults.count,+ seed = gravityPileDefaults.seed,+ gravity = gravityPileDefaults.gravity,+ items,+ colors: colorOverrides,+ accentColor,+ backgroundColor,+ speed = gravityPileDefaults.speed,+}: GravityPileProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const baseColors = { ...gravityPileDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ accent: accentColor ?? baseColors.accent,+ background: backgroundColor ?? baseColors.background,+ };+ const itemCount = Math.min(+ items?.length ?? 0,+ Math.max(1, Math.round(count)),+ );+ const sim = useMemo(+ () =>+ simulate(+ width,+ height,+ Math.max(1, Math.round(count)),+ seed,+ gravity,+ itemCount,+ ),+ [width, height, count, seed, gravity, itemCount],+ );++ const t = Math.min(FRAMES, Math.max(0, (frame * speed * 30) / fps));+ const f0 = Math.floor(t);+ const f1 = Math.min(FRAMES, f0 + 1);+ const mix = t - f0;+ const a = sim.frames[f0];+ const b = sim.frames[f1];+ const n = sim.bodies.length;++ return (+ <AbsoluteFill+ style={{ backgroundColor: colors.background, overflow: "hidden" }}+ >+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <line+ x1={0}+ x2={width}+ y1={sim.floor + 1}+ y2={sim.floor + 1}+ stroke={colors.floor}+ strokeOpacity={0.25}+ strokeWidth={2}+ />+ {sim.bodies.map((body, i) => {+ if (body.kind === "item") return null;+ const x = a[i * 3] + (b[i * 3] - a[i * 3]) * mix;+ const y = a[i * 3 + 1] + (b[i * 3 + 1] - a[i * 3 + 1]) * mix;+ const rot = a[i * 3 + 2] + (b[i * 3 + 2] - a[i * 3 + 2]) * mix;+ const fill = body.accent+ ? colors.accent+ : colors.shapes[body.color % colors.shapes.length];+ return (+ <g+ key={i}+ transform={`translate(${x.toFixed(2)} ${y.toFixed(2)}) rotate(${((rot * 180) / Math.PI).toFixed(2)})`}+ >+ <Shape body={body} fill={fill} />+ </g>+ );+ })}+ </svg>+ {items?.slice(0, itemCount).map((item, j) => {+ const i = n - itemCount + j;+ const body = sim.bodies[i];+ const x = a[i * 3] + (b[i * 3] - a[i * 3]) * mix;+ const y = a[i * 3 + 1] + (b[i * 3 + 1] - a[i * 3 + 1]) * mix;+ const rot = a[i * 3 + 2] + (b[i * 3 + 2] - a[i * 3 + 2]) * mix;+ return (+ <div+ key={j}+ style={{+ position: "absolute",+ left: x - body.r,+ top: y - body.r,+ width: body.r * 2,+ height: body.r * 2,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ transform: `rotate(${rot}rad)`,+ }}+ >+ {item}+ </div>+ );+ })}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/hyperspace/config.ts b/registry/remocn/hyperspace/config.tsnew file mode 100644index 00000000..8fa65e3c--- /dev/null+++ b/registry/remocn/hyperspace/config.ts@@ -0,0 +1,49 @@+import { hyperspaceExampleCode } from "@/components/docs/examples/hyperspace-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const hyperspaceConfig: ComponentConfig = {+ componentName: "hyperspace",+ importPath: "@/components/remocn/hyperspace",+ controls: {+ stars: {+ type: "number",+ min: 40,+ max: 600,+ step: 20,+ default: 260,+ description: "Stars",+ hiddenFromList: false,+ },+ streakColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Streak color",+ },+ accentColor: {+ type: "color",+ default: "#E5322D",+ description: "Accent color",+ },+ accentRatio: {+ type: "number",+ min: 0,+ max: 1,+ step: 0.02,+ default: 0.14,+ description: "Accent ratio",+ hiddenFromList: false,+ },+ flash: { type: "boolean", default: true, description: "Flash" },+ flashColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Flash color",+ },+ },+ durationInFrames: 124,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#0a0a0a" },+ snippet: hyperspaceExampleCode,+};diff --git a/registry/remocn/hyperspace/index.tsx b/registry/remocn/hyperspace/index.tsxnew file mode 100644index 00000000..2b9d616f--- /dev/null+++ b/registry/remocn/hyperspace/index.tsx@@ -0,0 +1,253 @@+"use client";++import type {+ TransitionPresentation,+ TransitionPresentationComponentProps,+} from "@remotion/transitions";+import type React from "react";+import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useVideoConfig,+} from "remotion";++export type HyperspaceProps = {+ /** Number of stars in the field. */+ stars?: number;+ /** Main streak color. */+ streakColor?: string;+ /** Color of the occasional tinted streak. */+ accentColor?: string;+ /** Share of stars drawn in `accentColor`, 0 to 1. */+ accentRatio?: number;+ /** White flash at the cut. Set false for a hard cut through the streaks. */+ flash?: boolean;+ /** Flash color. */+ flashColor?: string;+};++export const hyperspaceDefaults: Required<HyperspaceProps> = {+ stars: 260,+ streakColor: "#FFFFFF",+ accentColor: "#E5322D",+ accentRatio: 0.14,+ flash: true,+ flashColor: "#FFFFFF",+};++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++// Log-radius travel. Stars live on rays from the center and their radius grows+// as exp(travel), which reads as perspective: slow near the vanishing point,+// rushing at the edges.+const JUMP = 3.2;+const COAST = 1.1;+const CUT = 0.62;+// Slow drift the stars cover before the jump kicks in.+const SPOOL = 0.22;+const MAX_TAIL = 0.94;++type Star = { angle: number; logR: number; accent: boolean; weight: number };++function travelAt(p: number) {+ if (p <= CUT) {+ // Spool up: a slow linear drift that hands over to a quartic surge, so the+ // field starts moving gently instead of lurching.+ const t = p / CUT;+ return { travel: SPOOL * t + (JUMP - SPOOL) * t ** 4, speed: t ** 3 };+ }+ const q = (p - CUT) / (1 - CUT);+ const ease = 1 - (1 - q) ** 2;+ return { travel: JUMP + COAST * ease, speed: 0.7 * (1 - q) };+}++function Starfield({+ stars,+ progress,+ streakColor,+ accentColor,+ opacity,+ stride,+}: {+ stars: Star[];+ progress: number;+ streakColor: string;+ accentColor: string;+ opacity: number;+ stride: number;+}) {+ const { width, height } = useVideoConfig();+ const cx = width / 2;+ const cy = height / 2;+ const diag = Math.hypot(width, height) / 2;+ const unit = Math.min(width, height) / 720;+ const { travel, speed } = travelAt(progress);+ // Streak length grows with speed squared.+ const tail = Math.min(MAX_TAIL, 0.006 + MAX_TAIL * speed ** 2);++ const lines: React.ReactNode[] = [];+ stars.forEach((star, i) => {+ if (i % stride !== 0) return;+ const r = Math.exp(star.logR + travel);+ const r0 = r * (1 - tail);+ if (r0 > diag * 1.05) return;+ const near = Math.min(1, r / (diag * 0.12));+ const alpha = (0.25 + 0.75 * near) * opacity;+ const cos = Math.cos(star.angle);+ const sin = Math.sin(star.angle);+ lines.push(+ <line+ key={i}+ x1={cx + cos * r0}+ y1={cy + sin * r0}+ x2={cx + cos * r}+ y2={cy + sin * r}+ stroke={star.accent ? accentColor : streakColor}+ strokeOpacity={alpha}+ strokeWidth={(0.8 + star.weight * 2.4 * near) * unit}+ strokeLinecap="round"+ />,+ );+ });++ return (+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ {lines}+ </svg>+ );+}++const HyperspacePresentation: React.FC<+ TransitionPresentationComponentProps<HyperspaceProps>+> = ({+ children,+ presentationProgress,+ presentationDirection,+ passedProps,+}) => {+ const {+ stars: count,+ streakColor,+ accentColor,+ accentRatio,+ flash,+ flashColor,+ } = { ...hyperspaceDefaults, ...passedProps };+ const { width, height } = useVideoConfig();+ const diag = Math.hypot(width, height) / 2;+ const p = presentationProgress;++ const stars = useMemo<Star[]>(() => {+ const minLog = Math.log(Math.max(2, diag * 0.015));+ const maxLog = Math.log(diag);+ return Array.from({ length: Math.max(0, Math.round(count)) }, (_, i) => ({+ angle: random(`hyperspace-a-${i}`) * Math.PI * 2,+ logR: minLog + random(`hyperspace-r-${i}`) * (maxLog - minLog),+ accent: random(`hyperspace-c-${i}`) < accentRatio,+ weight: random(`hyperspace-w-${i}`),+ }));+ }, [count, accentRatio, diag]);++ if (presentationDirection === "exiting") {+ const t = Math.min(1, p / CUT);+ // Quartic push: barely moves while the stars spool up, then surges.+ const push = 1 + 0.42 * t ** 4;+ const dim = interpolate(t, [0, 1], [1, 0.45], {+ ...clamp,+ easing: Easing.in(Easing.quad),+ });+ const fieldIn = interpolate(t, [0, 0.45], [0, 1], {+ ...clamp,+ easing: Easing.inOut(Easing.quad),+ });+ const white = flash+ ? interpolate(t, [0.72, 1], [0, 1], {+ ...clamp,+ easing: Easing.in(Easing.quad),+ })+ : 0;+ return (+ <AbsoluteFill style={{ backgroundColor: "#000000", overflow: "hidden" }}>+ <AbsoluteFill+ style={{ transform: `scale(${push})`, filter: `brightness(${dim})` }}+ >+ {children}+ </AbsoluteFill>+ <Starfield+ stars={stars}+ progress={Math.min(p, CUT)}+ streakColor={streakColor}+ accentColor={accentColor}+ opacity={fieldIn}+ stride={1}+ />+ <AbsoluteFill style={{ backgroundColor: flashColor, opacity: white }} />+ </AbsoluteFill>+ );+ }++ if (p < CUT) {+ return <AbsoluteFill style={{ opacity: 0 }}>{children}</AbsoluteFill>;+ }++ // Arrival: the flash holds for a beat, then dissolves slowly while the scene+ // eases out of a slight zoom and soft focus, so the landing feels calm+ // after the jump.+ const q = (p - CUT) / (1 - CUT);+ const unit = Math.min(width, height);+ const soft = Easing.bezier(0.22, 1, 0.36, 1);+ const settle = interpolate(q, [0, 1], [1.06, 1], { ...clamp, easing: soft });+ const blur = interpolate(q, [0, 0.75], [unit * 0.018, 0], {+ ...clamp,+ easing: soft,+ });+ const white = flash+ ? interpolate(q, [0, 0.1, 1], [1, 1, 0], {+ ...clamp,+ easing: Easing.inOut(Easing.sin),+ })+ : 0;+ const fade = interpolate(q, [0, 0.45], [0.8, 0], {+ ...clamp,+ easing: Easing.out(Easing.quad),+ });+ return (+ <AbsoluteFill style={{ overflow: "hidden" }}>+ <AbsoluteFill+ style={{+ transform: `scale(${settle})`,+ filter: blur > 0.1 ? `blur(${blur}px)` : undefined,+ }}+ >+ {children}+ </AbsoluteFill>+ <Starfield+ stars={stars}+ progress={p}+ streakColor={streakColor}+ accentColor={accentColor}+ opacity={fade}+ stride={5}+ />+ <AbsoluteFill style={{ backgroundColor: flashColor, opacity: white }} />+ </AbsoluteFill>+ );+};++export function hyperspace(+ props: HyperspaceProps = {},+): TransitionPresentation<HyperspaceProps> {+ return { component: HyperspacePresentation, props };+}diff --git a/registry/remocn/impact-shake/config.ts b/registry/remocn/impact-shake/config.tsnew file mode 100644index 00000000..c70548a6--- /dev/null+++ b/registry/remocn/impact-shake/config.ts@@ -0,0 +1,65 @@+import { impactShakeExampleCode } from "@/components/docs/examples/impact-shake-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++// Shake, dust and squash have all died out about 23 frames after the hit.+const SETTLE = 23;+const HOLD = 20;++function durationOf(values: Record<string, unknown>) {+ const impact = typeof values.impact === "number" ? values.impact : 7;+ const speed =+ typeof values.speed === "number" && values.speed > 0 ? values.speed : 1;+ return Math.ceil((impact + SETTLE) / speed) + HOLD;+}++export const impactShakeConfig: ComponentConfig = {+ componentName: "ImpactShake",+ importPath: "@/components/remocn/impact-shake",+ controls: {+ text: { type: "text-content", default: "LAUNCH", description: "Text" },+ intensity: {+ type: "number",+ default: 1,+ min: 0,+ max: 2,+ step: 0.1,+ description: "Intensity",+ hiddenFromList: false,+ },+ impact: {+ type: "number",+ default: 7,+ min: 2,+ max: 30,+ step: 1,+ description: "Impact frame",+ hiddenFromList: false,+ },+ foregroundColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Foreground",+ },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ seed: {+ type: "number",+ default: 1,+ min: 1,+ max: 24,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ },+ durationInFrames: 50,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: impactShakeExampleCode,+};diff --git a/registry/remocn/impact-shake/index.tsx b/registry/remocn/impact-shake/index.tsxnew file mode 100644index 00000000..76b86664--- /dev/null+++ b/registry/remocn/impact-shake/index.tsx@@ -0,0 +1,270 @@+"use client";++import type React from "react";+import { useId, useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type ImpactShakeColors = {+ background: string;+ foreground: string;+ splitA: string;+ splitB: string;+ dust: string;+};++export type ImpactShakeProps = {+ /** The heavy subject. Defaults to a big white word. */+ children?: React.ReactNode;+ /** Word used when no children are passed. */+ text?: string;+ /** Shake, split and dust strength, 0 to 2. */+ intensity?: number;+ /** Frame (at 30fps) when the subject hits. */+ impact?: number;+ colors?: Partial<ImpactShakeColors>;+ /** Default word and flash color. Overrides `colors.foreground`. */+ foregroundColor?: string;+ /** Background color. Overrides `colors.background`. */+ backgroundColor?: string;+ seed?: number;+ speed?: number;+};++export const impactShakeDefaults = {+ text: "LAUNCH",+ intensity: 1,+ impact: 7,+ colors: {+ background: "#111111",+ foreground: "#FFFFFF",+ splitA: "#FF2A2A",+ splitB: "#2A6BFF",+ dust: "#D9D9D9",+ } satisfies ImpactShakeColors,+ seed: 1,+ speed: 1,+};++const FONT = "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";+const DUST = 36;++// Turns any content into a flat silhouette of one color, keeping its alpha.+function tintMatrix(hex: string) {+ const v = Number.parseInt(hex.replace("#", "").slice(0, 6), 16);+ const r = ((v >> 16) & 255) / 255;+ const g = ((v >> 8) & 255) / 255;+ const b = (v & 255) / 255;+ return `0 0 0 0 ${r} 0 0 0 0 ${g} 0 0 0 0 ${b} 0 0 0 1 0`;+}++export function ImpactShake({+ children,+ text = impactShakeDefaults.text,+ intensity = impactShakeDefaults.intensity,+ impact = impactShakeDefaults.impact,+ colors: colorOverrides,+ foregroundColor,+ backgroundColor,+ seed = impactShakeDefaults.seed,+ speed = impactShakeDefaults.speed,+}: ImpactShakeProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const uid = `impact-shake-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const baseColors = { ...impactShakeDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ foreground: foregroundColor ?? baseColors.foreground,+ background: backgroundColor ?? baseColors.background,+ };+ const t = (frame * speed * 30) / fps;+ const k = Math.max(0, intensity);+ const unit = height / 720;+ const since = t - impact;++ // Fall: pure acceleration into the hit, no easing out.+ const fall = interpolate(t, [0, impact], [-height * 0.85, 0], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.in(Easing.quad),+ });+ const falling = since < 0;+ const stretch = falling+ ? interpolate(t, [0, impact], [1, 1.18], { extrapolateRight: "clamp" })+ : 1;+ const squash = falling+ ? 0+ : 1 -+ spring({ frame: since, fps: 30, config: { damping: 9, stiffness: 260 } });+ const sx = falling+ ? 1 / Math.sqrt(stretch)+ : 1 + 0.16 * squash * Math.min(1, k);+ const sy = falling ? stretch : 1 - 0.2 * squash * Math.min(1, k);++ // Damped camera shake with incommensurate frequencies so it never looks looped.+ const decay = since >= 0 ? Math.exp(-since / 3.2) : 0;+ const phase = random(`impact-shake-${seed}`) * Math.PI * 2;+ const shakeX = decay * Math.sin(since * 2.9 + phase) * 26 * unit * k;+ const shakeY = decay * Math.cos(since * 3.7 + phase) * 34 * unit * k;+ const shakeR = decay * Math.sin(since * 2.3 + phase * 2) * 1.6 * k;++ const split =+ since >= 0 && since < 2 ? (1 - since / 2) * 18 * unit * k + 6 * unit : 0;+ const flash = interpolate(since, [0, 0.5, 2.5], [0, 0.12, 0], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ });++ const floorY = height * 0.62;+ const dust = useMemo(+ () =>+ Array.from({ length: DUST }, (_, i) => {+ const key = `impact-shake-${seed}-dust-${i}`;+ const side = i % 2 === 0 ? -1 : 1;+ return {+ chip: i % 3 === 0,+ x0: (0.04 + random(`${key}-x`) * 0.24) * side,+ vx: side * (0.4 + random(`${key}-v`) * 1),+ vy: 0.3 + random(`${key}-u`) * 0.9,+ size: 0.5 + random(`${key}-s`) * 0.9,+ life: 11 + random(`${key}-l`) * 9,+ };+ }),+ [seed],+ );++ const subject = children ?? (+ <span+ style={{+ fontFamily: FONT,+ fontSize: height * 0.24,+ fontWeight: 900,+ letterSpacing: "-0.05em",+ lineHeight: 1,+ color: colors.foreground,+ }}+ >+ {text}+ </span>+ );++ const layer = (filter: string | undefined, dx: number, key: string) => (+ <AbsoluteFill+ key={key}+ style={{+ alignItems: "center",+ justifyContent: "center",+ filter,+ transform: `translate(${dx}px, ${fall}px) scale(${sx}, ${sy})`,+ transformOrigin: `50% ${(floorY / height) * 100}%`,+ mixBlendMode: filter ? "screen" : undefined,+ }}+ >+ {subject}+ </AbsoluteFill>+ );++ return (+ <AbsoluteFill+ style={{ backgroundColor: colors.background, overflow: "hidden" }}+ >+ <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>+ <filter id={`${uid}-a`} colorInterpolationFilters="sRGB">+ <feColorMatrix type="matrix" values={tintMatrix(colors.splitA)} />+ </filter>+ <filter id={`${uid}-b`} colorInterpolationFilters="sRGB">+ <feColorMatrix type="matrix" values={tintMatrix(colors.splitB)} />+ </filter>+ </svg>+ <AbsoluteFill+ style={{+ transform: `translate(${shakeX}px, ${shakeY}px) rotate(${shakeR}deg) scale(${1 + decay * 0.04 * k})`,+ }}+ >+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <filter+ id={`${uid}-puff`}+ x="-50%"+ y="-50%"+ width="200%"+ height="200%"+ >+ <feGaussianBlur stdDeviation={height * 0.007} />+ </filter>+ {since >= 0+ ? dust.map((p, i) => {+ const age = since;+ if (age > p.life) return null;+ const life = age / p.life;+ const spread = Math.max(0.4, k);+ if (p.chip) {+ // Debris: ballistic arc, small and bright.+ const x =+ width / 2 + p.x0 * width + p.vx * age * 10 * unit * spread;+ const y =+ floorY - p.vy * age * 16 * unit + age * age * 1.6 * unit;+ const size = p.size * 6 * unit;+ return (+ <rect+ key={i}+ x={x - size / 2}+ y={y - size / 2}+ width={size}+ height={size}+ fill={colors.dust}+ opacity={(1 - life) * 0.9}+ transform={`rotate(${age * 40 * p.vx} ${x} ${y})`}+ />+ );+ }+ // Puffs: burst outward against heavy drag, then hang and swell.+ const travel = 1 - Math.exp(-age / 3.5);+ const x =+ width / 2 ++ p.x0 * width ++ p.vx * travel * width * 0.16 * spread;+ const y = floorY - p.vy * travel * height * 0.07;+ const r =+ height * p.size * (0.015 + 0.05 * travel + 0.02 * life);+ return (+ <circle+ key={i}+ cx={x}+ cy={y}+ r={r}+ fill={colors.dust}+ opacity={(1 - life) ** 1.4 * 0.38}+ filter={`url(#${uid}-puff)`}+ />+ );+ })+ : null}+ </svg>+ {split > 0 ? (+ <>+ {layer(`url(#${uid}-a)`, -split, "a")}+ {layer(`url(#${uid}-b)`, split, "b")}+ </>+ ) : null}+ {layer(undefined, 0, "main")}+ </AbsoluteFill>+ <AbsoluteFill+ style={{ backgroundColor: colors.foreground, opacity: flash * k }}+ />+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/inflate/config.ts b/registry/remocn/inflate/config.tsnew file mode 100644index 00000000..dc813a18--- /dev/null+++ b/registry/remocn/inflate/config.ts@@ -0,0 +1,23 @@+import { inflateExampleCode } from "@/components/docs/examples/inflate-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const inflateConfig: ComponentConfig = {+ componentName: "Inflate",+ importPath: "@/components/remocn/inflate",+ controls: {+ color: { type: "color", default: "#E5322D", description: "Body" },+ highlight: { type: "color", default: "#FFFFFF", description: "Highlight" },+ dotColor: { type: "color", default: "#111111", description: "Dot" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 66,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: inflateExampleCode,+};diff --git a/registry/remocn/inflate/index.tsx b/registry/remocn/inflate/index.tsxnew file mode 100644index 00000000..05a71975--- /dev/null+++ b/registry/remocn/inflate/index.tsx@@ -0,0 +1,173 @@+"use client";++import type React from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type InflateProps = {+ /** Wordmark revealed beside the mark once it settles. */+ children?: React.ReactNode;+ backgroundColor?: string;+ /** Body color of the mark. */+ color?: string;+ /** Specular highlight color. */+ highlight?: string;+ /** Dot inside the mark. */+ dotColor?: string;+ speed?: number;+};++export const inflateDefaults = {+ backgroundColor: "#111111",+ color: "#E5322D",+ highlight: "#FFFFFF",+ dotColor: "#111111",+ speed: 1,+};++const PUFF = 3;+const WOBBLE = 10;+const DOT = 15;+const SLIDE = 22;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++export function Inflate(props: InflateProps) {+ const { children, backgroundColor, color, highlight, dotColor, speed } = {+ ...inflateDefaults,+ ...props,+ };+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const t = frame * Math.max(0, speed);+ const size = Math.round(Math.min(width, height) * 0.22);++ // Main puff: an underdamped spring overshoots the final size.+ const puff = spring({+ frame: t - PUFF,+ fps,+ config: { damping: 8, stiffness: 150, mass: 0.6 },+ });+ // After the peak the body squashes wide and rings out like a balloon.+ const w0 = t - WOBBLE;+ const wobble =+ w0 > 0 ? 0.2 * Math.exp(-w0 / 6) * Math.sin((w0 / 9) * Math.PI * 2) : 0;++ const grow = Math.max(0, puff);+ const sliverW = interpolate(t, [0, PUFF], [0.7, 1], {+ ...clamp,+ easing: Easing.out(Easing.quad),+ });+ const bodyH = size * (0.05 + 0.95 * grow) * (1 - wobble);+ const bodyW = size * (sliverW + (Math.max(1, grow) - 1) * 0.8) * (1 + wobble);+ const roundness = interpolate(t, [PUFF, PUFF + 7, 26], [0.5, 0.46, 0.27], {+ ...clamp,+ easing: Easing.inOut(Easing.quad),+ });+ const radius = Math.min(bodyW, bodyH) * roundness;+ const gloss = interpolate(t, [PUFF + 2, PUFF + 9], [0, 1], clamp);+ const appear = interpolate(t, [0, 2], [0, 1], clamp);++ const dot = spring({+ frame: t - DOT,+ fps,+ config: { damping: 10, stiffness: 220, mass: 0.5 },+ });+ const slide = interpolate(t, [SLIDE, SLIDE + 11], [0, 1], {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });+ const reveal = interpolate(t, [SLIDE + 2, SLIDE + 13], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });++ return (+ <AbsoluteFill+ style={{+ backgroundColor,+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ display: "flex",+ alignItems: "center",+ gap: size * 0.24,+ transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,+ }}+ >+ <div+ style={{+ width: size,+ height: size,+ flexShrink: 0,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ position: "relative",+ flexShrink: 0,+ width: bodyW,+ height: bodyH,+ borderRadius: radius,+ backgroundColor: color,+ opacity: appear,+ overflow: "hidden",+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ boxShadow: `inset ${-size * 0.06}px ${-size * 0.08}px ${size * 0.14}px rgba(0,0,0,${0.28 * gloss})`,+ }}+ >+ <div+ style={{+ position: "absolute",+ left: "14%",+ top: "10%",+ width: "46%",+ height: "28%",+ borderRadius: "50%",+ background: `radial-gradient(ellipse at 45% 40%, ${highlight} 0%, transparent 70%)`,+ opacity: 0.55 * gloss,+ transform: "rotate(-18deg)",+ }}+ />+ <div+ style={{+ width: size * 0.3,+ height: size * 0.3,+ borderRadius: "50%",+ backgroundColor: dotColor,+ transform: `scale(${dot})`,+ }}+ />+ </div>+ </div>+ {children && (+ <div+ style={{+ opacity: reveal,+ clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,+ transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,+ }}+ >+ {children}+ </div>+ )}+ </div>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/iris-wipe/config.ts b/registry/remocn/iris-wipe/config.tsnew file mode 100644index 00000000..eddde947--- /dev/null+++ b/registry/remocn/iris-wipe/config.ts@@ -0,0 +1,43 @@+import { irisWipeExampleCode } from "@/components/docs/examples/iris-wipe-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const irisWipeConfig: ComponentConfig = {+ componentName: "irisWipe",+ importPath: "@/components/remocn/iris-wipe",+ controls: {+ color: { type: "color", default: "#000000", description: "Iris color" },+ centerX: {+ type: "number",+ min: 0,+ max: 1,+ step: 0.05,+ default: 0.5,+ description: "Center X",+ hiddenFromList: false,+ },+ centerY: {+ type: "number",+ min: 0,+ max: 1,+ step: 0.05,+ default: 0.5,+ description: "Center Y",+ hiddenFromList: false,+ },+ holdRadius: {+ type: "number",+ min: 0,+ max: 40,+ step: 1,+ default: 12,+ description: "Hold radius",+ hiddenFromList: false,+ },+ },+ durationInFrames: 104,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#efe9dc" },+ snippet: irisWipeExampleCode,+};diff --git a/registry/remocn/iris-wipe/index.tsx b/registry/remocn/iris-wipe/index.tsxnew file mode 100644index 00000000..3a63bd96--- /dev/null+++ b/registry/remocn/iris-wipe/index.tsx@@ -0,0 +1,88 @@+"use client";++import type {+ TransitionPresentation,+ TransitionPresentationComponentProps,+} from "@remotion/transitions";+import type React from "react";+import { AbsoluteFill, Easing, interpolate } from "remotion";++export type IrisWipeProps = {+ /** Fill shown outside the iris while it is closed. */+ color?: string;+ /** Horizontal iris center, 0 to 1. */+ centerX?: number;+ /** Vertical iris center, 0 to 1. */+ centerY?: number;+ /** Radius of the held dot, as a percentage of the frame diagonal. */+ holdRadius?: number;+};++export const irisWipeDefaults: Required<IrisWipeProps> = {+ color: "#000000",+ centerX: 0.5,+ centerY: 0.5,+ holdRadius: 12,+};++// circle() percentages resolve against the diagonal / sqrt(2), so 150% covers+// the frame from any center point.+const COVER = 150;+// Progress at which the iris is fully shut and starts opening on the next scene.+const CUT = 0.5;++// One smooth curve instead of keyframes: the circle rushes in from off-frame,+// lingers as a slowly shrinking dot and snaps shut, without ever standing+// still. Easing each keyframe segment separately drops the speed to zero at+// every key, which reads as a stall.+function closingRadius(u: number, hold: number) {+ return hold * (1 - u ** 3) + (COVER - hold) * (1 - u) ** 5;+}++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++const IrisWipePresentation: React.FC<+ TransitionPresentationComponentProps<IrisWipeProps>+> = ({+ children,+ presentationProgress,+ presentationDirection,+ passedProps,+}) => {+ const { color, centerX, centerY, holdRadius } = {+ ...irisWipeDefaults,+ ...passedProps,+ };+ const p = presentationProgress;+ const at = `${centerX * 100}% ${centerY * 100}%`;++ if (presentationDirection === "exiting") {+ const radius = closingRadius(Math.min(1, p / CUT), holdRadius);+ return (+ <AbsoluteFill style={{ backgroundColor: color }}>+ <AbsoluteFill style={{ clipPath: `circle(${radius}% at ${at})` }}>+ {children}+ </AbsoluteFill>+ </AbsoluteFill>+ );+ }++ const radius = interpolate(p, [CUT, 1], [0, COVER], {+ ...clamp,+ easing: Easing.bezier(0.45, 0, 0.75, 0.6),+ });+ return (+ <AbsoluteFill style={{ clipPath: `circle(${radius}% at ${at})` }}>+ {children}+ </AbsoluteFill>+ );+};++export function irisWipe(+ props: IrisWipeProps = {},+): TransitionPresentation<IrisWipeProps> {+ return { component: IrisWipePresentation, props };+}diff --git a/registry/remocn/isometric-build/config.ts b/registry/remocn/isometric-build/config.tsnew file mode 100644index 00000000..1109e67a--- /dev/null+++ b/registry/remocn/isometric-build/config.ts@@ -0,0 +1,80 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" ? value : fallback;++// The back row starts last, at 2·(grid − 1)·stagger plus up to one stagger of+// jitter, and its spring settles about 20 frames later. A hold follows.+function durationOf(values: Record<string, unknown>) {+ const speed = numberOr(values.speed, 1);+ const grid = Math.max(1, Math.round(numberOr(values.grid, 5)));+ const stagger = numberOr(values.stagger, 2);+ const build = (2 * (grid - 1) + 1) * stagger + 20;+ return (speed > 0 ? Math.ceil(build / speed) : build) + 52;+}++export const isometricBuildConfig: ComponentConfig = {+ componentName: "IsometricBuild",+ importPath: "@/components/remocn/isometric-build",+ controls: {+ grid: {+ type: "number",+ default: 5,+ min: 2,+ max: 9,+ step: 1,+ description: "Tiles per side",+ hiddenFromList: false,+ },+ maxHeight: {+ type: "number",+ default: 2.2,+ min: 0.5,+ max: 4,+ step: 0.1,+ description: "Max height",+ hiddenFromList: false,+ },+ stagger: {+ type: "number",+ default: 2,+ min: 0,+ max: 6,+ step: 0.5,+ description: "Stagger",+ hiddenFromList: false,+ },+ gap: {+ type: "number",+ default: 0.04,+ min: 0,+ max: 0.3,+ step: 0.01,+ description: "Gap",+ hiddenFromList: false,+ },+ floors: { type: "boolean", default: true, description: "Floor lines" },+ seed: {+ type: "number",+ default: 4,+ min: 1,+ max: 50,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Blocks" },+ accent: { type: "color", default: "#E5322D", description: "Accent tower" },+ },+ durationInFrames: 90,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/isometric-build/index.tsx b/registry/remocn/isometric-build/index.tsxnew file mode 100644index 00000000..f154b8c0--- /dev/null+++ b/registry/remocn/isometric-build/index.tsx@@ -0,0 +1,234 @@+"use client";++import { useMemo } from "react";+import {+ AbsoluteFill,+ interpolate,+ random,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type IsometricBuildProps = {+ /** Tiles per side. */+ grid?: number;+ /** Tallest regular block, in tile widths. The accent tower rises above it. */+ maxHeight?: number;+ /** Frames between consecutive diagonals rising. */+ stagger?: number;+ seed?: number;+ speed?: number;+ background?: string;+ /** Block color; side faces are this color shaded toward the background. */+ color?: string;+ /** The single accent tower. */+ accent?: string;+ /** Draw floor lines on the block faces. */+ floors?: boolean;+ /** Gap between neighbouring blocks, as a share of a tile. */+ gap?: number;+};++export const isometricBuildDefaults: Required<IsometricBuildProps> = {+ grid: 5,+ maxHeight: 2.2,+ stagger: 2,+ seed: 4,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ floors: true,+ gap: 0.04,+};++// True isometric: tile half-height = half-width · tan 30°, unit vertical edge+// matches the projected tile edge.+const ISO_Y = Math.tan(Math.PI / 6);+const ISO_Z = 1 / Math.cos(Math.PI / 6);+const FLOOR = 0.42;+const SHADE_LEFT = 0.32;+const SHADE_RIGHT = 0.6;++const fmt = (n: number) => Math.round(n * 10) / 10;++type Block = {+ i: number;+ j: number;+ height: number;+ accent: boolean;+ delay: number;+};++function makeBlocks(+ n: number,+ maxHeight: number,+ seed: number,+ stagger: number,+) {+ const r = (key: string) => random(`isometric-build-${seed}-${key}`);+ const inner = Math.max(1, n - 2);+ const ai = n > 2 ? 1 + Math.floor(r("ai") * inner) : 0;+ const aj = n > 2 ? 1 + Math.floor(r("aj") * inner) : 0;+ const blocks: Block[] = [];+ // Painter order: back (i + j small) to front.+ for (let sum = 0; sum <= 2 * (n - 1); sum++) {+ for (let i = 0; i < n; i++) {+ const j = sum - i;+ if (j < 0 || j >= n) continue;+ const accent = i === ai && j === aj;+ // One compact mass: heights follow a mound that peaks in the middle,+ // with a little seeded variation, snapped to whole floors so the+ // blocks stack like a single stepped sculpture rather than noise.+ const c = (n - 1) / 2;+ const centre = 1 - Math.hypot(i - c, j - c) / (Math.hypot(c, c) || 1);+ const raw =+ maxHeight *+ (0.2 + 0.8 * centre ** 1.3) *+ (0.75 + 0.5 * r(`h${i}-${j}`));+ const h = Math.max(FLOOR, Math.round(raw / FLOOR) * FLOOR);+ blocks.push({+ i,+ j,+ accent,+ height: accent ? maxHeight * 1.35 : h,+ // Front rows rise first.+ delay: (2 * (n - 1) - sum) * stagger + r(`d${i}-${j}`) * stagger,+ });+ }+ }+ return blocks;+}++export function IsometricBuild({+ grid = isometricBuildDefaults.grid,+ maxHeight = isometricBuildDefaults.maxHeight,+ stagger = isometricBuildDefaults.stagger,+ seed = isometricBuildDefaults.seed,+ speed = isometricBuildDefaults.speed,+ background = isometricBuildDefaults.background,+ color = isometricBuildDefaults.color,+ accent = isometricBuildDefaults.accent,+ floors = isometricBuildDefaults.floors,+ gap = isometricBuildDefaults.gap,+}: IsometricBuildProps) {+ const inset = Math.min(0.45, Math.max(0, gap)) / 2;+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const n = Math.max(1, Math.round(grid));+ const blocks = useMemo(+ () => makeBlocks(n, maxHeight, seed, stagger),+ [n, maxHeight, seed, stagger],+ );++ const tallest = maxHeight * 1.35;+ // Fit the diamond plus the tallest tower into the frame.+ const a = Math.min(+ (width * 0.64) / (2 * n),+ (height * 0.8) / (2 * n * ISO_Y + tallest * ISO_Z),+ );+ const b = a * ISO_Y;+ const hz = a * ISO_Z;+ const top = (height - (2 * n * b + tallest * hz)) / 2 + tallest * hz;+ const cx = width / 2;+ const P = (u: number, v: number, z: number) =>+ `${fmt(cx + (u - v) * a)} ${fmt(top + (u + v) * b - z * hz)}`;+ const poly = (...pts: string[]) => `M ${pts.join(" L ")} Z`;++ const unit = Math.min(width, height) / 720;+ const time = frame * speed;++ let ground = "";+ for (let k = 0; k <= n; k++) {+ ground += `M ${P(k, 0, 0)} L ${P(k, n, 0)} M ${P(0, k, 0)} L ${P(n, k, 0)} `;+ }++ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Isometric city build"+ style={{ display: "block" }}+ >+ <path+ d={ground}+ fill="none"+ stroke={color}+ strokeOpacity={0.12}+ strokeWidth={unit}+ />+ {blocks.map((block) => {+ const s = spring({+ frame: time - block.delay,+ fps,+ config: { damping: 11, stiffness: 140, mass: 0.7 },+ });+ const opacity = interpolate(s, [0, 0.15], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ });+ if (opacity <= 0) return null;+ const h = Math.max(0.02, block.height * s);+ const u0 = block.i + inset;+ const u1 = block.i + 1 - inset;+ const v0 = block.j + inset;+ const v1 = block.j + 1 - inset;+ const fill = block.accent ? accent : color;+ const left = poly(+ P(u0, v1, 0),+ P(u1, v1, 0),+ P(u1, v1, h),+ P(u0, v1, h),+ );+ const right = poly(+ P(u1, v0, 0),+ P(u1, v1, 0),+ P(u1, v1, h),+ P(u1, v0, h),+ );+ const roof = poly(+ P(u0, v0, h),+ P(u1, v0, h),+ P(u1, v1, h),+ P(u0, v1, h),+ );+ let lines = "";+ if (floors) {+ for (let z = FLOOR; z < h - FLOOR * 0.5; z += FLOOR) {+ lines += `M ${P(u0, v1, z)} L ${P(u1, v1, z)} L ${P(u1, v0, z)} `;+ }+ }+ return (+ <g key={`${block.i}-${block.j}`} opacity={opacity}>+ <path d={left} fill={fill} />+ <path d={left} fill={background} fillOpacity={SHADE_LEFT} />+ <path d={right} fill={fill} />+ <path d={right} fill={background} fillOpacity={SHADE_RIGHT} />+ {lines ? (+ <path+ d={lines}+ fill="none"+ stroke={background}+ strokeOpacity={0.35}+ strokeWidth={unit * 1.2}+ />+ ) : null}+ <path+ d={roof}+ fill={fill}+ stroke={background}+ strokeOpacity={0.5}+ strokeWidth={unit}+ strokeLinejoin="round"+ />+ </g>+ );+ })}+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/life-grid/config.ts b/registry/remocn/life-grid/config.tsnew file mode 100644index 00000000..a34c3925--- /dev/null+++ b/registry/remocn/life-grid/config.ts@@ -0,0 +1,66 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const lifeGridConfig: ComponentConfig = {+ componentName: "LifeGrid",+ importPath: "@/components/remocn/life-grid",+ controls: {+ cols: {+ type: "number",+ default: 48,+ min: 12,+ max: 96,+ step: 2,+ description: "Columns",+ hiddenFromList: false,+ },+ density: {+ type: "number",+ default: 0.24,+ min: 0.05,+ max: 0.6,+ step: 0.01,+ description: "Density",+ hiddenFromList: false,+ },+ framesPerGeneration: {+ type: "number",+ default: 5,+ min: 1,+ max: 15,+ step: 1,+ description: "Frames per generation",+ hiddenFromList: false,+ },+ gap: {+ type: "number",+ default: 0.16,+ min: 0,+ max: 0.4,+ step: 0.01,+ description: "Gap",+ hiddenFromList: false,+ },+ showGrid: { type: "boolean", default: true, description: "Lattice" },+ seed: {+ type: "number",+ default: 7,+ min: 1,+ max: 50,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Cells" },+ accent: { type: "color", default: "#E5322D", description: "Newborns" },+ },+ durationInFrames: 300,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/life-grid/index.tsx b/registry/remocn/life-grid/index.tsxnew file mode 100644index 00000000..b45a3c4e--- /dev/null+++ b/registry/remocn/life-grid/index.tsx@@ -0,0 +1,178 @@+"use client";++import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type LifeGridProps = {+ /** Columns; rows follow the frame aspect ratio. */+ cols?: number;+ /** Share of cells alive in the seeded first generation, 0 to 1. */+ density?: number;+ /** Frames each generation is held. */+ framesPerGeneration?: number;+ /** Gap between tiles, as a fraction of the cell. */+ gap?: number;+ /** Draw the faint lattice of empty cells. */+ showGrid?: boolean;+ seed?: number;+ speed?: number;+ background?: string;+ /** Living cells. */+ color?: string;+ /** Flash color for newborn cells. */+ accent?: string;+};++export const lifeGridDefaults: Required<LifeGridProps> = {+ cols: 48,+ density: 0.24,+ framesPerGeneration: 5,+ gap: 0.16,+ showGrid: true,+ seed: 7,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+};++const fmt = (n: number) => Math.round(n * 10) / 10;+const grow = Easing.out(Easing.back(2));+const shrink = Easing.in(Easing.cubic);+const settle = Easing.inOut(Easing.cubic);++// Generations are a pure function of the seed and grid size; computed once and+// shared across frames (and component instances) of a render.+const cache = new Map<string, Uint8Array[]>();++function generations(+ cols: number,+ rows: number,+ density: number,+ seed: number,+ count: number,+) {+ const key = `${cols}x${rows}|${density}|${seed}`;+ const known = cache.get(key);+ if (known && known.length >= count) return known;+ const list: Uint8Array[] = known ?? [];+ if (list.length === 0) {+ const first = new Uint8Array(cols * rows);+ for (let i = 0; i < first.length; i++) {+ first[i] = random(`life-grid-${seed}-${i}`) < density ? 1 : 0;+ }+ list.push(first);+ }+ while (list.length < count) {+ const prev = list[list.length - 1];+ const next = new Uint8Array(cols * rows);+ for (let y = 0; y < rows; y++) {+ for (let x = 0; x < cols; x++) {+ let n = 0;+ for (let dy = -1; dy <= 1; dy++) {+ for (let dx = -1; dx <= 1; dx++) {+ if (dx === 0 && dy === 0) continue;+ // Wrap around the edges (torus) so the board never runs dry at the border.+ const xx = (x + dx + cols) % cols;+ const yy = (y + dy + rows) % rows;+ n += prev[yy * cols + xx];+ }+ }+ const alive = prev[y * cols + x] === 1;+ next[y * cols + x] = n === 3 || (alive && n === 2) ? 1 : 0;+ }+ }+ list.push(next);+ }+ if (cache.size > 16) cache.clear();+ cache.set(key, list);+ return list;+}++export function LifeGrid({+ cols = lifeGridDefaults.cols,+ density = lifeGridDefaults.density,+ framesPerGeneration = lifeGridDefaults.framesPerGeneration,+ gap = lifeGridDefaults.gap,+ showGrid = lifeGridDefaults.showGrid,+ seed = lifeGridDefaults.seed,+ speed = lifeGridDefaults.speed,+ background = lifeGridDefaults.background,+ color = lifeGridDefaults.color,+ accent = lifeGridDefaults.accent,+}: LifeGridProps) {+ const frame = useCurrentFrame();+ const { width, height, durationInFrames } = useVideoConfig();+ const nx = Math.max(4, Math.round(cols));+ const ny = Math.max(4, Math.round((nx * height) / width));+ const fpg = Math.max(1, framesPerGeneration);+ const total = Math.ceil((durationInFrames * Math.max(0, speed)) / fpg) + 2;+ const gens = useMemo(+ () => generations(nx, ny, density, seed, total),+ [nx, ny, density, seed, total],+ );++ const cell = Math.min(width / nx, height / ny);+ const ox = (width - cell * nx) / 2;+ const oy = (height - cell * ny) / 2;+ const tile = cell * (1 - gap);++ const time = Math.max(0, frame * speed);+ const g = Math.min(gens.length - 1, Math.floor(time / fpg));+ const local = Math.min(1, (time - g * fpg) / fpg);+ const now = gens[g];+ const before = g > 0 ? gens[g - 1] : now;++ const square = (index: number, size: number) => {+ const x = ox + (index % nx) * cell + (cell - size) / 2;+ const y = oy + Math.floor(index / nx) * cell + (cell - size) / 2;+ const s = fmt(size);+ return `M ${fmt(x)} ${fmt(y)} h ${s} v ${s} h ${-s} Z `;+ };++ const bornSize = tile * (0.35 + 0.65 * grow(local));+ const dyingSize = tile * (1 - shrink(Math.min(1, local * 1.6)));+ let lattice = "";+ let alive = "";+ let fresh = "";+ // Newborns pop in as accent tiles, then a white tile grows from their+ // centre: a crisp flash with no pink cross-fade in between.+ const coreSize =+ tile * settle(Math.min(1, Math.max(0, (local - 0.35) / 0.65)));+ for (let i = 0; i < now.length; i++) {+ if (showGrid) lattice += square(i, tile);+ if (now[i]) {+ if (!before[i] && g > 0) {+ fresh += square(i, bornSize);+ if (coreSize > 0.5) alive += square(i, coreSize);+ } else {+ alive += square(i, tile);+ }+ } else if (before[i] && dyingSize > 0.5) {+ alive += square(i, dyingSize);+ }+ }++ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Game of Life grid"+ style={{ display: "block" }}+ >+ {showGrid ? <path d={lattice} fill={color} fillOpacity={0.05} /> : null}+ <path d={fresh} fill={accent} />+ <path d={alive} fill={color} />+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/light-leak/config.ts b/registry/remocn/light-leak/config.tsnew file mode 100644index 00000000..a405a73b--- /dev/null+++ b/registry/remocn/light-leak/config.ts@@ -0,0 +1,45 @@+import { lightLeakExampleCode } from "@/components/docs/examples/light-leak-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const lightLeakConfig: ComponentConfig = {+ componentName: "lightLeak",+ importPath: "@/components/remocn/light-leak",+ controls: {+ origin: {+ type: "enum",+ default: "left",+ variants: {+ left: {},+ right: {},+ top: {},+ bottom: {},+ },+ description: "Origin",+ },+ intensity: {+ type: "number",+ min: 0,+ max: 1,+ step: 0.05,+ default: 1,+ description: "Intensity",+ hiddenFromList: false,+ },+ leakColor: {+ type: "color",+ default: "#FF5A1F",+ description: "Leak color",+ },+ blowoutColor: {+ type: "color",+ default: "#FFF3E0",+ description: "Blow-out color",+ },+ },+ durationInFrames: 120,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#0a0a0a" },+ snippet: lightLeakExampleCode,+};diff --git a/registry/remocn/light-leak/index.tsx b/registry/remocn/light-leak/index.tsxnew file mode 100644index 00000000..1dfc6f8b--- /dev/null+++ b/registry/remocn/light-leak/index.tsx@@ -0,0 +1,129 @@+"use client";++import type {+ TransitionPresentation,+ TransitionPresentationComponentProps,+} from "@remotion/transitions";+import type React from "react";+import { AbsoluteFill, Easing, interpolate, useVideoConfig } from "remotion";++export type LightLeakOrigin = "left" | "right" | "top" | "bottom";++export type LightLeakProps = {+ /** Leak colors, warmest first. The last one is the blow-out tint. */+ colors?: string[];+ /** Edge the leak drifts in from. */+ origin?: LightLeakOrigin;+ /** Strength of the leak and the blow-out, 0 to 1. */+ intensity?: number;+};++export const lightLeakDefaults: Required<LightLeakProps> = {+ colors: ["#FF5A1F", "#E5322D", "#FFB347", "#FFF3E0"],+ origin: "left",+ intensity: 1,+};++// Each flare: offset along the drift axis, position across it, size, strength.+const FLARES = [+ { along: 0, across: 0.3, size: 0.85, alpha: 1 },+ { along: -0.18, across: 0.78, size: 0.7, alpha: 0.85 },+ { along: 0.12, across: 0.55, size: 0.55, alpha: 0.9 },+ { along: -0.32, across: 0.12, size: 0.6, alpha: 0.7 },+ { along: 0.05, across: 0.95, size: 0.5, alpha: 0.6 },+];+// Heat of the leak: ramps into the cut, then cools off more slowly.+function heat(p: number) {+ if (p <= 0.5) return Easing.in(Easing.quad)(p / 0.5);+ return 1 - Easing.out(Easing.quad)((p - 0.5) / 0.5);+}++function Leak({+ p,+ colors,+ origin,+ intensity,+}: {+ p: number;+ colors: string[];+ origin: LightLeakOrigin;+ intensity: number;+}) {+ const { width, height } = useVideoConfig();+ const k = heat(p) * intensity;+ const span = Math.max(width, height);+ const drift = interpolate(p, [0, 1], [-0.25, 1.05], {+ easing: Easing.bezier(0.3, 0.1, 0.5, 0.9),+ });+ const palette = colors.length > 0 ? colors : lightLeakDefaults.colors;+ const blowout = palette[palette.length - 1];+ // A narrow peak right at the cut takes the frame to near-white.+ const flash = Math.exp(-(((p - 0.5) / 0.1) ** 2)) * intensity;++ return (+ <AbsoluteFill style={{ pointerEvents: "none" }}>+ {FLARES.map((f, i) => {+ let along = drift + f.along;+ if (origin === "right" || origin === "bottom") along = 1 - along;+ const horizontal = origin === "left" || origin === "right";+ const x = (horizontal ? along : f.across) * width;+ const y = (horizontal ? f.across : along) * height;+ const color = palette[i % Math.max(1, palette.length - 1)];+ return (+ <AbsoluteFill+ key={f.across}+ style={{+ mixBlendMode: "screen",+ // sqrt keeps the leak hot as it enters; drift, not fade, sells it.+ opacity: Math.min(1, Math.sqrt(k) * f.alpha * 1.1),+ background: `radial-gradient(circle ${span * f.size}px at ${x}px ${y}px, color-mix(in srgb, ${color} 55%, ${blowout}) 0%, ${color} 22%, color-mix(in srgb, ${color} 55%, transparent) 45%, transparent 72%)`,+ }}+ />+ );+ })}+ <AbsoluteFill+ style={{ backgroundColor: blowout, opacity: Math.min(0.96, flash) }}+ />+ </AbsoluteFill>+ );+}++const LightLeakPresentation: React.FC<+ TransitionPresentationComponentProps<LightLeakProps>+> = ({+ children,+ presentationProgress,+ presentationDirection,+ passedProps,+}) => {+ const { colors, origin, intensity } = {+ ...lightLeakDefaults,+ ...passedProps,+ };+ const p = presentationProgress;+ const k = heat(p) * intensity;+ // Hard cut under the blow-out: the incoming scene owns the frame from 0.5.+ const visible = presentationDirection === "exiting" ? p < 0.5 : p >= 0.5;++ return (+ <AbsoluteFill style={{ opacity: visible ? 1 : 0 }}>+ <AbsoluteFill+ style={{+ // Squared so the picture only burns out close to the cut.+ filter: `brightness(${1 + k * k * 1.6}) saturate(${1 + k * 0.4})`,+ }}+ >+ {children}+ </AbsoluteFill>+ {visible && k > 0.001 ? (+ <Leak p={p} colors={colors} origin={origin} intensity={intensity} />+ ) : null}+ </AbsoluteFill>+ );+};++export function lightLeak(+ props: LightLeakProps = {},+): TransitionPresentation<LightLeakProps> {+ return { component: LightLeakPresentation, props };+}diff --git a/registry/remocn/line-boil/config.ts b/registry/remocn/line-boil/config.tsnew file mode 100644index 00000000..311a8d24--- /dev/null+++ b/registry/remocn/line-boil/config.ts@@ -0,0 +1,67 @@+import { lineBoilExampleCode } from "@/components/docs/examples/line-boil-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const lineBoilConfig: ComponentConfig = {+ componentName: "LineBoil",+ importPath: "@/components/remocn/line-boil",+ controls: {+ boilEvery: {+ type: "number",+ default: 3,+ min: 1,+ max: 8,+ step: 1,+ description: "Boil every",+ hiddenFromList: false,+ },+ drawings: {+ type: "number",+ default: 3,+ min: 1,+ max: 8,+ step: 1,+ description: "Drawings",+ hiddenFromList: false,+ },+ amplitude: {+ type: "number",+ default: 1,+ min: 0,+ max: 3,+ step: 0.1,+ description: "Wobble",+ hiddenFromList: false,+ },+ strokeWidth: {+ type: "number",+ default: 9,+ min: 2,+ max: 24,+ step: 1,+ description: "Line weight",+ hiddenFromList: false,+ },+ size: {+ type: "number",+ default: 0.66,+ min: 0.2,+ max: 0.9,+ step: 0.02,+ description: "Size",+ hiddenFromList: false,+ },+ line: { type: "color", default: "#111111", description: "Line" },+ fill: { type: "color", default: "#E5322D", description: "Fill" },+ background: {+ type: "color",+ default: "#FFFFFF",+ description: "Background",+ },+ },+ durationInFrames: 90,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#FFFFFF" },+ snippet: lineBoilExampleCode,+};diff --git a/registry/remocn/line-boil/index.tsx b/registry/remocn/line-boil/index.tsxnew file mode 100644index 00000000..432968e8--- /dev/null+++ b/registry/remocn/line-boil/index.tsx@@ -0,0 +1,214 @@+"use client";++import { getLength, getPointAtLength } from "@remotion/paths";+import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type LineBoilColors = {+ line: string;+ fill: string;+ background: string;+};++export type LineBoilProps = {+ /** Closed outline as SVG path data, any coordinate space. Fitted to the frame. Defaults to a 5-point star. */+ path?: string;+ /** Frames each drawing holds before the next one ("on threes" by default). */+ boilEvery?: number;+ /** Distinct drawings the boil cycles through. */+ drawings?: number;+ /** Wobble strength; 1 is a gentle hand-drawn boil. */+ amplitude?: number;+ /** Base line weight in px at 720p. */+ strokeWidth?: number;+ /** Shape size as a fraction of the short frame side. */+ size?: number;+ colors?: Partial<LineBoilColors>;+ /** Outline color. Overrides `colors.line` when set. */+ line?: string;+ /** Shape fill. Overrides `colors.fill` when set. */+ fill?: string;+ /** Background. Overrides `colors.background` when set. */+ background?: string;+ speed?: number;+};++const starPath = (() => {+ const points = Array.from({ length: 10 }, (_, i) => {+ const r = i % 2 === 0 ? 100 : 40;+ const a = (-90 + i * 36) * (Math.PI / 180);+ return `${(100 + r * Math.cos(a)).toFixed(2)} ${(100 + r * Math.sin(a)).toFixed(2)}`;+ });+ return `M ${points.join(" L ")} Z`;+})();++export const lineBoilDefaults = {+ path: starPath,+ boilEvery: 3,+ drawings: 3,+ amplitude: 1,+ strokeWidth: 9,+ size: 0.66,+ colors: {+ line: "#111111",+ fill: "#E5322D",+ background: "#FFFFFF",+ } as LineBoilColors,+ speed: 1,+};++const SAMPLES = 160;+const DRAW_END = 22;+const FILL_START = 28;+const FILL_END = 40;+export const lineBoilLength = FILL_END;++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++type Point = { x: number; y: number };++// Low-frequency integer harmonics keep the closed loop seamless while giving+// the slow, rubbery wobble of a re-traced cel line.+function boil(points: Point[], seed: string, amp: number): Point[] {+ const harmonics = [2, 4, 9, 15].map((k, j) => ({+ k,+ weight: [1, 0.7, 0.45, 0.3][j],+ px: random(`${seed}-px-${k}`) * Math.PI * 2,+ py: random(`${seed}-py-${k}`) * Math.PI * 2,+ }));+ return points.map((p, i) => {+ const s = i / points.length;+ let dx = 0;+ let dy = 0;+ for (const h of harmonics) {+ dx += h.weight * Math.sin(Math.PI * 2 * h.k * s + h.px);+ dy += h.weight * Math.sin(Math.PI * 2 * h.k * s + h.py);+ }+ const nx = random(`${seed}-nx-${i}`) - 0.5;+ const ny = random(`${seed}-ny-${i}`) - 0.5;+ return {+ x: p.x + amp * (dx * 0.6 + nx * 0.14),+ y: p.y + amp * (dy * 0.6 + ny * 0.14),+ };+ });+}++export function LineBoil({+ path = lineBoilDefaults.path,+ boilEvery = lineBoilDefaults.boilEvery,+ drawings = lineBoilDefaults.drawings,+ amplitude = lineBoilDefaults.amplitude,+ strokeWidth = lineBoilDefaults.strokeWidth,+ size = lineBoilDefaults.size,+ colors,+ line: lineColor,+ fill: fillColor,+ background: backgroundColor,+ speed = lineBoilDefaults.speed,+}: LineBoilProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const merged = { ...lineBoilDefaults.colors, ...colors };+ const palette: LineBoilColors = {+ line: lineColor ?? merged.line,+ fill: fillColor ?? merged.fill,+ background: backgroundColor ?? merged.background,+ };+ const t = (frame / fps) * 30 * speed;+ const unit = Math.min(width, height) / 720;++ const base = useMemo(() => {+ const length = getLength(path);+ const raw = Array.from(+ { length: SAMPLES },+ (_, i) =>+ getPointAtLength(path, (length * i) / SAMPLES) ?? { x: 0, y: 0 },+ );+ const xs = raw.map((p) => p.x);+ const ys = raw.map((p) => p.y);+ const minX = Math.min(...xs);+ const minY = Math.min(...ys);+ const bw = Math.max(...xs) - minX;+ const bh = Math.max(...ys) - minY;+ const scale = (size * Math.min(width, height)) / Math.max(bw, bh, 1e-6);+ const ox = width / 2 - (bw * scale) / 2;+ const oy = height / 2 - (bh * scale) / 2;+ return raw.map((p) => ({+ x: ox + (p.x - minX) * scale,+ y: oy + (p.y - minY) * scale,+ }));+ }, [path, size, width, height]);++ const drawing =+ Math.floor(t / Math.max(1, boilEvery)) % Math.max(1, drawings);+ const amp = amplitude * 6.5 * unit;+ const line = boil(base, `line-boil-${drawing}`, amp);+ const fillShape = boil(base, `line-boil-fill-${drawing}`, amp * 1.4);++ const draw = interpolate(t, [0, DRAW_END], [0, 1], {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });+ const visible = Math.round(draw * SAMPLES);+ const fill = interpolate(t, [FILL_START, FILL_END], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.back(1.6)),+ });++ const cx = base.reduce((sum, p) => sum + p.x, 0) / base.length;+ const cy = base.reduce((sum, p) => sum + p.y, 0) / base.length;+ const pressurePhase = random(`line-boil-pressure-${drawing}`) * Math.PI * 2;++ return (+ <AbsoluteFill style={{ backgroundColor: palette.background }}>+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Boiling hand-drawn outline"+ >+ {fill > 0 ? (+ <polygon+ points={fillShape.map((p) => `${p.x},${p.y}`).join(" ")}+ fill={palette.fill}+ transform={`translate(${cx} ${cy}) scale(${fill}) translate(${-cx} ${-cy})`}+ />+ ) : null}+ <g stroke={palette.line} strokeLinecap="round" fill="none">+ {line.slice(0, visible).map((p, i) => {+ const next = line[(i + 1) % line.length];+ const s = i / SAMPLES;+ const pressure =+ 0.75 ++ 0.25 * Math.sin(Math.PI * 2 * 3 * s + pressurePhase) ++ 0.12 * Math.sin(Math.PI * 2 * 7 * s - pressurePhase);+ // Taper the pen in and out while the line is still being drawn.+ const taper =+ draw < 1 ? Math.min(1, (visible - i) / 10, (i + 4) / 10) : 1;+ return (+ <line+ key={i}+ x1={p.x}+ y1={p.y}+ x2={next.x}+ y2={next.y}+ strokeWidth={strokeWidth * unit * pressure * taper}+ />+ );+ })}+ </g>+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/liquid-fill/config.ts b/registry/remocn/liquid-fill/config.tsnew file mode 100644index 00000000..17239e87--- /dev/null+++ b/registry/remocn/liquid-fill/config.ts@@ -0,0 +1,23 @@+import { liquidFillExampleCode } from "@/components/docs/examples/liquid-fill-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const liquidFillConfig: ComponentConfig = {+ componentName: "LiquidFill",+ importPath: "@/components/remocn/liquid-fill",+ controls: {+ liquidColor: { type: "color", default: "#E5322D", description: "Liquid" },+ outlineColor: { type: "color", default: "#FFFFFF", description: "Outline" },+ bubbleColor: { type: "color", default: "#FFFFFF", description: "Bubbles" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 78,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: liquidFillExampleCode,+};diff --git a/registry/remocn/liquid-fill/index.tsx b/registry/remocn/liquid-fill/index.tsxnew file mode 100644index 00000000..1632d372--- /dev/null+++ b/registry/remocn/liquid-fill/index.tsx@@ -0,0 +1,203 @@+"use client";++import type React from "react";+import { useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ interpolateColors,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type LiquidFillProps = {+ /** Wordmark revealed beside the mark once it is full. */+ children?: React.ReactNode;+ /** Mark outline as SVG path data inside a 100x100 box. Defaults to a rounded square. */+ shape?: string;+ backgroundColor?: string;+ liquidColor?: string;+ outlineColor?: string;+ /** Bubble outline color. */+ bubbleColor?: string;+ speed?: number;+};++const ROUNDED_SQUARE =+ "M 27 2 H 73 A 25 25 0 0 1 98 27 V 73 A 25 25 0 0 1 73 98 H 27 A 25 25 0 0 1 2 73 V 27 A 25 25 0 0 1 27 2 Z";++export const liquidFillDefaults = {+ shape: ROUNDED_SQUARE,+ backgroundColor: "#111111",+ liquidColor: "#E5322D",+ outlineColor: "#FFFFFF",+ bubbleColor: "#FFFFFF",+ speed: 1,+};++const LAND = 9;+const FULL = 34;+const SLIDE = 36;+const BUBBLES = 6;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++export function LiquidFill(props: LiquidFillProps) {+ const {+ children,+ shape,+ backgroundColor,+ liquidColor,+ outlineColor,+ bubbleColor,+ speed,+ } = { ...liquidFillDefaults, ...props };+ const uid = `liquid-fill-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const t = frame * Math.max(0, speed);+ const size = Math.round(Math.min(width, height) * 0.24);++ // Drop falls from above the mark and lands on the floor of the shape.+ const fall = interpolate(t, [0, LAND], [0, 1], {+ ...clamp,+ easing: Easing.in(Easing.quad),+ });+ const dropY = -70 + fall * 142;+ const dropStretch = 1 + 0.5 * fall;++ const level = interpolate(t, [LAND, FULL], [100, -12], {+ ...clamp,+ easing: Easing.bezier(0.35, 0, 0.35, 1),+ });+ const since = Math.max(0, t - LAND);+ const amp =+ t < LAND+ ? 0+ : 7 * Math.exp(-since / 10) * (1 - (t - LAND) / (FULL - LAND + 6));+ const splash = t < LAND ? 0 : 14 * Math.exp(-since / 3.5);+ const surface = (x: number) =>+ level ++ Math.max(0, amp) *+ (Math.sin(x * 0.09 + since * 0.7) ++ 0.45 * Math.sin(x * 0.17 - since * 0.95 + 1.3)) -+ splash * Math.exp(-(((x - 50) / 10) ** 2)) ++ splash * 0.35 * Math.exp(-(((x - 50) / 26) ** 2));+ const xs = Array.from({ length: 27 }, (_, i) => -4 + i * 4.3);+ const wave = xs.map((x) => `${x.toFixed(2)} ${surface(x).toFixed(2)}`);+ const liquidPath = `M ${wave.join(" L ")} L 110 110 L -10 110 Z`;+ const meniscusPath = `M ${wave.join(" L ")}`;++ const solid = interpolate(t, [FULL - 2, FULL + 3], [0, 1], clamp);+ const stroke = interpolateColors(solid, [0, 1], [outlineColor, liquidColor]);++ const slide = interpolate(t, [SLIDE, SLIDE + 11], [0, 1], {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });+ const reveal = interpolate(t, [SLIDE + 2, SLIDE + 13], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const outlineIn = interpolate(t, [0, 5], [0, 1], clamp);++ return (+ <AbsoluteFill+ style={{+ backgroundColor,+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ display: "flex",+ alignItems: "center",+ gap: size * 0.24,+ transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,+ }}+ >+ <svg+ width={size}+ height={size}+ viewBox="0 0 100 100"+ style={{ flexShrink: 0, overflow: "visible" }}+ >+ <defs>+ <clipPath id={`${uid}-clip`}>+ <path d={shape} />+ </clipPath>+ </defs>+ {t < LAND + 1 && (+ <path+ d="M 0 -7 C 3 -2 5 1 5 4 A 5 5 0 0 1 -5 4 C -5 1 -3 -2 0 -7 Z"+ fill={liquidColor}+ transform={`translate(50 ${dropY}) scale(${1.6 / Math.sqrt(dropStretch)} ${1.6 * dropStretch})`}+ opacity={interpolate(+ t,+ [0, 2, LAND, LAND + 1],+ [0, 1, 1, 0],+ clamp,+ )}+ />+ )}+ <g clipPath={`url(#${uid}-clip)`}>+ {t >= LAND && <path d={liquidPath} fill={liquidColor} />}+ {t >= LAND && solid < 1 && (+ <path+ d={meniscusPath}+ fill="none"+ stroke="#FFFFFF"+ strokeOpacity={0.35 * (1 - solid)}+ strokeWidth={1.4}+ />+ )}+ {Array.from({ length: BUBBLES }, (_, i) => {+ const start = LAND + 2 + random(`liquid-fill-b-${i}`) * 16;+ const age = t - start;+ if (age < 0) return null;+ const bx = 20 + random(`liquid-fill-x-${i}`) * 60;+ const by = 98 - age * (2.4 + random(`liquid-fill-v-${i}`) * 2);+ const r = 1.2 + random(`liquid-fill-r-${i}`) * 2;+ if (by < surface(bx) + r + 1) return null;+ return (+ <circle+ key={i}+ cx={bx + Math.sin(age * 0.6 + i) * 1.5}+ cy={by}+ r={r}+ fill="none"+ stroke={bubbleColor}+ strokeOpacity={0.7 * (1 - solid)}+ strokeWidth={0.8}+ />+ );+ })}+ </g>+ <path+ d={shape}+ fill="none"+ stroke={stroke}+ strokeWidth={3}+ opacity={outlineIn}+ />+ </svg>+ {children && (+ <div+ style={{+ opacity: reveal,+ clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,+ transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,+ }}+ >+ {children}+ </div>+ )}+ </div>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/long-shadow/config.ts b/registry/remocn/long-shadow/config.tsnew file mode 100644index 00000000..e5fb29e0--- /dev/null+++ b/registry/remocn/long-shadow/config.ts@@ -0,0 +1,52 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const longShadowConfig: ComponentConfig = {+ componentName: "LongShadow",+ importPath: "@/components/remocn/long-shadow",+ controls: {+ angleFrom: {+ type: "number",+ default: 45,+ min: 0,+ max: 360,+ step: 5,+ description: "Start angle",+ hiddenFromList: false,+ },+ angleTo: {+ type: "number",+ default: 135,+ min: 0,+ max: 360,+ step: 5,+ description: "End angle",+ hiddenFromList: false,+ },+ fade: {+ type: "number",+ default: 0,+ min: 0,+ max: 1,+ step: 0.05,+ description: "Fade",+ hiddenFromList: false,+ },+ shadowColor: {+ type: "color",+ default: "#ECEAE6",+ description: "Shadow",+ },+ background: {+ type: "color",+ default: "#FFFFFF",+ description: "Background",+ },+ iconColor: { type: "color", default: "#E5322D", description: "Badge" },+ checkColor: { type: "color", default: "#FFFFFF", description: "Check" },+ },+ durationInFrames: 70,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#FFFFFF" },+};diff --git a/registry/remocn/long-shadow/index.tsx b/registry/remocn/long-shadow/index.tsxnew file mode 100644index 00000000..8bc26f9f--- /dev/null+++ b/registry/remocn/long-shadow/index.tsx@@ -0,0 +1,196 @@+"use client";++import { type ReactNode, useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type LongShadowProps = {+ /** Flat icon or mark that casts the shadow. Defaults to a red check badge. */+ children?: ReactNode;+ /** Shadow direction in degrees at the start (0 = right, 90 = down). */+ angleFrom?: number;+ /** Shadow direction after the light swings. */+ angleTo?: number;+ shadowColor?: string;+ background?: string;+ /** Fade the shadow toward its far end, 0 to 1. */+ fade?: number;+ /** Colors of the default badge. */+ iconColor?: string;+ checkColor?: string;+ speed?: number;+};++export const longShadowDefaults = {+ angleFrom: 45,+ angleTo: 135,+ shadowColor: "#ECEAE6",+ background: "#FFFFFF",+ fade: 0,+ iconColor: "#E5322D",+ checkColor: "#FFFFFF",+ speed: 1,+};++export const longShadowLength = 48;++// Log-doubling extrusion: each pass unions the silhouette with itself shifted by+// twice the previous distance, so 10 passes stack 1024 copies.+const PASSES = 10;+const COPIES = 2 ** PASSES - 1;++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++function Badge({+ size,+ iconColor,+ checkColor,+}: {+ size: number;+ iconColor: string;+ checkColor: string;+}) {+ return (+ <svg width={size} height={size} viewBox="0 0 100 100" aria-hidden>+ <circle cx={50} cy={50} r={49} fill={iconColor} />+ <path+ d="M 29 52 L 44 66 L 72 36"+ fill="none"+ stroke={checkColor}+ strokeWidth={11}+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ );+}++export function LongShadow({+ children,+ angleFrom = longShadowDefaults.angleFrom,+ angleTo = longShadowDefaults.angleTo,+ shadowColor = longShadowDefaults.shadowColor,+ background = longShadowDefaults.background,+ fade = longShadowDefaults.fade,+ iconColor = longShadowDefaults.iconColor,+ checkColor = longShadowDefaults.checkColor,+ speed = longShadowDefaults.speed,+}: LongShadowProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const t = (frame / fps) * 30 * speed;+ const unit = Math.min(width, height) / 720;++ const pop = spring({+ frame: t,+ fps: 30,+ config: { damping: 13, stiffness: 170, mass: 0.8 },+ });+ const grow = interpolate(t, [7, 22], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const swing = spring({+ frame: t - 24,+ fps: 30,+ config: { damping: 11, stiffness: 70, mass: 0.9 },+ });+ const angle = angleFrom + (angleTo - angleFrom) * swing;+ const rad = (angle * Math.PI) / 180;+ const length = Math.hypot(width, height) * grow;+ const step = length / COPIES;+ const dx = Math.cos(rad) * step;+ const dy = Math.sin(rad) * step;++ const content = children ?? (+ <Badge+ size={Math.min(width, height) * 0.34}+ iconColor={iconColor}+ checkColor={checkColor}+ />+ );+ const mask =+ fade > 0+ ? `linear-gradient(${angle + 90}deg, #000 50%, rgba(0,0,0,${1 - Math.min(1, fade)}) 100%)`+ : undefined;++ return (+ <AbsoluteFill style={{ backgroundColor: background, overflow: "hidden" }}>+ <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>+ <filter+ id={`${id}-extrude`}+ x="0"+ y="0"+ width="1"+ height="1"+ colorInterpolationFilters="sRGB"+ >+ <feColorMatrix+ in="SourceAlpha"+ type="matrix"+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 3 0"+ result="m0"+ />+ {Array.from({ length: PASSES }, (_, i) => (+ <feOffset+ key={`o${i}`}+ in={`m${i}`}+ dx={dx * 2 ** i}+ dy={dy * 2 ** i}+ result={`o${i}`}+ />+ )).flatMap((offset, i) => [+ offset,+ <feMerge key={`m${i}`} result={`m${i + 1}`}>+ <feMergeNode in={`m${i}`} />+ <feMergeNode in={`o${i}`} />+ </feMerge>,+ ])}+ {/* feOffset snaps to whole pixels; a hair of blur hides the steps. */}+ <feGaussianBlur+ in={`m${PASSES}`}+ stdDeviation={0.8 * unit}+ result="soft"+ />+ <feFlood floodColor={shadowColor} />+ <feComposite in2="soft" operator="in" />+ </filter>+ </svg>+ <AbsoluteFill+ style={{+ transform: `scale(${pop})`,+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <AbsoluteFill+ style={{+ alignItems: "center",+ justifyContent: "center",+ filter: `url(#${id}-extrude)`,+ opacity: grow > 0 ? 1 : 0,+ maskImage: mask,+ WebkitMaskImage: mask,+ }}+ >+ {content}+ </AbsoluteFill>+ <AbsoluteFill+ style={{ alignItems: "center", justifyContent: "center" }}+ >+ {content}+ </AbsoluteFill>+ </AbsoluteFill>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/neon-sign/config.ts b/registry/remocn/neon-sign/config.tsnew file mode 100644index 00000000..aee0e70e--- /dev/null+++ b/registry/remocn/neon-sign/config.ts@@ -0,0 +1,49 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const neonSignConfig: ComponentConfig = {+ componentName: "NeonSign",+ importPath: "@/components/remocn/neon-sign",+ controls: {+ strokeWidth: {+ type: "number",+ default: 6,+ min: 2,+ max: 14,+ step: 1,+ description: "Tube width",+ hiddenFromList: false,+ },+ fit: {+ type: "number",+ default: 0.62,+ min: 0.3,+ max: 0.9,+ step: 0.01,+ description: "Fit",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 7,+ min: 1,+ max: 99,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ color: { type: "color", default: "#E5322D", description: "Tube" },+ glowColor: { type: "color", default: "#E5322D", description: "Glow" },+ tubeColor: { type: "color", default: "#2A2A2A", description: "Unlit tube" },+ coreColor: { type: "color", default: "#FFFFFF", description: "Core" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 70,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/neon-sign/index.tsx b/registry/remocn/neon-sign/index.tsxnew file mode 100644index 00000000..6a26fa5e--- /dev/null+++ b/registry/remocn/neon-sign/index.tsx@@ -0,0 +1,216 @@+"use client";++import { getBoundingBox, getSubpaths } from "@remotion/paths";+import { useId, useMemo } from "react";+import {+ AbsoluteFill,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type NeonSignProps = {+ /** SVG path data for the tube. Each subpath (M command) flickers on its own. */+ path?: string;+ /** viewBox for the path. Defaults to the path's bounding box. */+ viewBox?: string;+ /** Tube color when lit. */+ color?: string;+ /** Color of the halo and the glow on the wall. */+ glowColor?: string;+ /** Unlit glass tube. */+ tubeColor?: string;+ /** Color of the hot core inside the tube. */+ coreColor?: string;+ backgroundColor?: string;+ /** Tube thickness in path units. */+ strokeWidth?: number;+ /** Share of the frame width the sign spans. */+ fit?: number;+ seed?: number;+ speed?: number;+};++// Handwritten "hello" with an underline swash, one subpath per tube.+const HELLO = [+ "M 30 132 C 52 112 74 70 70 46 C 67 28 50 30 47 52 C 44 76 42 112 40 140 C 46 116 58 100 72 100 C 86 100 84 122 86 134 C 88 144 100 144 110 132",+ "M 110 132 C 124 124 142 110 136 98 C 130 88 112 96 112 116 C 112 138 134 146 156 130",+ "M 156 130 C 176 110 196 66 190 46 C 186 32 170 36 168 60 C 166 90 168 126 172 136 C 176 146 188 142 196 132",+ "M 196 132 C 216 110 232 66 226 46 C 222 32 206 36 204 60 C 202 90 204 126 208 136 C 212 146 224 142 232 132",+ "M 232 132 C 238 116 248 100 262 100 C 278 100 280 124 268 136 C 256 146 242 136 248 118 C 252 106 268 104 290 104",+ "M 52 170 C 120 160 210 162 296 152",+].join(" ");++export const neonSignDefaults = {+ path: HELLO,+ color: "#E5322D",+ glowColor: "#E5322D",+ tubeColor: "#2A2A2A",+ coreColor: "#FFFFFF",+ backgroundColor: "#111111",+ strokeWidth: 6,+ fit: 0.62,+ seed: 7,+ speed: 1,+};++const FIRST = 3;+const STEP = 3.4;+const STUTTER = 7;+// Whole sign drops out once after everything is lit, then holds.+const BUZZ: [number, number][] = [+ [29, 0.1],+ [30, 0],+ [31, 0.55],+ [32, 0.2],+];+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++function segmentLevel(t: number, i: number, seed: number) {+ const onset = FIRST + i * STEP + random(`neon-sign-${seed}-${i}`) * 2;+ if (t < onset) return 0;+ if (t < onset + STUTTER) {+ const tick = Math.floor(t);+ const v = random(`neon-sign-${seed}-${i}-${tick}`);+ const ramp = (t - onset) / STUTTER;+ return v < 0.5 - ramp * 0.3 ? 0.04 : 0.55 + 0.45 * v;+ }+ return 1;+}++export function NeonSign(props: NeonSignProps) {+ const {+ path,+ viewBox,+ color,+ glowColor,+ tubeColor,+ coreColor,+ backgroundColor,+ strokeWidth,+ fit,+ seed,+ speed,+ } = { ...neonSignDefaults, ...props };+ const uid = `neon-sign-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const t = frame * Math.max(0, speed);++ const segments = useMemo(() => getSubpaths(path), [path]);+ const box = useMemo(() => {+ if (viewBox) {+ const [x, y, w, h] = viewBox.split(/[\s,]+/).map(Number);+ return { x, y, w, h };+ }+ const b = getBoundingBox(path);+ const pad = strokeWidth * 6;+ return {+ x: b.x1 - pad,+ y: b.y1 - pad,+ w: b.width + pad * 2,+ h: b.height + pad * 2,+ };+ }, [path, viewBox, strokeWidth]);++ const tick = Math.floor(t);+ const buzz = BUZZ.find(([f]) => f === tick)?.[1] ?? 1;+ const levels = segments.map((_, i) => segmentLevel(t, i, seed) * buzz);+ const average =+ levels.reduce((a, b) => a + b, 0) / Math.max(1, levels.length);++ const scale = Math.min((width * fit) / box.w, (height * 0.7) / box.h);+ const drawW = box.w * scale;+ const drawH = box.h * scale;+ const settle = interpolate(t, [32, 40], [0.85, 1], clamp);++ return (+ <AbsoluteFill style={{ backgroundColor }}>+ <AbsoluteFill+ style={{+ background: `radial-gradient(ellipse ${drawW * 0.75}px ${drawH * 0.85}px at 50% 50%, ${glowColor} 0%, transparent 100%)`,+ opacity: 0.28 * average * settle,+ }}+ />+ <AbsoluteFill style={{ alignItems: "center", justifyContent: "center" }}>+ <svg+ width={drawW}+ height={drawH}+ viewBox={`${box.x} ${box.y} ${box.w} ${box.h}`}+ style={{ overflow: "visible" }}+ >+ <defs>+ <filter+ id={`${uid}-wide`}+ filterUnits="userSpaceOnUse"+ x={box.x - box.w}+ y={box.y - box.h}+ width={box.w * 3}+ height={box.h * 3}+ >+ <feGaussianBlur stdDeviation={strokeWidth * 2.2} />+ </filter>+ <filter+ id={`${uid}-near`}+ filterUnits="userSpaceOnUse"+ x={box.x - box.w}+ y={box.y - box.h}+ width={box.w * 3}+ height={box.h * 3}+ >+ <feGaussianBlur stdDeviation={strokeWidth * 0.6} />+ </filter>+ </defs>+ <g fill="none" strokeLinecap="round" strokeLinejoin="round">+ {segments.map((d, i) => (+ <path+ key={`tube-${i}`}+ d={d}+ stroke={tubeColor}+ strokeWidth={strokeWidth}+ />+ ))}+ {segments.map((d, i) => {+ const level = levels[i];+ if (level <= 0) return null;+ return (+ <g key={`lit-${i}`}>+ <path+ d={d}+ stroke={glowColor}+ strokeWidth={strokeWidth * 3}+ opacity={0.7 * level}+ filter={`url(#${uid}-wide)`}+ />+ <path+ d={d}+ stroke={color}+ strokeWidth={strokeWidth * 1.6}+ opacity={0.9 * level}+ filter={`url(#${uid}-near)`}+ />+ <path+ d={d}+ stroke={color}+ strokeWidth={strokeWidth}+ opacity={level}+ />+ <path+ d={d}+ stroke={coreColor}+ strokeWidth={strokeWidth * 0.36}+ opacity={0.9 * level}+ />+ </g>+ );+ })}+ </g>+ </svg>+ </AbsoluteFill>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/orbit-lock/config.ts b/registry/remocn/orbit-lock/config.tsnew file mode 100644index 00000000..4f0e3bbd--- /dev/null+++ b/registry/remocn/orbit-lock/config.ts@@ -0,0 +1,41 @@+import { orbitLockExampleCode } from "@/components/docs/examples/orbit-lock-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const orbitLockConfig: ComponentConfig = {+ componentName: "OrbitLock",+ importPath: "@/components/remocn/orbit-lock",+ controls: {+ moons: {+ type: "number",+ default: 3,+ min: 1,+ max: 8,+ step: 1,+ description: "Moons",+ hiddenFromList: false,+ },+ tilt: {+ type: "number",+ default: 64,+ min: 0,+ max: 85,+ step: 1,+ description: "Orbit tilt",+ hiddenFromList: false,+ },+ coreColor: { type: "color", default: "#E5322D", description: "Core" },+ moonColor: { type: "color", default: "#FFFFFF", description: "Moons" },+ flashColor: { type: "color", default: "#FFFFFF", description: "Flash" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 78,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: orbitLockExampleCode,+};diff --git a/registry/remocn/orbit-lock/index.tsx b/registry/remocn/orbit-lock/index.tsxnew file mode 100644index 00000000..a219ac74--- /dev/null+++ b/registry/remocn/orbit-lock/index.tsx@@ -0,0 +1,305 @@+"use client";++import type React from "react";+import { useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ interpolateColors,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type OrbitLockProps = {+ /** Lockup revealed after the moons collide with the core. Falls back to a placeholder "remocn" lockup. */+ children?: React.ReactNode;+ /** Number of moons orbiting the core. */+ moons?: number;+ backgroundColor?: string;+ coreColor?: string;+ moonColor?: string;+ /** Ring flash released on impact. */+ flashColor?: string;+ /** Orbit tilt in degrees: 0 is a flat circle, 80 is nearly edge-on. */+ tilt?: number;+ speed?: number;+};++export const orbitLockDefaults = {+ moons: 3,+ backgroundColor: "#111111",+ coreColor: "#E5322D",+ moonColor: "#FFFFFF",+ flashColor: "#FFFFFF",+ tilt: 64,+ speed: 1,+};++const IMPACT = 30;+const TURNS = 1.9;+const TRAIL = 10;+const TRAIL_STEP = 0.4;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++type Moon = { x: number; y: number; z: number };++function moonAt(+ t: number,+ index: number,+ count: number,+ outer: number,+ inner: number,+ tilt: number,+): Moon {+ const p = Math.min(1, Math.max(0, t / IMPACT));+ // Orbit radius collapses late; angular speed ramps up as it tightens.+ const r = inner + (outer - inner) * (1 - Easing.in(Easing.cubic)(p));+ const theta =+ (index / count) * Math.PI * 2 ++ Math.PI * 2 * TURNS * Easing.in(Easing.quad)(p);+ const plane = (index / count) * Math.PI + Math.PI / 9;+ const lx = r * Math.cos(theta);+ const ly = r * Math.sin(theta) * Math.cos(tilt);+ return {+ x: lx * Math.cos(plane) - ly * Math.sin(plane),+ y: lx * Math.sin(plane) + ly * Math.cos(plane),+ z: r * Math.sin(theta) * Math.sin(tilt),+ };+}++const PLACEHOLDER_FONT =+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif";++// Neutral lockup shown when no children are passed.+function PlaceholderLockup({+ mark,+ dot,+ text,+ scale = 1,+}: {+ mark: string;+ dot: string;+ text: string;+ scale?: number;+}) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 * scale }}>+ <div+ style={{+ width: 120 * scale,+ height: 120 * scale,+ borderRadius: 32 * scale,+ backgroundColor: mark,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36 * scale,+ height: 36 * scale,+ borderRadius: "50%",+ backgroundColor: dot,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: PLACEHOLDER_FONT,+ fontSize: 104 * scale,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: text,+ }}+ >+ remocn+ </span>+ </div>+ );+}++export function OrbitLock(props: OrbitLockProps) {+ const {+ children,+ moons,+ backgroundColor,+ coreColor,+ moonColor,+ flashColor,+ tilt,+ speed,+ } = { ...orbitLockDefaults, ...props };+ const uid = `orbit-lock-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const t = frame * Math.max(0, speed);+ const s = Math.min(width, height);+ const cx = width / 2;+ const cy = height / 2;+ const count = Math.max(1, Math.round(moons));+ const tiltRad = (Math.min(85, Math.max(0, tilt)) * Math.PI) / 180;++ const core = s * 0.055;+ const outer = s * 0.36;+ const moonR = s * 0.02;+ const p = Math.min(1, t / IMPACT);++ const corePulse = 1 + 0.3 * p ** 4;+ const burst = interpolate(t, [IMPACT, IMPACT + 2, IMPACT + 6], [1, 1.6, 0], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const coreScale = t < IMPACT ? corePulse : corePulse * burst;+ const coreFill = interpolateColors(+ t,+ [IMPACT - 2, IMPACT + 1],+ [coreColor, flashColor],+ );++ const ring = interpolate(t, [IMPACT, IMPACT + 16], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const ringVisible = t >= IMPACT && ring < 1;+ const orbitOpacity = interpolate(+ t,+ [0, 6, IMPACT - 4, IMPACT],+ [0, 0.16, 0.1, 0],+ clamp,+ );+ const orbitR = core + (outer - core) * (1 - Easing.in(Easing.cubic)(p));++ const pop = spring({+ frame: t - IMPACT - 3,+ fps,+ config: { damping: 11, stiffness: 170, mass: 0.7 },+ });++ const bodies = Array.from({ length: count }, (_, i) => {+ const head = moonAt(t, i, count, outer, core, tiltRad);+ const trail = Array.from({ length: TRAIL }, (_, k) =>+ moonAt(t - (k + 1) * TRAIL_STEP, i, count, outer, core, tiltRad),+ );+ return { i, head, trail };+ });+ const showMoons = t < IMPACT && t >= 0;+ const appear = interpolate(t, [0, 5], [0, 1], clamp);++ const renderMoon = ({ i, head, trail }: (typeof bodies)[number]) => {+ const depth = 1 + (0.18 * head.z) / outer;+ const points = [head, ...trail];+ // Tapered ribbon through the recent positions, fading toward the tail.+ const left: string[] = [];+ const right: string[] = [];+ points.forEach((pt, k) => {+ const prev = points[Math.max(0, k - 1)];+ const next = points[Math.min(points.length - 1, k + 1)];+ const dx = prev.x - next.x;+ const dy = prev.y - next.y;+ const len = Math.hypot(dx, dy) || 1;+ const half = moonR * depth * 0.9 * (1 - k / points.length);+ const nx = (-dy / len) * half;+ const ny = (dx / len) * half;+ left.push(`${cx + pt.x + nx},${cy + pt.y + ny}`);+ right.unshift(`${cx + pt.x - nx},${cy + pt.y - ny}`);+ });+ const tail = points[points.length - 1];+ const gradId = `${uid}-trail-${i}`;+ return (+ <g key={i} opacity={appear}>+ <defs>+ <linearGradient+ id={gradId}+ gradientUnits="userSpaceOnUse"+ x1={cx + head.x}+ y1={cy + head.y}+ x2={cx + tail.x}+ y2={cy + tail.y}+ >+ <stop offset="0" stopColor={moonColor} stopOpacity={0.6} />+ <stop offset="1" stopColor={moonColor} stopOpacity={0} />+ </linearGradient>+ </defs>+ <polygon+ points={[...left, ...right].join(" ")}+ fill={`url(#${gradId})`}+ />+ <circle+ cx={cx + head.x}+ cy={cy + head.y}+ r={moonR * depth}+ fill={moonColor}+ />+ </g>+ );+ };++ return (+ <AbsoluteFill style={{ backgroundColor }}>+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ >+ {Array.from({ length: count }, (_, i) => (+ <ellipse+ key={i}+ cx={cx}+ cy={cy}+ rx={orbitR}+ ry={orbitR * Math.cos(tiltRad)}+ transform={`rotate(${(i / count) * 180 + 20} ${cx} ${cy})`}+ fill="none"+ stroke={moonColor}+ strokeOpacity={orbitOpacity}+ strokeWidth={1.5}+ />+ ))}+ {showMoons && bodies.filter((b) => b.head.z < 0).map(renderMoon)}+ {coreScale > 0 && (+ <circle+ cx={cx}+ cy={cy}+ r={core * coreScale * appear}+ fill={coreFill}+ />+ )}+ {showMoons && bodies.filter((b) => b.head.z >= 0).map(renderMoon)}+ {ringVisible && (+ <circle+ cx={cx}+ cy={cy}+ r={core + ring * s * 0.62}+ fill="none"+ stroke={flashColor}+ strokeWidth={Math.max(1, s * 0.03 * (1 - ring))}+ opacity={1 - ring}+ />+ )}+ </svg>+ <AbsoluteFill+ style={{+ alignItems: "center",+ justifyContent: "center",+ opacity: interpolate(t, [IMPACT + 3, IMPACT + 6], [0, 1], clamp),+ transform: `scale(${0.55 + 0.45 * pop})`,+ }}+ >+ {children ?? (+ <PlaceholderLockup+ mark={coreColor}+ dot={backgroundColor}+ text={moonColor}+ />+ )}+ </AbsoluteFill>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/paper-tear/config.ts b/registry/remocn/paper-tear/config.tsnew file mode 100644index 00000000..61f6ffaf--- /dev/null+++ b/registry/remocn/paper-tear/config.ts@@ -0,0 +1,47 @@+import { paperTearExampleCode } from "@/components/docs/examples/paper-tear-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const paperTearConfig: ComponentConfig = {+ componentName: "paperTear",+ importPath: "@/components/remocn/paper-tear",+ controls: {+ impact: {+ type: "number",+ min: 0,+ max: 2,+ step: 0.1,+ default: 1,+ description: "Impact",+ hiddenFromList: false,+ },+ roughness: {+ type: "number",+ min: 0,+ max: 1,+ step: 0.05,+ default: 0.5,+ description: "Roughness",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ min: 1,+ max: 50,+ step: 1,+ default: 7,+ description: "Seed",+ hiddenFromList: false,+ },+ edgeColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Edge color",+ },+ },+ durationInFrames: 104,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#0a0a0a" },+ snippet: paperTearExampleCode,+};diff --git a/registry/remocn/paper-tear/index.tsx b/registry/remocn/paper-tear/index.tsxnew file mode 100644index 00000000..930c770f--- /dev/null+++ b/registry/remocn/paper-tear/index.tsx@@ -0,0 +1,361 @@+"use client";++import type {+ TransitionPresentation,+ TransitionPresentationComponentProps,+} from "@remotion/transitions";+import type React from "react";+import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ spring,+ useVideoConfig,+} from "remotion";++export type PaperTearProps = {+ /** Strength of the impact: shake, flash and debris. 0 turns them off. */+ impact?: number;+ /** Seed for the shape of the rip. */+ seed?: number | string;+ /** Color of the fibrous torn edge. */+ edgeColor?: string;+ /** How jagged the rip is, 0 to 1. */+ roughness?: number;+ /** Shadow the torn halves cast on the incoming scene. */+ shadowColor?: string;+};++export const paperTearDefaults: Required<PaperTearProps> = {+ impact: 1,+ seed: 7,+ edgeColor: "#FFFFFF",+ roughness: 0.5,+ shadowColor: "rgba(0, 0, 0, 0.45)",+};++// Timeline, as shares of the transition: the paper strains, then the rip+// tears through the whole frame in a couple of frames (the impact), then the+// halves are flung apart.+const STRAIN = 0.2;+const IMPACT = 0.28;+const SEGMENTS = 44;+const DEBRIS = 28;+const ripEase = Easing.in(Easing.quad);+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++type TearPoint = { x: number; y: number; left: number; right: number };++function buildTear(+ seed: number | string,+ roughness: number,+ width: number,+ height: number,+): TearPoint[] {+ const r = Math.min(1, Math.max(0, roughness));+ const unit = Math.min(width, height);+ const tilt = (random(`tear-tilt-${seed}`) - 0.5) * width * 0.08;+ const phaseA = random(`tear-pa-${seed}`) * Math.PI * 2;+ const phaseB = random(`tear-pb-${seed}`) * Math.PI * 2;+ const fiber = unit * (0.008 + r * 0.012);+ const points: TearPoint[] = [];+ for (let i = 0; i <= SEGMENTS; i++) {+ const t = i / SEGMENTS;+ const wander =+ Math.sin(t * Math.PI * 2.2 + phaseA) * width * 0.025 ++ Math.sin(t * Math.PI * 5.3 + phaseB) * width * 0.012;+ // Alternate the jitter sign so the rip zig-zags instead of drifting.+ const zig = (i % 2 === 0 ? 1 : -1) * random(`tear-z-${seed}-${i}`);+ points.push({+ x:+ width / 2 ++ tilt * (t - 0.5) ++ wander * (0.4 + r) ++ zig * unit * 0.022 * r,+ y: -unit * 0.05 + t * (height + unit * 0.1),+ left: fiber * (0.35 + random(`tear-l-${seed}-${i}`) * 1.3),+ right: fiber * (0.2 + random(`tear-r-${seed}-${i}`) * 0.9),+ });+ }+ return points;+}++type Shard = {+ x: number;+ y: number;+ vx: number;+ vy: number;+ spin: number;+ size: number;+ shape: string;+};++// Paper scraps blown out of the seam at the moment of impact.+function buildDebris(+ seed: number | string,+ tear: TearPoint[],+ unit: number,+): Shard[] {+ return Array.from({ length: DEBRIS }, (_, i) => {+ const r = (k: string) => random(`tear-debris-${seed}-${i}-${k}`);+ const at = tear[Math.floor(r("at") * tear.length)];+ const side = r("side") < 0.5 ? -1 : 1;+ const corners = Array.from({ length: 4 }, (_, k) => {+ const a = (k / 4) * Math.PI * 2 + r(`a${k}`) * 1.2;+ const d = 0.55 + r(`d${k}`) * 0.45;+ return `${(50 + Math.cos(a) * 50 * d).toFixed(0)}% ${(50 + Math.sin(a) * 50 * d).toFixed(0)}%`;+ });+ return {+ x: at.x,+ y: at.y,+ vx: side * unit * (0.25 + r("vx") * 0.9),+ vy: -unit * (0.1 + r("vy") * 0.55),+ spin: (r("spin") - 0.5) * 1440,+ size: unit * (0.008 + r("size") ** 2 * 0.026),+ shape: `polygon(${corners.join(",")})`,+ };+ });+}++// Damped camera jolt that starts at the impact.+function shakeAt(p: number, unit: number, impact: number) {+ const t = p - IMPACT;+ if (t < 0 || impact <= 0) return { x: 0, y: 0, amp: 0 };+ const decay = Math.exp(-t * 11);+ const amp = unit * 0.03 * impact * decay;+ return {+ x: Math.sin(t * 95) * amp,+ y: Math.cos(t * 120 + 0.6) * amp * 0.7,+ amp,+ };+}++const px = (x: number, y: number) => `${x}px ${y}px`;++const PaperTearPresentation: React.FC<+ TransitionPresentationComponentProps<PaperTearProps>+> = ({+ children,+ presentationProgress,+ presentationDirection,+ passedProps,+}) => {+ const { width, height, fps } = useVideoConfig();+ const { seed, edgeColor, roughness, shadowColor, impact } = {+ ...paperTearDefaults,+ ...passedProps,+ };+ const tear = useMemo(+ () => buildTear(seed, roughness, width, height),+ [seed, roughness, width, height],+ );+ const unit = Math.min(width, height);+ const debris = useMemo(+ () => buildDebris(seed, tear, unit),+ [seed, tear, unit],+ );+ const p = presentationProgress;+ const shake = shakeAt(p, unit, impact);++ if (presentationDirection === "entering") {+ // The next scene is punched toward camera by the hit and settles back.+ const scale = interpolate(p, [IMPACT, 1], [1 + 0.1 * impact, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ return (+ <AbsoluteFill+ style={{+ transform: `translate(${shake.x}px, ${shake.y}px) scale(${scale})`,+ }}+ >+ {children}+ </AbsoluteFill>+ );+ }++ // Strain: the sheet trembles and leans toward camera before it gives way.+ const strain = interpolate(p, [0, STRAIN, IMPACT], [0, 1, 1], {+ ...clamp,+ easing: Easing.in(Easing.cubic),+ });+ const tremble =+ p < IMPACT ? Math.sin(p * 260) * unit * 0.004 * strain * impact : 0;+ const lean = 1 + 0.025 * strain * (p < IMPACT ? 1 : 0);+ const front =+ -unit * 0.1 ++ ripEase(interpolate(p, [STRAIN, IMPACT], [0, 1], clamp)) *+ (height + unit * 0.25);+ // The torn fibres open up a short distance behind the running rip front.+ const open = (y: number) =>+ interpolate(front - y, [0, unit * 0.12], [0, 1], clamp);++ const pad = unit;+ const edge = tear.map((t) => px(t.x, t.y));+ const leftInk = tear.map((t) => px(t.x - t.left * open(t.y), t.y));+ const rightInk = tear.map((t) => px(t.x + t.right * open(t.y), t.y));+ const leftOuter = [px(-pad, height + pad), px(-pad, -pad)];+ const rightOuter = [px(width + pad, height + pad), px(width + pad, -pad)];+ const poly = (pts: string[]) => `polygon(${pts.join(",")})`;+ const leftPaper = poly([...edge, ...leftOuter]);+ const rightPaper = poly([...edge, ...rightOuter]);+ const leftPrint = poly([...leftInk, ...leftOuter]);+ const rightPrint = poly([...rightInk, ...rightOuter]);++ const peelFrames = 30;+ // A stiff spring right after the impact flings the halves apart.+ const peel = spring({+ frame: Math.max(0, (p - IMPACT) / (1 - IMPACT)) * peelFrames,+ fps,+ durationInFrames: peelFrames,+ config: { damping: 15, stiffness: 150, mass: 0.8 },+ });+ const maxX = Math.max(...tear.map((t) => t.x));+ const minX = Math.min(...tear.map((t) => t.x));+ // The inner edges swing toward camera as the halves part, so travel gets+ // headroom for the perspective growth. Pivoting on the outer edges keeps+ // the frame border sealed (a flat rotate would expose the top or bottom).+ const leftTravel = (maxX + unit * 0.12) * 1.3;+ const rightTravel = (width - minX + unit * 0.12) * 1.3;+ const curl = peel * 24;+ const lens = `perspective(${unit * 2.6}px)`;+ // Grow the shadow from zero so the closed rip shows no dark seam.+ const cast = interpolate(p, [IMPACT, IMPACT + 0.1], [0, 1], clamp);+ const shadow = `drop-shadow(0 ${unit * 0.012 * cast}px ${unit * 0.04 * cast}px ${shadowColor})`;++ const half = (+ paper: string,+ print: string,+ transform: string,+ origin: string,+ ) => (+ <AbsoluteFill+ style={{+ transform,+ transformOrigin: origin,+ filter: cast > 0 ? shadow : undefined,+ }}+ >+ <AbsoluteFill style={{ clipPath: paper, backgroundColor: edgeColor }} />+ <AbsoluteFill style={{ clipPath: print }}>{children}</AbsoluteFill>+ </AbsoluteFill>+ );++ // Flash along the seam and scraps of paper blown out of it.+ const flash =+ impact > 0+ ? interpolate(p, [IMPACT - 0.03, IMPACT, IMPACT + 0.14], [0, 1, 0], {+ ...clamp,+ }) * Math.min(1, impact)+ : 0;+ const seam = tear.map((t) => `${t.x},${t.y}`).join(" ");+ const age = p - IMPACT;+ const gravity = unit * 2.6;+ // Debris time runs in "seconds" of the transition so it reads physical.+ const dt = age * 1.1;++ return (+ <AbsoluteFill+ style={{+ zIndex: 2,+ // Overscan just enough that the jolt never exposes the frame edge.+ transform: `translate(${shake.x + tremble}px, ${shake.y}px) scale(${+ lean + (2.2 * shake.amp) / unit+ })`,+ }}+ >+ {front < height + unit * 0.05 ? (+ // Below the running rip the sheet is still whole. Cover the seam with+ // an intact copy so the split halves never show an anti-aliased hairline.+ <AbsoluteFill+ style={{+ clipPath: poly([+ px(-pad, front),+ px(width + pad, front),+ px(width + pad, height + pad),+ px(-pad, height + pad),+ ]),+ zIndex: 1,+ }}+ >+ {children}+ </AbsoluteFill>+ ) : null}+ {half(+ leftPaper,+ leftPrint,+ `${lens} translateX(${-peel * leftTravel}px) rotateY(${-curl}deg)`,+ "0% 50%",+ )}+ {half(+ rightPaper,+ rightPrint,+ `${lens} translateX(${peel * rightTravel}px) rotateY(${curl}deg)`,+ "100% 50%",+ )}+ {flash > 0.01 ? (+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0, overflow: "visible" }}+ aria-hidden+ >+ <polyline+ points={seam}+ fill="none"+ stroke={edgeColor}+ strokeOpacity={flash * 0.35}+ strokeWidth={unit * 0.06 * flash}+ strokeLinejoin="round"+ />+ <polyline+ points={seam}+ fill="none"+ stroke={edgeColor}+ strokeOpacity={flash}+ strokeWidth={unit * 0.012}+ strokeLinejoin="round"+ />+ </svg>+ ) : null}+ {impact > 0 && age > 0+ ? debris.map((shard, i) => {+ const fade = interpolate(age, [0.35, 0.6], [1, 0], clamp);+ if (fade <= 0) return null;+ const x = shard.x + shard.vx * dt * impact;+ const y =+ shard.y + shard.vy * dt * impact + 0.5 * gravity * dt * dt;+ const size = shard.size * (0.5 + 0.5 * Math.min(1, impact));+ return (+ <div+ key={i}+ style={{+ position: "absolute",+ left: x - size / 2,+ top: y - size / 2,+ width: size,+ height: size,+ backgroundColor: edgeColor,+ clipPath: shard.shape,+ opacity: fade,+ transform: `rotate(${shard.spin * dt}deg)`,+ }}+ />+ );+ })+ : null}+ </AbsoluteFill>+ );+};++export function paperTear(+ props: PaperTearProps = {},+): TransitionPresentation<PaperTearProps> {+ return { component: PaperTearPresentation, props };+}diff --git a/registry/remocn/parallax-depth/config.ts b/registry/remocn/parallax-depth/config.tsnew file mode 100644index 00000000..2cc5181b--- /dev/null+++ b/registry/remocn/parallax-depth/config.ts@@ -0,0 +1,50 @@+import { parallaxDepthExampleCode } from "@/components/docs/examples/parallax-depth-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const parallaxDepthConfig: ComponentConfig = {+ componentName: "ParallaxDepth",+ importPath: "@/components/remocn/parallax-depth",+ controls: {+ distance: {+ type: "number",+ default: 0.5,+ min: 0,+ max: 1.2,+ step: 0.05,+ description: "Truck distance",+ hiddenFromList: false,+ },+ push: {+ type: "number",+ default: 0.16,+ min: 0,+ max: 0.6,+ step: 0.02,+ description: "Push-in",+ hiddenFromList: false,+ },+ direction: {+ type: "enum",+ default: "right",+ variants: { right: {}, left: {} },+ description: "Direction",+ },+ seed: {+ type: "number",+ default: 3,+ min: 1,+ max: 24,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ skyColor: { type: "color", default: "#111111", description: "Sky" },+ sunColor: { type: "color", default: "#E5322D", description: "Sun" },+ },+ durationInFrames: 90,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: parallaxDepthExampleCode,+};diff --git a/registry/remocn/parallax-depth/index.tsx b/registry/remocn/parallax-depth/index.tsxnew file mode 100644index 00000000..98069c7f--- /dev/null+++ b/registry/remocn/parallax-depth/index.tsx@@ -0,0 +1,197 @@+"use client";++import type React from "react";+import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type ParallaxDepthLayer = {+ /** Full-frame content of the layer. Leave room past the edges for the truck. */+ content: React.ReactNode;+ /** Distance from the camera. 1 is nearest; larger values move less. */+ depth: number;+};++export type ParallaxDepthColors = {+ sky: string;+ sun: string;+ far: string;+ mid: string;+ near: string;+};++export type ParallaxDepthProps = {+ /** Custom layers. Falls back to the built-in sun and hills landscape. */+ layers?: ParallaxDepthLayer[];+ /** Sideways camera travel at depth 1, as a fraction of the frame width. */+ distance?: number;+ /** Push-in toward the scene, in depth units. */+ push?: number;+ /** Truck direction: 1 moves the camera right, -1 left. */+ direction?: 1 | -1;+ colors?: Partial<ParallaxDepthColors>;+ /** Sky color. Overrides `colors.sky`. */+ skyColor?: string;+ /** Sun color. Overrides `colors.sun`. */+ sunColor?: string;+ seed?: number;+ speed?: number;+};++export const parallaxDepthDefaults = {+ distance: 0.5,+ push: 0.16,+ direction: 1 as 1 | -1,+ colors: {+ sky: "#111111",+ sun: "#E5322D",+ far: "#2C2C2C",+ mid: "#555555",+ near: "#8E8E8E",+ } satisfies ParallaxDepthColors,+ seed: 3,+ speed: 1,+};++const DURATION = 60;++// A ridge line built from a few seeded sine octaves, spanning three widths so it+// never runs out while the camera trucks.+function hillPath(+ width: number,+ height: number,+ base: number,+ amp: number,+ waves: number,+ seed: string,+) {+ const octaves = [0, 1, 2].map((o) => ({+ f: (waves * (o + 1) * (0.8 + random(`${seed}-f${o}`) * 0.4)) / width,+ a: amp / (o * 1.7 + 1),+ p: random(`${seed}-p${o}`) * Math.PI * 2,+ }));+ const steps = 120;+ const x0 = -width;+ const x1 = width * 2;+ let d = `M ${x0} ${height * 2}`;+ for (let i = 0; i <= steps; i++) {+ const x = x0 + ((x1 - x0) * i) / steps;+ let y = base;+ for (const o of octaves)+ y -= o.a * (0.5 + 0.5 * Math.sin(x * o.f * 6.283 + o.p));+ d += ` L ${x.toFixed(1)} ${y.toFixed(1)}`;+ }+ return `${d} L ${x1} ${height * 2} Z`;+}++function useLandscape(colors: ParallaxDepthColors, seed: number) {+ const { width, height } = useVideoConfig();+ return useMemo<ParallaxDepthLayer[]>(() => {+ const svg = (children: React.ReactNode) => (+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ overflow: "visible" }}+ aria-hidden+ >+ {children}+ </svg>+ );+ const hill = (+ base: number,+ amp: number,+ waves: number,+ fill: string,+ key: string,+ ) => (+ <path+ d={hillPath(+ width,+ height,+ height * base,+ height * amp,+ waves,+ `${seed}-${key}`,+ )}+ fill={fill}+ />+ );+ return [+ {+ depth: 9,+ content: svg(+ <circle+ cx={width * 0.6}+ cy={height * 0.4}+ r={height * 0.17}+ fill={colors.sun}+ />,+ ),+ },+ { depth: 6, content: svg(hill(0.6, 0.24, 2.2, colors.far, "far")) },+ { depth: 2.6, content: svg(hill(0.76, 0.16, 1.2, colors.mid, "mid")) },+ { depth: 1.2, content: svg(hill(0.92, 0.14, 0.9, colors.near, "near")) },+ ];+ }, [width, height, colors.sun, colors.far, colors.mid, colors.near, seed]);+}++export function ParallaxDepth({+ layers,+ distance = parallaxDepthDefaults.distance,+ push = parallaxDepthDefaults.push,+ direction = parallaxDepthDefaults.direction,+ colors: colorOverrides,+ skyColor,+ sunColor,+ seed = parallaxDepthDefaults.seed,+ speed = parallaxDepthDefaults.speed,+}: ParallaxDepthProps) {+ const frame = useCurrentFrame();+ const { width, fps } = useVideoConfig();+ const baseColors = { ...parallaxDepthDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ sky: skyColor ?? baseColors.sky,+ sun: sunColor ?? baseColors.sun,+ };+ const landscape = useLandscape(colors, seed);+ const stack = [...(layers ?? landscape)].sort((a, b) => b.depth - a.depth);++ const t = (frame * speed * 30) / fps;+ const move = interpolate(t, [0, DURATION], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.bezier(0.45, 0, 0.2, 1),+ });+ const camX = (move - 0.5) * distance * width * direction;+ const camZ = move * push;++ return (+ <AbsoluteFill style={{ backgroundColor: colors.sky, overflow: "hidden" }}>+ {stack.map((layer, i) => {+ const depth = Math.max(0.2, layer.depth);+ // Pinhole camera: scale and offset both fall off with 1 / depth.+ const scale = depth / Math.max(0.05, depth - camZ);+ const x = (-camX * scale) / depth;+ return (+ <AbsoluteFill+ key={i}+ style={{+ transform: `translateX(${x}px) scale(${scale})`,+ transformOrigin: "50% 55%",+ }}+ >+ {layer.content}+ </AbsoluteFill>+ );+ })}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/pendulum-wave/config.ts b/registry/remocn/pendulum-wave/config.tsnew file mode 100644index 00000000..f8be6508--- /dev/null+++ b/registry/remocn/pendulum-wave/config.ts@@ -0,0 +1,59 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" ? value : fallback;++// One full loop, so the preview wraps on the realigned line.+function durationOf(values: Record<string, unknown>) {+ const speed = numberOr(values.speed, 1);+ const loopFrames = numberOr(values.loopFrames, 450);+ return speed > 0 ? Math.max(1, Math.round(loopFrames / speed)) : 450;+}++export const pendulumWaveConfig: ComponentConfig = {+ componentName: "PendulumWave",+ importPath: "@/components/remocn/pendulum-wave",+ controls: {+ count: {+ type: "number",+ default: 15,+ min: 2,+ max: 40,+ step: 1,+ description: "Pendulums",+ hiddenFromList: false,+ },+ cycles: {+ type: "number",+ default: 10,+ min: 1,+ max: 30,+ step: 1,+ description: "Swings of the slowest",+ hiddenFromList: false,+ },+ loopFrames: {+ type: "number",+ default: 450,+ min: 90,+ max: 900,+ step: 30,+ description: "Loop frames",+ hiddenFromList: false,+ },+ showGuides: { type: "boolean", default: true, description: "Guides" },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Bobs" },+ accent: { type: "color", default: "#E5322D", description: "Wave line" },+ },+ durationInFrames: 450,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/pendulum-wave/index.tsx b/registry/remocn/pendulum-wave/index.tsxnew file mode 100644index 00000000..54b868fc--- /dev/null+++ b/registry/remocn/pendulum-wave/index.tsx@@ -0,0 +1,165 @@+"use client";++import { AbsoluteFill, useCurrentFrame, useVideoConfig } from "remotion";++export type PendulumWaveProps = {+ /** Number of pendulums. */+ count?: number;+ /** Swings the slowest pendulum makes per loop; pendulum i makes cycles + i. */+ cycles?: number;+ /** Frames until every pendulum realigns. */+ loopFrames?: number;+ speed?: number;+ background?: string;+ /** Bobs and guides. */+ color?: string;+ /** The wave line threaded through the bobs. */+ accent?: string;+ /** Draw the faint per-pendulum tracks and centre line. */+ showGuides?: boolean;+};++export const pendulumWaveDefaults: Required<PendulumWaveProps> = {+ count: 15,+ cycles: 10,+ loopFrames: 450,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+ showGuides: true,+};++const TAU = Math.PI * 2;+const SMEAR_FRAMES = 4;+const SMEAR_SAMPLES = 6;++type Point = { x: number; y: number };++const fmt = (n: number) => Math.round(n * 10) / 10;++// Catmull-Rom through the bobs so the wave reads as one continuous curve.+function smoothPath(points: Point[]) {+ if (points.length < 2) return "";+ let d = `M ${fmt(points[0].x)} ${fmt(points[0].y)}`;+ for (let i = 0; i < points.length - 1; i++) {+ const p0 = points[i - 1] ?? points[i];+ const p1 = points[i];+ const p2 = points[i + 1];+ const p3 = points[i + 2] ?? p2;+ const c1x = p1.x + (p2.x - p0.x) / 6;+ const c1y = p1.y + (p2.y - p0.y) / 6;+ const c2x = p2.x - (p3.x - p1.x) / 6;+ const c2y = p2.y - (p3.y - p1.y) / 6;+ d += ` C ${fmt(c1x)} ${fmt(c1y)} ${fmt(c2x)} ${fmt(c2y)} ${fmt(p2.x)} ${fmt(p2.y)}`;+ }+ return d;+}++const circle = (x: number, y: number, r: number) =>+ `M ${fmt(x - r)} ${fmt(y)} a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(r * 2)} 0 a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(-r * 2)} 0`;++export function PendulumWave({+ count = pendulumWaveDefaults.count,+ cycles = pendulumWaveDefaults.cycles,+ loopFrames = pendulumWaveDefaults.loopFrames,+ speed = pendulumWaveDefaults.speed,+ background = pendulumWaveDefaults.background,+ color = pendulumWaveDefaults.color,+ accent = pendulumWaveDefaults.accent,+ showGuides = pendulumWaveDefaults.showGuides,+}: PendulumWaveProps) {+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const n = Math.max(2, Math.round(count));+ const loop = Math.max(1, loopFrames);+ const time = frame * speed;++ const marginX = width * 0.1;+ const gap = (width - marginX * 2) / (n - 1);+ const amp = height * 0.3;+ const cy = height / 2;+ const r0 = Math.min(gap * 0.3, height * 0.022);+ const unit = Math.min(width, height) / 720;++ // Phase of pendulum i: 2π · t · (cycles + i) / T. At t = 0 and t = T all+ // pendulums sit at the top extreme, so the loop closes on a straight line.+ const phaseAt = (i: number, t: number) => (TAU * t * (cycles + i)) / loop;++ const bobs = Array.from({ length: n }, (_, i) => {+ const c = Math.cos(phaseAt(i, time));+ // Fake depth: bobs swinging toward the viewer (lower) read slightly bigger.+ return { x: marginX + i * gap, y: cy - amp * c, r: r0 * (1 - 0.22 * c) };+ });++ let smear = "";+ for (let i = 0; i < n; i++) {+ const x = fmt(bobs[i].x);+ for (let s = 0; s <= SMEAR_SAMPLES; s++) {+ const t = time - (SMEAR_FRAMES * speed * s) / SMEAR_SAMPLES;+ const y = fmt(cy - amp * Math.cos(phaseAt(i, t)));+ smear += `${s === 0 ? "M" : "L"} ${x} ${y} `;+ }+ }++ const tracks = bobs+ .map((b) => `M ${fmt(b.x)} ${fmt(cy - amp)} V ${fmt(cy + amp)}`)+ .join(" ");+ const ticks = bobs+ .map(+ (b) =>+ circle(b.x, cy - amp, 2.2 * unit) + circle(b.x, cy + amp, 2.2 * unit),+ )+ .join(" ");++ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Pendulum wave"+ style={{ display: "block" }}+ >+ {showGuides ? (+ <g stroke={color} fill="none">+ <path+ d={`M ${fmt(marginX - gap)} ${cy} H ${fmt(width - marginX + gap)}`}+ strokeOpacity={0.14}+ strokeWidth={unit}+ />+ <path+ d={tracks}+ strokeOpacity={0.08}+ strokeWidth={unit}+ strokeDasharray={`${2 * unit} ${6 * unit}`}+ />+ <path d={ticks} fill={color} fillOpacity={0.25} stroke="none" />+ </g>+ ) : null}+ <path+ d={smoothPath(bobs)}+ fill="none"+ stroke={accent}+ strokeWidth={2.5 * unit}+ strokeLinecap="round"+ strokeOpacity={0.85}+ />+ <path+ d={smear}+ fill="none"+ stroke={color}+ strokeOpacity={0.13}+ strokeWidth={r0 * 0.9}+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path+ d={bobs.map((b) => circle(b.x, b.y, b.r)).join(" ")}+ fill={color}+ />+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/phyllotaxis/config.ts b/registry/remocn/phyllotaxis/config.tsnew file mode 100644index 00000000..84bb8bb9--- /dev/null+++ b/registry/remocn/phyllotaxis/config.ts@@ -0,0 +1,86 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" ? value : fallback;++// Growth, the 10-frame pop of the last seed, then two pulses along the arm.+function durationOf(values: Record<string, unknown>) {+ const speed = numberOr(values.speed, 1);+ const motion =+ numberOr(values.growFrames, 60) + 10 + 2 * numberOr(values.pulseFrames, 45);+ return (speed > 0 ? Math.ceil(motion / speed) : motion) + 5;+}++export const phyllotaxisConfig: ComponentConfig = {+ componentName: "Phyllotaxis",+ importPath: "@/components/remocn/phyllotaxis",+ controls: {+ count: {+ type: "number",+ default: 420,+ min: 50,+ max: 1200,+ step: 10,+ description: "Seeds",+ hiddenFromList: false,+ },+ size: {+ type: "number",+ default: 1,+ min: 0.3,+ max: 2,+ step: 0.05,+ description: "Seed size",+ hiddenFromList: false,+ },+ arm: {+ type: "number",+ default: 21,+ min: 1,+ max: 89,+ step: 1,+ description: "Arm spacing",+ hiddenFromList: false,+ },+ growFrames: {+ type: "number",+ default: 60,+ min: 15,+ max: 150,+ step: 5,+ description: "Grow frames",+ hiddenFromList: false,+ },+ pulseFrames: {+ type: "number",+ default: 45,+ min: 15,+ max: 120,+ step: 5,+ description: "Pulse frames",+ hiddenFromList: false,+ },+ rotation: {+ type: "number",+ default: 4,+ min: -30,+ max: 30,+ step: 1,+ description: "Rotation °/s",+ hiddenFromList: false,+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Seeds" },+ accent: { type: "color", default: "#E5322D", description: "Arm" },+ },+ durationInFrames: 165,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/phyllotaxis/index.tsx b/registry/remocn/phyllotaxis/index.tsxnew file mode 100644index 00000000..4352d118--- /dev/null+++ b/registry/remocn/phyllotaxis/index.tsx@@ -0,0 +1,137 @@+"use client";++import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type PhyllotaxisProps = {+ /** Number of seeds. */+ count?: number;+ /** Seed size multiplier. */+ size?: number;+ /** Frames for all seeds to spiral out. */+ growFrames?: number;+ /** Frames per pulse along the accent arm once grown. */+ pulseFrames?: number;+ /** Arm spacing: every n-th seed forms one parastichy (a Fibonacci number reads best). */+ arm?: number;+ /** Slow rotation of the head in degrees per second; 0 holds still. */+ rotation?: number;+ speed?: number;+ background?: string;+ color?: string;+ accent?: string;+};++export const phyllotaxisDefaults: Required<PhyllotaxisProps> = {+ count: 420,+ size: 1,+ growFrames: 60,+ pulseFrames: 45,+ arm: 21,+ rotation: 4,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+};++const GOLDEN = (137.508 * Math.PI) / 180;+const POP = 10;+const pop = Easing.out(Easing.back(2.2));+const clamp = { extrapolateLeft: "clamp", extrapolateRight: "clamp" } as const;+const fmt = (n: number) => Math.round(n * 10) / 10;+const dot = (x: number, y: number, r: number) =>+ `M ${fmt(x - r)} ${fmt(y)} a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(r * 2)} 0 a ${fmt(r)} ${fmt(r)} 0 1 0 ${fmt(-r * 2)} 0 `;++export function Phyllotaxis({+ count = phyllotaxisDefaults.count,+ size = phyllotaxisDefaults.size,+ growFrames = phyllotaxisDefaults.growFrames,+ pulseFrames = phyllotaxisDefaults.pulseFrames,+ arm = phyllotaxisDefaults.arm,+ rotation = phyllotaxisDefaults.rotation,+ speed = phyllotaxisDefaults.speed,+ background = phyllotaxisDefaults.background,+ color = phyllotaxisDefaults.color,+ accent = phyllotaxisDefaults.accent,+}: PhyllotaxisProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const n = Math.max(1, Math.round(count));+ const step = Math.max(1, Math.round(arm));+ const time = frame * speed;+ const cx = width / 2;+ const cy = height / 2;+ const maxR = Math.min(width, height) * 0.44;+ const c = maxR / Math.sqrt(n);+ const spin = (rotation * Math.PI * time) / 180 / fps;++ // Seeds appear in order with a little overshoot; the reveal eases so the+ // dense centre does not flash in all at once.+ const grown = (i: number) => {+ const at = growFrames * Math.sqrt(i / n);+ return pop(Math.min(1, Math.max(0, (time - at) / POP)));+ };+ const armIn = interpolate(time, [growFrames, growFrames + 14], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const since = time - growFrames - 10;+ const pulse = since > 0 ? (since / Math.max(1, pulseFrames)) % 1 : -1;++ let plain = "";+ let red = "";+ let spine = "";+ for (let i = 1; i <= n; i++) {+ const s = grown(i);+ if (s <= 0) continue;+ const radius = c * Math.sqrt(i);+ const theta = i * GOLDEN + spin;+ const x = cx + Math.cos(theta) * radius;+ const y = cy + Math.sin(theta) * radius;+ // Outer seeds are a touch larger, like a sunflower head.+ const base = c * 0.42 * size * (0.55 + 0.45 * Math.sqrt(i / n));+ const onArm = i % step === 0 && armIn > 0;+ if (!onArm) {+ plain += dot(x, y, base * s);+ continue;+ }+ // Pulse travels outward along the arm as a soft gaussian bump.+ const u = Math.sqrt(i / n);+ const bump =+ pulse >= 0 ? Math.exp(-(((u - pulse * 1.4 + 0.2) / 0.09) ** 2)) : 0;+ red += dot(x, y, base * s * (1 + 0.25 * armIn + bump * 0.9));+ spine += `${spine ? "L" : "M"} ${fmt(x)} ${fmt(y)} `;+ }++ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Phyllotaxis spiral"+ style={{ display: "block" }}+ >+ <path d={plain} fill={color} />+ {spine ? (+ <path+ d={spine}+ fill="none"+ stroke={accent}+ strokeOpacity={0.35 * armIn}+ strokeWidth={Math.min(width, height) / 720}+ />+ ) : null}+ <path d={red} fill={color} fillOpacity={1 - armIn} />+ <path d={red} fill={accent} fillOpacity={armIn} />+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/pixel-sort/config.ts b/registry/remocn/pixel-sort/config.tsnew file mode 100644index 00000000..6f956c61--- /dev/null+++ b/registry/remocn/pixel-sort/config.ts@@ -0,0 +1,38 @@+import { pixelSortExampleCode } from "@/components/docs/examples/pixel-sort-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const pixelSortConfig: ComponentConfig = {+ componentName: "pixelSort",+ importPath: "@/components/remocn/pixel-sort",+ controls: {+ columns: {+ type: "number",+ min: 8,+ max: 96,+ step: 2,+ default: 40,+ description: "Columns",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ min: 1,+ max: 50,+ step: 1,+ default: 5,+ description: "Seed",+ hiddenFromList: false,+ },+ streakColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Streak color",+ },+ },+ durationInFrames: 110,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#0a0a0a" },+ snippet: pixelSortExampleCode,+};diff --git a/registry/remocn/pixel-sort/index.tsx b/registry/remocn/pixel-sort/index.tsxnew file mode 100644index 00000000..d70b2160--- /dev/null+++ b/registry/remocn/pixel-sort/index.tsx@@ -0,0 +1,172 @@+"use client";++import type {+ TransitionPresentation,+ TransitionPresentationComponentProps,+} from "@remotion/transitions";+import type React from "react";+import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useVideoConfig,+} from "remotion";++export type PixelSortProps = {+ /** Number of vertical columns the frame is sliced into. */+ columns?: number;+ /** Seed for per-column melt amount and timing. */+ seed?: number | string;+ /** Color of the bright smeared streaks. */+ streakColor?: string;+};++export const pixelSortDefaults: Required<PixelSortProps> = {+ columns: 40,+ seed: 5,+ streakColor: "#FFFFFF",+};++// Outgoing columns melt over MELT; incoming ones drop in (DROP) and snap (SNAP).+const MELT = 0.42;+const DROP = 0.14;+const SNAP = 0.12;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};+const meltEase = Easing.in(Easing.cubic);+const snapEase = Easing.out(Easing.back(1.6));++type Column = {+ left: number;+ width: number;+ meltAt: number;+ amount: number;+ glow: number;+ streakFrom: number;+ snapAt: number;+};++const PixelSortPresentation: React.FC<+ TransitionPresentationComponentProps<PixelSortProps>+> = ({+ children,+ presentationProgress,+ presentationDirection,+ passedProps,+}) => {+ const { width, height } = useVideoConfig();+ const { columns, seed, streakColor } = {+ ...pixelSortDefaults,+ ...passedProps,+ };+ const count = Math.max(2, Math.round(columns));++ const layout = useMemo<Column[]>(+ () =>+ Array.from({ length: count }, (_, i) => {+ const r = (key: string) => random(`pixel-sort-${seed}-${key}-${i}`);+ const left = Math.floor((i * width) / count);+ const right = Math.floor(((i + 1) * width) / count);+ return {+ left,+ // 1px overlap keeps resting columns seamless.+ width: right - left + (i < count - 1 ? 1 : 0),+ meltAt: r("m") * 0.2,+ amount: 0.25 + r("a") ** 2 * 1.6,+ glow: 0.15 + r("g") * 0.75,+ streakFrom: 10 + r("s") * 50,+ snapAt: 0.5 + r("t") * (1 - 0.5 - DROP - SNAP) + DROP,+ };+ }),+ [count, seed, width],+ );++ const p = presentationProgress;+ const exiting = presentationDirection === "exiting";++ return (+ <AbsoluteFill>+ {layout.map((c) => {+ let stretch: number;+ let shift: number;+ let streak: number;+ let opacity = 1;+ let origin = "50% 0%";+ if (exiting) {+ const m = meltEase(+ interpolate(p, [c.meltAt, c.meltAt + MELT], [0, 1], clamp),+ );+ // Stretch around the streak start so the column never tears open.+ stretch = 1 + m * c.amount * 4;+ shift = 0;+ origin = `50% ${c.streakFrom}%`;+ streak = m * c.glow;+ } else {+ const drop = interpolate(+ p,+ [c.snapAt - DROP, c.snapAt],+ [0, 1],+ clamp,+ );+ const snap = snapEase(+ interpolate(p, [c.snapAt, c.snapAt + SNAP], [0, 1], clamp),+ );+ if (drop <= 0) return null;+ // A smeared streak falls in from above, then snaps to the real image.+ stretch = interpolate(snap, [0, 1], [1 + c.amount * 3, 1]);+ shift = -(1 - Easing.out(Easing.cubic)(drop)) * height * 1.1;+ streak = (1 - Math.min(1, Math.max(0, snap))) * Math.max(0.5, c.glow);+ opacity = interpolate(drop, [0, 0.3], [0, 1], clamp);+ }+ return (+ <div+ key={c.left}+ style={{+ position: "absolute",+ left: c.left,+ top: 0,+ width: c.width,+ height,+ overflow: "hidden",+ opacity,+ }}+ >+ <div+ style={{+ position: "absolute",+ left: -c.left,+ top: 0,+ width,+ height,+ transformOrigin: origin,+ transform: `translateY(${shift}px) scaleY(${stretch})`,+ }}+ >+ {children}+ </div>+ {streak > 0.002 ? (+ <div+ style={{+ position: "absolute",+ inset: 0,+ opacity: streak,+ background: `linear-gradient(to bottom, transparent ${c.streakFrom}%, ${streakColor} ${c.streakFrom + 30}%, transparent 100%)`,+ }}+ />+ ) : null}+ </div>+ );+ })}+ </AbsoluteFill>+ );+};++export function pixelSort(+ props: PixelSortProps = {},+): TransitionPresentation<PixelSortProps> {+ return { component: PixelSortPresentation, props };+}diff --git a/registry/remocn/puzzle-snap/config.ts b/registry/remocn/puzzle-snap/config.tsnew file mode 100644index 00000000..a81b5ea7--- /dev/null+++ b/registry/remocn/puzzle-snap/config.ts@@ -0,0 +1,37 @@+import { puzzleSnapExampleCode } from "@/components/docs/examples/puzzle-snap-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const puzzleSnapConfig: ComponentConfig = {+ componentName: "PuzzleSnap",+ importPath: "@/components/remocn/puzzle-snap",+ controls: {+ square: { type: "boolean", default: true, description: "Square piece" },+ seed: {+ type: "number",+ default: 3,+ min: 1,+ max: 99,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ primaryColor: { type: "color", default: "#E5322D", description: "Primary" },+ secondaryColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Secondary",+ },+ sparkColor: { type: "color", default: "#FFFFFF", description: "Sparks" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 66,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: puzzleSnapExampleCode,+};diff --git a/registry/remocn/puzzle-snap/index.tsx b/registry/remocn/puzzle-snap/index.tsxnew file mode 100644index 00000000..0ac1388e--- /dev/null+++ b/registry/remocn/puzzle-snap/index.tsx@@ -0,0 +1,254 @@+"use client";++import type React from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type PuzzleSnapProps = {+ /** Wordmark revealed beside the assembled mark. */+ children?: React.ReactNode;+ backgroundColor?: string;+ /** Fill of the quarter circle and the small square. */+ primaryColor?: string;+ /** Fill of the dot and the wedge. */+ secondaryColor?: string;+ /** Spark burst color. */+ sparkColor?: string;+ /** Include the small square piece. */+ square?: boolean;+ /** Seed for the scattered start positions. */+ seed?: number;+ speed?: number;+};++export const puzzleSnapDefaults = {+ backgroundColor: "#111111",+ primaryColor: "#E5322D",+ secondaryColor: "#FFFFFF",+ sparkColor: "#FFFFFF",+ square: true,+ seed: 3,+ speed: 1,+};++const STAGGER = 3;+const DRIFT = 10;+const SNAP = 3;+const SPARK = 8;+const SLIDE = 11;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++type Piece = {+ key: string;+ /** Pivot / contact point in mark units (0..2). */+ px: number;+ py: number;+ render: (c: number) => React.ReactNode;+};++export function PuzzleSnap(props: PuzzleSnapProps) {+ const {+ children,+ backgroundColor,+ primaryColor,+ secondaryColor,+ sparkColor,+ square,+ seed,+ speed,+ } = { ...puzzleSnapDefaults, ...props };+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const t = frame * Math.max(0, speed);+ const s = Math.min(width, height);+ const size = Math.round(s * 0.2);+ const c = size / 2;+ const gap = c * 0.08;++ const pieces: Piece[] = [+ {+ key: "quarter",+ px: 0.6,+ py: 0.6,+ render: (u) => (+ <path+ d={`M ${u - gap} ${u - gap} L 0 ${u - gap} A ${u - gap} ${u - gap} 0 0 1 ${u - gap} 0 Z`}+ fill={primaryColor}+ />+ ),+ },+ {+ key: "dot",+ px: 1.5,+ py: 0.5,+ render: (u) => (+ <circle cx={u * 1.5} cy={u * 0.5} r={u * 0.36} fill={secondaryColor} />+ ),+ },+ {+ key: "wedge",+ px: 0.65,+ py: 1.35,+ render: (u) => (+ <path+ d={`M ${u - gap} ${u + gap} L ${u - gap} ${2 * u} L 0 ${2 * u} Z`}+ fill={secondaryColor}+ />+ ),+ },+ ...(square+ ? [+ {+ key: "square",+ px: 1.5,+ py: 1.5,+ render: (u: number) => (+ <rect+ x={u * 1.18}+ y={u * 1.18}+ width={u * 0.64}+ height={u * 0.64}+ rx={u * 0.08}+ fill={primaryColor}+ />+ ),+ },+ ]+ : []),+ ];+ const lastContact = (pieces.length - 1) * STAGGER + DRIFT + SNAP;++ const punch = spring({+ frame: t - lastContact,+ fps,+ config: { damping: 9, stiffness: 260, mass: 0.5 },+ });+ const markScale = t < lastContact ? 1 : 1 + 0.08 * (1 - punch);+ const slide = interpolate(+ t,+ [lastContact + 2, lastContact + 2 + SLIDE],+ [0, 1],+ {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ },+ );+ const reveal = interpolate(+ t,+ [lastContact + 4, lastContact + 4 + SLIDE],+ [0, 1],+ { ...clamp, easing: Easing.out(Easing.cubic) },+ );++ return (+ <AbsoluteFill+ style={{+ backgroundColor,+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ display: "flex",+ alignItems: "center",+ gap: size * 0.24,+ // Shift the row so the mark sits dead center until it slides over.+ transform: `translateX(calc((50% - ${size / 2}px) * ${children ? 1 - slide : 0}))`,+ }}+ >+ <svg+ width={size}+ height={size}+ viewBox={`0 0 ${size} ${size}`}+ style={{+ flexShrink: 0,+ overflow: "visible",+ transform: `scale(${markScale})`,+ }}+ >+ {pieces.map((piece, i) => {+ const local = t - i * STAGGER;+ const angle = random(`puzzle-snap-${seed}-${i}-a`) * Math.PI * 2;+ const dist =+ s * (0.42 + 0.22 * random(`puzzle-snap-${seed}-${i}-d`));+ const spin =+ (random(`puzzle-snap-${seed}-${i}-r`) > 0.5 ? 1 : -1) *+ (120 + 160 * random(`puzzle-snap-${seed}-${i}-s`));+ // Drift most of the way in, then get yanked onto the slot.+ const remain =+ local < DRIFT+ ? interpolate(local, [0, DRIFT], [1, 0.2], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ })+ : interpolate(local, [DRIFT, DRIFT + SNAP], [0.2, 0], {+ ...clamp,+ easing: Easing.in(Easing.quad),+ });+ const ox = Math.cos(angle) * dist * remain;+ const oy = Math.sin(angle) * dist * remain;+ const pivotX = piece.px * c;+ const pivotY = piece.py * c;+ const opacity = interpolate(local, [0, 3], [0, 1], clamp);+ const sparkT = (local - DRIFT - SNAP) / SPARK;+ return (+ <g key={piece.key}>+ <g+ opacity={opacity}+ transform={`translate(${ox} ${oy}) rotate(${spin * remain} ${pivotX} ${pivotY})`}+ >+ {piece.render(c)}+ </g>+ {sparkT >= 0 &&+ sparkT < 1 &&+ Array.from({ length: 6 }, (_, k) => {+ const a =+ (k / 6) * Math.PI * 2 ++ random(`puzzle-snap-${seed}-${i}-spark`) * Math.PI;+ const e = Easing.out(Easing.cubic)(sparkT);+ const r0 = c * (0.45 + 0.4 * e);+ const r1 = r0 + c * 0.28 * (1 - 0.5 * e);+ return (+ <line+ key={k}+ x1={pivotX + Math.cos(a) * r0}+ y1={pivotY + Math.sin(a) * r0}+ x2={pivotX + Math.cos(a) * r1}+ y2={pivotY + Math.sin(a) * r1}+ stroke={sparkColor}+ strokeWidth={Math.max(1, c * 0.05 * (1 - sparkT))}+ strokeLinecap="round"+ opacity={1 - sparkT}+ />+ );+ })}+ </g>+ );+ })}+ </svg>+ {children && (+ <div+ style={{+ opacity: reveal,+ clipPath: `inset(-30% ${(1 - reveal) * 100}% -30% -5%)`,+ transform: `translateX(${(1 - reveal) * -size * 0.3}px)`,+ }}+ >+ {children}+ </div>+ )}+ </div>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 615c044c..177e00aa 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -3662,6 +3662,538 @@"target": "components/remocn/caption-drop.tsx"}]+ },+ {+ "name": "iris-wipe",+ "type": "registry:component",+ "title": "Iris Wipe",+ "description": "An old-cartoon iris closes on the subject, holds a beat as a dot, then opens on the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "iris-wipe/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/iris-wipe.tsx"+ }+ ]+ },+ {+ "name": "venetian-blinds",+ "type": "registry:component",+ "title": "Venetian Blinds",+ "description": "The outgoing scene splits into horizontal slats that turn edge-on in a staggered ripple, revealing the next scene behind them.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "venetian-blinds/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/venetian-blinds.tsx"+ }+ ]+ },+ {+ "name": "paper-tear",+ "type": "registry:component",+ "title": "Paper Tear",+ "description": "A jagged rip runs down the frame, then both halves peel apart on a spring with white fibrous torn edges, revealing the scene underneath.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "paper-tear/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/paper-tear.tsx"+ }+ ]+ },+ {+ "name": "pixel-sort",+ "type": "registry:component",+ "title": "Pixel Sort",+ "description": "The scene melts into seeded vertical streaks like glitch-art pixel sorting, then the next scene's columns fall in and snap into place.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "pixel-sort/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/pixel-sort.tsx"+ }+ ]+ },+ {+ "name": "light-leak",+ "type": "registry:component",+ "title": "Light Leak",+ "description": "A warm analog light leak drifts in from an edge and blows the frame out to near-white at the cut, then cools off to reveal the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "light-leak/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/light-leak.tsx"+ }+ ]+ },+ {+ "name": "orbit-lock",+ "type": "registry:component",+ "title": "Orbit Lock",+ "description": "Three moons ride tilted, shrinking orbits into a red core that bursts into a ring flash and springs the logo into place.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "orbit-lock/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/orbit-lock.tsx"+ }+ ]+ },+ {+ "name": "puzzle-snap",+ "type": "registry:component",+ "title": "Puzzle Snap",+ "description": "Geometric pieces spin in from scattered positions and magnet-snap into a mark with a spark burst, then the mark slides aside for the wordmark.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "puzzle-snap/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/puzzle-snap.tsx"+ }+ ]+ },+ {+ "name": "spotlight",+ "type": "registry:component",+ "title": "Spotlight",+ "description": "A soft spotlight cone searches the dark stage, overshoots, and lands on the logo before the house lights lift.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "spotlight/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/spotlight.tsx"+ }+ ]+ },+ {+ "name": "neon-sign",+ "type": "registry:component",+ "title": "Neon Sign",+ "description": "A glass neon tube stutters alive segment by segment with a hot white core and wall glow, buzzes off once, then holds lit.",+ "dependencies": ["remotion", "@remotion/paths"],+ "files": [+ {+ "path": "neon-sign/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/neon-sign.tsx"+ }+ ]+ },+ {+ "name": "inflate",+ "type": "registry:component",+ "title": "Inflate",+ "description": "A deflated red sliver puffs up like a balloon toy, overshoots, squashes wide and settles into a glossy rounded mark.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "inflate/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/inflate.tsx"+ }+ ]+ },+ {+ "name": "liquid-fill",+ "type": "registry:component",+ "title": "Liquid Fill",+ "description": "A drop falls into an outlined mark and liquid rises with a sloshing, damping surface and bubbles until the mark is solid.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "liquid-fill/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/liquid-fill.tsx"+ }+ ]+ },+ {+ "name": "accordion-unfold",+ "type": "registry:component",+ "title": "Accordion Unfold",+ "description": "A tight paper zigzag unfolds sideways into a flat card with the logo printed across it.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "accordion-unfold/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/accordion-unfold.tsx"+ }+ ]+ },+ {+ "name": "anamorphic-flare",+ "type": "registry:component",+ "title": "Anamorphic Flare",+ "description": "A point of light grows into a cinematic anamorphic streak that sweeps the frame and reveals the logo in its wake.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "anamorphic-flare/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/anamorphic-flare.tsx"+ }+ ]+ },+ {+ "name": "pendulum-wave",+ "type": "registry:component",+ "title": "Pendulum Wave",+ "description": "A row of pendulums with tuned periods drifts from a straight line into waves and braids, then realigns for a seamless loop.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "pendulum-wave/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/pendulum-wave.tsx"+ }+ ]+ },+ {+ "name": "flow-field",+ "type": "registry:component",+ "title": "Flow Field",+ "description": "Hundreds of particles ride a seeded noise field, leaving silky fading trails in a seamless loop.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "flow-field/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/flow-field.tsx"+ }+ ]+ },+ {+ "name": "isometric-build",+ "type": "registry:component",+ "title": "Isometric Build",+ "description": "An isometric tile grid springs up row by row into a stepped block sculpture with one accent tower, then holds.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "isometric-build/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/isometric-build.tsx"+ }+ ]+ },+ {+ "name": "life-grid",+ "type": "registry:component",+ "title": "Life Grid",+ "description": "Conway's Game of Life plays out on a seeded grid, with newborn cells flashing in the accent.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "life-grid/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/life-grid.tsx"+ }+ ]+ },+ {+ "name": "string-art",+ "type": "registry:component",+ "title": "String Art",+ "description": "Threads string a ring of pins times-table style while the multiplier morphs from cardioid to nephroid and beyond.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "string-art/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/string-art.tsx"+ }+ ]+ },+ {+ "name": "topo-lines",+ "type": "registry:component",+ "title": "Topo Lines",+ "description": "Topographic contour lines around a few seeded peaks breathe and shift in a seamless loop, one contour picked out in the accent color.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "topo-lines/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/topo-lines.tsx"+ }+ ]+ },+ {+ "name": "phyllotaxis",+ "type": "registry:component",+ "title": "Phyllotaxis",+ "description": "Seeds spiral out at the golden angle into a sunflower head, then an accent Fibonacci arm pulses outward.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "phyllotaxis/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/phyllotaxis.tsx"+ }+ ]+ },+ {+ "name": "hyperspace",+ "type": "registry:component",+ "title": "Hyperspace",+ "description": "A deterministic starfield stretches into radial streaks, the scene tunnels forward and a white flash at the cut reveals the next scene.",+ "dependencies": ["remotion", "@remotion/transitions"],+ "files": [+ {+ "path": "hyperspace/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/hyperspace.tsx"+ }+ ]+ },+ {+ "name": "parallax-depth",+ "type": "registry:component",+ "title": "Parallax Depth",+ "description": "A flat landscape built from depth layers trucks sideways with a gentle push-in, near layers sliding faster than far ones.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "parallax-depth/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/parallax-depth.tsx"+ }+ ]+ },+ {+ "name": "dolly-zoom",+ "type": "registry:component",+ "title": "Dolly Zoom",+ "description": "The vertigo shot: a perspective corridor with a red door stretches deeper while the subject in the center holds its exact size.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "dolly-zoom/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/dolly-zoom.tsx"+ }+ ]+ },+ {+ "name": "turntable",+ "type": "registry:component",+ "title": "Turntable",+ "description": "A product card spins on an invisible turntable through front, edge and back in real 3D, with face shading and a breathing floor shadow.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "turntable/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/turntable.tsx"+ }+ ]+ },+ {+ "name": "gravity-pile",+ "type": "registry:component",+ "title": "Gravity Pile",+ "description": "Seeded circles, squares and triangles rain down, bounce off the floor and each other, and settle into a heap.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "gravity-pile/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/gravity-pile.tsx"+ }+ ]+ },+ {+ "name": "cloth-reveal",+ "type": "registry:component",+ "title": "Cloth Reveal",+ "description": "A satin sheet draped over the content is yanked from one corner, folding and fluttering as a simulated cloth before it clears the frame.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "cloth-reveal/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/cloth-reveal.tsx"+ }+ ]+ },+ {+ "name": "exploded-view",+ "type": "registry:component",+ "title": "Exploded View",+ "description": "An isometric stack of slabs springs apart with leader lines and labels, holds, then clicks back together.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "exploded-view/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/exploded-view.tsx"+ }+ ]+ },+ {+ "name": "tiny-planet",+ "type": "registry:component",+ "title": "Tiny Planet",+ "description": "A seeded flat skyline bends into a tiny planet through a polar remap, then slowly spins beside a red sun.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "tiny-planet/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/tiny-planet.tsx"+ }+ ]+ },+ {+ "name": "impact-shake",+ "type": "registry:component",+ "title": "Impact Shake",+ "description": "Heavy content slams in from above with squash, a damped camera jolt, a two-frame RGB split and dust puffs kicking out sideways.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "impact-shake/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/impact-shake.tsx"+ }+ ]+ },+ {+ "name": "riso-print",+ "type": "registry:component",+ "title": "Riso Print",+ "description": "A two-ink risograph print: the accent plate slides in off-register, wobbles and settles a hair out of alignment over grainy paper.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "riso-print/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/riso-print.tsx"+ }+ ]+ },+ {+ "name": "line-boil",+ "type": "registry:component",+ "title": "Line Boil",+ "description": "A hand-drawn outline boils like a cel animation, redrawn every few frames with a varying pen weight, then fills with color while it keeps boiling.",+ "dependencies": ["remotion", "@remotion/paths"],+ "files": [+ {+ "path": "line-boil/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/line-boil.tsx"+ }+ ]+ },+ {+ "name": "blueprint",+ "type": "registry:component",+ "title": "Blueprint",+ "description": "The product wipes left to right into a technical drawing: blueprint grid, white linework, dimension lines with ticks, labels and a red callout.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "blueprint/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/blueprint.tsx"+ }+ ]+ },+ {+ "name": "duotone-beat",+ "type": "registry:component",+ "title": "Duotone Beat",+ "description": "A two-ink halftone portrait swaps its ink pair on every beat, with a punch-in on the downbeat and a bar indicator.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "duotone-beat/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/duotone-beat.tsx"+ }+ ]+ },+ {+ "name": "comic-panels",+ "type": "registry:component",+ "title": "Comic Panels",+ "description": "The frame cracks into a three-panel comic page with speed lines, red halftone and a starburst, then the action panel bursts into a full-frame POW.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "comic-panels/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/comic-panels.tsx"+ }+ ]+ },+ {+ "name": "long-shadow",+ "type": "registry:component",+ "title": "Long Shadow",+ "description": "A flat icon casts a long shadow to the frame edge, then the light swings and the shadow sweeps around on a spring.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "long-shadow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/long-shadow.tsx"+ }+ ]+ },+ {+ "name": "synthwave",+ "type": "registry:component",+ "title": "Synthwave",+ "description": "A retro neon horizon: a scrolling perspective grid, a rising striped sun and mountain ranges that slide in.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "synthwave/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/synthwave.tsx"+ }+ ]+ },+ {+ "name": "brick-mosaic",+ "type": "registry:component",+ "title": "Brick Mosaic",+ "description": "Toy bricks drop in row by row from the bottom with a tiny bounce, rebuilding a pixel-art logo on a baseplate.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "brick-mosaic/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/brick-mosaic.tsx"+ }+ ]+ },+ {+ "name": "x-ray-scan",+ "type": "registry:component",+ "title": "X-Ray Scan",+ "description": "A glowing scanner bar sweeps across a device, turning the shell dark and revealing white-line internals with one part in red.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "x-ray-scan/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/x-ray-scan.tsx"+ }+ ]}]}diff --git a/registry/remocn/riso-print/config.ts b/registry/remocn/riso-print/config.tsnew file mode 100644index 00000000..b73e50b8--- /dev/null+++ b/registry/remocn/riso-print/config.ts@@ -0,0 +1,45 @@+import { risoPrintExampleCode } from "@/components/docs/examples/riso-print-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const risoPrintConfig: ComponentConfig = {+ componentName: "RisoPrint",+ importPath: "@/components/remocn/riso-print",+ controls: {+ keyInk: { type: "color", default: "#111111", description: "Key ink" },+ accentInk: {+ type: "color",+ default: "#E5322D",+ description: "Accent ink",+ },+ paper: { type: "color", default: "#F2F0EA", description: "Paper" },+ grain: {+ type: "number",+ default: 0.5,+ min: 0,+ max: 1,+ step: 0.05,+ description: "Grain",+ hiddenFromList: false,+ },+ jitter: {+ type: "number",+ default: 1.2,+ min: 0,+ max: 6,+ step: 0.1,+ description: "Jitter",+ hiddenFromList: false,+ },+ marks: {+ type: "boolean",+ default: true,+ description: "Registration marks",+ },+ },+ durationInFrames: 75,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#F2F0EA" },+ snippet: risoPrintExampleCode,+};diff --git a/registry/remocn/riso-print/index.tsx b/registry/remocn/riso-print/index.tsxnew file mode 100644index 00000000..03e2dfc0--- /dev/null+++ b/registry/remocn/riso-print/index.tsx@@ -0,0 +1,302 @@+"use client";++import { type ReactNode, useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type RisoPrintProps = {+ /** Subject printed in both inks. Dark tones go to the key plate, warm tones to the accent plate. */+ children?: ReactNode;+ /** [key ink, accent ink]. */+ inks?: [string, string];+ /** Key ink. Overrides `inks[0]` when set. */+ keyInk?: string;+ /** Accent ink. Overrides `inks[1]` when set. */+ accentInk?: string;+ paper?: string;+ /** Final misregistration of the accent plate, in px at 720p. */+ offset?: [number, number];+ /** Ink speckle and paper tooth, 0 to 1. */+ grain?: number;+ /** Stop-motion wobble of the accent plate after it settles, in px at 720p. 0 disables. */+ jitter?: number;+ /** Print registration marks in the corners. */+ marks?: boolean;+ speed?: number;+};++export const risoPrintDefaults = {+ inks: ["#111111", "#E5322D"] as [string, string],+ paper: "#F2F0EA",+ offset: [7, -5] as [number, number],+ grain: 0.5,+ jitter: 1.2,+ marks: true,+ speed: 1,+};++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++// Coverage = A - channel: the key plate takes everything without red (blacks,+// blues), the accent plate everything without green (reds, blacks). Black+// therefore prints in both plates, like a rich black on a real riso.+const plateMatrix = (channel: 0 | 1) => {+ const k = 1.4;+ const r = channel === 0 ? -k : 0;+ const g = channel === 1 ? -k : 0;+ return `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${r} ${g} 0 ${k} -0.2`;+};++function PosterPlate({+ plate,+ width,+ height,+}: {+ plate: 0 | 1;+ width: number;+ height: number;+}) {+ const s = Math.min(width, height);+ const cx = width / 2;+ const cy = height / 2;+ return (+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ role="img"+ aria-label="Geometric poster"+ >+ {plate === 0 ? (+ <g fill="#000">+ <rect+ x={cx - 0.42 * s}+ y={cy - 0.1 * s}+ width={0.36 * s}+ height={0.36 * s}+ />+ {[0, 1, 2].map((i) => (+ <rect+ key={i}+ x={cx + 0.2 * s}+ y={cy + 0.2 * s + i * 0.045 * s}+ width={(0.3 - i * 0.07) * s}+ height={0.018 * s}+ />+ ))}+ </g>+ ) : (+ <g fill="#000">+ <circle cx={cx + 0.08 * s} cy={cy - 0.04 * s} r={0.26 * s} />+ <rect+ x={cx - 0.46 * s}+ y={cy - 0.34 * s}+ width={0.07 * s}+ height={0.07 * s}+ />+ </g>+ )}+ </svg>+ );+}++function Marks({ width, height }: { width: number; height: number }) {+ const s = Math.min(width, height);+ const m = 0.06 * s;+ const r = 0.018 * s;+ const points = [+ [m, m],+ [width - m, m],+ [m, height - m],+ [width - m, height - m],+ ];+ return (+ <svg+ width={width}+ height={height}+ style={{ position: "absolute", inset: 0 }}+ role="img"+ aria-label="Registration marks"+ >+ {points.map(([x, y]) => (+ <g key={`${x}-${y}`} stroke="#000" strokeWidth={0.0035 * s} fill="none">+ <circle cx={x} cy={y} r={r} />+ <line x1={x - r * 1.7} y1={y} x2={x + r * 1.7} y2={y} />+ <line x1={x} y1={y - r * 1.7} x2={x} y2={y + r * 1.7} />+ </g>+ ))}+ </svg>+ );+}++export function RisoPrint({+ children,+ inks: inksProp = risoPrintDefaults.inks,+ keyInk,+ accentInk,+ paper = risoPrintDefaults.paper,+ offset = risoPrintDefaults.offset,+ grain = risoPrintDefaults.grain,+ jitter = risoPrintDefaults.jitter,+ marks = risoPrintDefaults.marks,+ speed = risoPrintDefaults.speed,+}: RisoPrintProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const inks: [string, string] = [+ keyInk ?? inksProp[0],+ accentInk ?? inksProp[1],+ ];+ const unit = Math.min(width, height) / 720;+ const t = (frame / fps) * 30 * speed;+ const g = Math.max(0, Math.min(1, grain));++ // Key plate: the ink hits the paper.+ const press = interpolate(t, [0, 8], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });++ // Accent plate: slides in off-register, wobbles, settles a hair off.+ const slide = spring({+ frame: t - 4,+ fps: 30,+ config: { damping: 9, stiffness: 120, mass: 0.8 },+ });+ const step = Math.floor(t / 4);+ const jitterIn = interpolate(t, [26, 34], [0, 1], clamp);+ const jx = (random(`riso-jx-${step}`) - 0.5) * 2 * jitter * unit * jitterIn;+ const jy = (random(`riso-jy-${step}`) - 0.5) * 2 * jitter * unit * jitterIn;+ const ax = interpolate(slide, [0, 1], [-0.22 * width, offset[0] * unit]) + jx;+ const ay = interpolate(slide, [0, 1], [0.08 * height, offset[1] * unit]) + jy;+ const arot = interpolate(slide, [0, 1], [-4, 0.35]);+ const aopacity = interpolate(t, [4, 8], [0, 1], clamp);++ const speckle = `0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ${-5 * g} 0 0 0 ${1 + 5 * g * 0.56}`;+ const plates = [+ {+ ink: inks[0],+ transform: `scale(${interpolate(press, [0, 1], [1.035, 1])})`,+ opacity: press * 0.94,+ },+ {+ ink: inks[1],+ transform: `translate(${ax}px, ${ay}px) rotate(${arot}deg)`,+ opacity: aopacity * 0.9,+ },+ ];++ return (+ <AbsoluteFill style={{ backgroundColor: paper, overflow: "hidden" }}>+ <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>+ <defs>+ {plates.map((plate, i) => (+ <filter+ key={plate.ink + i}+ id={`${id}-plate-${i}`}+ x="0"+ y="0"+ width="1"+ height="1"+ colorInterpolationFilters="sRGB"+ >+ <feColorMatrix+ in="SourceGraphic"+ type="matrix"+ values={plateMatrix(i as 0 | 1)}+ result="coverage"+ />+ <feTurbulence+ type="fractalNoise"+ baseFrequency={0.9 / unit}+ numOctaves={2}+ seed={7 + i * 13}+ result="noise"+ />+ <feColorMatrix+ in="noise"+ type="matrix"+ values={speckle}+ result="mask"+ />+ <feComposite+ in="coverage"+ in2="mask"+ operator="in"+ result="inked"+ />+ <feFlood floodColor={plate.ink} result="ink" />+ <feComposite in="ink" in2="inked" operator="in" />+ </filter>+ ))}+ <filter+ id={`${id}-paper`}+ x="0"+ y="0"+ width="1"+ height="1"+ colorInterpolationFilters="sRGB"+ >+ <feTurbulence+ type="fractalNoise"+ baseFrequency={0.65 / unit}+ numOctaves={3}+ seed={3}+ />+ <feColorMatrix+ type="matrix"+ values={`0 0 0 0 0.25 0 0 0 0 0.2 0 0 0 0 0.12 ${0.5 * g} 0 0 0 ${-0.18 * g}`}+ />+ </filter>+ </defs>+ </svg>+ {plates.map((plate, i) => (+ <AbsoluteFill+ key={plate.ink + i}+ style={{+ filter: `url(#${id}-plate-${i})`,+ mixBlendMode: "multiply",+ opacity: plate.opacity,+ transform: plate.transform,+ }}+ >+ {children ? (+ <AbsoluteFill+ style={{ alignItems: "center", justifyContent: "center" }}+ >+ {children}+ </AbsoluteFill>+ ) : (+ <PosterPlate plate={i as 0 | 1} width={width} height={height} />+ )}+ {marks ? <Marks width={width} height={height} /> : null}+ </AbsoluteFill>+ ))}+ <svg+ width={width}+ height={height}+ style={{ position: "absolute", inset: 0, mixBlendMode: "multiply" }}+ aria-hidden+ >+ <rect+ width={width}+ height={height}+ fill="#fff"+ filter={`url(#${id}-paper)`}+ />+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/spotlight/config.ts b/registry/remocn/spotlight/config.tsnew file mode 100644index 00000000..cdbe5735--- /dev/null+++ b/registry/remocn/spotlight/config.ts@@ -0,0 +1,26 @@+import { spotlightExampleCode } from "@/components/docs/examples/spotlight-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const spotlightConfig: ComponentConfig = {+ componentName: "Spotlight",+ importPath: "@/components/remocn/spotlight",+ controls: {+ dim: {+ type: "number",+ default: 0.16,+ min: 0,+ max: 0.6,+ step: 0.01,+ description: "Unlit brightness",+ hiddenFromList: false,+ },+ beamColor: { type: "color", default: "#FFFFFF", description: "Beam" },+ stageColor: { type: "color", default: "#111111", description: "Stage" },+ },+ durationInFrames: 80,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: spotlightExampleCode,+};diff --git a/registry/remocn/spotlight/index.tsx b/registry/remocn/spotlight/index.tsxnew file mode 100644index 00000000..3c7c22a7--- /dev/null+++ b/registry/remocn/spotlight/index.tsx@@ -0,0 +1,223 @@+"use client";++import type React from "react";+import { useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ spring,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type SpotlightProps = {+ /** Lockup the beam lands on. Falls back to a placeholder "remocn" lockup. */+ children?: React.ReactNode;+ /** Color of the light cone and floor pool. */+ beamColor?: string;+ /** Dark stage behind everything. */+ stageColor?: string;+ /** Brightness of the unlit lockup, 0 to 1. */+ dim?: number;+ speed?: number;+};++export const spotlightDefaults = {+ beamColor: "#FFFFFF",+ stageColor: "#111111",+ dim: 0.16,+ speed: 1,+};++const SEARCH = 12;+const SWING = 26;+const HOUSE = 38;+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++const PLACEHOLDER_FONT =+ "-apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif";++// Neutral lockup shown when no children are passed.+function PlaceholderLockup({+ mark,+ dot,+ text,+ scale = 1,+}: {+ mark: string;+ dot: string;+ text: string;+ scale?: number;+}) {+ return (+ <div style={{ display: "flex", alignItems: "center", gap: 28 * scale }}>+ <div+ style={{+ width: 120 * scale,+ height: 120 * scale,+ borderRadius: 32 * scale,+ backgroundColor: mark,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36 * scale,+ height: 36 * scale,+ borderRadius: "50%",+ backgroundColor: dot,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: PLACEHOLDER_FONT,+ fontSize: 104 * scale,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: text,+ }}+ >+ remocn+ </span>+ </div>+ );+}++export function Spotlight(props: SpotlightProps) {+ const { children, beamColor, stageColor, dim, speed } = {+ ...spotlightDefaults,+ ...props,+ };+ const uid = `spotlight-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`;+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const t = frame * Math.max(0, speed);++ // Beam target, as a fraction of the width: search left, overshoot right, land.+ let target: number;+ if (t < SEARCH) {+ target = interpolate(t, [0, SEARCH], [0.14, 0.27], {+ ...clamp,+ easing: Easing.inOut(Easing.sin),+ });+ } else if (t < SWING) {+ target = interpolate(t, [SEARCH, SWING], [0.27, 0.74], {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });+ } else {+ const land = spring({+ frame: t - SWING,+ fps,+ config: { damping: 11, stiffness: 120, mass: 0.8 },+ });+ target = 0.74 + (0.5 - 0.74) * land;+ }++ const tx = target * width;+ const apexX = width / 2;+ const apexY = -height * 0.12;+ const floorY = height * 0.8;+ const spread = width * 0.27;+ const apexHalf = width * 0.012;++ const beamOn = interpolate(t, [0, 5], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.quad),+ });+ const house = interpolate(t, [HOUSE, HOUSE + 12], [0, 1], {+ ...clamp,+ easing: Easing.inOut(Easing.sin),+ });+ const coverage = Math.max(0, 1 - Math.abs(target - 0.5) / 0.3);+ const lit = Math.max(+ dim,+ dim + (1 - dim) * Easing.inOut(Easing.quad)(coverage) * beamOn,+ );+ const brightness =+ t >= SWING + 10 ? Math.max(lit, Math.min(1, lit + house)) : lit;+ const blur = width * 0.012;++ return (+ <AbsoluteFill style={{ backgroundColor: stageColor }}>+ <AbsoluteFill+ style={{+ background: `radial-gradient(ellipse 80% 70% at 50% 40%, ${beamColor} 0%, transparent 70%)`,+ opacity: 0.09 * house,+ }}+ />+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ >+ <defs>+ <linearGradient+ id={`${uid}-beam`}+ gradientUnits="userSpaceOnUse"+ x1={0}+ y1={apexY}+ x2={0}+ y2={floorY}+ >+ <stop offset="0" stopColor={beamColor} stopOpacity={0.55} />+ <stop offset="0.6" stopColor={beamColor} stopOpacity={0.2} />+ <stop offset="1" stopColor={beamColor} stopOpacity={0.12} />+ </linearGradient>+ <radialGradient id={`${uid}-pool`}>+ <stop offset="0" stopColor={beamColor} stopOpacity={0.45} />+ <stop offset="0.6" stopColor={beamColor} stopOpacity={0.14} />+ <stop offset="1" stopColor={beamColor} stopOpacity={0} />+ </radialGradient>+ <filter+ id={`${uid}-soft`}+ x={-width}+ y={-height}+ width={width * 3}+ height={height * 3}+ filterUnits="userSpaceOnUse"+ >+ <feGaussianBlur stdDeviation={blur} />+ </filter>+ </defs>+ <g opacity={beamOn * (1 - 0.35 * house)}>+ <ellipse+ cx={tx}+ cy={floorY}+ rx={spread * 1.25}+ ry={height * 0.07}+ fill={`url(#${uid}-pool)`}+ />+ <polygon+ points={`${apexX - apexHalf},${apexY} ${apexX + apexHalf},${apexY} ${tx + spread},${floorY} ${tx - spread},${floorY}`}+ fill={`url(#${uid}-beam)`}+ filter={`url(#${uid}-soft)`}+ />+ </g>+ </svg>+ <AbsoluteFill+ style={{+ alignItems: "center",+ justifyContent: "center",+ filter: `brightness(${brightness})`,+ }}+ >+ {children ?? (+ <PlaceholderLockup+ mark={beamColor}+ dot={stageColor}+ text={beamColor}+ />+ )}+ </AbsoluteFill>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/string-art/config.ts b/registry/remocn/string-art/config.tsnew file mode 100644index 00000000..76019a52--- /dev/null+++ b/registry/remocn/string-art/config.ts@@ -0,0 +1,87 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" ? value : fallback;++// Stringing, a 24-frame pause, the morph, then a short hold on the last figure.+function durationOf(values: Record<string, unknown>) {+ const speed = numberOr(values.speed, 1);+ const motion =+ numberOr(values.stringFrames, 60) + 24 + numberOr(values.morphFrames, 240);+ return (speed > 0 ? Math.ceil(motion / speed) : motion) + 16;+}++export const stringArtConfig: ComponentConfig = {+ componentName: "StringArt",+ importPath: "@/components/remocn/string-art",+ controls: {+ pins: {+ type: "number",+ default: 200,+ min: 40,+ max: 400,+ step: 10,+ description: "Pins",+ hiddenFromList: false,+ },+ from: {+ type: "number",+ default: 2,+ min: 1,+ max: 12,+ step: 0.5,+ description: "From multiplier",+ hiddenFromList: false,+ },+ to: {+ type: "number",+ default: 4,+ min: 1,+ max: 12,+ step: 0.5,+ description: "To multiplier",+ hiddenFromList: false,+ },+ morphFrames: {+ type: "number",+ default: 240,+ min: 30,+ max: 600,+ step: 10,+ description: "Morph frames",+ hiddenFromList: false,+ },+ sweep: {+ type: "number",+ default: 0.08,+ min: 0,+ max: 0.3,+ step: 0.01,+ description: "Accent sweep",+ hiddenFromList: false,+ },+ threadOpacity: {+ type: "number",+ default: 0.42,+ min: 0.1,+ max: 1,+ step: 0.02,+ description: "Thread opacity",+ hiddenFromList: false,+ },+ showLabel: { type: "boolean", default: true, description: "Label" },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Threads" },+ accent: { type: "color", default: "#E5322D", description: "Accent" },+ },+ durationInFrames: 340,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/string-art/index.tsx b/registry/remocn/string-art/index.tsxnew file mode 100644index 00000000..45564069--- /dev/null+++ b/registry/remocn/string-art/index.tsx@@ -0,0 +1,210 @@+"use client";++import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type StringArtProps = {+ /** Pins around the ring. */+ pins?: number;+ /** Multiplier at the start (2 draws a cardioid). */+ from?: number;+ /** Multiplier at the end (3 is a nephroid, 4 a three-cusp epicycloid). */+ to?: number;+ /** Frames for the threads to be strung, one pin after another. */+ stringFrames?: number;+ /** Frames for the multiplier to drift from `from` to `to`. */+ morphFrames?: number;+ /** Length of the accent sweep, as a share of all threads; 0 disables. */+ sweep?: number;+ /** Pins per frame the accent sweep travels once the threads are strung. */+ sweepSpeed?: number;+ /** Thread opacity, 0 to 1. */+ threadOpacity?: number;+ /** Show the running multiplier in the corner. */+ showLabel?: boolean;+ speed?: number;+ background?: string;+ color?: string;+ accent?: string;+};++export const stringArtDefaults: Required<StringArtProps> = {+ pins: 200,+ from: 2,+ to: 4,+ stringFrames: 60,+ morphFrames: 240,+ sweep: 0.08,+ sweepSpeed: 0.9,+ threadOpacity: 0.42,+ showLabel: true,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+};++const TAU = Math.PI * 2;+const MORPH_DELAY = 24;+// Share of each integer step spent holding on the clean integer figure.+const HOLD = 0.3;+const SWEEP_BUCKETS = 4;+const fmt = (n: number) => Math.round(n * 10) / 10;++export function StringArt({+ pins = stringArtDefaults.pins,+ from = stringArtDefaults.from,+ to = stringArtDefaults.to,+ stringFrames: stringFramesProp = stringArtDefaults.stringFrames,+ morphFrames: morphFramesProp = stringArtDefaults.morphFrames,+ sweep = stringArtDefaults.sweep,+ sweepSpeed = stringArtDefaults.sweepSpeed,+ threadOpacity = stringArtDefaults.threadOpacity,+ showLabel = stringArtDefaults.showLabel,+ speed = stringArtDefaults.speed,+ background = stringArtDefaults.background,+ color = stringArtDefaults.color,+ accent = stringArtDefaults.accent,+}: StringArtProps) {+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const n = Math.max(8, Math.round(pins));+ const unit = Math.min(width, height) / 720;+ const radius = Math.min(width, height) * 0.42;+ const cx = width / 2;+ const cy = height / 2;+ const time = frame * speed;+ // interpolate() needs a strictly increasing range.+ const stringFrames = Math.max(1, stringFramesProp);+ const morphFrames = Math.max(1, morphFramesProp);++ const strung = interpolate(time, [0, stringFrames], [0, n], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.inOut(Easing.quad),+ });+ const morphStart = stringFrames + MORPH_DELAY;+ // The multiplier walks through each integer table (cardioid, nephroid, ...)+ // with an eased step and a short hold on every clean figure.+ const span = to - from;+ const steps = Math.max(1, Math.ceil(Math.abs(span) - 1e-6));+ const u =+ interpolate(time, [morphStart, morphStart + morphFrames], [0, steps], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ }) - 1e-9;+ const step = Math.max(0, Math.floor(u));+ const within = Easing.inOut(Easing.cubic)(+ Math.min(1, Math.max(0, (u - step) / (1 - HOLD))),+ );+ const k = from + (span * Math.min(steps, step + within)) / steps;++ // Pin 0 sits on the left so the cardioid cusp points left and the figure is+ // symmetric about the horizontal axis. Angles stay continuous in k, so the+ // pattern morphs smoothly instead of snapping between integer tables.+ const point = (index: number) => {+ const a = Math.PI + (TAU * index) / n;+ return { x: cx + Math.cos(a) * radius, y: cy + Math.sin(a) * radius };+ };+ const xy = (p: { x: number; y: number }) => `${fmt(p.x)} ${fmt(p.y)}`;++ let threads = "";+ const accents: string[] = new Array(SWEEP_BUCKETS).fill("");+ const whole = Math.floor(strung);+ // The accent sweep rides the stringing head, then keeps circling the ring.+ const head = strung + Math.max(0, time - stringFrames) * sweepSpeed;+ const tail = Math.max(0, sweep) * n;+ for (let i = 0; i < Math.ceil(strung); i++) {+ const start = point(i);+ const end = point(k * i);+ // The thread being strung right now grows from its pin to the target.+ const f = i < whole ? 1 : strung - whole;+ const tip = {+ x: start.x + (end.x - start.x) * f,+ y: start.y + (end.y - start.y) * f,+ };+ const d = `M ${xy(start)} L ${xy(tip)} `;+ const behind = (((head - i) % n) + n) % n;+ if (tail > 0 && behind < tail) {+ accents[+ Math.min(SWEEP_BUCKETS - 1, Math.floor((behind / tail) * SWEEP_BUCKETS))+ ] += d;+ } else threads += d;+ }++ let pinDots = "";+ const pr = 1.6 * unit;+ for (let i = 0; i < n; i++) {+ const { x, y } = point(i);+ pinDots += `M ${fmt(x - pr)} ${fmt(y)} a ${fmt(pr)} ${fmt(pr)} 0 1 0 ${fmt(pr * 2)} 0 a ${fmt(pr)} ${fmt(pr)} 0 1 0 ${fmt(-pr * 2)} 0 `;+ }+ const pinsIn = interpolate(time, [0, 12], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ });+ const labelIn = interpolate(+ time,+ [stringFrames - 10, stringFrames + 6],+ [0, 1],+ {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ },+ );++ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="String art times table"+ style={{ display: "block" }}+ >+ <path d={pinDots} fill={color} fillOpacity={0.55 * pinsIn} />+ <path+ d={threads}+ fill="none"+ stroke={color}+ strokeOpacity={threadOpacity}+ strokeWidth={unit}+ strokeLinecap="round"+ />+ <g fill="none" stroke={accent} strokeLinecap="round">+ {accents.map((d, b) => (+ <path+ key={b}+ d={d}+ strokeOpacity={1 - b / SWEEP_BUCKETS}+ strokeWidth={unit * (1.6 - b * 0.15)}+ />+ ))}+ </g>+ </svg>+ {showLabel ? (+ <div+ style={{+ position: "absolute",+ left: width * 0.06,+ bottom: height * 0.08,+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",+ fontSize: 22 * unit,+ letterSpacing: "0.04em",+ color,+ opacity: 0.7 * labelIn,+ fontVariantNumeric: "tabular-nums",+ }}+ >+ <span style={{ color: accent }}>i → </span>+ {k.toFixed(2)} · i mod {n}+ </div>+ ) : null}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/synthwave/config.ts b/registry/remocn/synthwave/config.tsnew file mode 100644index 00000000..258aa0e6--- /dev/null+++ b/registry/remocn/synthwave/config.ts@@ -0,0 +1,50 @@+import { synthwaveExampleCode } from "@/components/docs/examples/synthwave-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const synthwaveConfig: ComponentConfig = {+ componentName: "Synthwave",+ importPath: "@/components/remocn/synthwave",+ controls: {+ gridSpeed: {+ type: "number",+ default: 2,+ min: 0,+ max: 6,+ step: 0.25,+ description: "Grid speed",+ hiddenFromList: false,+ },+ horizon: {+ type: "number",+ default: 0.6,+ min: 0.4,+ max: 0.8,+ step: 0.01,+ description: "Horizon",+ hiddenFromList: false,+ },+ sunStripes: {+ type: "boolean",+ default: true,+ description: "Scrolling sun stripes",+ },+ grid: { type: "color", default: "#E5322D", description: "Grid" },+ sunTop: { type: "color", default: "#FFC46B", description: "Sun top" },+ sunBottom: {+ type: "color",+ default: "#E5322D",+ description: "Sun bottom",+ },+ skyHorizon: {+ type: "color",+ default: "#3B0C10",+ description: "Horizon glow",+ },+ },+ durationInFrames: 120,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#08080B" },+ snippet: synthwaveExampleCode,+};diff --git a/registry/remocn/synthwave/index.tsx b/registry/remocn/synthwave/index.tsxnew file mode 100644index 00000000..18815b04--- /dev/null+++ b/registry/remocn/synthwave/index.tsx@@ -0,0 +1,305 @@+"use client";++import { useId, useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type SynthwaveColors = {+ skyTop: string;+ skyHorizon: string;+ sunTop: string;+ sunBottom: string;+ grid: string;+ floor: string;+ mountainsBack: string;+ mountainsFront: string;+};++export type SynthwaveProps = {+ colors?: Partial<SynthwaveColors>;+ /** Grid line color. Overrides `colors.grid` when set. */+ grid?: string;+ /** Top of the sun gradient. Overrides `colors.sunTop` when set. */+ sunTop?: string;+ /** Bottom of the sun gradient. Overrides `colors.sunBottom` when set. */+ sunBottom?: string;+ /** Sky glow at the horizon. Overrides `colors.skyHorizon` when set. */+ skyHorizon?: string;+ /** Grid rows that pass the viewer per second. */+ gridSpeed?: number;+ /** Horizon height as a fraction of the frame. */+ horizon?: number;+ /** Scroll the sun stripes downward. */+ sunStripes?: boolean;+ speed?: number;+};++export const synthwaveDefaults = {+ colors: {+ skyTop: "#08080B",+ skyHorizon: "#3B0C10",+ sunTop: "#FFC46B",+ sunBottom: "#E5322D",+ grid: "#E5322D",+ floor: "#0A0A0C",+ mountainsBack: "#2A0A0E",+ mountainsFront: "#111111",+ } as SynthwaveColors,+ gridSpeed: 2,+ horizon: 0.6,+ sunStripes: true,+ speed: 1,+};++/** Frames until the sun and mountains are in place; the grid loops forever. */+export const synthwaveLength = 40;++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++function ridge(+ seed: string,+ width: number,+ base: number,+ peak: number,+ count: number,+) {+ // Spans well past both edges so the slide never exposes an end.+ const points: string[] = [`${-0.4 * width},${base}`];+ for (let i = 0; i <= count; i++) {+ const x = -0.4 * width + (i / count) * 1.8 * width;+ const center = Math.min(1, Math.abs(x - width / 2) / (0.45 * width));+ const valley = 0.18 + 0.82 * center * center;+ const jag = 0.45 + 0.55 * random(`${seed}-${i}`);+ const y = base - peak * valley * (i % 2 === 0 ? jag : jag * 0.45);+ points.push(`${x},${y}`);+ }+ points.push(`${1.4 * width},${base}`);+ return points.join(" ");+}++export function Synthwave({+ colors,+ grid,+ sunTop,+ sunBottom,+ skyHorizon,+ gridSpeed = synthwaveDefaults.gridSpeed,+ horizon = synthwaveDefaults.horizon,+ sunStripes = synthwaveDefaults.sunStripes,+ speed = synthwaveDefaults.speed,+}: SynthwaveProps) {+ const frame = useCurrentFrame();+ const { width: W, height: H, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const merged = { ...synthwaveDefaults.colors, ...colors };+ const c: SynthwaveColors = {+ ...merged,+ grid: grid ?? merged.grid,+ sunTop: sunTop ?? merged.sunTop,+ sunBottom: sunBottom ?? merged.sunBottom,+ skyHorizon: skyHorizon ?? merged.skyHorizon,+ };+ const u = Math.min(W, H) / 720;+ const t = (frame / fps) * 30 * speed;+ const cx = W / 2;+ const yh = horizon * H;+ const floorDepth = H - yh;++ // Floor: screen y = yh + floorDepth / z, so z = 1 is the bottom edge.+ const rowGap = 0.5;+ const phase = ((((t / 30) * gridSpeed) % 1) + 1) % 1;+ const rows: { y: number; o: number }[] = [];+ for (let k = 0; k < 70; k++) {+ const z = 0.7 + (k + 1 - phase) * rowGap;+ const y = yh + floorDepth / z;+ if (y > H + 4 * u) continue;+ rows.push({ y, o: interpolate(z, [1, 14, 30], [1, 0.35, 0], clamp) });+ }+ const columns = Array.from({ length: 23 }, (_, i) => i - 11);+ const colSpread = W * 0.16;+ const nearZ = 0.35;++ const rise = interpolate(t, [0, 40], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const R = 0.27 * H;+ const sunY = interpolate(rise, [0, 1], [yh + R * 1.05, yh - R * 0.42]);+ const stripePhase = sunStripes ? (((t / 36) % 1) + 1) % 1 : 0;+ const stripes = Array.from({ length: 7 }, (_, i) => {+ const p = (i + stripePhase) / 7;+ const y = sunY + R * (-0.05 + p * 1.05);+ const h = R * (0.012 + 0.09 * p);+ return { y: y - h / 2, h };+ });++ const back = useMemo(+ () => ridge("synthwave-back", W, yh, 0.26 * H, 27),+ [W, H, yh],+ );+ const front = useMemo(+ () => ridge("synthwave-front", W, yh, 0.15 * H, 39),+ [W, H, yh],+ );+ // Ranges slide in sideways while rising from behind the horizon.+ const slideBack = interpolate(t, [4, 34], [1, 0], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const slideFront = interpolate(t, [8, 38], [1, 0], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ const stars = Array.from({ length: 70 }, (_, i) => ({+ x: random(`synthwave-sx-${i}`) * W,+ y: random(`synthwave-sy-${i}`) * yh * 0.8,+ r: (0.6 + random(`synthwave-sr-${i}`) * 1.4) * u,+ o:+ 0.25 ++ 0.5 * (0.5 + 0.5 * Math.sin(t * 0.15 + random(`synthwave-sp-${i}`) * 9)),+ }));++ return (+ <AbsoluteFill style={{ backgroundColor: c.floor, overflow: "hidden" }}>+ <svg width={W} height={H} viewBox={`0 0 ${W} ${H}`} aria-hidden>+ <defs>+ <linearGradient id={`${id}-sky`} x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stopColor={c.skyTop} />+ <stop offset="0.55" stopColor={c.skyTop} />+ <stop offset="1" stopColor={c.skyHorizon} />+ </linearGradient>+ <linearGradient id={`${id}-sun`} x1="0" y1="0" x2="0" y2="1">+ <stop offset="0.1" stopColor={c.sunTop} />+ <stop offset="0.85" stopColor={c.sunBottom} />+ </linearGradient>+ <linearGradient id={`${id}-floor`} x1="0" y1="0" x2="0" y2="1">+ <stop offset="0" stopColor={c.skyHorizon} />+ <stop offset="0.25" stopColor={c.floor} />+ </linearGradient>+ <mask id={`${id}-stripes`}>+ <rect width={W} height={H} fill="#fff" />+ {stripes.map((s, i) => (+ <rect key={i} x={0} y={s.y} width={W} height={s.h} fill="#000" />+ ))}+ </mask>+ <clipPath id={`${id}-above`}>+ <rect width={W} height={yh} />+ </clipPath>+ <filter+ id={`${id}-glow`}+ x="-20%"+ y="-20%"+ width="140%"+ height="140%"+ >+ <feGaussianBlur stdDeviation={4 * u} result="blur" />+ <feMerge>+ <feMergeNode in="blur" />+ <feMergeNode in="blur" />+ <feMergeNode in="SourceGraphic" />+ </feMerge>+ </filter>+ <filter+ id={`${id}-haze`}+ x="-50%"+ y="-50%"+ width="200%"+ height="200%"+ >+ <feGaussianBlur stdDeviation={30 * u} />+ </filter>+ </defs>++ <rect width={W} height={yh} fill={`url(#${id}-sky)`} />+ <g fill="#FFFFFF">+ {stars.map((s, i) => (+ <circle key={i} cx={s.x} cy={s.y} r={s.r} opacity={s.o} />+ ))}+ </g>++ <g clipPath={`url(#${id}-above)`}>+ <circle+ cx={cx}+ cy={sunY}+ r={R * 1.15}+ fill={c.sunBottom}+ opacity={0.45}+ filter={`url(#${id}-haze)`}+ />+ <circle+ cx={cx}+ cy={sunY}+ r={R}+ fill={`url(#${id}-sun)`}+ mask={`url(#${id}-stripes)`}+ />+ <polygon+ points={back}+ fill={c.mountainsBack}+ transform={`translate(${-0.25 * W * slideBack} ${0.3 * H * slideBack})`}+ />+ <g+ transform={`translate(${0.25 * W * slideFront} ${0.2 * H * slideFront})`}+ >+ <polygon points={front} fill={c.mountainsFront} />+ <polyline+ points={front}+ fill="none"+ stroke={c.grid}+ strokeWidth={1.5 * u}+ strokeOpacity={0.55}+ strokeLinejoin="round"+ />+ </g>+ </g>++ <rect y={yh} width={W} height={H - yh} fill={`url(#${id}-floor)`} />+ <g+ stroke={c.grid}+ strokeWidth={2.2 * u}+ filter={`url(#${id}-glow)`}+ fill="none"+ >+ {columns.map((j) => (+ <line+ key={j}+ x1={cx}+ y1={yh}+ x2={cx + (j * colSpread) / nearZ}+ y2={yh + floorDepth / nearZ}+ />+ ))}+ {rows.map((row, i) => (+ <line+ key={i}+ x1={0}+ y1={row.y}+ x2={W}+ y2={row.y}+ strokeOpacity={row.o}+ />+ ))}+ <line x1={0} y1={yh} x2={W} y2={yh} strokeWidth={3 * u} />+ </g>+ {/* Haze that swallows the converging lines at the horizon. */}+ <rect+ y={yh - 6 * u}+ width={W}+ height={0.12 * H}+ fill={c.skyHorizon}+ opacity={0.5}+ filter={`url(#${id}-haze)`}+ />+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/tiny-planet/config.ts b/registry/remocn/tiny-planet/config.tsnew file mode 100644index 00000000..4b6c663f--- /dev/null+++ b/registry/remocn/tiny-planet/config.ts@@ -0,0 +1,50 @@+import { tinyPlanetExampleCode } from "@/components/docs/examples/tiny-planet-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const tinyPlanetConfig: ComponentConfig = {+ componentName: "TinyPlanet",+ importPath: "@/components/remocn/tiny-planet",+ controls: {+ buildings: {+ type: "number",+ default: 26,+ min: 8,+ max: 48,+ step: 1,+ description: "Buildings",+ hiddenFromList: false,+ },+ spin: {+ type: "number",+ default: 0.7,+ min: 0,+ max: 3,+ step: 0.1,+ description: "Spin",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 4,+ min: 1,+ max: 24,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ skyColor: { type: "color", default: "#111111", description: "Sky" },+ sunColor: { type: "color", default: "#E5322D", description: "Sun" },+ buildingColor: {+ type: "color",+ default: "#FFFFFF",+ description: "Buildings",+ },+ groundColor: { type: "color", default: "#262626", description: "Ground" },+ },+ durationInFrames: 100,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: tinyPlanetExampleCode,+};diff --git a/registry/remocn/tiny-planet/index.tsx b/registry/remocn/tiny-planet/index.tsxnew file mode 100644index 00000000..84a32a4b--- /dev/null+++ b/registry/remocn/tiny-planet/index.tsx@@ -0,0 +1,224 @@+"use client";++import { useMemo } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type TinyPlanetColors = {+ sky: string;+ ground: string;+ near: string;+ far: string;+ window: string;+ sun: string;+};++export type TinyPlanetProps = {+ /** Buildings in the front row; the back row gets a matching count. */+ buildings?: number;+ seed?: number;+ /** Planet spin once bent, in degrees per frame at 30fps. */+ spin?: number;+ colors?: Partial<TinyPlanetColors>;+ /** Sky color. Overrides `colors.sky`. */+ skyColor?: string;+ /** Sun color. Overrides `colors.sun`. */+ sunColor?: string;+ /** Front-row building color. Overrides `colors.near`. */+ buildingColor?: string;+ /** Ground color. Overrides `colors.ground`. */+ groundColor?: string;+ speed?: number;+};++export const tinyPlanetDefaults = {+ buildings: 26,+ seed: 4,+ spin: 0.7,+ colors: {+ sky: "#111111",+ ground: "#262626",+ near: "#FFFFFF",+ far: "#6B6B6B",+ window: "#111111",+ sun: "#E5322D",+ } satisfies TinyPlanetColors,+ speed: 1,+};++const BEND_START = 8;+const BEND_END = 40;+const SPIN_RAMP = 14;++type Block = { s0: number; s1: number; h: number; row: 0 | 1; spire: number };++function makeCity(length: number, height: number, count: number, seed: number) {+ const blocks: Block[] = [];+ for (const row of [1, 0] as const) {+ const n = row === 1 ? Math.round(count * 0.8) : count;+ const slot = length / n;+ for (let i = 0; i < n; i++) {+ const key = `tiny-planet-${seed}-${row}-${i}`;+ const w = slot * (0.55 + random(`${key}-w`) * 0.4);+ const start =+ i * slot + random(`${key}-x`) * (slot - w) + (row ? slot * 0.5 : 0);+ const tall = random(`${key}-h`);+ const h = row+ ? height * (0.13 + tall * 0.16)+ : height * (0.05 + tall * tall * 0.15);+ const spire = random(`${key}-s`) < 0.18 ? height * 0.04 : 0;+ blocks.push({+ s0: start - length / 2,+ s1: start + w - length / 2,+ h,+ row,+ spire,+ });+ }+ }+ return blocks;+}++export function TinyPlanet({+ buildings = tinyPlanetDefaults.buildings,+ seed = tinyPlanetDefaults.seed,+ spin = tinyPlanetDefaults.spin,+ colors: colorOverrides,+ skyColor,+ sunColor,+ buildingColor,+ groundColor,+ speed = tinyPlanetDefaults.speed,+}: TinyPlanetProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const baseColors = { ...tinyPlanetDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ sky: skyColor ?? baseColors.sky,+ sun: sunColor ?? baseColors.sun,+ near: buildingColor ?? baseColors.near,+ ground: groundColor ?? baseColors.ground,+ };+ const t = (frame * speed * 30) / fps;++ // The skyline strip is exactly as long as the planet's circumference.+ const length = width;+ const radius = length / (2 * Math.PI);+ const city = useMemo(+ () => makeCity(length, height, Math.max(4, Math.round(buildings)), seed),+ [length, height, buildings, seed],+ );++ const bend = interpolate(t, [BEND_START, BEND_END], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.inOut(Easing.cubic),+ });+ // Spin eases in while the strip closes, then turns at a steady rate.+ const spinT = Math.max(0, t - (BEND_END - SPIN_RAMP));+ const turn =+ spinT < SPIN_RAMP+ ? (spin * spinT * spinT) / (2 * SPIN_RAMP)+ : spin * (spinT - SPIN_RAMP / 2);+ const rot = (turn * Math.PI) / 180;++ const kappa = Math.max(1e-5, bend / radius);+ const horizon = height * 0.7;+ const tallest = height * 0.33;+ const finalScale = (height * 0.43) / (radius + tallest);+ const scale = 1 + (finalScale - 1) * bend;+ const anchorY = horizon + (height / 2 - finalScale * radius - horizon) * bend;++ // Bend: arc-length s and height h onto a circle of curvature kappa whose+ // top sits at the pivot. kappa -> 0 is the flat skyline.+ const map = (s: number, h: number): [number, number] => {+ const a = kappa * s + rot * bend;+ const rr = 1 / kappa + h;+ const x = Math.sin(a) * rr;+ const y = 1 / kappa - Math.cos(a) * rr;+ return [width / 2 + x * scale, anchorY + y * scale];+ };+ const P = (s: number, h: number) =>+ map(s, h)+ .map((v) => v.toFixed(1))+ .join(",");++ const steps = 160;+ const depth = Math.min(1 / kappa, height * 3);+ let ground = "";+ for (let i = 0; i <= steps; i++) {+ const s = -length / 2 + (length * i) / steps;+ ground += `${i ? "L" : "M"}${P(s, 0)}`;+ }+ for (let i = steps; i >= 0; i--) {+ const s = -length / 2 + (length * i) / steps;+ ground += `L${P(s, -depth)}`;+ }++ const sunX = interpolate(bend, [0, 1], [width * 0.7, width * 0.8]);+ const sunY = interpolate(bend, [0, 1], [height * 0.36, height * 0.2]);+ const sunR = height * interpolate(bend, [0, 1], [0.12, 0.075]);++ return (+ <AbsoluteFill style={{ backgroundColor: colors.sky, overflow: "hidden" }}>+ <svg+ width={width}+ height={height}+ viewBox={`0 0 ${width} ${height}`}+ style={{ position: "absolute", inset: 0 }}+ aria-hidden+ >+ <circle cx={sunX} cy={sunY} r={sunR} fill={colors.sun} />+ {city.map((b, i) => {+ const sub = 4;+ const top: string[] = [];+ for (let k = 0; k <= sub; k++)+ top.push(P(b.s0 + ((b.s1 - b.s0) * k) / sub, b.h));+ const mid = (b.s0 + b.s1) / 2;+ const spire = b.spire+ ? ` M${P(mid - 1.5, b.h)} L${P(mid, b.h + b.spire)} L${P(mid + 1.5, b.h)}`+ : "";+ const d = `M${P(b.s0, -2)} L${top.join(" L")} L${P(b.s1, -2)} Z${spire}`;+ return (+ <path+ key={i}+ d={d}+ fill={b.row ? colors.far : colors.near}+ stroke={b.row ? colors.far : colors.near}+ strokeWidth={b.spire ? 2 * scale : 0}+ />+ );+ })}+ {city.map((b, i) => {+ if (b.row || b.h < height * 0.09) return null;+ const cols = Math.max(1, Math.floor((b.s1 - b.s0) / (height * 0.03)));+ const rows = Math.floor(b.h / (height * 0.04));+ const cells: string[] = [];+ for (let r = 0; r < rows; r++) {+ for (let c = 0; c < cols; c++) {+ if (random(`tiny-planet-${seed}-win-${i}-${r}-${c}`) < 0.55)+ continue;+ const s = b.s0 + ((b.s1 - b.s0) * (c + 0.5)) / cols;+ const h = b.h - height * 0.03 - r * height * 0.04;+ const ws = height * 0.006;+ cells.push(+ `M${P(s - ws, h)} L${P(s + ws, h)} L${P(s + ws, h - ws * 2.2)} L${P(s - ws, h - ws * 2.2)} Z`,+ );+ }+ }+ return (+ <path key={`w${i}`} d={cells.join(" ")} fill={colors.window} />+ );+ })}+ <path d={ground} fill={colors.ground} />+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/topo-lines/config.ts b/registry/remocn/topo-lines/config.tsnew file mode 100644index 00000000..da472b6d--- /dev/null+++ b/registry/remocn/topo-lines/config.ts@@ -0,0 +1,85 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++const numberOr = (value: unknown, fallback: number) =>+ typeof value === "number" ? value : fallback;++// One full loop, so the preview wraps without a seam.+function durationOf(values: Record<string, unknown>) {+ const speed = numberOr(values.speed, 1);+ const loopFrames = numberOr(values.loopFrames, 300);+ return speed > 0 ? Math.max(1, Math.round(loopFrames / speed)) : 300;+}++export const topoLinesConfig: ComponentConfig = {+ componentName: "TopoLines",+ importPath: "@/components/remocn/topo-lines",+ controls: {+ levels: {+ type: "number",+ default: 16,+ min: 4,+ max: 32,+ step: 1,+ description: "Contours",+ hiddenFromList: false,+ },+ peaks: {+ type: "number",+ default: 3,+ min: 1,+ max: 5,+ step: 1,+ description: "Peaks",+ hiddenFromList: false,+ },+ highlight: {+ type: "number",+ default: 9,+ min: -1,+ max: 31,+ step: 1,+ description: "Accent contour",+ hiddenFromList: false,+ },+ indexEvery: {+ type: "number",+ default: 4,+ min: 0,+ max: 8,+ step: 1,+ description: "Index line every",+ hiddenFromList: false,+ },+ loopFrames: {+ type: "number",+ default: 300,+ min: 90,+ max: 900,+ step: 30,+ description: "Loop frames",+ hiddenFromList: false,+ },+ seed: {+ type: "number",+ default: 2,+ min: 1,+ max: 50,+ step: 1,+ description: "Seed",+ hiddenFromList: false,+ },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ color: { type: "color", default: "#FFFFFF", description: "Contours" },+ accent: { type: "color", default: "#E5322D", description: "Accent" },+ },+ durationInFrames: 300,+ getDurationInFrames: durationOf,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+};diff --git a/registry/remocn/topo-lines/index.tsx b/registry/remocn/topo-lines/index.tsxnew file mode 100644index 00000000..f1b49659--- /dev/null+++ b/registry/remocn/topo-lines/index.tsx@@ -0,0 +1,249 @@+"use client";++import { useMemo } from "react";+import {+ AbsoluteFill,+ random,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type TopoLinesProps = {+ /** Number of contour levels. */+ levels?: number;+ /** Number of peaks in the height field (1 to 3 reads best). */+ peaks?: number;+ /** Contour drawn in the accent, counted from the lowest; -1 disables. */+ highlight?: number;+ /** Every n-th contour is a heavier index line; 0 disables. */+ indexEvery?: number;+ /** Sampling cells across the short side; higher is smoother and slower. */+ resolution?: number;+ /** Frames per seamless loop of the breathing field. */+ loopFrames?: number;+ seed?: number;+ speed?: number;+ background?: string;+ color?: string;+ accent?: string;+};++export const topoLinesDefaults: Required<TopoLinesProps> = {+ levels: 16,+ peaks: 3,+ highlight: 9,+ indexEvery: 4,+ resolution: 90,+ loopFrames: 300,+ seed: 2,+ speed: 1,+ background: "#111111",+ color: "#FFFFFF",+ accent: "#E5322D",+};++const TAU = Math.PI * 2;++// Cone height falls from 1 to 0 over this distance (short side = 1), so+// contours are evenly spaced like a real survey map.+const REACH = 0.95;+// Smooth-max softness: peaks merge into shared outer rings without creases.+const SOFT = 0.045;++type Peak = {+ x: number;+ y: number;+ amp: number;+ phase: number;+ orbit: number;+ lobes: [number, number];+};+type Ripple = { fx: number; fy: number; phase: number };++function makeTerrain(seed: number, peaks: number, w: number, h: number) {+ const r = (k: string) => random(`topo-lines-${seed}-${k}`);+ const m = Math.max(1, Math.round(peaks));+ const turn = r("turn") * TAU;+ const list: Peak[] = Array.from({ length: m }, (_, k) => {+ // Spread peaks around the centre so each keeps its own nest of rings.+ const a = turn + (k * TAU) / m + (r(`j${k}`) - 0.5) * 0.8;+ const spread = m === 1 ? 0.06 : 0.24 + r(`d${k}`) * 0.06;+ return {+ x: w / 2 + Math.cos(a) * spread * w,+ y: h / 2 + Math.sin(a) * spread * h * 1.1,+ amp: k === 0 ? 1 : 0.7 + r(`a${k}`) * 0.22,+ phase: r(`p${k}`) * TAU,+ orbit: 0.025 + r(`o${k}`) * 0.025,+ lobes: [r(`l2${k}`) * TAU, r(`l3${k}`) * TAU],+ };+ });+ const ripples: Ripple[] = Array.from({ length: 3 }, (_, k) => ({+ fx: (r(`rx${k}`) * 2 - 1) * (3 + k * 2),+ fy: (r(`ry${k}`) * 2 - 1) * (3 + k * 2),+ phase: r(`rp${k}`) * TAU,+ }));+ // Height at (x, y). `tau` walks once around a circle per loop: peaks drift+ // on small orbits, breathe, and their low harmonics rotate a whole number+ // of times, so the last frame matches the first.+ return (x: number, y: number, tau: number) => {+ let sum = 0;+ for (const p of list) {+ const px = p.x + Math.cos(tau + p.phase) * p.orbit;+ const py = p.y + Math.sin(tau + p.phase) * p.orbit;+ const dx = x - px;+ const dy = y - py;+ const theta = Math.atan2(dy, dx);+ const warp =+ 1 ++ 0.14 * Math.sin(2 * theta + p.lobes[0] + tau) ++ 0.08 * Math.sin(3 * theta + p.lobes[1] - tau);+ const amp = p.amp * (1 + 0.05 * Math.sin(tau + p.phase));+ const v = amp - (Math.hypot(dx, dy) * warp) / REACH;+ sum += Math.exp(v / SOFT);+ }+ let v = SOFT * Math.log(sum);+ for (const q of ripples) {+ v +=+ 0.03 *+ Math.sin(q.fx * x + q.fy * y + q.phase + Math.sin(tau + q.phase) * 1.4);+ }+ return v;+ };+}++const fmt = (n: number) => Math.round(n * 10) / 10;++export function TopoLines({+ levels = topoLinesDefaults.levels,+ peaks = topoLinesDefaults.peaks,+ highlight = topoLinesDefaults.highlight,+ indexEvery = topoLinesDefaults.indexEvery,+ resolution = topoLinesDefaults.resolution,+ loopFrames = topoLinesDefaults.loopFrames,+ seed = topoLinesDefaults.seed,+ speed = topoLinesDefaults.speed,+ background = topoLinesDefaults.background,+ color = topoLinesDefaults.color,+ accent = topoLinesDefaults.accent,+}: TopoLinesProps) {+ const frame = useCurrentFrame();+ const { width, height } = useVideoConfig();+ const unit = Math.min(width, height);+ const w = width / unit;+ const h = height / unit;+ const terrain = useMemo(+ () => makeTerrain(seed, peaks, w, h),+ [seed, peaks, w, h],+ );+ const tau = (TAU * frame * speed) / Math.max(1, loopFrames);++ const step = 1 / Math.max(20, resolution);+ const nx = Math.ceil(w / step) + 1;+ const ny = Math.ceil(h / step) + 1;+ const field = new Float32Array(nx * ny);+ for (let j = 0; j < ny; j++) {+ for (let i = 0; i < nx; i++) {+ field[j * nx + i] = terrain(i * step, j * step, tau);+ }+ }++ const count = Math.max(1, Math.round(levels));+ const thresholds = Array.from(+ { length: count },+ (_, l) => 0.04 + (l * 0.9) / count,+ );+ const paths = { plain: "", index: "", accent: "" };+ const s = step * unit;+ const X = (i: number) => fmt(i * s);+ const Y = (j: number) => fmt(j * s);++ // Marching squares. Segments that share a cell edge land on the same+ // interpolated point, so round caps make them read as continuous curves.+ for (let j = 0; j < ny - 1; j++) {+ for (let i = 0; i < nx - 1; i++) {+ const a = field[j * nx + i];+ const b = field[j * nx + i + 1];+ const c = field[(j + 1) * nx + i + 1];+ const d = field[(j + 1) * nx + i];+ const lo = Math.min(a, b, c, d);+ const hi = Math.max(a, b, c, d);+ for (let l = 0; l < count; l++) {+ const t = thresholds[l];+ if (t < lo || t >= hi) continue;+ const code =+ (a > t ? 8 : 0) | (b > t ? 4 : 0) | (c > t ? 2 : 0) | (d > t ? 1 : 0);+ const top = () => `${X(i + (t - a) / (b - a))} ${Y(j)}`;+ const right = () => `${X(i + 1)} ${Y(j + (t - b) / (c - b))}`;+ const bottom = () => `${X(i + (t - d) / (c - d))} ${Y(j + 1)}`;+ const left = () => `${X(i)} ${Y(j + (t - a) / (d - a))}`;+ let seg = "";+ switch (code) {+ case 1:+ case 14:+ seg = `M ${left()} L ${bottom()} `;+ break;+ case 2:+ case 13:+ seg = `M ${bottom()} L ${right()} `;+ break;+ case 3:+ case 12:+ seg = `M ${left()} L ${right()} `;+ break;+ case 4:+ case 11:+ seg = `M ${top()} L ${right()} `;+ break;+ case 6:+ case 9:+ seg = `M ${top()} L ${bottom()} `;+ break;+ case 7:+ case 8:+ seg = `M ${left()} L ${top()} `;+ break;+ case 5:+ seg = `M ${left()} L ${top()} M ${bottom()} L ${right()} `;+ break;+ case 10:+ seg = `M ${top()} L ${right()} M ${left()} L ${bottom()} `;+ break;+ }+ if (l === highlight) paths.accent += seg;+ else if (indexEvery > 0 && (l + 1) % indexEvery === 0)+ paths.index += seg;+ else paths.plain += seg;+ }+ }+ }++ const px = unit / 720;+ return (+ <AbsoluteFill style={{ backgroundColor: background }}>+ <svg+ width="100%"+ height="100%"+ viewBox={`0 0 ${width} ${height}`}+ role="img"+ aria-label="Topographic contour lines"+ style={{ display: "block" }}+ >+ <g fill="none" strokeLinecap="round" strokeLinejoin="round">+ <path+ d={paths.plain}+ stroke={color}+ strokeOpacity={0.38}+ strokeWidth={1.1 * px}+ />+ <path+ d={paths.index}+ stroke={color}+ strokeOpacity={0.85}+ strokeWidth={1.8 * px}+ />+ <path d={paths.accent} stroke={accent} strokeWidth={2.6 * px} />+ </g>+ </svg>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/turntable/config.ts b/registry/remocn/turntable/config.tsnew file mode 100644index 00000000..21e3d0b6--- /dev/null+++ b/registry/remocn/turntable/config.ts@@ -0,0 +1,50 @@+import { turntableExampleCode } from "@/components/docs/examples/turntable-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const turntableConfig: ComponentConfig = {+ componentName: "Turntable",+ importPath: "@/components/remocn/turntable",+ controls: {+ turns: {+ type: "number",+ default: 1,+ min: 0.5,+ max: 3,+ step: 0.5,+ description: "Turns",+ hiddenFromList: false,+ },+ thickness: {+ type: "number",+ default: 22,+ min: 2,+ max: 60,+ step: 1,+ description: "Thickness",+ hiddenFromList: false,+ },+ tilt: {+ type: "number",+ default: 8,+ min: -20,+ max: 30,+ step: 1,+ description: "Tilt",+ hiddenFromList: false,+ },+ frontColor: { type: "color", default: "#E5322D", description: "Front" },+ edgeColor: { type: "color", default: "#A3201C", description: "Edge" },+ backColor: { type: "color", default: "#F2F2F2", description: "Back" },+ backgroundColor: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 90,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: turntableExampleCode,+};diff --git a/registry/remocn/turntable/index.tsx b/registry/remocn/turntable/index.tsxnew file mode 100644index 00000000..1b0cff40--- /dev/null+++ b/registry/remocn/turntable/index.tsx@@ -0,0 +1,319 @@+"use client";++import type React from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type TurntableColors = {+ background: string;+ front: string;+ back: string;+ edge: string;+ mark: string;+ shadow: string;+};++export type TurntableProps = {+ /** Front face content. Defaults to a red card with a mark. */+ children?: React.ReactNode;+ /** Back face content. Defaults to a dark card. */+ back?: React.ReactNode;+ /** Card thickness in px at 720p. */+ thickness?: number;+ /** Full rotations per spin. */+ turns?: number;+ /** Camera tilt in degrees; positive looks down on the card. */+ tilt?: number;+ colors?: Partial<TurntableColors>;+ /** Default front face color. Overrides `colors.front`. */+ frontColor?: string;+ /** Card edge color. Overrides `colors.edge`. */+ edgeColor?: string;+ /** Default back face color. Overrides `colors.back`. */+ backColor?: string;+ /** Stage background. Overrides `colors.background`. */+ backgroundColor?: string;+ speed?: number;+};++export const turntableDefaults = {+ thickness: 22,+ turns: 1,+ tilt: 8,+ colors: {+ background: "#111111",+ front: "#E5322D",+ back: "#F2F2F2",+ edge: "#A3201C",+ mark: "#FFFFFF",+ shadow: "#000000",+ } satisfies TurntableColors,+ speed: 1,+};++const START = 6;+const END = 64;++function DefaultFront({ colors }: { colors: TurntableColors }) {+ return (+ <AbsoluteFill+ style={{+ backgroundColor: colors.front,+ padding: "9%",+ justifyContent: "space-between",+ }}+ >+ <div+ style={{+ width: "22%",+ aspectRatio: "1",+ borderRadius: "50%",+ border: `0.6em solid ${colors.mark}`,+ }}+ />+ <div style={{ display: "flex", flexDirection: "column", gap: "0.5em" }}>+ <div+ style={{+ height: "0.9em",+ width: "62%",+ background: colors.mark,+ borderRadius: 99,+ }}+ />+ <div+ style={{+ height: "0.9em",+ width: "38%",+ background: colors.mark,+ opacity: 0.55,+ borderRadius: 99,+ }}+ />+ </div>+ </AbsoluteFill>+ );+}++function DefaultBack({ colors }: { colors: TurntableColors }) {+ return (+ <AbsoluteFill style={{ backgroundColor: colors.back }}>+ <div+ style={{+ position: "absolute",+ top: "16%",+ left: 0,+ right: 0,+ height: "18%",+ background: "#111111",+ }}+ />+ <div+ style={{+ position: "absolute",+ right: "9%",+ bottom: "12%",+ width: "16%",+ aspectRatio: "1",+ borderRadius: "28%",+ background: colors.front,+ }}+ />+ </AbsoluteFill>+ );+}++export function Turntable({+ children,+ back,+ thickness = turntableDefaults.thickness,+ turns = turntableDefaults.turns,+ tilt = turntableDefaults.tilt,+ colors: colorOverrides,+ frontColor,+ edgeColor,+ backColor,+ backgroundColor,+ speed = turntableDefaults.speed,+}: TurntableProps) {+ const frame = useCurrentFrame();+ const { width, height, fps } = useVideoConfig();+ const baseColors = { ...turntableDefaults.colors, ...colorOverrides };+ const colors = {+ ...baseColors,+ front: frontColor ?? baseColors.front,+ edge: edgeColor ?? baseColors.edge,+ back: backColor ?? baseColors.back,+ background: backgroundColor ?? baseColors.background,+ };+ const t = (frame * speed * 30) / fps;+ const unit = height / 720;++ const cardH = height * 0.46;+ const cardW = cardH * 1.58;+ const depth = thickness * unit;+ const radius = Math.min(cardH * 0.06, depth * 1.2);++ const spin = interpolate(t, [START, END], [0, 1], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.bezier(0.55, 0, 0.25, 1),+ });+ const angle = spin * 360 * turns;+ const rad = (angle * Math.PI) / 180;+ const cos = Math.cos(rad);+ const sin = Math.sin(rad);++ // Lambert-ish shading for each face from a key light front-left.+ const light = (nx: number, nz: number) =>+ 0.55 + 0.45 * Math.max(0, nz * 0.85 - nx * 0.5);+ const frontShade = light(sin, cos);+ const backShade = light(-sin, -cos);+ const sideShade = light(cos, -sin);+ const sheen = 50 + sin * 120;++ const footprint = Math.abs(cos) * cardW + Math.abs(sin) * depth;+ const shadowW = Math.max(footprint, depth * 3);+ const floorY = height / 2 + cardH / 2 + height * 0.075;++ const face = (+ content: React.ReactNode,+ transform: string,+ shade: number,+ ): React.ReactNode => (+ <div+ style={{+ position: "absolute",+ inset: 0,+ borderRadius: radius,+ overflow: "hidden",+ backfaceVisibility: "hidden",+ transform,+ fontSize: cardH / 30,+ }}+ >+ {content}+ <div+ style={{+ position: "absolute",+ inset: 0,+ background: `linear-gradient(105deg, rgba(255,255,255,0) ${sheen - 22}%, rgba(255,255,255,0.22) ${sheen}%, rgba(255,255,255,0) ${sheen + 22}%)`,+ }}+ />+ <div+ style={{+ position: "absolute",+ inset: 0,+ background: "#000",+ opacity: 1 - shade,+ }}+ />+ </div>+ );++ const slab = (+ w: number,+ h: number,+ transform: string,+ shade: number,+ key: string,+ ) => (+ <div+ key={key}+ style={{+ position: "absolute",+ left: (cardW - w) / 2,+ top: (cardH - h) / 2,+ width: w,+ height: h,+ background: colors.edge,+ filter: `brightness(${shade})`,+ transform,+ }}+ />+ );++ return (+ <AbsoluteFill+ style={{+ backgroundColor: colors.background,+ overflow: "hidden",+ background: `radial-gradient(ellipse 60% 40% at 50% ${(floorY / height) * 100}%, rgba(255,255,255,0.07), rgba(255,255,255,0) 70%), ${colors.background}`,+ }}+ >+ <div+ style={{+ position: "absolute",+ left: width / 2 - shadowW / 2,+ top: floorY - height * 0.025,+ width: shadowW,+ height: height * 0.05,+ borderRadius: "50%",+ background: colors.shadow,+ opacity: 0.45 + 0.35 * Math.abs(cos),+ filter: `blur(${height * 0.018}px)`,+ }}+ />+ <AbsoluteFill+ style={{+ perspective: height * 2.4,+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: cardW,+ height: cardH,+ position: "relative",+ transformStyle: "preserve-3d",+ transform: `rotateX(${-tilt}deg) rotateY(${angle}deg)`,+ }}+ >+ {slab(+ depth,+ cardH - radius * 2,+ `rotateY(90deg) translateZ(${cardW / 2}px)`,+ sideShade,+ "r",+ )}+ {slab(+ depth,+ cardH - radius * 2,+ `rotateY(-90deg) translateZ(${cardW / 2}px)`,+ light(-cos, sin),+ "l",+ )}+ {slab(+ cardW - radius * 2,+ depth,+ `rotateX(90deg) translateZ(${cardH / 2}px)`,+ 1.1,+ "t",+ )}+ {slab(+ cardW - radius * 2,+ depth,+ `rotateX(-90deg) translateZ(${cardH / 2}px)`,+ 0.6,+ "b",+ )}+ {face(+ children ?? <DefaultFront colors={colors} />,+ `translateZ(${depth / 2}px)`,+ frontShade,+ )}+ {face(+ back ?? <DefaultBack colors={colors} />,+ `rotateY(180deg) translateZ(${depth / 2}px)`,+ backShade,+ )}+ </div>+ </AbsoluteFill>+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/venetian-blinds/config.ts b/registry/remocn/venetian-blinds/config.tsnew file mode 100644index 00000000..f32b9080--- /dev/null+++ b/registry/remocn/venetian-blinds/config.ts@@ -0,0 +1,48 @@+import { venetianBlindsExampleCode } from "@/components/docs/examples/venetian-blinds-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const venetianBlindsConfig: ComponentConfig = {+ componentName: "venetianBlinds",+ importPath: "@/components/remocn/venetian-blinds",+ controls: {+ slats: {+ type: "number",+ min: 2,+ max: 32,+ step: 1,+ default: 12,+ description: "Slats",+ hiddenFromList: false,+ },+ stagger: {+ type: "number",+ min: 0,+ max: 0.9,+ step: 0.05,+ default: 0.55,+ description: "Stagger",+ hiddenFromList: false,+ },+ direction: {+ type: "enum",+ default: "top-down",+ variants: {+ "top-down": {},+ "bottom-up": {},+ center: {},+ },+ description: "Direction",+ },+ shadeColor: {+ type: "color",+ default: "#000000",+ description: "Shade color",+ },+ },+ durationInFrames: 114,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#0a0a0a" },+ snippet: venetianBlindsExampleCode,+};diff --git a/registry/remocn/venetian-blinds/index.tsx b/registry/remocn/venetian-blinds/index.tsxnew file mode 100644index 00000000..897c4736--- /dev/null+++ b/registry/remocn/venetian-blinds/index.tsx@@ -0,0 +1,145 @@+"use client";++import type {+ TransitionPresentation,+ TransitionPresentationComponentProps,+} from "@remotion/transitions";+import type React from "react";+import { AbsoluteFill, Easing, interpolate, useVideoConfig } from "remotion";++export type VenetianBlindsDirection = "top-down" | "bottom-up" | "center";++export type VenetianBlindsProps = {+ /** Number of horizontal slats. */+ slats?: number;+ /** Share of the transition spent rippling across slats, 0 to 0.9. */+ stagger?: number;+ /** Which slat turns first. */+ direction?: VenetianBlindsDirection;+ /** Tint a slat picks up as it turns away from the light. */+ shadeColor?: string;+};++export const venetianBlindsDefaults: Required<VenetianBlindsProps> = {+ slats: 12,+ stagger: 0.55,+ direction: "top-down",+ shadeColor: "#000000",+};++const turnEase = Easing.bezier(0.55, 0, 0.35, 1);+const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++function slatDelay(+ index: number,+ count: number,+ direction: VenetianBlindsDirection,+) {+ if (count <= 1) return 0;+ const t = index / (count - 1);+ if (direction === "bottom-up") return 1 - t;+ if (direction === "center") return Math.abs(t - 0.5) * 2;+ return t;+}++const VenetianBlindsPresentation: React.FC<+ TransitionPresentationComponentProps<VenetianBlindsProps>+> = ({+ children,+ presentationProgress,+ presentationDirection,+ passedProps,+}) => {+ const { width, height } = useVideoConfig();+ const { slats, stagger, direction, shadeColor } = {+ ...venetianBlindsDefaults,+ ...passedProps,+ };+ const p = presentationProgress;++ if (presentationDirection === "entering") {+ // The incoming scene settles back a touch as the blinds open on it.+ const scale = interpolate(p, [0, 1], [1.06, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+ return (+ <AbsoluteFill style={{ transform: `scale(${scale})` }}>+ {children}+ </AbsoluteFill>+ );+ }++ const count = Math.max(1, Math.round(slats));+ const spread = Math.min(0.9, Math.max(0, stagger));++ return (+ <AbsoluteFill+ style={{+ zIndex: 2,+ perspective: height * 2.2,+ perspectiveOrigin: "50% 50%",+ }}+ >+ {Array.from({ length: count }, (_, i) => {+ const top = Math.floor((i * height) / count);+ const bottom = Math.floor(((i + 1) * height) / count);+ const start = slatDelay(i, count, direction) * spread;+ const local = turnEase(+ interpolate(p, [start, start + 1 - spread], [0, 1], clamp),+ );+ const angle = local * 90;+ // Fade out near edge-on so the last sliver never reads as a hairline.+ const fade = interpolate(angle, [76, 88], [1, 0], clamp);+ if (fade <= 0) return null;+ return (+ <div+ key={top}+ style={{+ position: "absolute",+ left: 0,+ top,+ width,+ // 1px overlap hides hairline seams between resting slats.+ height: bottom - top + (i < count - 1 ? 1 : 0),+ overflow: "hidden",+ transformOrigin: "50% 50%",+ transform: `rotateX(${angle}deg)`,+ backfaceVisibility: "hidden",+ opacity: fade,+ }}+ >+ <div+ style={{+ position: "absolute",+ left: 0,+ top: -top,+ width,+ height,+ }}+ >+ {children}+ </div>+ <div+ style={{+ position: "absolute",+ inset: 0,+ backgroundColor: shadeColor,+ opacity: Math.sin((angle * Math.PI) / 180) * 0.75,+ }}+ />+ </div>+ );+ })}+ </AbsoluteFill>+ );+};++export function venetianBlinds(+ props: VenetianBlindsProps = {},+): TransitionPresentation<VenetianBlindsProps> {+ return { component: VenetianBlindsPresentation, props };+}diff --git a/registry/remocn/x-ray-scan/config.ts b/registry/remocn/x-ray-scan/config.tsnew file mode 100644index 00000000..fce00c39--- /dev/null+++ b/registry/remocn/x-ray-scan/config.ts@@ -0,0 +1,29 @@+import { xRayScanExampleCode } from "@/components/docs/examples/x-ray-scan-example";+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const xRayScanConfig: ComponentConfig = {+ componentName: "XRayScan",+ importPath: "@/components/remocn/x-ray-scan",+ controls: {+ direction: {+ type: "enum",+ default: "horizontal",+ variants: { horizontal: {}, vertical: {} },+ description: "Direction",+ },+ shell: { type: "color", default: "#E5322D", description: "Shell" },+ accent: { type: "color", default: "#E5322D", description: "Accent part" },+ line: { type: "color", default: "#FFFFFF", description: "Scan line" },+ background: {+ type: "color",+ default: "#111111",+ description: "Background",+ },+ },+ durationInFrames: 65,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#111111" },+ snippet: xRayScanExampleCode,+};diff --git a/registry/remocn/x-ray-scan/index.tsx b/registry/remocn/x-ray-scan/index.tsxnew file mode 100644index 00000000..f6c9b57c--- /dev/null+++ b/registry/remocn/x-ray-scan/index.tsx@@ -0,0 +1,375 @@+"use client";++import { type ReactNode, useId } from "react";+import {+ AbsoluteFill,+ Easing,+ interpolate,+ useCurrentFrame,+ useVideoConfig,+} from "remotion";++export type XRayScanColors = {+ background: string;+ shell: string;+ detail: string;+ xray: string;+ line: string;+ accent: string;+};++export type XRayScanProps = {+ /** Exterior shown ahead of the bar. Defaults to the back of a phone. */+ outside?: ReactNode;+ /** Interior revealed behind the bar. Defaults to white-line phone internals. */+ inside?: ReactNode;+ colors?: Partial<XRayScanColors>;+ /** Phone shell color. Overrides `colors.shell` when set. */+ shell?: string;+ /** Highlighted internal part. Overrides `colors.accent` when set. */+ accent?: string;+ /** Scan line and interior line art. Overrides `colors.line` when set. */+ line?: string;+ /** Background. Overrides `colors.background` when set. */+ background?: string;+ /** "horizontal" sweeps left to right, "vertical" top to bottom. */+ direction?: "horizontal" | "vertical";+ speed?: number;+};++export const xRayScanDefaults = {+ colors: {+ background: "#111111",+ shell: "#E5322D",+ detail: "#111111",+ xray: "#07080A",+ line: "#FFFFFF",+ accent: "#E5322D",+ } as XRayScanColors,+ direction: "horizontal" as const,+ speed: 1,+};++export const xRayScanLength = 32;++const MONO = "ui-monospace, 'SF Mono', Menlo, Consolas, monospace";++type Device = { x: number; y: number; w: number; h: number; r: number };++function Outside({ id, d, c }: { id: string; d: Device; c: XRayScanColors }) {+ const lens = d.w * 0.085;+ return (+ <>+ <defs>+ <linearGradient id={`${id}-gloss`} x1="0" y1="0" x2="1" y2="1">+ <stop offset="0" stopColor="#FFFFFF" stopOpacity={0.22} />+ <stop offset="0.45" stopColor="#FFFFFF" stopOpacity={0} />+ <stop offset="1" stopColor="#000000" stopOpacity={0.18} />+ </linearGradient>+ </defs>+ <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} fill={c.shell} />+ <rect+ x={d.x}+ y={d.y}+ width={d.w}+ height={d.h}+ rx={d.r}+ fill={`url(#${id}-gloss)`}+ />+ <rect+ x={d.x + d.w * 0.07}+ y={d.y + d.w * 0.07}+ width={d.w * 0.4}+ height={d.w * 0.4}+ rx={d.w * 0.1}+ fill={c.detail}+ opacity={0.92}+ />+ {[+ [0.17, 0.17],+ [0.37, 0.17],+ [0.17, 0.37],+ ].map(([fx, fy]) => (+ <g key={`${fx}${fy}`}>+ <circle+ cx={d.x + d.w * fx}+ cy={d.y + d.w * fy}+ r={lens}+ fill="#000"+ stroke="#2A2A2A"+ strokeWidth={lens * 0.25}+ />+ <circle+ cx={d.x + d.w * fx - lens * 0.3}+ cy={d.y + d.w * fy - lens * 0.3}+ r={lens * 0.18}+ fill="#FFFFFF"+ opacity={0.6}+ />+ </g>+ ))}+ <circle+ cx={d.x + d.w / 2}+ cy={d.y + d.h * 0.5}+ r={d.w * 0.07}+ fill={c.detail}+ opacity={0.85}+ />+ </>+ );+}++function Inside({ d, c, u }: { d: Device; c: XRayScanColors; u: number }) {+ const X = (f: number) => d.x + d.w * f;+ const Y = (f: number) => d.y + d.h * f;+ const pins = (x: number, y: number, w: number, h: number, n: number) =>+ Array.from({ length: n }, (_, i) => {+ const px = x + ((i + 0.5) / n) * w;+ return `M ${px} ${y - 4 * u} V ${y} M ${px} ${y + h} V ${y + h + 4 * u}`;+ }).join(" ");+ return (+ <>+ <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} fill={c.xray} />+ <g fill="none" stroke={c.line} strokeWidth={2 * u} strokeLinejoin="round">+ <rect x={d.x} y={d.y} width={d.w} height={d.h} rx={d.r} />+ <rect+ x={X(0.04)}+ y={Y(0.02)}+ width={d.w * 0.92}+ height={d.h * 0.96}+ rx={d.r * 0.82}+ strokeOpacity={0.4}+ />+ {/* Camera ring */}+ {[+ [0.17, 0.17],+ [0.37, 0.17],+ [0.17, 0.37],+ ].map(([fx, fy]) => (+ <g key={`${fx}${fy}`}>+ <circle cx={X(fx)} cy={d.y + d.w * fy} r={d.w * 0.085} />+ <circle+ cx={X(fx)}+ cy={d.y + d.w * fy}+ r={d.w * 0.045}+ strokeOpacity={0.6}+ />+ </g>+ ))}+ {/* Logic board */}+ <path+ d={`M ${X(0.52)} ${Y(0.05)} H ${X(0.9)} V ${Y(0.36)} H ${X(0.1)} V ${Y(0.27)} H ${X(0.52)} Z`}+ />+ <rect+ x={X(0.6)}+ y={Y(0.08)}+ width={d.w * 0.22}+ height={d.h * 0.07}+ rx={2 * u}+ />+ <path+ d={pins(X(0.6), Y(0.08), d.w * 0.22, d.h * 0.07, 6)}+ strokeOpacity={0.6}+ strokeWidth={1.3 * u}+ />+ <rect+ x={X(0.16)}+ y={Y(0.295)}+ width={d.w * 0.16}+ height={d.h * 0.04}+ rx={2 * u}+ strokeOpacity={0.8}+ />+ <rect+ x={X(0.38)}+ y={Y(0.295)}+ width={d.w * 0.12}+ height={d.h * 0.04}+ rx={2 * u}+ strokeOpacity={0.8}+ />+ {/* Battery with wireless coil */}+ <rect+ x={X(0.12)}+ y={Y(0.4)}+ width={d.w * 0.76}+ height={d.h * 0.44}+ rx={6 * u}+ />+ <path+ d={`M ${X(0.42)} ${Y(0.4)} V ${Y(0.385)} H ${X(0.58)} V ${Y(0.4)}`}+ />+ {[0.26, 0.2, 0.14].map((f) => (+ <circle+ key={f}+ cx={X(0.5)}+ cy={Y(0.62)}+ r={d.w * f}+ strokeOpacity={0.45}+ />+ ))}+ <path+ d={`M ${X(0.5)} ${Y(0.47)} V ${Y(0.5)} M ${X(0.485)} ${Y(0.485)} H ${X(0.515)}`}+ />+ {/* Flex cable, speaker and port */}+ <path+ d={`M ${X(0.86)} ${Y(0.36)} V ${Y(0.38)} H ${X(0.92)} V ${Y(0.89)} H ${X(0.66)}`}+ strokeOpacity={0.6}+ />+ <rect+ x={X(0.38)}+ y={Y(0.935)}+ width={d.w * 0.24}+ height={d.h * 0.025}+ rx={d.h * 0.0125}+ />+ {Array.from({ length: 6 }, (_, i) => (+ <circle key={i} cx={X(0.14 + i * 0.035)} cy={Y(0.947)} r={1.8 * u} />+ ))}+ </g>+ {/* The one part in red: the SoC */}+ <g stroke={c.accent} strokeWidth={2.4 * u} fill="none">+ <rect+ x={X(0.6)}+ y={Y(0.17)}+ width={d.w * 0.22}+ height={d.w * 0.22}+ rx={3 * u}+ fill={c.accent}+ fillOpacity={0.22}+ />+ <path+ d={pins(X(0.6), Y(0.17), d.w * 0.22, d.w * 0.22, 5)}+ strokeWidth={1.4 * u}+ />+ </g>+ <text+ x={X(0.5)}+ y={Y(0.79)}+ textAnchor="middle"+ fontFamily={MONO}+ fontSize={12 * u}+ letterSpacing={2 * u}+ fill={c.line}+ opacity={0.7}+ >+ Li-ion 4500 mAh+ </text>+ </>+ );+}++export function XRayScan({+ outside,+ inside,+ colors,+ shell,+ accent,+ line,+ background,+ direction = xRayScanDefaults.direction,+ speed = xRayScanDefaults.speed,+}: XRayScanProps) {+ const frame = useCurrentFrame();+ const { width: W, height: H, fps } = useVideoConfig();+ const id = useId().replace(/[^a-zA-Z0-9_-]/g, "");+ const merged = { ...xRayScanDefaults.colors, ...colors };+ const c: XRayScanColors = {+ ...merged,+ shell: shell ?? merged.shell,+ accent: accent ?? merged.accent,+ line: line ?? merged.line,+ background: background ?? merged.background,+ };+ const t = (frame / fps) * 30 * speed;+ const u = Math.min(W, H) / 720;+ const vertical = direction === "vertical";++ const dh = 0.8 * H;+ const dw = dh * 0.49;+ const d: Device = {+ x: (W - dw) / 2,+ y: (H - dh) / 2,+ w: dw,+ h: dh,+ r: dw * 0.17,+ };+ const span = vertical ? H : W;+ const start = vertical ? d.y - 0.1 * H : d.x - 0.12 * W;+ const end = vertical ? d.y + d.h + 0.1 * H : d.x + d.w + 0.12 * W;+ const bar = interpolate(t, [5, 32], [start, end], {+ extrapolateLeft: "clamp",+ extrapolateRight: "clamp",+ easing: Easing.inOut(Easing.sin),+ });+ const scanning = t > 5 && t < 32;+ const band = 0.12 * span;+ const behind = vertical+ ? `inset(0 0 ${H - bar}px 0)`+ : `inset(0 ${W - bar}px 0 0)`;+ const ahead = vertical ? `inset(${bar}px 0 0 0)` : `inset(0 0 0 ${bar}px)`;+ const hot = vertical+ ? `inset(${Math.max(0, bar - band)}px 0 ${H - bar}px 0)`+ : `inset(0 ${W - bar}px 0 ${Math.max(0, bar - band)}px)`;+ const trail = vertical ? "to top" : "to left";++ const insideLayer = inside ?? (+ <svg width={W} height={H} aria-hidden>+ <Inside d={d} c={c} u={u} />+ </svg>+ );++ return (+ <AbsoluteFill style={{ backgroundColor: c.background, overflow: "hidden" }}>+ <svg width={0} height={0} style={{ position: "absolute" }} aria-hidden>+ <filter id={`${id}-glow`} x="-10%" y="-10%" width="120%" height="120%">+ <feGaussianBlur stdDeviation={3 * u} result="blur" />+ <feMerge>+ <feMergeNode in="blur" />+ <feMergeNode in="blur" />+ <feMergeNode in="SourceGraphic" />+ </feMerge>+ </filter>+ </svg>+ <AbsoluteFill style={{ clipPath: ahead }}>+ {outside ?? (+ <svg width={W} height={H} aria-hidden>+ <Outside id={id} d={d} c={c} />+ </svg>+ )}+ </AbsoluteFill>+ <AbsoluteFill style={{ clipPath: behind }}>{insideLayer}</AbsoluteFill>+ {/* Fresh exposure glows brighter just behind the bar. */}+ <AbsoluteFill+ style={{+ clipPath: hot,+ filter: `url(#${id}-glow)`,+ opacity: scanning ? 0.9 : 0,+ }}+ >+ {insideLayer}+ </AbsoluteFill>+ <AbsoluteFill+ style={{+ clipPath: behind,+ opacity: scanning ? 1 : 0,+ background: `linear-gradient(${trail}, ${c.line}2E 0px, transparent ${band}px)`,+ backgroundPosition: vertical ? `0 ${bar - H}px` : `${bar - W}px 0`,+ backgroundRepeat: "no-repeat",+ }}+ />+ <div+ style={{+ position: "absolute",+ left: vertical ? 0 : bar - 1.5 * u,+ top: vertical ? bar - 1.5 * u : 0,+ width: vertical ? W : 3 * u,+ height: vertical ? 3 * u : H,+ backgroundColor: c.line,+ boxShadow: `0 0 ${16 * u}px ${4 * u}px ${c.line}AA, 0 0 ${60 * u}px ${12 * u}px ${c.line}33`,+ opacity: scanning ? 1 : 0,+ }}+ />+ </AbsoluteFill>+ );+}diff --git a/source.tsx b/source.tsxindex 97f1d5bd..09161a13 100644--- a/source.tsx+++ b/source.tsx@@ -1,5 +1,6 @@import {ArtificialIntelligence04Icon,+ Award01Icon,BlurIcon,BookOpen01Icon,ClosedCaptionIcon,@@ -9,12 +10,14 @@ import {Layers01Icon,Layout01Icon,MagicWand01Icon,+ PaintBoardIcon,Rocket01Icon,Share01Icon,SparklesIcon,TextFontIcon,ToggleOnIcon,TransitionRightIcon,+ Video01Icon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";import { loader } from "fumadocs-core/source";@@ -23,6 +26,7 @@ import { docs } from "@/.source/server";/** Sidebar category icons — meta.json `icon` values resolve against this map. */const DOCS_ICONS: Record<string, IconSvgElement> = {ArtificialIntelligence04Icon,+ Award01Icon,BlurIcon,BookOpen01Icon,ClosedCaptionIcon,@@ -32,12 +36,14 @@ const DOCS_ICONS: Record<string, IconSvgElement> = {Layers01Icon,Layout01Icon,MagicWand01Icon,+ PaintBoardIcon,Rocket01Icon,Share01Icon,SparklesIcon,TextFontIcon,ToggleOnIcon,TransitionRightIcon,+ Video01Icon,};export const source = loader({diff --git a/src/remotion/motion-pack-root.tsx b/src/remotion/motion-pack-root.tsxnew file mode 100644index 00000000..318e0251--- /dev/null+++ b/src/remotion/motion-pack-root.tsx@@ -0,0 +1,42 @@+import { Composition, Folder, registerRoot } from "remotion";+import { cameraPhysicsDrafts } from "./motion-pack/camera-physics";+import { generativeDrafts } from "./motion-pack/generative";+import { graphicLookDrafts } from "./motion-pack/graphic-looks";+import { logoStingDrafts } from "./motion-pack/logo-stings";+import type { DraftShelf } from "./motion-pack/shared";+import { transitionDrafts } from "./motion-pack/transitions";++// Studio shelves for the motion pack (October 2026 release).+// Run: bun run studio:motion-pack+const SHELVES: DraftShelf[] = [+ { id: "Transitions", entries: transitionDrafts },+ { id: "Logo-stings", entries: logoStingDrafts },+ { id: "Generative-loops", entries: generativeDrafts },+ { id: "Camera-and-physics", entries: cameraPhysicsDrafts },+ { id: "Graphic-looks", entries: graphicLookDrafts },+];++function MotionPackRoot() {+ return (+ <>+ {SHELVES.map((shelf) => (+ <Folder key={shelf.id} name={shelf.id}>+ {shelf.entries.map((entry) => (+ <Composition+ key={entry.id}+ id={entry.id}+ component={entry.component}+ durationInFrames={entry.durationInFrames}+ fps={30}+ width={1280}+ height={720}+ defaultProps={entry.defaultProps ?? {}}+ />+ ))}+ </Folder>+ ))}+ </>+ );+}++registerRoot(MotionPackRoot);diff --git a/src/remotion/motion-pack/camera-physics.tsx b/src/remotion/motion-pack/camera-physics.tsxnew file mode 100644index 00000000..9eb9a4e8--- /dev/null+++ b/src/remotion/motion-pack/camera-physics.tsx@@ -0,0 +1,78 @@+import { ClothReveal } from "@/registry/remocn/cloth-reveal";+import { DollyZoom } from "@/registry/remocn/dolly-zoom";+import { ExplodedView } from "@/registry/remocn/exploded-view";+import { GravityPile } from "@/registry/remocn/gravity-pile";+import { hyperspace } from "@/registry/remocn/hyperspace";+import { ImpactShake } from "@/registry/remocn/impact-shake";+import { ParallaxDepth } from "@/registry/remocn/parallax-depth";+import { TinyPlanet } from "@/registry/remocn/tiny-planet";+import { Turntable } from "@/registry/remocn/turntable";+import {+ DemoLogo,+ type DraftEntry,+ TransitionDemo,+ transitionDemoDuration,+} from "./shared";++const HYPERSPACE = 56;++export const cameraPhysicsDrafts: DraftEntry[] = [+ {+ id: "hyperspace",+ component: () => (+ <TransitionDemo+ presentation={hyperspace()}+ transitionFrames={HYPERSPACE}+ />+ ),+ durationInFrames: transitionDemoDuration(HYPERSPACE),+ },+ {+ id: "parallax-depth",+ component: () => <ParallaxDepth />,+ durationInFrames: 80,+ },+ {+ id: "dolly-zoom",+ component: () => <DollyZoom />,+ durationInFrames: 60,+ },+ {+ id: "turntable",+ component: () => <Turntable />,+ durationInFrames: 90,+ },+ {+ id: "gravity-pile",+ component: () => <GravityPile />,+ durationInFrames: 90,+ },+ {+ id: "cloth-reveal",+ component: () => (+ <ClothReveal>+ <DemoLogo />+ </ClothReveal>+ ),+ durationInFrames: 60,+ },+ {+ id: "exploded-view",+ component: () => <ExplodedView />,+ durationInFrames: 64,+ },+ {+ id: "tiny-planet",+ component: () => <TinyPlanet />,+ durationInFrames: 100,+ },+ {+ id: "impact-shake",+ component: () => (+ <ImpactShake>+ <DemoLogo />+ </ImpactShake>+ ),+ durationInFrames: 40,+ },+];diff --git a/src/remotion/motion-pack/generative.tsx b/src/remotion/motion-pack/generative.tsxnew file mode 100644index 00000000..2e623075--- /dev/null+++ b/src/remotion/motion-pack/generative.tsx@@ -0,0 +1,18 @@+import { FlowField } from "@/registry/remocn/flow-field";+import { IsometricBuild } from "@/registry/remocn/isometric-build";+import { LifeGrid } from "@/registry/remocn/life-grid";+import { PendulumWave } from "@/registry/remocn/pendulum-wave";+import { Phyllotaxis } from "@/registry/remocn/phyllotaxis";+import { StringArt } from "@/registry/remocn/string-art";+import { TopoLines } from "@/registry/remocn/topo-lines";+import type { DraftEntry } from "./shared";++export const generativeDrafts: DraftEntry[] = [+ { id: "pendulum-wave", component: PendulumWave, durationInFrames: 450 },+ { id: "flow-field", component: FlowField, durationInFrames: 300 },+ { id: "isometric-build", component: IsometricBuild, durationInFrames: 90 },+ { id: "life-grid", component: LifeGrid, durationInFrames: 300 },+ { id: "string-art", component: StringArt, durationInFrames: 340 },+ { id: "topo-lines", component: TopoLines, durationInFrames: 300 },+ { id: "phyllotaxis", component: Phyllotaxis, durationInFrames: 165 },+];diff --git a/src/remotion/motion-pack/graphic-looks.tsx b/src/remotion/motion-pack/graphic-looks.tsxnew file mode 100644index 00000000..ef2fb27e--- /dev/null+++ b/src/remotion/motion-pack/graphic-looks.tsx@@ -0,0 +1,62 @@+import { Blueprint } from "@/registry/remocn/blueprint";+import { BrickMosaic } from "@/registry/remocn/brick-mosaic";+import { ComicPanels } from "@/registry/remocn/comic-panels";+import { DuotoneBeat } from "@/registry/remocn/duotone-beat";+import { LineBoil } from "@/registry/remocn/line-boil";+import { LongShadow } from "@/registry/remocn/long-shadow";+import { RisoPrint } from "@/registry/remocn/riso-print";+import { Synthwave } from "@/registry/remocn/synthwave";+import { XRayScan } from "@/registry/remocn/x-ray-scan";+import { DemoLogo, type DraftEntry, INK } from "./shared";++export const graphicLookDrafts: DraftEntry[] = [+ {+ id: "riso-print",+ component: () => <RisoPrint />,+ durationInFrames: 75,+ },+ {+ id: "line-boil",+ component: () => <LineBoil />,+ durationInFrames: 90,+ },+ {+ id: "blueprint",+ component: () => <Blueprint />,+ durationInFrames: 75,+ },+ {+ id: "duotone-beat",+ component: () => <DuotoneBeat />,+ durationInFrames: 120,+ },+ {+ id: "comic-panels",+ component: () => (+ <ComicPanels word="POW">+ <DemoLogo color={INK} />+ </ComicPanels>+ ),+ durationInFrames: 66,+ },+ {+ id: "long-shadow",+ component: () => <LongShadow />,+ durationInFrames: 70,+ },+ {+ id: "synthwave",+ component: () => <Synthwave />,+ durationInFrames: 120,+ },+ {+ id: "brick-mosaic",+ component: () => <BrickMosaic />,+ durationInFrames: 85,+ },+ {+ id: "x-ray-scan",+ component: () => <XRayScan />,+ durationInFrames: 65,+ },+];diff --git a/src/remotion/motion-pack/logo-stings.tsx b/src/remotion/motion-pack/logo-stings.tsxnew file mode 100644index 00000000..79375a4d--- /dev/null+++ b/src/remotion/motion-pack/logo-stings.tsx@@ -0,0 +1,99 @@+import { AccordionUnfold } from "@/registry/remocn/accordion-unfold";+import { AnamorphicFlare } from "@/registry/remocn/anamorphic-flare";+import { Inflate } from "@/registry/remocn/inflate";+import { LiquidFill } from "@/registry/remocn/liquid-fill";+import { NeonSign } from "@/registry/remocn/neon-sign";+import { OrbitLock } from "@/registry/remocn/orbit-lock";+import { PuzzleSnap } from "@/registry/remocn/puzzle-snap";+import { Spotlight } from "@/registry/remocn/spotlight";+import { DemoLogo, type DraftEntry, FONT, INK, PAPER } from "./shared";++// Mark-building stings draw their own mark, so they only take the wordmark.+function Wordmark() {+ return (+ <span+ style={{+ fontFamily: FONT,+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color: PAPER,+ }}+ >+ remocn+ </span>+ );+}++const HOLD = 30;++export const logoStingDrafts: DraftEntry[] = [+ {+ id: "orbit-lock",+ component: () => (+ <OrbitLock>+ <DemoLogo />+ </OrbitLock>+ ),+ durationInFrames: 48 + HOLD,+ },+ {+ id: "puzzle-snap",+ component: () => (+ <PuzzleSnap>+ <Wordmark />+ </PuzzleSnap>+ ),+ durationInFrames: 36 + HOLD,+ },+ {+ id: "spotlight",+ component: () => (+ <Spotlight>+ <DemoLogo />+ </Spotlight>+ ),+ durationInFrames: 50 + HOLD,+ },+ {+ id: "neon-sign",+ component: () => <NeonSign />,+ durationInFrames: 40 + HOLD,+ },+ {+ id: "inflate",+ component: () => (+ <Inflate>+ <Wordmark />+ </Inflate>+ ),+ durationInFrames: 36 + HOLD,+ },+ {+ id: "liquid-fill",+ component: () => (+ <LiquidFill>+ <Wordmark />+ </LiquidFill>+ ),+ durationInFrames: 48 + HOLD,+ },+ {+ id: "accordion-unfold",+ component: () => (+ <AccordionUnfold>+ <DemoLogo scale={0.8} color={INK} />+ </AccordionUnfold>+ ),+ durationInFrames: 36 + HOLD,+ },+ {+ id: "anamorphic-flare",+ component: () => (+ <AnamorphicFlare>+ <DemoLogo />+ </AnamorphicFlare>+ ),+ durationInFrames: 40 + HOLD,+ },+];diff --git a/src/remotion/motion-pack/shared.tsx b/src/remotion/motion-pack/shared.tsxnew file mode 100644index 00000000..ef1226ae--- /dev/null+++ b/src/remotion/motion-pack/shared.tsx@@ -0,0 +1,170 @@+import {+ linearTiming,+ type TransitionPresentation,+ TransitionSeries,+} from "@remotion/transitions";+import type React from "react";+import { AbsoluteFill } from "remotion";++/**+ * Studio review shelves for the motion pack. Each shelf file exports a list of+ * these entries; `motion-pack-root.tsx` turns them into Studio compositions.+ */+export interface DraftEntry {+ id: string;+ // biome-ignore lint/suspicious/noExplicitAny: demo props differ per draft+ component: React.ComponentType<any>;+ durationInFrames: number;+ defaultProps?: Record<string, unknown>;+}++export interface DraftShelf {+ id: string;+ entries: DraftEntry[];+}++export const INK = "#111111";+export const BRAND = "#E5322D";+export const PAPER = "#FFFFFF";+export const FONT =+ "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";++function Label({ text, color }: { text: string; color: string }) {+ return (+ <span+ style={{+ fontFamily: FONT,+ fontSize: 64,+ fontWeight: 700,+ letterSpacing: "-0.03em",+ color,+ }}+ >+ {text}+ </span>+ );+}++/** Outgoing demo scene: ink background, white square. */+export function SceneA({ label = "Scene A" }: { label?: string }) {+ return (+ <AbsoluteFill+ style={{+ backgroundColor: INK,+ alignItems: "center",+ justifyContent: "center",+ gap: 40,+ }}+ >+ <div style={{ width: 160, height: 160, backgroundColor: PAPER }} />+ <Label text={label} color={PAPER} />+ </AbsoluteFill>+ );+}++/** Incoming demo scene: brand red background, white circle. */+export function SceneB({ label = "Scene B" }: { label?: string }) {+ return (+ <AbsoluteFill+ style={{+ backgroundColor: BRAND,+ alignItems: "center",+ justifyContent: "center",+ gap: 40,+ }}+ >+ <div+ style={{+ width: 170,+ height: 170,+ borderRadius: "50%",+ backgroundColor: PAPER,+ }}+ />+ <Label text={label} color={PAPER} />+ </AbsoluteFill>+ );+}++/** Placeholder brand lockup: red rounded mark plus a wordmark. */+export function DemoLogo({+ scale = 1,+ color = PAPER,+}: {+ scale?: number;+ color?: string;+}) {+ return (+ <div+ style={{+ display: "flex",+ alignItems: "center",+ gap: 28 * scale,+ transform: `scale(${scale})`,+ }}+ >+ <div+ style={{+ width: 120,+ height: 120,+ borderRadius: 32,+ backgroundColor: BRAND,+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ }}+ >+ <div+ style={{+ width: 36,+ height: 36,+ borderRadius: "50%",+ backgroundColor: INK,+ }}+ />+ </div>+ <span+ style={{+ fontFamily: FONT,+ fontSize: 104,+ fontWeight: 800,+ letterSpacing: "-0.04em",+ color,+ }}+ >+ remocn+ </span>+ </div>+ );+}++const HOLD = 40;++export function transitionDemoDuration(transitionFrames: number) {+ return HOLD * 2 + transitionFrames;+}++/** Scene A -> transition -> Scene B, holding each scene for a beat. */+export function TransitionDemo({+ presentation,+ transitionFrames,+}: {+ // biome-ignore lint/suspicious/noExplicitAny: presentations carry their own prop types+ presentation: TransitionPresentation<any>;+ transitionFrames: number;+}) {+ return (+ <TransitionSeries>+ <TransitionSeries.Sequence durationInFrames={HOLD + transitionFrames}>+ <SceneA />+ </TransitionSeries.Sequence>+ <TransitionSeries.Transition+ timing={linearTiming({ durationInFrames: transitionFrames })}+ presentation={presentation}+ />+ <TransitionSeries.Sequence durationInFrames={HOLD + transitionFrames}>+ <SceneB />+ </TransitionSeries.Sequence>+ </TransitionSeries>+ );+}diff --git a/src/remotion/motion-pack/transitions.tsx b/src/remotion/motion-pack/transitions.tsxnew file mode 100644index 00000000..3da1618e--- /dev/null+++ b/src/remotion/motion-pack/transitions.tsx@@ -0,0 +1,57 @@+import { irisWipe } from "@/registry/remocn/iris-wipe";+import { lightLeak } from "@/registry/remocn/light-leak";+import { paperTear } from "@/registry/remocn/paper-tear";+import { pixelSort } from "@/registry/remocn/pixel-sort";+import { venetianBlinds } from "@/registry/remocn/venetian-blinds";+import {+ type DraftEntry,+ TransitionDemo,+ transitionDemoDuration,+} from "./shared";++const IRIS = 36;+const BLINDS = 26;+const TEAR = 36;+const SORT = 30;+const LEAK = 20;++export const transitionDrafts: DraftEntry[] = [+ {+ id: "iris-wipe",+ component: () => (+ <TransitionDemo presentation={irisWipe()} transitionFrames={IRIS} />+ ),+ durationInFrames: transitionDemoDuration(IRIS),+ },+ {+ id: "venetian-blinds",+ component: () => (+ <TransitionDemo+ presentation={venetianBlinds()}+ transitionFrames={BLINDS}+ />+ ),+ durationInFrames: transitionDemoDuration(BLINDS),+ },+ {+ id: "paper-tear",+ component: () => (+ <TransitionDemo presentation={paperTear()} transitionFrames={TEAR} />+ ),+ durationInFrames: transitionDemoDuration(TEAR),+ },+ {+ id: "pixel-sort",+ component: () => (+ <TransitionDemo presentation={pixelSort()} transitionFrames={SORT} />+ ),+ durationInFrames: transitionDemoDuration(SORT),+ },+ {+ id: "light-leak",+ component: () => (+ <TransitionDemo presentation={lightLeak()} transitionFrames={LEAK} />+ ),+ durationInFrames: transitionDemoDuration(LEAK),+ },+];