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

StartOptions interface

Options of `start()`.

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

Every field is optional.

interface StartOptions

Members

NameTypeDescription
readonly background?string | number

Clear colour: a number or any CSS colour, e.g. '#08080b'. Transparent by default.

readonly canvas?'over' | 'behind'

'over' (default) draws above the page, 'behind' draws under a transparent page.

readonly effects?{ [name: string]: EntryPatch | EffectSource }

Effects besides the folder's and the catalogue's: a new entry replaces the one of its name, a patch ({ ripple: { when: 'all' } }) changes when or reducedMotion of a known one. Replacing a built-in warns EFFECT_OVERRIDE in development unless the entry has override: true.

readonly enabled?boolean | 'auto'

'auto' (default) is off under Save-Data and unavailable without WebGPU or WebGL 2. true ignores Save-Data but not a missing GPU: the page stays plain, as with 'auto'. false is off.

readonly gsap?GsapLike

The site's GSAP. Its tweens and the frame share one ticker, and gsap.to(handle.params) works.

readonly lenis?LenisLike

The site's Lenis instance, so smooth scroll lands in the same frame as the canvas.

readonly load?'near' | 'eager' | 'manual'

When the engine boots: 'near' (default), 'eager' or 'manual'.

readonly margin?string

IntersectionObserver rootMargin that starts loading. Default '100% 0px'.

readonly plugins?readonly PluginEntry[]

Extra plugins, your own or official ones with more options.

readonly prefetch?boolean

Download the engine in idle time after window load. Default true.

readonly quality?false | 'auto' | QualityTier | Partial<QualityOptions>

Quality tiers for weaker GPUs: 'auto' (default) detects and adapts, a tier pins it, false leaves the plugin out. Loads with the engine, never in the main chunk.

readonly render?Partial<RenderOptions>

Renderer options beyond background. start() defaults to antialias: 'auto' and environment: 'room'.

readonly ScrollTrigger?ScrollTriggerStatic

The site's ScrollTrigger. Pins and scrubbed timelines drive pin and progress.

readonly transitions?boolean | Partial<TransitionsOptions> & { … }

Page transitions by data-dio-key. On by default, false turns them off. cover adds a GL cover the pages change behind: { cover: 'ink' } or { cover: { name: 'curtain', color } }.

Also exported from @dioramajs/diorama/auto.

Defined in packages/diorama/src/index.ts.