# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.3] - 2025-01-29

### Added
- **Direction buttons for ALL animations**: Visual arrow buttons to select animation direction (top, right, bottom, left)
- **Slow Motion toggle**: Make any animation 1.5x slower with a simple toggle switch
- **Universal direction support**: All animation types (Fade, Zoom, Rotate, Bounce, Flip) now support all 4 directions
- **20 new animation variants**: Each animation type now has 4 directional variants
  - Zoom: zoom-in, zoom-in-left, zoom-in-right, zoom-in-top
  - Rotate: rotate-in, rotate-in-left, rotate-in-right, rotate-in-top
  - Bounce: bounce-in, bounce-in-left, bounce-in-right, bounce-in-top
  - Flip: flip-in (X-axis), flip-in-left (Y-axis), flip-in-right (Y-axis), flip-in-top (X-axis)
- **Visual direction picker**: Intuitive icon-based buttons with rotated arrow SVGs
- **Slow modifier class**: New `animation-slow` class works across all animations

### Changed
- **Simplified UI**: Cleaner dropdown with base animation types (Fade, Zoom, Rotate, Bounce, Flip)
- **Direction selection**: Moved from dropdown to visual button grid for better UX
- **Removed "Fade In Slow"**: Replaced with universal "Slow Motion" toggle for all animations
- **Delay behavior**: Animation delay no longer triggers editor preview (frontend-only)
- **Future-proof selectors**: Frontend JavaScript now uses attribute selectors for better maintainability

### Fixed
- Fixed `scroll-fade-in-top` and other directional variants not triggering `fade-in-visible` class
- Frontend animation detection now works with all new animation variants
- Editor preview optimization (delay changes don't re-trigger preview)

### Technical Improvements
- **CSS architecture**: Organized animations by type with clear section comments
- **Universal slow modifier**: Single `animation-slow` class affects all animation types
- **Optimized CSS selectors**: Wildcard selectors for performance (`[class*="scroll-"]`)
- **Reduced code duplication**: Eliminated need for separate "slow" animation variants
- **Better scalability**: New direction system makes adding animations easier
- **Smarter JavaScript**: Attribute-based selectors catch all current and future animation variants
- **Enhanced keyframes**: Complete set of directional keyframes for editor preview
- **Improved class management**: Better handling of animation-slow and direction classes

## [1.0.2] - 2025-01-28

### Added
- Live animation preview in Gutenberg editor with "Show Animation" button
- Automatic animation preview when selecting or changing animations
- Automatic animation preview when changing delay values
- Support for all third-party blocks (Yoast SEO, Rank Math, etc.)
- Animation preview works in iframe editor context

### Fixed
- Animation classes now properly cleaned up when switching animations
- No more orphaned class fragments (like `-left`, `-right`, `-slow`)
- Correct animation detection for compound classes (e.g., `scroll-fade-in-left`)
- Elements remain visible in editor while supporting animation previews
- Animation dropdown now shows correct selection after changing animations
- Fade In animations now work correctly across all variants

### Changed
- Improved className management with array-based filtering
- Animation class extraction now prioritizes longest matches first
- Simplified animation preview logic (always animates block element)
- Removed debug console logs for production-ready code
- Enhanced editor CSS with `:not()` selectors for better performance

### Technical Improvements
- Uses `className` attribute directly (WordPress standard)
- Compatible with server-side rendered blocks
- Cleaner code structure with reduced complexity
- Better iframe handling for editor context
- Optimized CSS specificity for editor styles

## [1.0.1] - 2025-01-27

### Changed
- Improved code structure and organization
- Separated OOP and functional code into proper files
- Moved plugin functions to `includes/` directory following WordPress standards
- Enhanced JavaScript code formatting and WordPress compliance
- Reduced JavaScript linting errors by 85% (from 500+ to 78 errors)

### Fixed
- WordPress Coding Standards compliance issues
- File structure now follows WordPress plugin best practices
- Improved code maintainability and readability
- Better separation of concerns between classes and functions

### Technical Improvements
- Added proper Doc-Comments for all functions and classes
- Implemented Yoda Conditions for better code safety
- Enhanced comment formatting with proper punctuation
- Optimized plugin file organization

## [1.0.0] - 2025-09-18

### Added
- Initial release of Serend Animations
- 8 beautiful animation types:
  - Fade In (from bottom, left, right)
  - Fade In Slow (from bottom)
  - Zoom In
  - Rotate In
  - Bounce In
  - Flip In
- Delay slider for staggered animations (0-2000ms in 100ms steps)
- Gutenberg block inspector integration
- Intersection Observer API for performance
- Accessibility support with prefers-reduced-motion
- Full internationalization support (English/German)
- WordPress 6.0-6.6 compatibility
- PHP 7.4+ compatibility
- Clean uninstall functionality
- Debug mode for administrators with settings panel
- GPL v2 license compliance
- WordPress coding standards compliance
- Security features (nonces, escaping, sanitization)

### Security
- Added nonce verification for debug mode
- Implemented proper escaping for all output
- Added capability checks for admin functions
- Secure URL generation for debug links

### Debug Features
- Enable/disable debug mode via Settings → Serend Animations
- Visual debug overlay shows animation class usage on frontend
- Only visible to administrators for security
- Debug information in browser console
- Translation debug information in settings panel
- Real-time animation element counting

### Developer Features
- Clean, extensible code architecture
- WordPress hooks and filters
- No external dependencies
- Performance optimized with GPU acceleration
- Browser compatibility fallbacks
