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

EffectEntry interface

A loader plus what the light part must know before three loads.

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

Checked against the definition after load. On a mismatch the definition wins and dev mode warns.

interface EffectEntry

Members

NameTypeDescription
readonly intro?boolean | (element: Element) => boolean

The effect plays an intro: an element in view when its instance is created is hidden (data-dio-state="entering") until the effect draws it, at most 3 s, so the intro plays on the first screen too instead of the visitor seeing the DOM first. A function decides per element, e.g. from its markup.

readonly loadEffectLoader

Imports the effect module.

readonly override?boolean

The entry replaces a built-in effect of @dioramajs/diorama on purpose, so start() does not warn EFFECT_OVERRIDE in development. The registry ignores it.

readonly params?ParamSpec

Param defaults known before load, so these keys are readable and tweenable right away.

readonly presence?'fade' | 'custom'

Overrides the definition's presence (a GLSL file's pragma, a patch).

readonly reducedMotion?'static' | 'off'

Overrides the definition's reducedMotion. 'off' skips loading under reduced motion.

readonly when?When

Overrides the definition's when, e.g. 'all' to turn ripple on for touch.

Also exported from @dioramajs/effects.

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