@dioramajs/particles/drops
Exports of @dioramajs/particles/drops.
On this page
import { default, FADE, Glass } from '@dioramajs/particles/drops'Functions
opacity | How much of a drop shows: whole while it runs or grows, then fading over its last `FADE`; with a `lifetime`, also fading over its last third of it, running or not. |
trailProfile | Cross-section of a wet trail at `across`, from -1 (one edge) to 1 (the other): its opacity and how light it is. Symmetric about the middle, where the drop ran: a thin glossy line along the centre, a faint film, and darker edges where the water film ends. |
Classes
Glass | Water on the glass: drops that rest and dry, heavy ones that slide down in fits and starts, leave a wet trail and beads, and swallow what they meet. Deterministic for a seed; px, y down. |
Constants
default | Water drops on glass over an element, or over the viewport on `<body>`: rain that beads, runs and leaves wet trails, or a thaw that spreads from a point and leaves meltwater behind its front. Drops catch the light and darken at their rims; nothing behind them is read, so the page stays real DOM and clicks go through. Frames only while drops move or dry. |
FADE | Seconds a drop takes to fade out; a drop that stops running or growing has at least this. |
POOL | Drops the instance buffer holds. |
SLIDE | Radius in px (at scale 1) from which a drop is heavy enough to slide. |
TRAILS | Trail pieces kept; the oldest is overwritten. |