scroll-animations
Skill7 starsChanged 10 months agoMITView on GitHub
Scroll-triggered and scroll-linked animations for web interfaces. Use when implementing scroll-based reveals, parallax effects, progress indicators, scrubbing animations to scroll position, or viewport-aware stagger patterns. References GSAP ScrollTrigger, Intersection Observer API, and M3 motion tokens.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Kiddo4993/Claude-Skillstheir own version, first seen Nov 22, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Kiddo4993/Claude-Skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository87 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- motion-designSkill
- 3d-transformsSkill
- accessibilitySkill
- android-nativeSkill
- animation-recipesSkill
- anticipationSkill
- arc-motionSkill
- attention-choreographySkill
- attentionSkill
- audio-reactiveSkill
- blurSkill
- brand-animationSkill
- cameraSkill
- characterSkill
- choice-resolutionSkill
- cinematicSkill
- code-generationSkill
- colorSkill
- component-animationsSkill
- compositingSkill
- consequenceSkill
- container-transformSkill
- css-advancedSkill
- data-visualizationSkill
- depthSkill
- distortionSkill
- dramaturgySkill
- durationSkill
- easingSkill
- emotional-journeySkill
- emotion-mappingSkill
- emotion-selectionSkill
- empty-statesSkill
- entrance-patternsSkill
- exaggerationSkill
- exit-patternsSkill
- exportSkill
- figma-integrationSkill
- follow-throughSkill
- frame-timingSkill
- gesture-motionSkill
- glow-shadowSkill
- intentSkill
- ios-nativeSkill
- loading-statesSkill
- loopingSkill
- lottieSkill
- masksSkill
- microstateSkill
- morphingSkill
- motion-auditSkill
- motion-blurSkill
- motion-principlesSkill
- motion-specsSkill
- narrative-arcSkill
- notificationsSkill
- onboardingSkill
- opacitySkill
- orchestratorSkill
- The first 60 shown.
The file
Files
Scroll Animations
Scroll-triggered and scroll-linked motion patterns.
Standards Reference
| Tool/API | Documentation |
| GSAP ScrollTrigger | gsap.com/docs/v3/Plugins/ScrollTrigger |
| Intersection Observer | developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API |
| CSS scroll-driven | developer.mozilla.org/en-US/docs/Web/CSS/CSS_scroll-driven_animations |
Two Types of Scroll Animation
| Type | Behavior | Use Case |
| Scroll-triggered | Animation plays when element enters viewport | Reveal animations, stagger |
| Scroll-linked | Animation progress tied to scroll position | Parallax, scrubbing, progress |
Scroll-Triggered (Reveal on Scroll)
Intersection Observer (Vanilla JS)
const observer = new IntersectionObserver(
(entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
entry.target.classList.add('visible');
observer.unobserve(entry.target); // Once only
}
});
},
{ threshold: 0.2, rootMargin: '0px 0px -50px 0px' }
);
document.querySelectorAll('.animate-on-scroll').forEach(el => {
observer.observe(el);
});.animate-on-scroll {
opacity: 0;
transform: translateY(20px);
transition: opacity 250ms cubic-bezier(0.05, 0.7, 0.1, 1),
transform 250ms cubic-bezier(0.05, 0.7, 0.1, 1);
}
.animate-on-scroll.visible {
opacity: 1;
transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
.animate-on-scroll {
opacity: 1;
transform: none;
transition: none;
}
}GSAP ScrollTrigger (Triggered)
import gsap from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
gsap.registerPlugin(ScrollTrigger);
gsap.from('.card', {
opacity: 0,
y: 30,
duration: 0.25, // medium-1
ease: 'cubic-bezier(0.05, 0.7, 0.1, 1)', // emphasized-decelerate
stagger: 0.05,
scrollTrigger: {
trigger: '.card-grid',
start: 'top 80%', // When top of trigger hits 80% of viewport
toggleActions: 'play none none none'
}
});Scroll-Linked (Scrubbing)
GSAP ScrollTrigger (Scrub)
gsap.to('.progress-bar', {
scaleX: 1,
ease: 'none', // Linear for scroll-linked
scrollTrigger: {
trigger: 'body',
start: 'top top',
end: 'bottom bottom',
scrub: true // Links animation to scroll position
}
});Parallax
gsap.to('.parallax-bg', {
y: -100,
ease: 'none',
scrollTrigger: {
trigger: '.hero',
start: 'top top',
end: 'bottom top',
scrub: true
}
});Viewport-Aware Stagger
Prioritize above-the-fold content for faster perceived load.
const cards = gsap.utils.toArray('.card');
// Determine which cards are above the fold
const foldPosition = window.innerHeight;
const aboveFold = cards.filter(card =>
card.getBoundingClientRect().top < foldPosition
);
const belowFold = cards.filter(card =>
card.getBoundingClientRect().top >= foldPosition
);
// Phase 1: Above fold — faster, tighter stagger
gsap.from(aboveFold, {
opacity: 0,
y: 16,
duration: 0.2, // short-4
ease: 'cubic-bezier(0.05, 0.7, 0.1, 1)',
stagger: 0.04 // Tighter
});
// Phase 2: Below fold — triggered on scroll
gsap.from(belowFold, {
opacity: 0,
y: 16,
duration: 0.25, // medium-1
ease: 'cubic-bezier(0.05, 0.7, 0.1, 1)',
stagger: 0.05,
scrollTrigger: {
trigger: belowFold[0],
start: 'top 85%'
}
});Reduced Motion
Critical: Scroll animations often trigger vestibular issues.
const prefersReduced = window.matchMedia(
'(prefers-reduced-motion: reduce)'
).matches;
if (prefersReduced) {
// Option 1: Disable all scroll animations
ScrollTrigger.getAll().forEach(st => st.kill());
gsap.set('.animate', { opacity: 1, y: 0 });
// Option 2: Keep reveals, remove parallax
// Reveals are OK (fade only), parallax is not
}Safe vs. Unsafe Scroll Animations
| Safe (Reduced Motion OK) | Unsafe (Disable) |
| Fade on scroll | Parallax |
| Progress indicator | Horizontal scroll hijack |
| Simple reveal | Zoom on scroll |
| Sticky headers | 3D transforms |
Performance
- Use
will-changesparingly - Animate transforms/opacity only — avoid layout properties
- Use
scrub: truenotscrub: 0.5for smoother scrubbing - Batch observers — one observer for multiple elements
- Kill ScrollTriggers on unmount (React/SPA)
// React cleanup
useEffect(() => {
const ctx = gsap.context(() => {
// ScrollTrigger animations here
});
return () => ctx.revert(); // Cleanup
}, []);See references/scrolltrigger-patterns.md for advanced GSAP patterns.
See references/intersection-observer.md for vanilla JS patterns.
See references/scrubbing-media.md for Lottie/video scrubbing.
See references/parallax.md for parallax with accessibility.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

