How hsnaydd/moveto works
MoveTo is a small, dependency-free JavaScript library for animated scrolling. A consumer creates an instance and either calls move directly or registers a DOM trigger; trigger clicks resolve a target and apply options from data attributes before starting the same animation. The animation reads the container’s scroll position, applies an easing function over animation frames, scrolls toward the target, and calls the completion callback. Runtime behavior is concentrated in src/moveTo.js; edges reflect its shown calls and the README’s documented API.
Main entry points: moveTo.js Scroll animation
Components 7
Other components
- Library consumer
- MoveTo API
src/moveTo.js - DOM triggers
src/moveTo.js - Scroll options
src/moveTo.js - Scroll animation
src/moveTo.js - Easing functions
src/moveTo.js - Browser DOM and window
Connections 10
- Library consumer → MoveTo API: calls move or registers
README.md - MoveTo API → DOM triggers: registers click
src/moveTo.js - DOM triggers → Scroll options: reads data options
src/moveTo.js - DOM triggers → Scroll animation: starts on click
src/moveTo.js - MoveTo API → Scroll animation: starts move
src/moveTo.js - Scroll animation → Scroll options: uses settings
src/moveTo.js - Scroll animation → Easing functions: applies easing
src/moveTo.js - DOM triggers → Browser DOM and window: attaches listener
src/moveTo.js - Scroll animation → Browser DOM and window: reads and scrolls
src/moveTo.js - Scroll animation → Browser DOM and window: requests frames
src/moveTo.js