PluginProbe
Section Builder with Backgrounds – Customize with Color, Gradient, Image and Parallax. / 0.09
Section Builder with Backgrounds – Customize with Color, Gradient, Image and Parallax. v0.09
trunk 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19
background-block / build / view.js

view.js in Section Builder with Backgrounds – Customize with Color, Gradient, Image and Parallax. 0.09, at build/view.js

1 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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")}}})();