npx skills add ...
npx skills add freshtechbro/claudedesignskills --skill locomotive-scroll
Comprehensive skill for Locomotive Scroll smooth scrolling library with parallax effects, viewport detection, and scroll-driven animations. Use this skill when implementing smooth scrolling experiences, creating parallax effects, building scroll-triggered animations, or developing immersive scrolling websites. Triggers on tasks involving Locomotive Scroll, smooth scrolling, parallax, scroll detection, scroll events, sticky elements, horizontal scrolling, or GSAP ScrollTrigger integration. Integrates with GSAP for advanced scroll-driven animations.
npx skills add freshtechbro/claudedesignskills --skill locomotive-scroll
Comprehensive guide for implementing smooth scrolling, parallax effects, and scroll-driven animations using Locomotive Scroll.
Locomotive Scroll is a JavaScript library that provides:
When to use Locomotive Scroll:
Trade-offs:
Every Locomotive Scroll implementation requires specific data attributes:
| Attribute | Purpose | Example |
|---|---|---|
data-scroll | Enable detection | data-scroll |
data-scroll-speed | Parallax speed | data-scroll-speed="2" |
data-scroll-direction | Parallax axis | data-scroll-direction="horizontal" |
data-scroll-sticky | Sticky positioning | data-scroll-sticky |
data-scroll-target | Sticky boundary | data-scroll-target="#section" |
data-scroll-offset | Trigger offset | data-scroll-offset="20%" |
data-scroll-repeat | Repeat detection | data-scroll-repeat |
data-scroll-call | Event trigger | data-scroll-call="myFunction" |
data-scroll-id | Unique identifier | data-scroll-id="hero" |
data-scroll-class | Custom class | data-scroll-class="is-visible" |
Locomotive Scroll and GSAP ScrollTrigger work together for advanced animations:
data-scroll-section to segment long pages:Limit parallax elements - Too many can impact performance
Disable on mobile if performance is poor:
Problem: position: fixed elements break with smooth scroll
Solution: Use data-scroll-sticky instead or add fixed elements outside container:
Problem: All images load at once
Solution: Integrate with lazy loading:
Problem: Dynamic content doesn't update scroll positions
Solution: Call update() after DOM changes:
Problem: Screen readers and keyboard navigation broken
Solution: Provide disable option:
Problem: Scroll instance not cleaned up on route changes (SPAs)
Solution: Always destroy on unmount:
Problem: Parallax elements overlap incorrectly
Solution: Set explicit z-index on parallax layers:
generate_config.py - Configuration generator, integration_helper.py - GSAP integration codeapi_reference.md - Complete API, gsap_integration.md - GSAP ScrollTrigger patternsstarter_locomotive/ - Complete starter template with examples