Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
{
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
"name": "shared-axis-y",
"title": "Shared Axis Y",
"description": "Per-word hard-cut transition with staircase timing for sharp editorial swaps.",
"dependencies": ["remotion"],
"files": [
{
"path": "registry/remocn/shared-axis-y/index.tsx",
"content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SharedAxisYProps {\n fromText: string;\n toText: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SharedAxisY({\n fromText,\n toText,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SharedAxisYProps) {\n const frame = useCurrentFrame() * speed;\n\n const fromWords = fromText.split(\" \");\n const toWords = toText.split(\" \");\n\n const enterDur = 5;\n const exitDur = 4;\n const enterStagger = 2;\n const exitStagger = 2;\n const overlapF = 0;\n const microDelayF = 1;\n\n const exitTotal = exitDur + (fromWords.length - 1) * exitStagger;\n const newStart = Math.max(0, exitTotal - overlapF + microDelayF);\n\n const fontStack =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {fromWords.map((word, i) => {\n const local = frame - i * exitStagger;\n const opacity = interpolate(local, [0, exitDur], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily: fontStack,\n }}\n >\n {toWords.map((word, j) => {\n const local = frame - newStart - j * enterStagger;\n const opacity = interpolate(local, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.step1,\n });\n return (\n <span\n key={j}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/shared-axis-y.tsx"
}
],
"type": "registry:component"
}