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

drift function

Framing of a card's picture by where the card is: scale and sideways shift (box units).

View as Markdown
import { drift } from '@dioramajs/media/horizontal'

The picture lags the card, shifted against the way it crosses the screen.

function drift(
  centre: number,
  width: number,
  viewport: number,
  depth: number,
): [number, number]

Parameters

NameTypeDescription
centrenumber
widthnumber
viewportnumber
depthnumber

Defined in packages/media/src/horizontal.ts.