(card-rotation index max-rotation)Deterministic rotation for card at index. Uses sin for pseudo-random spread.
Deterministic rotation for card at index. Uses sin for pseudo-random spread.
(card-x-offset index)Small horizontal jitter for the 'messy stack' feel.
Small horizontal jitter for the 'messy stack' feel.
(compute-card-progress scroll-offset card-index scroll-distance)For a given scroll offset, compute the stacking progress [0.0, 1.0] of card i. Card i begins its transition at i*sd and completes at (i+1)*sd.
For a given scroll offset, compute the stacking progress [0.0, 1.0] of card i. Card i begins its transition at i*sd and completes at (i+1)*sd.
(compute-overall-progress scroll-offset child-count scroll-distance)Returns [0.0, 1.0] for how far through the total stacking the user has scrolled.
Returns [0.0, 1.0] for how far through the total stacking the user has scrolled.
(compute-stack-area-y container-h total-stack-h align)Compute the Y position of the stack area top within the container. container-h: container height (viewport), total-stack-h: sum of peeks + last card height, align: "top" | "center" | "bottom".
Compute the Y position of the stack area top within the container. container-h: container height (viewport), total-stack-h: sum of peeks + last card height, align: "top" | "center" | "bottom".
(compute-stacked-count scroll-offset child-count scroll-distance)Returns the integer count of fully stacked cards.
Returns the integer count of fully stacked cards.
(normalize {:keys [peek-raw rotation-raw scroll-distance-raw align-raw
disabled-attr]})Normalise raw attribute inputs into a stable view-model map.
Input keys: :peek-raw string | nil :rotation-raw string | nil :scroll-distance-raw string | nil :align-raw string | nil :disabled-attr string | nil
Output keys: :peek number :rotation number :scroll-distance number :align string :disabled? boolean
Normalise raw attribute inputs into a stable view-model map. Input keys: :peek-raw string | nil :rotation-raw string | nil :scroll-distance-raw string | nil :align-raw string | nil :disabled-attr string | nil Output keys: :peek number :rotation number :scroll-distance number :align string :disabled? boolean
(parse-align s)Parse align attribute. Returns "top", "center", or "bottom".
Parse align attribute. Returns "top", "center", or "bottom".
(parse-bool-attr s)Parse a boolean attribute (present = true).
Parse a boolean attribute (present = true).
(parse-positive-number s default)Parse a string to a positive number, returning default on failure.
Parse a string to a positive number, returning default on failure.
(stack-params card-index peek max-rotation)Returns {:stack-y :stack-rot :stack-x} for a card when fully stacked. stack-y is the peek offset (relative to stack top) for card at index.
Returns {:stack-y :stack-rot :stack-x} for a card when fully stacked.
stack-y is the peek offset (relative to stack top) for card at index.cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |