{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text-scramble",
  "title": "Text Scramble",
  "type": "registry:component",
  "description": "Letters decode from noise, left to right, again on hover",
  "dependencies": [],
  "files": [
    {
      "path": "src/kavyn/text-scramble.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/text-scramble.jsx",
      "content": "'use client'\n\nimport { useEffect, useRef, useState } from 'react'\n\nconst GLYPHS = '!<>-_\\\\/[]{}=+*^?#01'\n\n// Letters decode from noise, left to right. Replays on hover.\nexport default function TextScramble({ text = 'Deploy to the edge', duration = 900, className = '' }) {\n  const [out, setOut] = useState(text)\n  const raf = useRef(0)\n  const run = () => {\n    cancelAnimationFrame(raf.current)\n    const start = performance.now()\n    const tick = (now) => {\n      const p = Math.min(1, (now - start) / Math.max(1, duration))\n      const lock = Math.floor(p * text.length)\n      setOut(text.split('').map((ch, i) => (ch === ' ' || i < lock ? ch : GLYPHS[(Math.random() * GLYPHS.length) | 0])).join(''))\n      if (p < 1) raf.current = requestAnimationFrame(tick)\n    }\n    raf.current = requestAnimationFrame(tick)\n  }\n  useEffect(() => { run(); return () => cancelAnimationFrame(raf.current) }, [text, duration]) // eslint-disable-line react-hooks/exhaustive-deps\n  return (\n    <span onMouseEnter={run} onFocus={run} tabIndex={0} aria-label={text}\n      className={`cursor-default whitespace-nowrap font-mono text-2xl tracking-tight text-tx outline-none sm:text-3xl ${className}`}>\n      <span aria-hidden>{out}</span>\n    </span>\n  )\n}\n"
    }
  ],
  "cssVars": {
    "theme": {
      "color-bg": "var(--bg)",
      "color-panel": "var(--panel)",
      "color-panel2": "var(--panel2)",
      "color-line": "var(--line)",
      "color-line2": "var(--line2)",
      "color-tx": "var(--tx)",
      "color-mute": "var(--mute)",
      "color-faint": "var(--faint)",
      "color-acc": "var(--acc)",
      "color-acc-fg": "var(--acc-fg)"
    },
    "light": {
      "bg": "#ffffff",
      "panel": "#f5f5f7",
      "panel2": "#e8e8ed",
      "line": "#e5e5ea",
      "line2": "#d2d2d7",
      "tx": "#1d1d1f",
      "mute": "#6e6e73",
      "faint": "#a1a1a6",
      "acc": "#1d1d1f",
      "acc-fg": "#ffffff"
    },
    "dark": {
      "bg": "#000000",
      "panel": "#141416",
      "panel2": "#1f1f22",
      "line": "#262628",
      "line2": "#3a3a3d",
      "tx": "#f5f5f7",
      "mute": "#a1a1a6",
      "faint": "#6e6e73",
      "acc": "#f5f5f7",
      "acc-fg": "#000000"
    }
  },
  "css": {
    ".light": {
      "--bg": "#ffffff",
      "--panel": "#f5f5f7",
      "--panel2": "#e8e8ed",
      "--line": "#e5e5ea",
      "--line2": "#d2d2d7",
      "--tx": "#1d1d1f",
      "--mute": "#6e6e73",
      "--faint": "#a1a1a6",
      "--acc": "#1d1d1f",
      "--acc-fg": "#ffffff"
    }
  }
}
