| 1 |
(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var a in n)t.o(n,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:n[a]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)};const e=window.wp.domReady;function n(t){const e=Array.from(t.querySelectorAll(".gutenify-stacking-card-item")),n=t.dataset.topOffset||"50px";return e.forEach(((t,e)=>{t.style.position="sticky",t.style.top=t.dataset.stickyOffset||n,t.style.zIndex=e+1})),e}t.n(e)()((function(){const t=Array.from(document.querySelectorAll(".gutenify-stacking-cards-container"));if(!t.length)return;const e=t.map((t=>({container:t,items:n(t)})));if(!e.some((({container:t})=>{const e=t.dataset.stackingMode;return"scale"===e||"fade"===e})))return;let a=!1;const o=()=>{e.forEach((({container:t,items:e})=>function(t,e){const n=t.dataset.stackingMode;if("scale"!==n&&"fade"!==n)return;const a=parseFloat(t.dataset.scaleIntensity)||.05,o=parseFloat(t.dataset.fadeIntensity),s=isNaN(o)||.1===o?1:o;for(let t=0;t<e.length-1;t++){const o=e[t],r=e[t+1],i=o.getBoundingClientRect(),c=r.getBoundingClientRect(),d=c.height||1,l=i.bottom-c.top,f=Math.max(0,Math.min(1,l/d));"scale"===n?o.style.transform=`scale(${1-f*a})`:o.style.opacity=String(1-f*s)}}(t,e))),a=!1},s=()=>{a||(a=!0,window.requestAnimationFrame(o))};window.addEventListener("scroll",s,{passive:!0}),window.addEventListener("resize",s),o()}))})(); |