loading code fetching the highlighted snippet
Setup staggers the list in from one side and adds a hover nudge. With matchMedia conditions, crossing 800px cancels the scope and runs setup again, so the list re-staggers from the other end.
matchMedia: { wide: '>=800', narrow: '<800' } — resize
the window across 800px and scope.media flips, setup runs again and the stagger
changes direction.animate() call passes only a delay. The spring comes from
the scope's default transition.hover('li', …) is collected by the scope, so each re-run replaces it instead
of stacking listeners.Scatter animates every tile inside the scope with run(). Reset calls cancel(): the springs stop and each tile’s inline style is restored, so they snap straight home.
cancel() stops everything in the scope and restores the style attribute of every element it animated. stop() would freeze
the tiles where they are instead.scope.current; wrapping
work in run() (or bind()) is what gets it collected.