Motion Extractor
The tooling captures. You interpret. The scripts collect evidence: screenshots, measured values and technology signals. Naming the effects, explaining them and proposing implementations is your job, done by looking at the frames.
Requirements: playwright-cli on PATH and Node ≥ 18.
Ground rules
-
Label what you write:
- fact: measured, or read from a live runtime object.
- detected: technology evidence.
- hypothesis: your interpretation or a suggestion.
The original implementation is "unknown" unless the runtime evidence shows it.
-
Never copy site code. Record parameters (durations, offsets, eases,
"top 80%"-style config). Write any suggested snippet yourself. -
Page code stays in the browser. Scripts are only string-searched inside the page. Nothing from the site runs in Node or the shell.
-
Write only to the destination you choose (
--out), normally inside the client project, for example<project>/references/motion/<site>/. Never write to global directories.
Workflow
Let SKILL be this skill's directory.
- Capture, which takes about 3–5 minutes for a long page:
The capture runs these stages: detect, idle (reload, first 6s), inventory, scroll sweep with screenshots, runtime config, hover probe and a mobile pass. It then writesnode "$SKILL/scripts/mx.mjs" run <url> --out <dest><dest>/EVIDENCE.md. Useful options:--settle 1200for heavily smoothed sites;--step-vh 0.33for finer steps;--skip idle,hover,mobilefor a quick pass;--keep-opento keep the browser session open for manual follow-ups;helplists every option.
- Read
<dest>/EVIDENCE.md. It lists technologies, ScrollTrigger rows, the intro table, the elements that changed while scrolling (each with frame references), hover changes and the mobile comparison. Check "Scroll capture" first: if the offsets are unreliable, rerun with a larger--settle. - Look at the frames cited for the most significant elements, usually 6–12 frames in total. Skip the rest. Compare consecutive
scroll-NNN.pngframes to see what moves. - Interpret. Group the elements into effects and name each one with references/patterns.md. When a number is ambiguous, follow the reading rules in references/methodology.md, or drive
playwright-clidirectly for a targeted check. The methodology reference includes examples. - Write
<dest>/MOTION.mdfollowing references/motion-md-template.md. For each effect, cover: the visual description, the elements, the trigger, the timing, the relation to scroll, the evidence, the suggested equivalent implementation, and performance and accessibility.
Output layout
<dest>/
├── MOTION.md # written by you
├── EVIDENCE.md # generated digest (facts + frame index)
├── frames/ # scroll-NNN.png, idle-NNNNNms.png, mobile-NNN.png
└── data/ # raw JSON from each probe (large; query with node -e, don't read whole)
To refresh the digest after a targeted re-run (mx.mjs sweep|hover|runtime|... <url> --out <dest>), run mx.mjs digest --out <dest>.
Limits
- Canvas, WebGL, video and Lottie content is opaque: only the element box is tracked.
- Values are sampled at discrete scroll positions. Durations are lower bounds. Easing is what you judge from the frames and samples, unless the runtime shows it.
- Elements that mount later, or only gain transforms later, may not be tracked. Re-run with
--keep-openand inspect them manually. - Analyzing a site is for learning its craft. Build something original; do not clone it.
Methodology credit: NOTICE.md.