{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "text-liquid-gradient",
  "type": "registry:component",
  "title": "Text Liquid Gradient",
  "description": "Text filled with soft color blobs that drift through each other, over a blurred glow of the same colors.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "text",
    "text",
    "gradient",
    "liquid",
    "glow",
    "blob",
    "animated"
  ],
  "docs": "https://hyperblur.dev/effects/text-liquid-gradient",
  "files": [
    {
      "path": "registry/hyperblur/text-liquid-gradient.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/text-liquid-gradient.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface TextLiquidGradientProps extends React.HTMLAttributes<HTMLSpanElement> {\n  text: string;\n  colors?: string[];\n  speed?: number;\n  glow?: number;\n  glowBlur?: number;\n}\n\nconst css = `\n@keyframes hb-qdc-drift {\n  from { background-position: var(--hb-qdc-x0) var(--hb-qdc-y0); }\n  to { background-position: var(--hb-qdc-x1) var(--hb-qdc-y1); }\n}\n@keyframes hb-qdc-slide {\n  from { background-position: 0% 50%; }\n  to { background-position: 100% 50%; }\n}\n.hb-qdc {\n  position: relative;\n  display: inline-block;\n  max-width: 100%;\n  isolation: isolate;\n  line-height: 1.1;\n  font-family: inherit;\n  box-sizing: border-box;\n}\n.hb-qdc-t {\n  display: block;\n  margin: 0;\n  padding: 0.08em 0.14em;\n  color: transparent;\n  -webkit-text-fill-color: transparent;\n  -webkit-background-clip: text;\n  background-clip: text;\n  background-repeat: no-repeat;\n}\n.hb-qdc-main { position: relative; z-index: 1; display: block; }\n.hb-qdc-fill { position: relative; }\n.hb-qdc-abs { position: absolute; inset: 0; pointer-events: none; user-select: none; }\n.hb-qdc-base {\n  background-image: var(--hb-qdc-ramp);\n  background-size: 220% 100%;\n  background-repeat: repeat-x;\n  animation: hb-qdc-slide var(--hb-qdc-basedur) ease-in-out infinite alternate;\n}\n.hb-qdc-b {\n  background-image: radial-gradient(closest-side, var(--hb-qdc-c) 0%, transparent 100%);\n  background-size: var(--hb-qdc-w) var(--hb-qdc-h);\n  background-position: var(--hb-qdc-x0) var(--hb-qdc-y0);\n  animation: hb-qdc-drift var(--hb-qdc-dur) ease-in-out infinite alternate;\n  animation-delay: var(--hb-qdc-dl);\n}\n.hb-qdc-glow {\n  position: absolute;\n  inset: 0;\n  z-index: 0;\n  opacity: var(--hb-qdc-glow);\n  filter: blur(var(--hb-qdc-blur)) saturate(1.5);\n  pointer-events: none;\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qdc-base, .hb-qdc-b { animation: none; }\n}\n`;\n\nfunction mix(n: number) {\n  let h = Math.imul(n ^ 0x9e3779b9, 0x85ebca6b);\n  h ^= h >>> 13;\n  h = Math.imul(h, 0xc2b2ae35);\n  h ^= h >>> 16;\n  return (h >>> 0) / 4294967296;\n}\n\nexport function TextLiquidGradient({\n  text,\n  colors = [\"#2f7bff\", \"#8b5cf6\", \"#ff4fd8\", \"#22d3ee\"],\n  speed = 1,\n  glow = 0.55,\n  glowBlur = 0.2,\n  className = \"\",\n  style,\n  ...rest\n}: TextLiquidGradientProps) {\n  const palette = colors.length > 0 ? colors : [\"#2f7bff\"];\n  const pct = (v: number) => `${v.toFixed(1)}%`;\n  const rate = Math.max(0.1, speed);\n\n  const blobs = palette.map((c, i) => {\n    const dur = (7 + mix(i * 5 + 1) * 6) / rate;\n    return {\n      key: i,\n      style: {\n        \"--hb-qdc-c\": c,\n        \"--hb-qdc-w\": pct(70 + mix(i * 5 + 2) * 40),\n        \"--hb-qdc-h\": pct(130 + mix(i * 5 + 3) * 70),\n        \"--hb-qdc-x0\": pct(mix(i * 5 + 4) * 100),\n        \"--hb-qdc-y0\": pct(mix(i * 5 + 5) * 100),\n        \"--hb-qdc-x1\": pct(mix(i * 5 + 6) * 100),\n        \"--hb-qdc-y1\": pct(mix(i * 5 + 7) * 100),\n        \"--hb-qdc-dur\": `${dur.toFixed(2)}s`,\n        \"--hb-qdc-dl\": `${(-mix(i * 5 + 8) * dur).toFixed(2)}s`,\n      } as React.CSSProperties,\n    };\n  });\n\n  const ramp = `linear-gradient(100deg, ${[...palette, palette[0]].join(\", \")})`;\n  const vars = {\n    \"--hb-qdc-ramp\": ramp,\n    \"--hb-qdc-basedur\": `${(12 / rate).toFixed(2)}s`,\n    \"--hb-qdc-glow\": glow,\n    \"--hb-qdc-blur\": `${glowBlur}em`,\n    ...style,\n  } as React.CSSProperties;\n\n  return (\n    <span className={`hb-qdc ${className}`} style={vars} {...rest}>\n      <style href=\"hb-text-liquid-gradient\" precedence=\"default\">{css}</style>\n      {glow > 0 ? (\n        <span className=\"hb-qdc-glow\" aria-hidden=\"true\">\n          <span className=\"hb-qdc-t hb-qdc-base hb-qdc-abs\">{text}</span>\n          {blobs.map((b) => (\n            <span key={b.key} className=\"hb-qdc-t hb-qdc-b hb-qdc-abs\" style={b.style}>\n              {text}\n            </span>\n          ))}\n        </span>\n      ) : null}\n      <span className=\"hb-qdc-main\">\n        <span className=\"hb-qdc-t hb-qdc-base hb-qdc-fill\">{text}</span>\n        {blobs.map((b) => (\n          <span key={b.key} className=\"hb-qdc-t hb-qdc-b hb-qdc-abs\" style={b.style} aria-hidden=\"true\">\n            {text}\n          </span>\n        ))}\n      </span>\n    </span>\n  );\n}\n"
    }
  ]
}