{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "slot-machine-roll", "title": "Slot Machine Roll", "description": "Vertical reel scrolls characters from one value to another.", "dependencies": [ "remotion" ], "files": [ { "path": "registry/remocn/slot-machine-roll/index.tsx", "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SlotMachineRollProps {\n from?: string;\n to?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SlotMachineRoll({\n from = \"$99\",\n to = \"$199\",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: SlotMachineRollProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const len = Math.max(from.length, to.length);\n const paddedFrom = from.padStart(len, \" \");\n const paddedTo = to.padStart(len, \" \");\n\n const columns = [];\n for (let i = 0; i < len; i++) {\n const raw = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 14 },\n });\n const t = Math.max(0, Math.min(1, raw));\n columns.push(\n \n \n {paddedFrom[i]}\n {paddedTo[i]}\n \n ,\n );\n }\n\n return (\n \n \n {columns}\n \n \n );\n}\n", "type": "registry:component", "target": "components/remocn/slot-machine-roll.tsx" } ], "type": "registry:component" }