Skip to main content
100%

elastic-snap

✓ Published0🌍 Public
11wheel
Last edited Aug 22, 2016
Created on Nov 19, 2015

A circle in an SVG canvas exhibits a spring-like snapping effect, moving toward the mouse cursor with an elastic, damped motion. The interaction invites exploration of how a physics parameter changes the behavior: vertical mouse position controls the speed cap, altering the circle's momentum and overshoot. The example uses a custom D3 timer loop to incrementally update velocity and position, applying a clamp function to limit speed based on distance, and renders the result as an animated SVG element.

AI-generated description

Playing around with parameters for a snapping effect

Similar vizzes