IParallaxLayerProvide

interface
Parallax

Provide context exposed by the enriched OrigamParallax to its `<OrigamParallaxLayer>` children. Distinct from the legacy `IParallaxProvide` consumed by `<OrigamParallaxElement>` (kept separate to avoid coupling the two APIs).

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.

direction
requis
Ref<TParallaxDirection>
easing
requis
Ref<TParallaxEasing | string>
disabled
requis
Ref<boolean>
progress
requis
Ref<number>
Live scroll progress, normalised to `[0, 1]`. `0` = host just entered the viewport, `1` = host just left.
mouseRatio
requis
Ref<{ x: number, y: number }>
Live mouse-ratio for `direction="both"` on `event="move"` — `{ x: 0..1, y: 0..1 }`. Falls back to `{ x: 0.5, y: 0.5 }` when no mouse data is available.
cssScrollDriven
requis
Ref<boolean>
Whether the runtime is using the CSS scroll-driven path (true) or the JS rAF fallback (false). Layers may opt out of the JS work when the CSS path is active.
reducedMotion
requis
Ref<boolean>
Whether `prefers-reduced-motion: reduce` is honoured — layers MUST stay at offset 0 when this is true.
register
requis
(layer: IParallaxLayerRegistry) => void
Register / unregister a layer with the parent. The parent reads the registry to compute and apply per-layer transforms each frame.
unregister
requis
(id: symbol) => void
update
requis
(id: symbol, patch: Pick<IParallaxLayerRegistry, 'speed' | 'offsetX' | 'offsetY'>) => void