Aurora

Three curtains of light with bright lower hems, swaying across a surface. Their heights and warps are a CPU table per frame; the rays are noise per pixel.

<Fx effect="aurora" preset="Polar" />

Features

  • Three curtains with bright lower hems; heights and warps are a CPU table, rays per pixel.

Use it for

  • Quiet hero panels.
  • Night skies.

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react

Usage

import { Fx } from 'runets'

<div className="card"> {/* position: relative */}
  <Fx effect="aurora" />
</div>

API

PropTypeWhat it does
effectstringThe effect’s id, as in the address of this page.
presetstringOne of the presets above; the first by default.
paramsParamsAny parameter from the table, over the preset.
place'under' | 'over'Under the parent’s content (fills, halos) or over it (sparkles, glass). Default under.
radiusnumberCorner radius in points; the parent’s own border radius by default.
backdropstring | PaintWhat glass and distortion read: an image URL, or a function that paints a canvas the size of the parent.
maskPaintAn alpha mask for mask glow and text sheen.
hotbooleanDrives heat: the layer lights in 60 ms and cools over half a second instead of cutting off.
triggernumberChange it to fire a one-shot now (ping, ripple, burst, shockwave, zap).
wakenumberChange it to redraw for a second when something the layer reads, such as its occluders, moves on its own.
shape(time, w, h) => RectThe effect’s shape inside the parent, per frame: a lens that drifts.

Parameters

NameRangeDefault
a Firstcolor0x16c79a
b Secondcolor0x3b6cff
c Thirdcolor0xa23bff
scale Scale20 to 400120
speed Speed0 to 20.25
intensity Intensity0 to 1.50.5
feather Feather0 to 12040

Accessibility

Source

The code is in src/fx/glsl/emit.ts in runets, MIT licensed.