GODRICH
#css-animation#button#loader#transition#scroll#dashboard#ui#design-trends

03Drag inertia — tracking pointer velocity, then decaying it with an exponential glide

Record instantaneous velocity from pointermove deltas, then from release multiply it by a decay factor like 0.9 each frame and add to position — a skate-on-ice glide. Below a velocity threshold it stops, and the track limits clamp the value.

Best forVolume control, timeline scrubbing

requestAnimationFramepointermoveCSS custom properties
Drag inertia — tracking pointer velocity, then decaying it with an exponential glide
Open in a new tab

03 Drag inertia — tracking pointer velocity, then decaying it with an exponential glide — Measured area 1.847% · moving frames 19/23Original by GODRICH · SCSS and React ship in the zip · CSS Range Slider: 9 Physics-Grade Custom Sliders

The post this demo lives in

CSS Range Slider: 9 Physics-Grade Custom Sliders - preview of all 9 demosCSS Range Slider: 9 Physics-Grade Custom SlidersA css range slider, explained: A velocity lerp decays your drag to rest, and a spring overshoots the thumb on each value See all demos in this post

If you like this effect - similar demos