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

EffectUpdate type

Runs every frame while the instance is running and visible.

View as Markdown
import type { EffectUpdate } from '@dioramajs/diorama/effects'

Return true to ask for the next frame while state kept in JavaScript still moves (a damped value, a fade, a simulation), and false once it has settled. Without an animate option a returned boolean decides alone, so reading input.delta for the motion does not draw every frame; return one on every path. With animate, true adds frames to the policy. Returning nothing leaves it to the policy. true is honoured under reduced motion too: settle at once when input.reducedMotion is set.

type EffectUpdate = (input: EffectInput, frame: FrameTime) => boolean | void

Also exported from @dioramajs/effects.

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