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

07Edge autoscroll — an rAF loop mapping edge distance into scroll speed

Once the pointer enters the inner 40px band near a container's top or bottom edge during a drag, an requestAnimationFrame loop normalizes the remaining distance to that edge into 0-1, multiplies it by a max speed, and feeds the result to scrollBy every frame. Scrolling speeds up the closer it gets to the edge, and the loop stops the instant it leaves the band.

Best forLong lists, admin tables

requestAnimationFramescrollBygetBoundingClientRect
Edge autoscroll — an rAF loop mapping edge distance into scroll speed
Open in a new tab

07 Edge autoscroll — an rAF loop mapping edge distance into scroll speed — Measured area 41.662% · moving frames 12/23Original by GODRICH · SCSS and React ship in the zip · Drag to Reorder UI: 9 Lists, One Drop Index

The post this demo lives in

Drag to Reorder UI: 9 Lists, One Drop Index - preview of all 9 demosDrag to Reorder UI: 9 Lists, One Drop IndexDrag to reorder UI: Computing the drop index from pointer position reorders lists, kanban boards and grids -- with long- See all demos in this post

If you like this effect - similar demos