{
  "$schema": "https://www.cooki-ui.design/schema/registry-item.json",
  "name": "aurora-text-effect",
  "type": "registry:ui",
  "title": "Aurora Text Effect",
  "description": "Dynamic shimmering typography mask filled with multi-layer fluid chromatic aurora plasma waves.",
  "category": "text",
  "dependencies": [
    "clsx",
    "tailwind-merge"
  ],
  "tags": [
    "text",
    "aurora",
    "typography",
    "plasma",
    "shimmer",
    "chromatic",
    "gradient"
  ],
  "files": [
    {
      "path": "registry/text/aurora-text-effect/aurora-text-effect.tsx",
      "type": "registry:ui",
      "target": "components/ui/aurora-text-effect.tsx",
      "content": "import React, { useRef, useState, useEffect } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AuroraTextEffectProps {\n  text: string;\n  className?: string;\n  textClassName?: string;\n  fontSize?: string;\n  colors?: {\n    first?: string;\n    second?: string;\n    third?: string;\n    fourth?: string;\n  };\n  blurAmount?:\n  | \"blur-none\"\n  | \"blur-sm\"\n  | \"blur-md\"\n  | \"blur-lg\"\n  | \"blur-xl\"\n  | \"blur-2xl\"\n  | \"blur-3xl\"\n  | string;\n  animationSpeed?: {\n    border?: number;\n    first?: number;\n    second?: number;\n    third?: number;\n    fourth?: number;\n  };\n}\n\nexport function AuroraTextEffect({\n  text,\n  className,\n  textClassName,\n  fontSize = \"clamp(3rem, 8vw, 7rem)\",\n  colors = {\n    first: \"bg-cyan-400\",\n    second: \"bg-yellow-400\",\n    third: \"bg-green-400\",\n    fourth: \"bg-indigo-500\",\n  },\n  blurAmount = \"blur-lg\",\n  animationSpeed = {\n    border: 6,\n    first: 5,\n    second: 5,\n    third: 3,\n    fourth: 13,\n  },\n}: AuroraTextEffectProps) {\n  const containerRef = useRef<HTMLDivElement>(null);\n  const [isInView, setIsInView] = useState(true);\n\n  useEffect(() => {\n    const el = containerRef.current;\n    if (!el || typeof IntersectionObserver === \"undefined\") return;\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        setIsInView(entry.isIntersecting);\n      },\n      { rootMargin: \"250px\" }\n    );\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, []);\n\n  // Define keyframes as a style object\n  const keyframes = `\n    @keyframes aurora-1 {\n      0% { top: 0; right: 0; }\n      50% { top: 100%; right: 75%; }\n      75% { top: 100%; right: 25%; }\n      100% { top: 0; right: 0; }\n    }\n    @keyframes aurora-2 {\n      0% { top: -50%; left: 0%; }\n      60% { top: 100%; left: 75%; }\n      85% { top: 100%; left: 25%; }\n      100% { top: -50%; left: 0%; }\n    }\n    @keyframes aurora-3 {\n      0% { bottom: 0; left: 0; }\n      40% { bottom: 100%; left: 75%; }\n      65% { bottom: 40%; left: 50%; }\n      100% { bottom: 0; left: 0; }\n    }\n    @keyframes aurora-4 {\n      0% { bottom: -50%; right: 0; }\n      50% { bottom: 0%; right: 40%; }\n      90% { bottom: 50%; right: 25%; }\n      100% { bottom: -50%; right: 0; }\n    }\n    @keyframes aurora-border {\n      0% { border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%; }\n      25% { border-radius: 47% 29% 39% 49% / 61% 19% 66% 26%; }\n      50% { border-radius: 57% 23% 47% 72% / 63% 17% 66% 33%; }\n      75% { border-radius: 28% 49% 29% 100% / 93% 20% 64% 25%; }\n      100% { border-radius: 37% 29% 27% 27% / 28% 25% 41% 37%; }\n    }\n  `;\n\n  const playState = isInView ? \"running\" : \"paused\";\n\n  return (\n    <div\n      ref={containerRef}\n      className={cn(\n        // Updated to support light and dark modes\n        \"bg-white dark:bg-black flex items-center justify-center overflow-hidden\",\n        className\n      )}\n    >\n      <style>{keyframes /* This injects the keyframes into the DOM */}</style>\n      <div className=\"text-center\">\n        <h2\n          className={cn(\n            // Added theme-aware text color for visibility\n            \"font-extrabold tracking-tight relative overflow-hidden text-black dark:text-white\",\n            textClassName\n          )}\n          style={{ fontSize }}\n        >\n          {text}\n          <div\n            // Switched blend mode based on theme to preserve the effect\n            className=\"absolute inset-0 z-10 mix-blend-lighten dark:mix-blend-darken pointer-events-none\"\n          >\n            {/* First Aurora Layer */}\n            <div\n              className={cn(\n                \"absolute w-[60vw] h-[60vw] rounded-[37%_29%_27%_27%/28%_25%_41%_37%] filter mix-blend-overlay\",\n                colors.first || \"bg-cyan-400\",\n                blurAmount\n              )}\n              style={{\n                animationName: \"aurora-border, aurora-1\",\n                animationDuration: `${animationSpeed.border}s, ${animationSpeed.first}s`,\n                animationTimingFunction: \"ease-in-out, ease-in-out\",\n                animationIterationCount: \"infinite, infinite\",\n                animationDirection: \"normal, alternate\",\n                animationPlayState: `${playState}, ${playState}`,\n              }}\n            />\n\n            {/* Second Aurora Layer */}\n            <div\n              className={cn(\n                \"absolute w-[60vw] h-[60vw] rounded-[37%_29%_27%_27%/28%_25%_41%_37%] filter mix-blend-overlay\",\n                colors.second,\n                blurAmount\n              )}\n              style={{\n                animationName: \"aurora-border, aurora-2\",\n                animationDuration: `${animationSpeed.border}s, ${animationSpeed.second}s`,\n                animationTimingFunction: \"ease-in-out, ease-in-out\",\n                animationIterationCount: \"infinite, infinite\",\n                animationDirection: \"normal, alternate\",\n                animationPlayState: `${playState}, ${playState}`,\n              }}\n            />\n\n            {/* Third Aurora Layer */}\n            <div\n              className={cn(\n                \"absolute w-[60vw] h-[60vw] rounded-[37%_29%_27%_27%/28%_25%_41%_37%] filter mix-blend-overlay\",\n                colors.third,\n                blurAmount\n              )}\n              style={{\n                animationName: \"aurora-border, aurora-3\",\n                animationDuration: `${animationSpeed.border}s, ${animationSpeed.third}s`,\n                animationTimingFunction: \"ease-in-out, ease-in-out\",\n                animationIterationCount: \"infinite, infinite\",\n                animationDirection: \"normal, alternate\",\n                animationPlayState: `${playState}, ${playState}`,\n              }}\n            />\n\n            {/* Fourth Aurora Layer */}\n            <div\n              className={cn(\n                \"absolute w-[60vw] h-[60vw] rounded-[37%_29%_27%_27%/28%_25%_41%_37%] filter mix-blend-overlay\",\n                colors.fourth,\n                blurAmount\n              )}\n              style={{\n                animationName: \"aurora-border, aurora-4\",\n                animationDuration: `${animationSpeed.border}s, ${animationSpeed.fourth}s`,\n                animationTimingFunction: \"ease-in-out, ease-in-out\",\n                animationIterationCount: \"infinite, infinite\",\n                animationDirection: \"normal, alternate\",\n                animationPlayState: `${playState}, ${playState}`,\n              }}\n            />\n          </div>\n        </h2>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}