{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "grain-leak",
  "title": "Grain Leak",
  "type": "registry:component",
  "description": "Film grain with a slow light leak",
  "dependencies": [
    "motion@^12.43.0"
  ],
  "files": [
    {
      "path": "src/kavyn/grain-leak.jsx",
      "type": "registry:file",
      "target": "@components/kavyn/grain-leak.jsx",
      "content": "'use client'\n\nimport { useEffect, useRef } from 'react'\nimport { motion } from 'motion/react'\n\n/** @param {{ children?: any }} props */\nexport default function GrainLeak({ children = undefined }) {\n  const ref = useRef(null)\n  useEffect(() => {\n    const c = ref.current, ctx = c.getContext('2d')\n    c.width = 160; c.height = 160\n    let raf, f = 0\n    const draw = () => {\n      if (f++ % 3 === 0) {\n        const img = ctx.createImageData(160, 160)\n        for (let i = 0; i < img.data.length; i += 4) { const v = Math.random() * 255; img.data[i] = img.data[i + 1] = img.data[i + 2] = v; img.data[i + 3] = 22 }\n        ctx.putImageData(img, 0, 0)\n      }\n      raf = requestAnimationFrame(draw)\n    }\n    raf = requestAnimationFrame(draw)\n    return () => cancelAnimationFrame(raf)\n  }, [])\n  return (\n    <div className=\"relative size-full min-h-64 overflow-hidden bg-[#0c0b0b]\">\n      <motion.div className=\"absolute -left-1/4 -top-1/3 h-[120%] w-[80%] rounded-full bg-[radial-gradient(closest-side,rgba(232,170,110,.42),rgba(168,100,74,.16),transparent)] blur-2xl\"\n        animate={{ x: ['0%', '40%', '10%', '0%'], y: ['0%', '15%', '30%', '0%'], opacity: [0.5, 0.9, 0.6, 0.5] }} transition={{ repeat: Infinity, duration: 16, ease: 'easeInOut' }} />\n      <motion.div className=\"absolute -bottom-1/3 -right-1/4 h-[90%] w-[60%] rounded-full bg-[radial-gradient(closest-side,rgba(240,215,170,.22),transparent)] blur-2xl\"\n        animate={{ x: ['0%', '-30%', '0%'], opacity: [0.3, 0.7, 0.3] }} transition={{ repeat: Infinity, duration: 12, ease: 'easeInOut' }} />\n      <canvas ref={ref} className=\"absolute inset-0 size-full [image-rendering:pixelated] mix-blend-overlay\" style={{ opacity: 0.9 }} />\n      <div className=\"relative grid size-full min-h-64 place-items-center\">{children}</div>\n    </div>\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"
    }
  }
}
