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

EffectsApi interface

The `effects` service, `app.effects`.

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

Members

NameTypeDescription
readonly attachAttach

Same function as app.attach.

readonly renderRenderApi | undefined

The renderer once ready.

readonly statusReadonlySignal<EffectsStatus>

The state of the engine.

disable
disable(name: string): Off

Turns an effect off everywhere without touching markup. The returned Off turns it back on.

get
get<N extends 'curtain' | 'horizontal' | 'grid' | 'coin' | 'explode' | 'pins'
| 94 more | 'ribbon' | 'smoke' | 'tunnel' | 'zoom' | 'wave' | 'image' | 'gallery' | 'model' | 'globe' | 'label' | 'box' | 'ripple' | 'bend' | 'reveal' | 'parallax' | 'ambient' | 'hover-preview' | 'sequence' | 'expand' | 'zoom-scroll' | 'compare' | 'lightbox' | 'panorama' | 'tilt' | 'tone' | 'flipbook' | 'spin' | 'glitch' | 'pixelate' | 'video-hover' | 'stack' | 'coverflow' | 'carousel' | 'polaroids' | 'spotlight' | 'scrub' | 'chroma' | 'liquid' | 'flare' | 'frost' | 'reflection' | 'text-reveal' | 'scramble' | 'marquee' | 'video-text' | 'split-flap' | 'magnet' | 'assemble' | 'dust' | 'text-glitch' | 'neon' | 'extrude' | 'counter' | 'shimmer' | 'rotator' | 'inflate' | 'orbit' | 'voxel' | 'emboss' | 'shatter' | 'melt' | 'unfold' | 'blinds' | 'physics' | 'fire' | 'water' | 'keycaps' | 'lens' | 'prism' | 'hologram' | 'gradient' | 'dots' | 'waves' | 'stars' | 'blobs' | 'clouds' | 'device' | 'book' | 'hotspots' | 'vinyl' | 'beat' | 'visualizer' | 'confetti' | 'sparkles' | 'snow' | 'emoji' | 'drops' | 'beam' | 'glow' | 'shine' | 'chart' | 'graph' | 'heatmap' | 'map'
>( element: Element, name: N, ): EffectInstance<SpecFor<N>> | undefined

The instance of an effect on an element, if any.

instances
instances(name?: string): readonly EffectInstance<ParamSpec>[]

Live instances, of one effect or all.

load
load(): Promise<boolean>

Boots the engine now. Resolves false when 3D is unavailable.

observe
observe(root: ParentNode): Off

Observes another root such as a shadow root, and adopts the hiding stylesheet there.

pin
pin(element: Element, source: () => number): Off

Replaces the pin input of an element's layer with a 0..1 source, e.g. a ScrollTrigger's progress. Read once per frame in layout. Off restores the built-in formula.

register
register(entries: EffectEntries): Off

Adds or replaces sources. Waiting elements pick them up and replaced ones rebuild (HMR).

scan
scan(root?: ParentNode): void

Reconciles now, after DOM work the observer cannot see.

stats
stats(): EffectsStats

Counters for tests and devtools, zeros without the runtime.

take
take(element: Element, options?: TakeOptions): Copy

Takes an element's GL copy. Returns an inert copy ('released', ready false) without the runtime, when it is already taken, or when another app owns the element.

Also exported from @dioramajs/effects.

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