(compute-overall-progress container-top container-height viewport-height)Compute scroll progress [0,1] for the entire steps container. 0 = container just entered at the bottom, 1 = about to leave at the top.
Compute scroll progress [0,1] for the entire steps container. 0 = container just entered at the bottom, 1 = about to leave at the top.
(compute-step-progress step-top step-height trigger-y)Compute how far a step has moved through the viewport. 0 = step bottom just reached trigger line, 1 = step top passed it.
Compute how far a step has moved through the viewport. 0 = step bottom just reached trigger line, 1 = step top passed it.
(find-active-step step-rects trigger-y)Given a vector of {:top :bottom} rects and a trigger-y position (pixels from the top of the viewport), return the index of the active step or -1.
A step is active when it spans the trigger line (top <= trigger-y < bottom). If no step spans it, the last step whose top is above the trigger line wins.
Given a vector of {:top :bottom} rects and a trigger-y position (pixels
from the top of the viewport), return the index of the active step or -1.
A step is active when it spans the trigger line (top <= trigger-y < bottom).
If no step spans it, the last step whose top is above the trigger line wins.(normalize {:keys [layout-raw threshold-raw split-raw disabled-attr label-raw
autoplay-attr autoplay-speed-raw autoplay-loop-attr
autoplay-indicator-attr]})Normalise raw attribute inputs into a stable view-model map.
Input keys: :layout-raw string | nil :threshold-raw string | nil :split-raw string | nil :disabled-attr string | nil (hasAttribute) :label-raw string | nil :autoplay-attr string | nil :autoplay-speed-raw string | nil :autoplay-loop-attr string | nil :autoplay-indicator-attr string | nil
Output keys: :layout string — "left" | "right" | "top" :threshold number — [0,1] :split number — [0.1,0.9] :disabled? boolean :label string :autoplay? boolean :autoplay-speed number — [1,1000] :autoplay-loop? boolean :autoplay-indicator? boolean
Normalise raw attribute inputs into a stable view-model map. Input keys: :layout-raw string | nil :threshold-raw string | nil :split-raw string | nil :disabled-attr string | nil (hasAttribute) :label-raw string | nil :autoplay-attr string | nil :autoplay-speed-raw string | nil :autoplay-loop-attr string | nil :autoplay-indicator-attr string | nil Output keys: :layout string — "left" | "right" | "top" :threshold number — [0,1] :split number — [0.1,0.9] :disabled? boolean :label string :autoplay? boolean :autoplay-speed number — [1,1000] :autoplay-loop? boolean :autoplay-indicator? boolean
(parse-autoplay-speed s)Parse autoplay-speed attribute to a positive number clamped to [1,1000]. Default 50 px/s.
Parse autoplay-speed attribute to a positive number clamped to [1,1000]. Default 50 px/s.
(parse-bool-attr s)Standard HTML boolean attribute: present (non-nil) = true, absent (nil) = false.
Standard HTML boolean attribute: present (non-nil) = true, absent (nil) = false.
(parse-layout s)Normalise layout attribute to "left", "right", or "top". Unknown / nil values fall back to "left".
Normalise layout attribute to "left", "right", or "top". Unknown / nil values fall back to "left".
(parse-split s)Parse split attribute to a float clamped to [0.1,0.9]. Default 0.5.
Parse split attribute to a float clamped to [0.1,0.9]. Default 0.5.
(parse-threshold s)Parse threshold attribute to a float clamped to [0,1]. Default 0.5.
Parse threshold attribute to a float clamped to [0,1]. Default 0.5.
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 |