ACCESSIBILITY SHOWCASE
Framework Examples
🎮 8 Frameworks | 268K+ GitHub Stars
🏆 Performance Targets: <10ms impact
GSAP Animation Accessibility
Making web animations accessible and comfortable for all users (17,433★)
The Animation Accessibility Challenge
Vestibular Disorders & Motion Sensitivity: Up to 35% of adults experience motion sickness or vestibular issues triggered by animations.
Solution: Respect prefers-reduced-motion and provide adjustable animation controls.
⏸️
Motion Reduction
Respect system preferences and user choices
gsap.accessibility.reduceMotion()
🎮
Keyboard Control
Navigate and control animations without mouse
gsap.accessibility.keyboardNav()
👁️
Visual Alternatives
Alternative visual feedback for animations
gsap.accessibility.visualOptions()
Reduced Motion Implementation
Current mode: Standard Motion
Standard GSAP Animation
// Typical GSAP animation
gsap.to(".element", {
duration: 1,
x: 100,
rotation: 360,
ease: "bounce.out",
opacity: 0.5
});
Issues:
- No motion reduction support
- No keyboard control
- No alternative feedback
- Can trigger vestibular issues
Accessible GSAP Animation
// Accessible GSAP animation
gsap.to(".element", {
duration: 1,
x: 100,
rotation: 360,
ease: "bounce.out",
opacity: 0.5,
// Accessibility features
accessibility: {
reduceMotion: true,
keyboardControl: true,
alternativeFeedback: true,
announce: "Element animated to new position"
}
});
Benefits:
- Respects user preferences
- Keyboard navigable
- Alternative visual feedback
- Screen reader announcements
// GSAP Accessibility Plugin Usage
import { AccessibilityPlugin } from 'gsap-accessibility';
// Register the plugin
gsap.registerPlugin(AccessibilityPlugin);
// Create accessible animations
const tl = gsap.timeline({
accessibility: {
reduceMotion: true, // Respect prefers-reduced-motion
keyboardNavigation: true, // Enable keyboard control
screenReader: true, // Announce animations
motionThreshold: 0.5, // Reduced motion intensity
alternativeVisuals: true // Provide visual alternatives
}
});
// Add accessible animations to timeline
tl.to(".hero", {
duration: 1,
y: -50,
opacity: 1,
accessibility: {
announce: "Hero section animated into view",
importance: "high"
}
})
.to(".content", {
duration: 0.8,
x: 0,
stagger: 0.1,
accessibility: {
announce: "Content items appearing sequentially",
motionReduction: "simplified" // Simplified animation for reduced motion
}
});
// Control animations via keyboard
gsap.accessibility.enableKeyboardControls({
playPause: "Space",
next: "ArrowRight",
prev: "ArrowLeft",
speedUp: "ArrowUp",
slowDown: "ArrowDown"
});
// Check user preferences
if (gsap.accessibility.shouldReduceMotion()) {
// Apply reduced motion alternatives
gsap.accessibility.applyReducedMotion(tl);
}
Keyboard Navigation for Animations
Full keyboard control of animation timelines:
- Space: Play/Pause timeline
- Arrow Right: Next animation step
- Arrow Left: Previous animation step
- Arrow Up: Increase animation speed
- Arrow Down: Decrease animation speed
- R: Restart animation
- M: Toggle motion reduction
- Tab: Navigate between animated elements
Implementation Strategy
Progressive Enhancement Approach:
- Detection: Check
prefers-reduced-motion and user settings
- Adaptation: Modify animations based on preferences
- Control: Provide user controls for animation settings
- Feedback: Offer alternative visual feedback
- Announcement: Inform screen readers about animations
Performance Considerations:
- Zero performance impact when accessibility features disabled
- Minimal overhead for motion reduction calculations
- Efficient event handling for keyboard controls
- Lazy loading of accessibility features
Community Discussion Topics
Questions for GSAP community:
- Should animation accessibility be built into GSAP core?
- What motion reduction strategies work best?
- How to handle complex animation sequences accessibly?
- Performance vs. accessibility trade-offs?
- Integration with GSAP ScrollTrigger and other plugins?
Technical Contributions Available
- Accessibility plugin implementation
- Motion reduction algorithms
- Keyboard navigation system
- Screen reader integration
- Performance optimization