{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "animated-background-glass", "type": "registry:component", "title": "Animated Background Glass", "description": "Animated gradient background with floating orbs for glassmorphism UIs.\n * Provides an immersive atmosphere with theme-aware styling.\n *\n * ## Features", "dependencies": [ "react", "shadcn-glass-ui" ], "registryDependencies": [ "cn", "theme-provider" ], "files": [ { "path": "components/glass/specialized/animated-background-glass.tsx", "type": "registry:component", "content": "/**\n * AnimatedBackgroundGlass Component\n *\n * Animated gradient background with floating orbs for glassmorphism UIs.\n * Provides an immersive atmosphere with theme-aware styling.\n *\n * ## Features\n * - Theme-aware gradient background (glass/light/aurora)\n * - 5 floating animated orbs with blur effects\n * - Fixed positioning for full-page backgrounds\n * - Performance-optimized CSS animations (8s cycle)\n * - Configurable center orb visibility\n *\n * ## Orb Configuration\n * - **Orb 1:** Top-left, 600px, purple/blue tones\n * - **Orb 2:** Bottom-right, 700px, blue/violet tones, 2s delay\n * - **Orb 3:** Center-right, 500px, pink/cyan tones, 4s delay\n * - **Orb 4:** Bottom-left, 450px, cyan/violet tones, 6s delay\n * - **Orb 5:** Center, 500px, violet (glass theme only by default)\n *\n * ## CSS Variables\n * Customize colors via theme CSS variables:\n * - `--orb-1` through `--orb-5`: Orb colors (OKLCH with opacity)\n * - `--bg-from`, `--bg-via`, `--bg-to`: Gradient stops\n *\n * @example Basic usage\n * ```tsx\n * import { AnimatedBackgroundGlass } from 'shadcn-glass-ui'\n *\n * function App() {\n * return (\n * <>\n * \n *
\n * Your content here\n *
\n * \n * )\n * }\n * ```\n *\n * @example With center orb forced on\n * ```tsx\n * \n * ```\n *\n * @example With reduced opacity\n * ```tsx\n * \n * ```\n *\n * @example With dark overlay for better contrast\n * ```tsx\n * <>\n * \n *
\n *
Content
\n * \n * ```\n *\n * @accessibility\n * - Uses `aria-hidden=\"true\"` as purely decorative element\n * - Does not interfere with keyboard navigation\n * - No interactive elements within the component\n * - Animation uses CSS (respects `prefers-reduced-motion` when configured)\n *\n * @since v1.0.0\n */\n\nimport { forwardRef, type CSSProperties } from 'react';\nimport { cn } from '@/lib/utils';\nimport { useTheme } from '@/lib/theme-context';\nimport '@/glass-theme.css';\n\n// ========================================\n// PROPS INTERFACE\n// ========================================\n\n/**\n * Props for AnimatedBackgroundGlass component.\n *\n * Extends standard div attributes (excluding `style`) for maximum flexibility.\n * The `style` prop is excluded because the component uses internal inline styles\n * for the gradient background.\n *\n * @example\n * ```tsx\n * const props: AnimatedBackgroundGlassProps = {\n * showCenterOrb: true,\n * className: 'opacity-75',\n * };\n * ```\n */\nexport interface AnimatedBackgroundGlassProps extends Omit<\n React.HTMLAttributes,\n 'style'\n> {\n /**\n * Whether to show the center orb (Orb 5).\n *\n * - In `glass` theme: defaults to `true`\n * - In `light` and `aurora` themes: defaults to `false`\n *\n * Override to force visibility in any theme.\n *\n * @default undefined (auto-detected based on theme)\n */\n readonly showCenterOrb?: boolean;\n}\n\n// ========================================\n// COMPONENT\n// ========================================\n\nexport const AnimatedBackgroundGlass = forwardRef(\n ({ className, showCenterOrb, ...props }, ref) => {\n const { theme } = useTheme();\n const isGlass = theme === 'glass';\n\n // Show center orb if explicitly set, or auto-show in glass theme\n const shouldShowCenterOrb = showCenterOrb ?? isGlass;\n\n const bgStyles: CSSProperties = {\n background: 'linear-gradient(135deg, var(--bg-from), var(--bg-via), var(--bg-to))',\n };\n\n return (\n \n {/* Orb 1 - top left purple (600px) */}\n \n {/* Orb 2 - bottom right blue (700px) */}\n \n {/* Orb 3 - center right pink (500px) */}\n \n {/* Orb 4 - bottom left cyan (450px) */}\n \n {/* Orb 5 - center (configurable, default: glass theme only) */}\n {shouldShowCenterOrb && (\n \n )}\n
\n );\n }\n);\n\nAnimatedBackgroundGlass.displayName = 'AnimatedBackgroundGlass';\n\n// ========================================\n// ALIAS\n// ========================================\n\n/**\n * AnimatedBackground - Alias for AnimatedBackgroundGlass\n */\nexport const AnimatedBackground = AnimatedBackgroundGlass;\n" } ], "categories": [ "specialized" ] }