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

Exports of @dioramajs/text/rotator.

View as Markdown
On this page
import { default, fall, overshoot } from '@dioramajs/text/rotator'

Functions

fallA flap falling: faster and faster, then one small bounce on landing.
overshootSpeeds up like cubicInOut, then runs a few percent past the end and settles back.
piecesWhere the pieces of radius turn are at `progress` (0 the word leaving, flat; 1 the word coming, flat), back to front. `height` is the element's box height. Under reduced motion the words fade.

Constants

defaultWords take turns in a phrase on the faces of a real 3D shape: a cube or a drum that rolls to the next word, a split flap falling over its hinge or a strip folding into the page, lit from above and seen in perspective. The box eases to the width of the next word; between turns the word is plain DOM text.

Interfaces

PieceA flat region of a word moved into 3D: a point (x, y) of the region, y down, lands at `origin + ax * x - ay * y` in the element's frame (origin at its top left, y up, z towards the viewer).
WordOne word as laid out at rest, in element px (y down from the element's top left).

Types

AroundThe words a turn shows, by place from the word leaving (0) and the word coming (1).
Axis
Style
Vec3