{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "matrix-decode", "title": "Matrix Decode", "description": "Random scramble resolves left-to-right into the target text.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/matrix-decode/index.tsx", "content": "\"use client\";\n\nimport { random, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MatrixDecodeProps {\n text: string;\n charset?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n revealDuration?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MatrixDecode({\n text,\n charset = \"!@#$%^&*()_+-=<>?/\\\\|\",\n fontSize = 72,\n color = \"#22c55e\",\n fontWeight = 600,\n revealDuration = 60,\n speed = 1,\n className,\n}: MatrixDecodeProps) {\n const frame = useCurrentFrame() * speed;\n // useVideoConfig kept for consistency with sibling primitives\n useVideoConfig();\n\n let output = \"\";\n for (let i = 0; i < text.length; i++) {\n const revealFrame = (i / Math.max(text.length, 1)) * revealDuration;\n if (text[i] === \" \") {\n output += \" \";\n } else if (frame >= revealFrame) {\n output += text[i];\n } else {\n const r = random(`${i}-${Math.floor(frame / 2)}`);\n const ch = charset[Math.floor(r * charset.length)];\n output += ch;\n }\n }\n\n return (\n