(compute-influence ix iy mx my radius)Linear distance falloff. Returns 1.0 when the cursor is at the item centre,
0.0 at or beyond radius, and decays linearly between.
(ix, iy) item centre, in track-relative coordinates (mx, my) cursor position, same coordinate space radius influence radius in px
Linear distance falloff. Returns 1.0 when the cursor is at the item centre, 0.0 at or beyond `radius`, and decays linearly between. (ix, iy) item centre, in track-relative coordinates (mx, my) cursor position, same coordinate space radius influence radius in px
(compute-lift influence cross-delta lift-max)Cross-axis translation (px) toward the cursor.
influence [0..1] cross-delta cursor offset on the cross-axis from item centre (negative when cursor is before, positive when after) lift-max capped magnitude (px)
Sign ramps linearly through the soft band around 0 so the direction doesn't snap when the cursor crosses the item's cross-axis centre.
Cross-axis translation (px) toward the cursor.
influence [0..1]
cross-delta cursor offset on the cross-axis from item centre
(negative when cursor is before, positive when after)
lift-max capped magnitude (px)
Sign ramps linearly through the soft band around 0 so the direction
doesn't snap when the cursor crosses the item's cross-axis centre.(compute-scale influence max-scale)Map an influence factor [0..1] to a scale factor in [1.0 .. max-scale]. Uses an influence^2 ramp so items close to the cursor swell more, and items on the periphery stay nearer their base size.
Map an influence factor [0..1] to a scale factor in [1.0 .. max-scale]. Uses an influence^2 ramp so items close to the cursor swell more, and items on the periphery stay nearer their base size.
(lerp current target speed)Linear interpolation: moves current toward target by speed (0..1).
At speed=0 nothing moves; at speed=1 the result equals target.
Linear interpolation: moves `current` toward `target` by `speed` (0..1). At speed=0 nothing moves; at speed=1 the result equals target.
(normalize {:keys [direction-raw radius-raw max-scale-raw lift-raw gap-raw
disabled-attr]})Normalise raw attribute inputs into a stable view-model map.
Input keys: :direction-raw string | nil :radius-raw string | nil :max-scale-raw string | nil :lift-raw string | nil :gap-raw string | nil :disabled-attr string | nil (presence-based boolean)
Output keys: :direction string ("horizontal" | "vertical") :radius number :max-scale number :lift number :gap number :disabled? boolean :vertical? boolean
Normalise raw attribute inputs into a stable view-model map.
Input keys:
:direction-raw string | nil
:radius-raw string | nil
:max-scale-raw string | nil
:lift-raw string | nil
:gap-raw string | nil
:disabled-attr string | nil (presence-based boolean)
Output keys:
:direction string ("horizontal" | "vertical")
:radius number
:max-scale number
:lift number
:gap number
:disabled? boolean
:vertical? boolean(parse-direction s)Parse direction attribute. Returns 'horizontal' (default) or 'vertical'.
Parse direction attribute. Returns 'horizontal' (default) or 'vertical'.
(parse-float-clamped s default-val lo hi)Parse a string to a float clamped in [lo, hi]. Returns default-val on failure.
Parse a string to a float clamped in [lo, hi]. Returns default-val on failure.
(select-detail index item source)Build event detail map for x-proximity-list-select.
Build event detail map for x-proximity-list-select.
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 |