The easy way to create CSS scroll animations that react to the position of your HTML element on screen. Animate on scroll (AOS) your CSS.
Fixed the responsiveness of scroll direction.
Creates a class of "trig-scroll-up" or "trig-scroll-down" onto the body of the document depending on the last scroll direction.
Refactoring and slight optimisations.
Reintroduced data-trig-height="0" and restructured for better compression.
You can now use data-trig-global="true" to create global CSS variables for an element using the id for the variables (i.e --trig-yourelementid). There was an issue with element heights which is now fixed. This allows for progress bars like this to work.
More refactoring.
A little more refactoring.
Refactoring of script for code quality.
Reduced reflows to only when Trig.js starts and when the browser is resized.
Enable Trig.js by adding a class instead of a data attribute.