web-animation
Skill3 starsChanged 10 days agoMITView on GitHub
Activate this skill for UI motion, Framer Motion, GSAP, CSS keyframes, spring physics, or scroll-scrubbed animations. Use when crafting high-performance, accessible web animations, choreographed transitions, or interactive gestures.
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 35
Never read layout metrics (element.offsetHeight, getBoundingClientRect()) immediately after modifying DOM styles in an animation loop.
- Very specific: line 36
Use will-change: transform, opacity sparingly and only during active animation states.
- Very specific: line 76
Use layout and layoutId for smooth morphing transitions without calculating bounding boxes manually:
- Distinctive: line 93
Always bundle related sequence steps into GSAP timelines for precise scrubbing and playback control:
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Web Animation & Physics-Driven Motion
Scope: High-performance 60fps web motion, Framer Motion, GSAP ScrollTrigger, CSS hardware-accelerated transitions, spring physics, and accessible motion standards (
prefers-reduced-motion).
When to Activate
- Adding micro-interactions, page transitions, or modal reveals
- Implementing Framer Motion gesture and layout animations
- Building scroll-scrubbed timelines or pinned sections with GSAP ScrollTrigger
- Optimizing choppy animations, eliminating layout thrashing and jank
- Enforcing accessible reduced-motion compliance
- Crafting responsive, fluid motion across mobile and desktop
1. Performance & Hardware Acceleration Principles
The Golden Rule: Animate Composite Properties Only
To achieve consistent 60fps / 120fps animations, strictly restrict animations to properties handled by the browser's GPU compositor thread:
- Fast / GPU Accelerated:
transform(translate3d,scale,rotate),opacity. - Dangerous / Causes Reflow & Layout Thrashing:
width,height,top,left,margin,padding. - Causes Repaint:
color,background-color,box-shadow,border-radius.
Preventing Layout Thrash
- Never read layout metrics (
element.offsetHeight,getBoundingClientRect()) immediately after modifying DOM styles in an animation loop. - Use
will-change: transform, opacitysparingly and only during active animation states. Removewill-changeonce animation completes to prevent excessive GPU memory consumption.
2. Framer Motion Architecture (React)
Spring Physics Over Linear Easings
Real-world objects possess mass and momentum. Prefer physics-based spring curves over robotic linear or cubic-bezier easings for interactive elements:
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
transition={{
type: "spring",
stiffness: 350,
damping: 25,
mass: 0.8
}}
/>Choreographed Variants & Stagger
Encapsulate animation states into declarative variants to coordinate parent-child reveals:
const containerVariants = {
hidden: { opacity: 0 },
visible: {
opacity: 1,
transition: { staggerChildren: 0.08, delayChildren: 0.1 }
}
};
const itemVariants = {
hidden: { opacity: 0, y: 12 },
visible: { opacity: 1, y: 0, transition: { type: "spring", stiffness: 300, damping: 24 } }
};Layout Animations & Shared Element Transitions
Use layout and layoutId for smooth morphing transitions without calculating bounding boxes manually:
// Morphing active tab indicator
{isActive && (
<motion.div
layoutId="active-indicator"
className="absolute inset-0 rounded-lg bg-primary/10"
transition={{ type: "spring", bounce: 0.2, duration: 0.4 }}
/>
)}3. GSAP & ScrollTrigger Best Practices
Timeline Sequencing
Always bundle related sequence steps into GSAP timelines for precise scrubbing and playback control:
const tl = gsap.timeline({
scrollTrigger: {
trigger: "#feature-section",
start: "top top",
end: "+=1500",
scrub: 1,
pin: true,
anticipatePin: 1
}
});
tl.from(".feature-card", { y: 100, opacity: 0, stagger: 0.2 })
.to(".feature-graphic", { scale: 1.1, rotation: 5 }, "<");Cleanup & Memory Management
In modern single-page applications (React/Next.js/Vue), always clean up GSAP animations and ScrollTrigger instances on component unmount:
// React useEffect / useGSAP cleanup pattern
useEffect(() => {
const ctx = gsap.context(() => {
// animations here
}, containerRef);
return () => ctx.revert(); // Automatically kills tweens, ScrollTriggers, and resets inline styles
}, []);4. Accessibility: Mandatory Reduced Motion
Respect user motion sensitivities (prefers-reduced-motion: reduce) unconditionally:
CSS Implementation
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}Framer Motion Implementation
import { useReducedMotion } from "framer-motion";
export function AnimatedCard({ children }) {
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
initial={shouldReduceMotion ? { opacity: 0 } : { opacity: 0, y: 20 }}
animate={shouldReduceMotion ? { opacity: 1 } : { opacity: 1, y: 0 }}
transition={{ duration: shouldReduceMotion ? 0 : 0.4 }}
>
{children}
</motion.div>
);
}5. Verification Checklist
- Animations run at a rock-solid 60fps/120fps without dropping frames in DevTools Performance profile.
- Only
transformandopacityare animated during continuous movement. - No layout shifts (CLS = 0) caused by animated components.
prefers-reduced-motionis tested and gracefully disables intrusive motion.- All ScrollTrigger / interval listeners are properly disposed of on unmount.
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- bo-516/NiceDesign★ 1same 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 repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/always-on.mdcCursor rule
- 3d-visualsSkill
- agent-researchSkill
- api-architectureSkill
- assets-mediaSkill
- cavemanSkill
- cloudflare-expertSkill
- devops-cicdSkill
- firebase-expertSkill
- git-collaborationSkill
- gravitasSkill
- gsd-coreSkill
- llm-optimizationSkill
- mobile-engineeringSkill
- ponytailSkill
- postgres-ecosystemSkill
- security-auditorSkill
- sentry-expertSkill
- seo-marketingSkill
- state-managementSkill
- testing-qaSkill
- ui-ux-pro-maxSkill
- ux-researchSkill
- web-animationSkill
- web-gamedevSkill
- 3d-visualsSkill
- agent-researchSkill
- api-architectureSkill
- assets-mediaSkill
- cavemanSkill
- cloudflare-expertSkill
- devops-cicdSkill
- firebase-expertSkill
- git-collaborationSkill
- gravitasSkill
- gsd-coreSkill
- llm-optimizationSkill
- mobile-engineeringSkill
- ponytailSkill
- postgres-ecosystemSkill
- security-auditorSkill
- sentry-expertSkill
- seo-marketingSkill
- state-managementSkill
- testing-qaSkill
- ui-ux-pro-maxSkill
- ux-researchSkill
- web-gamedevSkill
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.

