Skip to content

components/scroll-to-bottom-blob-state

@fungi.computer/caps


@fungi.computer/caps / components/scroll-to-bottom-blob-state

ScrollDirection = "forward" | "reverse"

Direction used to interpret forward and column-reverse scroll geometry.


ScrollGeometry = Readonly<{ clientHeight: number; scrollHeight: number; scrollTop: number; }>

Host geometry needed to derive distance from the bottom edge.


ScrollFact = Readonly<{ distance: number; at: number; }>

A timestamped distance observation from the host scroller.


ScrollMotionState = Readonly<{ intensity: number; samples: readonly ScrollFact[]; }>

Pure controller state passed between scroll-fact updates.

const SCROLL_SETTLE_MS: 400 = 400

Quiet-period duration that returns the selector to rest, in milliseconds.


const SCROLL_WOBBLE_INTENSITY: number

Intensity boundary at which the visual begins wobbling.


const SCROLL_SHED_INTENSITY: number

Intensity boundary at which the visual begins shedding.

distanceToBottom(geometry, direction): number

Distance from the visual end, including column-reverse’s negative scrollTop.

ScrollGeometry

ScrollDirection

number


createScrollMotionState(): ScrollMotionState

Create a stable, idle controller state before the first host fact.

ScrollMotionState


stepScrollMotion(state, fact): ScrollMotionState

Advance the controller from one host scroll fact.

ScrollMotionState

ScrollFact

ScrollMotionState


settleScrollMotion(state): ScrollMotionState

The 400ms quiet period returns the controller to its stable presentation.

ScrollMotionState

ScrollMotionState