Agent skill Web motion
Locomotive Scroll
Design or implement effects that respond to scrolling on a web page.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add https://github.com/freshtechbro/claudedesignskills/tree/main/plugins/bundles/extended-3d-scroll/skills/locomotive-scroll --skill locomotive-scroll --agent claude-code --yesCheck this file in your project.claude/skills/locomotive-scroll/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add https://github.com/freshtechbro/claudedesignskills/tree/main/plugins/bundles/extended-3d-scroll/skills/locomotive-scroll --skill locomotive-scrollSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. A browser-rendered gallery with normal window scrolling and an existing in-page link. Locomotive Scroll v5 workflow. The skill’s starter package declares v4.1.4 and uses the v4 wrapper conventions.
View operation manualWhat this skill helps with
- Design or implement effects that respond to scrolling on a web page.
Good for
- Scroll-driven storytelling
- Publisher
- FreshTechBro
- Compatibility
- Locomotive Scroll v5 workflow. The skill’s starter package declares v4.1.4 and uses the v4 wrapper conventions.
- Scenario
- Add restrained parallax to a gallery
- Skill name
locomotive-scroll- Repository
freshtechbro/claudedesignskills
Common pitfall
Avoid this prompt
Install current locomotive-scroll and copy the v4 starter’s constructor as-is.
The starter targets v4. The v5 rewrite configures wheel behavior through Lenis and uses a different setup.
Use these steps
- Confirm package major, native navigation, and the decorative target.
- Enable one decorative scroll effect, preserving native wheel scrolling and the reduced-motion fallback.
- Compare desktop, touch, and reduced motion, then leave and return to the route.
Hands-on walkthrough
Animate one decorative gallery image and test native navigation and the fallback settings.
Animate one decorative gallery image and test native navigation and the fallback settings.
Find the existing scroll owner
Confirm package major, native navigation, and the decorative target.
Prompt · Step 1Use Locomotive Scroll to inspect [gallery route]. Record the resolved library major if present, find which element owns scrolling, and record how the in-page link and keyboard scrolling currently work. Choose one decorative image inside a clipped frame for a v5 trial. Document the difference if the project uses the shipped v4 starter.Add a v5 instance
Enable one decorative scroll effect, preserving native wheel scrolling and the reduced-motion fallback.
Prompt · Step 2For the v5 window-scroll setup, import LocomotiveScroll from locomotive-scroll. Give only the gallery image data-scroll and a low data-scroll-speed such as 0.15. After the browser mounts, initialize new LocomotiveScroll({ lenisOptions: { smoothWheel: false } }) and follow the installed v5 usage guide for styles. Skip initialization in reduced-motion mode, clean up with destroy(), and restore any decoration styles your integration added.Verify native navigation and teardown
Compare desktop, touch, and reduced motion, then leave and return to the route.
- The chosen image moves on desktop while standard navigation still works.
- Touch and reduced motion retain a usable static gallery, and the route can remount.
Prompt · Step 3On a desktop wheel scroll, measure the decorative image offset before and after a short scroll. Test the existing hash link and keyboard scrolling, then check native touch and reduced-motion modes with the image static. Leave and return to the route to check for duplicate listeners and stale transforms. Report observed differences and the exact library version.
Workflow lookup
Use the documented calls with the version selected for the walkthrough.
Assign decorative parallaxAPI
- Command or reference
data-scroll · data-scroll-speed- Examples
- Set both on the chosen image and confirm movement in the real frame.
Tear down the route instanceAPI
- Command or reference
locomotiveScroll.destroy()- Examples
- Call when leaving the mounted piece that owns the instance.
FAQ
Does the bundled starter use the same major?
Its package.json targets v4.1.4. Follow the v5 usage and options documentation for the walkthrough’s window-scroll setup.
Where are the skill materials?
Open the project skill folder printed by the installer for SKILL.md and any bundled resources. The app’s runtime libraries are managed separately in its own package manifest.