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

inView function

Whether `share` 0..1 of a box is in view, counted above the bottom tenth of the viewport: a box peeking in at the edge has not been looked at yet.

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

. top and height are the box's in viewport px (input.y, input.height), viewport the viewport height. An empty box never is.

function inView(
  top: number,
  height: number,
  viewport: number,
  share: number,
): boolean

Parameters

NameTypeDescription
topnumber
heightnumber
viewportnumber
sharenumber

Also exported from @dioramajs/effects/kit.

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