svg-scroll-draw 2.21.0 → 2.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -15
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +1 -1
- package/dist/angular/index.d.ts +1 -1
- package/dist/angular/index.mjs +1 -1
- package/dist/aos/index.cjs +2 -2
- package/dist/aos/index.mjs +1 -1
- package/dist/aos/react/index.cjs +2 -2
- package/dist/aos/react/index.mjs +1 -1
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/aos.global.js +2 -2
- package/dist/cdn/scrollreveal.global.js +2 -2
- package/dist/cdn/svg-scroll-draw.dev.global.js +83 -29
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/cdn/vivus.global.js +1 -1
- package/dist/chunk-2PYLM3E7.mjs +1 -0
- package/dist/chunk-DWK6XXY6.mjs +2 -0
- package/dist/chunk-DY5JCXVR.mjs +1 -0
- package/dist/chunk-EAWFBJUR.mjs +2 -0
- package/dist/{chunk-MTEGM4RR.mjs → chunk-GVBO5GRD.mjs} +1 -1
- package/dist/chunk-HX4SP5WN.mjs +3 -0
- package/dist/chunk-JCXMBI4G.mjs +2 -0
- package/dist/chunk-KV3WCPQ5.mjs +1 -0
- package/dist/chunk-LTCJVVSC.mjs +1 -0
- package/dist/{chunk-SMRTRZSD.mjs → chunk-OTDD2ROH.mjs} +1 -1
- package/dist/{chunk-MENZ5DS4.mjs → chunk-VMUJMXKO.mjs} +1 -1
- package/dist/chunk-WXUOF4NM.mjs +1 -0
- package/dist/chunk-YNNA33A5.mjs +2 -0
- package/dist/cinematic/index.cjs +2 -2
- package/dist/cinematic/index.mjs +1 -1
- package/dist/{engine-DQyBzZDl.d.ts → engine-B7UpB4fT.d.ts} +2 -1
- package/dist/{engine-P8u6OK4m.d.mts → engine-o1VSQ1lX.d.mts} +2 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.d.mts +2 -2
- package/dist/group/index.d.ts +2 -2
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +2 -1
- package/dist/horizontal/index.d.ts +2 -1
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-CMqK0GCT.d.mts → index-BY-CNE8c.d.mts} +1 -1
- package/dist/{index-DPqPEnO-.d.ts → index-DqXXiDIk.d.ts} +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +1 -1
- package/dist/nuxt/index.d.ts +1 -1
- package/dist/nuxt/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +1 -1
- package/dist/react/index.d.ts +1 -1
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.mjs +1 -1
- package/dist/scrollreveal/index.cjs +2 -2
- package/dist/scrollreveal/index.mjs +1 -1
- package/dist/scrollreveal/react/index.cjs +2 -2
- package/dist/scrollreveal/react/index.mjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.d.mts +1 -1
- package/dist/solid/index.d.ts +1 -1
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.d.mts +1 -1
- package/dist/svelte/index.d.ts +1 -1
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vivus/index.cjs +2 -2
- package/dist/vivus/index.d.mts +3 -0
- package/dist/vivus/index.d.ts +3 -0
- package/dist/vivus/index.mjs +1 -1
- package/dist/vivus/react/index.cjs +2 -2
- package/dist/vivus/react/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +1 -1
- package/dist/vue/index.d.ts +1 -1
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-426RAN5I.mjs +0 -1
- package/dist/chunk-4T5R3ZTL.mjs +0 -2
- package/dist/chunk-7SBTYJGH.mjs +0 -1
- package/dist/chunk-BFX2CSQ3.mjs +0 -1
- package/dist/chunk-ENACACPZ.mjs +0 -3
- package/dist/chunk-KGAJQP2N.mjs +0 -2
- package/dist/chunk-KHQ7OGQK.mjs +0 -1
- package/dist/chunk-OMI46IXL.mjs +0 -2
- package/dist/chunk-WQZKXAXK.mjs +0 -2
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var SvgScrollDraw=(()=>{var
|
|
2
|
-
<div style="position:absolute;${
|
|
3
|
-
<div style="position:absolute;${c?`left:${m}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${m}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:!0}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove()}}}var Gt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,jt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Sr(e,t,r){if(!!1)return;let n=(e.match(jt)??[]).join("").toUpperCase(),s=(t.match(jt)??[]).join("").toUpperCase(),i=(e.match(Gt)??[]).length,u=(t.match(Gt)??[]).length;if(n!==s){Q(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}i!==u&&Q(`morphTo: coordinate count differs (${i} \u2192 ${u}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r)}function vt(e,t,r){let n=(t.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let u=parseFloat(i),m=n[s++]??u;return String(+(u+(m-u)*r).toFixed(4))})}function at(e,t={}){if(typeof window>"u")return{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...n}=t,s=r?{...nt[r],...n}:n,i=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:u="path, polyline, line, polygon, rect, circle",speed:m=1,fade:c=!1,easing:f="linear",trigger:v={},stagger:M=0,direction:E="forward",once:oe=!1,debug:Te=!1,axis:S="y",scrollContainer:P,autoReverse:d=!1,delay:x=0,strokeColor:T,strokeWidth:I,fillOpacity:Z,waypoints:q,velocityScale:se=!1,threshold:le=0,rootMargin:G="0px",repeat:O=0,repeatDelay:Ne=0,morphTo:j,clip:ye,autoplay:Ae=!1,duration:He=1e3,native:_e=!0,onProgress:de,onStart:J,onComplete:p,onEnter:R,onLeave:Ve,onEnterBack:Ee,onLeaveBack:Me}=s,ie=ye===!0?"left":typeof ye=="string"?ye:!1,he=typeof f=="function"?f:ne[f]??ne.linear,Se=Le(v.start??"top bottom"),ze=Le(v.end??"bottom top"),ce=typeof P=="string"?document.querySelector(P):P??null,ge=Array.isArray(T)?T[0]:null,K=Array.isArray(T)?T[1]:typeof T=="string"?T:null,_=Array.isArray(I)?I[0]:null,Y=Array.isArray(I)?I[1]:typeof I=="number"?I:null,U=Array.isArray(Z)?Z[0]:null,V=Array.isArray(Z)?Z[1]:typeof Z=="number"?Z:null;function Pe(o){let a=o*100;switch(ie){case"right":return`inset(0 0 0 ${100-a}%)`;case"top":return`inset(0 0 ${100-a}% 0)`;case"bottom":return`inset(${100-a}% 0 0 0)`;case"center":return`circle(${o*150}% at 50% 50%)`;default:return`inset(0 ${100-a}% 0 0)`}}let L=ie?[]:Array.from(e.querySelectorAll(u)),$=[],ee=[],B=0,ue=0,l=M,h=0,C=!1,F=!1,A=0,te=!1,ae=-1,$e=[],X=-1,N=!1,me=0,ke=0,Ie,mt=null;function At(){mt?.destroy(),mt=null}let Oe=new Set,Mt=NaN,Re=!0,Ze=-1,Pt=performance.now(),We=NaN;function Ye(){return ce?S==="x"?ce.scrollLeft:ce.scrollTop:S==="x"?window.scrollX:window.scrollY}function $t(){return ce?S==="x"?ce.clientWidth:ce.clientHeight:S==="x"?window.innerWidth:window.innerHeight}function kt(){let o=rt(e,ce,S);return Fe(o,o.scroll,$t(),Se,ze)}function tr(){let o=ue-B,a=L.length-1,y=ce??document.documentElement,z=S==="x"?"Width":"Height";if(l=M,M>0&&a>0&&o>0){let be=y[`scroll${z}`]-y[`client${z}`]-1-B-o/m;be>=0&&(l=Math.min(M,be/(a*o)))}h=ue+a*l*o}function Lt(){({tStart:B,tEnd:ue}=kt()),tr(),Te&&!1&&(At(),mt=Er(B,ue,S))}function ft(o,a=kt){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:a});let y=o.destroy;return o.destroy=()=>{y.call(o),De(e)},o}function rr(o,a){if(e.style.setProperty("--scroll-draw-progress",String(o)),ie){let y=a==="reverse"?1-o:o;e.style.clipPath=Pe(y);return}L.forEach((y,z)=>{y.style.strokeDashoffset=a==="reverse"?`${$[z]*o}`:`${$[z]*(1-o)}`,c&&(y.style.opacity=a==="reverse"?`${1-o}`:`${o}`),ge&&K?y.style.stroke=Ge(ge,K,o):K&&(y.style.stroke=K),_!==null&&Y!==null?y.style.strokeWidth=`${_+(Y-_)*o}`:Y!==null&&(y.style.strokeWidth=`${Y}`),U!==null&&V!==null?y.style.fillOpacity=`${U+(V-U)*o}`:V!==null&&(y.style.fillOpacity=`${V}`),j&&y.tagName.toLowerCase()==="path"&&ee[z]&&y.setAttribute("d",vt(ee[z],j,o))})}function Je(){if(e.style.setProperty("--scroll-draw-progress","0"),ie){e.style.clipPath=Pe(0);return}L.forEach((o,a)=>{o.style.strokeDasharray=`${$[a]}`,o.style.strokeDashoffset=E==="reverse"?"0":`${$[a]}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),_!==null&&(o.style.strokeWidth=`${_}`),U!==null&&(o.style.fillOpacity=`${U}`),j&&o.tagName.toLowerCase()==="path"&&ee[a]&&o.setAttribute("d",ee[a])})}if(L.forEach(o=>{vr(o);let a=Be(o);$.push(a);let y=o.tagName.toLowerCase()==="path";y?ee.push(o.getAttribute("d")??""):ee.push(""),j&&(y?Sr(ee[ee.length-1],j,o):Q(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),i?(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=E==="reverse"?`${a}`:"0",c&&(o.style.opacity="1"),K&&(o.style.stroke=K),Y!==null&&(o.style.strokeWidth=`${Y}`),V!==null&&(o.style.fillOpacity=`${V}`),j&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",j)):(o.style.strokeDasharray=`${a}`,o.style.strokeDashoffset=E==="reverse"?"0":`${a}`,c?o.style.opacity=E==="reverse"?"1":"0":o.style.opacity="",ge&&(o.style.stroke=ge),_!==null&&(o.style.strokeWidth=`${_}`),U!==null&&(o.style.fillOpacity=`${U}`))}),ie){if(i)return e.style.clipPath=Pe(1),p?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0)}else if(i)return p?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ct=typeof f=="string"?ot(f):null;function nr(){return!(_e===!1||!wr()||!L.length||!Ct||ie||S!=="y"||ce||m!==1||M!==0||oe||d||se!==!1||j||q||O||x>0||de||J||p||R||Ve||Ee||Me||T!=null||I!=null||Z!=null||(v.start??"top bottom").trim()!=="top bottom"||(v.end??"bottom top").trim()!=="bottom top")}function or(){let o=++br,a=`svg-scroll-draw-${o}`,y=`svg-scroll-draw-host-${o}`,z=`--svg-scroll-draw-${o}`,be=E==="reverse"?"0":"var(--ssd-len)",xe=E==="reverse"?"var(--ssd-len)":"0",ve=`stroke-dashoffset:${be};`,w=`stroke-dashoffset:${xe};`;c&&(ve+=`opacity:${E==="reverse"?1:0};`,w+=`opacity:${E==="reverse"?0:1};`);let k=document.createElement("style");k.setAttribute("data-svg-scroll-draw",""),k.textContent=`@keyframes ${a}{from{${ve}}to{${w}}}.${y}{view-timeline-name:${z};view-timeline-axis:block;}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${Ct};animation-fill-mode:both;animation-timeline:${z};animation-range:cover 0% cover 100%;}`,document.head.appendChild(k),e.classList.add(y);function re(g,W){g.style.setProperty("--ssd-len",String($[W])),g.style.strokeDasharray=`${$[W]}`,g.style.strokeDashoffset="",g.style.opacity="",g.style.animationPlayState="",g.classList.add(a)}L.forEach(re);let b=!1,D=-1;function H(){if(D>=0)return D;let g=e.getBoundingClientRect(),{tStart:W,tEnd:we}=Fe({top:g.top,height:g.height},Ye(),$t(),Se,ze);return he(pe(Ye(),W,we,m))}return{destroy(){e.classList.remove(y),L.forEach(g=>{g.classList.remove(a),g.style.removeProperty("--ssd-len"),g.style.animationPlayState=""}),k.remove()},replay(){b=!1,D=-1,L.forEach(re)},pause(){b=!0,L.forEach(g=>{g.style.animationPlayState="paused"})},resume(){b&&(b=!1,L.forEach(g=>{g.style.animationPlayState="running"}))},seek(g){let W=Math.min(1,Math.max(0,g));D=W,b=!0,L.forEach((we,fe)=>{we.classList.remove(a),we.style.strokeDashoffset=E==="reverse"?`${$[fe]*W}`:`${$[fe]*(1-W)}`,c&&(we.style.opacity=E==="reverse"?`${1-W}`:`${W}`)})},getProgress(){return H()},refresh(){L.forEach((g,W)=>{$[W]=Be(g),g.style.setProperty("--ssd-len",String($[W])),g.style.strokeDasharray=`${$[W]}`})}}}if(nr())return ft(or());function sr(){let o=Math.max(1,He),a=0,y=0,z=!1;function be(b){let D=!0;if(ie){let H=Math.min(1,Math.max(0,b/o)),g=he(H);me=g,e.style.setProperty("--scroll-draw-progress",String(g)),e.style.clipPath=Pe(E==="reverse"?1-g:g),de?.(g),H<1&&(D=!1)}else L.forEach((H,g)=>{let W=g*M*o,we=Math.min(1,Math.max(0,(b-W)/o)),fe=he(we);H.style.strokeDashoffset=E==="reverse"?`${$[g]*fe}`:`${$[g]*(1-fe)}`,c&&(H.style.opacity=E==="reverse"?`${1-fe}`:`${fe}`),ge&&K?H.style.stroke=Ge(ge,K,fe):K&&(H.style.stroke=K),_!==null&&Y!==null?H.style.strokeWidth=`${_+(Y-_)*fe}`:Y!==null&&(H.style.strokeWidth=`${Y}`),U!==null&&V!==null?H.style.fillOpacity=`${U+(V-U)*fe}`:V!==null&&(H.style.fillOpacity=`${V}`),j&&H.tagName.toLowerCase()==="path"&&ee[g]&&H.setAttribute("d",vt(ee[g],j,fe)),g===0&&(me=fe,de?.(fe),e.style.setProperty("--scroll-draw-progress",String(fe))),we<1&&(D=!1)});if(q){let H=Math.min(1,Math.max(0,b/o)),g=he(H);for(let W in q){let we=parseFloat(W);g>=we&&!Oe.has(we)&&(Oe.add(we),q[W]?.())}}return D}function xe(b){if(N)return;let D=b-a;F||(F=!0,J?.());let H=be(D);if(H&&!C){C=!0,be(o*(1+Math.max(0,L.length-1)*M)),p?.(),ke<(O==="infinite"?1/0:O??0)&&(ke++,Ie=setTimeout(()=>{a=performance.now(),F=!1,C=!1,Oe.clear(),Je(),A=requestAnimationFrame(xe)},Ne));return}H||(A=requestAnimationFrame(xe))}function ve(){cancelAnimationFrame(A),clearTimeout(Ie),a=performance.now(),y=0,N=!1,F=!1,C=!1,ke=0,z=!0,me=0,Oe.clear(),Je(),A=requestAnimationFrame(xe)}let w=new IntersectionObserver(b=>{b.forEach(D=>{D.isIntersecting&&!(oe&&C)?ve():!D.isIntersecting&&!oe&&!C&&(cancelAnimationFrame(A),clearTimeout(Ie),z=!1)})},{root:ce??null,threshold:le,rootMargin:G}),k;function re(){clearTimeout(k),k=setTimeout(()=>{L.forEach((b,D)=>{$[D]=Be(b),b.style.strokeDasharray=`${$[D]}`})},150)}return window.addEventListener("resize",re),window.addEventListener("orientationchange",re),x>0?setTimeout(()=>w.observe(e),x):w.observe(e),{destroy(){cancelAnimationFrame(A),clearTimeout(Ie),w.disconnect(),window.removeEventListener("resize",re),window.removeEventListener("orientationchange",re),clearTimeout(k)},replay(){ke=0,ve()},pause(){N||!z||(N=!0,y=performance.now()-a,cancelAnimationFrame(A))},resume(){N&&(N=!1,z=!0,a=performance.now()-y,A=requestAnimationFrame(xe))},seek(b){let D=Math.min(1,Math.max(0,b));me=D,N=!0,y=D*o,a=performance.now()-y,cancelAnimationFrame(A),be(y)},getProgress(){return me},refresh(){clearTimeout(k),L.forEach((b,D)=>{$[D]=Be(b),b.style.strokeDasharray=`${$[D]}`})}}}if(Ae)return ft(sr());Lt();function Dt(){if(N||!qe)return;let o=performance.now(),a=Ye();if(!Re&&se===!1&&a===Mt){dt(a);return}Re=!1,Mt=a;let y=m;if(se!==!1){let w=o-Pt,k=w>0?Math.abs(a-(Ze<0?a:Ze))/w:0;y=m*Math.max(.2,1+k*(typeof se=="number"?se:1)*.04)}Ze=a,Pt=o;let z=d?X===-1||a>=X?"forward":"reverse":E;X=a;let be=ue-B,xe=!0,ve=be===0?0:(a-B)/be;if(isNaN(We)||(We<=0&&ve>0?R?.():We>0&&ve<=0&&Me?.(),We<1&&ve>=1?Ve?.():We>=1&&ve<1&&Ee?.()),We=ve,ie){let w=he(pe(a,B,ue,y));oe&&!d&&(ae=Math.max(ae,w),w=ae),me=w,e.style.setProperty("--scroll-draw-progress",String(w));let k=z==="reverse"?1-w:w;e.style.clipPath=Pe(k),de?.(w),!F&&pe(a,B,ue,y)>0&&(F=!0,J?.()),w>=1&&!C?(C=!0,p?.(),ke<(O==="infinite"?1/0:O??0)&&(ke++,Ie=setTimeout(()=>{ae=-1,F=!1,C=!1,e.style.clipPath=Pe(0)},Ne))):w<1&&!oe&&(C=!1),dt(a);return}if(L.forEach((w,k)=>{let re=k*l*be,b=he(pe(a,B+re,ue+re,y));oe&&!d&&(b=$e[k]=Math.max($e[k]??ae,b)),w.style.strokeDashoffset=z==="reverse"?`${$[k]*b}`:`${$[k]*(1-b)}`,c&&(w.style.opacity=z==="reverse"?`${1-b}`:`${b}`),ge&&K?w.style.stroke=Ge(ge,K,b):K&&(w.style.stroke=K),_!==null&&Y!==null?w.style.strokeWidth=`${_+(Y-_)*b}`:Y!==null&&(w.style.strokeWidth=`${Y}`),U!==null&&V!==null?w.style.fillOpacity=`${U+(V-U)*b}`:V!==null&&(w.style.fillOpacity=`${V}`),j&&w.tagName.toLowerCase()==="path"&&ee[k]&&w.setAttribute("d",vt(ee[k],j,b)),k===0&&(me=b,de?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(xe=!1)}),q){let w=he(pe(a,B,ue,y));for(let k in q){let re=parseFloat(k);w>=re&&!Oe.has(re)&&(Oe.add(re),q[k]?.())}}!F&&pe(a,B,ue,y)>0&&(F=!0,J?.()),xe&&!C?(C=!0,p?.(),ke<(O==="infinite"?1/0:O??0)&&(ke++,Ie=setTimeout(()=>{ae=-1,$e=[],F=!1,C=!1,Oe.clear(),Je(),Re=!0},Ne))):!xe&&!oe&&(C=!1),dt(a)}function pt(o){return o>=ue&&o<h}function dt(o){te||pt(o)?A=requestAnimationFrame(Dt):qe=!1}function gt(){return te||pt(Ye())}let qe=!1;function Ke(){qe||(qe=!0,A=requestAnimationFrame(function(){Dt()}))}function et(){qe=!1,cancelAnimationFrame(A)}let yt=new IntersectionObserver(o=>{o.forEach(a=>{te=a.isIntersecting,te&&!N?(Re=!0,Ke()):qe&&!N&&pt(Ye())||et()})},{root:ce??null,threshold:le,rootMargin:G});function It(){L.forEach((o,a)=>{$[a]=Be(o),o.style.strokeDasharray=`${$[a]}`}),Lt(),Re=!0}let tt;function Ue(){clearTimeout(tt),tt=setTimeout(It,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let ir=je([e],Ue);return x>0?setTimeout(()=>yt.observe(e),x):yt.observe(e),ft({destroy(){cancelAnimationFrame(A),clearTimeout(Ie),et(),yt.disconnect(),ir(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(tt),At()},replay(){ae=-1,$e=[],X=-1,Ze=-1,F=!1,C=!1,ke=0,N=!1,me=0,Oe.clear(),clearTimeout(Ie),Je(),Re=!0,gt()&&Ke()},pause(){N=!0,et()},resume(){N&&(N=!1,Re=!0,gt()&&Ke())},seek(o){let a=Math.min(1,Math.max(0,o));me=a,ae=a,$e=[],N=!0,et(),rr(a,E),Re=!0},getProgress(){return me},refresh(){clearTimeout(tt),It(),gt()&&!N&&Ke()}},()=>({tStart:B,tEnd:ue}))}function Yt(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let n=typeof e=="string"?document.querySelector(e):e;return n?at(n,t):(Q("Container not found:",e),r)}function xr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Ut(e){let t=[],r=/([\w]+)\(([^)]*)\)/g,n;for(;(n=r.exec(e))!==null;){let s=[],i=[],u=n[2].trim();if(u)for(let m of u.split(/[\s,]+/)){let c=m.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(c?parseFloat(c[1]):0),i.push(c?c[2]:"")}t.push({fn:n[1],nums:s,units:i})}return t}function Tr(e,t,r){let n=Ut(e),s=Ut(t);return n.length===0||n.length!==s.length?r<1?e:t:n.map((i,u)=>{let m=s[u];return i.fn!==m.fn||i.nums.length!==m.nums.length?r<1?`${i.fn}(${i.nums.map((c,f)=>`${c}${i.units[f]}`).join(", ")})`:`${m.fn}(${m.nums.map((c,f)=>`${c}${m.units[f]}`).join(", ")})`:`${i.fn}(${i.nums.map((c,f)=>`${c+(m.nums[f]-c)*r}${i.units[f]}`).join(", ")})`}).join(" ")}function Xt(e,t,r){if(typeof e=="number"&&typeof t=="number")return String(e+(t-e)*r);let n=String(e),s=String(t);if(xr(n))return Ge(n,s,r);if(n.includes("("))return Tr(n,s,r);let i=n.match(/^([-+]?[\d.]+)(.*)$/),u=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&u){let m=parseFloat(i[1]),c=parseFloat(u[1]);return`${m+(c-m)*r}${i[2]||u[2]}`}return r<1?n:s}function Ar(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Mr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Pr=0,Qt="--scroll-draw-progress";function $r(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function St(e,t){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:n,trigger:s={},easing:i="ease-out",speed:u=1,once:m=!1,axis:c="y",scrollContainer:f,native:v=!0,velocityScale:M=!1,respectReducedMotion:E=!0,triggerElement:oe,onProgress:Te,onComplete:S,onEnter:P,onLeave:d,onEnterBack:x,onLeaveBack:T}=t,I=E&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,Z=typeof i=="function"?i:ne[i]??ne["ease-out"],q=Le(s.start??"top bottom"),se=Le(s.end??"bottom top"),le=oe??e,G=typeof f=="string"?document.querySelector(f):f??null,O=Object.entries(n).map(([l,h])=>({prop:Ar(l),from:Array.isArray(h)?h[0]:"",to:Array.isArray(h)?h[1]:h}));function Ne(){let l=window.getComputedStyle(e);for(let h of O)h.from===""&&(h.from=l.getPropertyValue(h.prop).trim()||"0")}function j(){for(let l of O)e.style.setProperty(l.prop,String(l.to))}let ye=new Map;for(let l of[...O.map(h=>h.prop),Qt])ye.set(l,e.style.getPropertyValue(l));function Ae(){for(let[l,h]of ye)h?e.style.setProperty(l,h):e.style.removeProperty(l)}if(I)return j(),S?.(),{...r,destroy:Ae,getProgress:()=>1};Ne();let He=typeof i=="string"?ot(i):null;function _e(){if(!v||!$r()||!He||c!=="y"||G||le!==e||m||u!==1||Te||S||P||d||x||T||M!==!1||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return!1;for(let l of O)if(!Mr.has(l.prop))return!1;return!0}function de(){let l=`ssd-a-${++Pr}`,h=O.map(X=>`${X.prop}:${X.from}`).join(";"),C=O.map(X=>`${X.prop}:${X.to}`).join(";"),F=document.createElement("style");F.setAttribute("data-ssd-animate",""),F.textContent=`@keyframes ${l}{from{${h}}to{${C}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${He};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(F),e.classList.add(l);let A=()=>c==="x"?window.scrollX:window.scrollY,te=()=>c==="x"?window.innerWidth:window.innerHeight,ae=()=>{let X=e.getBoundingClientRect();return Fe({top:X.top,height:X.height},A(),te(),q,se)};Ce(e,{type:"animate",getProgress:()=>$e.getProgress(),getTrigger:ae});let $e={refresh(){},destroy(){e.classList.remove(l),F.remove(),e.style.animationPlayState="",Ae(),De(e)},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(X){let N=Math.min(1,Math.max(0,X));e.classList.remove(l);for(let me of O)e.style.setProperty(me.prop,Xt(me.from,me.to,N))},getProgress(){let{tStart:X,tEnd:N}=ae();return Z(pe(A(),X,N,u))}};return $e}if(_e())return de();let J=0,p=0,R=0,Ve=!1,Ee=!1,Me=-1,ie=0,he=!1,Se=NaN,ze=-1,ce=0,ge=()=>G?c==="x"?G.scrollLeft:G.scrollTop:c==="x"?window.scrollX:window.scrollY,K=()=>G?c==="x"?G.clientWidth:G.clientHeight:c==="x"?window.innerWidth:window.innerHeight,_=le===e?O:[],Y=!1;function U(){let l=e.style,h=_.map(te=>l.getPropertyValue(te.prop)),C=l.transition;_.length&&(l.transition="none"),_.forEach(te=>l.setProperty(te.prop,ye.get(te.prop)??""));let F=rt(le,G,c);_.forEach((te,ae)=>l.setProperty(te.prop,h[ae])),_.length&&(e.offsetWidth,l.transition=C);let A=Fe(F,F.scroll,K(),q,se);Y&&Math.abs(A.tStart-J)<1&&Math.abs(A.tEnd-p)<1||(Y=!0,J=A.tStart,p=A.tEnd)}function V(l){e.style.setProperty(Qt,String(l));for(let h of O)e.style.setProperty(h.prop,Xt(h.from,h.to,l));Te?.(l)}function Pe(l){if(isNaN(Se)){Se=l;return}Se<=0&&l>0?P?.():Se>0&&l<=0&&T?.(),Se<1&&l>=1?d?.():Se>=1&&l<1&&x?.(),Se=l}function L(){if(!Ve||Ee)return;let l=performance.now(),h=ge(),C=u;if(M!==!1){let te=l-ce,ae=te>0?Math.abs(h-(ze<0?h:ze))/te:0;C=u*Math.max(.2,1+ae*(typeof M=="number"?M:1)*.04)}ze=h,ce=l;let F=p===J?0:(h-J)/(p-J);Pe(F);let A=Z(pe(h,J,p,C));m&&(Me=Math.max(Me,A),A=Me),ie=A,V(A),A>=1&&!he?(he=!0,S?.()):A<1&&!m&&(he=!1),R=requestAnimationFrame(L)}U(),p===J&&Q("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let l=Z(pe(ge(),J,p,u));m&&l>0&&(Me=l),ie=l,V(l)}let $=new IntersectionObserver(l=>{l.forEach(h=>{Ve=h.isIntersecting,Ve&&!Ee?R=requestAnimationFrame(L):cancelAnimationFrame(R)})},{root:G??null}),ee;function B(){clearTimeout(ee),ee=setTimeout(U,150)}window.addEventListener("resize",B),window.addEventListener("orientationchange",B);let ue=je([le],B);return $.observe(e),Ce(e,{type:"animate",getProgress:()=>ie,getTrigger:()=>({tStart:J,tEnd:p})}),{destroy(){cancelAnimationFrame(R),$.disconnect(),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),ue(),clearTimeout(ee),Ae(),De(e)},replay(){Me=-1,he=!1,ie=0,Ee=!1,V(0)},pause(){Ee=!0,cancelAnimationFrame(R)},resume(){Ee&&(Ee=!1,Ve&&(R=requestAnimationFrame(L)))},seek(l){let h=Math.min(1,Math.max(0,l));ie=h,Me=h,Ee=!0,cancelAnimationFrame(R),V(h)},getProgress(){return ie},refresh(){U()}}}var lt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Zt(e,t){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;return r?St(r,t):(Q("scrollAnimate: element not found:",e),lt)}function Jt(e,t={}){if(typeof window>"u")return lt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return Q("scrollParallax: element not found:",e),lt;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:u,onProgress:m}=t,c=-n*100,f=r.style,v=!!r.ownerSVGElement,M=f.getPropertyValue("transform-box");v&&f.setProperty("transform-box","fill-box");let E=St(r,{props:s==="x"?{transform:["translateX(0%)",`translateX(${c}%)`]}:{transform:["translateY(0%)",`translateY(${c}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:m});return v?{...E,destroy(){E.destroy(),f.setProperty("transform-box",M)}}:E}var xt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Kt(e,t){if(typeof window>"u")return xt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return Q("scrollCounter: element not found:",e),xt;let n=r,{from:s=0,to:i,format:u,easing:m="ease-out",trigger:c={},once:f=!0,decimals:v,onComplete:M}=t,E=v!==void 0?p=>p.toFixed(v):u??(p=>String(Math.round(p))),oe=typeof m=="function"?m:ne[m]??ne["ease-out"],Te=Le(c.start??"top 80%"),S=Le(c.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n.textContent=E(i),M?.(),xt;let d=0,x=0,T=!1,I=0,Z=!1,q=!1,se=-1,le=0,G=!1,O=()=>window.scrollY,Ne=()=>window.innerHeight;function j(){let p=n.getBoundingClientRect(),R=Fe({top:p.top,height:p.height},O(),Ne(),Te,S);T&&Math.abs(R.tStart-d)<1&&Math.abs(R.tEnd-x)<1||(T=!0,d=R.tStart,x=R.tEnd)}function ye(p){n.textContent=E(s+(i-s)*p),n.style.setProperty("--scroll-draw-progress",String(p))}function Ae(){if(!Z||q)return;let p=oe(pe(O(),d,x,1));f&&(se=Math.max(se,p),p=se),le=p,ye(p),p>=1&&!G?(G=!0,M?.()):p<1&&!f&&(G=!1),I=requestAnimationFrame(Ae)}j();{let p=oe(pe(O(),d,x,1));f&&p>0&&(se=p),le=p,ye(p)}let He=new IntersectionObserver(p=>{p.forEach(R=>{Z=R.isIntersecting,Z&&!q?I=requestAnimationFrame(Ae):cancelAnimationFrame(I)})}),_e;function de(){clearTimeout(_e),_e=setTimeout(j,150)}window.addEventListener("resize",de),window.addEventListener("orientationchange",de);let J=je([n],de);return He.observe(n),Ce(n,{type:"counter",getProgress:()=>le,getTrigger:()=>({tStart:d,tEnd:x})}),{destroy(){cancelAnimationFrame(I),He.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),J(),clearTimeout(_e),De(n)},replay(){se=-1,G=!1,le=0,q=!1,ye(0)},pause(){q=!0,cancelAnimationFrame(I)},resume(){q&&(q=!1,Z&&(I=requestAnimationFrame(Ae)))},seek(p){let R=Math.min(1,Math.max(0,p));le=R,se=R,q=!0,cancelAnimationFrame(I),ye(R)},getProgress(){return le}}}var er="http://www.w3.org/2000/svg",kr="cinematic-photo",Tt=e=>e<0?0:e>1?1:e;function ct(e){let t=parseFloat(e);return Number.isFinite(t)?Tt(t/100):0}function Lr(e){return ne[e]??ne.linear}var Cr={destroy:()=>{},getProgress:()=>0},ut=class{constructor(t){if(typeof document>"u"){this.mount=null;return}this.mount=typeof t.wrapper=="string"?document.querySelector(t.wrapper):t.wrapper,this.mount||Q("Cinematic: wrapper not found:",t.wrapper)}loadStory(t){let r=this.mount;if(typeof window>"u"||!r)return Cr;r.style.position="relative",r.style.height=t.totalHeight,r.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",r.appendChild(n);let s=[];for(let S of t.scenes){if(S.background){let d=document.createElement("img");d.id=kr,d.src=S.background,d.alt="",d.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(d)}let P=S.animations.filter(d=>d.type==="draw");if(P.length){let d=document.createElementNS(er,"svg");d.setAttribute("viewBox",`0 0 ${t.canvas.width} ${t.canvas.height}`),d.setAttribute("preserveAspectRatio","xMidYMid meet"),d.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(d);for(let x of P){let T=document.createElementNS(er,"path");T.id=x.target.replace(/^#/,""),T.setAttribute("d",x.d),T.setAttribute("fill","none"),T.setAttribute("stroke",x.stroke),T.setAttribute("stroke-width",String(x.strokeWidth)),T.setAttribute("stroke-linecap","round"),T.setAttribute("stroke-linejoin","round");let I=x.length||T.getTotalLength?.()||0;T.style.strokeDasharray=String(I),T.style.strokeDashoffset=String(I),d.appendChild(T),s.push({kind:"draw",el:T,start:ct(x.start),end:ct(x.end),ease:Lr(x.easing),length:I})}}for(let d of S.animations){if(d.type!=="fade")continue;let x=n.querySelector(d.target)??document.querySelector(d.target);x&&(x.style.opacity=String(d.from),s.push({kind:"fade",el:x,start:ct(d.start),end:ct(d.end),ease:ne["ease-in-out"]??ne.linear,from:d.from,to:d.to}))}}let i=0,u=()=>{let S=r.offsetHeight-window.innerHeight;return S<=0?r.getBoundingClientRect().top<=0?1:0:Tt(-r.getBoundingClientRect().top/S)},m=S=>{for(let P of s){let d=P.end-P.start,x=d<=0?S>=P.end?1:0:Tt((S-P.start)/d),T=P.ease(x);P.kind==="draw"?P.el.style.strokeDashoffset=String(P.length*(1-T)):P.el.style.opacity=String(P.from+(P.to-P.from)*T)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return m(1),{destroy:()=>{},getProgress:()=>1};let c=0,f=!1,v=!1,M=()=>{i=u(),m(i),f&&(c=requestAnimationFrame(M))},E=()=>{f||(f=!0,c=requestAnimationFrame(M))},oe=()=>{f=!1,cancelAnimationFrame(c)},Te=new IntersectionObserver(S=>{for(let P of S)v=P.isIntersecting,v?E():oe()},{threshold:0});return Te.observe(n),i=u(),m(i),Ce(r,{type:"draw",getProgress:()=>i,getTrigger:()=>{let S=r.getBoundingClientRect().top+window.scrollY;return{tStart:S,tEnd:S+Math.max(0,r.offsetHeight-window.innerHeight)}}}),{destroy(){oe(),Te.disconnect(),De(r)},getProgress:()=>i}}};if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class t extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key=""}connectedCallback(){this.build()}attributeChangedCallback(){this.instance&&this.build()}build(){let s=JSON.stringify(e.map(M=>this.getAttribute(M)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},u=this.getAttribute("speed"),m=this.getAttribute("easing"),c=this.getAttribute("stagger"),f=this.getAttribute("direction"),v=this.getAttribute("selector");u&&(i.speed=parseFloat(u)),m&&(i.easing=m),c&&(i.stagger=parseFloat(c)),f&&(i.direction=f),v&&(i.selector=v),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=at(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}t.observedAttributes=e,customElements.define("scroll-draw",t)}return fr(Dr);})();
|
|
1
|
+
"use strict";var SvgScrollDraw=(()=>{var wt=Object.defineProperty;var mr=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var pr=Object.prototype.hasOwnProperty;var dr=(e,r)=>{for(var t in r)wt(e,t,{get:r[t],enumerable:!0})},gr=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let s of fr(r))!pr.call(e,s)&&s!==t&&wt(e,s,{get:()=>r[s],enumerable:!(n=mr(r,s))||n.enumerable});return e};var yr=e=>gr(wt({},"__esModule",{value:!0}),e);var Hr={};dr(Hr,{Cinematic:()=>ft,PRESETS:()=>ot,createBounce:()=>vt,createElastic:()=>Et,createSpring:()=>Ft,scrollAnimate:()=>tr,scrollCounter:()=>nr,scrollDraw:()=>Ut,scrollParallax:()=>rr});function Ft({tension:e=2.5,friction:r=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,r)}function vt({bounces:e=3,decay:r=.5}={}){let t=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,r)),s=Math.sqrt(n),i=0,c=[];for(let p=0;p<t;p++){let S=Math.pow(s,p);c.push(S),i+=S}let f=[0],u=0;for(let p=0;p<t;p++)u+=c[p]/i,f.push(u);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let S=0;S<t;S++)if(p<=f[S+1]){let P=(p-f[S])/(f[S+1]-f[S]);if(S===0)return P*(2-P);let x=1-Math.pow(n,S);return x+(1-x)*(2*P-1)*(2*P-1)}return 1}}function Et({amplitude:e=1,period:r=.4}={}){let t=Math.max(1,e),n=Math.max(.1,r),s=t<=1?n/4:n/(2*Math.PI)*Math.asin(1/t);return i=>i<=0?0:i>=1?1:t*Math.pow(2,-10*i)*Math.sin((i-s)*(2*Math.PI)/n)+1}var te={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:vt(),elastic:Et()};function Nt(e,r,t){return Math.min(t,Math.max(r,e))}function $e(e="top bottom"){let r=e.trim();if(/^\d+(\.\d+)?%$/.test(r))return{element:"top",viewport:r};let[t="top",n="bottom"]=r.split(/\s+/).filter(Boolean);return{element:t,viewport:n}}function Ht(e,r,t,n){switch(n){case"top":return e+t;case"center":return e+t+r/2;case"bottom":return e+t+r;default:return e+t}}function _t(e,r){if(/^\d+(\.\d+)?%$/.test(e))return r*(parseFloat(e)/100);switch(e){case"top":return 0;case"center":return r/2;case"bottom":return r;default:return r}}function se(e,r,t,n){return t===r?0:Nt((e-r)/(t-r)*n,0,1)}function Fe(e,r,t,n,s){let i=Ht(e.top,e.height,r,n.element)-_t(n.viewport,t),c=Ht(e.top,e.height,r,s.element)-_t(s.viewport,t);return{tStart:i,tEnd:c}}function nt(e,r,t){let n=e.getBoundingClientRect(),s=t==="x"?n.width:n.height;return r?{top:t==="x"?n.left-r.getBoundingClientRect().left+r.scrollLeft:n.top-r.getBoundingClientRect().top+r.scrollTop,height:s,scroll:0}:{top:t==="x"?n.left:n.top,height:s,scroll:t==="x"?window.scrollX:window.scrollY}}function We(e){let r=e.tagName.toLowerCase();if(r==="rect"){let t=parseFloat(e.getAttribute("width")??"0"),n=parseFloat(e.getAttribute("height")??"0");return 2*(t+n)}if(r==="circle"){let t=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*t}return e.getTotalLength()}function Vt(e){let r=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(r)return[parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16),parseInt(r[3]+r[3],16)];let t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let n=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return n?[parseInt(n[1]),parseInt(n[2]),parseInt(n[3])]:null}function qe(e,r,t){let n=Vt(e),s=Vt(r);return!n||!s?e:`rgb(${Math.round(n[0]+(s[0]-n[0])*t)},${Math.round(n[1]+(s[1]-n[1])*t)},${Math.round(n[2]+(s[2]-n[2])*t)})`}var ot={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:!1},reveal:{easing:"ease-out",fade:!0,speed:1.2,once:!0},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:!0,speed:.75},spring:{easing:"spring",speed:1.1}};function Y(e,...r){}var hr="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",br="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",zt=33;function wr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function vr(e){let r=[];for(let t=0;t<zt;t++){let n=t/(zt-1);r.push(String(Math.round(e(n)*1e5)/1e5))}return`linear(${r.join(",")})`}function st(e){switch(e){case"linear":return"linear";case"ease-in":return hr;case"ease-out":return br;case"ease-in-out":return wr()?vr(te["ease-in-out"]):null;default:return null}}var Wt=Symbol.for("svg-scroll-draw.registry");function qt(){let e=globalThis;return e[Wt]||(e[Wt]=new Map)}function ke(e,r){qt().set(e,r)}function Se(e){qt().delete(e)}var Xe,it=new Set,at=new WeakMap,Ze=new Map,Bt=e=>{let r=e.getBoundingClientRect();return r.width+" "+r.height};function Er(e){let r=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let n=t;n;n=n.previousElementSibling)r.add(n);return r}function Be(e,r){if(typeof ResizeObserver>"u"||typeof document>"u")return()=>{};let t=()=>r();Xe??(Xe=new ResizeObserver(s=>{let i=!1;for(let{target:c}of s)at.get(c)!==Bt(c)&&(i=!0),at.set(c,"");i&&it.forEach(c=>c())})),it.add(t);let n=Er(e);return[document.body,document.documentElement].forEach(s=>s&&n.add(s)),n.forEach(s=>{at.has(s)||at.set(s,Bt(s)),Ze.set(s,(Ze.get(s)??0)+1),Xe.observe(s)}),()=>{it.delete(t)&&(n.forEach(s=>{let i=(Ze.get(s)??1)-1;if(i)return void Ze.set(s,i);Ze.delete(s),Xe?.unobserve(s)}),it.size||(Xe?.disconnect(),Xe=void 0))}}function lt(e){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let r=window.matchMedia("(prefers-reduced-motion: reduce)"),t=s=>e(!!s.matches);if(typeof r.addEventListener=="function")return r.addEventListener("change",t),()=>r.removeEventListener("change",t);let n=r;return n.addListener?.(t),()=>n.removeListener?.(t)}function Ge(e,r){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return r(e,!0);let t=r(e,!1),n=lt(i=>{if(!i)return;n();let c=(t.getProgress?.()??0)>=1;t.destroy(),t=r(c?{...e,onComplete:void 0}:e,!0)}),s={};for(let i of Object.keys(t))s[i]=(...c)=>t[i]?.(...c);return s.destroy=()=>{n(),t.destroy()},s}var Sr=0;function xr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Gt(e,r){let t="";try{t=getComputedStyle(e).getPropertyValue(r).trim()}catch{}return t||(e.getAttribute(r)??"").trim()}var jt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Tr(e){if(!!1)return;let r=Gt(e,"stroke");if(!r||r==="none"){Y("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!jt.has(t)&&!jt.has(Gt(e,"fill"))&&Y("Element has a fill \u2014 it may obscure the stroke animation.",e)}function Ar(e,r,t){let n=document.createElement("div");n.setAttribute("data-svg-scroll-draw-debug",""),n.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function s(){let i=t==="x"?window.scrollX:window.scrollY,c=e-i,f=r-i,u=t==="x";n.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${u?`left:${c}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${c}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${u?`left:${f}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${f}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`}return document.body.appendChild(n),window.addEventListener("scroll",s,{passive:!0}),s(),{el:n,destroy(){window.removeEventListener("scroll",s),n.remove()}}}var Qt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Yt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Mr(e,r,t){if(!!1)return;let n=(e.match(Yt)??[]).join("").toUpperCase(),s=(r.match(Yt)??[]).join("").toUpperCase(),i=(e.match(Qt)??[]).length,c=(r.match(Qt)??[]).length;if(n!==s){Y(`morphTo: command sequence differs (${n||"\u2205"} \u2192 ${s||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,t);return}i!==c&&Y(`morphTo: coordinate count differs (${i} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t)}function St(e,r,t){let n=(r.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),s=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,i=>{let c=parseFloat(i),f=n[s++]??c;return String(+(c+(f-c)*t).toFixed(4))})}function ct(e,r={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:Ge(r,(t,n)=>Lr(e,t,n))}function Lr(e,r,t){let{preset:n,...s}=r,i=n?{...ot[n],...s}:s,{selector:c="path, polyline, line, polygon, rect, circle",speed:f=1,fade:u=!1,easing:p="linear",trigger:S={},stagger:P=0,direction:x="forward",once:U=!1,debug:pe=!1,axis:F="y",scrollContainer:T,autoReverse:M=!1,delay:d=0,strokeColor:E,strokeWidth:w,fillOpacity:I,waypoints:z,velocityScale:N=!1,threshold:X=0,rootMargin:_e="0px",repeat:le=0,repeatDelay:ce=0,morphTo:H,clip:xe,autoplay:Ne=!1,duration:Te=1e3,native:ie=!0,onProgress:g,onStart:k,onComplete:de,onEnter:be,onLeave:Ae,onEnterBack:Me,onLeaveBack:He}=i,Z=xe===!0?"left":typeof xe=="string"?xe:!1,ge=typeof p=="function"?p:te[p]??te.linear,je=$e(S.start??"top bottom"),Qe=$e(S.end??"bottom top"),ae=typeof T=="string"?document.querySelector(T):T??null,J=Array.isArray(E)?E[0]:null,j=Array.isArray(E)?E[1]:typeof E=="string"?E:null,Q=Array.isArray(w)?w[0]:null,W=Array.isArray(w)?w[1]:typeof w=="number"?w:null,re=Array.isArray(I)?I[0]:null,G=Array.isArray(I)?I[1]:typeof I=="number"?I:null;function we(o){let l=o*100;switch(Z){case"right":return`inset(0 0 0 ${100-l}%)`;case"top":return`inset(0 0 ${100-l}% 0)`;case"bottom":return`inset(${100-l}% 0 0 0)`;case"center":return`circle(${o*150}% at 50% 50%)`;default:return`inset(0 ${100-l}% 0 0)`}}let D=Z?[]:Array.from(e.querySelectorAll(c)),L=[],ne=[],a=0,m=0,ye=P,ue=0,A=!1,C=!1,_=0,Ce=!1,R=-1,Le=[],De=-1,K=!1,ve=0,Pe=0,Oe,pt=null;function Lt(){pt?.destroy(),pt=null}let Ie=new Set,Pt=NaN,Re=!0,Je=-1,$t=performance.now(),Ve=NaN;function Ye(){return ae?F==="x"?ae.scrollLeft:ae.scrollTop:F==="x"?window.scrollX:window.scrollY}function kt(){return ae?F==="x"?ae.clientWidth:ae.clientHeight:F==="x"?window.innerWidth:window.innerHeight}function Ct(){let o=nt(e,ae,F);return Fe(o,o.scroll,kt(),je,Qe)}function sr(){let o=m-a,l=D.length-1,h=ae??document.documentElement,q=F==="x"?"Width":"Height";if(ye=P,P>0&&l>0&&o>0){let me=h[`scroll${q}`]-h[`client${q}`]-1-a-o/f;me>=0&&(ye=Math.min(P,me/(l*o)))}ue=m+l*ye*o}function Dt(){({tStart:a,tEnd:m}=Ct()),sr(),pe&&!1&&(Lt(),pt=Ar(a,m,F))}function dt(o,l=Ct){ke(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let h=o.destroy;return o.destroy=()=>{h.call(o),Se(e)},o}function ir(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),Z){let h=l==="reverse"?1-o:o;e.style.clipPath=we(h);return}D.forEach((h,q)=>{h.style.strokeDashoffset=l==="reverse"?`${L[q]*o}`:`${L[q]*(1-o)}`,u&&(h.style.opacity=l==="reverse"?`${1-o}`:`${o}`),J&&j?h.style.stroke=qe(J,j,o):j&&(h.style.stroke=j),Q!==null&&W!==null?h.style.strokeWidth=`${Q+(W-Q)*o}`:W!==null&&(h.style.strokeWidth=`${W}`),re!==null&&G!==null?h.style.fillOpacity=`${re+(G-re)*o}`:G!==null&&(h.style.fillOpacity=`${G}`),H&&h.tagName.toLowerCase()==="path"&&ne[q]&&h.setAttribute("d",St(ne[q],H,o))})}function Ke(){if(e.style.setProperty("--scroll-draw-progress","0"),Z){e.style.clipPath=we(0);return}D.forEach((o,l)=>{o.style.strokeDasharray=`${L[l]}`,o.style.strokeDashoffset=x==="reverse"?"0":`${L[l]}`,u?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",J&&(o.style.stroke=J),Q!==null&&(o.style.strokeWidth=`${Q}`),re!==null&&(o.style.fillOpacity=`${re}`),H&&o.tagName.toLowerCase()==="path"&&ne[l]&&o.setAttribute("d",ne[l])})}if(D.forEach(o=>{Tr(o);let l=We(o);L.push(l);let h=o.tagName.toLowerCase()==="path";h?ne.push(o.getAttribute("d")??""):ne.push(""),H&&(h?Mr(ne[ne.length-1],H,o):Y(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),t?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=x==="reverse"?`${l}`:"0",u&&(o.style.opacity="1"),j&&(o.style.stroke=j),W!==null&&(o.style.strokeWidth=`${W}`),G!==null&&(o.style.fillOpacity=`${G}`),H&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",H)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=x==="reverse"?"0":`${l}`,u?o.style.opacity=x==="reverse"?"1":"0":o.style.opacity="",J&&(o.style.stroke=J),Q!==null&&(o.style.strokeWidth=`${Q}`),re!==null&&(o.style.fillOpacity=`${re}`))}),Z){if(t)return e.style.clipPath=we(1),de?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=we(0)}else if(t)return de?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Ot=typeof p=="string"?st(p):null;function ar(){return!(ie===!1||!xr()||!D.length||!Ot||Z||F!=="y"||ae||f!==1||P!==0||U||M||N!==!1||H||z||le||d>0||g||k||de||be||Ae||Me||He||E!=null||w!=null||I!=null||(S.start??"top bottom").trim()!=="top bottom"||(S.end??"bottom top").trim()!=="bottom top")}function lr(){let o=++Sr,l=`svg-scroll-draw-${o}`,h=`svg-scroll-draw-host-${o}`,q=`--svg-scroll-draw-${o}`,me=x==="reverse"?"0":"var(--ssd-len)",Ee=x==="reverse"?"var(--ssd-len)":"0",he=`stroke-dashoffset:${me};`,v=`stroke-dashoffset:${Ee};`;u&&(he+=`opacity:${x==="reverse"?1:0};`,v+=`opacity:${x==="reverse"?0:1};`);let $=document.createElement("style");$.setAttribute("data-svg-scroll-draw",""),$.textContent=`@keyframes ${l}{from{${he}}to{${v}}}.${h}{view-timeline-name:${q};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Ot};animation-fill-mode:both;animation-timeline:${q};animation-range:cover 0% cover 100%;}`,document.head.appendChild($),e.classList.add(h);function ee(y,B){y.style.setProperty("--ssd-len",String(L[B])),y.style.strokeDasharray=`${L[B]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l)}D.forEach(ee);let b=!1,O=-1;function V(){if(O>=0)return O;let y=e.getBoundingClientRect(),{tStart:B,tEnd:fe}=Fe({top:y.top,height:y.height},Ye(),kt(),je,Qe);return ge(se(Ye(),B,fe,f))}return{destroy(){e.classList.remove(h),D.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState=""}),$.remove()},replay(){b=!1,O=-1,D.forEach(ee)},pause(){b=!0,D.forEach(y=>{y.style.animationPlayState="paused"})},resume(){b&&(b=!1,D.forEach(y=>{y.style.animationPlayState="running"}))},seek(y){let B=Math.min(1,Math.max(0,y));O=B,b=!0,D.forEach((fe,oe)=>{fe.classList.remove(l),fe.style.strokeDashoffset=x==="reverse"?`${L[oe]*B}`:`${L[oe]*(1-B)}`,u&&(fe.style.opacity=x==="reverse"?`${1-B}`:`${B}`)})},getProgress(){return V()},refresh(){D.forEach((y,B)=>{L[B]=We(y),y.style.setProperty("--ssd-len",String(L[B])),y.style.strokeDasharray=`${L[B]}`})}}}if(ar())return dt(lr());function cr(){let o=Math.max(1,Te),l=0,h=0,q=!1;function me(b){let O=!0;if(Z){let V=Math.min(1,Math.max(0,b/o)),y=ge(V);ve=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=we(x==="reverse"?1-y:y),g?.(y),V<1&&(O=!1)}else D.forEach((V,y)=>{let B=y*P*o,fe=Math.min(1,Math.max(0,(b-B)/o)),oe=ge(fe);V.style.strokeDashoffset=x==="reverse"?`${L[y]*oe}`:`${L[y]*(1-oe)}`,u&&(V.style.opacity=x==="reverse"?`${1-oe}`:`${oe}`),J&&j?V.style.stroke=qe(J,j,oe):j&&(V.style.stroke=j),Q!==null&&W!==null?V.style.strokeWidth=`${Q+(W-Q)*oe}`:W!==null&&(V.style.strokeWidth=`${W}`),re!==null&&G!==null?V.style.fillOpacity=`${re+(G-re)*oe}`:G!==null&&(V.style.fillOpacity=`${G}`),H&&V.tagName.toLowerCase()==="path"&&ne[y]&&V.setAttribute("d",St(ne[y],H,oe)),y===0&&(ve=oe,g?.(oe),e.style.setProperty("--scroll-draw-progress",String(oe))),fe<1&&(O=!1)});if(z){let V=Math.min(1,Math.max(0,b/o)),y=ge(V);for(let B in z){let fe=parseFloat(B);y>=fe&&!Ie.has(fe)&&(Ie.add(fe),z[B]?.())}}return O}function Ee(b){if(K)return;let O=b-l;C||(C=!0,k?.());let V=me(O);if(V&&!A){A=!0,me(o*(1+Math.max(0,D.length-1)*P)),de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Oe=setTimeout(()=>{l=performance.now(),C=!1,A=!1,Ie.clear(),Ke(),_=requestAnimationFrame(Ee)},ce));return}V||(_=requestAnimationFrame(Ee))}function he(){cancelAnimationFrame(_),clearTimeout(Oe),l=performance.now(),h=0,K=!1,C=!1,A=!1,Pe=0,q=!0,ve=0,Ie.clear(),Ke(),_=requestAnimationFrame(Ee)}let v=new IntersectionObserver(b=>{b.forEach(O=>{O.isIntersecting&&!(U&&A)?he():!O.isIntersecting&&!U&&!A&&(cancelAnimationFrame(_),clearTimeout(Oe),q=!1)})},{root:ae??null,threshold:X,rootMargin:_e}),$;function ee(){clearTimeout($),$=setTimeout(()=>{D.forEach((b,O)=>{L[O]=We(b),b.style.strokeDasharray=`${L[O]}`})},150)}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),d>0?setTimeout(()=>v.observe(e),d):v.observe(e),{destroy(){cancelAnimationFrame(_),clearTimeout(Oe),v.disconnect(),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout($)},replay(){Pe=0,he()},pause(){K||!q||(K=!0,h=performance.now()-l,cancelAnimationFrame(_))},resume(){K&&(K=!1,q=!0,l=performance.now()-h,_=requestAnimationFrame(Ee))},seek(b){let O=Math.min(1,Math.max(0,b));ve=O,K=!0,h=O*o,l=performance.now()-h,cancelAnimationFrame(_),me(h)},getProgress(){return ve},refresh(){clearTimeout($),D.forEach((b,O)=>{L[O]=We(b),b.style.strokeDasharray=`${L[O]}`})}}}if(Ne)return dt(cr());Dt();function It(){if(K||!ze)return;let o=performance.now(),l=Ye();if(!Re&&N===!1&&l===Pt){yt(l);return}Re=!1,Pt=l;let h=f;if(N!==!1){let v=o-$t,$=v>0?Math.abs(l-(Je<0?l:Je))/v:0;h=f*Math.max(.2,1+$*(typeof N=="number"?N:1)*.04)}Je=l,$t=o;let q=M?De===-1||l>=De?"forward":"reverse":x;De=l;let me=m-a,Ee=!0,he=me===0?0:(l-a)/me;if(isNaN(Ve)||(Ve<=0&&he>0?be?.():Ve>0&&he<=0&&He?.(),Ve<1&&he>=1?Ae?.():Ve>=1&&he<1&&Me?.()),Ve=he,Z){let v=ge(se(l,a,m,h));U&&!M&&(R=Math.max(R,v),v=R),ve=v,e.style.setProperty("--scroll-draw-progress",String(v));let $=q==="reverse"?1-v:v;e.style.clipPath=we($),g?.(v),!C&&se(l,a,m,h)>0&&(C=!0,k?.()),v>=1&&!A?(A=!0,de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Oe=setTimeout(()=>{R=-1,C=!1,A=!1,e.style.clipPath=we(0)},ce))):v<1&&!U&&(A=!1),yt(l);return}if(D.forEach((v,$)=>{let ee=$*ye*me,b=ge(se(l,a+ee,m+ee,h));U&&!M&&(b=Le[$]=Math.max(Le[$]??R,b)),v.style.strokeDashoffset=q==="reverse"?`${L[$]*b}`:`${L[$]*(1-b)}`,u&&(v.style.opacity=q==="reverse"?`${1-b}`:`${b}`),J&&j?v.style.stroke=qe(J,j,b):j&&(v.style.stroke=j),Q!==null&&W!==null?v.style.strokeWidth=`${Q+(W-Q)*b}`:W!==null&&(v.style.strokeWidth=`${W}`),re!==null&&G!==null?v.style.fillOpacity=`${re+(G-re)*b}`:G!==null&&(v.style.fillOpacity=`${G}`),H&&v.tagName.toLowerCase()==="path"&&ne[$]&&v.setAttribute("d",St(ne[$],H,b)),$===0&&(ve=b,g?.(b),e.style.setProperty("--scroll-draw-progress",String(b))),b<1&&(Ee=!1)}),z){let v=ge(se(l,a,m,h));for(let $ in z){let ee=parseFloat($);v>=ee&&!Ie.has(ee)&&(Ie.add(ee),z[$]?.())}}!C&&se(l,a,m,h)>0&&(C=!0,k?.()),Ee&&!A?(A=!0,de?.(),Pe<(le==="infinite"?1/0:le??0)&&(Pe++,Oe=setTimeout(()=>{R=-1,Le=[],C=!1,A=!1,Ie.clear(),Ke(),Re=!0},ce))):!Ee&&!U&&(A=!1),yt(l)}function gt(o){return o>=m&&o<ue}function yt(o){Ce||gt(o)?_=requestAnimationFrame(It):ze=!1}function ht(){return Ce||gt(Ye())}let ze=!1;function et(){ze||(ze=!0,_=requestAnimationFrame(function(){It()}))}function tt(){ze=!1,cancelAnimationFrame(_)}let bt=new IntersectionObserver(o=>{o.forEach(l=>{Ce=l.isIntersecting,Ce&&!K?(Re=!0,et()):ze&&!K&>(Ye())||tt()})},{root:ae??null,threshold:X,rootMargin:_e});function Rt(){D.forEach((o,l)=>{L[l]=We(o),o.style.strokeDasharray=`${L[l]}`}),Dt(),Re=!0}let rt;function Ue(){clearTimeout(rt),rt=setTimeout(Rt,150)}window.addEventListener("resize",Ue),window.addEventListener("orientationchange",Ue);let ur=Be([e],Ue);return d>0?setTimeout(()=>bt.observe(e),d):bt.observe(e),dt({destroy(){cancelAnimationFrame(_),clearTimeout(Oe),tt(),bt.disconnect(),ur(),window.removeEventListener("resize",Ue),window.removeEventListener("orientationchange",Ue),clearTimeout(rt),Lt()},replay(){R=-1,Le=[],De=-1,Je=-1,C=!1,A=!1,Pe=0,K=!1,ve=0,Ie.clear(),clearTimeout(Oe),Ke(),Re=!0,ht()&&et()},pause(){K=!0,tt()},resume(){K&&(K=!1,Re=!0,ht()&&et())},seek(o){let l=Math.min(1,Math.max(0,o));ve=l,R=l,Le=[],K=!0,tt(),ir(l,x),Re=!0},getProgress(){return ve},refresh(){clearTimeout(rt),Rt(),ht()&&!K&&et()}},()=>({tStart:a,tEnd:m}))}function Ut(e,r){let t={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return t;let n=typeof e=="string"?document.querySelector(e):e;return n?ct(n,r):(Y("Container not found:",e),t)}function Pr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Xt(e){let r=[],t=/([\w]+)\(([^)]*)\)/g,n;for(;(n=t.exec(e))!==null;){let s=[],i=[],c=n[2].trim();if(c)for(let f of c.split(/[\s,]+/)){let u=f.match(/^([-+]?[\d.eE]+)(.*)$/);s.push(u?parseFloat(u[1]):0),i.push(u?u[2]:"")}r.push({fn:n[1],nums:s,units:i})}return r}function $r(e,r,t){let n=Xt(e),s=Xt(r);return n.length===0||n.length!==s.length?t<1?e:r:n.map((i,c)=>{let f=s[c];return i.fn!==f.fn||i.nums.length!==f.nums.length?t<1?`${i.fn}(${i.nums.map((u,p)=>`${u}${i.units[p]}`).join(", ")})`:`${f.fn}(${f.nums.map((u,p)=>`${u}${f.units[p]}`).join(", ")})`:`${i.fn}(${i.nums.map((u,p)=>`${u+(f.nums[p]-u)*t}${i.units[p]}`).join(", ")})`}).join(" ")}function Zt(e,r,t){if(typeof e=="number"&&typeof r=="number")return String(e+(r-e)*t);let n=String(e),s=String(r);if(Pr(n))return qe(n,s,t);if(n.includes("("))return $r(n,s,t);let i=n.match(/^([-+]?[\d.]+)(.*)$/),c=s.match(/^([-+]?[\d.]+)(.*)$/);if(i&&c){let f=parseFloat(i[1]),u=parseFloat(c[1]);return`${f+(u-f)*t}${i[2]||c[2]}`}return t<1?n:s}function kr(e){return e.replace(/([A-Z])/g,r=>`-${r.toLowerCase()}`)}var Cr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Dr=0,Jt="--scroll-draw-progress";function Or(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var er={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Tt(e,r){return typeof window>"u"?er:r.respectReducedMotion===!1?Kt(e,r,!1):Ge(r,(t,n)=>Kt(e,t,n))}function Kt(e,r,t){let{props:n,trigger:s={},easing:i="ease-out",speed:c=1,once:f=!1,axis:u="y",scrollContainer:p,native:S=!0,velocityScale:P=!1,triggerElement:x,onProgress:U,onComplete:pe,onEnter:F,onLeave:T,onEnterBack:M,onLeaveBack:d}=r,E=typeof i=="function"?i:te[i]??te["ease-out"],w=$e(s.start??"top bottom"),I=$e(s.end??"bottom top"),z=x??e,N=typeof p=="string"?document.querySelector(p):p??null,X=Object.entries(n).map(([a,m])=>({prop:kr(a),from:Array.isArray(m)?m[0]:"",to:Array.isArray(m)?m[1]:m}));function _e(){let a=window.getComputedStyle(e);for(let m of X)m.from===""&&(m.from=a.getPropertyValue(m.prop).trim()||"0")}function le(){for(let a of X)e.style.setProperty(a.prop,String(a.to))}let ce=new Map;for(let a of[...X.map(m=>m.prop),Jt])ce.set(a,e.style.getPropertyValue(a));function H(){for(let[a,m]of ce)m?e.style.setProperty(a,m):e.style.removeProperty(a)}if(t)return le(),pe?.(),{...er,destroy:H,getProgress:()=>1};_e();let xe=typeof i=="string"?st(i):null;function Ne(){if(!S||!Or()||!xe||u!=="y"||N||z!==e||f||c!==1||U||pe||F||T||M||d||P!==!1||(s.start??"top bottom").trim()!=="top bottom"||(s.end??"bottom top").trim()!=="bottom top")return!1;for(let a of X)if(!Cr.has(a.prop))return!1;return!0}function Te(){let a=`ssd-a-${++Dr}`,m=X.map(R=>`${R.prop}:${R.from}`).join(";"),ye=X.map(R=>`${R.prop}:${R.to}`).join(";"),ue=document.createElement("style");ue.setAttribute("data-ssd-animate",""),ue.textContent=`@keyframes ${a}{from{${m}}to{${ye}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${xe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(ue),e.classList.add(a);let A=()=>u==="x"?window.scrollX:window.scrollY,C=()=>u==="x"?window.innerWidth:window.innerHeight,_=()=>{let R=e.getBoundingClientRect();return Fe({top:R.top,height:R.height},A(),C(),w,I)};ke(e,{type:"animate",getProgress:()=>Ce.getProgress(),getTrigger:_});let Ce={refresh(){},destroy(){e.classList.remove(a),ue.remove(),e.style.animationPlayState="",H(),Se(e)},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a)},pause(){e.style.animationPlayState="paused"},resume(){e.style.animationPlayState=""},seek(R){let Le=Math.min(1,Math.max(0,R));e.classList.remove(a);for(let De of X)e.style.setProperty(De.prop,Zt(De.from,De.to,Le))},getProgress(){let{tStart:R,tEnd:Le}=_();return E(se(A(),R,Le,c))}};return Ce}if(Ne())return Te();let ie=0,g=0,k=0,de=!1,be=!1,Ae=-1,Me=0,He=!1,Z=NaN,ge=-1,je=0,Qe=()=>N?u==="x"?N.scrollLeft:N.scrollTop:u==="x"?window.scrollX:window.scrollY,ae=()=>N?u==="x"?N.clientWidth:N.clientHeight:u==="x"?window.innerWidth:window.innerHeight,J=z===e?X:[],j=!1;function Q(){let a=e.style,m=J.map(C=>a.getPropertyValue(C.prop)),ye=a.transition;J.length&&(a.transition="none"),J.forEach(C=>a.setProperty(C.prop,ce.get(C.prop)??""));let ue=nt(z,N,u);J.forEach((C,_)=>a.setProperty(C.prop,m[_])),J.length&&(e.offsetWidth,a.transition=ye);let A=Fe(ue,ue.scroll,ae(),w,I);j&&Math.abs(A.tStart-ie)<1&&Math.abs(A.tEnd-g)<1||(j=!0,ie=A.tStart,g=A.tEnd)}function W(a){e.style.setProperty(Jt,String(a));for(let m of X)e.style.setProperty(m.prop,Zt(m.from,m.to,a));U?.(a)}function re(a){if(isNaN(Z)){Z=a;return}Z<=0&&a>0?F?.():Z>0&&a<=0&&d?.(),Z<1&&a>=1?T?.():Z>=1&&a<1&&M?.(),Z=a}function G(){if(!de||be)return;let a=performance.now(),m=Qe(),ye=c;if(P!==!1){let C=a-je,_=C>0?Math.abs(m-(ge<0?m:ge))/C:0;ye=c*Math.max(.2,1+_*(typeof P=="number"?P:1)*.04)}ge=m,je=a;let ue=g===ie?0:(m-ie)/(g-ie);re(ue);let A=E(se(m,ie,g,ye));f&&(Ae=Math.max(Ae,A),A=Ae),Me=A,W(A),A>=1&&!He?(He=!0,pe?.()):A<1&&!f&&(He=!1),k=requestAnimationFrame(G)}Q(),g===ie&&Y("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e);{let a=E(se(Qe(),ie,g,c));f&&a>0&&(Ae=a),Me=a,W(a)}let we=new IntersectionObserver(a=>{a.forEach(m=>{de=m.isIntersecting,de&&!be?k=requestAnimationFrame(G):cancelAnimationFrame(k)})},{root:N??null}),D;function L(){clearTimeout(D),D=setTimeout(Q,150)}window.addEventListener("resize",L),window.addEventListener("orientationchange",L);let ne=Be([z],L);return we.observe(e),ke(e,{type:"animate",getProgress:()=>Me,getTrigger:()=>({tStart:ie,tEnd:g})}),{destroy(){cancelAnimationFrame(k),we.disconnect(),window.removeEventListener("resize",L),window.removeEventListener("orientationchange",L),ne(),clearTimeout(D),H(),Se(e)},replay(){Ae=-1,He=!1,Me=0,be=!1,W(0)},pause(){be=!0,cancelAnimationFrame(k)},resume(){be&&(be=!1,de&&(k=requestAnimationFrame(G)))},seek(a){let m=Math.min(1,Math.max(0,a));Me=m,Ae=m,be=!0,cancelAnimationFrame(k),W(m)},getProgress(){return Me},refresh(){Q()}}}var ut={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function tr(e,r){if(typeof window>"u")return ut;let t=typeof e=="string"?document.querySelector(e):e;return t?Tt(t,r):(Y("scrollAnimate: element not found:",e),ut)}function rr(e,r={}){if(typeof window>"u")return ut;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return Y("scrollParallax: element not found:",e),ut;let{speed:n=.3,axis:s="y",easing:i="linear",trigger:c,onProgress:f}=r,u=-n*100,p=t.style,S=!!t.ownerSVGElement,P=p.getPropertyValue("transform-box");S&&p.setProperty("transform-box","fill-box");let x=Tt(t,{props:s==="x"?{transform:["translateX(0%)",`translateX(${u}%)`]}:{transform:["translateY(0%)",`translateY(${u}%)`]},trigger:c??{start:"top bottom",end:"bottom top"},easing:i,native:!1,onProgress:f});return S?{...x,destroy(){x.destroy(),p.setProperty("transform-box",P)}}:x}var At={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nr(e,r){if(typeof window>"u")return At;let t=typeof e=="string"?document.querySelector(e):e;return t?Ge(r,(n,s)=>Ir(t,n,s)):(Y("scrollCounter: element not found:",e),At)}function Ir(e,r,t){let{from:n=0,to:s,format:i,easing:c="ease-out",trigger:f={},once:u=!0,decimals:p,onComplete:S}=r,P=p!==void 0?g=>g.toFixed(p):i??(g=>String(Math.round(g))),x=typeof c=="function"?c:te[c]??te["ease-out"],U=$e(f.start??"top 80%"),pe=$e(f.end??"top 20%");if(t)return e.textContent=P(s),S?.(),{...At,getProgress:()=>1};let F=0,T=0,M=!1,d=0,E=!1,w=!1,I=-1,z=0,N=!1,X=()=>window.scrollY,_e=()=>window.innerHeight;function le(){let g=e.getBoundingClientRect(),k=Fe({top:g.top,height:g.height},X(),_e(),U,pe);M&&Math.abs(k.tStart-F)<1&&Math.abs(k.tEnd-T)<1||(M=!0,F=k.tStart,T=k.tEnd)}function ce(g){e.textContent=P(n+(s-n)*g),e.style.setProperty("--scroll-draw-progress",String(g))}function H(){if(!E||w)return;let g=x(se(X(),F,T,1));u&&(I=Math.max(I,g),g=I),z=g,ce(g),g>=1&&!N?(N=!0,S?.()):g<1&&!u&&(N=!1),d=requestAnimationFrame(H)}le();{let g=x(se(X(),F,T,1));u&&g>0&&(I=g),z=g,ce(g)}let xe=new IntersectionObserver(g=>{g.forEach(k=>{E=k.isIntersecting,E&&!w?d=requestAnimationFrame(H):cancelAnimationFrame(d)})}),Ne;function Te(){clearTimeout(Ne),Ne=setTimeout(le,150)}window.addEventListener("resize",Te),window.addEventListener("orientationchange",Te);let ie=Be([e],Te);return xe.observe(e),ke(e,{type:"counter",getProgress:()=>z,getTrigger:()=>({tStart:F,tEnd:T})}),{destroy(){cancelAnimationFrame(d),xe.disconnect(),window.removeEventListener("resize",Te),window.removeEventListener("orientationchange",Te),ie(),clearTimeout(Ne),Se(e)},replay(){I=-1,N=!1,z=0,w=!1,ce(0)},pause(){w=!0,cancelAnimationFrame(d)},resume(){w&&(w=!1,E&&(d=requestAnimationFrame(H)))},seek(g){let k=Math.min(1,Math.max(0,g));z=k,I=k,w=!0,cancelAnimationFrame(d),ce(k)},getProgress(){return z}}}var or="http://www.w3.org/2000/svg",Rr="cinematic-photo",Mt=e=>e<0?0:e>1?1:e;function mt(e){let r=parseFloat(e);return Number.isFinite(r)?Mt(r/100):0}function Fr(e){return te[e]??te.linear}var Nr={destroy:()=>{},getProgress:()=>0},ft=class{constructor(r){if(typeof document>"u"){this.mount=null;return}this.mount=typeof r.wrapper=="string"?document.querySelector(r.wrapper):r.wrapper,this.mount||Y("Cinematic: wrapper not found:",r.wrapper)}loadStory(r){let t=this.mount;if(typeof window>"u"||!t)return Nr;t.style.position="relative",t.style.height=r.totalHeight,t.style.display="block";let n=document.createElement("div");n.setAttribute("data-cinematic-stage",""),n.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(n);let s=[];for(let T of r.scenes){if(T.background){let d=document.createElement("img");d.id=Rr,d.src=T.background,d.alt="",d.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",n.appendChild(d)}let M=T.animations.filter(d=>d.type==="draw");if(M.length){let d=document.createElementNS(or,"svg");d.setAttribute("viewBox",`0 0 ${r.canvas.width} ${r.canvas.height}`),d.setAttribute("preserveAspectRatio","xMidYMid meet"),d.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",n.appendChild(d);for(let E of M){let w=document.createElementNS(or,"path");w.id=E.target.replace(/^#/,""),w.setAttribute("d",E.d),w.setAttribute("fill","none"),w.setAttribute("stroke",E.stroke),w.setAttribute("stroke-width",String(E.strokeWidth)),w.setAttribute("stroke-linecap","round"),w.setAttribute("stroke-linejoin","round");let I=E.length||w.getTotalLength?.()||0;w.style.strokeDasharray=String(I),w.style.strokeDashoffset=String(I),d.appendChild(w),s.push({kind:"draw",el:w,start:mt(E.start),end:mt(E.end),ease:Fr(E.easing),length:I})}}for(let d of T.animations){if(d.type!=="fade")continue;let E=n.querySelector(d.target)??document.querySelector(d.target);E&&(E.style.opacity=String(d.from),s.push({kind:"fade",el:E,start:mt(d.start),end:mt(d.end),ease:te["ease-in-out"]??te.linear,from:d.from,to:d.to}))}}let i=0,c=()=>{let T=t.offsetHeight-window.innerHeight;return T<=0?t.getBoundingClientRect().top<=0?1:0:Mt(-t.getBoundingClientRect().top/T)},f=T=>{for(let M of s){let d=M.end-M.start,E=d<=0?T>=M.end?1:0:Mt((T-M.start)/d),w=M.ease(E);M.kind==="draw"?M.el.style.strokeDashoffset=String(M.length*(1-w)):M.el.style.opacity=String(M.from+(M.to-M.from)*w)}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return f(1),{destroy:()=>{},getProgress:()=>1};let u=0,p=!1,S=!1,P=()=>{i=c(),f(i),p&&(u=requestAnimationFrame(P))},x=()=>{p||(p=!0,u=requestAnimationFrame(P))},U=()=>{p=!1,cancelAnimationFrame(u)},pe=new IntersectionObserver(T=>{for(let M of T)S=M.isIntersecting,S?x():U()},{threshold:0});pe.observe(n),i=c(),f(i),ke(t,{type:"draw",getProgress:()=>i,getTrigger:()=>{let T=t.getBoundingClientRect().top+window.scrollY;return{tStart:T,tEnd:T+Math.max(0,t.offsetHeight-window.innerHeight)}}});let F=lt(T=>{T&&(F(),U(),pe.disconnect(),Se(t),i=1,f(1))});return{destroy(){F(),U(),pe.disconnect(),Se(t)},getProgress:()=>i}}};if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class r extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key=""}connectedCallback(){this.build()}attributeChangedCallback(){this.instance&&this.build()}build(){let s=JSON.stringify(e.map(P=>this.getAttribute(P)));if(this.instance&&s===this.key)return;this.instance?.destroy(),this.key=s;let i={},c=this.getAttribute("speed"),f=this.getAttribute("easing"),u=this.getAttribute("stagger"),p=this.getAttribute("direction"),S=this.getAttribute("selector");c&&(i.speed=parseFloat(c)),f&&(i.easing=f),u&&(i.stagger=parseFloat(u)),p&&(i.direction=p),S&&(i.selector=S),this.hasAttribute("fade")&&(i.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(i.once=this.getAttribute("once")!=="false"),this.instance=ct(this,i)}disconnectedCallback(){this.instance?.destroy(),this.instance=null}}r.observedAttributes=e,customElements.define("scroll-draw",r)}return yr(Hr);})();
|
package/dist/cdn/vivus.global.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{function g(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function m(r,...t){}var E=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],V=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function $(r){if(typeof window>"u")return!1;let t=window,e=n=>typeof t[n]=="function"&&r instanceof t[n];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var y=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],S=["line","ellipse","circle","polygon","polyline","rect"],A="http://www.w3.org/2000/svg";function v(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let n=[];for(let s=0;s<t.length;s+=2)n.push(`${t[s]},${t[s+1]}`);t=n}let e=`M${t[0]}`;for(let n=1;n<t.length;n++)t[n].indexOf(",")!==-1&&(e+=`L${t[n]}`);return e}function b(r,t,e,n){let s=parseFloat(e)||0,a=parseFloat(n)||0,i=parseFloat(r)||0,o=parseFloat(t)||0,l=i-s,h=i+s;return`M${l},${o}A${s},${a} 0,1,1 ${h},${o}A${s},${a} 0,1,1 ${l},${o}`}var x={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,n=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,i=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?i:a,0),n/2),i=Math.min(Math.max(i<0?a:i,0),s/2);let o=`A ${a},${i},0,0,1,`;return`M ${t+a},${e} L ${t+n-a},${e} ${o}${t+n},${e+i} L ${t+n},${e+s-i} ${o}${t+n-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-i} L ${t},${e+i} ${o}${t+a},${e}`}return`M${t} ${e} L${t+n} ${e} L${t+n} ${e+s} L${t} ${e+s} Z`},polyline:v,polygon:r=>`${v(r)}Z`,ellipse:r=>b(r.cx,r.cy,r.rx,r.ry),circle:r=>b(r.cx,r.cy,r.r,r.r)};function L(r){for(let t of Array.from(r.querySelectorAll(S.join(",")))){let e={};for(let{name:a,value:i}of Array.from(t.attributes)){if(y.indexOf(a)!==-1&&i.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=i}let n=x[t.tagName.toLowerCase()](e),s=document.createElementNS(A,"path");for(let{name:a,value:i}of Array.from(t.attributes))y.indexOf(a)===-1&&s.setAttribute(a,i);s.setAttribute("d",n),t.parentNode?.replaceChild(s,t)}}var c=class c{constructor(t,e,n){this.isReady=!1;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=!1;this.reverseStack=!1;this.selfDestroy=!1;this.ignoreInvisible=!1;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.setElement(t,e),this.setOptions(e),this.setCallback(n),this.isReady&&this.init()}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let n=t;if(typeof n=="string"){let s=document.getElementById(n);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');n=s}if(this.parentEl=n,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let i=a.querySelector("svg");if(!i)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=i,i.setAttribute("width","100%"),i.setAttribute("height","100%"),this.parentEl.appendChild(i),this.isReady=!0,this.init()}),s.open("GET",e.file),s.send();return}if($(n)){this.el=n,this.isReady=!0;return}if(n instanceof HTMLObjectElement){let s=n,a=i=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&i)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=!0,this.init())};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&E.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&V.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let n=navigator.userAgent,s=n.indexOf("MSIE")!==-1||n.indexOf("Trident/")!==-1||n.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:!1,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{})}mapping(){let t=0,e=0,n=0,s=!1,a=Array.from(this.el.querySelectorAll("path"));a.forEach((i,o)=>{if(this.isInvisible(i))return;let l={el:i,length:0,startAt:0,duration:0,isResizeSensitive:!1},h=1;if(i.getAttribute("vector-effect")==="non-scaling-stroke"){let d=i.getBoundingClientRect(),f=i.getBBox();h=Math.max(d.width/f.width,d.height/f.height),l.isResizeSensitive=!0,s=!0}if(l.length=Math.ceil(i.getTotalLength()*h),isNaN(l.length)){m("vivus: cannot retrieve a path element length",i);return}this.map.push(l),i.style.strokeDasharray=`${l.length} ${l.length+this.dashGap*2}`,i.style.strokeDashoffset=String(l.length+this.dashGap),l.length+=this.dashGap,e+=l.length,this.renderPath(o)}),s&&m("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((i,o)=>{let l=()=>{let h={};for(let{name:d,value:f}of Array.from(i.el.attributes))h[d]=f;return h};switch(this.type){case"delayed":i.startAt=this.delayUnit*o,i.duration=this.duration-this.delay;break;case"oneByOne":i.startAt=n/e*this.duration,i.duration=i.length/e*this.duration;break;case"sync":case"async":case"nsync":i.startAt=0,i.duration=this.duration;break;case"scenario-sync":{let h=l();i.startAt=t+(u(h["data-delay"],this.delayUnit)||0),i.duration=u(h["data-duration"],this.duration),t=h["data-async"]!==void 0?i.startAt:i.startAt+i.duration,this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}case"scenario":{let h=l();i.startAt=u(h["data-start"],this.delayUnit)||0,i.duration=u(h["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,i.startAt+i.duration);break}}n+=i.length,this.frameLength=this.frameLength||this.duration})}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()))}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),n=t.el.getBBox(),s=Math.max(e.width/n.width,e.height/n.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`}this.trace(),this.mustRecalcScale=null}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else{this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished()}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this)}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,n)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(n))})}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let n=e.el.cloneNode(!0);e.el.parentNode?.replaceChild(n,e.el),e.el=n}init(){this.frameLength=0,this.currentFrame=0,this.map=[],L(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this)}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null)};this.viewportListener=t,window.addEventListener("scroll",t),t()}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let n=t;if(n&&typeof n=="function")this.instanceCallback=n,n=void 0;else if(n&&typeof n!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=n||1,g()?(this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e)})}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let n=t.getBoundingClientRect();return!n.width&&!n.height}return!1}isInViewport(t,e=0){let n=window.pageYOffset||document.documentElement.scrollTop,s=n+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),i=n+a.top;return i+a.height*(e||0)<=s&&i+a.height>=n}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,n=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(n*(2.5*Math.PI)))+1;return 1-s+a*s};var p=c,w=p;globalThis.Vivus=w;})();
|
|
1
|
+
"use strict";(()=>{function g(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function y(r){if(typeof window>"u"||typeof window.matchMedia!="function")return()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),e=s=>r(!!s.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",e),()=>t.removeEventListener("change",e);let i=t;return i.addListener?.(e),()=>i.removeListener?.(e)}function m(r,...t){}var L=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],V=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function M(r){if(typeof window>"u")return!1;let t=window,e=i=>typeof t[i]=="function"&&r instanceof t[i];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var v=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],$=["line","ellipse","circle","polygon","polyline","rect"],R="http://www.w3.org/2000/svg";function w(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let i=[];for(let s=0;s<t.length;s+=2)i.push(`${t[s]},${t[s+1]}`);t=i}let e=`M${t[0]}`;for(let i=1;i<t.length;i++)t[i].indexOf(",")!==-1&&(e+=`L${t[i]}`);return e}function b(r,t,e,i){let s=parseFloat(e)||0,a=parseFloat(i)||0,n=parseFloat(r)||0,o=parseFloat(t)||0,h=n-s,l=n+s;return`M${h},${o}A${s},${a} 0,1,1 ${l},${o}A${s},${a} 0,1,1 ${h},${o}`}var S={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,i=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,n=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?n:a,0),i/2),n=Math.min(Math.max(n<0?a:n,0),s/2);let o=`A ${a},${n},0,0,1,`;return`M ${t+a},${e} L ${t+i-a},${e} ${o}${t+i},${e+n} L ${t+i},${e+s-n} ${o}${t+i-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-n} L ${t},${e+n} ${o}${t+a},${e}`}return`M${t} ${e} L${t+i} ${e} L${t+i} ${e+s} L${t} ${e+s} Z`},polyline:w,polygon:r=>`${w(r)}Z`,ellipse:r=>b(r.cx,r.cy,r.rx,r.ry),circle:r=>b(r.cx,r.cy,r.r,r.r)};function x(r){for(let t of Array.from(r.querySelectorAll($.join(",")))){let e={};for(let{name:a,value:n}of Array.from(t.attributes)){if(v.indexOf(a)!==-1&&n.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=n}let i=S[t.tagName.toLowerCase()](e),s=document.createElementNS(R,"path");for(let{name:a,value:n}of Array.from(t.attributes))v.indexOf(a)===-1&&s.setAttribute(a,n);s.setAttribute("d",i),t.parentNode?.replaceChild(s,t)}}var c=class c{constructor(t,e,i){this.isReady=!1;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=!1;this.reverseStack=!1;this.selfDestroy=!1;this.ignoreInvisible=!1;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.unwatchMotion=()=>{};this.setElement(t,e),this.setOptions(e),this.setCallback(i),this.isReady&&this.init(),this.unwatchMotion=y(s=>{s&&this.handle&&this.endNow()})}endNow(){this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished()}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let i=t;if(typeof i=="string"){let s=document.getElementById(i);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');i=s}if(this.parentEl=i,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let n=a.querySelector("svg");if(!n)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=n,n.setAttribute("width","100%"),n.setAttribute("height","100%"),this.parentEl.appendChild(n),this.isReady=!0,this.init()}),s.open("GET",e.file),s.send();return}if(M(i)){this.el=i,this.isReady=!0;return}if(i instanceof HTMLObjectElement){let s=i,a=n=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&n)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=!0,this.init())};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&L.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&V.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let i=navigator.userAgent,s=i.indexOf("MSIE")!==-1||i.indexOf("Trident/")!==-1||i.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:!1,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{})}mapping(){let t=0,e=0,i=0,s=!1,a=Array.from(this.el.querySelectorAll("path"));a.forEach((n,o)=>{if(this.isInvisible(n))return;let h={el:n,length:0,startAt:0,duration:0,isResizeSensitive:!1},l=1;if(n.getAttribute("vector-effect")==="non-scaling-stroke"){let d=n.getBoundingClientRect(),f=n.getBBox();l=Math.max(d.width/f.width,d.height/f.height),h.isResizeSensitive=!0,s=!0}if(h.length=Math.ceil(n.getTotalLength()*l),isNaN(h.length)){m("vivus: cannot retrieve a path element length",n);return}this.map.push(h),n.style.strokeDasharray=`${h.length} ${h.length+this.dashGap*2}`,n.style.strokeDashoffset=String(h.length+this.dashGap),h.length+=this.dashGap,e+=h.length,this.renderPath(o)}),s&&m("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((n,o)=>{let h=()=>{let l={};for(let{name:d,value:f}of Array.from(n.el.attributes))l[d]=f;return l};switch(this.type){case"delayed":n.startAt=this.delayUnit*o,n.duration=this.duration-this.delay;break;case"oneByOne":n.startAt=i/e*this.duration,n.duration=n.length/e*this.duration;break;case"sync":case"async":case"nsync":n.startAt=0,n.duration=this.duration;break;case"scenario-sync":{let l=h();n.startAt=t+(u(l["data-delay"],this.delayUnit)||0),n.duration=u(l["data-duration"],this.duration),t=l["data-async"]!==void 0?n.startAt:n.startAt+n.duration,this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}case"scenario":{let l=h();n.startAt=u(l["data-start"],this.delayUnit)||0,n.duration=u(l["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}}i+=n.length,this.frameLength=this.frameLength||this.duration})}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()))}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),i=t.el.getBBox(),s=Math.max(e.width/i.width,e.height/i.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`}this.trace(),this.mustRecalcScale=null}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else{this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished()}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this)}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,i)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(i))})}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let i=e.el.cloneNode(!0);e.el.parentNode?.replaceChild(i,e.el),e.el=i}init(){this.frameLength=0,this.currentFrame=0,this.map=[],x(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this)}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null)};this.viewportListener=t,window.addEventListener("scroll",t),t()}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let i=t;if(i&&typeof i=="function")this.instanceCallback=i,i=void 0;else if(i&&typeof i!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=i||1,g()?(this.endNow(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.unwatchMotion(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e)})}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let i=t.getBoundingClientRect();return!i.width&&!i.height}return!1}isInViewport(t,e=0){let i=window.pageYOffset||document.documentElement.scrollTop,s=i+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),n=i+a.top;return n+a.height*(e||0)<=s&&n+a.height>=i}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,i=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(i*(2.5*Math.PI)))+1;return 1-s+a*s};var p=c,E=p;globalThis.Vivus=E;})();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-5PJEKEEP.mjs';function i(n,t){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t(n,true);let e=t(n,false),d=a(o=>{if(!o)return;d();let s=(e.getProgress?.()??0)>=1;e.destroy(),e=t(s?{...n,onComplete:void 0}:n,true);}),r={};for(let o of Object.keys(e))r[o]=(...s)=>e[o]?.(...s);return r.destroy=()=>{d(),e.destroy();},r}export{i as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-AJ22VSHC.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';var ee="4.0.9",X=()=>typeof window<"u"&&typeof document<"u",H=e=>e!==null&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]";function q(e,...n){for(let t of n)if(H(t))for(let o of Object.keys(t)){let i=t[o];H(i)?(H(e[o])||(e[o]={}),q(e[o],i)):e[o]=i;}return e}function $(e){if(typeof e=="string")try{return Array.from(document.querySelectorAll(e))}catch{return []}return e instanceof Element?[e]:e&&typeof e.length=="number"?Array.from(e).filter(n=>n instanceof Element):[]}var A=(e=navigator.userAgent)=>/Android|iPhone|iPad|iPod/i.test(e),G=false;function W(e,...n){G&&typeof console<"u"&&console.log(`%cScrollReveal: ${e}${n.map(t=>`
|
|
2
|
+
\u2014 ${t}`).join("")}`,"color: #ea654b;");}var I=()=>[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function se(e,n){let t=[];for(let o=0;o<4;o++)for(let i=0;i<4;i++){let r=0;for(let s=0;s<4;s++)r+=e[i+4*s]*n[4*o+s];t[i+4*o]=r;}return t}function le(e){let n=/matrix(3d)?\(([^)]+)\)/.exec(e||"");if(!n)return I();let t=n[2].split(", ").map(parseFloat);if(t.length===16)return t;let o=I();return [o[0],o[1],o[4],o[5],o[12],o[13]]=t,o}function N(e,n){let t=Math.PI/180*n,o=Math.cos(t),i=Math.sin(t),r=I(),[s,a,c,R]=e==="x"?[5,10,6,9]:e==="y"?[0,10,8,2]:[0,5,1,4];return r[s]=r[a]=o,r[c]=i,r[R]=-i,r}function ae(e,n){let t=I();return t[e==="X"?12:13]=n,t}function ce(e){let n=I();return n[0]=n[5]=e,n}function w(e,n){for(let t of n.split(";")){let o=t.indexOf(":");if(o<1)continue;let i=t.slice(0,o).trim(),r=t.slice(o+1).trim();i&&r&&e.style.setProperty(i,r);}}function de(e){let{node:n,config:t}=e,o=window.getComputedStyle(n),i=(n.getAttribute("style")||"").match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[],r=i.map(d=>d.trim()),s=`${r.join("; ")};`,a=i.some(d=>/visibility\s?:\s?visible/i.test(d))?s:`${[...r,"visibility: visible"].join("; ")};`,c=parseFloat(o.opacity),R=t.opacity!==null&&!isNaN(parseFloat(String(t.opacity)))?parseFloat(String(t.opacity)):c,b=c!==R?{computed:`opacity: ${c};`,generated:`opacity: ${R};`}:{computed:"",generated:""},u=[];if(parseFloat(t.distance)){let d=t.origin==="top"||t.origin==="bottom"?"Y":"X",f=t.distance;(t.origin==="top"||t.origin==="left")&&(f=f.startsWith("-")?f.slice(1):`-${f}`);let k=f.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g)||[],m=Number(k[0]),z=k[1],M;if(z==="em")M=parseInt(o.fontSize,10)*m;else if(z==="px")M=m;else if(z==="%"){let K=n.getBoundingClientRect();M=(d==="Y"?K.height:K.width)*m/100;}else throw new RangeError("Unrecognized or missing distance unit.");u.push(ae(d,M));}t.rotate.x&&u.push(N("x",t.rotate.x)),t.rotate.y&&u.push(N("y",t.rotate.y)),t.rotate.z&&u.push(N("z",t.rotate.z)),t.scale!==1&&u.push(ce(t.scale===0?2e-4:t.scale));let p={initial:"",final:""};if(u.length){let d=le(o.transform);p={initial:`transform: matrix3d(${u.reduce(se,d).join(", ")});`,final:`transform: matrix3d(${d.join(", ")});`};}let S={delayed:"",instant:""};if(b.generated||p.initial){let d=m=>`${m/1e3}s`,f=[],k=m=>({delayed:`${m} ${d(t.duration)} ${t.easing} ${d(t.delay)}`,instant:`${m} ${d(t.duration)} ${t.easing} 0s`});o.transition&&!/all 0s|none 0s/.test(o.transition)&&f.push({delayed:o.transition,instant:o.transition}),b.generated&&f.push(k("opacity")),p.initial&&f.push(k("transform")),S={delayed:`transition: ${f.map(m=>m.delayed).join(", ")};`,instant:`transition: ${f.map(m=>m.instant).join(", ")};`};}return {inline:{computed:s,generated:a},opacity:b,position:o.position,transform:p,transition:S}}var T=(...e)=>e.filter(n=>n!=="").join(" "),ue=()=>({delay:0,distance:"0",duration:600,easing:"cubic-bezier(0.5, 0, 0, 1)",interval:0,opacity:0,origin:"bottom",rotate:{x:0,y:0,z:0},scale:1,cleanup:false,container:document.documentElement,desktop:true,mobile:true,reset:false,useDelay:"always",viewFactor:0,viewOffset:{top:0,right:0,bottom:0,left:0},afterReset:()=>{},afterReveal:()=>{},beforeReset:()=>{},beforeReveal:()=>{}}),v=null,O=null,l={containers:{},elements:{},history:[],sequences:{}},Y=true,j=null,y=0,C=false,E=null,B=false,fe=0,P=()=>fe++;function Z(e,n=false){let t=e,o=n?t.clientHeight:t.offsetHeight,i=n?t.clientWidth:t.offsetWidth,r=0,s=0,a=t;for(;a;)isNaN(a.offsetTop)||(r+=a.offsetTop),isNaN(a.offsetLeft)||(s+=a.offsetLeft),a=a.offsetParent;return {bounds:{top:r,right:s+i,bottom:r+o,left:s},height:o,width:i}}var me=e=>e.node===document.documentElement?{top:window.pageYOffset,left:window.pageXOffset}:{top:e.node.scrollTop,left:e.node.scrollLeft};function be(e){let n=l.containers[e.containerId];if(!n||!n.geometry||!n.scroll||!e.geometry)return false;let t=Math.max(0,Math.min(1,e.config.viewFactor)),o=e.config.viewOffset,i=e.geometry,r={top:i.bounds.top+i.height*t,right:i.bounds.right-i.width*t,bottom:i.bounds.bottom-i.height*t,left:i.bounds.left+i.width*t},s={top:n.geometry.bounds.top+n.scroll.top+o.top,right:n.geometry.bounds.right+n.scroll.left-o.right,bottom:n.geometry.bounds.bottom+n.scroll.top-o.bottom,left:n.geometry.bounds.left+n.scroll.left+o.left};return r.top<s.bottom&&r.right>s.left&&r.bottom>s.top&&r.left<s.right||e.styles.position==="fixed"}function te(e,n=false){let t=n?e.config.duration+e.config.delay:e.config.duration,o=0;e.timer&&(o=Date.now()-e.timer.start,clearTimeout(e.timer.clock)),(e.revealed?e.config.beforeReveal:e.config.beforeReset)(e.node),e.timer={start:Date.now(),clock:setTimeout(()=>{(e.revealed?e.config.afterReveal:e.config.afterReset)(e.node),e.timer=null,e.revealed&&!e.config.reset&&e.config.cleanup&&U(e.node);},t-o)};}function ge(e,n){let t=e.styles;e.revealed=e.seen=true,w(e.node,T(t.inline.generated,t.opacity.computed,t.transform.final,n?t.transition.delayed:t.transition.instant)),te(e,n);}function pe(e){let n=e.styles;e.revealed=false,w(e.node,T(n.inline.generated,n.opacity.generated,n.transform.initial,n.transition.instant)),te(e);}function x(e,n={}){let t=n.pristine||Y,o=e.config.useDelay,i=o==="always"||o==="onload"&&t||o==="once"&&!e.seen;if(n.reveal||e.visible&&!e.revealed)return ge(e,i);if(n.reset||!e.visible&&e.revealed&&e.config.reset)return pe(e)}function _(e,n){let t=[],o=[],i=[];return e.members.forEach((r,s)=>{l.elements[r]?.[n]&&o.push(s);}),o.length&&e.members.forEach((r,s)=>{let a=l.elements[r];a&&!a[n]&&(s<o[0]?t:i).push(s);}),{head:t,body:o,foot:i}}function L(e,n,t,o){let i=t<0?"head":"foot",r=l.elements[e.members[n+t]];e.blocked[i]=true,setTimeout(()=>{e.blocked[i]=false,r&&ne(r,o);},e.interval);}function ne(e,n=Y){if(!e.visible&&e.revealed&&e.config.reset)return x(e,{reset:true});let t=e.sequence&&l.sequences[e.sequence.id];if(!t||!e.sequence)return;let o=e.sequence.index,i=_(t,"visible"),r=_(t,"revealed");if(!r.body.length){let a=i.body[0],c=l.elements[t.members[a]];if(c)return L(t,a,-1,n),L(t,a,1,n),x(c,{reveal:true,pristine:n})}let s=a=>a[a.length-1];if(!t.blocked.head&&o===s(r.head)&&o>=(i.body[0]??1/0))return L(t,o,-1,n),x(e,{reveal:true,pristine:n});if(!t.blocked.foot&&o===r.foot[0]&&o<=(s(i.body)??-1/0))return L(t,o,1,n),x(e,{reveal:true,pristine:n})}function ve(){y=0;let e=B;B=false;for(let t of Object.values(l.containers))(e||!t.geometry)&&(t.geometry=Z(t.node,true)),t.scroll=me(t);let n=Object.values(l.elements);for(let t of n)(e||!t.geometry)&&(t.geometry=Z(t.node)),t.visible=be(t);for(let t of n)t.sequence?ne(t):x(t);Y=false;}function g(e){let n=e?e.type:"init";(n==="init"||n==="resize")&&(B=true),y||(y=requestAnimationFrame(ve));}var h=e=>e.node===document.documentElement?window:e.node;function oe(){let e=new Set(Array.from(document.querySelectorAll("[data-sr-id]")).map(o=>parseInt(o.getAttribute("data-sr-id")||"",10)));for(let o of Object.values(l.elements))e.has(o.id)||delete l.elements[o.id];let n=new Set,t=new Set;for(let o of Object.values(l.elements))n.add(o.containerId),o.sequence&&t.add(o.sequence.id);for(let o of Object.values(l.containers))n.has(o.id)||(h(o).removeEventListener("scroll",g),h(o).removeEventListener("resize",g),delete l.containers[o.id]);for(let o of Object.values(l.sequences))t.has(o.id)||delete l.sequences[o.id];}function V(){j=null,oe();let e=C||a();for(let n of Object.values(l.elements)){let t=n.styles;e?(n.visible=n.revealed=n.seen=true,w(n.node,T(t.inline.generated,t.opacity.computed,t.transform.final,"transition: none;"))):n.visible?(n.revealed=true,w(n.node,T(t.inline.generated,t.opacity.computed,t.transform.final))):(n.revealed=false,w(n.node,T(t.inline.generated,t.opacity.generated,t.transform.initial)));}if(e){for(let n of Object.values(l.containers))h(n).removeEventListener("scroll",g),h(n).removeEventListener("resize",g);y&&cancelAnimationFrame(y),y=0;return}for(let n of Object.values(l.containers))h(n).addEventListener("scroll",g),h(n).addEventListener("resize",g);g();}function ie(e,n={},t=false){if(!v)return;let o=[],i=n.interval||0,r,s;try{if(i){let c=Math.abs(i);if(isNaN(c))throw new RangeError("Invalid sequence interval.");r={id:P(),interval:Math.max(c,16),members:[],blocked:{head:!1,foot:!1}};}let a=$(e);if(!a.length)throw new Error("Invalid reveal target.");s=[];for(let c of a){let R=c.getAttribute("data-sr-id"),b=R!==null?l.elements[Number(R)]:void 0,u=b?q({},b):{id:P(),node:c,seen:!1,revealed:!1,visible:!1};b&&w(c,b.styles.inline.computed);let p=q({},b?b.config:v,n);if(!p.mobile&&A()||!p.desktop&&!A()){b&&U(c);continue}let S=$(p.container)[0];if(!S)throw new Error("Invalid container.");if(!S.contains(c))continue;let d=[...o,...Object.values(l.containers)].find(f=>f.node===S)?.id;d===void 0&&(d=P(),o.push({id:d,node:S})),u.config=p,u.containerId=d,u.styles=de(u),r&&(u.sequence={id:r.id,index:r.members.length},r.members.push(u.id)),s.push(u);}for(let c of s)l.elements[c.id]=c,c.node.setAttribute("data-sr-id",String(c.id));}catch(a){return W("Reveal failed.",a.message)}for(let a of o)l.containers[a.id]=a;r&&(l.sequences[r.id]=r),t||(l.history.push({target:e,options:n}),j&&clearTimeout(j),j=setTimeout(V,0));}function U(e){let n=false;for(let t of $(e)){let o=t.getAttribute("data-sr-id");if(o===null)continue;n=true;let i=l.elements[Number(o)];i&&(i.timer&&clearTimeout(i.timer.clock),w(i.node,i.styles.inline.generated),delete l.elements[i.id]),t.removeAttribute("data-sr-id");}n&&oe();}function ye(){for(let e of Object.values(l.elements))w(e.node,e.styles.inline.generated),e.node.removeAttribute("data-sr-id");for(let e of Object.values(l.containers))h(e).removeEventListener("scroll",g),h(e).removeEventListener("resize",g);y&&cancelAnimationFrame(y),y=0,l={containers:{},elements:{},history:[],sequences:{}},E?.(),E=null,C=false;}function he(){for(let e of l.history)ie(e.target,e.options,true);V();}var D=()=>(X()&&document.documentElement.classList.remove("sr"),{reveal(){},clean(){},destroy(){},sync(){},defaults:{},version:ee,noop:true});function re(){if(!X())return false;let e=document.documentElement.style;return ("transform"in e||"WebkitTransform"in e)&&("transition"in e||"WebkitTransition"in e)}function we(){document.documentElement.classList.add("sr"),document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",()=>{document.body.style.height="100%";},{once:true});}function Re(e={}){if(!X()||!re())return D();let n;try{if(n=q({},v??ue(),e),!$(n.container)[0])throw new Error("Invalid container.")}catch(t){return W("Invalid configuration.",t.message),D()}return v=n,!v.mobile&&A()||!v.desktop&&!A()?(W("This device is disabled.",`desktop: ${v.desktop}`,`mobile: ${v.mobile}`),D()):(we(),!E&&!C&&!a()&&(E=a$1(t=>{t&&(E?.(),E=null,C=true,V());})),O||(O={reveal:(t,o)=>ie(t,o),clean:U,destroy:ye,sync:he,get defaults(){return v},version:ee,noop:false},Object.defineProperty(O,"delegate",{value:g})),O)}var J=Re;J.isSupported=re;Object.defineProperty(J,"debug",{get:()=>G,set:e=>{typeof e=="boolean"&&(G=e);}});var ke=J;export{J as a,ke as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function B(e,r){let t=document.createElement("span");t.textContent=r,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function _(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(n.textContent=t,n.style.whiteSpace="pre"):(n.textContent=t,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(t)?null:n}).filter(t=>t!==null)}function Q(e){let r=e.textContent??"";return e.textContent="",r.split("").map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=t,t===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),t===" "?null:n}).filter(t=>t!==null)}function W(e){let r=_(e),t=new Map;for(let s of r){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let n=[],c=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of c){let i=t.get(s),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block",i.forEach((g,b)=>{let h=g.nextElementSibling;l.appendChild(g),b<i.length-1&&h&&h.style.whiteSpace==="pre"&&l.appendChild(h);}),n.push(l);}return e.textContent="",n.forEach((s,i)=>{e.appendChild(s),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Z(e,r,t,n){if(t<=1||n===0)return e;let c=(t-1)*n,s=r*n,i=s+(1-c);return i<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(i-s)))}function ee(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")||""}var Y={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,r={}){if(typeof window>"u")return Y;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),Y;let n=t;return a(r,(c,s)=>te(n,c,s))}function te(e,r,t){let{split:n="words",stagger:c$1=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:g=true,onComplete:b}=r,h=typeof s=="function"?s:d[s]??d["ease-out"],j=a$1(l.start??"top 85%"),G=a$1(l.end??"top 40%"),S=e.innerHTML,I=e.textContent??"",m;n==="chars"?m=Q(e):n==="lines"?m=W(e):m=_(e),B(e,I);let U=m.length;function V(o,a){i?.opacity!==void 0&&(o.style.opacity=String(i.opacity+(1-i.opacity)*a));let E=ee(a,i);E&&(o.style.transform=E);}function d$2(o){e.style.setProperty("--scroll-draw-progress",String(o)),m.forEach((a,E)=>{let K=h(Z(o,E,U,c$1));V(a,K);});}if(t)return d$2(1),b?.(),{destroy(){e.innerHTML=S;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};d$2(0);let C=0,M=0,p=0,x=false,u=false,y=-1,f=0,w=false,F=()=>window.scrollY,X=()=>window.innerHeight;function P(){let o=e.getBoundingClientRect(),a=c({top:o.top,height:o.height},F(),X(),j,G);C=a.tStart,M=a.tEnd;}function L(){if(!x||u)return;let o=b$2(F(),C,M,1);g&&(y=Math.max(y,o),o=y),f=o,d$2(o),o>=1&&!w?(w=true,b?.()):o<1&&!g&&(w=false),p=requestAnimationFrame(L);}P();let O=new IntersectionObserver(o=>{o.forEach(a=>{x=a.isIntersecting,x&&!u?p=requestAnimationFrame(L):cancelAnimationFrame(p);});}),v;function T(){clearTimeout(v),v=setTimeout(()=>{if(n==="lines"){let o=f;e.innerHTML=S,m=W(e),B(e,I),d$2(o);}P();},150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let J=d$1([e],T);return O.observe(e),a$2(e,{type:"text",getProgress:()=>f,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(p),O.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),J(),clearTimeout(v),e.innerHTML=S,b$1(e);},replay(){y=-1,w=false,f=0,u=false,d$2(0);},pause(){u=true,cancelAnimationFrame(p);},resume(){u&&(u=false,x&&(p=requestAnimationFrame(L)));},seek(o){let a=Math.min(1,Math.max(0,o));f=a,y=a,u=true,cancelAnimationFrame(p),d$2(a);},getProgress(){return f}}}export{le as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-AJ22VSHC.mjs';import {a}from'./chunk-5PJEKEEP.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var E=["delayed","sync","async","nsync","oneByOne","scenario","scenario-sync"],$=["inViewport","manual","autostart"];function u(r,t){let e=parseInt(r,10);return e>=0?e:t}function V(r){if(typeof window>"u")return false;let t=window,e=i=>typeof t[i]=="function"&&r instanceof t[i];return e("SVGSVGElement")||e("SVGGElement")||r?.constructor===t.SVGElement}var v=["cx","cy","points","r","rx","ry","x","x1","x2","y","y1","y2"],A=["line","ellipse","circle","polygon","polyline","rect"],x="http://www.w3.org/2000/svg";function b(r){let t=r.points.trim().split(" ");if(r.points.indexOf(",")===-1){let i=[];for(let s=0;s<t.length;s+=2)i.push(`${t[s]},${t[s+1]}`);t=i;}let e=`M${t[0]}`;for(let i=1;i<t.length;i++)t[i].indexOf(",")!==-1&&(e+=`L${t[i]}`);return e}function w(r,t,e,i){let s=parseFloat(e)||0,a=parseFloat(i)||0,n=parseFloat(r)||0,o=parseFloat(t)||0,h=n-s,l=n+s;return `M${h},${o}A${s},${a} 0,1,1 ${l},${o}A${s},${a} 0,1,1 ${h},${o}`}var L={line:r=>`M${r.x1||0},${r.y1||0}L${r.x2||0},${r.y2||0}`,rect(r){let t=parseFloat(r.x)||0,e=parseFloat(r.y)||0,i=parseFloat(r.width)||0,s=parseFloat(r.height)||0;if(r.rx||r.ry){let a=parseInt(r.rx,10)||-1,n=parseInt(r.ry,10)||-1;a=Math.min(Math.max(a<0?n:a,0),i/2),n=Math.min(Math.max(n<0?a:n,0),s/2);let o=`A ${a},${n},0,0,1,`;return `M ${t+a},${e} L ${t+i-a},${e} ${o}${t+i},${e+n} L ${t+i},${e+s-n} ${o}${t+i-a},${e+s} L ${t+a},${e+s} ${o}${t},${e+s-n} L ${t},${e+n} ${o}${t+a},${e}`}return `M${t} ${e} L${t+i} ${e} L${t+i} ${e+s} L${t} ${e+s} Z`},polyline:b,polygon:r=>`${b(r)}Z`,ellipse:r=>w(r.cx,r.cy,r.rx,r.ry),circle:r=>w(r.cx,r.cy,r.r,r.r)};function R(r){for(let t of Array.from(r.querySelectorAll(A.join(",")))){let e={};for(let{name:a,value:n}of Array.from(t.attributes)){if(v.indexOf(a)!==-1&&n.indexOf("%")!==-1)throw new Error("Pathformer [parseAttr]: a SVG shape got values in percentage. This cannot be transformed into 'path' tags. Please use 'viewBox'.");e[a]=n;}let i=L[t.tagName.toLowerCase()](e),s=document.createElementNS(x,"path");for(let{name:a,value:n}of Array.from(t.attributes))v.indexOf(a)===-1&&s.setAttribute(a,n);s.setAttribute("d",i),t.parentNode?.replaceChild(s,t);}}var c=class c{constructor(t,e,i){this.isReady=false;this.type="delayed";this.start="inViewport";this.duration=120;this.delay=null;this.dashGap=1;this.forceRender=false;this.reverseStack=false;this.selfDestroy=false;this.ignoreInvisible=false;this.animTimingFunction=c.LINEAR;this.pathTimingFunction=c.LINEAR;this.callback=()=>{};this.map=[];this.frameLength=0;this.currentFrame=0;this.delayUnit=0;this.speed=1;this.handle=null;this.instanceCallback=null;this.mustRecalcScale=null;this.viewportListener=null;this.unwatchMotion=()=>{};this.setElement(t,e),this.setOptions(e),this.setCallback(i),this.isReady&&this.init(),this.unwatchMotion=a(s=>{s&&this.handle&&this.endNow();});}endNow(){this.stop(),this.currentFrame=this.speed<0?0:this.frameLength,this.trace(),this.speed>0&&this.selfDestroy&&this.destroy(),this.finished();}setElement(t,e){if(t===void 0)throw new Error('Vivus [constructor]: "element" parameter is required');let i=t;if(typeof i=="string"){let s=document.getElementById(i);if(!s)throw new Error('Vivus [constructor]: "element" parameter is not related to an existing ID');i=s;}if(this.parentEl=i,e&&e.file){let s=new XMLHttpRequest;s.addEventListener("load",()=>{let a=document.createElement("div");a.innerHTML=s.responseText;let n=a.querySelector("svg");if(!n)throw new Error(`Vivus [load]: Cannot find the SVG in the loaded file : ${e.file}`);this.el=n,n.setAttribute("width","100%"),n.setAttribute("height","100%"),this.parentEl.appendChild(n),this.isReady=true,this.init();}),s.open("GET",e.file),s.send();return}if(V(i)){this.el=i,this.isReady=true;return}if(i instanceof HTMLObjectElement){let s=i,a=n=>{if(this.isReady)return;let o=s.contentDocument&&s.contentDocument.querySelector("svg");if(!o&&n)throw new Error("Vivus [constructor]: object loaded does not contain any SVG");o&&(s.getAttribute("built-by-vivus")&&(this.parentEl.insertBefore(o,s),this.parentEl.removeChild(s),o.setAttribute("width","100%"),o.setAttribute("height","100%")),this.el=o,this.isReady=true,this.init());};a(),this.isReady||s.addEventListener("load",a);return}throw new Error('Vivus [constructor]: "element" parameter is not valid (or miss the "file" attribute)')}setOptions(t){if(t!==void 0&&(t===null||t.constructor!==Object))throw new Error('Vivus [constructor]: "options" parameter must be an object');let e=t||{};if(e.type&&E.indexOf(e.type)===-1)throw new Error(`Vivus [constructor]: ${e.type} is not an existing animation \`type\``);if(e.start&&$.indexOf(e.start)===-1)throw new Error(`Vivus [constructor]: ${e.start} is not an existing \`start\` option`);this.type=e.type||"delayed",this.start=e.start||"inViewport";let i=navigator.userAgent,s=i.indexOf("MSIE")!==-1||i.indexOf("Trident/")!==-1||i.indexOf("Edge/")!==-1;if(this.duration=u(e.duration,120),this.delay=u(e.delay,null),this.dashGap=u(e.dashGap,1),this.forceRender=Object.prototype.hasOwnProperty.call(e,"forceRender")?!!e.forceRender:s,this.reverseStack=!!e.reverseStack,this.selfDestroy=!!e.selfDestroy,this.onReady=e.onReady,this.map=[],this.ignoreInvisible=Object.prototype.hasOwnProperty.call(e,"ignoreInvisible")?!!e.ignoreInvisible:false,this.animTimingFunction=e.animTimingFunction||c.LINEAR,this.pathTimingFunction=e.pathTimingFunction||c.LINEAR,this.delay!==null&&this.delay>=this.duration)throw new Error("Vivus [constructor]: delay must be shorter than duration")}setCallback(t){if(t&&typeof t!="function")throw new Error('Vivus [constructor]: "callback" parameter must be a function');this.callback=t||(()=>{});}mapping(){let t=0,e=0,i=0,s=false,a=Array.from(this.el.querySelectorAll("path"));a.forEach((n,o)=>{if(this.isInvisible(n))return;let h={el:n,length:0,startAt:0,duration:0,isResizeSensitive:false},l=1;if(n.getAttribute("vector-effect")==="non-scaling-stroke"){let d=n.getBoundingClientRect(),m=n.getBBox();l=Math.max(d.width/m.width,d.height/m.height),h.isResizeSensitive=true,s=true;}if(h.length=Math.ceil(n.getTotalLength()*l),isNaN(h.length)){b$1("vivus: cannot retrieve a path element length",n);return}this.map.push(h),n.style.strokeDasharray=`${h.length} ${h.length+this.dashGap*2}`,n.style.strokeDashoffset=String(h.length+this.dashGap),h.length+=this.dashGap,e+=h.length,this.renderPath(o);}),s&&b$1("vivus: this SVG contains non-scaling-strokes. Call instance.recalc() when the SVG is resized."),e=e===0?1:e,this.delay=this.delay===null?this.duration/3:this.delay,this.delayUnit=this.delay/(a.length>1?a.length-1:1),this.reverseStack&&this.map.reverse(),this.map.forEach((n,o)=>{let h=()=>{let l={};for(let{name:d,value:m}of Array.from(n.el.attributes))l[d]=m;return l};switch(this.type){case "delayed":n.startAt=this.delayUnit*o,n.duration=this.duration-this.delay;break;case "oneByOne":n.startAt=i/e*this.duration,n.duration=n.length/e*this.duration;break;case "sync":case "async":case "nsync":n.startAt=0,n.duration=this.duration;break;case "scenario-sync":{let l=h();n.startAt=t+(u(l["data-delay"],this.delayUnit)||0),n.duration=u(l["data-duration"],this.duration),t=l["data-async"]!==void 0?n.startAt:n.startAt+n.duration,this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}case "scenario":{let l=h();n.startAt=u(l["data-start"],this.delayUnit)||0,n.duration=u(l["data-duration"],this.duration),this.frameLength=Math.max(this.frameLength,n.startAt+n.duration);break}}i+=n.length,this.frameLength=this.frameLength||this.duration;});}recalc(){this.mustRecalcScale||(this.mustRecalcScale=requestAnimationFrame(()=>this.performLineRecalc()));}performLineRecalc(){for(let t of this.map){if(!t.isResizeSensitive)continue;let e=t.el.getBoundingClientRect(),i=t.el.getBBox(),s=Math.max(e.width/i.width,e.height/i.height);t.length=Math.ceil(t.el.getTotalLength()*s),t.el.style.strokeDasharray=`${t.length} ${t.length+this.dashGap*2}`;}this.trace(),this.mustRecalcScale=null;}draw(){if(this.currentFrame+=this.speed,this.currentFrame<=0)this.stop(),this.reset();else if(this.currentFrame>=this.frameLength)this.stop(),this.currentFrame=this.frameLength,this.trace(),this.selfDestroy&&this.destroy();else {this.trace(),this.handle=requestAnimationFrame(()=>this.draw());return}this.finished();}finished(){if(this.callback(this),this.instanceCallback){let t=this.instanceCallback;this.instanceCallback=null,t(this);}}trace(){let t=this.animTimingFunction(this.currentFrame/this.frameLength)*this.frameLength;this.map.forEach((e,i)=>{let s=this.pathTimingFunction(Math.max(0,Math.min(1,(t-e.startAt)/e.duration)));e.progress!==s&&(e.progress=s,e.el.style.strokeDashoffset=String(Math.floor(e.length*(1-s))),this.renderPath(i));});}renderPath(t){let e=this.forceRender&&this.map&&this.map[t];if(!e)return;let i=e.el.cloneNode(true);e.el.parentNode?.replaceChild(i,e.el),e.el=i;}init(){this.frameLength=0,this.currentFrame=0,this.map=[],R(this.el),this.mapping(),this.starter(),this.onReady&&this.onReady(this);}starter(){if(this.start==="manual")return;if(this.start==="autostart"){this.play();return}let t=()=>{this.isInViewport(this.parentEl,1)&&(this.play(),window.removeEventListener("scroll",t),this.viewportListener=null);};this.viewportListener=t,window.addEventListener("scroll",t),t();}getStatus(){return this.currentFrame===0?"start":this.currentFrame===this.frameLength?"end":"progress"}reset(){return this.setFrameProgress(0)}finish(){return this.setFrameProgress(1)}setFrameProgress(t){let e=Math.min(1,Math.max(0,t));return this.currentFrame=Math.round(this.frameLength*e),this.trace(),this}play(t,e){this.instanceCallback=null;let i=t;if(i&&typeof i=="function")this.instanceCallback=i,i=void 0;else if(i&&typeof i!="number")throw new Error("Vivus [play]: invalid speed");return e&&typeof e=="function"&&!this.instanceCallback&&(this.instanceCallback=e),this.speed=i||1,a$1()?(this.endNow(),this):(this.handle||this.draw(),this)}stop(){return this.handle&&(cancelAnimationFrame(this.handle),this.handle=null),this}destroy(){this.stop(),this.unwatchMotion(),this.viewportListener&&(window.removeEventListener("scroll",this.viewportListener),this.viewportListener=null),this.map.forEach((t,e)=>{t.el.style.strokeDashoffset="",t.el.style.strokeDasharray="",this.renderPath(e);});}isInvisible(t){let e=t.getAttribute("data-ignore");if(e!==null)return e!=="false";if(this.ignoreInvisible){let i=t.getBoundingClientRect();return !i.width&&!i.height}return false}isInViewport(t,e=0){let i=window.pageYOffset||document.documentElement.scrollTop,s=i+Math.max(document.documentElement.clientHeight,window.innerHeight),a=t.getBoundingClientRect(),n=i+a.top;return n+a.height*(e||0)<=s&&n+a.height>=i}};c.LINEAR=t=>t,c.EASE=t=>-Math.cos(t*Math.PI)/2+.5,c.EASE_OUT=t=>1-Math.pow(1-t,3),c.EASE_IN=t=>Math.pow(t,3),c.EASE_OUT_BOUNCE=t=>{let e=-Math.cos(t*(.5*Math.PI))+1,i=Math.pow(e,1.5),s=Math.pow(1-t,2),a=-Math.abs(Math.cos(i*(2.5*Math.PI)))+1;return 1-s+a*s};var p=c,k=p;
|
|
2
|
+
export{p as a,k as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-LTCJVVSC.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function b(e,o){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;return r?a(r,o):(b$1("scrollAnimate: element not found:",e),n)}function P(e,o={}){if(typeof window>"u")return n;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return b$1("scrollParallax: element not found:",e),n;let{speed:c=.3,axis:p="y",easing:f="linear",trigger:u,onProgress:g}=o,i=-c*100,s=r.style,m=!!r.ownerSVGElement,y=s.getPropertyValue("transform-box");m&&s.setProperty("transform-box","fill-box");let l=a(r,{props:p==="x"?{transform:["translateX(0%)",`translateX(${i}%)`]}:{transform:["translateY(0%)",`translateY(${i}%)`]},trigger:u??{start:"top bottom",end:"bottom top"},easing:f,native:false,onProgress:g});return m?{...l,destroy(){l.destroy(),s.setProperty("transform-box",y);}}:l}export{b as a,P as b};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {b as b$1,a as a$6}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-YWKPTYSG.mjs';import {a as a$2}from'./chunk-YZV4Z3EQ.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$3}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$5,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b,a as a$4}from'./chunk-LFSU6LR3.mjs';var ht={sketch:{easing:"ease-in",stagger:.1,speed:.9,fade:false},reveal:{easing:"ease-out",fade:true,speed:1.2,once:true},typewriter:{easing:"linear",stagger:.05,speed:1.5},cinematic:{easing:"ease-in-out",fade:true,speed:.75},spring:{easing:"spring",speed:1.1}};var Dt=0;function Ct(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function gt(r,y){let u="";try{u=getComputedStyle(r).getPropertyValue(y).trim();}catch{}return u||(r.getAttribute(y)??"").trim()}var vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ot(r){if(!a$4)return;let y=gt(r,"stroke");if(!y||y==="none"){b("Element has no stroke \u2014 path will not be visible.",r);return}let u=(r.getAttribute("fill")??"").trim();u&&!vt.has(u)&&!vt.has(gt(r,"fill"))&&b("Element has a fill \u2014 it may obscure the stroke animation.",r);}function Nt(r,y,u){let h=document.createElement("div");h.setAttribute("data-svg-scroll-draw-debug",""),h.style.cssText="position:fixed;pointer-events:none;z-index:9999;font-family:monospace;font-size:11px;top:0;left:0;right:0;bottom:0;";function N(){let B=u==="x"?window.scrollX:window.scrollY,F=r-B,z=y-B,H=u==="x";h.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${H?`left:${F}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${F}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
3
|
+
<div style="position:absolute;${H?`left:${z}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${z}px;left:0;right:0;border-top:2px dashed #ef4444;`}padding:2px 6px;color:#ef4444;background:rgba(0,0,0,.6)">\u25A0 end</div>`;}return document.body.appendChild(h),window.addEventListener("scroll",N,{passive:true}),N(),{el:h,destroy(){window.removeEventListener("scroll",N),h.remove();}}}var wt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,bt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Ft(r,y,u){if(!a$4)return;let h=(r.match(bt)??[]).join("").toUpperCase(),N=(y.match(bt)??[]).join("").toUpperCase(),B=(r.match(wt)??[]).length,F=(y.match(wt)??[]).length;if(h!==N){b(`morphTo: command sequence differs (${h||"\u2205"} \u2192 ${N||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,u);return}B!==F&&b(`morphTo: coordinate count differs (${B} \u2192 ${F}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,u);}function _e(r,y,u){let h=(y.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),N=0;return r.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,B=>{let F=parseFloat(B),z=h[N++]??F;return String(+(F+(z-F)*u).toFixed(4))})}function Yt(r,y={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:a(y,(u,h)=>Ht(r,u,h))}function Ht(r,y,u){let{preset:h,...N}=y,B=h?{...ht[h],...N}:N,{selector:F="path, polyline, line, polygon, rect, circle",speed:z=1,fade:H=false,easing:pe="linear",trigger:be={},stagger:J=0,direction:g="forward",once:K=false,debug:Et=false,axis:U="y",scrollContainer:Oe,autoReverse:Ee=false,delay:de=0,strokeColor:ee,strokeWidth:te,fillOpacity:re,waypoints:se,velocityScale:ye=false,threshold:Ue=0,rootMargin:je="0px",repeat:oe=0,repeatDelay:Ne=0,morphTo:P,clip:Fe,autoplay:$t=false,duration:Tt=1e3,native:kt=true,onProgress:he,onStart:$e,onComplete:le,onEnter:Xe,onLeave:Ye,onEnterBack:Qe,onLeaveBack:Ze}=B,j=Fe===true?"left":typeof Fe=="string"?Fe:false,ne=typeof pe=="function"?pe:d[pe]??d.linear,Je=a$1(be.start??"top bottom"),Ke=a$1(be.end??"bottom top"),I=typeof Oe=="string"?document.querySelector(Oe):Oe??null,V=Array.isArray(ee)?ee[0]:null,E=Array.isArray(ee)?ee[1]:typeof ee=="string"?ee:null,S=Array.isArray(te)?te[0]:null,$=Array.isArray(te)?te[1]:typeof te=="number"?te:null,x=Array.isArray(re)?re[0]:null,T=Array.isArray(re)?re[1]:typeof re=="number"?re:null;function ie(e){let t=e*100;switch(j){case "right":return `inset(0 0 0 ${100-t}%)`;case "top":return `inset(0 0 ${100-t}% 0)`;case "bottom":return `inset(${100-t}% 0 0 0)`;case "center":return `circle(${e*150}% at 50% 50%)`;default:return `inset(0 ${100-t}% 0 0)`}}let d$2=j?[]:Array.from(r.querySelectorAll(F)),l=[],L=[],M=0,D=0,Te=J,et=0,b$4=false,R=false,A=0,ke=false,X=-1,ge=[],Se=-1,v=false,q=0,_=0,Y,He=null;function tt(){He?.destroy(),He=null;}let Q=new Set,rt=NaN,Z=true,xe=-1,st=performance.now(),fe=NaN;function ve(){return I?U==="x"?I.scrollLeft:I.scrollTop:U==="x"?window.scrollX:window.scrollY}function ot(){return I?U==="x"?I.clientWidth:I.clientHeight:U==="x"?window.innerWidth:window.innerHeight}function nt(){let e=a$3(r,I,U);return c(e,e.scroll,ot(),Je,Ke)}function St(){let e=D-M,t=d$2.length-1,o=I??document.documentElement,m=U==="x"?"Width":"Height";if(Te=J,J>0&&t>0&&e>0){let C=o[`scroll${m}`]-o[`client${m}`]-1-M-e/z;C>=0&&(Te=Math.min(J,C/(t*e)));}et=D+t*Te*e;}function it(){(({tStart:M,tEnd:D}=nt())),St(),Et&&a$4&&(tt(),He=Nt(M,D,U));}function Ie(e,t=nt){a$5(r,{type:"draw",getProgress:()=>e.getProgress(),getTrigger:t});let o=e.destroy;return e.destroy=()=>{o.call(e),b$2(r);},e}function xt(e,t){if(r.style.setProperty("--scroll-draw-progress",String(e)),j){let o=t==="reverse"?1-e:e;r.style.clipPath=ie(o);return}d$2.forEach((o,m)=>{o.style.strokeDashoffset=t==="reverse"?`${l[m]*e}`:`${l[m]*(1-e)}`,H&&(o.style.opacity=t==="reverse"?`${1-e}`:`${e}`),V&&E?o.style.stroke=a$6(V,E,e):E&&(o.style.stroke=E),S!==null&&$!==null?o.style.strokeWidth=`${S+($-S)*e}`:$!==null&&(o.style.strokeWidth=`${$}`),x!==null&&T!==null?o.style.fillOpacity=`${x+(T-x)*e}`:T!==null&&(o.style.fillOpacity=`${T}`),P&&o.tagName.toLowerCase()==="path"&&L[m]&&o.setAttribute("d",_e(L[m],P,e));});}function Ae(){if(r.style.setProperty("--scroll-draw-progress","0"),j){r.style.clipPath=ie(0);return}d$2.forEach((e,t)=>{e.style.strokeDasharray=`${l[t]}`,e.style.strokeDashoffset=g==="reverse"?"0":`${l[t]}`,H?e.style.opacity=g==="reverse"?"1":"0":e.style.opacity="",V&&(e.style.stroke=V),S!==null&&(e.style.strokeWidth=`${S}`),x!==null&&(e.style.fillOpacity=`${x}`),P&&e.tagName.toLowerCase()==="path"&&L[t]&&e.setAttribute("d",L[t]);});}if(d$2.forEach(e=>{Ot(e);let t=a$2(e);l.push(t);let o=e.tagName.toLowerCase()==="path";o?L.push(e.getAttribute("d")??""):L.push(""),P&&(o?Ft(L[L.length-1],P,e):b(`morphTo only applies to <path> elements \u2014 ignored on <${e.tagName}>.`,e)),u?(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=g==="reverse"?`${t}`:"0",H&&(e.style.opacity="1"),E&&(e.style.stroke=E),$!==null&&(e.style.strokeWidth=`${$}`),T!==null&&(e.style.fillOpacity=`${T}`),P&&e.tagName.toLowerCase()==="path"&&e.setAttribute("d",P)):(e.style.strokeDasharray=`${t}`,e.style.strokeDashoffset=g==="reverse"?"0":`${t}`,H?e.style.opacity=g==="reverse"?"1":"0":e.style.opacity="",V&&(e.style.stroke=V),S!==null&&(e.style.strokeWidth=`${S}`),x!==null&&(e.style.fillOpacity=`${x}`));}),j){if(u)return r.style.clipPath=ie(1),le?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};r.style.clipPath=ie(0);}else if(u)return le?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let at=typeof pe=="string"?b$1(pe):null;function At(){return !(kt===false||!Ct()||!d$2.length||!at||j||U!=="y"||I||z!==1||J!==0||K||Ee||ye!==false||P||se||oe||de>0||he||$e||le||Xe||Ye||Qe||Ze||ee!=null||te!=null||re!=null||(be.start??"top bottom").trim()!=="top bottom"||(be.end??"bottom top").trim()!=="bottom top")}function Pt(){let e=++Dt,t=`svg-scroll-draw-${e}`,o=`svg-scroll-draw-host-${e}`,m=`--svg-scroll-draw-${e}`,C=g==="reverse"?"0":"var(--ssd-len)",G=g==="reverse"?"var(--ssd-len)":"0",W=`stroke-dashoffset:${C};`,i=`stroke-dashoffset:${G};`;H&&(W+=`opacity:${g==="reverse"?1:0};`,i+=`opacity:${g==="reverse"?0:1};`);let a=document.createElement("style");a.setAttribute("data-svg-scroll-draw",""),a.textContent=`@keyframes ${t}{from{${W}}to{${i}}}.${o}{view-timeline-name:${m};view-timeline-axis:block;}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${at};animation-fill-mode:both;animation-timeline:${m};animation-range:cover 0% cover 100%;}`,document.head.appendChild(a),r.classList.add(o);function w(s,p){s.style.setProperty("--ssd-len",String(l[p])),s.style.strokeDasharray=`${l[p]}`,s.style.strokeDashoffset="",s.style.opacity="",s.style.animationPlayState="",s.classList.add(t);}d$2.forEach(w);let n=false,f=-1;function c$1(){if(f>=0)return f;let s=r.getBoundingClientRect(),{tStart:p,tEnd:O}=c({top:s.top,height:s.height},ve(),ot(),Je,Ke);return ne(b$3(ve(),p,O,z))}return {destroy(){r.classList.remove(o),d$2.forEach(s=>{s.classList.remove(t),s.style.removeProperty("--ssd-len"),s.style.animationPlayState="";}),a.remove();},replay(){n=false,f=-1,d$2.forEach(w);},pause(){n=true,d$2.forEach(s=>{s.style.animationPlayState="paused";});},resume(){n&&(n=false,d$2.forEach(s=>{s.style.animationPlayState="running";}));},seek(s){let p=Math.min(1,Math.max(0,s));f=p,n=true,d$2.forEach((O,k)=>{O.classList.remove(t),O.style.strokeDashoffset=g==="reverse"?`${l[k]*p}`:`${l[k]*(1-p)}`,H&&(O.style.opacity=g==="reverse"?`${1-p}`:`${p}`);});},getProgress(){return c$1()},refresh(){d$2.forEach((s,p)=>{l[p]=a$2(s),s.style.setProperty("--ssd-len",String(l[p])),s.style.strokeDasharray=`${l[p]}`;});}}}if(At())return Ie(Pt());function Lt(){let e=Math.max(1,Tt),t=0,o=0,m=false;function C(n){let f=true;if(j){let c=Math.min(1,Math.max(0,n/e)),s=ne(c);q=s,r.style.setProperty("--scroll-draw-progress",String(s)),r.style.clipPath=ie(g==="reverse"?1-s:s),he?.(s),c<1&&(f=false);}else d$2.forEach((c,s)=>{let p=s*J*e,O=Math.min(1,Math.max(0,(n-p)/e)),k=ne(O);c.style.strokeDashoffset=g==="reverse"?`${l[s]*k}`:`${l[s]*(1-k)}`,H&&(c.style.opacity=g==="reverse"?`${1-k}`:`${k}`),V&&E?c.style.stroke=a$6(V,E,k):E&&(c.style.stroke=E),S!==null&&$!==null?c.style.strokeWidth=`${S+($-S)*k}`:$!==null&&(c.style.strokeWidth=`${$}`),x!==null&&T!==null?c.style.fillOpacity=`${x+(T-x)*k}`:T!==null&&(c.style.fillOpacity=`${T}`),P&&c.tagName.toLowerCase()==="path"&&L[s]&&c.setAttribute("d",_e(L[s],P,k)),s===0&&(q=k,he?.(k),r.style.setProperty("--scroll-draw-progress",String(k))),O<1&&(f=false);});if(se){let c=Math.min(1,Math.max(0,n/e)),s=ne(c);for(let p in se){let O=parseFloat(p);s>=O&&!Q.has(O)&&(Q.add(O),se[p]?.());}}return f}function G(n){if(v)return;let f=n-t;R||(R=true,$e?.());let c=C(f);if(c&&!b$4){b$4=true,C(e*(1+Math.max(0,d$2.length-1)*J)),le?.(),_<(oe==="infinite"?1/0:oe??0)&&(_++,Y=setTimeout(()=>{t=performance.now(),R=false,b$4=false,Q.clear(),Ae(),A=requestAnimationFrame(G);},Ne));return}c||(A=requestAnimationFrame(G));}function W(){cancelAnimationFrame(A),clearTimeout(Y),t=performance.now(),o=0,v=false,R=false,b$4=false,_=0,m=true,q=0,Q.clear(),Ae(),A=requestAnimationFrame(G);}let i=new IntersectionObserver(n=>{n.forEach(f=>{f.isIntersecting&&!(K&&b$4)?W():!f.isIntersecting&&!K&&!b$4&&(cancelAnimationFrame(A),clearTimeout(Y),m=false);});},{root:I??null,threshold:Ue,rootMargin:je}),a;function w(){clearTimeout(a),a=setTimeout(()=>{d$2.forEach((n,f)=>{l[f]=a$2(n),n.style.strokeDasharray=`${l[f]}`;});},150);}return window.addEventListener("resize",w),window.addEventListener("orientationchange",w),de>0?setTimeout(()=>i.observe(r),de):i.observe(r),{destroy(){cancelAnimationFrame(A),clearTimeout(Y),i.disconnect(),window.removeEventListener("resize",w),window.removeEventListener("orientationchange",w),clearTimeout(a);},replay(){_=0,W();},pause(){v||!m||(v=true,o=performance.now()-t,cancelAnimationFrame(A));},resume(){v&&(v=false,m=true,t=performance.now()-o,A=requestAnimationFrame(G));},seek(n){let f=Math.min(1,Math.max(0,n));q=f,v=true,o=f*e,t=performance.now()-o,cancelAnimationFrame(A),C(o);},getProgress(){return q},refresh(){clearTimeout(a),d$2.forEach((n,f)=>{l[f]=a$2(n),n.style.strokeDasharray=`${l[f]}`;});}}}if($t)return Ie(Lt());it();function lt(){if(v||!ce)return;let e=performance.now(),t=ve();if(!Z&&ye===false&&t===rt){We(t);return}Z=false,rt=t;let o=z;if(ye!==false){let i=e-st,a=i>0?Math.abs(t-(xe<0?t:xe))/i:0;o=z*Math.max(.2,1+a*(typeof ye=="number"?ye:1)*.04);}xe=t,st=e;let m=Ee?Se===-1||t>=Se?"forward":"reverse":g;Se=t;let C=D-M,G=true,W=C===0?0:(t-M)/C;if(isNaN(fe)||(fe<=0&&W>0?Xe?.():fe>0&&W<=0&&Ze?.(),fe<1&&W>=1?Ye?.():fe>=1&&W<1&&Qe?.()),fe=W,j){let i=ne(b$3(t,M,D,o));K&&!Ee&&(X=Math.max(X,i),i=X),q=i,r.style.setProperty("--scroll-draw-progress",String(i));let a=m==="reverse"?1-i:i;r.style.clipPath=ie(a),he?.(i),!R&&b$3(t,M,D,o)>0&&(R=true,$e?.()),i>=1&&!b$4?(b$4=true,le?.(),_<(oe==="infinite"?1/0:oe??0)&&(_++,Y=setTimeout(()=>{X=-1,R=false,b$4=false,r.style.clipPath=ie(0);},Ne))):i<1&&!K&&(b$4=false),We(t);return}if(d$2.forEach((i,a)=>{let w=a*Te*C,n=ne(b$3(t,M+w,D+w,o));K&&!Ee&&(n=ge[a]=Math.max(ge[a]??X,n)),i.style.strokeDashoffset=m==="reverse"?`${l[a]*n}`:`${l[a]*(1-n)}`,H&&(i.style.opacity=m==="reverse"?`${1-n}`:`${n}`),V&&E?i.style.stroke=a$6(V,E,n):E&&(i.style.stroke=E),S!==null&&$!==null?i.style.strokeWidth=`${S+($-S)*n}`:$!==null&&(i.style.strokeWidth=`${$}`),x!==null&&T!==null?i.style.fillOpacity=`${x+(T-x)*n}`:T!==null&&(i.style.fillOpacity=`${T}`),P&&i.tagName.toLowerCase()==="path"&&L[a]&&i.setAttribute("d",_e(L[a],P,n)),a===0&&(q=n,he?.(n),r.style.setProperty("--scroll-draw-progress",String(n))),n<1&&(G=false);}),se){let i=ne(b$3(t,M,D,o));for(let a in se){let w=parseFloat(a);i>=w&&!Q.has(w)&&(Q.add(w),se[a]?.());}}!R&&b$3(t,M,D,o)>0&&(R=true,$e?.()),G&&!b$4?(b$4=true,le?.(),_<(oe==="infinite"?1/0:oe??0)&&(_++,Y=setTimeout(()=>{X=-1,ge=[],R=false,b$4=false,Q.clear(),Ae(),Z=true;},Ne))):!G&&!K&&(b$4=false),We(t);}function Re(e){return e>=D&&e<et}function We(e){ke||Re(e)?A=requestAnimationFrame(lt):ce=false;}function ze(){return ke||Re(ve())}let ce=false;function Pe(){ce||(ce=true,A=requestAnimationFrame(function(){lt();}));}function Le(){ce=false,cancelAnimationFrame(A);}let Ve=new IntersectionObserver(e=>{e.forEach(t=>{ke=t.isIntersecting,ke&&!v?(Z=true,Pe()):ce&&!v&&Re(ve())||Le();});},{root:I??null,threshold:Ue,rootMargin:je});function ft(){d$2.forEach((e,t)=>{l[t]=a$2(e),e.style.strokeDasharray=`${l[t]}`;}),it(),Z=true;}let Me;function we(){clearTimeout(Me),Me=setTimeout(ft,150);}window.addEventListener("resize",we),window.addEventListener("orientationchange",we);let Mt=d$1([r],we);return de>0?setTimeout(()=>Ve.observe(r),de):Ve.observe(r),Ie({destroy(){cancelAnimationFrame(A),clearTimeout(Y),Le(),Ve.disconnect(),Mt(),window.removeEventListener("resize",we),window.removeEventListener("orientationchange",we),clearTimeout(Me),tt();},replay(){X=-1,ge=[],Se=-1,xe=-1,R=false,b$4=false,_=0,v=false,q=0,Q.clear(),clearTimeout(Y),Ae(),Z=true,ze()&&Pe();},pause(){v=true,Le();},resume(){v&&(v=false,Z=true,ze()&&Pe());},seek(e){let t=Math.min(1,Math.max(0,e));q=t,X=t,ge=[],v=true,Le(),xt(t,g),Z=true;},getProgress(){return q},refresh(){clearTimeout(Me),ft(),ze()&&!v&&Pe();}},()=>({tStart:M,tEnd:D}))}export{ht as a,Yt as b};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-AJ22VSHC.mjs';import {a as a$2}from'./chunk-5PJEKEEP.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';var C={offset:120,delay:0,duration:400,easing:"ease",once:false,mirror:false,anchorPlacement:"top-bottom",disable:false,startEvent:"DOMContentLoaded",disableMutationObserver:false,initClassName:"aos-init",animatedClassName:"aos-animate",useClassNames:false,throttleDelay:99,debounceDelay:50},j={"ease-in-back":"cubic-bezier(.6,-.28,.735,.045)","ease-out-back":"cubic-bezier(.175,.885,.32,1.275)","ease-in-out-back":"cubic-bezier(.68,-.55,.265,1.55)","ease-in-sine":"cubic-bezier(.47,0,.745,.715)","ease-out-sine":"cubic-bezier(.39,.575,.565,1)","ease-in-out-sine":"cubic-bezier(.445,.05,.55,.95)","ease-in-quad":"cubic-bezier(.55,.085,.68,.53)","ease-out-quad":"cubic-bezier(.25,.46,.45,.94)","ease-in-out-quad":"cubic-bezier(.455,.03,.515,.955)","ease-in-cubic":"cubic-bezier(.55,.055,.675,.19)","ease-out-cubic":"cubic-bezier(.215,.61,.355,1)","ease-in-out-cubic":"cubic-bezier(.645,.045,.355,1)","ease-in-quart":"cubic-bezier(.895,.03,.685,.22)","ease-out-quart":"cubic-bezier(.165,.84,.44,1)","ease-in-out-quart":"cubic-bezier(.77,0,.175,1)"},w="svg-scroll-draw-aos",r=(e,t)=>`translate3d(${e},${t},0)`,U=[["fade-up",r("0","100px")],["fade-down",r("0","-100px")],["fade-right",r("-100px","0")],["fade-left",r("100px","0")],["fade-up-right",r("-100px","100px")],["fade-up-left",r("100px","100px")],["fade-down-right",r("-100px","-100px")],["fade-down-left",r("100px","-100px")],["zoom-in","scale(.6)"],["zoom-out","scale(1.2)"],["zoom-in-up",`${r("0","100px")} scale(.6)`],["zoom-in-down",`${r("0","-100px")} scale(.6)`],["zoom-in-right",`${r("-100px","0")} scale(.6)`],["zoom-in-left",`${r("100px","0")} scale(.6)`],["zoom-out-up",`${r("0","100px")} scale(1.2)`],["zoom-out-down",`${r("0","-100px")} scale(1.2)`],["zoom-out-right",`${r("-100px","0")} scale(1.2)`],["zoom-out-left",`${r("100px","0")} scale(1.2)`],["slide-up",r("0","100%")],["slide-down",r("0","-100%")],["slide-right",r("-100%","0")],["slide-left",r("100%","0")],["flip-left","perspective(2500px) rotateY(-100deg)"],["flip-right","perspective(2500px) rotateY(100deg)"],["flip-up","perspective(2500px) rotateX(-100deg)"],["flip-down","perspective(2500px) rotateX(100deg)"]];function G(e){let t=`.${e}`,n=o=>`[data-aos^=${o}][data-aos^=${o}]`;return ["[data-aos][data-aos]{transition-duration:var(--aos-duration,400ms);transition-timing-function:var(--aos-easing,ease);transition-delay:0s}",`[data-aos][data-aos]${t}{transition-delay:var(--aos-delay,0ms)}`,`${n("fade")}{opacity:0;transition-property:opacity,transform}`,`${n("fade")}${t}{opacity:1;transform:translateZ(0)}`,`${n("zoom")}{opacity:0;transition-property:opacity,transform}`,`${n("zoom")}${t}{opacity:1;transform:translateZ(0) scale(1)}`,`${n("slide")}{transition-property:transform}`,`${n("slide")}${t}{transform:translateZ(0)}`,`${n("flip")}{backface-visibility:hidden;transition-property:transform}`,...U.map(([o,u])=>`[data-aos=${o}]{transform:${u}}`),...["left","right"].map(o=>`[data-aos=flip-${o}]${t}{transform:perspective(2500px) rotateY(0)}`),...["up","down"].map(o=>`[data-aos=flip-${o}]${t}{transform:perspective(2500px) rotateX(0)}`),"[data-aos-instant][data-aos-instant]{transition:none!important}"].join(`
|
|
2
|
+
`)}var a={...C},s=[],l=false,b=0,$,v=null,c=null,f=false,p=null,N=()=>typeof window<"u"&&typeof document<"u";function H(e){if(!(e instanceof HTMLElement))return e.getBoundingClientRect().top+window.scrollY;let t=0,n=e;for(;n;)t+=n.offsetTop-(n.tagName!=="BODY"?n.scrollTop:0),n=n.offsetParent;return t}var k=e=>e instanceof HTMLElement?e.offsetHeight:e.getBoundingClientRect().height;function d(e,t){return e.getAttribute(`data-aos-${t}`)}function M(e,t,n){let o=d(e,t);return o==="true"?true:o==="false"?false:n}function q(e,t){let n=d(e,"offset");return n&&!isNaN(Number(n))?parseInt(n,10):n||t?0:a.offset}function W(e){let t=window.innerHeight,n=d(e,"anchor-placement"),o=q(e,n),u=d(e,"anchor"),x=u?document.querySelector(u):null;u&&!x&&b$1(`aos: data-aos-anchor="${u}" matches nothing; using the element itself`);let L=x||e,m=k(L),i=H(L)-t;switch(n||a.anchorPlacement){case "center-bottom":i+=m/2;break;case "bottom-bottom":i+=m;break;case "top-center":i+=t/2;break;case "center-center":i+=t/2+m/2;break;case "bottom-center":i+=t/2+m;break;case "top-top":i+=t;break;case "bottom-top":i+=t+m;break;case "center-top":i+=t+m/2;break;}return i+o}function _(e){return H(e)+k(e)-q(e,null)}function J(e){let t=d(e,"duration")??String(a.duration),n=d(e,"delay")??String(a.delay),o=d(e,"easing")??a.easing;e.style.setProperty("--aos-duration",`${parseFloat(t)||0}ms`),e.style.setProperty("--aos-delay",`${parseFloat(n)||0}ms`),e.style.setProperty("--aos-easing",j[o]??o);}function D(){s=Array.from(document.querySelectorAll("[data-aos]")).map(e=>{let t=s.find(n=>n.node===e);return {node:e,in:0,out:0,once:M(e,"once",a.once),mirror:M(e,"mirror",a.mirror),animated:t?t.animated:e.classList.contains(a.animatedClassName),classes:a.useClassNames?(e.getAttribute("data-aos")||"").split(" ").filter(Boolean):[],id:d(e,"id")}});for(let e of s)J(e.node),e.node.classList.add(a.initClassName);}function I(){for(let e of s)e.in=W(e.node),e.out=_(e.node);}function P(e,t){document.dispatchEvent(new CustomEvent(`aos:${e}`,{detail:t.node})),t.id&&document.dispatchEvent(new CustomEvent(`aos:${e}:${t.id}`,{detail:t.node}));}function O(e){e.animated||(e.animated=true,e.node.classList.add(a.animatedClassName,...e.classes),P("in",e));}function S(e){e.animated&&(e.animated=false,e.node.classList.remove(a.animatedClassName,...e.classes),P("out",e));}function y(){b=0;let e=window.scrollY;for(let t of s){if(f){O(t);continue}t.mirror&&!t.once&&e>t.out?S(t):e>t.in?O(t):t.once||S(t);}}var R=()=>{b||(b=requestAnimationFrame(y));};function g(){clearTimeout($),$=setTimeout(h,50);}var F=()=>h();function Y(){let e=a.disable;if(typeof e=="function")return e();if(e===true)return true;let t=window.innerWidth;return e==="phone"?t<768:e==="tablet"?t>=768&&t<1024:e==="mobile"?t<1024:false}function B(){document.querySelectorAll("[data-aos]").forEach(e=>{for(let t of ["data-aos","data-aos-easing","data-aos-duration","data-aos-delay"])e.removeAttribute(t);});}function K(){if(document.getElementById(w))return;let e=document.createElement("style");e.id=w,e.textContent=G(a.animatedClassName),document.head.appendChild(e);}function E(){if(!l){if(l=true,c=null,D(),f)for(let e of s)e.node.setAttribute("data-aos-instant","");I(),y(),window.addEventListener("scroll",R,{passive:true}),window.addEventListener("resize",g),window.addEventListener("orientationchange",g),window.addEventListener("load",F),!a.disableMutationObserver&&typeof MutationObserver<"u"&&(v=new MutationObserver(e=>{e.some(n=>[...Array.from(n.addedNodes),...Array.from(n.removedNodes)].some(o=>o instanceof Element&&(o.hasAttribute("data-aos")||o.querySelector("[data-aos]"))))&&X();}),v.observe(document.documentElement,{childList:true,subtree:true}));}}function Q(e={}){if(!N())return [];if((l||c)&&Z(),a={...C,...e},Y())return B(),[];f=a$1(),f||(p=a$2(n=>{if(n&&(p?.(),p=null,f=true,!!l)){for(let o of s)o.node.setAttribute("data-aos-instant","");y();}})),K();let t=document.readyState!=="loading";if(a.startEvent==="DOMContentLoaded"&&t)E();else if(a.startEvent==="load"&&document.readyState==="complete")E();else {let n=a.startEvent==="load"?window:document,o=()=>E();n.addEventListener(a.startEvent,o,{once:true}),c={target:n,type:a.startEvent,fn:o};}return Array.from(document.querySelectorAll("[data-aos]"))}function h(){l&&(I(),y());}function X(){if(l){if(Y()){B();return}D(),h();}}function Z(){if(N()){c&&c.target.removeEventListener(c.type,c.fn),c=null,cancelAnimationFrame(b),b=0,clearTimeout($),window.removeEventListener("scroll",R),window.removeEventListener("resize",g),window.removeEventListener("orientationchange",g),window.removeEventListener("load",F),v?.disconnect(),v=null,p?.(),p=null;for(let e of s)e.node.removeAttribute("data-aos-instant");s=[],l=false,document.getElementById(w)?.remove();}}var V={init:Q,refresh:h,refreshHard:X,destroy:Z},oe=V;export{Q as a,h as b,X as c,Z as d,oe as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var X={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function se(u,E={}){if(typeof window>"u")return X;let b$3=typeof u=="string"?document.querySelector(u):u;if(!b$3||b$3.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",u),X;let t=b$3,{trigger:P={},easing:T="linear",once:z=false,axis:f="y",preload:Y="auto",triggerElement:j,onReady:C,onComplete:J,onProgress:K}=E,I=j??t,g=window.matchMedia("(prefers-reduced-motion: reduce)").matches,Q=typeof T=="function"?T:d[T]??d.linear,U=a(P.start??"top top"),Z=a(P.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=Y);let V=E.from??0,A=E.to,p=0,w=0,r=0,a$3=false,n=false,s=-1,l=0,v=false,i=false,R=()=>f==="x"?window.scrollX:window.scrollY,$=()=>f==="x"?window.innerWidth:window.innerHeight;function S(){let e=I.getBoundingClientRect(),o=f==="x"?e.left:e.top,m=f==="x"?e.width:e.height,k=c({top:o,height:m},R(),$(),U,Z);p=k.tStart,w=k.tEnd,i&&w===p&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let h=NaN;function c$1(e){if(!i)return;let o=A??t.duration??0,m=V+(o-V)*e;m!==h&&(h=m,t.currentTime=m),t.style.setProperty("--scroll-draw-progress",String(e)),K?.(e);}function y(){if(!a$3||n||!i||g)return;let e=Q(b$2(R(),p,w,1));z&&(s=Math.max(s,e),e=s),l=e,c$1(e),e>=1&&!v?(v=true,J?.()):e<1&&!z&&(v=false),r=requestAnimationFrame(y);}function x(){if(i=true,A===void 0&&(A=t.duration),g){c$1(1),C?.();return}S(),C?.(),a$3&&!n&&(r=requestAnimationFrame(y));}t.readyState>=1?x():t.addEventListener("loadedmetadata",x,{once:true}),i||S();let q=g?()=>{}:a$1(e=>{e&&(q(),g=true,cancelAnimationFrame(r),c$1(1));}),O=new IntersectionObserver(e=>{e.forEach(o=>{a$3=o.isIntersecting,a$3&&!n&&i?r=requestAnimationFrame(y):cancelAnimationFrame(r);});}),L;function d$2(){clearTimeout(L),L=setTimeout(S,150);}window.addEventListener("resize",d$2),window.addEventListener("orientationchange",d$2);let ee=d$1([I],d$2);return O.observe(t),a$2(t,{type:"video",getProgress:()=>l,getTrigger:()=>({tStart:p,tEnd:w})}),{destroy(){cancelAnimationFrame(r),O.disconnect(),t.removeEventListener("loadedmetadata",x),window.removeEventListener("resize",d$2),window.removeEventListener("orientationchange",d$2),ee(),q(),clearTimeout(L),b$1(t);},replay(){s=-1,v=false,l=0,n=false,h=NaN,c$1(0);},pause(){n=true,cancelAnimationFrame(r);},resume(){n&&(n=false,a$3&&i&&(r=requestAnimationFrame(y)));},seek(e){let o=Math.min(1,Math.max(0,e));l=o,s=o,n=true,cancelAnimationFrame(r),h=NaN,c$1(o);},getProgress(){return l}}}export{se as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b,a as a$4}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-YWKPTYSG.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$2,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$3}from'./chunk-BCV4RAIX.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function He(t){return t.startsWith("#")||t.startsWith("rgb")||t.startsWith("hsl")}function de(t){let i=[],l=/([\w]+)\(([^)]*)\)/g,s;for(;(s=l.exec(t))!==null;){let m=[],o=[],c=s[2].trim();if(c)for(let a of c.split(/[\s,]+/)){let r=a.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(r?parseFloat(r[1]):0),o.push(r?r[2]:"");}i.push({fn:s[1],nums:m,units:o});}return i}function xe(t,i,l){let s=de(t),m=de(i);return s.length===0||s.length!==m.length?l<1?t:i:s.map((o,c)=>{let a=m[c];return o.fn!==a.fn||o.nums.length!==a.nums.length?l<1?`${o.fn}(${o.nums.map((r,g)=>`${r}${o.units[g]}`).join(", ")})`:`${a.fn}(${a.nums.map((r,g)=>`${r}${a.units[g]}`).join(", ")})`:`${o.fn}(${o.nums.map((r,g)=>`${r+(a.nums[g]-r)*l}${o.units[g]}`).join(", ")})`}).join(" ")}function ye(t,i,l){if(typeof t=="number"&&typeof i=="number")return String(t+(i-t)*l);let s=String(t),m=String(i);if(He(s))return a$4(s,m,l);if(s.includes("("))return xe(s,m,l);let o=s.match(/^([-+]?[\d.]+)(.*)$/),c=m.match(/^([-+]?[\d.]+)(.*)$/);if(o&&c){let a=parseFloat(o[1]),r=parseFloat(c[1]);return `${a+(r-a)*l}${o[2]||c[2]}`}return l<1?s:m}function Ce(t){return t.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var Fe=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Ie=0,he="--scroll-draw-progress";function Ne(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var be={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function _e(t,i){return typeof window>"u"?be:i.respectReducedMotion===false?Ee(t,i,false):a(i,(l,s)=>Ee(t,l,s))}function Ee(t,i,l){let{props:s,trigger:m={},easing:o="ease-out",speed:c$1=1,once:a=false,axis:r="y",scrollContainer:g,native:ve=true,velocityScale:H=false,triggerElement:we,onProgress:J,onComplete:R,onEnter:K,onLeave:Q,onEnterBack:ee,onLeaveBack:te}=i,k=typeof o=="function"?o:d[o]??d["ease-out"],ne=a$1(m.start??"top bottom"),re=a$1(m.end??"bottom top"),x=we??t,d$2=typeof g=="string"?document.querySelector(g):g??null,y=Object.entries(s).map(([e,n])=>({prop:Ce(e),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function Se(){let e=window.getComputedStyle(t);for(let n of y)n.from===""&&(n.from=e.getPropertyValue(n.prop).trim()||"0");}function Te(){for(let e of y)t.style.setProperty(e.prop,String(e.to));}let V=new Map;for(let e of [...y.map(n=>n.prop),he])V.set(e,t.style.getPropertyValue(e));function O(){for(let[e,n]of V)n?t.style.setProperty(e,n):t.style.removeProperty(e);}if(l)return Te(),R?.(),{...be,destroy:O,getProgress:()=>1};Se();let oe=typeof o=="string"?b(o):null;function Le(){if(!ve||!Ne()||!oe||r!=="y"||d$2||x!==t||a||c$1!==1||J||R||K||Q||ee||te||H!==false||(m.start??"top bottom").trim()!=="top bottom"||(m.end??"bottom top").trim()!=="bottom top")return false;for(let e of y)if(!Fe.has(e.prop))return false;return true}function Pe(){let e=`ssd-a-${++Ie}`,n=y.map(f=>`${f.prop}:${f.from}`).join(";"),P=y.map(f=>`${f.prop}:${f.to}`).join(";"),E=document.createElement("style");E.setAttribute("data-ssd-animate",""),E.textContent=`@keyframes ${e}{from{${n}}to{${P}}}.${e}{animation-name:${e};animation-duration:auto;animation-timing-function:${oe};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),t.classList.add(e);let u=()=>r==="x"?window.scrollX:window.scrollY,p=()=>r==="x"?window.innerWidth:window.innerHeight,A=()=>{let f=t.getBoundingClientRect();return c({top:f.top,height:f.height},u(),p(),ne,re)};a$2(t,{type:"animate",getProgress:()=>D.getProgress(),getTrigger:A});let D={refresh(){},destroy(){t.classList.remove(e),E.remove(),t.style.animationPlayState="",O(),b$3(t);},replay(){t.classList.remove(e),t.offsetWidth,t.classList.add(e);},pause(){t.style.animationPlayState="paused";},resume(){t.style.animationPlayState="";},seek(f){let _=Math.min(1,Math.max(0,f));t.classList.remove(e);for(let q of y)t.style.setProperty(q.prop,ye(q.from,q.to,_));},getProgress(){let{tStart:f,tEnd:_}=A();return k(b$2(u(),f,_,c$1))}};return D}if(Le())return Pe();let h=0,b$4=0,v=0,C=false,w=false,T=-1,L=0,F=false,S=NaN,W=-1,se=0,ie=()=>d$2?r==="x"?d$2.scrollLeft:d$2.scrollTop:r==="x"?window.scrollX:window.scrollY,Ae=()=>d$2?r==="x"?d$2.clientWidth:d$2.clientHeight:r==="x"?window.innerWidth:window.innerHeight,M=x===t?y:[],ae=false;function z(){let e=t.style,n=M.map(p=>e.getPropertyValue(p.prop)),P=e.transition;M.length&&(e.transition="none"),M.forEach(p=>e.setProperty(p.prop,V.get(p.prop)??""));let E=a$3(x,d$2,r);M.forEach((p,A)=>e.setProperty(p.prop,n[A])),M.length&&(t.offsetWidth,e.transition=P);let u=c(E,E.scroll,Ae(),ne,re);ae&&Math.abs(u.tStart-h)<1&&Math.abs(u.tEnd-b$4)<1||(ae=true,h=u.tStart,b$4=u.tEnd);}function I(e){t.style.setProperty(he,String(e));for(let n of y)t.style.setProperty(n.prop,ye(n.from,n.to,e));J?.(e);}function Me(e){if(isNaN(S)){S=e;return}S<=0&&e>0?K?.():S>0&&e<=0&&te?.(),S<1&&e>=1?Q?.():S>=1&&e<1&&ee?.(),S=e;}function B(){if(!C||w)return;let e=performance.now(),n=ie(),P=c$1;if(H!==false){let p=e-se,A=p>0?Math.abs(n-(W<0?n:W))/p:0;P=c$1*Math.max(.2,1+A*(typeof H=="number"?H:1)*.04);}W=n,se=e;let E=b$4===h?0:(n-h)/(b$4-h);Me(E);let u=k(b$2(n,h,b$4,P));a&&(T=Math.max(T,u),u=T),L=u,I(u),u>=1&&!F?(F=true,R?.()):u<1&&!a&&(F=false),v=requestAnimationFrame(B);}z(),b$4===h&&b$1("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",t);{let e=k(b$2(ie(),h,b$4,c$1));a&&e>0&&(T=e),L=e,I(e);}let le=new IntersectionObserver(e=>{e.forEach(n=>{C=n.isIntersecting,C&&!w?v=requestAnimationFrame(B):cancelAnimationFrame(v);});},{root:d$2??null}),j;function $(){clearTimeout(j),j=setTimeout(z,150);}window.addEventListener("resize",$),window.addEventListener("orientationchange",$);let $e=d$1([x],$);return le.observe(t),a$2(t,{type:"animate",getProgress:()=>L,getTrigger:()=>({tStart:h,tEnd:b$4})}),{destroy(){cancelAnimationFrame(v),le.disconnect(),window.removeEventListener("resize",$),window.removeEventListener("orientationchange",$),$e(),clearTimeout(j),O(),b$3(t);},replay(){T=-1,F=false,L=0,w=false,I(0);},pause(){w=true,cancelAnimationFrame(v);},resume(){w&&(w=false,C&&(v=requestAnimationFrame(B)));},seek(e){let n=Math.min(1,Math.max(0,e));L=n,T=n,w=true,cancelAnimationFrame(v),I(n);},getProgress(){return L},refresh(){z();}}}export{_e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-HX4SP5WN.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function l(r,s){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let o=typeof r=="string"?document.querySelector(r):r;return o?b(o,s):(b$1("Container not found:",r),n)}export{l as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-
|
|
1
|
+
import {a,b as b$1}from'./chunk-XSVTHCLO.mjs';import {a as a$3}from'./chunk-KV3WCPQ5.mjs';import {a as a$4}from'./chunk-DY5JCXVR.mjs';import {a as a$2}from'./chunk-WXUOF4NM.mjs';import {a as a$1}from'./chunk-LTCJVVSC.mjs';import {b as b$2}from'./chunk-HX4SP5WN.mjs';import {defineComponent,ref,h as h$1,onMounted,watch,onUnmounted,unref}from'vue';var u=e=>typeof e=="function"?e():unref(e);function r(e,t,o){let l=null,i=t(),s=()=>{l?.destroy(),l=e.value?o(e.value,b$1(i,()=>i)):null;};onMounted(s),watch(()=>a(i=t()),s),onUnmounted(()=>{l?.destroy(),l=null;});}function B(e={}){let t=ref(null);return r(t,()=>u(e),b$2),t}var g={preset:0,selector:0,speed:0,fade:1,easing:0,trigger:0,stagger:0,direction:0,once:1,debug:1,axis:0,scrollContainer:0,autoReverse:1,delay:0,strokeColor:0,strokeWidth:0,fillOpacity:0,clip:2,waypoints:0,velocityScale:3,threshold:0,rootMargin:0,repeat:0,repeatDelay:0,morphTo:0,onProgress:0,onStart:0,onComplete:0,onEnter:0,onLeave:0,onEnterBack:0,onLeaveBack:0,autoplay:1,duration:0,native:1},b=[null,Boolean,[Boolean,String],[Boolean,Number]],T=e=>({type:e,default:void 0}),H=defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(g).map(([e,t])=>[e,t?T(b[t]):null])),setup(e,{slots:t}){let o=ref(null);return r(o,()=>{let l={};for(let i in g){let s=e[i];s!=null&&(l[i]=s);}return l},b$2),()=>h$1("div",{ref:o},t.default?.())}});function V(e){let t=ref(null);return r(t,()=>u(e),a$1),t}var j=defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options,a$1),()=>h$1("div",{ref:o},t.default?.())}});function G(e){let t=ref(null);return r(t,()=>u(e),a$2),t}var h=defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:T(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let t=ref(null);return r(t,()=>{let o={to:e.to};return e.from!=null&&(o.from=e.from),e.format!=null&&(o.format=e.format),e.easing!=null&&(o.easing=e.easing),e.trigger!=null&&(o.trigger=e.trigger),e.once!=null&&(o.once=e.once),e.decimals!=null&&(o.decimals=e.decimals),e.onComplete!=null&&(o.onComplete=e.onComplete),o},a$2),()=>h$1("span",{ref:t})}});function N(e={}){let t=ref(null);return r(t,()=>u(e),a$3),t}var F=defineComponent({name:"ScrollVideo",props:{src:{type:String,required:true},options:{type:Object},muted:{type:Boolean,default:true},playsInline:{type:Boolean,default:true},class:{type:String}},setup(e){let t=ref(null);return r(t,()=>e.options??{},a$3),()=>h$1("video",{ref:t,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function q(e={}){let t=ref(null);return r(t,()=>u(e),a$4),t}var I=defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:t}){let o=ref(null);return r(o,()=>e.options??{},a$4),()=>h$1(e.tag,{ref:o},t.default?.())}});export{B as a,H as b,V as c,j as d,G as e,h as f,N as g,F as h,q as i,I as j};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var A={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Z(t,w){if(typeof window>"u")return A;let l=typeof t=="string"?document.querySelector(t):t;return l?a(w,(m,f)=>Y(l,m,f)):(b("scrollCounter: element not found:",t),A)}function Y(t,w,l){let{from:m=0,to:f,format:_,easing:h="ease-out",trigger:F={},once:b=true,decimals:I,onComplete:M}=w,P=I!==void 0?e=>e.toFixed(I):_??(e=>String(Math.round(e))),x=typeof h=="function"?h:d[h]??d["ease-out"],B=a$1(F.start??"top 80%"),G=a$1(F.end??"top 20%");if(l)return t.textContent=P(f),M?.(),{...A,getProgress:()=>1};let a=0,c$1=0,L=false,n=0,g=false,o=false,i=-1,s=0,p=false,y=()=>window.scrollY,V=()=>window.innerHeight;function z(){let e=t.getBoundingClientRect(),r=c({top:e.top,height:e.height},y(),V(),B,G);L&&Math.abs(r.tStart-a)<1&&Math.abs(r.tEnd-c$1)<1||(L=true,a=r.tStart,c$1=r.tEnd);}function d$2(e){t.textContent=P(m+(f-m)*e),t.style.setProperty("--scroll-draw-progress",String(e));}function v(){if(!g||o)return;let e=x(b$1(y(),a,c$1,1));b&&(i=Math.max(i,e),e=i),s=e,d$2(e),e>=1&&!p?(p=true,M?.()):e<1&&!b&&(p=false),n=requestAnimationFrame(v);}z();{let e=x(b$1(y(),a,c$1,1));b&&e>0&&(i=e),s=e,d$2(e);}let O=new IntersectionObserver(e=>{e.forEach(r=>{g=r.isIntersecting,g&&!o?n=requestAnimationFrame(v):cancelAnimationFrame(n);});}),S;function u(){clearTimeout(S),S=setTimeout(z,150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let W=d$1([t],u);return O.observe(t),a$2(t,{type:"counter",getProgress:()=>s,getTrigger:()=>({tStart:a,tEnd:c$1})}),{destroy(){cancelAnimationFrame(n),O.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),W(),clearTimeout(S),b$2(t);},replay(){i=-1,p=false,s=0,o=false,d$2(0);},pause(){o=true,cancelAnimationFrame(n);},resume(){o&&(o=false,g&&(n=requestAnimationFrame(v)));},seek(e){let r=Math.min(1,Math.max(0,e));s=r,i=r,o=true,cancelAnimationFrame(n),d$2(r);},getProgress(){return s}}}export{Z as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var M="http://www.w3.org/2000/svg",P="cinematic-photo",S=a=>a<0?0:a>1?1:a;function p(a){let s=parseFloat(a);return Number.isFinite(s)?S(s/100):0}function L(a){return d[a]??d.linear}var R={destroy:()=>{},getProgress:()=>0},T=class{constructor(s){if(typeof document>"u"){this.mount=null;return}this.mount=typeof s.wrapper=="string"?document.querySelector(s.wrapper):s.wrapper,this.mount||b("Cinematic: wrapper not found:",s.wrapper);}loadStory(s){let i=this.mount;if(typeof window>"u"||!i)return R;i.style.position="relative",i.style.height=s.totalHeight,i.style.display="block";let c=document.createElement("div");c.setAttribute("data-cinematic-stage",""),c.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",i.appendChild(c);let f=[];for(let e of s.scenes){if(e.background){let t=document.createElement("img");t.id=P,t.src=e.background,t.alt="",t.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",c.appendChild(t);}let n=e.animations.filter(t=>t.type==="draw");if(n.length){let t=document.createElementNS(M,"svg");t.setAttribute("viewBox",`0 0 ${s.canvas.width} ${s.canvas.height}`),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",c.appendChild(t);for(let o of n){let r=document.createElementNS(M,"path");r.id=o.target.replace(/^#/,""),r.setAttribute("d",o.d),r.setAttribute("fill","none"),r.setAttribute("stroke",o.stroke),r.setAttribute("stroke-width",String(o.strokeWidth)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");let b=o.length||r.getTotalLength?.()||0;r.style.strokeDasharray=String(b),r.style.strokeDashoffset=String(b),t.appendChild(r),f.push({kind:"draw",el:r,start:p(o.start),end:p(o.end),ease:L(o.easing),length:b});}}for(let t of e.animations){if(t.type!=="fade")continue;let o=c.querySelector(t.target)??document.querySelector(t.target);o&&(o.style.opacity=String(t.from),f.push({kind:"fade",el:o,start:p(t.start),end:p(t.end),ease:d["ease-in-out"]??d.linear,from:t.from,to:t.to}));}}let d$1=0,v=()=>{let e=i.offsetHeight-window.innerHeight;return e<=0?i.getBoundingClientRect().top<=0?1:0:S(-i.getBoundingClientRect().top/e)},l=e=>{for(let n of f){let t=n.end-n.start,o=t<=0?e>=n.end?1:0:S((e-n.start)/t),r=n.ease(o);n.kind==="draw"?n.el.style.strokeDashoffset=String(n.length*(1-r)):n.el.style.opacity=String(n.from+(n.to-n.from)*r);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return l(1),{destroy:()=>{},getProgress:()=>1};let g=0,u=false,A=false,k=()=>{d$1=v(),l(d$1),u&&(g=requestAnimationFrame(k));},I=()=>{u||(u=true,g=requestAnimationFrame(k));},h=()=>{u=false,cancelAnimationFrame(g);},y=new IntersectionObserver(e=>{for(let n of e)A=n.isIntersecting,A?I():h();},{threshold:0});y.observe(c),d$1=v(),l(d$1),a(i,{type:"draw",getProgress:()=>d$1,getTrigger:()=>{let e=i.getBoundingClientRect().top+window.scrollY;return {tStart:e,tEnd:e+Math.max(0,i.offsetHeight-window.innerHeight)}}});let E=a$1(e=>{e&&(E(),h(),y.disconnect(),b$1(i),d$1=1,l(1));});return {destroy(){E(),h(),y.disconnect(),b$1(i);},getProgress:()=>d$1}}};
|
|
2
|
+
export{T as a};
|
package/dist/cinematic/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';function
|
|
2
|
-
exports.Cinematic=
|
|
1
|
+
'use strict';function D({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),o=Math.max(.01,Math.min(.99,n)),p=Math.sqrt(o),c=0,h=[];for(let i=0;i<t;i++){let d=Math.pow(p,i);h.push(d),c+=d;}let l=[0],g=0;for(let i=0;i<t;i++)g+=h[i]/c,l.push(g);return i=>{if(i<=0)return 0;if(i>=1)return 1;for(let d=0;d<t;d++)if(i<=l[d+1]){let f=(i-l[d])/(l[d+1]-l[d]);if(d===0)return f*(2-f);let b=1-Math.pow(o,d);return b+(1-b)*(2*f-1)*(2*f-1)}return 1}}function P({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),o=Math.max(.1,n),p=t<=1?o/4:o/(2*Math.PI)*Math.asin(1/t);return c=>c<=0?0:c>=1?1:t*Math.pow(2,-10*c)*Math.sin((c-p)*(2*Math.PI)/o)+1}var y={linear:e=>e,"ease-in":e=>e*e,"ease-out":e=>e*(2-e),"ease-in-out":e=>e<.5?2*e*e:-1+(4-2*e)*e,spring:e=>1-Math.cos(e*Math.PI*2.5)*Math.pow(1-e,2.2),bounce:D(),elastic:P()};var H=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function _(e,...n){H&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var A=Symbol.for("svg-scroll-draw.registry");function R(){let e=globalThis;return e[A]||(e[A]=new Map)}function k(e,n){R().set(e,n);}function S(e){R().delete(e);}function I(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=p=>e(!!p.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let o=n;return o.addListener?.(t),()=>o.removeListener?.(t)}var T="http://www.w3.org/2000/svg",V="cinematic-photo",x=e=>e<0?0:e>1?1:e;function w(e){let n=parseFloat(e);return Number.isFinite(n)?x(n/100):0}function O(e){return y[e]??y.linear}var Q={destroy:()=>{},getProgress:()=>0},C=class{constructor(n){if(typeof document>"u"){this.mount=null;return}this.mount=typeof n.wrapper=="string"?document.querySelector(n.wrapper):n.wrapper,this.mount||_("Cinematic: wrapper not found:",n.wrapper);}loadStory(n){let t=this.mount;if(typeof window>"u"||!t)return Q;t.style.position="relative",t.style.height=n.totalHeight,t.style.display="block";let o=document.createElement("div");o.setAttribute("data-cinematic-stage",""),o.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",t.appendChild(o);let p=[];for(let s of n.scenes){if(s.background){let r=document.createElement("img");r.id=V,r.src=s.background,r.alt="",r.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",o.appendChild(r);}let a=s.animations.filter(r=>r.type==="draw");if(a.length){let r=document.createElementNS(T,"svg");r.setAttribute("viewBox",`0 0 ${n.canvas.width} ${n.canvas.height}`),r.setAttribute("preserveAspectRatio","xMidYMid meet"),r.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",o.appendChild(r);for(let m of a){let u=document.createElementNS(T,"path");u.id=m.target.replace(/^#/,""),u.setAttribute("d",m.d),u.setAttribute("fill","none"),u.setAttribute("stroke",m.stroke),u.setAttribute("stroke-width",String(m.strokeWidth)),u.setAttribute("stroke-linecap","round"),u.setAttribute("stroke-linejoin","round");let E=m.length||u.getTotalLength?.()||0;u.style.strokeDasharray=String(E),u.style.strokeDashoffset=String(E),r.appendChild(u),p.push({kind:"draw",el:u,start:w(m.start),end:w(m.end),ease:O(m.easing),length:E});}}for(let r of s.animations){if(r.type!=="fade")continue;let m=o.querySelector(r.target)??document.querySelector(r.target);m&&(m.style.opacity=String(r.from),p.push({kind:"fade",el:m,start:w(r.start),end:w(r.end),ease:y["ease-in-out"]??y.linear,from:r.from,to:r.to}));}}let c=0,h=()=>{let s=t.offsetHeight-window.innerHeight;return s<=0?t.getBoundingClientRect().top<=0?1:0:x(-t.getBoundingClientRect().top/s)},l=s=>{for(let a of p){let r=a.end-a.start,m=r<=0?s>=a.end?1:0:x((s-a.start)/r),u=a.ease(m);a.kind==="draw"?a.el.style.strokeDashoffset=String(a.length*(1-u)):a.el.style.opacity=String(a.from+(a.to-a.from)*u);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return l(1),{destroy:()=>{},getProgress:()=>1};let g=0,i=false,d=false,f=()=>{c=h(),l(c),i&&(g=requestAnimationFrame(f));},b=()=>{i||(i=true,g=requestAnimationFrame(f));},v=()=>{i=false,cancelAnimationFrame(g);},M=new IntersectionObserver(s=>{for(let a of s)d=a.isIntersecting,d?b():v();},{threshold:0});M.observe(o),c=h(),l(c),k(t,{type:"draw",getProgress:()=>c,getTrigger:()=>{let s=t.getBoundingClientRect().top+window.scrollY;return {tStart:s,tEnd:s+Math.max(0,t.offsetHeight-window.innerHeight)}}});let L=I(s=>{s&&(L(),v(),M.disconnect(),S(t),c=1,l(1));});return {destroy(){L(),v(),M.disconnect(),S(t);},getProgress:()=>c}}};
|
|
2
|
+
exports.Cinematic=C;
|
package/dist/cinematic/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Cinematic}from'../chunk-
|
|
1
|
+
export{a as Cinematic}from'../chunk-YNNA33A5.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
|
|
@@ -17,7 +17,8 @@ interface ScrollAnimateOptions {
|
|
|
17
17
|
velocityScale?: boolean | number;
|
|
18
18
|
/**
|
|
19
19
|
* Honour `prefers-reduced-motion: reduce` by applying the final state and not
|
|
20
|
-
* animating
|
|
20
|
+
* animating, also when the reader turns it on while the page is open.
|
|
21
|
+
* Default: `true`.
|
|
21
22
|
*
|
|
22
23
|
* Set to `false` only when the movement is *scroll-linked scrubbing* rather
|
|
23
24
|
* than autonomous motion — it advances solely as the user scrolls, 1:1 with
|
|
@@ -17,7 +17,8 @@ interface ScrollAnimateOptions {
|
|
|
17
17
|
velocityScale?: boolean | number;
|
|
18
18
|
/**
|
|
19
19
|
* Honour `prefers-reduced-motion: reduce` by applying the final state and not
|
|
20
|
-
* animating
|
|
20
|
+
* animating, also when the reader turns it on while the page is open.
|
|
21
|
+
* Default: `true`.
|
|
21
22
|
*
|
|
22
23
|
* Set to `false` only when the movement is *scroll-linked scrubbing* rather
|
|
23
24
|
* than autonomous motion — it advances solely as the user scrolls, 1:1 with
|