Aurora

Curtains of light that fold, sway and shimmer.

Preview

Installation

pnpm add astro-dither

Or copy the source into your project: npx astro-dither add effect

Usage

---
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.

Northern lights

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

Hanging down

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

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.05Vertical 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.
directionnumber11 rises, -1 hangs the rays from a bright top edge. -1 to 1.
masknumber00 none, 1 fades the top, 2 fades the bottom, 3 fades the sides. 0 to 3.
palettestring[]the effect's2 to 8 colours, paper first, brightest last. transparent works.
cellnumber2Size of one dither cell in CSS pixels, 1 to 8.
matrix2 | 4 | 8 | "noise"8The Bayer threshold size, or noise for a random look.
speednumber1Playback speed. 0 draws one still frame.
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.