cyclicMovement

Commons
stable

Computes a sinusoidal parallax offset (x, y) from a reference position relative to a shape or the viewport. Used by the parallax system to create cyclic, depth-driven motion.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

cycleData
required
IParallaxElementCicle
Configuration object: referencePosition (current pointer/scroll position), shape (bounding rect of the element), event type ('scroll' | 'mousemove'), cycles (frequency multiplier), and strength (amplitude factor).

API

Return value

The value returned by this util.

A { x, y } point representing the computed CSS transform offset in pixels.

Usage

Examples

Ready-to-paste usage snippets.

Used internally by OrigamParallaxElement

typescript