{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "directional-wipe", "title": "Directional Wipe", "description": "Slide one scene in while pushing the other out.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/directional-wipe/index.tsx", "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface DirectionalWipeProps {\n from?: ReactNode;\n to?: ReactNode;\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n transitionStart?: number;\n transitionDuration?: 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 DirectionalWipe({\n from,\n to,\n direction = \"left\",\n transitionStart,\n transitionDuration = 20,\n speed = 1,\n className,\n}: DirectionalWipeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const start =\n typeof transitionStart === \"number\"\n ? transitionStart\n : Math.floor(durationInFrames * 0.4);\n\n const progress = interpolate(\n frame,\n [start, start + transitionDuration],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.65, 0, 0.35, 1),\n },\n );\n\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign = direction === \"left\" || direction === \"up\" ? -1 : 1;\n\n const fromOffset = progress * 100 * sign;\n const toOffset = (1 - progress) * 100 * -sign;\n\n const transformFor = (offset: number) =>\n axis === \"x\" ? `translateX(${offset}%)` : `translateY(${offset}%)`;\n\n const fromContent = from ?? ;\n const toContent = to ?? ;\n\n return (\n \n \n {fromContent}\n \n \n {toContent}\n \n \n );\n}\n", "type": "registry:component", "target": "components/remocn/directional-wipe.tsx" } ], "type": "registry:component" }