v2.0.0
Project Changelog: Version 2.0.0
Major Changes:
-
Event Handling Enhancement:
- In the first version, the
event
property could only work with one event at a time, either "scroll" or "mouse". In version 2.0.0, this has been significantly improved. - Change: The property name has been updated from "event" to "events".
- Enhancement: Now, you can pass an array of necessary events, allowing for multiple events to be handled simultaneously.
- Animation: Added dynamic animations based on the specified events, providing a more engaging user experience.
- In the first version, the
-
jQuery Dependency Update:
- Change: jQuery is no longer a required dependency.
- Option: While jQuery is not mandatory, the library has been designed to seamlessly work with or without jQuery, giving developers flexibility in their choice of dependencies.
-
Transition to Modern GSAP:
- Update: Migrated from TweenLite and CSS Plugin to a more modern GSAP
- Enhancement: This transition ensures the use of up-to-date animation capabilities and practices.
-
Auto-adjustment Offsets:
- Feature: Auto-adjustment of offsets has been implemented to ensure a full animation length.
- Example: If an element is positioned at the very top or bottom, the offsets will be adjusted automatically for a smoother animation experience.
-
TypeScript Integration:
- Change: The codebase has been rewritten to TypeScript, enhancing type safety and code readability.
-
IntersectionObserver for Gyroscope Event:
- Feature: Added IntersectionObserver for the gyroscope event to prevent animation if the element is not visible.
- Enhancement: This improves efficiency and prevents unnecessary animations when elements are not in the viewport.
- Note: The gyroscope event, which was initially hardcoded, is now dynamically animated based on intersection and visibility.
-
Build System Update:
- Migration: Transitioned from webpack to Vite.
- Structure: The project will now have two files: Module and UMD, enhancing compatibility and modularity.
-
Package Cleanup:
- Optimization: Removed unnecessary files from the NPM package, streamlining the distribution package.
-
Code Quality Tools Integration:
- Additions: Integrated ESLint, Prettier, and Husky for enhanced code quality and style consistency.
These major changes collectively represent a significant evolution of the project, focusing on improved flexibility, performance, and modern development practices. Developers can now enjoy a more versatile and efficient animation library with dynamic gyroscope event animations based on visibility.