trigger-animations
Version:
A lightweight animation-on-scroll trigger utility built with **GSAP + ScrollTrigger**. Add animation attributes to your HTML elements and let the script handle the rest.
16 lines (15 loc) • 356 B
JavaScript
function zoom(element) {
const config = {};
// zoom in
const zoomIn = element.getAttribute("data-zoom-in");
if (zoomIn !== null) {
config.scale = 0;
}
// zoom out
const zoomOut = element.getAttribute("data-zoom-out");
if (zoomOut !== null) {
config.scale = 2;
}
return config;
}
export default zoom;