|
1
|
+(()=>{"use strict";const t=class{constructor(t){if(this.ablocksAnimation=t,!this.ablocksAnimation||!t?.classList.contains("ablocks-invisible"))return;const e=new IntersectionObserver(t=>{t.forEach(t=>{t.isIntersecting&&(this.applyAnimation(t.target),e.unobserve(t.target))})},{threshold:.5});Array.isArray(t)||t instanceof NodeList?t.forEach(t=>{e.observe(t)}):t&&e.observe(t),window.addEventListener("resize",()=>this.handleResize(t))}applyAnimation(t){if(t.getAttribute("data-settings")){const e=JSON.parse(t.getAttribute("data-settings")),i=window.matchMedia(`(max-width: ${this.getBreakpoint("tablet")}) and (min-width: ${this.getBreakpoint("mobile")})`).matches,a=window.matchMedia(`(max-width: ${this.getBreakpoint("mobile")})`).matches;let n=e.animationType;if(i?n=e.animationTypeTablet||e.animationType:a&&(n=e.animationTypeMobile||e.animationType),t.style.visibility="visible","none"===n)return;t.style.setProperty("--animate-duration",`${e.animationDuration||1}s`), |