EffectDefinition interface
What `defineEffect` takes: the params, the options and `setup`.
import type { EffectDefinition } from '@dioramajs/diorama/effects'interface EffectDefinition<P extends ParamSpec>Members
| Name | Type | Description |
|---|---|---|
readonly animate? | AnimatePolicy<P> | Defaults to the update's answer when it returns a boolean, else to what the effect reads: |
readonly bleed? | number | Extra px around the box for visibility, for copies displaced past it. Default 0. |
readonly burst? | boolean | Objects in |
readonly media? | boolean | 'optional' | Needs the <img> or <video> as a texture. Implies |
readonly name? | string | kebab-case token in |
readonly on? | string | Selector of the elements this effect accepts. Others are skipped with a warning. |
readonly params? | P | Defaults. Their types become the param types. |
readonly presence? | 'fade' | 'custom' | Page transitions. 'fade' (default) multiplies the copy's alpha by |
readonly quality? | QualitySpec<P> | How the effect gets cheaper on weaker GPUs. Read by the runtime and by the docs. |
readonly rebuild? | readonly (keyof P & string)[] | Params whose change re-runs setup. String and choice params always do. |
readonly reducedMotion? | 'static' | 'off' | 'static' (default) runs with motion inputs zeroed and time frozen. 'off' skips the effect. |
readonly when? | When | Media query the page must match or the instance is |
setup | | Builds the effect once per instance. May return an update that runs every drawn frame. |
Also exported from @dioramajs/effects.
Defined in packages/effects/src/types.ts.