Drag the balls and let go. All four follow your drag, so the only difference is how each library springs the ball back. Motion and Anime have springs built in: you give them stiffness and damping. GSAP has a springy elastic ease, but nothing that takes stiffness and damping, so I work out the spring myself and give it the curve. CSS can't do springs at all, so it fakes one with a single bounce. Move the damping slider and watch which ones change.
Drag anywhere on the fields.Drag any ball. All four follow together.
0, 0 PX
/* CSS doesn't do springs. This is what I used instead: one line, one bounce past the target. The duration changes to match how long the real spring takes to settle, but the bounce is always the same shape. Obviously CSS doesn't have a place for damping, so it doesn't apply here. */ .ball { transition: translate 767ms cubic-bezier(0.34, 1.56, 0.64, 1); } /* On release, go back to 0. The ease adds the bounce. */ .ball.released { translate: 0px 0px; }
It's one line from an easing cheat sheet, with no maths and no build step. It looks springy enough, and it only animates translate, so it runs off the main thread, like the bounce.
It isn't really a spring. It bounces once, in a shape I picked by eye, and there's nowhere to put stiffness or damping, so the damping slider moves the other three and leaves this one alone. Real physics means solving it in JS and pasting in a hundred numbers.
One overshoot ease, duration matched by eye
Loading engines…