Menu
Docs menu

Aurora

Curtains of light that fold, sway and shimmer.

Preview

Expanded preview

Installation

Terminal window
pnpm add astro-dither

Or copy the source into your project:

Terminal window
npx astro-dither add effect

Usage

src/pages/index.astro
---
import { DitherAurora } from "astro-dither";
---
<DitherAurora />

Each curtain has a bright lower edge that folds slowly, with rays that fade as they rise. Further curtains hang higher and dimmer. height sets where the lowest edge hangs, so you can keep the area under it clear for text.

The props group like this:

Shape: curtains, height, spread, sway, turbulence, rays, length. Light: glow, intensity, shimmer. Placement and motion: tilt, scale, drift, direction, mask, plus speed, cell and matrix.

Examples

Above a headline

Raising height lifts the curtains so the lower third stays clear.

Expanded preview

Northern lights

A green-to-violet palette with more curtains and longer rays.

Expanded preview

Hanging down

direction -1 flips it so rays fall from a bright top edge.

Expanded preview

Props

PropTypeDefaultDescription
curtainsnumber3How many curtains. Each hangs higher and dimmer. 1 to 6.
heightnumber0.42Where the lowest bright edge hangs, 0 to 1. 0 to 0.9.
spreadnumber0.11Vertical gap between curtains. 0 to 0.3.
swaynumber1How far the edges fold. 0 to 3.
turbulencenumber0.6Fine ripples along each edge. 0 to 2.
raysnumber8How many rays fit across. 2 to 20.
lengthnumber0.45How far the rays reach up. 0 to 1.
glownumber0.9Brightness of the line along each edge. 0 to 2.
intensitynumber0.95Overall curtain brightness. 0 to 1.
shimmernumber0.2A slow brightness ripple. 0 to 1.
scalenumber1Horizontal zoom. 0.2 to 3.
tiltnumber0Tilt of the curtains in degrees. -45 to 45.
driftnumber0Sideways travel. -2 to 2.
directionnumber1up rises from a bright lower edge; down hangs the rays from a bright top edge (1 or -1 in params). -1 to 1.
masknumber0Fades it out where your text sits: none, top, bottom or edges (0 to 3 in params). 0 to 3.
palettestring[]the effect's2 to 8 colours, paper first, brightest last. transparent works.
cellnumber2Size of one dither cell in CSS pixels. Rounded to whole device pixels so cells stay even.
matrix2 | 4 | 8 | "noise"8The Bayer threshold size, or noise for a random look.
speednumber1Playback speed. 0 draws one still frame.
stillTimenumberthe effect'sThe moment drawn when motion is off or reduced, in seconds.
levelsnumber0 (all)Tones the field snaps to before dithering. Low values give hard, posterised steps.
bloomnumber0Bloom around lit cells, 0 to 1. Set a positive prop to create the overlay before overriding it with CSS --dither-bloom.
bloomRadiusnumber10Bloom blur in CSS pixels. CSS --dither-bloom-radius overrides it.
classstringundefinedClasses on the surface element, for size and position.

Notes

  • Decorative and aria-hidden. Put real text on top of it, not inside it.
  • With reduced motion it draws one still frame at 6s and stops.
  • It pauses when scrolled out of view or when the tab is hidden.
  • It shares one WebGL context with every other ordered effect on the page.