IParallaxLayerRegistry

interface
Motion & Parallax

Internal layer descriptor registered into the parent OrigamParallax via provide/inject. The parent reads speed, offsetX and offsetY to compute the per-frame transform, then applies it to the shared target HTMLElement.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

id
required
symbol
Unique symbol identifier for the layer. Used to register and unregister the layer in the parent context.
speed
required
number
Parallax speed multiplier. 0 = fixed, 0.5 = half scroll speed, 1 = neutral, >1 = faster than scroll. Negative values reverse direction.
offsetX
required
number
Static X-axis offset (px) applied on top of the parallax translation.
offsetY
required
number
Static Y-axis offset (px) applied on top of the parallax translation.
target
required
HTMLElement
Reference to the DOM element that receives the per-frame CSS transform.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Using IParallaxLayerRegistry in a custom layer

typescript