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

entering function

Scroll progress of a box coming into view, 0..1: 0 while less than `share` of it shows, 1 once it is centred in the viewport.

View as Markdown
import { entering } from '@dioramajs/diorama/kit'

. progress is input.progress, height the box height and viewport the viewport height in px.

function entering(
  progress: number,
  height: number,
  viewport: number,
  share: number,
): number

Parameters

NameTypeDescription
progressnumber
heightnumber
viewportnumber
sharenumber

Also exported from @dioramajs/effects/kit.

Defined in packages/effects/src/kit.ts.