Skip to content

Aurora API

Aurora

Extends Effect.

Factory Function

typescript
createAurora(config?: AuroraConfig)

Methods

See Effect for the full method reference: mount(), start(), pause(), resume(), configure(), withFade(), and destroy().


AuroraConfig

typescript
interface AuroraConfig {
    bands?: number;
    colors?: string[];
    speed?: number;
    intensity?: number;
    waveAmplitude?: number;
    verticalPosition?: number;
    scale?: number;
}
PropertyTypeDefaultDescription
bandsnumber5Number of aurora curtain rays.
colorsstring[]['#9922ff', '#4455ff', '#0077ee', '#00aabb', '#22ddff']Base hex colors for each ray. Colors cycle if fewer than bands.
speednumber1Animation speed multiplier.
intensitynumber0.8Overall brightness/opacity (0-1).
waveAmplitudenumber1Base wave undulation amplitude multiplier.
verticalPositionnumber0.68Normalized Y base for the aurora rays (0=top, 1=bottom).
scalenumber1Global scale factor for ray height.

AuroraBand

Internal representation of a single aurora band.

typescript
type AuroraBand = {
    x: number;          // Normalized X position of the ray center (0-1)
    baseY: number;      // Normalized Y base of the ray (0-1)
    height: number;     // Normalized ray height (0-1, relative to canvas height)
    sigma: number;      // Horizontal Gaussian spread in pixels (at 1920px width)
    phase1: number;     // Sway oscillation phase
    phase2: number;     // Base wave oscillation phase
    amplitude1: number; // Sway amplitude (fraction of canvas width)
    frequency1: number; // Base wave spatial frequency (rad/px)
    speed: number;      // Individual animation speed multiplier
    hue: number;        // Primary (bottom) hue in HSL (0-360)
    opacity: number;    // Maximum opacity for this ray
};