A WordPress plugin that adds animation classes to blocks on scroll. Simple and flexible - no dependencies, no build process!
The plugin adds two classes to enabled blocks:
gds-block-animations-block- Added immediately when page loadsgds-animate-visible- Added when block enters viewport (with 50ms delay for blocks already visible on load)
You style the animations in your theme CSS!
- ✨ Pure PHP, CSS, and JS - no build tools needed
- 🎨 Simple class-based system - style animations in your theme
- 📱 Respects user's motion preferences
- 🎯 Admin settings page to enable/disable per block
- 🚀 Performant using IntersectionObserver API
- ♿ Accessibility-friendly
- Activate the plugin through the 'Plugins' menu in WordPress
- Go to Settings → GDS Animate to enable blocks
- Add animation styles in your theme CSS
- Navigate to Settings → GDS Animate in WordPress admin
- Browse all available blocks grouped by category:
- Text - Paragraph, Heading, List, etc.
- Media - Image, Gallery, Video, Audio, etc.
- Design - Button, Columns, Group, Spacer, etc.
- Widgets - Shortcode, Archives, Calendar, etc.
- Theme - Navigation, Site Logo, Template Parts, etc.
- Embeds - YouTube, Twitter, Instagram, etc.
- Check the blocks you want to animate
- Click Save Changes
Each block shows its title and technical name (e.g., core/media-text)
You can disable animation for individual blocks:
- Select any enabled block in the editor
- Look for Animation Settings panel in the sidebar (Inspector Controls)
- Toggle "Disable scroll animation" to turn off animation for that specific block
- Animation will be disabled only for that block instance
The plugin just adds classes - you create the animations! Example:
/* Query Loop with staggered cards */
.wp-block-query.gds-block-animations-block .wp-block-gds-post-teaser {
opacity: 0;
transform: translateY(20px);
transition:
opacity 0.5s ease,
transform 0.5s ease;
}
.wp-block-query.gds-animate-visible .wp-block-gds-post-teaser:nth-child(1) {
opacity: 1;
transform: translateY(0);
transition-delay: 0s;
}
.wp-block-query.gds-animate-visible .wp-block-gds-post-teaser:nth-child(2) {
opacity: 1;
transform: translateY(0);
transition-delay: 0.1s;
}
.wp-block-query.gds-animate-visible .wp-block-gds-post-teaser:nth-child(3) {
opacity: 1;
transform: translateY(0);
transition-delay: 0.2s;
}
/* Continue for more items... */gdsAnimate();Shows enabled blocks and animation counts.
gds-animate/
├── gds-animate.php # Main plugin with settings
├── assets/
│ ├── style.css # Example styles (optional)
│ ├── script.js # Class management logic (frontend)
│ └── editor.js # Block editor controls
└── README.md # This file
1. Update PHP (gds-animate.php):
- Add to default options array
- Add checkbox in settings form
2. Update JS (assets/script.js):
- Add to
blockClassMapobject
3. Style in Theme:
- Add CSS for
.your-block.gds-block-animations-blockand.your-block.gds-animate-visible
- IntersectionObserver triggers when 10% of block is visible
- 100px bottom margin offset (animates slightly before fully visible)
- Blocks are observed once (not repeated on scroll up/down)
- 50ms delay for blocks visible on page load ensures smooth animation
GPL-2.0+