Skip to content

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

Rebuild registry artifacts after formatting

kapishdima4b8c14c0c022
diff --git a/registry-artifacts/caret-swap.json b/registry-artifacts/caret-swap.json
index 60ca5bd0..0eb071b4 100644
--- a/registry-artifacts/caret-swap.json
+++ b/registry-artifacts/caret-swap.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/caret-swap/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface CaretSwapProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n caretColor?: string;\n caretColorEnd?: string;\n swapAt?: number;\n typeSpeed?: number;\n speed?: number;\n className?: string;\n}\n\nconst CARET_LEAD = 7;\nconst EXPAND_FRAMES = 6;\nconst COLLAPSE_FRAMES = 7;\nconst IDLE_FRAMES = 7;\nconst BLINK_FRAMES = 8;\nconst CARET_WIDTH_EM = 0.08;\nconst CARET_HEIGHT_EM = 1.1;\nconst CARET_GAP_EM = 0.06;\nconst CHAR_WIDTH_EM = 0.52;\nconst TYPE_ACCEL = 0.96;\n\nfunction typeElapsed(count: number, typeSpeed: number): number {\n return (typeSpeed * (1 - TYPE_ACCEL ** count)) / (1 - TYPE_ACCEL);\n}\n\nexport function caretSwapLength(\n toText: string,\n swapAt = 20,\n typeSpeed = 1,\n): number {\n return Math.ceil(\n swapAt +\n EXPAND_FRAMES +\n COLLAPSE_FRAMES +\n IDLE_FRAMES +\n typeElapsed(Array.from(toText).length, typeSpeed),\n );\n}\n\nconst expandEasing = Easing.bezier(0.6, 0, 0.8, 0.4);\nconst collapseEasing = Easing.bezier(0.2, 0.7, 0.3, 1);\n\nexport function CaretSwap({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n caretColor = \"#FF4DAA\",\n caretColorEnd = \"#8A5CF6\",\n swapAt = 20,\n typeSpeed = 1,\n speed = 1,\n className,\n}: CaretSwapProps) {\n const frame = useCurrentFrame() * speed;\n\n const toChars = Array.from(toText);\n const caretWidth = CARET_WIDTH_EM * fontSize;\n const caretHeight = CARET_HEIGHT_EM * fontSize;\n\n const caretVisibleAt = Math.max(swapAt - CARET_LEAD, 0);\n const expandEnd = swapAt + EXPAND_FRAMES;\n const collapseEnd = expandEnd + COLLAPSE_FRAMES;\n const typeStart = collapseEnd + IDLE_FRAMES;\n const typeEnd = typeStart + typeElapsed(toChars.length, typeSpeed);\n\n const expand = interpolate(frame, [swapAt, expandEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: expandEasing,\n });\n const collapse = interpolate(frame, [expandEnd, collapseEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: collapseEasing,\n });\n\n const typing = frame >= typeStart;\n let typedCount = 0;\n if (typing) {\n while (\n typedCount < toChars.length &&\n typeElapsed(typedCount, typeSpeed) <= frame - typeStart\n ) {\n typedCount++;\n }\n }\n const typed = toChars.slice(0, typedCount).join(\"\");\n\n const anchorWidthEm =\n Array.from(fromText).length * CHAR_WIDTH_EM +\n CARET_WIDTH_EM +\n CARET_GAP_EM;\n const targetShiftEm = (anchorWidthEm - toChars.length * CHAR_WIDTH_EM) / 2;\n const typeProgress = toChars.length > 0 ? typedCount / toChars.length : 0;\n const typedShift = targetShiftEm * typeProgress * fontSize;\n\n const blinkOff =\n frame >= typeEnd + BLINK_FRAMES &&\n Math.floor((frame - typeEnd) / BLINK_FRAMES) % 2 === 1;\n\n const caretStyle = {\n background: `linear-gradient(180deg, ${caretColor}, ${caretColorEnd})`,\n borderRadius: fontSize * 0.03,\n };\n\n const overlayWidth =\n frame < expandEnd\n ? `calc(${(expand * 100).toFixed(3)}% + ${((1 - expand) * caretWidth).toFixed(2)}px)`\n : `calc(${((1 - collapse) * 100).toFixed(3)}% + ${(collapse * caretWidth).toFixed(2)}px)`;\n\n const tailSolidStop =\n frame < expandEnd ? 100 - 90 * expand : 10 + 90 * collapse;\n const tailMask =\n frame >= swapAt\n ? `linear-gradient(90deg, black ${tailSolidStop.toFixed(1)}%, transparent 100%)`\n : undefined;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n visibility: frame < expandEnd ? \"visible\" : \"hidden\",\n }}\n >\n {fromText}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n visibility: \"hidden\",\n }}\n />\n {!typing && (\n <span\n aria-hidden\n style={{\n ...caretStyle,\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n height: caretHeight,\n ...(frame < swapAt\n ? { right: 0, width: caretWidth }\n : frame < expandEnd\n ? { right: 0, width: overlayWidth }\n : { left: 0, width: overlayWidth }),\n WebkitMaskImage: tailMask,\n maskImage: tailMask,\n opacity: frame >= caretVisibleAt ? 1 : 0,\n }}\n />\n )}\n {typing && (\n <span\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n transform: `translate(${typedShift.toFixed(1)}px, -50%)`,\n display: \"inline-flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ display: \"inline-block\", whiteSpace: \"pre\" }}>\n {typed}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n opacity: blinkOff ? 0 : 1,\n }}\n />\n </span>\n )}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface CaretSwapProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n caretColor?: string;\n caretColorEnd?: string;\n swapAt?: number;\n typeSpeed?: number;\n speed?: number;\n className?: string;\n}\n\nconst CARET_LEAD = 7;\nconst EXPAND_FRAMES = 6;\nconst COLLAPSE_FRAMES = 7;\nconst IDLE_FRAMES = 7;\nconst BLINK_FRAMES = 8;\nconst CARET_WIDTH_EM = 0.08;\nconst CARET_HEIGHT_EM = 1.1;\nconst CARET_GAP_EM = 0.06;\nconst CHAR_WIDTH_EM = 0.52;\nconst TYPE_ACCEL = 0.96;\n\nfunction typeElapsed(count: number, typeSpeed: number): number {\n return (typeSpeed * (1 - TYPE_ACCEL ** count)) / (1 - TYPE_ACCEL);\n}\n\nexport function caretSwapLength(\n toText: string,\n swapAt = 20,\n typeSpeed = 1,\n): number {\n return Math.ceil(\n swapAt +\n EXPAND_FRAMES +\n COLLAPSE_FRAMES +\n IDLE_FRAMES +\n typeElapsed(Array.from(toText).length, typeSpeed),\n );\n}\n\nconst expandEasing = Easing.bezier(0.6, 0, 0.8, 0.4);\nconst collapseEasing = Easing.bezier(0.2, 0.7, 0.3, 1);\n\nexport function CaretSwap({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n caretColor = \"#FF4DAA\",\n caretColorEnd = \"#8A5CF6\",\n swapAt = 20,\n typeSpeed = 1,\n speed = 1,\n className,\n}: CaretSwapProps) {\n const frame = useCurrentFrame() * speed;\n\n const toChars = Array.from(toText);\n const caretWidth = CARET_WIDTH_EM * fontSize;\n const caretHeight = CARET_HEIGHT_EM * fontSize;\n\n const caretVisibleAt = Math.max(swapAt - CARET_LEAD, 0);\n const expandEnd = swapAt + EXPAND_FRAMES;\n const collapseEnd = expandEnd + COLLAPSE_FRAMES;\n const typeStart = collapseEnd + IDLE_FRAMES;\n const typeEnd = typeStart + typeElapsed(toChars.length, typeSpeed);\n\n const expand = interpolate(frame, [swapAt, expandEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: expandEasing,\n });\n const collapse = interpolate(frame, [expandEnd, collapseEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: collapseEasing,\n });\n\n const typing = frame >= typeStart;\n let typedCount = 0;\n if (typing) {\n while (\n typedCount < toChars.length &&\n typeElapsed(typedCount, typeSpeed) <= frame - typeStart\n ) {\n typedCount++;\n }\n }\n const typed = toChars.slice(0, typedCount).join(\"\");\n\n const anchorWidthEm =\n Array.from(fromText).length * CHAR_WIDTH_EM + CARET_WIDTH_EM + CARET_GAP_EM;\n const targetShiftEm = (anchorWidthEm - toChars.length * CHAR_WIDTH_EM) / 2;\n const typeProgress = toChars.length > 0 ? typedCount / toChars.length : 0;\n const typedShift = targetShiftEm * typeProgress * fontSize;\n\n const blinkOff =\n frame >= typeEnd + BLINK_FRAMES &&\n Math.floor((frame - typeEnd) / BLINK_FRAMES) % 2 === 1;\n\n const caretStyle = {\n background: `linear-gradient(180deg, ${caretColor}, ${caretColorEnd})`,\n borderRadius: fontSize * 0.03,\n };\n\n const overlayWidth =\n frame < expandEnd\n ? `calc(${(expand * 100).toFixed(3)}% + ${((1 - expand) * caretWidth).toFixed(2)}px)`\n : `calc(${((1 - collapse) * 100).toFixed(3)}% + ${(collapse * caretWidth).toFixed(2)}px)`;\n\n const tailSolidStop =\n frame < expandEnd ? 100 - 90 * expand : 10 + 90 * collapse;\n const tailMask =\n frame >= swapAt\n ? `linear-gradient(90deg, black ${tailSolidStop.toFixed(1)}%, transparent 100%)`\n : undefined;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n visibility: frame < expandEnd ? \"visible\" : \"hidden\",\n }}\n >\n {fromText}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n visibility: \"hidden\",\n }}\n />\n {!typing && (\n <span\n aria-hidden\n style={{\n ...caretStyle,\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n height: caretHeight,\n ...(frame < swapAt\n ? { right: 0, width: caretWidth }\n : frame < expandEnd\n ? { right: 0, width: overlayWidth }\n : { left: 0, width: overlayWidth }),\n WebkitMaskImage: tailMask,\n maskImage: tailMask,\n opacity: frame >= caretVisibleAt ? 1 : 0,\n }}\n />\n )}\n {typing && (\n <span\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n transform: `translate(${typedShift.toFixed(1)}px, -50%)`,\n display: \"inline-flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ display: \"inline-block\", whiteSpace: \"pre\" }}>\n {typed}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n opacity: blinkOff ? 0 : 1,\n }}\n />\n </span>\n )}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/caret-swap.tsx"
}
diff --git a/registry-artifacts/elements/caret-swap.json b/registry-artifacts/elements/caret-swap.json
index 1b7b317a..0c039dc4 100644
--- a/registry-artifacts/elements/caret-swap.json
+++ b/registry-artifacts/elements/caret-swap.json
@@ -11,7 +11,7 @@
"durationInFrames": 67,
"installationMode": "component-owned-sequence",
"slug": "caret-swap",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface CaretSwapProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n caretColor?: string;\n caretColorEnd?: string;\n swapAt?: number;\n typeSpeed?: number;\n speed?: number;\n className?: string;\n}\n\nconst CARET_LEAD = 7;\nconst EXPAND_FRAMES = 6;\nconst COLLAPSE_FRAMES = 7;\nconst IDLE_FRAMES = 7;\nconst BLINK_FRAMES = 8;\nconst CARET_WIDTH_EM = 0.08;\nconst CARET_HEIGHT_EM = 1.1;\nconst CARET_GAP_EM = 0.06;\nconst CHAR_WIDTH_EM = 0.52;\nconst TYPE_ACCEL = 0.96;\n\nfunction typeElapsed(count: number, typeSpeed: number): number {\n return (typeSpeed * (1 - TYPE_ACCEL ** count)) / (1 - TYPE_ACCEL);\n}\n\nfunction caretSwapLength(\n toText: string,\n swapAt = 20,\n typeSpeed = 1,\n): number {\n return Math.ceil(\n swapAt +\n EXPAND_FRAMES +\n COLLAPSE_FRAMES +\n IDLE_FRAMES +\n typeElapsed(Array.from(toText).length, typeSpeed),\n );\n}\n\nconst expandEasing = Easing.bezier(0.6, 0, 0.8, 0.4);\nconst collapseEasing = Easing.bezier(0.2, 0.7, 0.3, 1);\n\nfunction CaretSwapBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n caretColor = \"#FF4DAA\",\n caretColorEnd = \"#8A5CF6\",\n swapAt = 20,\n typeSpeed = 1,\n speed = 1,\n className,\n}: CaretSwapProps) {\n const frame = useCurrentFrame() * speed;\n\n const toChars = Array.from(toText);\n const caretWidth = CARET_WIDTH_EM * fontSize;\n const caretHeight = CARET_HEIGHT_EM * fontSize;\n\n const caretVisibleAt = Math.max(swapAt - CARET_LEAD, 0);\n const expandEnd = swapAt + EXPAND_FRAMES;\n const collapseEnd = expandEnd + COLLAPSE_FRAMES;\n const typeStart = collapseEnd + IDLE_FRAMES;\n const typeEnd = typeStart + typeElapsed(toChars.length, typeSpeed);\n\n const expand = interpolate(frame, [swapAt, expandEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: expandEasing,\n });\n const collapse = interpolate(frame, [expandEnd, collapseEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: collapseEasing,\n });\n\n const typing = frame >= typeStart;\n let typedCount = 0;\n if (typing) {\n while (\n typedCount < toChars.length &&\n typeElapsed(typedCount, typeSpeed) <= frame - typeStart\n ) {\n typedCount++;\n }\n }\n const typed = toChars.slice(0, typedCount).join(\"\");\n\n const anchorWidthEm =\n Array.from(fromText).length * CHAR_WIDTH_EM +\n CARET_WIDTH_EM +\n CARET_GAP_EM;\n const targetShiftEm = (anchorWidthEm - toChars.length * CHAR_WIDTH_EM) / 2;\n const typeProgress = toChars.length > 0 ? typedCount / toChars.length : 0;\n const typedShift = targetShiftEm * typeProgress * fontSize;\n\n const blinkOff =\n frame >= typeEnd + BLINK_FRAMES &&\n Math.floor((frame - typeEnd) / BLINK_FRAMES) % 2 === 1;\n\n const caretStyle = {\n background: `linear-gradient(180deg, ${caretColor}, ${caretColorEnd})`,\n borderRadius: fontSize * 0.03,\n };\n\n const overlayWidth =\n frame < expandEnd\n ? `calc(${(expand * 100).toFixed(3)}% + ${((1 - expand) * caretWidth).toFixed(2)}px)`\n : `calc(${((1 - collapse) * 100).toFixed(3)}% + ${(collapse * caretWidth).toFixed(2)}px)`;\n\n const tailSolidStop =\n frame < expandEnd ? 100 - 90 * expand : 10 + 90 * collapse;\n const tailMask =\n frame >= swapAt\n ? `linear-gradient(90deg, black ${tailSolidStop.toFixed(1)}%, transparent 100%)`\n : undefined;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n visibility: frame < expandEnd ? \"visible\" : \"hidden\",\n }}\n >\n {fromText}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n visibility: \"hidden\",\n }}\n />\n {!typing && (\n <span\n aria-hidden\n style={{\n ...caretStyle,\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n height: caretHeight,\n ...(frame < swapAt\n ? { right: 0, width: caretWidth }\n : frame < expandEnd\n ? { right: 0, width: overlayWidth }\n : { left: 0, width: overlayWidth }),\n WebkitMaskImage: tailMask,\n maskImage: tailMask,\n opacity: frame >= caretVisibleAt ? 1 : 0,\n }}\n />\n )}\n {typing && (\n <span\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n transform: `translate(${typedShift.toFixed(1)}px, -50%)`,\n display: \"inline-flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ display: \"inline-block\", whiteSpace: \"pre\" }}>\n {typed}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n opacity: blinkOff ? 0 : 1,\n }}\n />\n </span>\n )}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Executing it?\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"That's where everyone quits\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n swapAt: {\n type: \"number\",\n min: 10,\n max: 120,\n step: 5,\n default: 20,\n description: \"Swap frame\",\n hiddenFromList: false,\n },\n typeSpeed: {\n type: \"number\",\n min: 1,\n max: 6,\n step: 1,\n default: 1,\n description: \"Frames / char\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n caretColor: {\n type: \"color\",\n default: \"#FF4DAA\",\n description: \"Caret top\",\n },\n caretColorEnd: {\n type: \"color\",\n default: \"#8A5CF6\",\n description: \"Caret bottom\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 1100,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 120,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"swapAt\",\"typeSpeed\",\"color\",\"caretColor\",\"caretColorEnd\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Executing it?\",\n toText: \"That's where everyone quits\",\n fontSize: 72,\n swapAt: 20,\n typeSpeed: 1,\n color: \"#171717\",\n caretColor: \"#FF4DAA\",\n caretColorEnd: \"#8A5CF6\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype CaretSwapElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CaretSwapBase>;\n\nconst CaretSwapInner = forwardRef<\n HTMLDivElement,\n CaretSwapElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 1100, height = 120, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CaretSwap>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CaretSwapBase\n {...(componentProps as unknown as ComponentProps<typeof CaretSwapBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CaretSwap = Interactive.withSchema({\n Component: CaretSwapInner,\n componentName: \"<CaretSwap>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface CaretSwapProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n caretColor?: string;\n caretColorEnd?: string;\n swapAt?: number;\n typeSpeed?: number;\n speed?: number;\n className?: string;\n}\n\nconst CARET_LEAD = 7;\nconst EXPAND_FRAMES = 6;\nconst COLLAPSE_FRAMES = 7;\nconst IDLE_FRAMES = 7;\nconst BLINK_FRAMES = 8;\nconst CARET_WIDTH_EM = 0.08;\nconst CARET_HEIGHT_EM = 1.1;\nconst CARET_GAP_EM = 0.06;\nconst CHAR_WIDTH_EM = 0.52;\nconst TYPE_ACCEL = 0.96;\n\nfunction typeElapsed(count: number, typeSpeed: number): number {\n return (typeSpeed * (1 - TYPE_ACCEL ** count)) / (1 - TYPE_ACCEL);\n}\n\nfunction caretSwapLength(\n toText: string,\n swapAt = 20,\n typeSpeed = 1,\n): number {\n return Math.ceil(\n swapAt +\n EXPAND_FRAMES +\n COLLAPSE_FRAMES +\n IDLE_FRAMES +\n typeElapsed(Array.from(toText).length, typeSpeed),\n );\n}\n\nconst expandEasing = Easing.bezier(0.6, 0, 0.8, 0.4);\nconst collapseEasing = Easing.bezier(0.2, 0.7, 0.3, 1);\n\nfunction CaretSwapBase({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n caretColor = \"#FF4DAA\",\n caretColorEnd = \"#8A5CF6\",\n swapAt = 20,\n typeSpeed = 1,\n speed = 1,\n className,\n}: CaretSwapProps) {\n const frame = useCurrentFrame() * speed;\n\n const toChars = Array.from(toText);\n const caretWidth = CARET_WIDTH_EM * fontSize;\n const caretHeight = CARET_HEIGHT_EM * fontSize;\n\n const caretVisibleAt = Math.max(swapAt - CARET_LEAD, 0);\n const expandEnd = swapAt + EXPAND_FRAMES;\n const collapseEnd = expandEnd + COLLAPSE_FRAMES;\n const typeStart = collapseEnd + IDLE_FRAMES;\n const typeEnd = typeStart + typeElapsed(toChars.length, typeSpeed);\n\n const expand = interpolate(frame, [swapAt, expandEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: expandEasing,\n });\n const collapse = interpolate(frame, [expandEnd, collapseEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: collapseEasing,\n });\n\n const typing = frame >= typeStart;\n let typedCount = 0;\n if (typing) {\n while (\n typedCount < toChars.length &&\n typeElapsed(typedCount, typeSpeed) <= frame - typeStart\n ) {\n typedCount++;\n }\n }\n const typed = toChars.slice(0, typedCount).join(\"\");\n\n const anchorWidthEm =\n Array.from(fromText).length * CHAR_WIDTH_EM + CARET_WIDTH_EM + CARET_GAP_EM;\n const targetShiftEm = (anchorWidthEm - toChars.length * CHAR_WIDTH_EM) / 2;\n const typeProgress = toChars.length > 0 ? typedCount / toChars.length : 0;\n const typedShift = targetShiftEm * typeProgress * fontSize;\n\n const blinkOff =\n frame >= typeEnd + BLINK_FRAMES &&\n Math.floor((frame - typeEnd) / BLINK_FRAMES) % 2 === 1;\n\n const caretStyle = {\n background: `linear-gradient(180deg, ${caretColor}, ${caretColorEnd})`,\n borderRadius: fontSize * 0.03,\n };\n\n const overlayWidth =\n frame < expandEnd\n ? `calc(${(expand * 100).toFixed(3)}% + ${((1 - expand) * caretWidth).toFixed(2)}px)`\n : `calc(${((1 - collapse) * 100).toFixed(3)}% + ${(collapse * caretWidth).toFixed(2)}px)`;\n\n const tailSolidStop =\n frame < expandEnd ? 100 - 90 * expand : 10 + 90 * collapse;\n const tailMask =\n frame >= swapAt\n ? `linear-gradient(90deg, black ${tailSolidStop.toFixed(1)}%, transparent 100%)`\n : undefined;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n visibility: frame < expandEnd ? \"visible\" : \"hidden\",\n }}\n >\n {fromText}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n visibility: \"hidden\",\n }}\n />\n {!typing && (\n <span\n aria-hidden\n style={{\n ...caretStyle,\n position: \"absolute\",\n top: \"50%\",\n transform: \"translateY(-50%)\",\n height: caretHeight,\n ...(frame < swapAt\n ? { right: 0, width: caretWidth }\n : frame < expandEnd\n ? { right: 0, width: overlayWidth }\n : { left: 0, width: overlayWidth }),\n WebkitMaskImage: tailMask,\n maskImage: tailMask,\n opacity: frame >= caretVisibleAt ? 1 : 0,\n }}\n />\n )}\n {typing && (\n <span\n style={{\n position: \"absolute\",\n left: 0,\n top: \"50%\",\n transform: `translate(${typedShift.toFixed(1)}px, -50%)`,\n display: \"inline-flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ display: \"inline-block\", whiteSpace: \"pre\" }}>\n {typed}\n </span>\n <span\n aria-hidden\n style={{\n ...caretStyle,\n display: \"inline-block\",\n flexShrink: 0,\n width: caretWidth,\n height: caretHeight,\n marginLeft: CARET_GAP_EM * fontSize,\n opacity: blinkOff ? 0 : 1,\n }}\n />\n </span>\n )}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n fromText: {\n type: \"text-content\",\n default: \"Executing it?\",\n description: \"From text\",\n },\n toText: {\n type: \"text-content\",\n default: \"That's where everyone quits\",\n description: \"To text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n swapAt: {\n type: \"number\",\n min: 10,\n max: 120,\n step: 5,\n default: 20,\n description: \"Swap frame\",\n hiddenFromList: false,\n },\n typeSpeed: {\n type: \"number\",\n min: 1,\n max: 6,\n step: 1,\n default: 1,\n description: \"Frames / char\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n caretColor: {\n type: \"color\",\n default: \"#FF4DAA\",\n description: \"Caret top\",\n },\n caretColorEnd: {\n type: \"color\",\n default: \"#8A5CF6\",\n description: \"Caret bottom\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 1100,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 120,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"fromText\",\"toText\",\"fontSize\",\"swapAt\",\"typeSpeed\",\"color\",\"caretColor\",\"caretColorEnd\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n fromText: \"Executing it?\",\n toText: \"That's where everyone quits\",\n fontSize: 72,\n swapAt: 20,\n typeSpeed: 1,\n color: \"#171717\",\n caretColor: \"#FF4DAA\",\n caretColorEnd: \"#8A5CF6\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype CaretSwapElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof CaretSwapBase>;\n\nconst CaretSwapInner = forwardRef<\n HTMLDivElement,\n CaretSwapElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 1100, height = 120, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<CaretSwap>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <CaretSwapBase\n {...(componentProps as unknown as ComponentProps<typeof CaretSwapBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const CaretSwap = Interactive.withSchema({\n Component: CaretSwapInner,\n componentName: \"<CaretSwap>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 67
}
diff --git a/registry-artifacts/elements/sheen-slide-in.json b/registry-artifacts/elements/sheen-slide-in.json
index cb6bd3ed..21611055 100644
--- a/registry-artifacts/elements/sheen-slide-in.json
+++ b/registry-artifacts/elements/sheen-slide-in.json
@@ -11,7 +11,7 @@
"durationInFrames": 64,
"installationMode": "component-owned-sequence",
"slug": "sheen-slide-in",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SheenSlideInProps {\n text: string;\n exitAt?: number;\n fontSize?: number;\n baseColor?: string;\n sheenColor?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst SETTLE_AMP_EM = 1.8;\nconst SETTLE_TAU = 2.5;\nconst CREEP_AMP_EM = 0.28;\nconst CREEP_TAU = 12;\nconst FADE_FRAMES = 4;\nconst SHEEN_IN_START = 0;\nconst SHEEN_IN_END = 4;\nconst SHEEN_SWEEP_END = 48;\nconst SHEEN_OUT_START = 48;\nconst SHEEN_OUT_END = 58;\nconst EXIT_FRAMES = 4;\nconst EXIT_SCALE = 0.9;\n\nfunction sheenSlideInLength(exitAt = 60): number {\n return exitAt + EXIT_FRAMES;\n}\n\nfunction travelEm(frame: number): number {\n return (\n SETTLE_AMP_EM * Math.exp(-frame / SETTLE_TAU) +\n CREEP_AMP_EM * Math.exp(-frame / CREEP_TAU)\n );\n}\n\nconst exitEasing = Easing.out(Easing.quad);\n\nfunction SheenSlideInBase({\n text,\n exitAt = 60,\n fontSize = 72,\n baseColor = \"#18181b\",\n sheenColor = \"#4f8ef7\",\n fontWeight = 400,\n speed = 1,\n className,\n}: SheenSlideInProps) {\n const frame = useCurrentFrame() * speed;\n\n const x = fontSize * travelEm(frame);\n\n const exit = interpolate(frame, [exitAt, exitAt + EXIT_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = interpolate(frame, [0, FADE_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenOpacity =\n interpolate(frame, [SHEEN_IN_START, SHEEN_IN_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }) *\n interpolate(frame, [SHEEN_OUT_START, SHEEN_OUT_END], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenPosition = interpolate(frame, [0, SHEEN_SWEEP_END], [160, -60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.1,\n margin: 0,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n };\n\n if (exit >= 1) {\n return (\n <div style={{ position: \"absolute\", inset: 0, background: \"transparent\" }} />\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-block\",\n opacity,\n translate: `${x}px 0`,\n scale: `${1 - (1 - EXIT_SCALE) * exit}`,\n }}\n >\n <span className={className} style={{ ...textStyle, color: baseColor }}>\n {text}\n </span>\n <span\n aria-hidden\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(100deg, transparent 25%, ${sheenColor} 50%, transparent 75%)`,\n backgroundSize: \"250% 100%\",\n backgroundPosition: `${sheenPosition}% 50%`,\n opacity: sheenOpacity,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Introducing\",\n description: \"Text\",\n },\n exitAt: {\n type: \"number\",\n min: 30,\n max: 150,\n step: 5,\n default: 60,\n description: \"Exit frame\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n baseColor: {\n type: \"color\",\n default: \"#18181b\",\n description: \"Base color\",\n },\n sheenColor: {\n type: \"color\",\n default: \"#4f8ef7\",\n description: \"Sheen color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 620,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 120,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"exitAt\",\"fontSize\",\"baseColor\",\"sheenColor\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Introducing\",\n exitAt: 60,\n fontSize: 72,\n baseColor: \"#18181b\",\n sheenColor: \"#4f8ef7\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype SheenSlideInElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SheenSlideInBase>;\n\nconst SheenSlideInInner = forwardRef<\n HTMLDivElement,\n SheenSlideInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 620, height = 120, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SheenSlideIn>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SheenSlideInBase\n {...(componentProps as unknown as ComponentProps<typeof SheenSlideInBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SheenSlideIn = Interactive.withSchema({\n Component: SheenSlideInInner,\n componentName: \"<SheenSlideIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface SheenSlideInProps {\n text: string;\n exitAt?: number;\n fontSize?: number;\n baseColor?: string;\n sheenColor?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst SETTLE_AMP_EM = 1.8;\nconst SETTLE_TAU = 2.5;\nconst CREEP_AMP_EM = 0.28;\nconst CREEP_TAU = 12;\nconst FADE_FRAMES = 4;\nconst SHEEN_IN_START = 0;\nconst SHEEN_IN_END = 4;\nconst SHEEN_SWEEP_END = 48;\nconst SHEEN_OUT_START = 48;\nconst SHEEN_OUT_END = 58;\nconst EXIT_FRAMES = 4;\nconst EXIT_SCALE = 0.9;\n\nfunction sheenSlideInLength(exitAt = 60): number {\n return exitAt + EXIT_FRAMES;\n}\n\nfunction travelEm(frame: number): number {\n return (\n SETTLE_AMP_EM * Math.exp(-frame / SETTLE_TAU) +\n CREEP_AMP_EM * Math.exp(-frame / CREEP_TAU)\n );\n}\n\nconst exitEasing = Easing.out(Easing.quad);\n\nfunction SheenSlideInBase({\n text,\n exitAt = 60,\n fontSize = 72,\n baseColor = \"#18181b\",\n sheenColor = \"#4f8ef7\",\n fontWeight = 400,\n speed = 1,\n className,\n}: SheenSlideInProps) {\n const frame = useCurrentFrame() * speed;\n\n const x = fontSize * travelEm(frame);\n\n const exit = interpolate(frame, [exitAt, exitAt + EXIT_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = interpolate(frame, [0, FADE_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenOpacity =\n interpolate(frame, [SHEEN_IN_START, SHEEN_IN_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }) *\n interpolate(frame, [SHEEN_OUT_START, SHEEN_OUT_END], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenPosition = interpolate(frame, [0, SHEEN_SWEEP_END], [160, -60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.1,\n margin: 0,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n };\n\n if (exit >= 1) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, background: \"transparent\" }}\n />\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-block\",\n opacity,\n translate: `${x}px 0`,\n scale: `${1 - (1 - EXIT_SCALE) * exit}`,\n }}\n >\n <span className={className} style={{ ...textStyle, color: baseColor }}>\n {text}\n </span>\n <span\n aria-hidden\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(100deg, transparent 25%, ${sheenColor} 50%, transparent 75%)`,\n backgroundSize: \"250% 100%\",\n backgroundPosition: `${sheenPosition}% 50%`,\n opacity: sheenOpacity,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Introducing\",\n description: \"Text\",\n },\n exitAt: {\n type: \"number\",\n min: 30,\n max: 150,\n step: 5,\n default: 60,\n description: \"Exit frame\",\n hiddenFromList: false,\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n baseColor: {\n type: \"color\",\n default: \"#18181b\",\n description: \"Base color\",\n },\n sheenColor: {\n type: \"color\",\n default: \"#4f8ef7\",\n description: \"Sheen color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 620,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 120,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"exitAt\",\"fontSize\",\"baseColor\",\"sheenColor\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Introducing\",\n exitAt: 60,\n fontSize: 72,\n baseColor: \"#18181b\",\n sheenColor: \"#4f8ef7\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype SheenSlideInElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof SheenSlideInBase>;\n\nconst SheenSlideInInner = forwardRef<\n HTMLDivElement,\n SheenSlideInElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 620, height = 120, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<SheenSlideIn>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <SheenSlideInBase\n {...(componentProps as unknown as ComponentProps<typeof SheenSlideInBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const SheenSlideIn = Interactive.withSchema({\n Component: SheenSlideInInner,\n componentName: \"<SheenSlideIn>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 64
}
diff --git a/registry-artifacts/elements/word-push.json b/registry-artifacts/elements/word-push.json
index 983f80c9..caa41b32 100644
--- a/registry-artifacts/elements/word-push.json
+++ b/registry-artifacts/elements/word-push.json
@@ -11,7 +11,7 @@
"durationInFrames": 42,
"installationMode": "component-owned-sequence",
"slug": "word-push",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface WordPushProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n accel?: number;\n speed?: number;\n className?: string;\n}\n\nconst REVEAL_FRAMES = 2;\nconst SLIDE_FRAMES = 12;\nconst OVERSHOOT_EM = 0.5;\nconst CHAR_WIDTH_EM = 0.5;\nconst SPACE_WIDTH_EM = 0.22;\n\nfunction revealFrame(index: number, wordGap: number, accel: number): number {\n if (accel === 1) return index * wordGap;\n return (wordGap * (1 - accel ** index)) / (1 - accel);\n}\n\nfunction wordPushLength(text: string, wordGap = 10, accel = 0.8): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return 0;\n return Math.ceil(revealFrame(words.length - 1, wordGap, accel)) + SLIDE_FRAMES;\n}\n\nconst pushEasing = Easing.out(Easing.cubic);\nconst driveEasing = Easing.bezier(0.15, 0.7, 0.25, 1);\n\nfunction WordPushBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 10,\n accel = 0.8,\n speed = 1,\n className,\n}: WordPushProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n let lineX = interpolate(\n frame,\n [0, SLIDE_FRAMES],\n [-OVERSHOOT_EM * fontSize, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n },\n );\n for (let j = 1; j < words.length; j++) {\n const wordWidth =\n (words[j].length * CHAR_WIDTH_EM + SPACE_WIDTH_EM) * fontSize;\n const revealAt = revealFrame(j, wordGap, accel);\n const pushed = interpolate(\n frame,\n [revealAt + 1, revealAt + 1 + SLIDE_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: pushEasing,\n },\n );\n lineX += (wordWidth / 2) * (1 - pushed);\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${lineX}px 0`,\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, j) => {\n const revealAt = revealFrame(j, wordGap, accel);\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const driven =\n j === 0\n ? 1\n : interpolate(frame, [revealAt, revealAt + SLIDE_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n });\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight: j < words.length - 1 ? \"0.22em\" : undefined,\n opacity,\n translate: `${OVERSHOOT_EM * fontSize * (1 - driven)}px 0`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"move at your own pace\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n wordGap: {\n type: \"number\",\n min: 3,\n max: 30,\n step: 1,\n default: 10,\n description: \"Frames / word\",\n hiddenFromList: false,\n },\n accel: {\n type: \"number\",\n min: 0.5,\n max: 1,\n step: 0.05,\n default: 0.8,\n description: \"Gap shrink / word\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 760,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 110,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"wordGap\",\"accel\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"move at your own pace\",\n fontSize: 72,\n wordGap: 10,\n accel: 0.8,\n color: \"#171717\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype WordPushElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof WordPushBase>;\n\nconst WordPushInner = forwardRef<\n HTMLDivElement,\n WordPushElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 760, height = 110, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<WordPush>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <WordPushBase\n {...(componentProps as unknown as ComponentProps<typeof WordPushBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const WordPush = Interactive.withSchema({\n Component: WordPushInner,\n componentName: \"<WordPush>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface WordPushProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n accel?: number;\n speed?: number;\n className?: string;\n}\n\nconst REVEAL_FRAMES = 2;\nconst SLIDE_FRAMES = 12;\nconst OVERSHOOT_EM = 0.5;\nconst CHAR_WIDTH_EM = 0.5;\nconst SPACE_WIDTH_EM = 0.22;\n\nfunction revealFrame(index: number, wordGap: number, accel: number): number {\n if (accel === 1) return index * wordGap;\n return (wordGap * (1 - accel ** index)) / (1 - accel);\n}\n\nfunction wordPushLength(\n text: string,\n wordGap = 10,\n accel = 0.8,\n): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return 0;\n return (\n Math.ceil(revealFrame(words.length - 1, wordGap, accel)) + SLIDE_FRAMES\n );\n}\n\nconst pushEasing = Easing.out(Easing.cubic);\nconst driveEasing = Easing.bezier(0.15, 0.7, 0.25, 1);\n\nfunction WordPushBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 10,\n accel = 0.8,\n speed = 1,\n className,\n}: WordPushProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n let lineX = interpolate(\n frame,\n [0, SLIDE_FRAMES],\n [-OVERSHOOT_EM * fontSize, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n },\n );\n for (let j = 1; j < words.length; j++) {\n const wordWidth =\n (words[j].length * CHAR_WIDTH_EM + SPACE_WIDTH_EM) * fontSize;\n const revealAt = revealFrame(j, wordGap, accel);\n const pushed = interpolate(\n frame,\n [revealAt + 1, revealAt + 1 + SLIDE_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: pushEasing,\n },\n );\n lineX += (wordWidth / 2) * (1 - pushed);\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${lineX}px 0`,\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, j) => {\n const revealAt = revealFrame(j, wordGap, accel);\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const driven =\n j === 0\n ? 1\n : interpolate(\n frame,\n [revealAt, revealAt + SLIDE_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n },\n );\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight: j < words.length - 1 ? \"0.22em\" : undefined,\n opacity,\n translate: `${OVERSHOOT_EM * fontSize * (1 - driven)}px 0`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"move at your own pace\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n wordGap: {\n type: \"number\",\n min: 3,\n max: 30,\n step: 1,\n default: 10,\n description: \"Frames / word\",\n hiddenFromList: false,\n },\n accel: {\n type: \"number\",\n min: 0.5,\n max: 1,\n step: 0.05,\n default: 0.8,\n description: \"Gap shrink / word\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 760,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 110,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"wordGap\",\"accel\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"move at your own pace\",\n fontSize: 72,\n wordGap: 10,\n accel: 0.8,\n color: \"#171717\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype WordPushElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof WordPushBase>;\n\nconst WordPushInner = forwardRef<\n HTMLDivElement,\n WordPushElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 760, height = 110, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<WordPush>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <WordPushBase\n {...(componentProps as unknown as ComponentProps<typeof WordPushBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const WordPush = Interactive.withSchema({\n Component: WordPushInner,\n componentName: \"<WordPush>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 42
}
diff --git a/registry-artifacts/elements/word-stream.json b/registry-artifacts/elements/word-stream.json
index 72c064b2..b940305d 100644
--- a/registry-artifacts/elements/word-stream.json
+++ b/registry-artifacts/elements/word-stream.json
@@ -11,7 +11,7 @@
"durationInFrames": 63,
"installationMode": "component-owned-sequence",
"slug": "word-stream",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface WordStreamProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n hold?: number;\n drift?: number;\n speed?: number;\n className?: string;\n}\n\ninterface PhraseSchedule {\n words: string[];\n start: number;\n exitStart: number;\n last: boolean;\n}\n\nconst REVEAL_FRAMES = 3;\nconst ENTRY_FRAMES = 8;\nconst RUN_OUT_FRAMES = 5;\nconst SWAP_OVERLAP = 0;\n\nfunction wordStreamLength(\n text: string,\n wordGap = 6,\n hold = 18,\n): number {\n const schedule = schedulePhrases(text, wordGap, hold);\n const finalPhrase = schedule[schedule.length - 1];\n if (!finalPhrase) return 0;\n return (\n finalPhrase.start +\n (finalPhrase.words.length - 1) * wordGap +\n REVEAL_FRAMES\n );\n}\n\nfunction schedulePhrases(\n text: string,\n wordGap: number,\n hold: number,\n): PhraseSchedule[] {\n const phrases = text\n .split(\"|\")\n .map((phrase) => phrase.trim())\n .filter(Boolean);\n let cursor = 0;\n return phrases.map((phrase, i) => {\n const words = phrase.split(/\\s+/);\n const start = cursor;\n const complete = start + (words.length - 1) * wordGap + REVEAL_FRAMES;\n const exitStart = complete + hold;\n cursor = exitStart + SWAP_OVERLAP;\n return { words, start, exitStart, last: i === phrases.length - 1 };\n });\n}\n\nconst revealEasing = Easing.bezier(0.2, 0.8, 0.2, 1);\nconst entryEasing = Easing.bezier(0.2, 0.8, 0.3, 1);\nconst runOutEasing = Easing.bezier(0.7, 0, 0.9, 0.4);\n\nfunction WordStreamBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 6,\n hold = 18,\n drift = 2,\n speed = 1,\n className,\n}: WordStreamProps) {\n const frame = useCurrentFrame() * speed;\n\n const schedule = schedulePhrases(text, wordGap, hold);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n {schedule.map((phrase, i) => {\n if (frame < phrase.start) return null;\n if (!phrase.last && frame >= phrase.exitStart) return null;\n\n const scale = fontSize / 72;\n const crawl = scale * drift;\n const life = phrase.exitStart - phrase.start;\n\n const entryX = interpolate(\n frame,\n [phrase.start, phrase.start + ENTRY_FRAMES],\n [scale * 30, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: entryEasing,\n },\n );\n const crawlX =\n crawl * (life / 2 - (Math.min(frame, phrase.exitStart) - phrase.start));\n const runOutX = phrase.last\n ? 0\n : interpolate(\n frame,\n [phrase.exitStart - RUN_OUT_FRAMES, phrase.exitStart],\n [0, -scale * 80],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: runOutEasing,\n },\n );\n const x = entryX + crawlX + runOutX;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${x}px 0`,\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {phrase.words.map((word, j) => {\n const revealAt = phrase.start + j * wordGap;\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: revealEasing,\n },\n );\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight:\n j < phrase.words.length - 1 ? \"0.28em\" : undefined,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n })}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"introducing | one-tap checkout | for your store\",\n description: \"Phrases (| separated)\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n wordGap: {\n type: \"number\",\n min: 2,\n max: 30,\n step: 1,\n default: 6,\n description: \"Frames / word\",\n hiddenFromList: false,\n },\n hold: {\n type: \"number\",\n min: 6,\n max: 90,\n step: 3,\n default: 18,\n description: \"Phrase hold\",\n hiddenFromList: false,\n },\n drift: {\n type: \"number\",\n min: 0,\n max: 6,\n step: 0.5,\n default: 2,\n description: \"Drift px / frame\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 700,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 110,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"wordGap\",\"hold\",\"drift\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"introducing | one-tap checkout | for your store\",\n fontSize: 72,\n wordGap: 6,\n hold: 18,\n drift: 2,\n color: \"#171717\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype WordStreamElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof WordStreamBase>;\n\nconst WordStreamInner = forwardRef<\n HTMLDivElement,\n WordStreamElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 700, height = 110, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<WordStream>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <WordStreamBase\n {...(componentProps as unknown as ComponentProps<typeof WordStreamBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const WordStream = Interactive.withSchema({\n Component: WordStreamInner,\n componentName: \"<WordStream>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface WordStreamProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n hold?: number;\n drift?: number;\n speed?: number;\n className?: string;\n}\n\ninterface PhraseSchedule {\n words: string[];\n start: number;\n exitStart: number;\n last: boolean;\n}\n\nconst REVEAL_FRAMES = 3;\nconst ENTRY_FRAMES = 8;\nconst RUN_OUT_FRAMES = 5;\nconst SWAP_OVERLAP = 0;\n\nfunction wordStreamLength(text: string, wordGap = 6, hold = 18): number {\n const schedule = schedulePhrases(text, wordGap, hold);\n const finalPhrase = schedule[schedule.length - 1];\n if (!finalPhrase) return 0;\n return (\n finalPhrase.start + (finalPhrase.words.length - 1) * wordGap + REVEAL_FRAMES\n );\n}\n\nfunction schedulePhrases(\n text: string,\n wordGap: number,\n hold: number,\n): PhraseSchedule[] {\n const phrases = text\n .split(\"|\")\n .map((phrase) => phrase.trim())\n .filter(Boolean);\n let cursor = 0;\n return phrases.map((phrase, i) => {\n const words = phrase.split(/\\s+/);\n const start = cursor;\n const complete = start + (words.length - 1) * wordGap + REVEAL_FRAMES;\n const exitStart = complete + hold;\n cursor = exitStart + SWAP_OVERLAP;\n return { words, start, exitStart, last: i === phrases.length - 1 };\n });\n}\n\nconst revealEasing = Easing.bezier(0.2, 0.8, 0.2, 1);\nconst entryEasing = Easing.bezier(0.2, 0.8, 0.3, 1);\nconst runOutEasing = Easing.bezier(0.7, 0, 0.9, 0.4);\n\nfunction WordStreamBase({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 6,\n hold = 18,\n drift = 2,\n speed = 1,\n className,\n}: WordStreamProps) {\n const frame = useCurrentFrame() * speed;\n\n const schedule = schedulePhrases(text, wordGap, hold);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n {schedule.map((phrase, i) => {\n if (frame < phrase.start) return null;\n if (!phrase.last && frame >= phrase.exitStart) return null;\n\n const scale = fontSize / 72;\n const crawl = scale * drift;\n const life = phrase.exitStart - phrase.start;\n\n const entryX = interpolate(\n frame,\n [phrase.start, phrase.start + ENTRY_FRAMES],\n [scale * 30, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: entryEasing,\n },\n );\n const crawlX =\n crawl *\n (life / 2 - (Math.min(frame, phrase.exitStart) - phrase.start));\n const runOutX = phrase.last\n ? 0\n : interpolate(\n frame,\n [phrase.exitStart - RUN_OUT_FRAMES, phrase.exitStart],\n [0, -scale * 80],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: runOutEasing,\n },\n );\n const x = entryX + crawlX + runOutX;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${x}px 0`,\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {phrase.words.map((word, j) => {\n const revealAt = phrase.start + j * wordGap;\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: revealEasing,\n },\n );\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight:\n j < phrase.words.length - 1 ? \"0.28em\" : undefined,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n })}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"introducing | one-tap checkout | for your store\",\n description: \"Phrases (| separated)\",\n },\n fontSize: {\n type: \"number\",\n min: 12,\n max: 160,\n step: 1,\n default: 72,\n description: \"Font size\",\n hiddenFromList: false,\n },\n wordGap: {\n type: \"number\",\n min: 2,\n max: 30,\n step: 1,\n default: 6,\n description: \"Frames / word\",\n hiddenFromList: false,\n },\n hold: {\n type: \"number\",\n min: 6,\n max: 90,\n step: 3,\n default: 18,\n description: \"Phrase hold\",\n hiddenFromList: false,\n },\n drift: {\n type: \"number\",\n min: 0,\n max: 6,\n step: 0.5,\n default: 2,\n description: \"Drift px / frame\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#171717\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n width: {\n type: \"number\",\n default: 700,\n min: 10,\n step: 10,\n description: \"Width\",\n },\n height: {\n type: \"number\",\n default: 110,\n min: 10,\n step: 10,\n description: \"Height\",\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"wordGap\",\"hold\",\"drift\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"introducing | one-tap checkout | for your store\",\n fontSize: 72,\n wordGap: 6,\n hold: 18,\n drift: 2,\n color: \"#171717\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype WordStreamElementProps = InteractiveBaseProps &\n InteractiveTransformProps & { readonly width?: number; readonly height?: number } &\n ComponentProps<typeof WordStreamBase>;\n\nconst WordStreamInner = forwardRef<\n HTMLDivElement,\n WordStreamElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, width = 700, height = 110, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<WordStream>\"}\n outlineRef={outlineRef}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width,\n height,\n ...style,\n }}\n >\n <WordStreamBase\n {...(componentProps as unknown as ComponentProps<typeof WordStreamBase>)}\n />\n </div>\n </div>\n </Sequence>\n );\n});\n\nexport const WordStream = Interactive.withSchema({\n Component: WordStreamInner,\n componentName: \"<WordStream>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 63
}
diff --git a/registry-artifacts/elements/zoom-words.json b/registry-artifacts/elements/zoom-words.json
index 08e7e258..1de3addf 100644
--- a/registry-artifacts/elements/zoom-words.json
+++ b/registry-artifacts/elements/zoom-words.json
@@ -8,7 +8,7 @@
"durationInFrames": 63,
"installationMode": "component-owned-sequence",
"slug": "zoom-words",
- "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ZoomWordsProps {\n text: string;\n fontSize?: number;\n zoom?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n anchor?: number;\n blur?: number;\n blurFrames?: number;\n speed?: number;\n className?: string;\n}\n\nconst CHAR_WIDTH_EM = 0.52;\nconst SPACE_WIDTH_EM = 0.3;\nconst WORD_BLUR_EM = 0.05;\nconst phraseEasing = Easing.bezier(0.5, 0, 0.7, 0.7);\nconst FADE_EARLY = 0.5;\nconst FADE_SLOTS = 2;\n\nfunction smoothstep(t: number): number {\n const x = Math.min(Math.max(t, 0), 1);\n return x * x * (3 - 2 * x);\n}\nconst WORD_SHIFT_X_EM = 0.16;\nconst WORD_SHIFT_Y_EM = 0.12;\n\nfunction wordWidthEm(word: string): number {\n return Array.from(word).length * CHAR_WIDTH_EM + SPACE_WIDTH_EM;\n}\n\nfunction zoomWordsLength(text: string, wordGap = 12): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n return words.length * wordGap;\n}\n\nfunction ZoomWordsBase({\n text,\n fontSize = 64,\n zoom = 2.2,\n color = \"#cfc2ff\",\n fontWeight = 400,\n wordGap = 12,\n anchor = 0.5,\n blur = 0.04,\n blurFrames = 60,\n speed = 1,\n className,\n}: ZoomWordsProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n const phraseFrames = words.length * wordGap;\n const wordProgress =\n words.length *\n interpolate(frame, [0, phraseFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: phraseEasing,\n });\n\n const totalEm = words.reduce((sum, w) => sum + wordWidthEm(w), 0);\n const firstHalfEm = words.length > 0 ? wordWidthEm(words[0]) / 2 : 0;\n const lastHalfEm =\n words.length > 0 ? wordWidthEm(words[words.length - 1]) / 2 : 0;\n let revealedEm = 0;\n for (let i = 0; i < words.length; i++) {\n revealedEm +=\n wordWidthEm(words[i]) *\n smoothstep((wordProgress - i + FADE_EARLY) / FADE_SLOTS);\n }\n const travelMax = Math.max(totalEm - lastHalfEm - firstHalfEm, 0.001);\n const raw = Math.min(Math.max(revealedEm, 0), travelMax);\n const cameraEm = firstHalfEm + travelMax * smoothstep(raw / travelMax);\n const cameraPct = totalEm > 0 ? (cameraEm / totalEm) * 100 : 0;\n\n const blurNow =\n blur *\n fontSize *\n zoom *\n interpolate(frame, [0, blurFrames], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n scale: `${zoom}`,\n filter: blurNow > 0.05 ? `blur(${blurNow}px)` : undefined,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: `${anchor * 100}%`,\n transform: \"translateY(-50%)\",\n whiteSpace: \"pre\",\n }}\n >\n <span\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"baseline\",\n transform: `translateX(-${cameraPct.toFixed(3)}%)`,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, i) => {\n const p = smoothstep(\n (wordProgress - i + FADE_EARLY) / FADE_SLOTS,\n );\n const opacity = smoothstep(p * 1.2);\n const wordBlur = WORD_BLUR_EM * fontSize * (1 - p);\n const arrive = 1 - smoothstep(p * 1.6);\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n opacity,\n filter:\n wordBlur > 0.05 ? `blur(${wordBlur}px)` : undefined,\n translate: `${(WORD_SHIFT_X_EM * fontSize * arrive).toFixed(1)}px ${(WORD_SHIFT_Y_EM * fontSize * arrive).toFixed(1)}px`,\n }}\n >\n {word}\n {i < words.length - 1 && \" \"}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Still piecing together tools\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 24,\n max: 160,\n step: 1,\n default: 64,\n description: \"Font size\",\n hiddenFromList: false,\n },\n wordGap: {\n type: \"number\",\n min: 4,\n max: 24,\n step: 1,\n default: 12,\n description: \"Frames / word\",\n hiddenFromList: false,\n },\n zoom: {\n type: \"number\",\n min: 1,\n max: 4,\n step: 0.1,\n default: 2.2,\n description: \"Camera zoom\",\n hiddenFromList: false,\n },\n anchor: {\n type: \"number\",\n min: 0.2,\n max: 0.9,\n step: 0.05,\n default: 0.5,\n description: \"Camera anchor\",\n hiddenFromList: false,\n },\n blur: {\n type: \"number\",\n min: 0,\n max: 0.3,\n step: 0.01,\n default: 0.04,\n description: \"Start blur (em)\",\n hiddenFromList: false,\n },\n blurFrames: {\n type: \"number\",\n min: 10,\n max: 120,\n step: 5,\n default: 60,\n description: \"Focus frames\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#cfc2ff\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"wordGap\",\"zoom\",\"anchor\",\"blur\",\"blurFrames\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Still piecing together tools\",\n fontSize: 64,\n wordGap: 12,\n zoom: 2.2,\n anchor: 0.5,\n blur: 0.04,\n blurFrames: 60,\n color: \"#cfc2ff\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype ZoomWordsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ZoomWordsBase>;\n\nconst ZoomWordsInner = forwardRef<\n HTMLDivElement,\n ZoomWordsElementProps & { 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 ?? \"<ZoomWords>\"}\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 <ZoomWordsBase\n {...(componentProps as unknown as ComponentProps<typeof ZoomWordsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ZoomWords = Interactive.withSchema({\n Component: ZoomWordsInner,\n componentName: \"<ZoomWords>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
+ "sourceCode": "import { Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\nimport { forwardRef, useImperativeHandle, useRef, type ComponentProps } from \"react\";\n\ninterface ZoomWordsProps {\n text: string;\n fontSize?: number;\n zoom?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n anchor?: number;\n blur?: number;\n blurFrames?: number;\n speed?: number;\n className?: string;\n}\n\nconst CHAR_WIDTH_EM = 0.52;\nconst SPACE_WIDTH_EM = 0.3;\nconst WORD_BLUR_EM = 0.05;\nconst phraseEasing = Easing.bezier(0.5, 0, 0.7, 0.7);\nconst FADE_EARLY = 0.5;\nconst FADE_SLOTS = 2;\n\nfunction smoothstep(t: number): number {\n const x = Math.min(Math.max(t, 0), 1);\n return x * x * (3 - 2 * x);\n}\nconst WORD_SHIFT_X_EM = 0.16;\nconst WORD_SHIFT_Y_EM = 0.12;\n\nfunction wordWidthEm(word: string): number {\n return Array.from(word).length * CHAR_WIDTH_EM + SPACE_WIDTH_EM;\n}\n\nfunction zoomWordsLength(text: string, wordGap = 12): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n return words.length * wordGap;\n}\n\nfunction ZoomWordsBase({\n text,\n fontSize = 64,\n zoom = 2.2,\n color = \"#cfc2ff\",\n fontWeight = 400,\n wordGap = 12,\n anchor = 0.5,\n blur = 0.04,\n blurFrames = 60,\n speed = 1,\n className,\n}: ZoomWordsProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n const phraseFrames = words.length * wordGap;\n const wordProgress =\n words.length *\n interpolate(frame, [0, phraseFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: phraseEasing,\n });\n\n const totalEm = words.reduce((sum, w) => sum + wordWidthEm(w), 0);\n const firstHalfEm = words.length > 0 ? wordWidthEm(words[0]) / 2 : 0;\n const lastHalfEm =\n words.length > 0 ? wordWidthEm(words[words.length - 1]) / 2 : 0;\n let revealedEm = 0;\n for (let i = 0; i < words.length; i++) {\n revealedEm +=\n wordWidthEm(words[i]) *\n smoothstep((wordProgress - i + FADE_EARLY) / FADE_SLOTS);\n }\n const travelMax = Math.max(totalEm - lastHalfEm - firstHalfEm, 0.001);\n const raw = Math.min(Math.max(revealedEm, 0), travelMax);\n const cameraEm = firstHalfEm + travelMax * smoothstep(raw / travelMax);\n const cameraPct = totalEm > 0 ? (cameraEm / totalEm) * 100 : 0;\n\n const blurNow =\n blur *\n fontSize *\n zoom *\n interpolate(frame, [0, blurFrames], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n scale: `${zoom}`,\n filter: blurNow > 0.05 ? `blur(${blurNow}px)` : undefined,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: `${anchor * 100}%`,\n transform: \"translateY(-50%)\",\n whiteSpace: \"pre\",\n }}\n >\n <span\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"baseline\",\n transform: `translateX(-${cameraPct.toFixed(3)}%)`,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, i) => {\n const p = smoothstep(\n (wordProgress - i + FADE_EARLY) / FADE_SLOTS,\n );\n const opacity = smoothstep(p * 1.2);\n const wordBlur = WORD_BLUR_EM * fontSize * (1 - p);\n const arrive = 1 - smoothstep(p * 1.6);\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n opacity,\n filter: wordBlur > 0.05 ? `blur(${wordBlur}px)` : undefined,\n translate: `${(WORD_SHIFT_X_EM * fontSize * arrive).toFixed(1)}px ${(WORD_SHIFT_Y_EM * fontSize * arrive).toFixed(1)}px`,\n }}\n >\n {word}\n {i < words.length - 1 && \" \"}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n text: {\n type: \"text-content\",\n default: \"Still piecing together tools\",\n description: \"Text\",\n },\n fontSize: {\n type: \"number\",\n min: 24,\n max: 160,\n step: 1,\n default: 64,\n description: \"Font size\",\n hiddenFromList: false,\n },\n wordGap: {\n type: \"number\",\n min: 4,\n max: 24,\n step: 1,\n default: 12,\n description: \"Frames / word\",\n hiddenFromList: false,\n },\n zoom: {\n type: \"number\",\n min: 1,\n max: 4,\n step: 0.1,\n default: 2.2,\n description: \"Camera zoom\",\n hiddenFromList: false,\n },\n anchor: {\n type: \"number\",\n min: 0.2,\n max: 0.9,\n step: 0.05,\n default: 0.5,\n description: \"Camera anchor\",\n hiddenFromList: false,\n },\n blur: {\n type: \"number\",\n min: 0,\n max: 0.3,\n step: 0.01,\n default: 0.04,\n description: \"Start blur (em)\",\n hiddenFromList: false,\n },\n blurFrames: {\n type: \"number\",\n min: 10,\n max: 120,\n step: 5,\n default: 60,\n description: \"Focus frames\",\n hiddenFromList: false,\n },\n color: {\n type: \"color\",\n default: \"#cfc2ff\",\n description: \"Color\",\n },\n fontWeight: {\n type: \"enum\",\n default: \"400\",\n variants: {\n \"400\": {},\n \"500\": {},\n \"600\": {},\n \"700\": {},\n },\n description: \"Font weight\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"text\",\"fontSize\",\"wordGap\",\"zoom\",\"anchor\",\"blur\",\"blurFrames\",\"color\",\"fontWeight\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n text: \"Still piecing together tools\",\n fontSize: 64,\n wordGap: 12,\n zoom: 2.2,\n anchor: 0.5,\n blur: 0.04,\n blurFrames: 60,\n color: \"#cfc2ff\",\n fontWeight: \"400\",\n speed: 1,\n};\n\ntype ZoomWordsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ZoomWordsBase>;\n\nconst ZoomWordsInner = forwardRef<\n HTMLDivElement,\n ZoomWordsElementProps & { 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 ?? \"<ZoomWords>\"}\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 <ZoomWordsBase\n {...(componentProps as unknown as ComponentProps<typeof ZoomWordsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ZoomWords = Interactive.withSchema({\n Component: ZoomWordsInner,\n componentName: \"<ZoomWords>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"
},
"durationInFrames": 63
}
diff --git a/registry-artifacts/sheen-slide-in.json b/registry-artifacts/sheen-slide-in.json
index 3f420285..b2858ea9 100644
--- a/registry-artifacts/sheen-slide-in.json
+++ b/registry-artifacts/sheen-slide-in.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/sheen-slide-in/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SheenSlideInProps {\n text: string;\n exitAt?: number;\n fontSize?: number;\n baseColor?: string;\n sheenColor?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst SETTLE_AMP_EM = 1.8;\nconst SETTLE_TAU = 2.5;\nconst CREEP_AMP_EM = 0.28;\nconst CREEP_TAU = 12;\nconst FADE_FRAMES = 4;\nconst SHEEN_IN_START = 0;\nconst SHEEN_IN_END = 4;\nconst SHEEN_SWEEP_END = 48;\nconst SHEEN_OUT_START = 48;\nconst SHEEN_OUT_END = 58;\nconst EXIT_FRAMES = 4;\nconst EXIT_SCALE = 0.9;\n\nexport function sheenSlideInLength(exitAt = 60): number {\n return exitAt + EXIT_FRAMES;\n}\n\nfunction travelEm(frame: number): number {\n return (\n SETTLE_AMP_EM * Math.exp(-frame / SETTLE_TAU) +\n CREEP_AMP_EM * Math.exp(-frame / CREEP_TAU)\n );\n}\n\nconst exitEasing = Easing.out(Easing.quad);\n\nexport function SheenSlideIn({\n text,\n exitAt = 60,\n fontSize = 72,\n baseColor = \"#18181b\",\n sheenColor = \"#4f8ef7\",\n fontWeight = 400,\n speed = 1,\n className,\n}: SheenSlideInProps) {\n const frame = useCurrentFrame() * speed;\n\n const x = fontSize * travelEm(frame);\n\n const exit = interpolate(frame, [exitAt, exitAt + EXIT_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = interpolate(frame, [0, FADE_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenOpacity =\n interpolate(frame, [SHEEN_IN_START, SHEEN_IN_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }) *\n interpolate(frame, [SHEEN_OUT_START, SHEEN_OUT_END], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenPosition = interpolate(frame, [0, SHEEN_SWEEP_END], [160, -60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.1,\n margin: 0,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n };\n\n if (exit >= 1) {\n return (\n <div style={{ position: \"absolute\", inset: 0, background: \"transparent\" }} />\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-block\",\n opacity,\n translate: `${x}px 0`,\n scale: `${1 - (1 - EXIT_SCALE) * exit}`,\n }}\n >\n <span className={className} style={{ ...textStyle, color: baseColor }}>\n {text}\n </span>\n <span\n aria-hidden\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(100deg, transparent 25%, ${sheenColor} 50%, transparent 75%)`,\n backgroundSize: \"250% 100%\",\n backgroundPosition: `${sheenPosition}% 50%`,\n opacity: sheenOpacity,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SheenSlideInProps {\n text: string;\n exitAt?: number;\n fontSize?: number;\n baseColor?: string;\n sheenColor?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nconst SETTLE_AMP_EM = 1.8;\nconst SETTLE_TAU = 2.5;\nconst CREEP_AMP_EM = 0.28;\nconst CREEP_TAU = 12;\nconst FADE_FRAMES = 4;\nconst SHEEN_IN_START = 0;\nconst SHEEN_IN_END = 4;\nconst SHEEN_SWEEP_END = 48;\nconst SHEEN_OUT_START = 48;\nconst SHEEN_OUT_END = 58;\nconst EXIT_FRAMES = 4;\nconst EXIT_SCALE = 0.9;\n\nexport function sheenSlideInLength(exitAt = 60): number {\n return exitAt + EXIT_FRAMES;\n}\n\nfunction travelEm(frame: number): number {\n return (\n SETTLE_AMP_EM * Math.exp(-frame / SETTLE_TAU) +\n CREEP_AMP_EM * Math.exp(-frame / CREEP_TAU)\n );\n}\n\nconst exitEasing = Easing.out(Easing.quad);\n\nexport function SheenSlideIn({\n text,\n exitAt = 60,\n fontSize = 72,\n baseColor = \"#18181b\",\n sheenColor = \"#4f8ef7\",\n fontWeight = 400,\n speed = 1,\n className,\n}: SheenSlideInProps) {\n const frame = useCurrentFrame() * speed;\n\n const x = fontSize * travelEm(frame);\n\n const exit = interpolate(frame, [exitAt, exitAt + EXIT_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = interpolate(frame, [0, FADE_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenOpacity =\n interpolate(frame, [SHEEN_IN_START, SHEEN_IN_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }) *\n interpolate(frame, [SHEEN_OUT_START, SHEEN_OUT_END], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const sheenPosition = interpolate(frame, [0, SHEEN_SWEEP_END], [160, -60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const textStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.1,\n margin: 0,\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n };\n\n if (exit >= 1) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, background: \"transparent\" }}\n />\n );\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"inline-block\",\n opacity,\n translate: `${x}px 0`,\n scale: `${1 - (1 - EXIT_SCALE) * exit}`,\n }}\n >\n <span className={className} style={{ ...textStyle, color: baseColor }}>\n {text}\n </span>\n <span\n aria-hidden\n style={{\n ...textStyle,\n position: \"absolute\",\n inset: 0,\n color: \"transparent\",\n backgroundClip: \"text\",\n WebkitBackgroundClip: \"text\",\n backgroundImage: `linear-gradient(100deg, transparent 25%, ${sheenColor} 50%, transparent 75%)`,\n backgroundSize: \"250% 100%\",\n backgroundPosition: `${sheenPosition}% 50%`,\n opacity: sheenOpacity,\n }}\n >\n {text}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/sheen-slide-in.tsx"
}
diff --git a/registry-artifacts/word-push.json b/registry-artifacts/word-push.json
index 6463e0fe..c377e9d9 100644
--- a/registry-artifacts/word-push.json
+++ b/registry-artifacts/word-push.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/word-push/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface WordPushProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n accel?: number;\n speed?: number;\n className?: string;\n}\n\nconst REVEAL_FRAMES = 2;\nconst SLIDE_FRAMES = 12;\nconst OVERSHOOT_EM = 0.5;\nconst CHAR_WIDTH_EM = 0.5;\nconst SPACE_WIDTH_EM = 0.22;\n\nfunction revealFrame(index: number, wordGap: number, accel: number): number {\n if (accel === 1) return index * wordGap;\n return (wordGap * (1 - accel ** index)) / (1 - accel);\n}\n\nexport function wordPushLength(text: string, wordGap = 10, accel = 0.8): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return 0;\n return Math.ceil(revealFrame(words.length - 1, wordGap, accel)) + SLIDE_FRAMES;\n}\n\nconst pushEasing = Easing.out(Easing.cubic);\nconst driveEasing = Easing.bezier(0.15, 0.7, 0.25, 1);\n\nexport function WordPush({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 10,\n accel = 0.8,\n speed = 1,\n className,\n}: WordPushProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n let lineX = interpolate(\n frame,\n [0, SLIDE_FRAMES],\n [-OVERSHOOT_EM * fontSize, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n },\n );\n for (let j = 1; j < words.length; j++) {\n const wordWidth =\n (words[j].length * CHAR_WIDTH_EM + SPACE_WIDTH_EM) * fontSize;\n const revealAt = revealFrame(j, wordGap, accel);\n const pushed = interpolate(\n frame,\n [revealAt + 1, revealAt + 1 + SLIDE_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: pushEasing,\n },\n );\n lineX += (wordWidth / 2) * (1 - pushed);\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${lineX}px 0`,\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, j) => {\n const revealAt = revealFrame(j, wordGap, accel);\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const driven =\n j === 0\n ? 1\n : interpolate(frame, [revealAt, revealAt + SLIDE_FRAMES], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n });\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight: j < words.length - 1 ? \"0.22em\" : undefined,\n opacity,\n translate: `${OVERSHOOT_EM * fontSize * (1 - driven)}px 0`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface WordPushProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n accel?: number;\n speed?: number;\n className?: string;\n}\n\nconst REVEAL_FRAMES = 2;\nconst SLIDE_FRAMES = 12;\nconst OVERSHOOT_EM = 0.5;\nconst CHAR_WIDTH_EM = 0.5;\nconst SPACE_WIDTH_EM = 0.22;\n\nfunction revealFrame(index: number, wordGap: number, accel: number): number {\n if (accel === 1) return index * wordGap;\n return (wordGap * (1 - accel ** index)) / (1 - accel);\n}\n\nexport function wordPushLength(\n text: string,\n wordGap = 10,\n accel = 0.8,\n): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n if (words.length === 0) return 0;\n return (\n Math.ceil(revealFrame(words.length - 1, wordGap, accel)) + SLIDE_FRAMES\n );\n}\n\nconst pushEasing = Easing.out(Easing.cubic);\nconst driveEasing = Easing.bezier(0.15, 0.7, 0.25, 1);\n\nexport function WordPush({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 10,\n accel = 0.8,\n speed = 1,\n className,\n}: WordPushProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n let lineX = interpolate(\n frame,\n [0, SLIDE_FRAMES],\n [-OVERSHOOT_EM * fontSize, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n },\n );\n for (let j = 1; j < words.length; j++) {\n const wordWidth =\n (words[j].length * CHAR_WIDTH_EM + SPACE_WIDTH_EM) * fontSize;\n const revealAt = revealFrame(j, wordGap, accel);\n const pushed = interpolate(\n frame,\n [revealAt + 1, revealAt + 1 + SLIDE_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: pushEasing,\n },\n );\n lineX += (wordWidth / 2) * (1 - pushed);\n }\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${lineX}px 0`,\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, j) => {\n const revealAt = revealFrame(j, wordGap, accel);\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n\n const driven =\n j === 0\n ? 1\n : interpolate(\n frame,\n [revealAt, revealAt + SLIDE_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: driveEasing,\n },\n );\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight: j < words.length - 1 ? \"0.22em\" : undefined,\n opacity,\n translate: `${OVERSHOOT_EM * fontSize * (1 - driven)}px 0`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/word-push.tsx"
}
diff --git a/registry-artifacts/word-stream.json b/registry-artifacts/word-stream.json
index bd986e12..9718afa0 100644
--- a/registry-artifacts/word-stream.json
+++ b/registry-artifacts/word-stream.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/word-stream/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface WordStreamProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n hold?: number;\n drift?: number;\n speed?: number;\n className?: string;\n}\n\ninterface PhraseSchedule {\n words: string[];\n start: number;\n exitStart: number;\n last: boolean;\n}\n\nconst REVEAL_FRAMES = 3;\nconst ENTRY_FRAMES = 8;\nconst RUN_OUT_FRAMES = 5;\nconst SWAP_OVERLAP = 0;\n\nexport function wordStreamLength(\n text: string,\n wordGap = 6,\n hold = 18,\n): number {\n const schedule = schedulePhrases(text, wordGap, hold);\n const finalPhrase = schedule[schedule.length - 1];\n if (!finalPhrase) return 0;\n return (\n finalPhrase.start +\n (finalPhrase.words.length - 1) * wordGap +\n REVEAL_FRAMES\n );\n}\n\nfunction schedulePhrases(\n text: string,\n wordGap: number,\n hold: number,\n): PhraseSchedule[] {\n const phrases = text\n .split(\"|\")\n .map((phrase) => phrase.trim())\n .filter(Boolean);\n let cursor = 0;\n return phrases.map((phrase, i) => {\n const words = phrase.split(/\\s+/);\n const start = cursor;\n const complete = start + (words.length - 1) * wordGap + REVEAL_FRAMES;\n const exitStart = complete + hold;\n cursor = exitStart + SWAP_OVERLAP;\n return { words, start, exitStart, last: i === phrases.length - 1 };\n });\n}\n\nconst revealEasing = Easing.bezier(0.2, 0.8, 0.2, 1);\nconst entryEasing = Easing.bezier(0.2, 0.8, 0.3, 1);\nconst runOutEasing = Easing.bezier(0.7, 0, 0.9, 0.4);\n\nexport function WordStream({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 6,\n hold = 18,\n drift = 2,\n speed = 1,\n className,\n}: WordStreamProps) {\n const frame = useCurrentFrame() * speed;\n\n const schedule = schedulePhrases(text, wordGap, hold);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n {schedule.map((phrase, i) => {\n if (frame < phrase.start) return null;\n if (!phrase.last && frame >= phrase.exitStart) return null;\n\n const scale = fontSize / 72;\n const crawl = scale * drift;\n const life = phrase.exitStart - phrase.start;\n\n const entryX = interpolate(\n frame,\n [phrase.start, phrase.start + ENTRY_FRAMES],\n [scale * 30, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: entryEasing,\n },\n );\n const crawlX =\n crawl * (life / 2 - (Math.min(frame, phrase.exitStart) - phrase.start));\n const runOutX = phrase.last\n ? 0\n : interpolate(\n frame,\n [phrase.exitStart - RUN_OUT_FRAMES, phrase.exitStart],\n [0, -scale * 80],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: runOutEasing,\n },\n );\n const x = entryX + crawlX + runOutX;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${x}px 0`,\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {phrase.words.map((word, j) => {\n const revealAt = phrase.start + j * wordGap;\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: revealEasing,\n },\n );\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight:\n j < phrase.words.length - 1 ? \"0.28em\" : undefined,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n })}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface WordStreamProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n hold?: number;\n drift?: number;\n speed?: number;\n className?: string;\n}\n\ninterface PhraseSchedule {\n words: string[];\n start: number;\n exitStart: number;\n last: boolean;\n}\n\nconst REVEAL_FRAMES = 3;\nconst ENTRY_FRAMES = 8;\nconst RUN_OUT_FRAMES = 5;\nconst SWAP_OVERLAP = 0;\n\nexport function wordStreamLength(text: string, wordGap = 6, hold = 18): number {\n const schedule = schedulePhrases(text, wordGap, hold);\n const finalPhrase = schedule[schedule.length - 1];\n if (!finalPhrase) return 0;\n return (\n finalPhrase.start + (finalPhrase.words.length - 1) * wordGap + REVEAL_FRAMES\n );\n}\n\nfunction schedulePhrases(\n text: string,\n wordGap: number,\n hold: number,\n): PhraseSchedule[] {\n const phrases = text\n .split(\"|\")\n .map((phrase) => phrase.trim())\n .filter(Boolean);\n let cursor = 0;\n return phrases.map((phrase, i) => {\n const words = phrase.split(/\\s+/);\n const start = cursor;\n const complete = start + (words.length - 1) * wordGap + REVEAL_FRAMES;\n const exitStart = complete + hold;\n cursor = exitStart + SWAP_OVERLAP;\n return { words, start, exitStart, last: i === phrases.length - 1 };\n });\n}\n\nconst revealEasing = Easing.bezier(0.2, 0.8, 0.2, 1);\nconst entryEasing = Easing.bezier(0.2, 0.8, 0.3, 1);\nconst runOutEasing = Easing.bezier(0.7, 0, 0.9, 0.4);\n\nexport function WordStream({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 400,\n wordGap = 6,\n hold = 18,\n drift = 2,\n speed = 1,\n className,\n}: WordStreamProps) {\n const frame = useCurrentFrame() * speed;\n\n const schedule = schedulePhrases(text, wordGap, hold);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n {schedule.map((phrase, i) => {\n if (frame < phrase.start) return null;\n if (!phrase.last && frame >= phrase.exitStart) return null;\n\n const scale = fontSize / 72;\n const crawl = scale * drift;\n const life = phrase.exitStart - phrase.start;\n\n const entryX = interpolate(\n frame,\n [phrase.start, phrase.start + ENTRY_FRAMES],\n [scale * 30, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: entryEasing,\n },\n );\n const crawlX =\n crawl *\n (life / 2 - (Math.min(frame, phrase.exitStart) - phrase.start));\n const runOutX = phrase.last\n ? 0\n : interpolate(\n frame,\n [phrase.exitStart - RUN_OUT_FRAMES, phrase.exitStart],\n [0, -scale * 80],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: runOutEasing,\n },\n );\n const x = entryX + crawlX + runOutX;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n whiteSpace: \"nowrap\",\n translate: `${x}px 0`,\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {phrase.words.map((word, j) => {\n const revealAt = phrase.start + j * wordGap;\n\n const opacity = interpolate(\n frame,\n [revealAt, revealAt + REVEAL_FRAMES],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: revealEasing,\n },\n );\n\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n marginRight:\n j < phrase.words.length - 1 ? \"0.28em\" : undefined,\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n })}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/word-stream.tsx"
}
diff --git a/registry-artifacts/zoom-words.json b/registry-artifacts/zoom-words.json
index 9e1595e1..63512d58 100644
--- a/registry-artifacts/zoom-words.json
+++ b/registry-artifacts/zoom-words.json
@@ -7,7 +7,7 @@
"files": [
{
"path": "registry/remocn/zoom-words/index.tsx",
- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ZoomWordsProps {\n text: string;\n fontSize?: number;\n zoom?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n anchor?: number;\n blur?: number;\n blurFrames?: number;\n speed?: number;\n className?: string;\n}\n\nconst CHAR_WIDTH_EM = 0.52;\nconst SPACE_WIDTH_EM = 0.3;\nconst WORD_BLUR_EM = 0.05;\nconst phraseEasing = Easing.bezier(0.5, 0, 0.7, 0.7);\nconst FADE_EARLY = 0.5;\nconst FADE_SLOTS = 2;\n\nfunction smoothstep(t: number): number {\n const x = Math.min(Math.max(t, 0), 1);\n return x * x * (3 - 2 * x);\n}\nconst WORD_SHIFT_X_EM = 0.16;\nconst WORD_SHIFT_Y_EM = 0.12;\n\nfunction wordWidthEm(word: string): number {\n return Array.from(word).length * CHAR_WIDTH_EM + SPACE_WIDTH_EM;\n}\n\nexport function zoomWordsLength(text: string, wordGap = 12): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n return words.length * wordGap;\n}\n\nexport function ZoomWords({\n text,\n fontSize = 64,\n zoom = 2.2,\n color = \"#cfc2ff\",\n fontWeight = 400,\n wordGap = 12,\n anchor = 0.5,\n blur = 0.04,\n blurFrames = 60,\n speed = 1,\n className,\n}: ZoomWordsProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n const phraseFrames = words.length * wordGap;\n const wordProgress =\n words.length *\n interpolate(frame, [0, phraseFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: phraseEasing,\n });\n\n const totalEm = words.reduce((sum, w) => sum + wordWidthEm(w), 0);\n const firstHalfEm = words.length > 0 ? wordWidthEm(words[0]) / 2 : 0;\n const lastHalfEm =\n words.length > 0 ? wordWidthEm(words[words.length - 1]) / 2 : 0;\n let revealedEm = 0;\n for (let i = 0; i < words.length; i++) {\n revealedEm +=\n wordWidthEm(words[i]) *\n smoothstep((wordProgress - i + FADE_EARLY) / FADE_SLOTS);\n }\n const travelMax = Math.max(totalEm - lastHalfEm - firstHalfEm, 0.001);\n const raw = Math.min(Math.max(revealedEm, 0), travelMax);\n const cameraEm = firstHalfEm + travelMax * smoothstep(raw / travelMax);\n const cameraPct = totalEm > 0 ? (cameraEm / totalEm) * 100 : 0;\n\n const blurNow =\n blur *\n fontSize *\n zoom *\n interpolate(frame, [0, blurFrames], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n scale: `${zoom}`,\n filter: blurNow > 0.05 ? `blur(${blurNow}px)` : undefined,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: `${anchor * 100}%`,\n transform: \"translateY(-50%)\",\n whiteSpace: \"pre\",\n }}\n >\n <span\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"baseline\",\n transform: `translateX(-${cameraPct.toFixed(3)}%)`,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, i) => {\n const p = smoothstep(\n (wordProgress - i + FADE_EARLY) / FADE_SLOTS,\n );\n const opacity = smoothstep(p * 1.2);\n const wordBlur = WORD_BLUR_EM * fontSize * (1 - p);\n const arrive = 1 - smoothstep(p * 1.6);\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n opacity,\n filter:\n wordBlur > 0.05 ? `blur(${wordBlur}px)` : undefined,\n translate: `${(WORD_SHIFT_X_EM * fontSize * arrive).toFixed(1)}px ${(WORD_SHIFT_Y_EM * fontSize * arrive).toFixed(1)}px`,\n }}\n >\n {word}\n {i < words.length - 1 && \" \"}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ZoomWordsProps {\n text: string;\n fontSize?: number;\n zoom?: number;\n color?: string;\n fontWeight?: number;\n wordGap?: number;\n anchor?: number;\n blur?: number;\n blurFrames?: number;\n speed?: number;\n className?: string;\n}\n\nconst CHAR_WIDTH_EM = 0.52;\nconst SPACE_WIDTH_EM = 0.3;\nconst WORD_BLUR_EM = 0.05;\nconst phraseEasing = Easing.bezier(0.5, 0, 0.7, 0.7);\nconst FADE_EARLY = 0.5;\nconst FADE_SLOTS = 2;\n\nfunction smoothstep(t: number): number {\n const x = Math.min(Math.max(t, 0), 1);\n return x * x * (3 - 2 * x);\n}\nconst WORD_SHIFT_X_EM = 0.16;\nconst WORD_SHIFT_Y_EM = 0.12;\n\nfunction wordWidthEm(word: string): number {\n return Array.from(word).length * CHAR_WIDTH_EM + SPACE_WIDTH_EM;\n}\n\nexport function zoomWordsLength(text: string, wordGap = 12): number {\n const words = text.trim().split(/\\s+/).filter(Boolean);\n return words.length * wordGap;\n}\n\nexport function ZoomWords({\n text,\n fontSize = 64,\n zoom = 2.2,\n color = \"#cfc2ff\",\n fontWeight = 400,\n wordGap = 12,\n anchor = 0.5,\n blur = 0.04,\n blurFrames = 60,\n speed = 1,\n className,\n}: ZoomWordsProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.trim().split(/\\s+/).filter(Boolean);\n\n const phraseFrames = words.length * wordGap;\n const wordProgress =\n words.length *\n interpolate(frame, [0, phraseFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: phraseEasing,\n });\n\n const totalEm = words.reduce((sum, w) => sum + wordWidthEm(w), 0);\n const firstHalfEm = words.length > 0 ? wordWidthEm(words[0]) / 2 : 0;\n const lastHalfEm =\n words.length > 0 ? wordWidthEm(words[words.length - 1]) / 2 : 0;\n let revealedEm = 0;\n for (let i = 0; i < words.length; i++) {\n revealedEm +=\n wordWidthEm(words[i]) *\n smoothstep((wordProgress - i + FADE_EARLY) / FADE_SLOTS);\n }\n const travelMax = Math.max(totalEm - lastHalfEm - firstHalfEm, 0.001);\n const raw = Math.min(Math.max(revealedEm, 0), travelMax);\n const cameraEm = firstHalfEm + travelMax * smoothstep(raw / travelMax);\n const cameraPct = totalEm > 0 ? (cameraEm / totalEm) * 100 : 0;\n\n const blurNow =\n blur *\n fontSize *\n zoom *\n interpolate(frame, [0, blurFrames], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n scale: `${zoom}`,\n filter: blurNow > 0.05 ? `blur(${blurNow}px)` : undefined,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n top: \"50%\",\n left: `${anchor * 100}%`,\n transform: \"translateY(-50%)\",\n whiteSpace: \"pre\",\n }}\n >\n <span\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"baseline\",\n transform: `translateX(-${cameraPct.toFixed(3)}%)`,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.02em\",\n lineHeight: 1.15,\n whiteSpace: \"pre\",\n fontFamily:\n \"var(--font-geist-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)\",\n }}\n >\n {words.map((word, i) => {\n const p = smoothstep(\n (wordProgress - i + FADE_EARLY) / FADE_SLOTS,\n );\n const opacity = smoothstep(p * 1.2);\n const wordBlur = WORD_BLUR_EM * fontSize * (1 - p);\n const arrive = 1 - smoothstep(p * 1.6);\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n opacity,\n filter: wordBlur > 0.05 ? `blur(${wordBlur}px)` : undefined,\n translate: `${(WORD_SHIFT_X_EM * fontSize * arrive).toFixed(1)}px ${(WORD_SHIFT_Y_EM * fontSize * arrive).toFixed(1)}px`,\n }}\n >\n {word}\n {i < words.length - 1 && \" \"}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/zoom-words.tsx"
}