A loop that always requests another animation frame may keep doing work after the surface looks still. This glass effect wakes only when input changes its target and no frame is already pending.

Settling depends on both velocity and remaining distance. Distance alone can reach zero as a spring passes its target. Ripples add their remaining energy to the check. Once settled, the component paints a final state and clears its frame ID.

Leaving the viewport, hiding the document, or disposing of the component cancels the task. A reduced-motion preference changed during use must stop it too; checking only at startup is insufficient.

Returning to a visible page restores a still image and waits for new input. Cleanup also disconnects observers and event listeners.

For a concrete acceptance check, record performance after the ripple settles. Confirm that the component no longer schedules recurring frame callbacks, then switch tabs and change the motion preference to check cancellation.

References: Page Visibility API, reduced motion preferences.