{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "glow-card",
  "title": "Glow Card",
  "description": "A card with an animated rotating conic-gradient glow border, customizable colors, text position, and an optional background image.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/glow-card/glow-card.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type GlowCardTextPosition = \"top-left\" | \"top-center\" | \"top-right\" | \"center-left\" | \"center\" | \"center-right\" | \"bottom-left\" | \"bottom-center\" | \"bottom-right\";\n\nexport interface GlowCardProps {\n  text?: string;\n  fontSize?: number;\n  textColor?: string;\n  textPosition?: GlowCardTextPosition;\n  backgroundImage?: string;\n  backgroundColor?: string;\n  overlayOpacity?: number;\n  colors?: string[];\n  radius?: number;\n  padding?: number;\n  glowWidth?: number;\n  glowBlur?: number;\n  duration?: number;\n  className?: string;\n}\n\nconst DEFAULT_COLORS = [\"#FF375F\", \"#FF8A00\", \"#FFD60A\", \"#34C759\", \"#64D2FF\", \"#0A84FF\", \"#BF5AF2\"];\n\nexport function GlowCard({\n  text = \"I'm a card with an inner glow\",\n  fontSize = 28,\n  textColor = \"#F5F5F7\",\n  textPosition = \"center\",\n  backgroundImage,\n  backgroundColor = \"#1C1C1E\",\n  overlayOpacity = 0.55,\n  colors = DEFAULT_COLORS,\n  radius = 24,\n  padding = 32,\n  glowWidth = 28,\n  glowBlur = 20,\n  duration = 6,\n  className,\n}: GlowCardProps) {\n  const uid = React.useId().replace(/[:]/g, \"\");\n  const rootRef = React.useRef<HTMLDivElement>(null);\n  const [isVisible, setIsVisible] = React.useState(true);\n\n  React.useEffect(() => {\n    const el = rootRef.current;\n    if (!el) return;\n    const observer = new IntersectionObserver(([entry]) => setIsVisible(entry.isIntersecting), { threshold: 0 });\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, []);\n\n  const [vertical, horizontal] = textPosition === \"center\" ? [\"center\", \"center\"] : textPosition.split(\"-\");\n  const alignItems = vertical === \"top\" ? \"flex-start\" : vertical === \"bottom\" ? \"flex-end\" : \"center\";\n  const justifyContent = horizontal === \"left\" ? \"flex-start\" : horizontal === \"right\" ? \"flex-end\" : \"center\";\n  const textAlign = horizontal === \"left\" ? \"left\" : horizontal === \"right\" ? \"right\" : \"center\";\n\n  const stops = colors.length > 0 ? colors : DEFAULT_COLORS;\n  const gradientStops = [...stops, stops[0]].join(\", \");\n  const className_ = `glow-card-${uid}`;\n\n  return (\n    <div\n      ref={rootRef}\n      className={cn(\"relative isolate flex h-full w-full overflow-hidden\", className_, className)}\n      style={{ alignItems, justifyContent, borderRadius: radius, clipPath: `inset(0 round ${radius}px)`, padding, backgroundColor }}\n    >\n      {backgroundImage && (\n        <>\n          <img src={backgroundImage} alt=\"\" className=\"absolute inset-0 h-full w-full object-cover\" style={{ zIndex: 0 }} />\n          <div className=\"pointer-events-none absolute inset-0\" style={{ zIndex: 1, backgroundColor, opacity: overlayOpacity, mixBlendMode: \"multiply\" }} />\n        </>\n      )}\n      <div aria-hidden className={`${className_}-glow`} />\n      <p\n        className=\"relative m-0\"\n        style={{ zIndex: 3, textAlign, color: textColor, fontSize, fontWeight: 600, lineHeight: \"1.25em\", letterSpacing: \"-0.01em\", textWrap: \"balance\" }}\n      >\n        {text}\n      </p>\n      <style>{`\n        @property --glow-angle-${uid} {\n          syntax: '<angle>';\n          initial-value: 0deg;\n          inherits: false;\n        }\n        @keyframes glow-spin-${uid} {\n          to { --glow-angle-${uid}: 1turn; }\n        }\n        .${className_}-glow {\n          position: absolute;\n          inset: 0;\n          z-index: 2;\n          pointer-events: none;\n          filter: blur(${glowBlur}px);\n        }\n        /* A ring that follows the card's corner radius, so the glow stays inside the shape. */\n        .${className_}-glow::before {\n          content: '';\n          position: absolute;\n          inset: -${glowWidth * 0.8}px;\n          padding: ${glowWidth}px;\n          border-radius: ${radius + glowWidth * 0.8}px;\n          background: conic-gradient(from var(--glow-angle-${uid}), ${gradientStops});\n          -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n          -webkit-mask-composite: xor;\n          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n          mask-composite: exclude;\n          animation: glow-spin-${uid} ${duration}s linear infinite;\n          animation-play-state: ${isVisible ? \"running\" : \"paused\"};\n        }\n      `}</style>\n    </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}