(compute-scroll-progress scroll-top scroll-height client-height)Compute scroll progress [0,1] for a scroll container.
Compute scroll progress [0,1] for a scroll container.
(compute-scroll-velocity current-scroll last-scroll dt)Compute normalised scroll velocity [0,1]. 0 = stationary, 1 = fast scrolling (~2000 px/s).
Compute normalised scroll velocity [0,1]. 0 = stationary, 1 = fast scrolling (~2000 px/s).
(horizontal-wave-path-d fill-x width height t amplitude phase)Generate SVG path d-string for horizontal fill (fills left to right). fill-x = X coordinate of the liquid surface at rest. width, height = SVG viewport dimensions.
Generate SVG path d-string for horizontal fill (fills left to right). fill-x = X coordinate of the liquid surface at rest. width, height = SVG viewport dimensions.
(layer-params i n)Compute per-layer rendering and physics parameters. i = layer index (0 = back, n-1 = front), n = total layers.
Compute per-layer rendering and physics parameters. i = layer index (0 = back, n-1 = front), n = total layers.
(lerp current target speed)Linear interpolation from current toward target at given speed (0-1).
Linear interpolation from current toward target at given speed (0-1).
(normalize {:keys [target-raw orientation-raw mode-raw theme-raw
wave-intensity-raw splash-intensity-raw layers-raw
disabled-attr]})Normalise raw attribute inputs into a stable view-model map.
Input keys: :target-raw string | nil :orientation-raw string | nil :mode-raw string | nil :theme-raw string | nil :wave-intensity-raw string | nil :splash-intensity-raw string | nil :layers-raw string | nil :disabled-attr string | nil
Output keys: :target string | nil :orientation string :mode string :theme string :wave-intensity number :splash-intensity number :layers integer :disabled? boolean
Normalise raw attribute inputs into a stable view-model map. Input keys: :target-raw string | nil :orientation-raw string | nil :mode-raw string | nil :theme-raw string | nil :wave-intensity-raw string | nil :splash-intensity-raw string | nil :layers-raw string | nil :disabled-attr string | nil Output keys: :target string | nil :orientation string :mode string :theme string :wave-intensity number :splash-intensity number :layers integer :disabled? boolean
(parse-disabled s)Parse disabled attribute. Present (any value) → true, nil → false.
Parse disabled attribute. Present (any value) → true, nil → false.
(parse-layers s)Parse layers attribute to integer 2-5, default 3.
Parse layers attribute to integer 2-5, default 3.
(parse-mode s)Normalise mode attribute. Unknown/nil → "fill".
Normalise mode attribute. Unknown/nil → "fill".
(parse-orientation s)Normalise orientation attribute. Unknown/nil → "vertical".
Normalise orientation attribute. Unknown/nil → "vertical".
(parse-theme s)Normalise theme attribute. Unknown/nil → "gold".
Normalise theme attribute. Unknown/nil → "gold".
(progress->fill-x progress width)Convert progress [0,1] to fill-x for horizontal orientation. progress 0 = empty (fill-x = 0), progress 1 = full (fill-x = width).
Convert progress [0,1] to fill-x for horizontal orientation. progress 0 = empty (fill-x = 0), progress 1 = full (fill-x = width).
(progress->fill-y progress height)Convert progress [0,1] to fill-y (SVG Y coordinate for liquid surface). progress 0 = empty (fill-y = height), progress 1 = full (fill-y = 0).
Convert progress [0,1] to fill-y (SVG Y coordinate for liquid surface). progress 0 = empty (fill-y = height), progress 1 = full (fill-y = 0).
(progress-detail progress velocity)Build event detail map for x-liquid-fill-progress.
Build event detail map for x-liquid-fill-progress.
(spring-step current target velocity dt stiffness damping)Single step of damped spring physics (1D). Returns #js [new-position new-velocity].
Single step of damped spring physics (1D). Returns #js [new-position new-velocity].
(wave-path-d fill-y width height t amplitude phase)Generate an SVG path d-string for a single wave layer (vertical fill). fill-y = Y coordinate of the liquid surface at rest (0 = top, height = bottom). width, height = SVG viewport dimensions. t, amplitude, phase = wave animation parameters.
Generate an SVG path d-string for a single wave layer (vertical fill). fill-y = Y coordinate of the liquid surface at rest (0 = top, height = bottom). width, height = SVG viewport dimensions. t, amplitude, phase = wave animation parameters.
(wave-y x t amplitude phase)Compute wave surface Y displacement at normalised position x [0,1]. Uses sum-of-sines with integer-cycle frequencies so the wave is balanced (same height at left and right edges). Amplitude in pixels. t = accumulated time, phase = layer phase offset.
Compute wave surface Y displacement at normalised position x [0,1]. Uses sum-of-sines with integer-cycle frequencies so the wave is balanced (same height at left and right edges). Amplitude in pixels. t = accumulated time, phase = layer phase offset.
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 |