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/text/shatter

Exports of @dioramajs/text/shatter.

View as Markdown
On this page
import { CALM, CAP, corners } from '@dioramajs/text/shatter'

Functions

cornersA shard's corners in its own frame: px from the pivot, y up, counterclockwise.
edgesThe edges of each shard as half-planes in its own frame: unit normal out and offset.
shape

Constants

CALMSeconds of the fade that stands in for the break under reduced motion.
CAPMost shards per tier.
defaultThe heading breaks into 3D shards that fly apart, tumble and catch the light: thin panes of glass with the text printed on them, thick chunks of stone with rough walls and a puff of dust, or torn paper that flutters down. On a click from the point of impact, scrubbed as the heading scrolls out, as a light crack under the pointer, or assembled from flying shards once in view. At rest the element is plain DOM text.
THICKThickness of a shard at depth 1, em of the font size.