File manager - Edit - /var/www/html/portalHomolog/public/pmar/js/animateGradative.js
Back
document.addEventListener("DOMContentLoaded", function () { const elements = document.querySelectorAll(".animate-on-scroll"); // remove animações prévias e armazena o tipo elements.forEach((el) => { const animClasses = Array.from(el.classList).filter( (c) => c.startsWith("animate__") && c !== "animate__animated" ); if (animClasses.length) { el.dataset.anim = animClasses.join(" "); animClasses.forEach((c) => el.classList.remove(c)); } el.classList.remove("animate__animated"); }); const io = new IntersectionObserver( (entries, observer) => { entries.forEach((entry) => { const el = entry.target; // só ativa quando pelo menos metade está visível if (entry.intersectionRatio >= 0.1) { const anim = el.dataset.anim || "animate__fadeInUp"; el.classList.add( "is-visible", "animate__animated", ...anim.split(" ") ); // impede reanimação observer.unobserve(el); } }); }, { threshold: [0, 0.1, 1], rootMargin: "0px 0px -10% 0px", // começa um pouco antes do bloco entrar } ); elements.forEach((el) => io.observe(el)); });
| ver. 1.4 |
Github
|
.
| PHP 8.3.28 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings