Skip to content

Motion compare

Runs the same move three ways: a CSS transition, a linear requestAnimationFrame tween and a damped spring. Each run reads the dot's rendered position every frame and reports frames rendered, average and worst frame gap, overshoot count and settle time. Cells read 'not measured yet' until a run completes. Frame gaps come from rAF timestamps and reflect your display and page load, not the isolated cost of each approach. With reduced motion all three snap and nothing is measured.

  • Spring Physics
  • requestAnimationFrame
  • CSS Transition
  • prefers-reduced-motion

motion-compare

  • CSS transition

    transition: transform 700ms ease. The browser runs the curve.

    Frames
    not measured yet
    Avg frame
    not measured yet
    Worst frame
    not measured yet
    Overshoots
    not measured yet
    Settled at
    not measured yet
  • Linear rAF tween

    requestAnimationFrame, position = distance x elapsed / 700 ms.

    Frames
    not measured yet
    Avg frame
    not measured yet
    Worst frame
    not measured yet
    Overshoots
    not measured yet
    Settled at
    not measured yet
  • Spring physics

    Damped spring integrated each frame (the library's approach). No fixed duration.

    Frames
    not measured yet
    Avg frame
    not measured yet
    Worst frame
    not measured yet
    Overshoots
    not measured yet
    Settled at
    not measured yet

Every number is read in this browser during the run, from the dot's rendered position in each requestAnimationFrame. Frame gaps follow your display refresh and whatever else the page is doing, so they say little about the cost of each approach in isolation. Run it a few times; the values move.

Accessibility

Works with

Cursor
Reacts to where the pointer is, not just whether it's over the element.
Touch
Follows your finger while it's down, then settles a moment after you lift.
Keyboard
Focus lights it up the way the cursor does. Every action has a key.
Reduced motion
Nothing moves or springs. Colour still answers, without drifting.