{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "eternal-glow-card",
  "title": "Eternal Glow Card",
  "description": "A hover-reveal product card with a blurred gradient overlay, staggered title/price/description reveal, a badge, and 5 color themes.",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/eternal-glow-card/eternal-glow-card.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/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 EternalGlowCardTheme = \"dark\" | \"warm\" | \"navy\" | \"rose\" | \"custom\";\nexport type EternalGlowCardBadgePosition = \"top-left\" | \"top-right\" | \"bottom-left\" | \"bottom-right\";\n\nexport interface EternalGlowCardProps {\n  image?: string;\n  title?: string;\n  titleSize?: number;\n  description?: string;\n  showDescription?: boolean;\n  price?: string;\n  showPrice?: boolean;\n  buttonText?: string;\n  href?: string;\n  showBadge?: boolean;\n  badgeText?: string;\n  badgePosition?: EternalGlowCardBadgePosition;\n  theme?: EternalGlowCardTheme;\n  customOverlayColor?: string;\n  overlayOpacity?: number;\n  blurAmount?: number;\n  className?: string;\n}\n\nconst THEMES: Record<Exclude<EternalGlowCardTheme, \"custom\">, { gradient: string; badgeBg: string; badgeColor: string; btnBg: string; btnColor: string }> = {\n  dark: { gradient: \"linear-gradient(to bottom, rgba(0,0,0,0.10) 0%, rgba(0,0,0,0.58) 100%)\", badgeBg: \"rgba(255,255,255,0.18)\", badgeColor: \"#ffffff\", btnBg: \"#ffffff\", btnColor: \"#111111\" },\n  warm: { gradient: \"linear-gradient(to bottom, rgba(101,67,33,0.08) 0%, rgba(101,67,33,0.62) 100%)\", badgeBg: \"rgba(255,220,170,0.28)\", badgeColor: \"#fff5e6\", btnBg: \"#f5deb3\", btnColor: \"#5c3a1e\" },\n  navy: { gradient: \"linear-gradient(to bottom, rgba(15,30,60,0.08) 0%, rgba(15,30,60,0.65) 100%)\", badgeBg: \"rgba(100,150,255,0.22)\", badgeColor: \"#e0eaff\", btnBg: \"#dce8ff\", btnColor: \"#0f1e3c\" },\n  rose: { gradient: \"linear-gradient(to bottom, rgba(160,50,80,0.08) 0%, rgba(160,50,80,0.58) 100%)\", badgeBg: \"rgba(255,180,200,0.22)\", badgeColor: \"#fff0f4\", btnBg: \"#ffd6e0\", btnColor: \"#7a1530\" },\n};\n\nconst CUSTOM_THEME_UI = { badgeBg: \"rgba(255,255,255,0.18)\", badgeColor: \"#ffffff\", btnBg: \"#ffffff\", btnColor: \"#111111\" };\n\nconst BADGE_POS: Record<EternalGlowCardBadgePosition, React.CSSProperties> = {\n  \"top-left\": { top: 20, left: 20 },\n  \"top-right\": { top: 20, right: 20 },\n  \"bottom-left\": { bottom: 20, left: 20 },\n  \"bottom-right\": { bottom: 20, right: 20 },\n};\n\nfunction hexToRgb(hex: string) {\n  const h = (hex || \"#000000\").replace(\"#\", \"\");\n  return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];\n}\n\nfunction buildGradient(theme: EternalGlowCardTheme, customColor: string, opacity: number) {\n  if (theme === \"custom\") {\n    const [r, g, b] = hexToRgb(customColor);\n    const lo = opacity / 100;\n    return `linear-gradient(to bottom, rgba(${r},${g},${b},${lo * 0.25}) 0%, rgba(${r},${g},${b},${lo}) 100%)`;\n  }\n  return THEMES[theme].gradient.replace(/rgba\\((\\d+),(\\d+),(\\d+),([\\d.]+)\\) 100%/, (_m, r, g, b) => `rgba(${r},${g},${b},${opacity / 100}) 100%`);\n}\n\nconst stagger = (i: number) => ({\n  initial: { opacity: 0, y: 20 },\n  animate: { opacity: 1, y: 0 },\n  exit: { opacity: 0, y: 10 },\n  transition: { duration: 0.36, delay: 0.03 + i * 0.055, ease: [0.25, 0.46, 0.45, 0.94] as const },\n});\n\n// \"$48.00\" as a schema.org Offer; undefined when the currency symbol isn't one we recognise.\nfunction toOffer(price: string | undefined) {\n  const currency = ({ $: \"USD\", \"€\": \"EUR\", \"£\": \"GBP\", \"₺\": \"TRY\", \"¥\": \"JPY\" } as Record<string, string>)[price?.trim()[0] ?? \"\"];\n  const amount = parseFloat(price?.replace(/[^0-9.]/g, \"\") ?? \"\");\n  return currency && !Number.isNaN(amount) ? { \"@type\": \"Offer\", price: amount.toFixed(2), priceCurrency: currency } : undefined;\n}\n\nexport function EternalGlowCard({\n  image = \"https://images.unsplash.com/photo-1620916566398-39f1143ab7be?w=800\",\n  title = \"Eternal Glow\",\n  titleSize = 36,\n  description = \"Unveil your natural radiance with our vitamin-rich serums designed to hydrate and illuminate.\",\n  showDescription = true,\n  price = \"$48.00\",\n  showPrice = true,\n  buttonText = \"Shop the Glow\",\n  href,\n  showBadge = true,\n  badgeText = \"New\",\n  badgePosition = \"top-right\",\n  theme = \"dark\",\n  customOverlayColor = \"#000000\",\n  overlayOpacity = 55,\n  blurAmount = 12,\n  className,\n}: EternalGlowCardProps) {\n  const [hovered, setHovered] = React.useState(false);\n  const [tapped, setTapped] = React.useState(false);\n  const [isTouch, setIsTouch] = React.useState(false);\n\n  React.useEffect(() => {\n    setIsTouch(window.matchMedia(\"(hover: none) and (pointer: coarse)\").matches);\n  }, []);\n\n  const active = hovered || tapped;\n  const themeUi = theme === \"custom\" ? CUSTOM_THEME_UI : THEMES[theme];\n  const gradient = buildGradient(theme, customOverlayColor, overlayOpacity);\n\n  const handleCardClick = () => {\n    if (href && !isTouch) {\n      window.open(href, \"_blank\", \"noopener\");\n      return;\n    }\n    if (isTouch) setTapped((v) => !v);\n  };\n\n  // schema.org Product markup (JSON-LD) for search engines, skipped while the placeholder product shows.\n  const jsonLd = title === \"Eternal Glow\"\n    ? null\n    : JSON.stringify({\n        \"@context\": \"https://schema.org\",\n        \"@type\": \"Product\",\n        name: title,\n        ...(description ? { description } : {}),\n        ...(image ? { image } : {}),\n        ...(href ? { url: href } : {}),\n        ...(toOffer(price) ? { offers: toOffer(price) } : {}),\n      }).replace(/</g, \"\\\\u003c\");\n\n  return (\n    <div\n      className={cn(\"relative h-full w-full overflow-hidden rounded-3xl select-none\", href && !isTouch ? \"cursor-pointer\" : \"cursor-default\", className)}\n      onMouseEnter={() => setHovered(true)}\n      onMouseLeave={() => setHovered(false)}\n      onClick={handleCardClick}\n    >\n      {jsonLd && <script type=\"application/ld+json\" dangerouslySetInnerHTML={{ __html: jsonLd }} />}\n      <motion.img\n        src={image}\n        alt={title}\n        animate={{ scale: active ? 1.06 : 1 }}\n        transition={{ duration: 0.65, ease: [0.25, 0.46, 0.45, 0.94] }}\n        className=\"block h-full w-full object-cover\"\n      />\n\n      {showBadge && badgeText && (\n        <motion.div\n          initial={{ opacity: 0, scale: 0.85 }}\n          animate={{ opacity: 1, scale: 1 }}\n          className=\"absolute z-10 rounded-full border border-white/22 px-3.5 py-1.5 text-[11px] font-bold tracking-[0.07em] uppercase backdrop-blur-sm\"\n          style={{ ...BADGE_POS[badgePosition], background: themeUi.badgeBg, color: themeUi.badgeColor }}\n        >\n          {badgeText}\n        </motion.div>\n      )}\n\n      <AnimatePresence>\n        {active && (\n          <motion.div\n            key=\"overlay\"\n            initial={{ opacity: 0 }}\n            animate={{ opacity: 1 }}\n            exit={{ opacity: 0 }}\n            transition={{ duration: 0.36, ease: \"easeOut\" }}\n            className=\"absolute inset-0\"\n            style={{ backdropFilter: `blur(${blurAmount}px)`, WebkitBackdropFilter: `blur(${blurAmount}px)`, background: gradient }}\n          />\n        )}\n      </AnimatePresence>\n\n      <AnimatePresence>\n        {active && (\n          <motion.div key=\"content\" className=\"absolute inset-0 flex flex-col justify-end gap-2.5 px-8 pt-9 pb-9\">\n            <motion.h2 {...stagger(0)} className=\"m-0 leading-[1.1] font-bold tracking-[-0.4px] text-white\" style={{ fontSize: titleSize }}>\n              {title}\n            </motion.h2>\n\n            {showPrice && price && (\n              <motion.span {...stagger(1)} className=\"m-0 text-lg font-semibold text-white/95\">\n                {price}\n              </motion.span>\n            )}\n\n            {showDescription && description && (\n              <motion.p {...stagger(showPrice && price ? 2 : 1)} className=\"m-0 max-w-[340px] text-[15px] leading-[1.55] text-white/82\">\n                {description}\n              </motion.p>\n            )}\n\n            <motion.button\n              {...stagger(3)}\n              whileHover={{ scale: 1.04 }}\n              whileTap={{ scale: 0.96 }}\n              className=\"mt-2 flex items-center gap-2 self-start rounded-full border-none px-6.5 py-3.5 text-sm font-bold tracking-[0.01em]\"\n              style={{ background: themeUi.btnBg, color: themeUi.btnColor }}\n            >\n              {buttonText}\n            </motion.button>\n          </motion.div>\n        )}\n      </AnimatePresence>\n\n          </div>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}