{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "kinetic-type-mask", "title": "Kinetic Type Mask", "description": "Use giant typography as a window into the next scene.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/kinetic-type-mask/index.tsx", "content": "\"use client\";\n\nimport { type ReactNode, useId } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface KineticTypeMaskProps {\n from?: ReactNode;\n to?: ReactNode;\n text?: string;\n transitionStart?: number;\n holdFrames?: number;\n transitionDuration?: number;\n maxScale?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultPanel({ label, color }: { label: string; color: string }) {\n return (\n \n {label}\n \n );\n}\n\nexport function KineticTypeMask({\n from,\n to,\n text = \"NEXT\",\n transitionStart,\n holdFrames = 12,\n transitionDuration = 24,\n maxScale = 120,\n speed = 1,\n className,\n}: KineticTypeMaskProps) {\n const frame = useCurrentFrame() * speed;\n const { width, height, durationInFrames } = useVideoConfig();\n\n const start = transitionStart ?? Math.floor(durationInFrames * 0.3);\n const scaleStart = start + holdFrames;\n\n const scale = interpolate(\n frame,\n [scaleStart, scaleStart + transitionDuration],\n [1, maxScale],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.7, 0, 0.84, 0),\n },\n );\n\n const id = useId().replace(/[:#]/g, \"\");\n\n const fromContent = from ?? ;\n const toContent = to ?? ;\n\n return (\n \n
{fromContent}
\n\n {scale < maxScale * 0.95 && (\n \n {text}\n \n )}\n\n \n
{toContent}
\n \n\n \n \n \n \n {text}\n \n \n \n \n \n );\n}\n", "type": "registry:component", "target": "components/remocn/kinetic-type-mask.tsx" } ], "type": "registry:component" }