Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

@dioramajs/particles/drops

Exports of @dioramajs/particles/drops.

View as Markdown
On this page
import { default, FADE, Glass } from '@dioramajs/particles/drops'

Functions

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

GlassWater 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

defaultWater 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.
FADESeconds a drop takes to fade out; a drop that stops running or growing has at least this.
POOLDrops the instance buffer holds.
SLIDERadius in px (at scale 1) from which a drop is heavy enough to slide.
TRAILSTrail pieces kept; the oldest is overwritten.

Interfaces

DropA drop on the glass, in px from the area's top left, y down.
WeatherWhat a step needs.