Firefly Field
A few points drifting in the dark, each flashing on its own rhythm.
The canvas in this preview is the file shown here. The surrounding demo shell only provides context and is not part of the copied code.
import { useEffect, useRef } from "react";
/**
* Vibary · Firefly Field
*
* A few points that drift and flash, each on its own rhythm.
*
* The technique: the flash envelope is asymmetric — up in about a tenthAbout this effect
Dusk for a screen that should feel restful — a sleep mode, a wind-down state, a dark empty view. The flash envelope is asymmetric: up in about a tenth of a second, down over most of a second, then a long dark gap. A sine wave on opacity gives you dots that pulse, while the fast rise and slow decay says a light was switched on and is dying away, and the seconds of nothing in between are what make a flash an event rather than a rhythm. An unlit fly is not drawn at all. The drift is a random walk on each fly's heading rather than on its position — jittering a position reads as noise, while a wandering heading produces the long aimless curves that read as flight.