michalsnik/aos — reverse-engineered prompt
Reverse engineered prompt
Build me a lightweight JavaScript library for animate on scroll effects for regular websites. I want something easy to drop into a page with a script tag or import into a project, then initialize with one simple call. Elements should animate when they enter the viewport by using HTML data attributes, so things like fade in, fade up, delays, duration, easing, offset, whether it runs once, whether it mirrors on the way out, and where the trigger point should be can all be set per element.
Please include sensible defaults plus global options when the library is initialized. It should also expose a small API so I can refresh positions after resize or after new content is added. If possible, fire document events when elements animate in and out, including support for custom ids so people can listen for specific elements.
I’d also like a simple demo page that shows the built in animations and how custom animations can be added with CSS. Look up current browser docs online if you need to.
Want more depth? Deep Reverse