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/confetti

Exports of @dioramajs/particles/confetti.

View as Markdown
On this page
import { default, flight, MIN_DRAG } from '@dioramajs/particles/confetti'

Functions

flightThe closed form of a launch from `x0, y0, 0` at `vx, vy, vz` under gravity `g` (down) and linear drag `k`: p(t) = p0 + v0·f + g·(t − f)/k with f = (1 − e^(−kt))/k. The vertex shader draws the same path.

Constants

defaultA burst of confetti from the element's box, a shower from the top of the viewport or fireworks over it, over everything, to mark a sign-up, an order or a donation. The element is never hidden, and under reduced motion nothing loads.
MIN_DRAGDrag never goes below this, so the closed form stays exact in float32.
POOLPieces in the ring every burst writes into: one instanced draw.

Interfaces

FlightWhere a piece is `t` s after launch, in world px (y up), without its sway.