{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"signal-glitch","type":"registry:ui","title":"Signal Glitch","description":"RGB-split slices jitter across the text like a broken signal.","dependencies":[],"registryDependencies":[],"files":[{"path":"registry/ui/signal-glitch.tsx","type":"registry:ui","content":"\"use client\";\n\nimport type { CSSProperties } from \"react\";\n\nconst css = `\n.signal-glitch{position:relative;display:inline-block}\n.signal-glitch::before,.signal-glitch::after{content:attr(data-text);position:absolute;inset:0;pointer-events:none}\n.signal-glitch::before{transform:translateX(3px);text-shadow:-2px 0 #ff2bd6;animation:glitch-a var(--glitch-speed) infinite linear alternate-reverse}\n.signal-glitch::after{transform:translateX(-3px);text-shadow:2px 0 #2bf0ff;animation:glitch-b calc(var(--glitch-speed) * 1.4) infinite linear alternate-reverse}\n.signal-glitch[data-hover-only]:not(:hover)::before,.signal-glitch[data-hover-only]:not(:hover)::after{content:none}\n@keyframes glitch-a{0%{clip-path:inset(20% 0 55% 0)}20%{clip-path:inset(62% 0 8% 0)}40%{clip-path:inset(40% 0 33% 0)}60%{clip-path:inset(82% 0 4% 0)}80%{clip-path:inset(8% 0 72% 0)}100%{clip-path:inset(30% 0 44% 0)}}\n@keyframes glitch-b{0%{clip-path:inset(70% 0 6% 0)}25%{clip-path:inset(12% 0 64% 0)}50%{clip-path:inset(48% 0 22% 0)}75%{clip-path:inset(4% 0 86% 0)}100%{clip-path:inset(56% 0 18% 0)}}\n`;\n\nexport interface SignalGlitchProps {\n  text: string;\n  /** Seconds per glitch loop; lower is more frantic. */\n  speed?: number;\n  /** Only glitch while hovered. */\n  hoverOnly?: boolean;\n  className?: string;\n}\n\nexport function SignalGlitch({ text, speed = 0.6, hoverOnly = false, className }: SignalGlitchProps) {\n  return (\n    <>\n      <style href=\"signal-glitch\" precedence=\"default\">\n        {css}\n      </style>\n      <span\n        className={`signal-glitch ${className ?? \"\"}`}\n        data-text={text}\n        data-hover-only={hoverOnly || undefined}\n        style={{ \"--glitch-speed\": `${speed}s` } as CSSProperties}\n      >\n        {text}\n      </span>\n    </>\n  );\n}\n"}]}