{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "marquee",
  "type": "registry:component",
  "title": "Marquee",
  "description": "Infinite horizontal scroller for logos, text or cards. Seamless loop with soft edge fade.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "motion",
    "marquee",
    "ticker",
    "logos",
    "loop",
    "scroll"
  ],
  "docs": "https://hyperblur.dev/effects/marquee",
  "files": [
    {
      "path": "registry/hyperblur/marquee.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/marquee.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface MarqueeProps extends React.HTMLAttributes<HTMLDivElement> {\n  children: React.ReactNode;\n  speed?: number;\n  direction?: \"left\" | \"right\";\n  pauseOnHover?: boolean;\n  gap?: number;\n  fade?: boolean;\n}\n\nconst css = `\n@keyframes hb-mq-run {\n  from { transform: translate3d(0, 0, 0); }\n  to { transform: translate3d(-50%, 0, 0); }\n}\n.hb-mq { position: relative; display: flex; overflow: hidden; width: 100%; }\n.hb-mq[data-fade=\"true\"] {\n  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);\n  mask-image: linear-gradient(to right, transparent 0, #000 10%, #000 90%, transparent 100%);\n}\n.hb-mq-track {\n  display: flex;\n  flex: 0 0 auto;\n  width: max-content;\n  will-change: transform;\n  animation: hb-mq-run var(--hb-dur) linear infinite;\n  animation-direction: var(--hb-dir);\n}\n.hb-mq-group {\n  display: flex;\n  flex: 0 0 auto;\n  align-items: center;\n  box-sizing: border-box;\n  min-width: 100%;\n  gap: var(--hb-gap);\n  padding-right: var(--hb-gap);\n}\n.hb-mq[data-pause=\"true\"]:hover .hb-mq-track { animation-play-state: paused; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-mq { overflow-x: auto; }\n  .hb-mq-track { animation: none; will-change: auto; }\n  .hb-mq-group[aria-hidden=\"true\"] { display: none; }\n}\n`;\n\nexport function Marquee({\n  children,\n  speed = 1,\n  direction = \"left\",\n  pauseOnHover = true,\n  gap = 32,\n  fade = true,\n  className = \"\",\n  style,\n  ...rest\n}: MarqueeProps) {\n  const groupRef = React.useRef<HTMLDivElement>(null);\n  const [width, setWidth] = React.useState(0);\n\n  React.useEffect(() => {\n    const el = groupRef.current;\n    if (!el) return;\n    const measure = () => setWidth(el.offsetWidth);\n    measure();\n    if (typeof ResizeObserver === \"undefined\") return;\n    const ro = new ResizeObserver(measure);\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, [children, gap]);\n\n  const pxPerSecond = 60 * Math.max(speed, 0.01);\n  const dur = width > 0 ? +(width / pxPerSecond).toFixed(3) : +(30 / Math.max(speed, 0.01)).toFixed(3);\n\n  const vars = {\n    \"--hb-dur\": `${dur}s`,\n    \"--hb-dir\": direction === \"right\" ? \"reverse\" : \"normal\",\n    \"--hb-gap\": `${Math.max(0, gap)}px`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <div\n      className={`hb-mq ${className}`}\n      style={vars}\n      data-fade={fade}\n      data-pause={pauseOnHover}\n      {...rest}\n    >\n      <style href=\"hb-marquee\" precedence=\"default\">{css}</style>\n      <div className=\"hb-mq-track\">\n        <div className=\"hb-mq-group\" ref={groupRef}>\n          {children}\n        </div>\n        <div className=\"hb-mq-group\" aria-hidden=\"true\">\n          {children}\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}