
Gsap Animations
- 2 installs
- 404 repo stars
- Updated August 5, 2026
- aiskillstore/marketplace
gsap-animations is a Claude Code skill of GSAP best practices for building performant, accessible web animations like scroll triggers, parallax, and reveals.
About
gsap-animations is a Claude Code skill covering GSAP animation best practices for web design. A developer uses it to implement scroll-triggered, staggered, parallax, and hero-timeline animations while keeping them performant and accessible. It stresses animating only transform and opacity, respecting prefers-reduced-motion, and providing responsive, JS-optional fallbacks, including a WordPress enqueue path.
- GSAP and ScrollTrigger patterns for scroll, stagger, and parallax
- Performance rules: animate transform/opacity for 60fps
- Accessibility via prefers-reduced-motion and CSS fallbacks
Gsap Animations by the numbers
- 2 all-time installs (skills.sh)
- Ranked #1,862 of 2,245 Frontend Development skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
gsap-animations capabilities & compatibility
- Capabilities
- scroll animation · parallax · reduced motion · responsive animation
- Use cases
- frontend · ui design · web design
What gsap-animations says it does
GSAP animation best practices for web design - scroll triggers, performance optimization, accessibility, responsive animations, and testing integration.
Animate `transform` and `opacity` only (GPU-accelerated)
npx skills add https://github.com/aiskillstore/marketplace --skill gsap-animationsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 2 |
|---|---|
| repo stars | ★ 404 |
| Last updated | August 5, 2026 |
| Repository | aiskillstore/marketplace ↗ |
What it does
Implement performant, accessible GSAP scroll and reveal animations on web pages.
Who is it for?
Adding performant, accessible GSAP animations to web pages, including WordPress themes.
Skip if: Non-web animation, video editing, or backend work.
When should I use this skill?
When implementing or reviewing GSAP/ScrollTrigger animations on a web project.
Files
GSAP Animation Best Practices
Comprehensive guide for implementing professional, accessible, and performant animations using GSAP (GreenSock Animation Platform).
Core Principles
1. Performance First
- Animate
transformandopacityonly (GPU-accelerated) - Avoid animating
width,height,top,left,margin,padding - Use
will-changesparingly - Target 60fps on all devices
2. Accessibility Always
- Respect
prefers-reduced-motion - Ensure content is visible without JavaScript
- Don't hide critical content behind animations
- Provide skip/pause controls for long animations
3. Progressive Enhancement
- Content must work without animations
- Animations enhance, not replace, functionality
- Test with animations disabled
---
GSAP Setup
Installation
<!-- CDN (recommended for WordPress) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js"></script>
<!-- Optional plugins -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollSmoother.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/SplitText.min.js"></script>WordPress Enqueue
function theme_enqueue_gsap() {
// GSAP Core
wp_enqueue_script(
'gsap',
'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/gsap.min.js',
array(),
'3.12.5',
true
);
// ScrollTrigger
wp_enqueue_script(
'gsap-scrolltrigger',
'https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.5/ScrollTrigger.min.js',
array('gsap'),
'3.12.5',
true
);
// Theme animations
wp_enqueue_script(
'theme-animations',
get_theme_file_uri('/assets/js/animations.js'),
array('gsap', 'gsap-scrolltrigger'),
filemtime(get_theme_file_path('/assets/js/animations.js')),
true
);
}
add_action('wp_enqueue_scripts', 'theme_enqueue_gsap');---
Animation Patterns
1. Fade In on Scroll
// Basic fade in
gsap.from('.fade-in', {
opacity: 0,
y: 50,
duration: 1,
stagger: 0.2,
scrollTrigger: {
trigger: '.fade-in',
start: 'top 80%',
toggleActions: 'play none none none'
}
});2. Staggered Elements
// Cards appearing one by one
gsap.from('.card', {
opacity: 0,
y: 100,
duration: 0.8,
stagger: {
amount: 0.6,
from: 'start'
},
ease: 'power2.out',
scrollTrigger: {
trigger: '.cards-container',
start: 'top 75%'
}
});3. Parallax Effect
// Subtle parallax on images
gsap.to('.parallax-image', {
yPercent: -20,
ease: 'none',
scrollTrigger: {
trigger: '.parallax-section',
start: 'top bottom',
end: 'bottom top',
scrub: true
}
});4. Text Reveal (Line by Line)
// Requires SplitText plugin (Club GreenSock)
// Or use CSS-based alternative below
// CSS Alternative - wrap each line in a span
gsap.from('.reveal-line', {
opacity: 0,
y: '100%',
duration: 0.8,
stagger: 0.1,
ease: 'power3.out',
scrollTrigger: {
trigger: '.text-reveal',
start: 'top 80%'
}
});5. Curtain/Mask Reveal
// Image revealed by sliding mask
gsap.to('.curtain-mask', {
scaleX: 0,
transformOrigin: 'right center',
duration: 1.2,
ease: 'power4.inOut',
scrollTrigger: {
trigger: '.curtain-container',
start: 'top 70%'
}
});6. Hero Animation Timeline
// Complex hero sequence
const heroTL = gsap.timeline({
defaults: { ease: 'power3.out' }
});
heroTL
.from('.hero-bg', { scale: 1.2, duration: 1.5 })
.from('.hero-title', { opacity: 0, y: 100, duration: 1 }, '-=1')
.from('.hero-subtitle', { opacity: 0, y: 50, duration: 0.8 }, '-=0.5')
.from('.hero-cta', { opacity: 0, y: 30, duration: 0.6 }, '-=0.3');---
Accessibility
Respect Reduced Motion
// Check user preference
const prefersReducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// Option 1: Disable all animations
if (prefersReducedMotion) {
gsap.globalTimeline.timeScale(0);
ScrollTrigger.getAll().forEach(st => st.kill());
}
// Option 2: Simplified animations
const animationConfig = prefersReducedMotion
? { duration: 0, stagger: 0 }
: { duration: 1, stagger: 0.2 };
gsap.from('.element', {
opacity: 0,
y: prefersReducedMotion ? 0 : 50,
...animationConfig
});CSS Fallback
/* Ensure content visible without JS */
.fade-in {
opacity: 1;
transform: translateY(0);
}
/* Only hide if animations will run */
.js .fade-in {
opacity: 0;
transform: translateY(50px);
}
/* Respect reduced motion in CSS too */
@media (prefers-reduced-motion: reduce) {
.js .fade-in {
opacity: 1;
transform: none;
}
}Add JS Class to HTML
// Add at start of script
document.documentElement.classList.add('js');---
Responsive Animations
Breakpoint-Aware Animations
// Create responsive animations
const mm = gsap.matchMedia();
mm.add('(min-width: 1024px)', () => {
// Desktop animations
gsap.from('.hero-image', {
x: 100,
opacity: 0,
duration: 1.2
});
return () => {
// Cleanup on breakpoint change
};
});
mm.add('(max-width: 1023px)', () => {
// Mobile animations (simpler)
gsap.from('.hero-image', {
opacity: 0,
duration: 0.8
});
});Refresh on Resize
// Recalculate ScrollTrigger on resize
let resizeTimer;
window.addEventListener('resize', () => {
clearTimeout(resizeTimer);
resizeTimer = setTimeout(() => {
ScrollTrigger.refresh();
}, 250);
});---
Performance Optimization
1. Use Transform Properties Only
// GOOD - GPU accelerated
gsap.to('.element', {
x: 100, // transform: translateX
y: 50, // transform: translateY
rotation: 45, // transform: rotate
scale: 1.2, // transform: scale
opacity: 0.5
});
// BAD - Causes layout/paint
gsap.to('.element', {
left: 100, // Triggers layout
width: '200px', // Triggers layout
marginTop: 50 // Triggers layout
});2. Batch Similar Animations
// Use batch for many similar elements
ScrollTrigger.batch('.card', {
onEnter: batch => gsap.to(batch, {
opacity: 1,
y: 0,
stagger: 0.1
}),
start: 'top 85%'
});3. Kill Unused ScrollTriggers
// Cleanup when navigating (SPA) or component unmount
function cleanup() {
ScrollTrigger.getAll().forEach(st => st.kill());
gsap.killTweensOf('*');
}4. Lazy Initialize
// Only initialize animations for visible sections
const observer = new IntersectionObserver((entries) => {
entries.forEach(entry => {
if (entry.isIntersecting) {
initSectionAnimations(entry.target);
observer.unobserve(entry.target);
}
});
}, { rootMargin: '100px' });
document.querySelectorAll('.animated-section').forEach(section => {
observer.observe(section);
});---
ScrollTrigger Best Practices
1. Proper Start/End Points
// Avoid common mistakes
ScrollTrigger.create({
trigger: '.section',
start: 'top 80%', // When top of trigger hits 80% from top of viewport
end: 'bottom 20%', // When bottom of trigger hits 20% from top
markers: true, // Debug only - remove in production!
});2. Pin Sections Carefully
// Pinning can cause layout issues
ScrollTrigger.create({
trigger: '.pinned-section',
start: 'top top',
end: '+=100%',
pin: true,
pinSpacing: true, // Usually want this true
anticipatePin: 1 // Helps with mobile
});3. Handle Images Loading
// Wait for images before calculating positions
ScrollTrigger.config({
ignoreMobileResize: true
});
window.addEventListener('load', () => {
ScrollTrigger.refresh();
});
// Or refresh after lazy images load
document.querySelectorAll('img[loading="lazy"]').forEach(img => {
img.addEventListener('load', () => ScrollTrigger.refresh());
});---
Testing Integration
Visual QA Compatibility
For the visual-qa skill to capture animations correctly:
// Expose function to complete all animations instantly
window.completeAllAnimations = function() {
gsap.globalTimeline.progress(1);
ScrollTrigger.getAll().forEach(st => {
st.scroll(st.end);
});
};
// Or skip animations entirely for screenshots
if (window.location.search.includes('skip-animations')) {
gsap.globalTimeline.timeScale(100);
}Playwright Testing
// In Playwright test
await page.evaluate(() => {
if (window.completeAllAnimations) {
window.completeAllAnimations();
}
});
await page.waitForTimeout(500);
await page.screenshot({ path: 'screenshot.png', fullPage: true });---
Common Animation Library
Reusable Animation Classes
// animations.js - Reusable animation library
const Animations = {
// Initialize all animations
init() {
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
return;
}
this.fadeIn();
this.slideIn();
this.parallax();
this.textReveal();
},
fadeIn() {
gsap.utils.toArray('[data-animate="fade-in"]').forEach(el => {
gsap.from(el, {
opacity: 0,
y: 50,
duration: 0.8,
scrollTrigger: {
trigger: el,
start: 'top 85%',
once: true
}
});
});
},
slideIn() {
gsap.utils.toArray('[data-animate="slide-left"]').forEach(el => {
gsap.from(el, {
opacity: 0,
x: -100,
duration: 1,
scrollTrigger: {
trigger: el,
start: 'top 80%',
once: true
}
});
});
gsap.utils.toArray('[data-animate="slide-right"]').forEach(el => {
gsap.from(el, {
opacity: 0,
x: 100,
duration: 1,
scrollTrigger: {
trigger: el,
start: 'top 80%',
once: true
}
});
});
},
parallax() {
gsap.utils.toArray('[data-parallax]').forEach(el => {
const speed = el.dataset.parallax || 0.2;
gsap.to(el, {
yPercent: -100 * speed,
ease: 'none',
scrollTrigger: {
trigger: el.parentElement,
start: 'top bottom',
end: 'bottom top',
scrub: true
}
});
});
},
textReveal() {
gsap.utils.toArray('[data-animate="text-reveal"]').forEach(el => {
const lines = el.querySelectorAll('.line');
gsap.from(lines, {
opacity: 0,
y: '100%',
duration: 0.8,
stagger: 0.1,
scrollTrigger: {
trigger: el,
start: 'top 80%',
once: true
}
});
});
},
// Refresh after dynamic content
refresh() {
ScrollTrigger.refresh();
},
// Cleanup for SPA navigation
destroy() {
ScrollTrigger.getAll().forEach(st => st.kill());
gsap.killTweensOf('*');
}
};
// Initialize on DOM ready
document.addEventListener('DOMContentLoaded', () => Animations.init());HTML Usage
<!-- Fade in -->
<div data-animate="fade-in">Content</div>
<!-- Slide from left -->
<div data-animate="slide-left">Content</div>
<!-- Parallax (0.2 = 20% speed) -->
<img data-parallax="0.3" src="image.jpg">
<!-- Text reveal (requires line wrapping) -->
<div data-animate="text-reveal">
<div class="line">First line</div>
<div class="line">Second line</div>
</div>---
Debugging
Enable Markers
ScrollTrigger.defaults({
markers: true // Shows start/end markers
});Log Animation Events
gsap.to('.element', {
x: 100,
onStart: () => console.log('Animation started'),
onComplete: () => console.log('Animation completed'),
onUpdate: self => console.log('Progress:', self.progress())
});Check for Issues
// List all ScrollTriggers
console.log('ScrollTriggers:', ScrollTrigger.getAll());
// Check if element exists
const el = document.querySelector('.animated-element');
if (!el) console.warn('Animation target not found!');---
Checklist
Before Launch
- [ ] Remove all
markers: true - [ ] Test with
prefers-reduced-motion: reduce - [ ] Test on mobile devices (real devices, not just DevTools)
- [ ] Check performance in DevTools Performance tab
- [ ] Verify 60fps on target devices
- [ ] Content visible without JavaScript
- [ ] Images lazy-loaded before ScrollTrigger refresh
- [ ] No layout thrashing (avoid animating layout properties)
Visual QA Integration
- [ ] Animations complete before screenshots
- [ ] Full-page scroll triggers all animations
- [ ] Screenshots capture final animated state
- [ ] Test at all viewport sizes
---
Resources
{
"schema_version": "2.0",
"meta": {
"generated_at": "2026-01-16T23:56:13.860Z",
"slug": "crazyswami-gsap-animations",
"source_url": "https://github.com/CrazySwami/wordpress-dev-skills/tree/main/skills/gsap-animations",
"source_ref": "main",
"model": "claude",
"analysis_version": "3.0.0",
"source_type": "community",
"content_hash": "062a8b433a9bec5896ee08748f28f5bd95269095ae5ddd3a5d21ed010e857da5",
"tree_hash": "cddf0a90b6b2ea1274beff89a67adc124017f508700d990c54dbb3f5720751f7"
},
"skill": {
"name": "gsap-animations",
"description": "GSAP animation best practices for web design - scroll triggers, performance optimization, accessibility, responsive animations, and testing integration. Use when implementing or reviewing animations on WordPress or any web project.",
"summary": "GSAP animation best practices for web design - scroll triggers, performance optimization, accessibil...",
"icon": "🎬",
"version": "1.0.0",
"author": "CrazySwami",
"license": "MIT",
"category": "design",
"tags": [
"animation",
"gsap",
"web-design",
"performance",
"accessibility"
],
"supported_tools": [
"claude",
"codex",
"claude-code"
],
"risk_factors": [
"network",
"external_commands"
]
},
"security_audit": {
"risk_level": "safe",
"is_blocked": false,
"safe_to_publish": true,
"summary": "This is a documentation-only skill containing GSAP animation best practices. No executable code, network calls, or file system access. Pure educational content with code examples for implementing animations safely. All 103 static findings are false positives - the scanner incorrectly flagged markdown code formatting backticks as shell execution and legitimate CDN URLs as hardcoded endpoints.",
"risk_factor_evidence": [
{
"factor": "network",
"evidence": [
{
"file": "skill-report.json",
"line_start": 6,
"line_end": 6
},
{
"file": "SKILL.md",
"line_start": 38,
"line_end": 38
},
{
"file": "SKILL.md",
"line_start": 39,
"line_end": 39
},
{
"file": "SKILL.md",
"line_start": 42,
"line_end": 42
},
{
"file": "SKILL.md",
"line_start": 43,
"line_end": 43
},
{
"file": "SKILL.md",
"line_start": 53,
"line_end": 53
},
{
"file": "SKILL.md",
"line_start": 62,
"line_end": 62
},
{
"file": "SKILL.md",
"line_start": 635,
"line_end": 635
},
{
"file": "SKILL.md",
"line_start": 636,
"line_end": 636
},
{
"file": "SKILL.md",
"line_start": 637,
"line_end": 637
},
{
"file": "SKILL.md",
"line_start": 638,
"line_end": 638
},
{
"file": "SKILL.md",
"line_start": 639,
"line_end": 639
}
]
},
{
"factor": "external_commands",
"evidence": [
{
"file": "SKILL.md",
"line_start": 14,
"line_end": 14
},
{
"file": "SKILL.md",
"line_start": 14,
"line_end": 14
},
{
"file": "SKILL.md",
"line_start": 15,
"line_end": 15
},
{
"file": "SKILL.md",
"line_start": 15,
"line_end": 15
},
{
"file": "SKILL.md",
"line_start": 15,
"line_end": 15
},
{
"file": "SKILL.md",
"line_start": 15,
"line_end": 15
},
{
"file": "SKILL.md",
"line_start": 15,
"line_end": 15
},
{
"file": "SKILL.md",
"line_start": 15,
"line_end": 15
},
{
"file": "SKILL.md",
"line_start": 16,
"line_end": 16
},
{
"file": "SKILL.md",
"line_start": 20,
"line_end": 20
},
{
"file": "SKILL.md",
"line_start": 36,
"line_end": 44
},
{
"file": "SKILL.md",
"line_start": 44,
"line_end": 48
},
{
"file": "SKILL.md",
"line_start": 48,
"line_end": 78
},
{
"file": "SKILL.md",
"line_start": 78,
"line_end": 86
},
{
"file": "SKILL.md",
"line_start": 86,
"line_end": 99
},
{
"file": "SKILL.md",
"line_start": 99,
"line_end": 103
},
{
"file": "SKILL.md",
"line_start": 103,
"line_end": 119
},
{
"file": "SKILL.md",
"line_start": 119,
"line_end": 123
},
{
"file": "SKILL.md",
"line_start": 123,
"line_end": 135
},
{
"file": "SKILL.md",
"line_start": 135,
"line_end": 139
},
{
"file": "SKILL.md",
"line_start": 139,
"line_end": 155
},
{
"file": "SKILL.md",
"line_start": 155,
"line_end": 159
},
{
"file": "SKILL.md",
"line_start": 159,
"line_end": 171
},
{
"file": "SKILL.md",
"line_start": 171,
"line_end": 175
},
{
"file": "SKILL.md",
"line_start": 175,
"line_end": 186
},
{
"file": "SKILL.md",
"line_start": 186,
"line_end": 194
},
{
"file": "SKILL.md",
"line_start": 194,
"line_end": 214
},
{
"file": "SKILL.md",
"line_start": 214,
"line_end": 218
},
{
"file": "SKILL.md",
"line_start": 218,
"line_end": 238
},
{
"file": "SKILL.md",
"line_start": 238,
"line_end": 242
},
{
"file": "SKILL.md",
"line_start": 242,
"line_end": 245
},
{
"file": "SKILL.md",
"line_start": 245,
"line_end": 253
},
{
"file": "SKILL.md",
"line_start": 253,
"line_end": 277
},
{
"file": "SKILL.md",
"line_start": 277,
"line_end": 281
},
{
"file": "SKILL.md",
"line_start": 281,
"line_end": 290
},
{
"file": "SKILL.md",
"line_start": 290,
"line_end": 298
},
{
"file": "SKILL.md",
"line_start": 298,
"line_end": 314
},
{
"file": "SKILL.md",
"line_start": 314,
"line_end": 318
},
{
"file": "SKILL.md",
"line_start": 318,
"line_end": 328
},
{
"file": "SKILL.md",
"line_start": 328,
"line_end": 332
},
{
"file": "SKILL.md",
"line_start": 332,
"line_end": 338
},
{
"file": "SKILL.md",
"line_start": 338,
"line_end": 342
},
{
"file": "SKILL.md",
"line_start": 342,
"line_end": 356
},
{
"file": "SKILL.md",
"line_start": 356,
"line_end": 364
},
{
"file": "SKILL.md",
"line_start": 364,
"line_end": 372
},
{
"file": "SKILL.md",
"line_start": 372,
"line_end": 376
},
{
"file": "SKILL.md",
"line_start": 376,
"line_end": 386
},
{
"file": "SKILL.md",
"line_start": 386,
"line_end": 390
},
{
"file": "SKILL.md",
"line_start": 390,
"line_end": 404
},
{
"file": "SKILL.md",
"line_start": 404,
"line_end": 414
},
{
"file": "SKILL.md",
"line_start": 414,
"line_end": 427
},
{
"file": "SKILL.md",
"line_start": 427,
"line_end": 431
},
{
"file": "SKILL.md",
"line_start": 431,
"line_end": 440
},
{
"file": "SKILL.md",
"line_start": 440,
"line_end": 448
},
{
"file": "SKILL.md",
"line_start": 448,
"line_end": 554
},
{
"file": "SKILL.md",
"line_start": 554,
"line_end": 558
},
{
"file": "SKILL.md",
"line_start": 558,
"line_end": 573
},
{
"file": "SKILL.md",
"line_start": 573,
"line_end": 581
},
{
"file": "SKILL.md",
"line_start": 581,
"line_end": 585
},
{
"file": "SKILL.md",
"line_start": 585,
"line_end": 589
},
{
"file": "SKILL.md",
"line_start": 589,
"line_end": 596
},
{
"file": "SKILL.md",
"line_start": 596,
"line_end": 600
},
{
"file": "SKILL.md",
"line_start": 600,
"line_end": 607
},
{
"file": "SKILL.md",
"line_start": 607,
"line_end": 615
},
{
"file": "SKILL.md",
"line_start": 615,
"line_end": 616
}
]
}
],
"critical_findings": [],
"high_findings": [],
"medium_findings": [],
"low_findings": [],
"dangerous_patterns": [],
"files_scanned": 2,
"total_lines": 817,
"audit_model": "claude",
"audited_at": "2026-01-16T23:56:13.860Z"
},
"content": {
"user_title": "Create smooth GSAP animations with accessibility",
"value_statement": "Web animations often fail accessibility tests and hurt performance. This skill provides production-ready GSAP patterns that respect user preferences and maintain 60fps.",
"seo_keywords": [
"GSAP animations",
"scroll trigger",
"web animation",
"Claude Code",
"accessibility",
"performance",
"GreenSock",
"WordPress animations",
"responsive design",
"60fps"
],
"actual_capabilities": [
"Provides GSAP animation code examples for fade-ins, parallax, and text reveals",
"Includes accessibility patterns for prefers-reduced-motion support",
"Offers WordPress integration examples with proper script enqueueing",
"Contains performance optimization techniques for 60fps animations",
"Provides testing integration for visual QA and Playwright"
],
"limitations": [
"Requires GSAP library installation via CDN or npm",
"Some advanced features need Club GreenSock membership",
"Code examples need adaptation to specific project structure",
"Performance testing requires actual device testing beyond DevTools"
],
"use_cases": [
{
"target_user": "WordPress developers",
"title": "Add scroll animations to themes",
"description": "Implement performant fade-ins and parallax effects in WordPress themes with proper script enqueueing and accessibility."
},
{
"target_user": "Frontend developers",
"title": "Optimize existing GSAP animations",
"description": "Refactor animations to use GPU-accelerated properties only and add reduced motion support for better accessibility."
},
{
"target_user": "QA engineers",
"title": "Test animated websites consistently",
"description": "Use provided testing helpers to capture screenshots at animation completion for visual regression testing."
}
],
"prompt_templates": [
{
"title": "Basic fade animation",
"scenario": "Adding simple fade-in to elements",
"prompt": "Create a GSAP fade-in animation for elements with class 'fade-in' that triggers when they enter the viewport. Include accessibility support for reduced motion."
},
{
"title": "Scroll-triggered parallax",
"scenario": "Implementing parallax scrolling effect",
"prompt": "Show me how to create a subtle parallax effect on images that moves them 20% slower than scroll. Make it performant and mobile-friendly."
},
{
"title": "WordPress integration",
"scenario": "Enqueueing GSAP in WordPress properly",
"prompt": "Provide the complete WordPress PHP code to properly enqueue GSAP and ScrollTrigger from CDN with theme animations file."
},
{
"title": "Animation performance audit",
"scenario": "Reviewing animation code for performance issues",
"prompt": "Analyze this GSAP animation code and identify any performance issues or properties that might cause layout thrashing: [paste code]"
}
],
"output_examples": [
{
"input": "Create a hero section animation with background scale, title fade, and subtitle slide",
"output": [
"Timeline-based animation sequence created",
"Uses GPU-accelerated properties (scale, opacity, y)",
"Includes accessibility check for reduced motion",
"Provides cleanup function for SPA navigation",
"Animation durations optimized for 60fps"
]
},
{
"input": "Add scroll-triggered cards that fade in one by one",
"output": [
"Staggered card animation configured",
"ScrollTrigger set to start at 75% viewport",
"Batch processing enabled for multiple cards",
"Cleanup function provided for component unmount"
]
}
],
"best_practices": [
"Always check prefers-reduced-motion before animating and provide alternatives",
"Use transform properties (x, y, scale, rotation) instead of layout properties (width, height, top, left)",
"Test animations on real mobile devices, not just browser DevTools"
],
"anti_patterns": [
"Animating width, height, or position properties that trigger layout recalculation",
"Using markers: true in production code - always remove debug markers",
"Creating animations without cleanup functions for single-page applications"
],
"faq": [
{
"question": "Is this compatible with all browsers?",
"answer": "GSAP works in all modern browsers. For IE11 support, use GSAP 3.x with polyfills for modern JavaScript features."
},
{
"question": "Do I need a Club GreenSock membership?",
"answer": "Core GSAP is free. Premium plugins like SplitText require membership, but the skill provides CSS alternatives."
},
{
"question": "Can I use this with React or Vue?",
"answer": "Yes, but wrap animations in useEffect (React) or lifecycle hooks (Vue) and cleanup in unmount to prevent memory leaks."
},
{
"question": "How do I integrate with existing WordPress themes?",
"answer": "Use the provided wp_enqueue_script examples in your theme's functions.php file and enqueue from a child theme for updates."
},
{
"question": "Why are my animations janky on mobile?",
"answer": "Ensure you are animating transform properties only, not layout properties. Also test on actual devices as simulators do not show real performance."
},
{
"question": "How do I debug ScrollTrigger positions?",
"answer": "Enable markers: true temporarily to visualize trigger points. Use console.log to check element positions and viewport calculations."
}
]
},
"file_structure": [
{
"name": "SKILL.md",
"type": "file",
"path": "SKILL.md",
"lines": 640
}
]
}
Related skills
FAQ
Which properties should I animate with GSAP for performance?
Animate transform and opacity only since they are GPU-accelerated; avoid width, height, top, left, margin, and padding.
How do I handle reduced-motion preferences?
Check prefers-reduced-motion and either disable animations or use simplified zero-duration configs, with a CSS fallback.