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

Définition

La définition TypeScript de l'interface telle que trouvée dans le code source d'origam. Cliquez sur l'icône de copie pour copier l'extrait.

typescript

API

Propriétés

Chaque propriété déclarée par cette interface, avec son type, son caractère optionnel et sa valeur par défaut.

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

Écosystème

Utilisé par

Composants et composables qui étendent ou consomment cette interface.

Usage

Exemples

Extraits de code prêts à coller utilisant cette interface.

Using IParallaxLayerRegistry in a custom layer

typescript