{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "marquee",
  "title": "Marquee",
  "description": "An endless horizontal or vertical marquee with faded edges that pauses on hover, shown with customer logos, testimonials and a live bookings ticker.",
  "dependencies": [],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/components/backgrounds/marquee.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\n// Each copy moves by its own length plus the gap, so N identical copies loop seamlessly.\nconst CSS = `\n@keyframes pc-marquee-x { from { transform: translateX(0) } to { transform: translateX(calc(-100% - var(--pc-mq-gap))) } }\n@keyframes pc-marquee-y { from { transform: translateY(0) } to { transform: translateY(calc(-100% - var(--pc-mq-gap))) } }\n@keyframes pc-marquee-x-rtl { from { transform: translateX(0) } to { transform: translateX(calc(100% + var(--pc-mq-gap))) } }\n.pc-marquee { display: flex; overflow: hidden; gap: var(--pc-mq-gap) }\n.pc-marquee[data-vertical] { flex-direction: column }\n.pc-marquee-track {\n  display: flex; flex-shrink: 0; align-items: var(--pc-mq-align, center); justify-content: space-around; gap: var(--pc-mq-gap);\n  animation: pc-marquee-x var(--pc-mq-duration, 40s) linear infinite;\n}\n.pc-marquee[data-vertical] .pc-marquee-track { flex-direction: column; align-items: var(--pc-mq-align, stretch); animation-name: pc-marquee-y }\n/* Right-to-left: copies are laid out from the right, so they travel right (toward the inline start) to loop. */\n:where([dir=rtl]) .pc-marquee:not([data-vertical]) .pc-marquee-track { animation-name: pc-marquee-x-rtl }\n.pc-marquee[dir=rtl]:not([data-vertical]) .pc-marquee-track { animation-name: pc-marquee-x-rtl }\n:where([dir=rtl]) .pc-marquee[dir=ltr]:not([data-vertical]) .pc-marquee-track { animation-name: pc-marquee-x }\n.pc-marquee[data-reverse] .pc-marquee-track { animation-direction: reverse }\n.pc-marquee[data-pause-on-hover]:is(:hover, :focus-within) .pc-marquee-track,\n.pc-marquee[data-paused] .pc-marquee-track { animation-play-state: paused }\n.pc-marquee[data-fade] {\n  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--pc-mq-fade), #000 calc(100% - var(--pc-mq-fade)), transparent);\n  mask-image: linear-gradient(to right, transparent, #000 var(--pc-mq-fade), #000 calc(100% - var(--pc-mq-fade)), transparent);\n}\n.pc-marquee[data-fade][data-vertical] {\n  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 var(--pc-mq-fade), #000 calc(100% - var(--pc-mq-fade)), transparent);\n  mask-image: linear-gradient(to bottom, transparent, #000 var(--pc-mq-fade), #000 calc(100% - var(--pc-mq-fade)), transparent);\n}\n@media (prefers-reduced-motion: reduce) {\n  .pc-marquee-track { animation: none }\n  .pc-marquee-track[data-copy] { display: none }\n  .pc-marquee:not([data-vertical]) { overflow-x: auto; scrollbar-width: thin }\n  .pc-marquee[data-vertical] { overflow-y: auto; scrollbar-width: thin }\n}\n`\n\nexport type MarqueeProps = React.HTMLAttributes<HTMLDivElement> & {\n  /** Scroll toward the inline start (right-to-left in LTR, left-to-right under dir=\"rtl\") or bottom-to-top when false; the other way when true. */\n  reverse?: boolean\n  /** Pause while the pointer is over it or focus is inside it. */\n  pauseOnHover?: boolean\n  /** Scroll vertically instead of horizontally; give the marquee a height. */\n  vertical?: boolean\n  /** Seconds for one copy to pass. */\n  duration?: number\n  /** Space between items and between copies (any CSS length). */\n  gap?: string\n  /** How many copies to render; raise it if the content is shorter than the container. */\n  repeat?: number\n  /** Fade the edges with a mask. */\n  fade?: boolean\n  /** Length of each faded edge (any CSS length). */\n  fadeSize?: string\n  /** Cross-axis alignment of the items. Defaults to center (horizontal) or stretch (vertical). */\n  align?: \"start\" | \"center\" | \"end\" | \"stretch\"\n}\n\n/**\n * An endless CSS marquee, horizontal or vertical, with faded edges. Pauses on hover and focus, off-screen and in\n * hidden tabs. Reduced motion turns it into a plain scrollable row without duplicates.\n */\nexport function Marquee({\n  reverse = false,\n  pauseOnHover = true,\n  vertical = false,\n  duration = 40,\n  gap = \"1rem\",\n  repeat = 3,\n  fade = true,\n  fadeSize = \"12%\",\n  align,\n  className,\n  style,\n  children,\n  ...props\n}: MarqueeProps) {\n  const ref = React.useRef<HTMLDivElement>(null)\n  const [paused, setPaused] = React.useState(false)\n\n  React.useEffect(() => {\n    const el = ref.current\n    if (!el) return\n    let inView = true\n    const update = () => setPaused(!inView || document.hidden)\n    const io = new IntersectionObserver(([e]) => {\n      if (!e) return\n      inView = e.isIntersecting\n      update()\n    })\n    io.observe(el)\n    document.addEventListener(\"visibilitychange\", update)\n    return () => {\n      io.disconnect()\n      document.removeEventListener(\"visibilitychange\", update)\n    }\n  }, [])\n\n  return (\n    <div\n      ref={ref}\n      data-vertical={vertical ? \"\" : undefined}\n      data-reverse={reverse ? \"\" : undefined}\n      data-pause-on-hover={pauseOnHover ? \"\" : undefined}\n      data-paused={paused ? \"\" : undefined}\n      data-fade={fade ? \"\" : undefined}\n      className={cn(\"pc-marquee\", className)}\n      style={{ ...style, [\"--pc-mq-gap\" as string]: gap, [\"--pc-mq-duration\" as string]: `${duration}s`, [\"--pc-mq-fade\" as string]: fadeSize, ...(align ? { [\"--pc-mq-align\" as string]: align } : {}) }}\n      {...props}\n    >\n      <style href=\"pc-marquee\" precedence=\"default\">\n        {CSS}\n      </style>\n      {Array.from({ length: Math.max(2, repeat) }, (_, i) => (\n        <div key={i} className=\"pc-marquee-track\" data-copy={i > 0 ? \"\" : undefined} aria-hidden={i > 0 ? true : undefined} inert={i > 0 ? true : undefined}>\n          {children}\n        </div>\n      ))}\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/marquee.tsx"
    }
  ],
  "categories": [
    "components",
    "backgrounds"
  ],
  "type": "registry:component"
}