This is the comprehensive documentation for the Linchpin Blocks animation controls system, covering all features, implementation details, and user guides.
📚 Table of Contents
- Overview & Features
- User Guide
- Animation Types & Controls
- Advanced Features
- Interactive Guide System
- Frontend Implementation
- Developer Documentation
- Performance & Accessibility
Overview & Features
What is Animation Controls?
The Animation Controls system provides comprehensive GSAP animation capabilities for WordPress blocks, including:
- 13+ Animation Types: Fade, Slide, Scale, Rotate, Reveal, Zoom, Custom
- ScrollTrigger Integration: Complete ScrollTrigger support with pinning and snapping
- Child Animation System: 5 patterns for animating child elements
- Preset Management: Save, load, and share animation configurations
- Copy/Paste Functionality: Transfer settings between blocks
- Interactive Guide: 7-step walkthrough for new users
- Performance Optimized: Lazy loading, GPU acceleration, accessibility support
Supported Blocks
core/group– Group blockscore/row– Row blockscore/columns– Column blockscore/stack– Stack blockscore/grid– Grid blockscore/cover– Cover blockscore/column– Individual columns
User Guide
Getting Started
- Select a supported block in the WordPress editor
- Open the block settings sidebar (Inspector Controls)
- Find the "Block Animation" panel – it will auto-open when animations are enabled
- Configure your animations using the three main tabs:
- Animate In: Entrance animations and ScrollTrigger settings
- Animate Out: Exit animations and toggle actions
- Pin: Pinning and snap settings
Basic Animation Setup
Animate In (Entrance Animations)
- Enable Animation: Toggle the "Enable Animation" switch
- Choose Animation Type: Select from 13+ preset types or Custom
- Set Timing: Configure duration, delay, and easing
- ScrollTrigger Options: Enable scrubbing and set trigger positions
- Child Animations: Enable to animate child elements individually
Animate Out (Exit Animations)
- Enable Animate Out: Toggle the "Enable Animate Out" switch
- Choose Out Animation Type: Select from 13+ exit animation types
- Set Out Timing: Configure duration, delay, and easing
- Set Offset: Define when out animation should start
- Child Out Animations: Enable to animate children when exiting
Pin Controls (Sticky Effects)
- Enable Pinning: Toggle the "Enable Pinning" switch
- Choose Pin Type: Fixed (performance) or Transform (nested elements)
- Configure Pin Options: Spacing, anticipate pin, reparent settings
- Advanced Options: Custom containers, spacer classes
- Snap Settings: Configure scroll snapping behavior
Visual Indicators
When animations are enabled, you'll see:
- Blue Play Button: On animated blocks (click to preview)
- Animation Badges: In/Out animation type indicators
- Magenta Pin Icon: On pinned blocks
- Child Indicators: Shows linked child animations
Smart Panel Behavior
- Auto-Open: Panel opens when animations are enabled
- Dynamic Title: Shows current animation status
- Intelligent Tabs: Auto-selects relevant tab
- Visual Feedback: Green status indicators, animation summaries
Animation Types & Controls
Animation Types
Entrance Animations (Animate In)
- Fade In – Simple opacity transition
- Slide In Up/Down/Left/Right – Movement with opacity
- Scale In – Scale and opacity transition
- Rotate In – Rotation with opacity
- Reveal Left/Right – Column-based reveals
- Reveal Inward/Outward – Alternating column reveals
- Zoom In – Center-based scale reveal
- Custom – User-defined transform values
Exit Animations (Animate Out)
- Fade Out – Simple opacity transition
- Slide Out Up/Down/Left/Right – Movement with opacity
- Scale Out – Scale and opacity transition
- Rotate Out – Rotation with opacity
- Reveal Out Left/Right – Column-based reveals
- Reveal Outward/Inward – Alternating column reveals
- Zoom Out – Center-based scale reveal
- Custom – User-defined transform values
Timing & Easing Controls
Duration & Delay
- Duration: 0.1-10 seconds with 0.1 step precision
- Delay: 0-5 seconds with 0.1 step precision
- Stagger: Delay between child element animations
- Out Timing: Independent timing for exit animations
Easing Functions
- Power Easing: Power1-4 with In/Out/InOut variants
- Back Easing: Overshoot effects with In/Out/InOut
- Elastic Easing: Bouncy effects with In/Out/InOut
- Bounce Easing: Bounce effects with In/Out/InOut
- Linear: No easing (none option)
Custom Transform Controls
When "Custom" animation type is selected:
- Position (X/Y): Horizontal and vertical positioning
- Scale: Size transformation (0.1-5x)
- Rotation: Rotation in degrees (-360 to 360)
- Opacity: Transparency (0-1)
- From/To Values: Initial and target states
- Out From/To Values: Exit animation states
Advanced Features
ScrollTrigger Integration
Trigger Configuration
- Start Position: Define when animation begins (e.g., "top 80%")
- End Position: Define when animation ends (e.g., "bottom 20%")
- Scrub Animation: Link animation progress to scroll position
- Scrub Smoothness: Control scrubbing responsiveness (0.1-5)
- Auto Refresh: Automatically refresh on layout changes
Toggle Actions
- Enter Actions: What happens when entering trigger zone
- Leave Actions: What happens when leaving trigger zone
- Enter Back Actions: What happens when re-entering from above
- Leave Back Actions: What happens when re-leaving from below
Child Animation System
Animation Patterns
- Staggered – One after another with delay
- All At Once – Simultaneous animation
- Sequential – Same as staggered
- Alternating – Every other element
- Random – Random order animation
Child Animation Controls
- Animate Children: Enable child element animation
- Child Animation Type: Independent animation type for children
- Child Animation Pattern: How children are animated
- Child Delay: Delay between each child animation
- Reverse Child Order: Animate from last to first
- Child Out Animations: Separate exit animations for children
Pin & Snap Features
Pin Settings
- Pin Enable/Disable: Master pin control
- Pin Type: Fixed (performance) vs Transform (nested elements)
- Pin Spacing: Control content flow around pinned elements
- Anticipate Pin: Prevent visual jumps
- Pin Reparent: Handle overflow issues
- Custom Containers: Pin within specific containers
- Pin Spacer Classes: Custom CSS for spacer elements
Snap Settings
- Snap Type: None, Mandatory, or Proximity
- Snap Duration: Animation duration for snap (0.1-5s)
- Snap Delay: Delay before snap starts (0-2s)
- Snap Ease: Easing function for snap animation
- Directional Snap: Only snap in trigger direction
Preset Management
Save Presets
- Preset Naming: Custom names for saved presets
- Complete Settings: Saves all animation attributes
- REST API Integration: Server-side preset storage
- User-Specific: Presets tied to user accounts
Load Presets
- Preset Selection: Dropdown of saved presets
- Preview Modal: See preset details before applying
- Settings Summary: Visual breakdown of preset settings
- Apply Functionality: One-click preset application
- Delete Presets: Remove unwanted presets
Copy/Paste Functionality
Copy Settings
- JSON Export: Complete animation settings as JSON
- Clipboard Integration: One-click copy to clipboard
- Validation: Only copies when animations are enabled
- Success Feedback: Confirmation notifications
Paste Settings
- JSON Import: Paste animation settings from JSON
- Modal Interface: User-friendly paste interface
- Error Handling: Validation and error messages
- Success Feedback: Confirmation of successful application
Interactive Guide System
7-Step Walkthrough
The system includes an interactive guide that automatically appears for first-time users:
- Welcome: Introduction to animation controls
- Animate In: Entrance animation features
- Animate Out: Exit animation features
- Pinning: Sticky scroll effects
- Scroll Scrubbing: Scroll-linked animations
- Advanced Features: Snap and advanced options
- Getting Started: Quick start guide
Guide Features
- Smart Auto-Display: Shows when first enabling animations
- Session Management: Only shows once per session
- Permanent Dismissal: Option to never show again
- Manual Access: Always available via More Tools menu
- Card-Based Layout: Visual, engaging content with hover effects
Accessing the Guide
- Automatic: Shows when first enabling any animation feature
- Manual: Click three dots (⋮) in editor toolbar → "Show Animation Features Guide"
- Persistent: Available even after permanent dismissal
Frontend Implementation
How It Works
Block Rendering (PHP)
When blocks are rendered on the frontend, animation data is injected as HTML attributes:
<div class="wp-block-group"
data-animation-enabled="true"
data-animation-type="slideInUp"
data-animation-duration="1"
data-animation-delay="0.5"
data-animation-ease="power2.out">
<!-- Block content -->
</div>
Animation Execution (JavaScript)
The frontend script handles animation execution:
- Waits for GSAP library to be available
- Registers ScrollTrigger plugin if needed
- Finds all animated elements via data attributes
- Initializes animations for each element
Animation Types
- In-View Animations: Uses Intersection Observer API
- Scroll-Based Animations: Uses GSAP ScrollTrigger plugin
- Child Animations: Supports all 5 animation patterns
- Pin & Snap: Complete ScrollTrigger pinning and snapping
Performance Optimizations
- Lazy Loading: Assets only load when needed
- GPU Acceleration: Hardware-accelerated animations
- Efficient Triggers: Optimized ScrollTrigger usage
- Memory Management: Proper cleanup and disposal
Browser Support
- Modern Browsers: Chrome, Firefox, Safari, Edge
- Mobile Support: iOS and Android browsers
- Progressive Enhancement: Works without JavaScript
- Accessibility: Respects user motion preferences
Developer Documentation
Extending Supported Blocks
Add animation support to custom blocks:
import { addFilter } from '@wordpress/hooks';
addFilter(
'linchpin.animationControls.supportedBlocks',
'my-plugin/add-animation-blocks',
(blocks) => {
return [
...blocks,
'my-plugin/custom-block',
'core/image',
'core/heading'
];
}
);
Animation Type Filtering
Control which animation types are available:
add_filter( 'linchpin_blocks_enabled_animation_types', function( $enabled_types, $all_defaults ) {
return [
'fadeIn',
'fadeOut',
'slideInUp',
'slideInDown',
];
}, 10, 2 );
Technical Architecture
Modular Design
- Component-Based: Reusable React components
- Utility Functions: Shared animation logic
- Hook System: Custom hooks for common functionality
- Filter Integration: WordPress filter system
Code Organization
- Separation of Concerns: Clear responsibility boundaries
- Maintainability: Easy to modify and extend
- Testability: Individual components can be tested
- Documentation: Comprehensive inline documentation
WordPress Integration
- Block Editor: Native block editor integration
- REST API: Server-side preset management
- User Meta: Persistent user preferences
- Asset Management: Efficient script and style loading
Performance & Accessibility
Performance Optimizations
- Lazy Loading: Assets only load when needed
- GPU Acceleration: Hardware-accelerated animations
- Efficient Triggers: Optimized ScrollTrigger usage
- Memory Management: Proper cleanup and disposal
Accessibility Features
- Reduced Motion: Respects
prefers-reduced-motion - Keyboard Navigation: Full keyboard support
- Screen Reader: Proper ARIA labels and descriptions
- Focus Management: Clear focus indicators
Browser Compatibility
- Modern Browsers: Chrome, Firefox, Safari, Edge
- Mobile Support: iOS and Android browsers
- Progressive Enhancement: Works without JavaScript
- Fallback Support: Graceful degradation
Troubleshooting
Common Issues
Animations not running:
- Check if GSAP is loaded:
console.log(window.gsap) - Verify data attributes in HTML
- Check browser console for errors
- Ensure blocks have animation enabled in editor
ScrollTrigger animations not working:
- Verify ScrollTrigger plugin is loaded
- Check start/end position values
- Ensure trigger element exists
- Test without scrub first
Performance issues:
- Reduce number of animated elements
- Use simpler animations
- Check for conflicting CSS animations
- Test on lower-end devices
Debugging Tools
- ScrollTrigger Markers: Enable in development
- Browser DevTools: Inspect data attributes and performance
- Console Warnings: Check for missing dependencies
- Network Tab: Verify asset loading
Future Enhancements
Planned Features
- Animation Templates: Pre-built animation combinations
- Batch Operations: Apply settings to multiple blocks
- Animation Library: Curated animation collections
- Advanced Easing: Custom easing function editor
- Animation Timeline: Visual timeline editor
- Performance Analytics: Animation performance metrics
Extensibility
- Plugin API: Third-party animation extensions
- Custom Presets: User-defined preset categories
- Animation Events: JavaScript events for animations
- Advanced Triggers: Custom trigger conditions
This comprehensive documentation covers all aspects of the Linchpin Blocks animation controls system, providing both users and developers with complete information about available functionality.