{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "chromatic-aberration-wipe", "title": "Chromatic Aberration Wipe", "description": "An ultra-fast slide transition with an RGB glitch on the peak frames.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/chromatic-aberration-wipe/index.tsx", "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChromaticAberrationWipeProps {\n from?: ReactNode;\n to?: ReactNode;\n direction?: \"left\" | \"right\";\n transitionStart?: number;\n transitionDuration?: number;\n aberrationOffset?: 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 ChromaticAberrationWipe({\n from,\n to,\n direction = \"left\",\n transitionStart,\n transitionDuration = 7,\n aberrationOffset = 8,\n speed = 1,\n className,\n}: ChromaticAberrationWipeProps) {\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 sign = direction === \"left\" ? -1 : 1;\n\n const fromOffset = progress * 100 * sign;\n const toOffset = (1 - progress) * 100 * -sign;\n\n const transformX = (offset: number) => `translateX(${offset}%)`;\n\n const peakStart = start + Math.max(1, Math.floor(transitionDuration * 0.25));\n const peakEnd = start + Math.max(peakStart + 1, Math.ceil(transitionDuration * 0.75));\n const inPeak = frame >= peakStart && frame <= peakEnd;\n const filter = inPeak\n ? `drop-shadow(-${aberrationOffset}px 0 0 rgba(255,0,0,0.8)) drop-shadow(${aberrationOffset}px 0 0 rgba(0,255,255,0.8))`\n : \"none\";\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/chromatic-aberration-wipe.tsx" } ], "type": "registry:component" }