'use client';
import { forwardRef, HTMLAttributes } from 'react';
export interface AuroraProps extends HTMLAttributes {
/** Array of aurora colors (5 colors will be used) */
colors?: string[];
/** Animation duration in seconds */
speed?: number;
/** Opacity/strength of the aurora effect */
intensity?: number;
/** Blur amount in pixels */
blur?: number;
/** Position the aurora effect */
position?: 'fixed' | 'absolute';
/** Animation style variant */
variant?: 'default' | 'subtle' | 'dynamic';
/** Constrain aurora to specific area */
region?: 'full' | 'top' | 'bottom' | 'left' | 'right';
/** Custom CSS blend mode */
blendMode?: string;
}
export const Aurora = forwardRef(
(
{
colors = ['#00ff00', '#00ffff', '#ff00ff', '#00ff80', '#8000ff'],
speed = 20,
intensity = 0.5,
blur = 100,
position = 'fixed',
variant = 'default',
region = 'full',
blendMode = 'screen',
className = '',
style,
...props
},
ref
) => {
const getSpeedModifier = () => {
switch (variant) {
case 'subtle': return 1.5;
case 'dynamic': return 0.6;
default: return 1;
}
};
const layerAnimation = `aurora-move ${speed * getSpeedModifier()}s ease-in-out infinite`;
const layerStyles = {
'--aurora-color-1': colors[0] || '#00ff00',
'--aurora-color-2': colors[1] || colors[0],
'--aurora-color-3': colors[2] || colors[0],
'--aurora-color-4': colors[3] || colors[1] || colors[0],
'--aurora-color-5': colors[4] || colors[2] || colors[0],
} as React.CSSProperties;
return (
);
}
);
Aurora.displayName = 'Aurora';
export default Aurora;