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/media/stack

Exports of @dioramajs/media/stack.

View as Markdown
On this page
import { default, scatter, slot } from '@dioramajs/media/stack'

Functions

scatterScatter of a card in the pile, each part -1..1, the same for a card on every load.
slotThe pose of a card at a whole depth in the pile: 0 is the top, which sits on the box. `width` and `height` are the box, `rotate` in degrees, `offset` in px.
travelHow far a thrown card flies before it is gone, px.

Constants

defaultThe images of a container as a pile of cards. A drag, a swipe, a click or a key throws the top card off and brings the next one forward. Fires `dio:index` on the container when a card is on top.

Interfaces

PoseWhere a card sits: x, y px from the box centre (y up), angle in radians, scale.

Types

StackStyleHow the cards lie under the top one.