| 1 |
(()=>{"use strict";const e=e=>{const{bottom:t}=e.getBoundingClientRect(),{innerHeight:n}=window;return{reached:0,leave:(t=>{if(t<0)return 100;if(t<=n+e.clientHeight){const r=n+e.clientHeight;return Number((100-t/r*100).toFixed(2))}return 0})(t)}},t=(t,n={},r=!1)=>{const o=r||t.parentElement,{isReverse:a,speed:s}=n,c=a?s:-s,l=e(o).leave;if(0<=l<=100){const e=l*c+(50-50*c);t.style.top=`${e}%`,t.style.transform=`translateY(-${e}%)`}},n=(t,n=!1)=>{const r=n||t.parentElement,o=e(r).leave;if(0<=o<=100){const e=Math.max(1,1+o/100*.5);t.style.scale=e}};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-evb-background").forEach((e=>{const o=JSON.parse(e.dataset.attributes),{wrapper:a}=o,{animation:s={}}=a,{type:c="none",parallax:l={}}=s,i=e.querySelector(".evbBackground");"parallax"===c&&i&&(t(i,l,e),document.addEventListener("scroll",(()=>{t(i,l,e)}))),"zoomIn"===c&&i&&(n(i,e),document.addEventListener("scroll",(()=>{n(i,e)})));const d=e.querySelector(".evbShape.top"),u=e.querySelector(".evbShape.bottom");r(d),r(u),e.removeAttribute("data-attributes")}))}));const r=e=>{if(e){const t=JSON.parse(e.dataset?.svg);e.innerHTML=t,e.removeAttribute("data-svg")}}})(); |