/** * Animation System Module * * Unified animation system consolidating all scroll animation modules. * * Replaces: * - scrollfx * - parallax * - scroll-timeline * - scroll-loop * - scroll-dependent * - sticky-fade * - sticky-steps * * Usage: * - Add data-module="animation-system" to enable animations * - Or import and use directly: import { AnimationSystem } from './modules/animation-system/index.js' * * Features: * - Fade-in animations * - Parallax effects * - Scroll timeline animations * - Sticky fade animations * - Sticky steps animations * - IntersectionObserver support * - Backward compatibility with old modules */ import { Logger } from '../../core/logger.js'; import { AnimationSystem } from './AnimationSystem.js'; import { ScrollAnimation } from './ScrollAnimation.js'; import { TimelineAnimation } from './TimelineAnimation.js'; const AnimationSystemModule = { name: 'animation-system', animationSystem: null, init(config = {}, state = null) { Logger.info('[AnimationSystemModule] Module initialized'); // Create animation system this.animationSystem = AnimationSystem.create(config); // Expose globally for easy access if (typeof window !== 'undefined') { window.AnimationSystem = this.animationSystem; } return this; }, /** * Get animation system instance */ getAnimationSystem() { return this.animationSystem || AnimationSystem.create(); }, /** * Register animation */ registerAnimation(element, config) { const system = this.getAnimationSystem(); system.registerAnimation(element, config); }, destroy() { if (this.animationSystem) { this.animationSystem.destroy(); this.animationSystem = null; } if (typeof window !== 'undefined' && window.AnimationSystem) { delete window.AnimationSystem; } Logger.info('[AnimationSystemModule] Module destroyed'); } }; // Export for direct usage export { AnimationSystem, ScrollAnimation, TimelineAnimation }; // Export as default for module system export default AnimationSystemModule; // Export init function for module system export const init = AnimationSystemModule.init.bind(AnimationSystemModule); // Backward compatibility exports export { createTrigger } from '../scrollfx/index.js';