svg-scroll-draw 2.18.0 → 2.19.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 +10 -10
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +3 -3
- package/dist/angular/index.d.ts +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.d.mts +6 -5
- package/dist/astro/index.d.ts +6 -5
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +133 -31
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/chunk-7SBTYJGH.mjs +1 -0
- package/dist/chunk-A4JCC3QQ.mjs +1 -0
- package/dist/chunk-BFX2CSQ3.mjs +1 -0
- package/dist/chunk-I45LCJUP.mjs +1 -0
- package/dist/{chunk-DIMNQPW5.mjs → chunk-JPK2NJWO.mjs} +1 -1
- package/dist/chunk-KHQ7OGQK.mjs +1 -0
- package/dist/chunk-MTEGM4RR.mjs +1 -0
- package/dist/chunk-PKHX3HSS.mjs +1 -0
- package/dist/chunk-WHFRS7IP.mjs +3 -0
- package/dist/{engine-6AXEX8CL.d.ts → engine-C9LKls__.d.ts} +1 -1
- package/dist/{engine-Ci08nM91.d.mts → engine-CvzRSkuk.d.mts} +1 -1
- package/dist/group/index.cjs +2 -2
- package/dist/group/index.d.mts +3 -3
- package/dist/group/index.d.ts +3 -3
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +10 -3
- package/dist/horizontal/index.d.ts +10 -3
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-BDGQEK6X.d.mts → index-BlIjovDN.d.mts} +1 -1
- package/dist/{index-DxjUOIbK.d.ts → index-DZjvLJcU.d.ts} +1 -1
- package/dist/{index-BVuNgQSd.d.ts → index-G3VfLIN8.d.ts} +2 -2
- package/dist/{index-CGR7pSOR.d.mts → index-Zxa5HIes.d.mts} +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +3 -3
- package/dist/nuxt/index.d.ts +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/pin/index.cjs +1 -1
- package/dist/pin/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.d.mts +1 -1
- package/dist/progress/index.d.ts +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +16 -13
- package/dist/react/index.d.ts +16 -13
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +1 -1
- package/dist/reveal/index.d.ts +1 -1
- package/dist/reveal/index.mjs +1 -1
- package/dist/{scroll-draw-CNlq4Z_L.d.mts → scroll-draw-B4CadBz0.d.mts} +1 -1
- package/dist/{scroll-draw-BlJfbTDv.d.ts → scroll-draw-Cs6Z5ype.d.ts} +1 -1
- package/dist/snap/index.d.mts +1 -1
- package/dist/snap/index.d.ts +1 -1
- package/dist/solid/index.cjs +2 -2
- package/dist/solid/index.d.mts +3 -3
- package/dist/solid/index.d.ts +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +2 -2
- package/dist/svelte/index.d.mts +3 -3
- package/dist/svelte/index.d.ts +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.d.mts +1 -1
- package/dist/text/index.d.ts +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +11 -11
- package/dist/timeline/index.d.mts +1 -1
- package/dist/timeline/index.d.ts +1 -1
- package/dist/timeline/index.mjs +4 -4
- package/dist/{types-DHU1zNEw.d.mts → types-B0YM4nQP.d.mts} +6 -1
- package/dist/{types-DHU1zNEw.d.ts → types-B0YM4nQP.d.ts} +6 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +1 -1
- package/dist/video/index.d.ts +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +5 -83
- package/dist/vue/index.d.ts +5 -83
- 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-4MH5SQTH.mjs +0 -1
- package/dist/chunk-CTVQDBD3.mjs +0 -1
- package/dist/chunk-KBFWDHF4.mjs +0 -1
- package/dist/chunk-LINFV2GK.mjs +0 -3
- package/dist/chunk-PEFR3ZB7.mjs +0 -1
- package/dist/chunk-QJ4H2HW3.mjs +0 -1
- package/dist/chunk-SNCRC6BA.mjs +0 -1
- package/dist/chunk-TIRZOSQ4.mjs +0 -1
package/dist/timeline/index.cjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function ke({bounces:e=3,decay:t=.5}={}){let n=Math.max(1,Math.round(e)),i=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(i),a=0,f=[];for(let l=0;l<n;l++){let p=Math.pow(o,l);f.push(p),a+=p;}let b=[0],v=0;for(let l=0;l<n;l++)v+=f[l]/a,b.push(v);return l=>{if(l<=0)return 0;if(l>=1)return 1;for(let p=0;p<n;p++)if(l<=b[p+1]){let g=(l-b[p])/(b[p+1]-b[p]);if(p===0)return g*(2-g);let L=1-Math.pow(i,p);return L+(1-L)*(2*g-1)*(2*g-1)}return 1}}function Fe({amplitude:e=1,period:t=.4}={}){let n=Math.max(1,e),i=Math.max(.1,t),o=n<=1?i/4:i/(2*Math.PI)*Math.asin(1/n);return a=>a<=0?0:a>=1?1:n*Math.pow(2,-10*a)*Math.sin((a-o)*(2*Math.PI)/i)+1}var J={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:ke(),elastic:Fe()};function ae(e,t,n){return Math.min(n,Math.max(t,e))}function Y(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[n="top",i="bottom"]=t.split(/\s+/).filter(Boolean);return {element:n,viewport:i}}function ue(e,t,n,i){switch(i){case "top":return e+n;case "center":return e+n+t/2;case "bottom":return e+n+t;default:return e+n}}function ce(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function le(e,t,n,i){return n===t?0:ae((e-t)/(n-t)*i,0,1)}function de(e,t,n,i,o){let a=ue(e.top,e.height,t,i.element)-ce(i.viewport,n),f=ue(e.top,e.height,t,o.element)-ce(o.viewport,n);return {tStart:a,tEnd:f}}function Z(e){let t=e.tagName.toLowerCase();if(t==="rect"){let n=parseFloat(e.getAttribute("width")??"0"),i=parseFloat(e.getAttribute("height")??"0");return 2*(n+i)}if(t==="circle"){let n=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*n}return e.getTotalLength()}function me(){return typeof window>"u"||typeof window.matchMedia!="function"?false:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function pe(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=o=>e(!!o.matches);if(typeof t.addEventListener=="function")return t.addEventListener("change",n),()=>t.removeEventListener("change",n);let i=t;return i.addListener?.(n),()=>i.removeListener?.(n)}var Oe=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function fe(e,...t){Oe&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var be=Symbol.for("svg-scroll-draw.registry");function ge(){let e=globalThis;return e[be]||(e[be]=new Map)}function he(e,t){ge().set(e,t);}function ye(e){ge().delete(e);}var I,V=new Set,C=new WeakMap,A=new Map,we=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function Pe(e){let t=new Set;for(let n of e)for(;n&&n!==document.body;n=n.parentElement)for(let i=n;i;i=i.previousElementSibling)t.add(i);return t}function ve(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let n=()=>t();I??(I=new ResizeObserver(o=>{let a=false;for(let{target:f}of o)C.get(f)!==we(f)&&(a=true),C.set(f,"");a&&V.forEach(f=>f());})),V.add(n);let i=Pe(e);return [document.body,document.documentElement].forEach(o=>o&&i.add(o)),i.forEach(o=>{C.has(o)||C.set(o,we(o)),A.set(o,(A.get(o)??0)+1),I.observe(o);}),()=>{V.delete(n)&&(i.forEach(o=>{let a=(A.get(o)??1)-1;if(a)return void A.set(o,a);A.delete(o),I?.unobserve(o);}),V.size||(I?.disconnect(),I=void 0));}}var xe=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function tt(e,t){let n={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return n;let i=typeof e=="string"?document.querySelector(e):e;if(!i)return fe("timeline: Container not found:",e),n;let o=i,{trigger:a={},speed:f=1,once:b=false,axis:v="y",tracks:l,onComplete:p,repeat:g,repeatDelay:L=0,loop:G=false,loopDuration:Ee=1500,debug:Me=false,label:Le,respectReducedMotion:ee=true}=t,Te=Y(a.start??"top bottom"),Se=Y(a.end??"bottom top"),$=g==="infinite"?1/0:g??0,d,Q=G===true?1/0:typeof G=="number"?G:0,h=false,W=0,T=Q,q=ee&&me(),Re=pe(r=>{q=ee&&r,q&&(h=false,clearTimeout(d),d=void 0);}),N=()=>Q>0&&!q,B=new Map,j=l.map(r=>{let u=typeof r.easing=="function"?r.easing:J[r.easing??"linear"]??J.linear,m=Array.from(o.querySelectorAll(r.selector)),c=m.map(s=>Z(s));return m.forEach((s,y)=>{B.has(s)||B.set(s,s.getAttribute("style")??""),s.style.strokeDasharray=`${c[y]}`,s.style.strokeDashoffset=`${c[y]}`,r.fade&&(s.style.opacity="0");}),{...r,elements:m,lengths:c,easeFn:u}});function De(){for(let[r,u]of B)u?r.setAttribute("style",u):r.removeAttribute("style");}let H=0,K=0,k=false,x=false,E=0,R=false,D=-1,M=0,w=null;Me&&(w=document.createElement("div"),Object.assign(w.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(w));function _e(r){if(!w)return;let u=Le??(typeof e=="string"?e:"timeline"),m=l.map(({selector:c,from:s,to:y},X)=>{let S=xe[X%xe.length],P=y>s?Math.min(1,Math.max(0,(r-s)/(y-s))):0,z=Math.round(P*100);return `<div style="margin:4px 0">
|
|
2
2
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
|
|
3
|
-
<span style="color:${S};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${
|
|
4
|
-
<span style="color:#666;margin-left:8px">${
|
|
3
|
+
<span style="color:${S};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${c}</span>
|
|
4
|
+
<span style="color:#666;margin-left:8px">${z}%</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div style="height:3px;background:#2a2a2a;border-radius:2px;position:relative;overflow:hidden">
|
|
7
|
-
<div style="position:absolute;left:${
|
|
8
|
-
<div style="position:absolute;left:${
|
|
7
|
+
<div style="position:absolute;left:${s*100}%;width:${(y-s)*100}%;height:100%;background:${S}33;border-radius:2px"></div>
|
|
8
|
+
<div style="position:absolute;left:${s*100}%;width:${(y-s)*P*100}%;height:100%;background:${S};border-radius:2px;transition:width 0.05s linear"></div>
|
|
9
9
|
</div>
|
|
10
|
-
</div>`}).join("");
|
|
10
|
+
</div>`}).join("");w.innerHTML=`
|
|
11
11
|
<div style="color:#555;margin-bottom:8px;font-size:10px;text-transform:uppercase;letter-spacing:0.12em;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:6px">
|
|
12
|
-
scrollDrawTimeline \xB7 ${
|
|
12
|
+
scrollDrawTimeline \xB7 ${u}
|
|
13
13
|
</div>
|
|
14
|
-
${
|
|
14
|
+
${m}
|
|
15
15
|
<div style="margin-top:6px;padding-top:6px;border-top:1px solid rgba(255,255,255,0.06)">
|
|
16
16
|
<div style="display:flex;justify-content:space-between;margin-bottom:2px">
|
|
17
17
|
<span style="color:#555">scroll</span>
|
|
18
|
-
<span style="color:#666">${Math.round(
|
|
18
|
+
<span style="color:#666">${Math.round(r*100)}%</span>
|
|
19
19
|
</div>
|
|
20
20
|
<div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
|
|
21
|
-
<div style="height:100%;background:#fff;border-radius:1px;width:${
|
|
21
|
+
<div style="height:100%;background:#fff;border-radius:1px;width:${r*100}%;transition:width 0.05s linear"></div>
|
|
22
22
|
</div>
|
|
23
|
-
</div>`;}function
|
|
23
|
+
</div>`;}function te(){return v==="x"?window.scrollX:window.scrollY}function Ie(){return v==="x"?window.innerWidth:window.innerHeight}function ne(){let r=o.getBoundingClientRect(),u=te(),m=v==="x"?r.left:r.top,c=v==="x"?r.width:r.height,s=de({top:m,height:c},u,Ie(),Te,Se);H=s.tStart,K=s.tEnd;}function re(r){o.style.setProperty("--scroll-draw-progress",String(r)),j.forEach(({elements:u,lengths:m,from:c,to:s,easeFn:y,fade:X})=>{let S=s-c,P=S>0?Math.min(1,Math.max(0,(r-c)/S)):0,z=y(P);u.forEach((se,$e)=>{se.style.strokeDashoffset=`${m[$e]*(1-z)}`,X&&(se.style.opacity=String(z));});}),_e(r);}function F(){D=-1,M=0,R=false,j.forEach(({elements:r,lengths:u,fade:m})=>{r.forEach((c,s)=>{c.style.strokeDashoffset=`${u[s]}`,m&&(c.style.opacity="0");});}),o.style.setProperty("--scroll-draw-progress","0");}function U(){if(!k||x)return;let r;h?r=Math.min(1,(performance.now()-W)/Ee):(r=le(te(),H,K,f),(b||N())&&(D=Math.max(D,r),r=D)),M=r,re(r),r>=1&&!R?(R=true,p?.(),N()&&!h&&!d?d=setTimeout(()=>{d=void 0,T!==1/0&&T--,F(),h=true,W=performance.now();},L):$>0&&b&&!h&&!d&&(d=setTimeout(()=>{d=void 0,$!==1/0&&$--,F();},L))):!h&&r<1&&!b&&(R=false),h&&r>=1&&!d&&(R=false,T>0&&N()?d=setTimeout(()=>{d=void 0,T!==1/0&&T--,F(),W=performance.now();},L):h=false),E=requestAnimationFrame(U);}ne();let oe=new IntersectionObserver(r=>{r.forEach(u=>{k=u.isIntersecting,k&&!x?E=requestAnimationFrame(U):cancelAnimationFrame(E);});},{threshold:0});oe.observe(o);function ie(){j.forEach(({elements:r,lengths:u})=>{r.forEach((m,c)=>{u[c]=Z(m),m.style.strokeDasharray=`${u[c]}`;});}),ne();}let O;function _(){clearTimeout(O),O=setTimeout(ie,150);}window.addEventListener("resize",_),window.addEventListener("orientationchange",_);let Ae=ve([o],_);return he(o,{type:"draw",getProgress:()=>M,getTrigger:()=>({tStart:H,tEnd:K})}),{destroy(){cancelAnimationFrame(E),clearTimeout(O),clearTimeout(d),oe.disconnect(),ye(o),window.removeEventListener("resize",_),window.removeEventListener("orientationchange",_),Ae(),Re(),w&&(w.remove(),w=null),De(),o.style.removeProperty("--scroll-draw-progress");},refresh(){clearTimeout(O),ie();},replay(){$=g==="infinite"?1/0:g??0,T=Q,h=false,clearTimeout(d),d=void 0,F(),x=false;},pause(){x=true,cancelAnimationFrame(E);},resume(){x&&(x=false,k&&(E=requestAnimationFrame(U)));},seek(r){M=Math.min(1,Math.max(0,r)),D=M,x=true,cancelAnimationFrame(E),re(M);},getProgress(){return M}}}exports.scrollDrawTimeline=tt;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EasingName, S as ScrollDrawInstance } from '../types-
|
|
1
|
+
import { E as EasingName, S as ScrollDrawInstance } from '../types-B0YM4nQP.mjs';
|
|
2
2
|
|
|
3
3
|
interface TimelineTrack {
|
|
4
4
|
/** CSS selector for paths within the container to animate on this track. */
|
package/dist/timeline/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EasingName, S as ScrollDrawInstance } from '../types-
|
|
1
|
+
import { E as EasingName, S as ScrollDrawInstance } from '../types-B0YM4nQP.js';
|
|
2
2
|
|
|
3
3
|
interface TimelineTrack {
|
|
4
4
|
/** CSS selector for paths within the container to animate on this track. */
|
package/dist/timeline/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-YZV4Z3EQ.mjs';import {a,c,b as b$2}from'../chunk-
|
|
1
|
+
import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-YZV4Z3EQ.mjs';import {a,d as d$1,c,b as b$2}from'../chunk-A4JCC3QQ.mjs';import {d}from'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$4,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var le=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Ae(u,ce){let V={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return V;let W=typeof u=="string"?document.querySelector(u):u;if(!W)return b("timeline: Container not found:",u),V;let s=W,{trigger:_={},speed:pe=1,once:$=false,axis:w="y",tracks:B,onComplete:de,repeat:x,repeatDelay:I=0,loop:L=false,loopDuration:fe=1500,debug:ue=false,label:me,respectReducedMotion:U=true}=ce,ge=a(_.start??"top bottom"),ye=a(_.end??"bottom top"),v=x==="infinite"?1/0:x??0,r,k=L===true?1/0:typeof L=="number"?L:0,a$5=false,A=0,m=k,R=U&&a$1(),be=a$2(e=>{R=U&&e,R&&(a$5=false,clearTimeout(r),r=void 0);}),F=()=>k>0&&!R,z=new Map,C=B.map(e=>{let n=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,i=Array.from(s.querySelectorAll(e.selector)),o=i.map(t=>a$3(t));return i.forEach((t,l)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${o[l]}`,t.style.strokeDashoffset=`${o[l]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:i,lengths:o,easeFn:n}});function he(){for(let[e,n]of z)n?e.setAttribute("style",n):e.removeAttribute("style");}let P=0,H=0,T=false,p=false,d$2=0,y=false,b$3=-1,f=0,c$1=null;ue&&(c$1=document.createElement("div"),Object.assign(c$1.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(c$1));function we(e){if(!c$1)return;let n=me??(typeof u=="string"?u:"timeline"),i=B.map(({selector:o,from:t,to:l},q)=>{let g=le[q%le.length],D=l>t?Math.min(1,Math.max(0,(e-t)/(l-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
|
|
2
2
|
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
|
|
3
3
|
<span style="color:${g};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${o}</span>
|
|
4
4
|
<span style="color:#666;margin-left:8px">${S}%</span>
|
|
5
5
|
</div>
|
|
6
6
|
<div style="height:3px;background:#2a2a2a;border-radius:2px;position:relative;overflow:hidden">
|
|
7
|
-
<div style="position:absolute;left:${t*100}%;width:${(
|
|
8
|
-
<div style="position:absolute;left:${t*100}%;width:${(
|
|
7
|
+
<div style="position:absolute;left:${t*100}%;width:${(l-t)*100}%;height:100%;background:${g}33;border-radius:2px"></div>
|
|
8
|
+
<div style="position:absolute;left:${t*100}%;width:${(l-t)*D*100}%;height:100%;background:${g};border-radius:2px;transition:width 0.05s linear"></div>
|
|
9
9
|
</div>
|
|
10
10
|
</div>`}).join("");c$1.innerHTML=`
|
|
11
11
|
<div style="color:#555;margin-bottom:8px;font-size:10px;text-transform:uppercase;letter-spacing:0.12em;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:6px">
|
|
@@ -20,4 +20,4 @@ import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$1}from'../chunk-AJ22
|
|
|
20
20
|
<div style="height:2px;background:#2a2a2a;border-radius:1px;overflow:hidden">
|
|
21
21
|
<div style="height:100%;background:#fff;border-radius:1px;width:${e*100}%;transition:width 0.05s linear"></div>
|
|
22
22
|
</div>
|
|
23
|
-
</div>`;}function X(){return
|
|
23
|
+
</div>`;}function X(){return w==="x"?window.scrollX:window.scrollY}function xe(){return w==="x"?window.innerWidth:window.innerHeight}function Y(){let e=s.getBoundingClientRect(),n=X(),i=w==="x"?e.left:e.top,o=w==="x"?e.width:e.height,t=c({top:i,height:o},n,xe(),ge,ye);P=t.tStart,H=t.tEnd;}function J(e){s.style.setProperty("--scroll-draw-progress",String(e)),C.forEach(({elements:n,lengths:i,from:o,to:t,easeFn:l,fade:q})=>{let g=t-o,D=g>0?Math.min(1,Math.max(0,(e-o)/g)):0,S=l(D);n.forEach((Z,Te)=>{Z.style.strokeDashoffset=`${i[Te]*(1-S)}`,q&&(Z.style.opacity=String(S));});}),we(e);}function E(){b$3=-1,f=0,y=false,C.forEach(({elements:e,lengths:n,fade:i})=>{e.forEach((o,t)=>{o.style.strokeDashoffset=`${n[t]}`,i&&(o.style.opacity="0");});}),s.style.setProperty("--scroll-draw-progress","0");}function O(){if(!T||p)return;let e;a$5?e=Math.min(1,(performance.now()-A)/fe):(e=b$2(X(),P,H,pe),($||F())&&(b$3=Math.max(b$3,e),e=b$3)),f=e,J(e),e>=1&&!y?(y=true,de?.(),F()&&!a$5&&!r?r=setTimeout(()=>{r=void 0,m!==1/0&&m--,E(),a$5=true,A=performance.now();},I):v>0&&$&&!a$5&&!r&&(r=setTimeout(()=>{r=void 0,v!==1/0&&v--,E();},I))):!a$5&&e<1&&!$&&(y=false),a$5&&e>=1&&!r&&(y=false,m>0&&F()?r=setTimeout(()=>{r=void 0,m!==1/0&&m--,E(),A=performance.now();},I):a$5=false),d$2=requestAnimationFrame(O);}Y();let K=new IntersectionObserver(e=>{e.forEach(n=>{T=n.isIntersecting,T&&!p?d$2=requestAnimationFrame(O):cancelAnimationFrame(d$2);});},{threshold:0});K.observe(s);function Q(){C.forEach(({elements:e,lengths:n})=>{e.forEach((i,o)=>{n[o]=a$3(i),i.style.strokeDasharray=`${n[o]}`;});}),Y();}let M;function h(){clearTimeout(M),M=setTimeout(Q,150);}window.addEventListener("resize",h),window.addEventListener("orientationchange",h);let ve=d$1([s],h);return a$4(s,{type:"draw",getProgress:()=>f,getTrigger:()=>({tStart:P,tEnd:H})}),{destroy(){cancelAnimationFrame(d$2),clearTimeout(M),clearTimeout(r),K.disconnect(),b$1(s),window.removeEventListener("resize",h),window.removeEventListener("orientationchange",h),ve(),be(),c$1&&(c$1.remove(),c$1=null),he(),s.style.removeProperty("--scroll-draw-progress");},refresh(){clearTimeout(M),Q();},replay(){v=x==="infinite"?1/0:x??0,m=k,a$5=false,clearTimeout(r),r=void 0,E(),p=false;},pause(){p=true,cancelAnimationFrame(d$2);},resume(){p&&(p=false,T&&(d$2=requestAnimationFrame(O)));},seek(e){f=Math.min(1,Math.max(0,e)),b$3=f,p=true,cancelAnimationFrame(d$2),J(f);},getProgress(){return f}}}export{Ae as scrollDrawTimeline};
|
|
@@ -68,6 +68,11 @@ interface ScrollDrawOptions {
|
|
|
68
68
|
* `<line>`, and other SVG shape elements.
|
|
69
69
|
*/
|
|
70
70
|
morphTo?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Progress 0–1, called as the scroll moves. Under `stagger` it is the first
|
|
73
|
+
* path's, the same value `getProgress()` and `--scroll-draw-progress` give;
|
|
74
|
+
* `onComplete` waits for the last path.
|
|
75
|
+
*/
|
|
71
76
|
onProgress?: (alpha: number) => void;
|
|
72
77
|
onStart?: () => void;
|
|
73
78
|
onComplete?: () => void;
|
|
@@ -125,7 +130,7 @@ interface ScrollDrawInstance {
|
|
|
125
130
|
resume: () => void;
|
|
126
131
|
/** Jump to a specific progress value (0–1) and pause. */
|
|
127
132
|
seek: (progress: number) => void;
|
|
128
|
-
/** Returns current draw progress (0–1)
|
|
133
|
+
/** Returns current draw progress (0–1): the first path's under `stagger`, as `onProgress`. */
|
|
129
134
|
getProgress: () => number;
|
|
130
135
|
/**
|
|
131
136
|
* Re-measure after a layout change: path lengths, and the scroll trigger window.
|
|
@@ -68,6 +68,11 @@ interface ScrollDrawOptions {
|
|
|
68
68
|
* `<line>`, and other SVG shape elements.
|
|
69
69
|
*/
|
|
70
70
|
morphTo?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Progress 0–1, called as the scroll moves. Under `stagger` it is the first
|
|
73
|
+
* path's, the same value `getProgress()` and `--scroll-draw-progress` give;
|
|
74
|
+
* `onComplete` waits for the last path.
|
|
75
|
+
*/
|
|
71
76
|
onProgress?: (alpha: number) => void;
|
|
72
77
|
onStart?: () => void;
|
|
73
78
|
onComplete?: () => void;
|
|
@@ -125,7 +130,7 @@ interface ScrollDrawInstance {
|
|
|
125
130
|
resume: () => void;
|
|
126
131
|
/** Jump to a specific progress value (0–1) and pause. */
|
|
127
132
|
seek: (progress: number) => void;
|
|
128
|
-
/** Returns current draw progress (0–1)
|
|
133
|
+
/** Returns current draw progress (0–1): the first path's under `stagger`, as `onProgress`. */
|
|
129
134
|
getProgress: () => number;
|
|
130
135
|
/**
|
|
131
136
|
* Re-measure after a layout change: path lengths, and the scroll trigger window.
|
package/dist/video/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';function me({bounces:e=3,decay:t=.5}={}){let r=Math.max(1,Math.round(e)),n=Math.max(.01,Math.min(.99,t)),o=Math.sqrt(n),i=0,m=[];for(let a=0;a<r;a++){let u=Math.pow(o,a);m.push(u),i+=u;}let c=[0],M=0;for(let a=0;a<r;a++)M+=m[a]/i,c.push(M);return a=>{if(a<=0)return 0;if(a>=1)return 1;for(let u=0;u<r;u++)if(a<=c[u+1]){let g=(a-c[u])/(c[u+1]-c[u]);if(u===0)return g*(2-g);let S=1-Math.pow(n,u);return S+(1-S)*(2*g-1)*(2*g-1)}return 1}}function ce({amplitude:e=1,period:t=.4}={}){let r=Math.max(1,e),n=Math.max(.1,t),o=r<=1?n/4:n/(2*Math.PI)*Math.asin(1/r);return i=>i<=0?0:i>=1?1:r*Math.pow(2,-10*i)*Math.sin((i-o)*(2*Math.PI)/n)+1}var C={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:me(),elastic:ce()};function X(e,t,r){return Math.min(r,Math.max(t,e))}function F(e="top bottom"){let t=e.trim();if(/^\d+(\.\d+)?%$/.test(t))return {element:"top",viewport:t};let[r="top",n="bottom"]=t.split(/\s+/).filter(Boolean);return {element:r,viewport:n}}function j(e,t,r,n){switch(n){case "top":return e+r;case "center":return e+r+t/2;case "bottom":return e+r+t;default:return e+r}}function J(e,t){if(/^\d+(\.\d+)?%$/.test(e))return t*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return t/2;case "bottom":return t;default:return t}}function Q(e,t,r,n){return r===t?0:X((e-t)/(r-t)*n,0,1)}function U(e,t,r,n,o){let i=j(e.top,e.height,t,n.element)-J(n.viewport,r),m=j(e.top,e.height,t,o.element)-J(o.viewport,r);return {tStart:i,tEnd:m}}var Y=Symbol.for("svg-scroll-draw.registry");function Z(){let e=globalThis;return e[Y]||(e[Y]=new Map)}function H(e,t){Z().set(e,t);}function ee(e){Z().delete(e);}var v,V=new Set,P=new WeakMap,x=new Map,te=e=>{let t=e.getBoundingClientRect();return t.width+" "+t.height};function le(e){let t=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let n=r;n;n=n.previousElementSibling)t.add(n);return t}function ne(e,t){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>t();v??(v=new ResizeObserver(o=>{let i=false;for(let{target:m}of o)P.get(m)!==te(m)&&(i=true),P.set(m,"");i&&V.forEach(m=>m());})),V.add(r);let n=le(e);return [document.body,document.documentElement].forEach(o=>o&&n.add(o)),n.forEach(o=>{P.has(o)||P.set(o,te(o)),x.set(o,(x.get(o)??0)+1),v.observe(o);}),()=>{V.delete(r)&&(n.forEach(o=>{let i=(x.get(o)??1)-1;if(i)return void x.set(o,i);x.delete(o),v?.unobserve(o);}),V.size||(v?.disconnect(),v=void 0));}}var de=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function q(e,...t){de&&console.warn(`[svg-scroll-draw] ${e}`,...t);}var re={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function _e(e,t={}){if(typeof window>"u")return re;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return q("scrollVideo: <video> element not found:",e),re;let n=r,{trigger:o={},easing:i="linear",once:m=false,axis:c="y",preload:M="auto",triggerElement:a,onReady:u,onComplete:g,onProgress:S}=t,W=a??n,k=window.matchMedia("(prefers-reduced-motion: reduce)").matches,oe=typeof i=="function"?i:C[i]??C.linear,ie=F(o.start??"top top"),se=F(o.end??"bottom top");n.pause(),n.hasAttribute("preload")||(n.preload=M);let G=t.from??0,N=t.to,_=0,R=0,d=0,b=false,f=false,w=-1,h=0,T=false,p=false,B=()=>c==="x"?window.scrollX:window.scrollY,ae=()=>c==="x"?window.innerWidth:window.innerHeight;function O(){let s=W.getBoundingClientRect(),l=c==="x"?s.left:s.top,y=c==="x"?s.width:s.height,K=U({top:l,height:y},B(),ae(),ie,se);_=K.tStart,R=K.tEnd,p&&R===_&&q("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",n);}let A=NaN;function L(s){if(!p)return;let l=N??n.duration??0,y=G+(l-G)*s;y!==A&&(A=y,n.currentTime=y),n.style.setProperty("--scroll-draw-progress",String(s)),S?.(s);}function I(){if(!b||f||!p||k)return;let s=oe(Q(B(),_,R,1));m&&(w=Math.max(w,s),s=w),h=s,L(s),s>=1&&!T?(T=true,g?.()):s<1&&!m&&(T=false),d=requestAnimationFrame(I);}function z(){if(p=true,N===void 0&&(N=n.duration),k){L(1),u?.();return}O(),u?.(),b&&!f&&(d=requestAnimationFrame(I));}n.readyState>=1?z():n.addEventListener("loadedmetadata",z,{once:true}),p||O();let $=new IntersectionObserver(s=>{s.forEach(l=>{b=l.isIntersecting,b&&!f&&p?d=requestAnimationFrame(I):cancelAnimationFrame(d);});}),D;function E(){clearTimeout(D),D=setTimeout(O,150);}window.addEventListener("resize",E),window.addEventListener("orientationchange",E);let ue=ne([W],E);return $.observe(n),H(n,{type:"video",getProgress:()=>h,getTrigger:()=>({tStart:_,tEnd:R})}),{destroy(){cancelAnimationFrame(d),$.disconnect(),n.removeEventListener("loadedmetadata",z),window.removeEventListener("resize",E),window.removeEventListener("orientationchange",E),ue(),clearTimeout(D),ee(n);},replay(){w=-1,T=false,h=0,f=false,A=NaN,L(0);},pause(){f=true,cancelAnimationFrame(d);},resume(){f&&(f=false,b&&p&&(d=requestAnimationFrame(I)));},seek(s){let l=Math.min(1,Math.max(0,s));h=l,w=l,f=true,cancelAnimationFrame(d),A=NaN,L(l);},getProgress(){return h}}}exports.scrollVideo=_e;
|
package/dist/video/index.d.mts
CHANGED
package/dist/video/index.d.ts
CHANGED
package/dist/video/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as scrollVideo}from'../chunk-
|
|
1
|
+
export{a as scrollVideo}from'../chunk-7SBTYJGH.mjs';import'../chunk-A4JCC3QQ.mjs';import'../chunk-DM6EDKWH.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var vue=require('vue');function
|
|
2
|
-
<div style="position:absolute;${m?`left:${
|
|
3
|
-
<div style="position:absolute;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}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(t),window.addEventListener("scroll",a,{passive:true}),a(),{el:t,destroy(){window.removeEventListener("scroll",a),t.remove();}}}var It=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Dt=/[MmLlHhVvCcSsQqTtAaZz]/g;function ar(e,n,r){if(!Ue)return;let t=(e.match(Dt)??[]).join("").toUpperCase(),a=(n.match(Dt)??[]).join("").toUpperCase(),s=(e.match(It)??[]).length,c=(n.match(It)??[]).length;if(t!==a){ge(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${a||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==c&&ge(`morphTo: coordinate count differs (${s} \u2192 ${c}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function ut(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),a=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let c=parseFloat(s),u=t[a++]??c;return String(+(c+(u-c)*r).toFixed(4))})}function mt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,a=r?{...$t[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:c="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:d="linear",trigger:E={},stagger:V=0,direction:L="forward",once:re=false,debug:Me=false,axis:W="y",scrollContainer:ne,autoReverse:oe=false,delay:Y=0,strokeColor:M,strokeWidth:D,fillOpacity:C,waypoints:w,velocityScale:R=false,threshold:P=0,rootMargin:$="0px",repeat:T=0,repeatDelay:X=0,morphTo:x,clip:fe,autoplay:be=false,duration:se=1e3,native:ie=true,onProgress:p,onStart:S,onComplete:g,onEnter:O,onLeave:ae,onEnterBack:ee,onLeaveBack:A}=a,F=fe===true?"left":typeof fe=="string"?fe:false,K=typeof d=="function"?d:te[d]??te.linear,we=de(E.start??"top bottom"),_e=de(E.end??"bottom top"),ve=typeof ne=="string"?document.querySelector(ne):ne??null,Se=Array.isArray(M)?M[0]:null,le=Array.isArray(M)?M[1]:typeof M=="string"?M:null,ce=Array.isArray(D)?D[0]:null,G=Array.isArray(D)?D[1]:typeof D=="number"?D:null,pe=Array.isArray(C)?C[0]:null,Q=Array.isArray(C)?C[1]:typeof C=="number"?C:null;function Pe(o){let l=o*100;switch(F){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 z=F?[]:Array.from(e.querySelectorAll(c)),k=[],i=[],f=0,ye=0,N=false,_=false,q=0,Ae=false,Ee=-1,Z=[],Ne=-1,j=false,Oe=0,Ie=0,He,st=null;function ht(){st?.destroy(),st=null;}let Ve=new Set,bt=NaN,ze=true,Qe=-1,wt=performance.now(),qe=NaN;function it(){return ve?W==="x"?ve.scrollLeft:ve.scrollTop:W==="x"?window.scrollX:window.scrollY}function vt(){return ve?W==="x"?ve.clientWidth:ve.clientHeight:W==="x"?window.innerWidth:window.innerHeight}function St(){let o=nt(e,ve,W);return xe(o,o.scroll,vt(),we,_e)}function Et(){(({tStart:f,tEnd:ye}=St())),Me&&Ue&&(ht(),st=ir(f,ye,W));}function at(o,l=St){Ce(e,{type:"draw",getProgress:()=>o.getProgress(),getTrigger:l});let b=o.destroy;return o.destroy=()=>{b.call(o),$e(e);},o}function Ut(o,l){if(e.style.setProperty("--scroll-draw-progress",String(o)),F){let b=l==="reverse"?1-o:o;e.style.clipPath=Pe(b);return}z.forEach((b,ue)=>{b.style.strokeDashoffset=l==="reverse"?`${k[ue]*o}`:`${k[ue]*(1-o)}`,m&&(b.style.opacity=l==="reverse"?`${1-o}`:`${o}`),Se&&le?b.style.stroke=We(Se,le,o):le&&(b.style.stroke=le),ce!==null&&G!==null?b.style.strokeWidth=`${ce+(G-ce)*o}`:G!==null&&(b.style.strokeWidth=`${G}`),pe!==null&&Q!==null?b.style.fillOpacity=`${pe+(Q-pe)*o}`:Q!==null&&(b.style.fillOpacity=`${Q}`),x&&b.tagName.toLowerCase()==="path"&&i[ue]&&b.setAttribute("d",ut(i[ue],x,o));});}function Ze(){if(e.style.setProperty("--scroll-draw-progress","0"),F){e.style.clipPath=Pe(0);return}z.forEach((o,l)=>{o.style.strokeDasharray=`${k[l]}`,o.style.strokeDashoffset=L==="reverse"?"0":`${k[l]}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`),x&&o.tagName.toLowerCase()==="path"&&i[l]&&o.setAttribute("d",i[l]);});}if(z.forEach(o=>{sr(o);let l=Be(o);k.push(l);let b=o.tagName.toLowerCase()==="path";b?i.push(o.getAttribute("d")??""):i.push(""),x&&(b?ar(i[i.length-1],x,o):ge(`morphTo only applies to <path> elements \u2014 ignored on <${o.tagName}>.`,o)),s?(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=L==="reverse"?`${l}`:"0",m&&(o.style.opacity="1"),le&&(o.style.stroke=le),G!==null&&(o.style.strokeWidth=`${G}`),Q!==null&&(o.style.fillOpacity=`${Q}`),x&&o.tagName.toLowerCase()==="path"&&o.setAttribute("d",x)):(o.style.strokeDasharray=`${l}`,o.style.strokeDashoffset=L==="reverse"?"0":`${l}`,m?o.style.opacity=L==="reverse"?"1":"0":o.style.opacity="",Se&&(o.style.stroke=Se),ce!==null&&(o.style.strokeWidth=`${ce}`),pe!==null&&(o.style.fillOpacity=`${pe}`));}),F){if(s)return e.style.clipPath=Pe(1),g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Pe(0);}else if(s)return g?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Tt=typeof d=="string"?ot(d):null;function Yt(){return !(ie===false||!or()||!z.length||!Tt||F||W!=="y"||ve||u!==1||V!==0||re||oe||R!==false||x||w||T||Y>0||p||S||g||O||ae||ee||A||M!=null||D!=null||C!=null||(E.start??"top bottom").trim()!=="top bottom"||(E.end??"bottom top").trim()!=="bottom top")}function Xt(){let o=++nr,l=`svg-scroll-draw-${o}`,b=`svg-scroll-draw-host-${o}`,ue=`--svg-scroll-draw-${o}`,De=L==="reverse"?"0":"var(--ssd-len)",ke=L==="reverse"?"var(--ssd-len)":"0",Le=`stroke-dashoffset:${De};`,v=`stroke-dashoffset:${ke};`;m&&(Le+=`opacity:${L==="reverse"?1:0};`,v+=`opacity:${L==="reverse"?0:1};`);let I=document.createElement("style");I.setAttribute("data-svg-scroll-draw",""),I.textContent=`@keyframes ${l}{from{${Le}}to{${v}}}.${b}{view-timeline-name:${ue};view-timeline-axis:block;}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${Tt};animation-fill-mode:both;animation-timeline:${ue};animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(b);function me(y,U){y.style.setProperty("--ssd-len",String(k[U])),y.style.strokeDasharray=`${k[U]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(l);}z.forEach(me);let h=false,H=-1;function B(){if(H>=0)return H;let y=e.getBoundingClientRect(),{tStart:U,tEnd:Te}=xe({top:y.top,height:y.height},it(),vt(),we,_e);return K(J(it(),U,Te,u))}return {destroy(){e.classList.remove(b),z.forEach(y=>{y.classList.remove(l),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),I.remove();},replay(){h=false,H=-1,z.forEach(me);},pause(){h=true,z.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,z.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let U=Math.min(1,Math.max(0,y));H=U,h=true,z.forEach((Te,he)=>{Te.classList.remove(l),Te.style.strokeDashoffset=L==="reverse"?`${k[he]*U}`:`${k[he]*(1-U)}`,m&&(Te.style.opacity=L==="reverse"?`${1-U}`:`${U}`);});},getProgress(){return B()},refresh(){z.forEach((y,U)=>{k[U]=Be(y),y.style.setProperty("--ssd-len",String(k[U])),y.style.strokeDasharray=`${k[U]}`;});}}}if(Yt())return at(Xt());function Kt(){let o=Math.max(1,se),l=0,b=0,ue=false;function De(h){let H=true;if(F){let B=Math.min(1,Math.max(0,h/o)),y=K(B);Oe=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Pe(L==="reverse"?1-y:y),p?.(y),B<1&&(H=false);}else z.forEach((B,y)=>{let U=y*V*o,Te=Math.min(1,Math.max(0,(h-U)/o)),he=K(Te);B.style.strokeDashoffset=L==="reverse"?`${k[y]*he}`:`${k[y]*(1-he)}`,m&&(B.style.opacity=L==="reverse"?`${1-he}`:`${he}`),Se&&le?B.style.stroke=We(Se,le,he):le&&(B.style.stroke=le),ce!==null&&G!==null?B.style.strokeWidth=`${ce+(G-ce)*he}`:G!==null&&(B.style.strokeWidth=`${G}`),pe!==null&&Q!==null?B.style.fillOpacity=`${pe+(Q-pe)*he}`:Q!==null&&(B.style.fillOpacity=`${Q}`),x&&B.tagName.toLowerCase()==="path"&&i[y]&&B.setAttribute("d",ut(i[y],x,he)),y===0&&(Oe=he,p?.(he),e.style.setProperty("--scroll-draw-progress",String(he))),Te<1&&(H=false);});if(w){let B=Math.min(1,Math.max(0,h/o)),y=K(B);for(let U in w){let Te=parseFloat(U);y>=Te&&!Ve.has(Te)&&(Ve.add(Te),w[U]?.());}}return H}function ke(h){if(j)return;let H=h-l;_||(_=true,S?.());let B=De(H);if(B&&!N){N=true,De(o*(1+Math.max(0,z.length-1)*V)),g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,He=setTimeout(()=>{l=performance.now(),_=false,N=false,Ve.clear(),Ze(),q=requestAnimationFrame(ke);},X));return}B||(q=requestAnimationFrame(ke));}function Le(){cancelAnimationFrame(q),clearTimeout(He),l=performance.now(),b=0,j=false,_=false,N=false,Ie=0,ue=true,Oe=0,Ve.clear(),Ze(),q=requestAnimationFrame(ke);}let v=new IntersectionObserver(h=>{h.forEach(H=>{H.isIntersecting&&!(re&&N)?Le():!H.isIntersecting&&!re&&!N&&(cancelAnimationFrame(q),clearTimeout(He),ue=false);});},{root:ve??null,threshold:P,rootMargin:$}),I;function me(){clearTimeout(I),I=setTimeout(()=>{z.forEach((h,H)=>{k[H]=Be(h),h.style.strokeDasharray=`${k[H]}`;});},150);}return window.addEventListener("resize",me),window.addEventListener("orientationchange",me),Y>0?setTimeout(()=>v.observe(e),Y):v.observe(e),{destroy(){cancelAnimationFrame(q),clearTimeout(He),v.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),clearTimeout(I);},replay(){Ie=0,Le();},pause(){j||!ue||(j=true,b=performance.now()-l,cancelAnimationFrame(q));},resume(){j&&(j=false,ue=true,l=performance.now()-b,q=requestAnimationFrame(ke));},seek(h){let H=Math.min(1,Math.max(0,h));Oe=H,j=true,b=H*o,l=performance.now()-b,cancelAnimationFrame(q),De(b);},getProgress(){return Oe},refresh(){clearTimeout(I),z.forEach((h,H)=>{k[H]=Be(h),h.style.strokeDasharray=`${k[H]}`;});}}}if(be)return at(Kt());Et();function Je(){if(!Ae||j)return;let o=performance.now(),l=it();if(!ze&&R===false&&l===bt){q=requestAnimationFrame(Je);return}ze=false,bt=l;let b=u;if(R!==false){let v=o-wt,I=v>0?Math.abs(l-(Qe<0?l:Qe))/v:0;b=u*Math.max(.2,1+I*(typeof R=="number"?R:1)*.04);}Qe=l,wt=o;let ue=oe?Ne===-1||l>=Ne?"forward":"reverse":L;Ne=l;let De=ye-f,ke=true,Le=De===0?0:(l-f)/De;if(isNaN(qe)||(qe<=0&&Le>0?O?.():qe>0&&Le<=0&&A?.(),qe<1&&Le>=1?ae?.():qe>=1&&Le<1&&ee?.()),qe=Le,F){let v=K(J(l,f,ye,b));re&&!oe&&(Ee=Math.max(Ee,v),v=Ee),Oe=v,e.style.setProperty("--scroll-draw-progress",String(v));let I=ue==="reverse"?1-v:v;e.style.clipPath=Pe(I),p?.(v),!_&&J(l,f,ye,b)>0&&(_=true,S?.()),v>=1&&!N?(N=true,g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,He=setTimeout(()=>{Ee=-1,_=false,N=false,e.style.clipPath=Pe(0);},X))):v<1&&!re&&(N=false),q=requestAnimationFrame(Je);return}if(z.forEach((v,I)=>{let me=I*V*De,h=K(J(l,f+me,ye+me,b));re&&!oe&&(h=Z[I]=Math.max(Z[I]??Ee,h)),Oe=h,v.style.strokeDashoffset=ue==="reverse"?`${k[I]*h}`:`${k[I]*(1-h)}`,m&&(v.style.opacity=ue==="reverse"?`${1-h}`:`${h}`),Se&&le?v.style.stroke=We(Se,le,h):le&&(v.style.stroke=le),ce!==null&&G!==null?v.style.strokeWidth=`${ce+(G-ce)*h}`:G!==null&&(v.style.strokeWidth=`${G}`),pe!==null&&Q!==null?v.style.fillOpacity=`${pe+(Q-pe)*h}`:Q!==null&&(v.style.fillOpacity=`${Q}`),x&&v.tagName.toLowerCase()==="path"&&i[I]&&v.setAttribute("d",ut(i[I],x,h)),I===0&&(p?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(ke=false);}),w){let v=K(J(l,f,ye,b));for(let I in w){let me=parseFloat(I);v>=me&&!Ve.has(me)&&(Ve.add(me),w[I]?.());}}!_&&J(l,f,ye,b)>0&&(_=true,S?.()),ke&&!N?(N=true,g?.(),Ie<(T==="infinite"?1/0:T??0)&&(Ie++,He=setTimeout(()=>{Ee=-1,Z=[],_=false,N=false,Ve.clear(),Ze(),ze=true;},X))):!ke&&!re&&(N=false),q=requestAnimationFrame(Je);}let lt=false;function et(){lt||(lt=true,q=requestAnimationFrame(function(){Je();}));}function tt(){lt=false,cancelAnimationFrame(q);}let ct=new IntersectionObserver(o=>{o.forEach(l=>{Ae=l.isIntersecting,Ae&&!j?(ze=true,et()):tt();});},{root:ve??null,threshold:P,rootMargin:$});function xt(){z.forEach((o,l)=>{k[l]=Be(o),o.style.strokeDasharray=`${k[l]}`;}),Et(),ze=true;}let rt;function Ge(){clearTimeout(rt),rt=setTimeout(xt,150);}window.addEventListener("resize",Ge),window.addEventListener("orientationchange",Ge);let je;return typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>Ge()),je.observe(document.body),je.observe(document.documentElement),je.observe(e)),Y>0?setTimeout(()=>ct.observe(e),Y):ct.observe(e),at({destroy(){cancelAnimationFrame(q),clearTimeout(He),tt(),ct.disconnect(),je?.disconnect(),window.removeEventListener("resize",Ge),window.removeEventListener("orientationchange",Ge),clearTimeout(rt),ht();},replay(){Ee=-1,Z=[],Ne=-1,Qe=-1,_=false,N=false,Ie=0,j=false,Oe=0,Ve.clear(),clearTimeout(He),Ze(),ze=true,Ae&&et();},pause(){j=true,tt();},resume(){j&&(j=false,ze=true,Ae&&et());},seek(o){let l=Math.min(1,Math.max(0,o));Oe=l,Ee=l,Z=[],j=true,tt(),Ut(l,L),ze=true;},getProgress(){return Oe},refresh(){clearTimeout(rt),xt(),Ae&&!j&&et();}},()=>({tStart:f,tEnd:ye}))}var Nt=new WeakMap,lr=0;function Ht(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=Nt.get(r);return t===void 0&&Nt.set(r,t=++lr),`el#${t}`}return r})}function Vt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...a)=>n()[t]?.(...a));return r}function cr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function zt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let a=[],s=[],c=t[2].trim();if(c)for(let u of c.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);a.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:a,units:s});}return n}function ur(e,n,r){let t=zt(e),a=zt(n);return t.length===0||t.length!==a.length?r<1?e:n:t.map((s,c)=>{let u=a[c];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,d)=>`${m}${s.units[d]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,d)=>`${m}${u.units[d]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,d)=>`${m+(u.nums[d]-m)*r}${s.units[d]}`).join(", ")})`}).join(" ")}function _t(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),a=String(n);if(cr(t))return We(t,a,r);if(t.includes("("))return ur(t,a,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),c=a.match(/^([-+]?[\d.]+)(.*)$/);if(s&&c){let u=parseFloat(s[1]),m=parseFloat(c[1]);return `${u+(m-u)*r}${s[2]||c[2]}`}return r<1?t:a}function mr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var fr=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),pr=0,qt="--scroll-draw-progress";function dr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function ft(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:a={},easing:s="ease-out",speed:c=1,once:u=false,axis:m="y",scrollContainer:d,native:E=true,velocityScale:V=false,respectReducedMotion:L=true,triggerElement:re,onProgress:Me,onComplete:W,onEnter:ne,onLeave:oe,onEnterBack:Y,onLeaveBack:M}=n,D=L&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,C=typeof s=="function"?s:te[s]??te["ease-out"],w=de(a.start??"top bottom"),R=de(a.end??"bottom top"),P=re??e,$=typeof d=="string"?document.querySelector(d):d??null,T=Object.entries(t).map(([i,f])=>({prop:mr(i),from:Array.isArray(f)?f[0]:"",to:Array.isArray(f)?f[1]:f}));function X(){let i=window.getComputedStyle(e);for(let f of T)f.from===""&&(f.from=i.getPropertyValue(f.prop).trim()||"0");}function x(){for(let i of T)e.style.setProperty(i.prop,String(i.to));}let fe=new Map;for(let i of [...T.map(f=>f.prop),qt])fe.set(i,e.style.getPropertyValue(i));function be(){for(let[i,f]of fe)f?e.style.setProperty(i,f):e.style.removeProperty(i);}if(D)return x(),W?.(),{...r,destroy:be,getProgress:()=>1};X();let se=typeof s=="string"?ot(s):null;function ie(){if(!E||!dr()||!se||m!=="y"||$||P!==e||u||c!==1||Me||W||ne||oe||Y||M||V!==false||(a.start??"top bottom").trim()!=="top bottom"||(a.end??"bottom top").trim()!=="bottom top")return false;for(let i of T)if(!fr.has(i.prop))return false;return true}function p(){let i=`ssd-a-${++pr}`,f=T.map(Z=>`${Z.prop}:${Z.from}`).join(";"),ye=T.map(Z=>`${Z.prop}:${Z.to}`).join(";"),N=document.createElement("style");N.setAttribute("data-ssd-animate",""),N.textContent=`@keyframes ${i}{from{${f}}to{${ye}}}.${i}{animation-name:${i};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(N),e.classList.add(i);let _=()=>m==="x"?window.scrollX:window.scrollY,q=()=>m==="x"?window.innerWidth:window.innerHeight,Ae=()=>{let Z=e.getBoundingClientRect();return xe({top:Z.top,height:Z.height},_(),q(),w,R)};Ce(e,{type:"animate",getProgress:()=>Ee.getProgress(),getTrigger:Ae});let Ee={destroy(){e.classList.remove(i),N.remove(),e.style.animationPlayState="",be(),$e(e);},replay(){e.classList.remove(i),e.offsetWidth,e.classList.add(i);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Z){let Ne=Math.min(1,Math.max(0,Z));e.classList.remove(i);for(let j of T)e.style.setProperty(j.prop,_t(j.from,j.to,Ne));},getProgress(){let{tStart:Z,tEnd:Ne}=Ae();return C(J(_(),Z,Ne,c))}};return Ee}if(ie())return p();let S=0,g=0,O=0,ae=false,ee=false,A=-1,F=0,K=false,we=NaN,_e=-1,ve=0,Se=()=>$?m==="x"?$.scrollLeft:$.scrollTop:m==="x"?window.scrollX:window.scrollY,le=()=>$?m==="x"?$.clientWidth:$.clientHeight:m==="x"?window.innerWidth:window.innerHeight;function ce(){let i=nt(P,$,m),f=xe(i,i.scroll,le(),w,R);S=f.tStart,g=f.tEnd;}function G(i){e.style.setProperty(qt,String(i));for(let f of T)e.style.setProperty(f.prop,_t(f.from,f.to,i));Me?.(i);}function pe(i){if(isNaN(we)){we=i;return}we<=0&&i>0?ne?.():we>0&&i<=0&&M?.(),we<1&&i>=1?oe?.():we>=1&&i<1&&Y?.(),we=i;}function Q(){if(!ae||ee)return;let i=performance.now(),f=Se(),ye=c;if(V!==false){let q=i-ve,Ae=q>0?Math.abs(f-(_e<0?f:_e))/q:0;ye=c*Math.max(.2,1+Ae*(typeof V=="number"?V:1)*.04);}_e=f,ve=i;let N=g===S?0:(f-S)/(g-S);pe(N);let _=C(J(f,S,g,ye));u&&(A=Math.max(A,_),_=A),F=_,G(_),_>=1&&!K?(K=true,W?.()):_<1&&!u&&(K=false),O=requestAnimationFrame(Q);}ce(),g===S&&ge("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 i=C(J(Se(),S,g,c));u&&i>0&&(A=i),F=i,G(i);}let Pe=new IntersectionObserver(i=>{i.forEach(f=>{ae=f.isIntersecting,ae&&!ee?O=requestAnimationFrame(Q):cancelAnimationFrame(O);});},{root:$??null}),z;function k(){clearTimeout(z),z=setTimeout(ce,150);}return window.addEventListener("resize",k),window.addEventListener("orientationchange",k),Pe.observe(e),Ce(e,{type:"animate",getProgress:()=>F,getTrigger:()=>({tStart:S,tEnd:g})}),{destroy(){cancelAnimationFrame(O),Pe.disconnect(),window.removeEventListener("resize",k),window.removeEventListener("orientationchange",k),clearTimeout(z),be(),$e(e);},replay(){A=-1,K=false,F=0,ee=false,G(0);},pause(){ee=true,cancelAnimationFrame(O);},resume(){ee&&(ee=false,ae&&(O=requestAnimationFrame(Q)));},seek(i){let f=Math.min(1,Math.max(0,i));F=f,A=f,ee=true,cancelAnimationFrame(O),G(f);},getProgress(){return F}}}var pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function dt(e,n){if(typeof window>"u")return pt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollCounter: element not found:",e),pt;let t=r,{from:a=0,to:s,format:c,easing:u="ease-out",trigger:m={},once:d=true,decimals:E,onComplete:V}=n,L=E!==void 0?p=>p.toFixed(E):c??(p=>String(Math.round(p))),re=typeof u=="function"?u:te[u]??te["ease-out"],Me=de(m.start??"top 80%"),W=de(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=L(s),V?.(),pt;let oe=0,Y=0,M=0,D=false,C=false,w=-1,R=0,P=false,$=()=>window.scrollY,T=()=>window.innerHeight;function X(){let p=t.getBoundingClientRect(),S=xe({top:p.top,height:p.height},$(),T(),Me,W);oe=S.tStart,Y=S.tEnd;}function x(p){t.textContent=L(a+(s-a)*p),t.style.setProperty("--scroll-draw-progress",String(p));}function fe(){if(!D||C)return;let p=re(J($(),oe,Y,1));d&&(w=Math.max(w,p),p=w),R=p,x(p),p>=1&&!P?(P=true,V?.()):p<1&&!d&&(P=false),M=requestAnimationFrame(fe);}X();{let p=re(J($(),oe,Y,1));d&&p>0&&(w=p),R=p,x(p);}let be=new IntersectionObserver(p=>{p.forEach(S=>{D=S.isIntersecting,D&&!C?M=requestAnimationFrame(fe):cancelAnimationFrame(M);});}),se;function ie(){clearTimeout(se),se=setTimeout(X,150);}return window.addEventListener("resize",ie),window.addEventListener("orientationchange",ie),be.observe(t),Ce(t,{type:"counter",getProgress:()=>R,getTrigger:()=>({tStart:oe,tEnd:Y})}),{destroy(){cancelAnimationFrame(M),be.disconnect(),window.removeEventListener("resize",ie),window.removeEventListener("orientationchange",ie),clearTimeout(se),$e(t);},replay(){w=-1,P=false,R=0,C=false,x(0);},pause(){C=true,cancelAnimationFrame(M);},resume(){C&&(C=false,D&&(M=requestAnimationFrame(fe)));},seek(p){let S=Math.min(1,Math.max(0,p));R=S,w=S,C=true,cancelAnimationFrame(M),x(S);},getProgress(){return R}}}var Bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function gt(e,n={}){if(typeof window>"u")return Bt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return ge("scrollVideo: <video> element not found:",e),Bt;let t=r,{trigger:a={},easing:s="linear",once:c=false,axis:u="y",preload:m="auto",triggerElement:d,onReady:E,onComplete:V,onProgress:L}=n,re=d??t,Me=window.matchMedia("(prefers-reduced-motion: reduce)").matches,W=typeof s=="function"?s:te[s]??te.linear,ne=de(a.start??"top top"),oe=de(a.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let Y=n.from??0,M=n.to,D=0,C=0,w=0,R=false,P=false,$=-1,T=0,X=false,x=false,fe=()=>u==="x"?window.scrollX:window.scrollY,be=()=>u==="x"?window.innerWidth:window.innerHeight;function se(){let A=re.getBoundingClientRect(),F=u==="x"?A.left:A.top,K=u==="x"?A.width:A.height,we=xe({top:F,height:K},fe(),be(),ne,oe);D=we.tStart,C=we.tEnd,x&&C===D&&ge("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ie=NaN;function p(A){if(!x)return;let F=M??t.duration??0,K=Y+(F-Y)*A;K!==ie&&(ie=K,t.currentTime=K),t.style.setProperty("--scroll-draw-progress",String(A)),L?.(A);}function S(){if(!R||P||!x||Me)return;let A=W(J(fe(),D,C,1));c&&($=Math.max($,A),A=$),T=A,p(A),A>=1&&!X?(X=true,V?.()):A<1&&!c&&(X=false),w=requestAnimationFrame(S);}function g(){if(x=true,M===void 0&&(M=t.duration),Me){p(1),E?.();return}se(),E?.(),R&&!P&&(w=requestAnimationFrame(S));}t.readyState>=1?g():t.addEventListener("loadedmetadata",g,{once:true}),x||se();let O=new IntersectionObserver(A=>{A.forEach(F=>{R=F.isIntersecting,R&&!P&&x?w=requestAnimationFrame(S):cancelAnimationFrame(w);});}),ae;function ee(){clearTimeout(ae),ae=setTimeout(se,150);}return window.addEventListener("resize",ee),window.addEventListener("orientationchange",ee),O.observe(t),Ce(t,{type:"video",getProgress:()=>T,getTrigger:()=>({tStart:D,tEnd:C})}),{destroy(){cancelAnimationFrame(w),O.disconnect(),t.removeEventListener("loadedmetadata",g),window.removeEventListener("resize",ee),window.removeEventListener("orientationchange",ee),clearTimeout(ae),$e(t);},replay(){$=-1,X=false,T=0,P=false,ie=NaN,p(0);},pause(){P=true,cancelAnimationFrame(w);},resume(){P&&(P=false,R&&x&&(w=requestAnimationFrame(S)));},seek(A){let F=Math.min(1,Math.max(0,A));T=F,$=F,P=true,cancelAnimationFrame(w),ie=NaN,p(F);},getProgress(){return T}}}function jt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function gr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Wt(e){let n=jt(e),r=new Map;for(let s of n){let c=s.offsetTop;r.has(c)||r.set(c,[]),r.get(c).push(s);}let t=[],a=Array.from(r.keys()).sort((s,c)=>s-c);for(let s of a){let c=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",c.forEach((m,d)=>{let E=m.nextElementSibling;u.appendChild(m),d<c.length-1&&E&&E.style.whiteSpace==="pre"&&u.appendChild(E);}),t.push(u);}return e.textContent="",t.forEach((s,c)=>{e.appendChild(s),c<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function yr(e,n,r,t){if(r<=1||t===0)return e;let a=(r-1)*t,s=n*t,c=s+(1-a);return c<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(c-s)))}function hr(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Gt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yt(e,n={}){if(typeof window>"u")return Gt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return ge("scrollText: element not found:",e),Gt;let t=r,{split:a="words",stagger:s=.04,easing:c="ease-out",from:u={opacity:0,y:24},trigger:m={},once:d=true,onComplete:E}=n,V=window.matchMedia("(prefers-reduced-motion: reduce)").matches,L=typeof c=="function"?c:te[c]??te["ease-out"],re=de(m.start??"top 85%"),Me=de(m.end??"top 40%"),W=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ne;a==="chars"?ne=gr(t):a==="lines"?ne=Wt(t):ne=jt(t);let oe=ne.length;function Y(g,O){u?.opacity!==void 0&&(g.style.opacity=String(u.opacity+(1-u.opacity)*O));let ae=hr(O,u);ae&&(g.style.transform=ae);}function M(g){t.style.setProperty("--scroll-draw-progress",String(g)),ne.forEach((O,ae)=>{let ee=L(yr(g,ae,oe,s));Y(O,ee);});}if(V)return M(1),E?.(),{destroy(){t.innerHTML=W,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};M(0);let D=0,C=0,w=0,R=false,P=false,$=-1,T=0,X=false,x=()=>window.scrollY,fe=()=>window.innerHeight;function be(){let g=t.getBoundingClientRect(),O=xe({top:g.top,height:g.height},x(),fe(),re,Me);D=O.tStart,C=O.tEnd;}function se(){if(!R||P)return;let g=J(x(),D,C,1);d&&($=Math.max($,g),g=$),T=g,M(g),g>=1&&!X?(X=true,E?.()):g<1&&!d&&(X=false),w=requestAnimationFrame(se);}be();let ie=new IntersectionObserver(g=>{g.forEach(O=>{R=O.isIntersecting,R&&!P?w=requestAnimationFrame(se):cancelAnimationFrame(w);});}),p;function S(){clearTimeout(p),p=setTimeout(()=>{if(a==="lines"){let g=T;t.innerHTML=W,t.setAttribute("aria-label",t.textContent??""),ne=Wt(t),M(g);}be();},150);}return window.addEventListener("resize",S),window.addEventListener("orientationchange",S),ie.observe(t),Ce(t,{type:"text",getProgress:()=>T,getTrigger:()=>({tStart:D,tEnd:C})}),{destroy(){cancelAnimationFrame(w),ie.disconnect(),window.removeEventListener("resize",S),window.removeEventListener("orientationchange",S),clearTimeout(p),t.innerHTML=W,t.removeAttribute("aria-label"),$e(t);},replay(){$=-1,X=false,T=0,P=false,M(0);},pause(){P=true,cancelAnimationFrame(w);},resume(){P&&(P=false,R&&(w=requestAnimationFrame(se)));},seek(g){let O=Math.min(1,Math.max(0,g));T=O,$=O,P=true,cancelAnimationFrame(w),M(O);},getProgress(){return T}}}var Ke=e=>typeof e=="function"?e():vue.unref(e);function Fe(e,n,r){let t=null,a=n(),s=()=>{t?.destroy(),t=e.value?r(e.value,Vt(a,()=>a)):null;};vue.onMounted(s),vue.watch(()=>Ht(a=n()),s),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function En(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),mt),n}var Tn=vue.defineComponent({name:"ScrollDraw",props:{selector:{type:String},speed:{type:Number},fade:{type:Boolean},stagger:{type:Number},easing:{type:[String,Function]},direction:{type:String},trigger:{type:Object},onProgress:{type:Function},onStart:{type:Function},onComplete:{type:Function},once:{type:Boolean},debug:{type:Boolean}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>{let t={};return e.selector!=null&&(t.selector=e.selector),e.speed!=null&&(t.speed=e.speed),e.fade!=null&&(t.fade=e.fade),e.stagger!=null&&(t.stagger=e.stagger),e.easing!=null&&(t.easing=e.easing),e.direction!=null&&(t.direction=e.direction),e.trigger!=null&&(t.trigger=e.trigger),e.once!=null&&(t.once=e.once),e.debug!=null&&(t.debug=e.debug),e.onProgress!=null&&(t.onProgress=e.onProgress),e.onStart!=null&&(t.onStart=e.onStart),e.onComplete!=null&&(t.onComplete=e.onComplete),t},mt),()=>vue.h("div",{ref:r},n.default?.())}});function xn(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),ft),n}var Mn=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options,ft),()=>vue.h("div",{ref:r},n.default?.())}});function An(e){let n=vue.ref(null);return Fe(n,()=>Ke(e),dt),n}var Ln=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:{type:Boolean},decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return Fe(n,()=>{let r={to:e.to};return e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete),r},dt),()=>vue.h("span",{ref:n})}});function Cn(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),gt),n}var $n=vue.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 n=vue.ref(null);return Fe(n,()=>e.options??{},gt),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function Pn(e={}){let n=vue.ref(null);return Fe(n,()=>Ke(e),yt),n}var On=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return Fe(r,()=>e.options??{},yt),()=>vue.h(e.tag,{ref:r},n.default?.())}});exports.ScrollAnimate=Mn;exports.ScrollCounter=Ln;exports.ScrollDraw=Tn;exports.ScrollText=On;exports.ScrollVideo=$n;exports.useScrollAnimate=xn;exports.useScrollCounter=An;exports.useScrollDraw=En;exports.useScrollText=Pn;exports.useScrollVideo=Cn;
|
|
1
|
+
'use strict';var vue=require('vue');function sr({bounces:e=3,decay:n=.5}={}){let r=Math.max(1,Math.round(e)),t=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(t),s=0,l=[];for(let g=0;g<r;g++){let T=Math.pow(o,g);l.push(T),s+=T;}let u=[0],m=0;for(let g=0;g<r;g++)m+=l[g]/s,u.push(m);return g=>{if(g<=0)return 0;if(g>=1)return 1;for(let T=0;T<r;T++)if(g<=u[T+1]){let q=(g-u[T])/(u[T+1]-u[T]);if(T===0)return q*(2-q);let A=1-Math.pow(t,T);return A+(1-A)*(2*q-1)*(2*q-1)}return 1}}function ir({amplitude:e=1,period:n=.4}={}){let r=Math.max(1,e),t=Math.max(.1,n),o=r<=1?t/4:t/(2*Math.PI)*Math.asin(1/r);return s=>s<=0?0:s>=1?1:r*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/t)+1}var ie={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:sr(),elastic:ir()};function $t(e,n,r){return Math.min(r,Math.max(n,e))}function he(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[r="top",t="bottom"]=n.split(/\s+/).filter(Boolean);return {element:r,viewport:t}}function Pt(e,n,r,t){switch(t){case "top":return e+r;case "center":return e+r+n/2;case "bottom":return e+r+n;default:return e+r}}function Ot(e,n){if(/^\d+(\.\d+)?%$/.test(e))return n*(parseFloat(e)/100);switch(e){case "top":return 0;case "center":return n/2;case "bottom":return n;default:return n}}function Z(e,n,r,t){return r===n?0:$t((e-n)/(r-n)*t,0,1)}function Le(e,n,r,t,o){let s=Pt(e.top,e.height,n,t.element)-Ot(t.viewport,r),l=Pt(e.top,e.height,n,o.element)-Ot(o.viewport,r);return {tStart:s,tEnd:l}}function st(e,n,r){let t=e.getBoundingClientRect(),o=r==="x"?t.width:t.height;return n?{top:r==="x"?t.left-n.getBoundingClientRect().left+n.scrollLeft:t.top-n.getBoundingClientRect().top+n.scrollTop,height:o,scroll:0}:{top:r==="x"?t.left:t.top,height:o,scroll:r==="x"?window.scrollX:window.scrollY}}function We(e){let n=e.tagName.toLowerCase();if(n==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),t=parseFloat(e.getAttribute("height")??"0");return 2*(r+t)}if(n==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function kt(e){let n=/^#([a-f\d])([a-f\d])([a-f\d])$/i.exec(e);if(n)return [parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16)];let r=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(r)return [parseInt(r[1],16),parseInt(r[2],16),parseInt(r[3],16)];let t=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return t?[parseInt(t[1]),parseInt(t[2]),parseInt(t[3])]:null}function Ge(e,n,r){let t=kt(e),o=kt(n);return !t||!o?e:`rgb(${Math.round(t[0]+(o[0]-t[0])*r)},${Math.round(t[1]+(o[1]-t[1])*r)},${Math.round(t[2]+(o[2]-t[2])*r)})`}var Rt={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 Ue=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function be(e,...n){Ue&&console.warn(`[svg-scroll-draw] ${e}`,...n);}var ar="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",lr="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",It=33;function cr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function ur(e){let n=[];for(let r=0;r<It;r++){let t=r/(It-1);n.push(String(Math.round(e(t)*1e5)/1e5));}return `linear(${n.join(",")})`}function it(e){switch(e){case "linear":return "linear";case "ease-in":return ar;case "ease-out":return lr;case "ease-in-out":return cr()?ur(ie["ease-in-out"]):null;default:return null}}var Ft=Symbol.for("svg-scroll-draw.registry");function Dt(){let e=globalThis;return e[Ft]||(e[Ft]=new Map)}function ke(e,n){Dt().set(e,n);}function Re(e){Dt().delete(e);}var Ye,at=new Set,lt=new WeakMap,Xe=new Map,Nt=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function mr(e){let n=new Set;for(let r of e)for(;r&&r!==document.body;r=r.parentElement)for(let t=r;t;t=t.previousElementSibling)n.add(t);return n}function Fe(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let r=()=>n();Ye??(Ye=new ResizeObserver(o=>{let s=false;for(let{target:l}of o)lt.get(l)!==Nt(l)&&(s=true),lt.set(l,"");s&&at.forEach(l=>l());})),at.add(r);let t=mr(e);return [document.body,document.documentElement].forEach(o=>o&&t.add(o)),t.forEach(o=>{lt.has(o)||lt.set(o,Nt(o)),Xe.set(o,(Xe.get(o)??0)+1),Ye.observe(o);}),()=>{at.delete(r)&&(t.forEach(o=>{let s=(Xe.get(o)??1)-1;if(s)return void Xe.set(o,s);Xe.delete(o),Ye?.unobserve(o);}),at.size||(Ye?.disconnect(),Ye=void 0));}}var fr=0;function pr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Ht(e,n){let r="";try{r=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return r||(e.getAttribute(n)??"").trim()}var Vt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function dr(e){if(!Ue)return;let n=Ht(e,"stroke");if(!n||n==="none"){be("Element has no stroke \u2014 path will not be visible.",e);return}let r=(e.getAttribute("fill")??"").trim();r&&!Vt.has(r)&&!Vt.has(Ht(e,"fill"))&&be("Element has a fill \u2014 it may obscure the stroke animation.",e);}function gr(e,n,r){let t=document.createElement("div");t.setAttribute("data-svg-scroll-draw-debug",""),t.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 o(){let s=r==="x"?window.scrollX:window.scrollY,l=e-s,u=n-s,m=r==="x";t.innerHTML=`
|
|
2
|
+
<div style="position:absolute;${m?`left:${l}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${l}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;${m?`left:${u}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${u}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(t),window.addEventListener("scroll",o,{passive:true}),o(),{el:t,destroy(){window.removeEventListener("scroll",o),t.remove();}}}var zt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,_t=/[MmLlHhVvCcSsQqTtAaZz]/g;function yr(e,n,r){if(!Ue)return;let t=(e.match(_t)??[]).join("").toUpperCase(),o=(n.match(_t)??[]).join("").toUpperCase(),s=(e.match(zt)??[]).length,l=(n.match(zt)??[]).length;if(t!==o){be(`morphTo: command sequence differs (${t||"\u2205"} \u2192 ${o||"\u2205"}). Interpolation is coordinate-for-coordinate, so the result will not reach the target shape. Redraw both paths with the same commands.`,r);return}s!==l&&be(`morphTo: coordinate count differs (${s} \u2192 ${l}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function dt(e,n,r){let t=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let l=parseFloat(s),u=t[o++]??l;return String(+(l+(u-l)*r).toFixed(4))})}function gt(e,n={}){if(typeof window>"u")return {destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};let{preset:r,...t}=n,o=r?{...Rt[r],...t}:t,s=window.matchMedia("(prefers-reduced-motion: reduce)").matches,{selector:l="path, polyline, line, polygon, rect, circle",speed:u=1,fade:m=false,easing:g="linear",trigger:T={},stagger:q=0,direction:A="forward",once:J=false,debug:Ce=false,axis:j="y",scrollContainer:ae,autoReverse:ee=false,delay:U=0,strokeColor:F,strokeWidth:$,fillOpacity:O,waypoints:b,velocityScale:P=false,threshold:x=0,rootMargin:M="0px",repeat:E=0,repeatDelay:te=0,morphTo:L,clip:re,autoplay:we=false,duration:ge=1e3,native:ye=true,onProgress:H,onStart:C,onComplete:f,onEnter:p,onLeave:k,onEnterBack:B,onLeaveBack:Ee}=o,w=re===true?"left":typeof re=="string"?re:false,V=typeof g=="function"?g:ie[g]??ie.linear,le=he(T.start??"top bottom"),He=he(T.end??"bottom top"),Se=typeof ae=="string"?document.querySelector(ae):ae??null,Te=Array.isArray(F)?F[0]:null,ce=Array.isArray(F)?F[1]:typeof F=="string"?F:null,Y=Array.isArray($)?$[0]:null,ne=Array.isArray($)?$[1]:typeof $=="number"?$:null,oe=Array.isArray(O)?O[0]:null,X=Array.isArray(O)?O[1]:typeof O=="number"?O:null;function Ve(i){let c=i*100;switch(w){case "right":return `inset(0 0 0 ${100-c}%)`;case "top":return `inset(0 0 ${100-c}% 0)`;case "bottom":return `inset(${100-c}% 0 0 0)`;case "center":return `circle(${i*150}% at 50% 50%)`;default:return `inset(0 ${100-c}% 0 0)`}}let W=w?[]:Array.from(e.querySelectorAll(l)),R=[],ue=[],me=0,$e=0,a=false,d=false,z=0,fe=false,D=-1,se=[],Pe=-1,K=false,N=0,xe=0,Me,ct=null;function Et(){ct?.destroy(),ct=null;}let _e=new Set,St=NaN,qe=true,Je=-1,Tt=performance.now(),Be=NaN;function ut(){return Se?j==="x"?Se.scrollLeft:Se.scrollTop:j==="x"?window.scrollX:window.scrollY}function xt(){return Se?j==="x"?Se.clientWidth:Se.clientHeight:j==="x"?window.innerWidth:window.innerHeight}function Mt(){let i=st(e,Se,j);return Le(i,i.scroll,xt(),le,He)}function At(){(({tStart:me,tEnd:$e}=Mt())),Ce&&Ue&&(Et(),ct=gr(me,$e,j));}function mt(i,c=Mt){ke(e,{type:"draw",getProgress:()=>i.getProgress(),getTrigger:c});let v=i.destroy;return i.destroy=()=>{v.call(i),Re(e);},i}function er(i,c){if(e.style.setProperty("--scroll-draw-progress",String(i)),w){let v=c==="reverse"?1-i:i;e.style.clipPath=Ve(v);return}W.forEach((v,pe)=>{v.style.strokeDashoffset=c==="reverse"?`${R[pe]*i}`:`${R[pe]*(1-i)}`,m&&(v.style.opacity=c==="reverse"?`${1-i}`:`${i}`),Te&&ce?v.style.stroke=Ge(Te,ce,i):ce&&(v.style.stroke=ce),Y!==null&&ne!==null?v.style.strokeWidth=`${Y+(ne-Y)*i}`:ne!==null&&(v.style.strokeWidth=`${ne}`),oe!==null&&X!==null?v.style.fillOpacity=`${oe+(X-oe)*i}`:X!==null&&(v.style.fillOpacity=`${X}`),L&&v.tagName.toLowerCase()==="path"&&ue[pe]&&v.setAttribute("d",dt(ue[pe],L,i));});}function et(){if(e.style.setProperty("--scroll-draw-progress","0"),w){e.style.clipPath=Ve(0);return}W.forEach((i,c)=>{i.style.strokeDasharray=`${R[c]}`,i.style.strokeDashoffset=A==="reverse"?"0":`${R[c]}`,m?i.style.opacity=A==="reverse"?"1":"0":i.style.opacity="",Te&&(i.style.stroke=Te),Y!==null&&(i.style.strokeWidth=`${Y}`),oe!==null&&(i.style.fillOpacity=`${oe}`),L&&i.tagName.toLowerCase()==="path"&&ue[c]&&i.setAttribute("d",ue[c]);});}if(W.forEach(i=>{dr(i);let c=We(i);R.push(c);let v=i.tagName.toLowerCase()==="path";v?ue.push(i.getAttribute("d")??""):ue.push(""),L&&(v?yr(ue[ue.length-1],L,i):be(`morphTo only applies to <path> elements \u2014 ignored on <${i.tagName}>.`,i)),s?(i.style.strokeDasharray=`${c}`,i.style.strokeDashoffset=A==="reverse"?`${c}`:"0",m&&(i.style.opacity="1"),ce&&(i.style.stroke=ce),ne!==null&&(i.style.strokeWidth=`${ne}`),X!==null&&(i.style.fillOpacity=`${X}`),L&&i.tagName.toLowerCase()==="path"&&i.setAttribute("d",L)):(i.style.strokeDasharray=`${c}`,i.style.strokeDashoffset=A==="reverse"?"0":`${c}`,m?i.style.opacity=A==="reverse"?"1":"0":i.style.opacity="",Te&&(i.style.stroke=Te),Y!==null&&(i.style.strokeWidth=`${Y}`),oe!==null&&(i.style.fillOpacity=`${oe}`));}),w){if(s)return e.style.clipPath=Ve(1),f?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};e.style.clipPath=Ve(0);}else if(s)return f?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};let Lt=typeof g=="string"?it(g):null;function tr(){return !(ye===false||!pr()||!W.length||!Lt||w||j!=="y"||Se||u!==1||q!==0||J||ee||P!==false||L||b||E||U>0||H||C||f||p||k||B||Ee||F!=null||$!=null||O!=null||(T.start??"top bottom").trim()!=="top bottom"||(T.end??"bottom top").trim()!=="bottom top")}function rr(){let i=++fr,c=`svg-scroll-draw-${i}`,v=`svg-scroll-draw-host-${i}`,pe=`--svg-scroll-draw-${i}`,ze=A==="reverse"?"0":"var(--ssd-len)",Ie=A==="reverse"?"var(--ssd-len)":"0",Oe=`stroke-dashoffset:${ze};`,S=`stroke-dashoffset:${Ie};`;m&&(Oe+=`opacity:${A==="reverse"?1:0};`,S+=`opacity:${A==="reverse"?0:1};`);let I=document.createElement("style");I.setAttribute("data-svg-scroll-draw",""),I.textContent=`@keyframes ${c}{from{${Oe}}to{${S}}}.${v}{view-timeline-name:${pe};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${pe};animation-range:cover 0% cover 100%;}`,document.head.appendChild(I),e.classList.add(v);function de(y,Q){y.style.setProperty("--ssd-len",String(R[Q])),y.style.strokeDasharray=`${R[Q]}`,y.style.strokeDashoffset="",y.style.opacity="",y.style.animationPlayState="",y.classList.add(c);}W.forEach(de);let h=false,_=-1;function G(){if(_>=0)return _;let y=e.getBoundingClientRect(),{tStart:Q,tEnd:Ae}=Le({top:y.top,height:y.height},ut(),xt(),le,He);return V(Z(ut(),Q,Ae,u))}return {destroy(){e.classList.remove(v),W.forEach(y=>{y.classList.remove(c),y.style.removeProperty("--ssd-len"),y.style.animationPlayState="";}),I.remove();},replay(){h=false,_=-1,W.forEach(de);},pause(){h=true,W.forEach(y=>{y.style.animationPlayState="paused";});},resume(){h&&(h=false,W.forEach(y=>{y.style.animationPlayState="running";}));},seek(y){let Q=Math.min(1,Math.max(0,y));_=Q,h=true,W.forEach((Ae,ve)=>{Ae.classList.remove(c),Ae.style.strokeDashoffset=A==="reverse"?`${R[ve]*Q}`:`${R[ve]*(1-Q)}`,m&&(Ae.style.opacity=A==="reverse"?`${1-Q}`:`${Q}`);});},getProgress(){return G()},refresh(){W.forEach((y,Q)=>{R[Q]=We(y),y.style.setProperty("--ssd-len",String(R[Q])),y.style.strokeDasharray=`${R[Q]}`;});}}}if(tr())return mt(rr());function nr(){let i=Math.max(1,ge),c=0,v=0,pe=false;function ze(h){let _=true;if(w){let G=Math.min(1,Math.max(0,h/i)),y=V(G);N=y,e.style.setProperty("--scroll-draw-progress",String(y)),e.style.clipPath=Ve(A==="reverse"?1-y:y),H?.(y),G<1&&(_=false);}else W.forEach((G,y)=>{let Q=y*q*i,Ae=Math.min(1,Math.max(0,(h-Q)/i)),ve=V(Ae);G.style.strokeDashoffset=A==="reverse"?`${R[y]*ve}`:`${R[y]*(1-ve)}`,m&&(G.style.opacity=A==="reverse"?`${1-ve}`:`${ve}`),Te&&ce?G.style.stroke=Ge(Te,ce,ve):ce&&(G.style.stroke=ce),Y!==null&&ne!==null?G.style.strokeWidth=`${Y+(ne-Y)*ve}`:ne!==null&&(G.style.strokeWidth=`${ne}`),oe!==null&&X!==null?G.style.fillOpacity=`${oe+(X-oe)*ve}`:X!==null&&(G.style.fillOpacity=`${X}`),L&&G.tagName.toLowerCase()==="path"&&ue[y]&&G.setAttribute("d",dt(ue[y],L,ve)),y===0&&(N=ve,H?.(ve),e.style.setProperty("--scroll-draw-progress",String(ve))),Ae<1&&(_=false);});if(b){let G=Math.min(1,Math.max(0,h/i)),y=V(G);for(let Q in b){let Ae=parseFloat(Q);y>=Ae&&!_e.has(Ae)&&(_e.add(Ae),b[Q]?.());}}return _}function Ie(h){if(K)return;let _=h-c;d||(d=true,C?.());let G=ze(_);if(G&&!a){a=true,ze(i*(1+Math.max(0,W.length-1)*q)),f?.(),xe<(E==="infinite"?1/0:E??0)&&(xe++,Me=setTimeout(()=>{c=performance.now(),d=false,a=false,_e.clear(),et(),z=requestAnimationFrame(Ie);},te));return}G||(z=requestAnimationFrame(Ie));}function Oe(){cancelAnimationFrame(z),clearTimeout(Me),c=performance.now(),v=0,K=false,d=false,a=false,xe=0,pe=true,N=0,_e.clear(),et(),z=requestAnimationFrame(Ie);}let S=new IntersectionObserver(h=>{h.forEach(_=>{_.isIntersecting&&!(J&&a)?Oe():!_.isIntersecting&&!J&&!a&&(cancelAnimationFrame(z),clearTimeout(Me),pe=false);});},{root:Se??null,threshold:x,rootMargin:M}),I;function de(){clearTimeout(I),I=setTimeout(()=>{W.forEach((h,_)=>{R[_]=We(h),h.style.strokeDasharray=`${R[_]}`;});},150);}return window.addEventListener("resize",de),window.addEventListener("orientationchange",de),U>0?setTimeout(()=>S.observe(e),U):S.observe(e),{destroy(){cancelAnimationFrame(z),clearTimeout(Me),S.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),clearTimeout(I);},replay(){xe=0,Oe();},pause(){K||!pe||(K=true,v=performance.now()-c,cancelAnimationFrame(z));},resume(){K&&(K=false,pe=true,c=performance.now()-v,z=requestAnimationFrame(Ie));},seek(h){let _=Math.min(1,Math.max(0,h));N=_,K=true,v=_*i,c=performance.now()-v,cancelAnimationFrame(z),ze(v);},getProgress(){return N},refresh(){clearTimeout(I),W.forEach((h,_)=>{R[_]=We(h),h.style.strokeDasharray=`${R[_]}`;});}}}if(we)return mt(nr());At();function tt(){if(!fe||K)return;let i=performance.now(),c=ut();if(!qe&&P===false&&c===St){z=requestAnimationFrame(tt);return}qe=false,St=c;let v=u;if(P!==false){let S=i-Tt,I=S>0?Math.abs(c-(Je<0?c:Je))/S:0;v=u*Math.max(.2,1+I*(typeof P=="number"?P:1)*.04);}Je=c,Tt=i;let pe=ee?Pe===-1||c>=Pe?"forward":"reverse":A;Pe=c;let ze=$e-me,Ie=true,Oe=ze===0?0:(c-me)/ze;if(isNaN(Be)||(Be<=0&&Oe>0?p?.():Be>0&&Oe<=0&&Ee?.(),Be<1&&Oe>=1?k?.():Be>=1&&Oe<1&&B?.()),Be=Oe,w){let S=V(Z(c,me,$e,v));J&&!ee&&(D=Math.max(D,S),S=D),N=S,e.style.setProperty("--scroll-draw-progress",String(S));let I=pe==="reverse"?1-S:S;e.style.clipPath=Ve(I),H?.(S),!d&&Z(c,me,$e,v)>0&&(d=true,C?.()),S>=1&&!a?(a=true,f?.(),xe<(E==="infinite"?1/0:E??0)&&(xe++,Me=setTimeout(()=>{D=-1,d=false,a=false,e.style.clipPath=Ve(0);},te))):S<1&&!J&&(a=false),z=requestAnimationFrame(tt);return}if(W.forEach((S,I)=>{let de=I*q*ze,h=V(Z(c,me+de,$e+de,v));J&&!ee&&(h=se[I]=Math.max(se[I]??D,h)),S.style.strokeDashoffset=pe==="reverse"?`${R[I]*h}`:`${R[I]*(1-h)}`,m&&(S.style.opacity=pe==="reverse"?`${1-h}`:`${h}`),Te&&ce?S.style.stroke=Ge(Te,ce,h):ce&&(S.style.stroke=ce),Y!==null&&ne!==null?S.style.strokeWidth=`${Y+(ne-Y)*h}`:ne!==null&&(S.style.strokeWidth=`${ne}`),oe!==null&&X!==null?S.style.fillOpacity=`${oe+(X-oe)*h}`:X!==null&&(S.style.fillOpacity=`${X}`),L&&S.tagName.toLowerCase()==="path"&&ue[I]&&S.setAttribute("d",dt(ue[I],L,h)),I===0&&(N=h,H?.(h),e.style.setProperty("--scroll-draw-progress",String(h))),h<1&&(Ie=false);}),b){let S=V(Z(c,me,$e,v));for(let I in b){let de=parseFloat(I);S>=de&&!_e.has(de)&&(_e.add(de),b[I]?.());}}!d&&Z(c,me,$e,v)>0&&(d=true,C?.()),Ie&&!a?(a=true,f?.(),xe<(E==="infinite"?1/0:E??0)&&(xe++,Me=setTimeout(()=>{D=-1,se=[],d=false,a=false,_e.clear(),et(),qe=true;},te))):!Ie&&!J&&(a=false),z=requestAnimationFrame(tt);}let ft=false;function rt(){ft||(ft=true,z=requestAnimationFrame(function(){tt();}));}function nt(){ft=false,cancelAnimationFrame(z);}let pt=new IntersectionObserver(i=>{i.forEach(c=>{fe=c.isIntersecting,fe&&!K?(qe=true,rt()):nt();});},{root:Se??null,threshold:x,rootMargin:M});function Ct(){W.forEach((i,c)=>{R[c]=We(i),i.style.strokeDasharray=`${R[c]}`;}),At(),qe=true;}let ot;function je(){clearTimeout(ot),ot=setTimeout(Ct,150);}window.addEventListener("resize",je),window.addEventListener("orientationchange",je);let or=Fe([e],je);return U>0?setTimeout(()=>pt.observe(e),U):pt.observe(e),mt({destroy(){cancelAnimationFrame(z),clearTimeout(Me),nt(),pt.disconnect(),or(),window.removeEventListener("resize",je),window.removeEventListener("orientationchange",je),clearTimeout(ot),Et();},replay(){D=-1,se=[],Pe=-1,Je=-1,d=false,a=false,xe=0,K=false,N=0,_e.clear(),clearTimeout(Me),et(),qe=true,fe&&rt();},pause(){K=true,nt();},resume(){K&&(K=false,qe=true,fe&&rt());},seek(i){let c=Math.min(1,Math.max(0,i));N=c,D=c,se=[],K=true,nt(),er(c,A),qe=true;},getProgress(){return N},refresh(){clearTimeout(ot),Ct(),fe&&!K&&rt();}},()=>({tStart:me,tEnd:$e}))}var qt=new WeakMap,hr=0;function Bt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=qt.get(r);return t===void 0&&qt.set(r,t=++hr),`el#${t}`}return r})}function Wt(e,n){let r={...e};for(let t of Object.keys(r))typeof r[t]=="function"&&(r[t]=(...o)=>n()[t]?.(...o));return r}function br(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Gt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],s=[],l=t[2].trim();if(l)for(let u of l.split(/[\s,]+/)){let m=u.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(m?parseFloat(m[1]):0),s.push(m?m[2]:"");}n.push({fn:t[1],nums:o,units:s});}return n}function wr(e,n,r){let t=Gt(e),o=Gt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((s,l)=>{let u=o[l];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((m,g)=>`${m}${s.units[g]}`).join(", ")})`:`${u.fn}(${u.nums.map((m,g)=>`${m}${u.units[g]}`).join(", ")})`:`${s.fn}(${s.nums.map((m,g)=>`${m+(u.nums[g]-m)*r}${s.units[g]}`).join(", ")})`}).join(" ")}function jt(e,n,r){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*r);let t=String(e),o=String(n);if(br(t))return Ge(t,o,r);if(t.includes("("))return wr(t,o,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),l=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&l){let u=parseFloat(s[1]),m=parseFloat(l[1]);return `${u+(m-u)*r}${s[2]||l[2]}`}return r<1?t:o}function vr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Er=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Sr=0,Ut="--scroll-draw-progress";function Tr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}function yt(e,n){let r={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return r;let{props:t,trigger:o={},easing:s="ease-out",speed:l=1,once:u=false,axis:m="y",scrollContainer:g,native:T=true,velocityScale:q=false,respectReducedMotion:A=true,triggerElement:J,onProgress:Ce,onComplete:j,onEnter:ae,onLeave:ee,onEnterBack:U,onLeaveBack:F}=n,$=A&&window.matchMedia("(prefers-reduced-motion: reduce)").matches,O=typeof s=="function"?s:ie[s]??ie["ease-out"],b=he(o.start??"top bottom"),P=he(o.end??"bottom top"),x=J??e,M=typeof g=="string"?document.querySelector(g):g??null,E=Object.entries(t).map(([a,d])=>({prop:vr(a),from:Array.isArray(d)?d[0]:"",to:Array.isArray(d)?d[1]:d}));function te(){let a=window.getComputedStyle(e);for(let d of E)d.from===""&&(d.from=a.getPropertyValue(d.prop).trim()||"0");}function L(){for(let a of E)e.style.setProperty(a.prop,String(a.to));}let re=new Map;for(let a of [...E.map(d=>d.prop),Ut])re.set(a,e.style.getPropertyValue(a));function we(){for(let[a,d]of re)d?e.style.setProperty(a,d):e.style.removeProperty(a);}if($)return L(),j?.(),{...r,destroy:we,getProgress:()=>1};te();let ge=typeof s=="string"?it(s):null;function ye(){if(!T||!Tr()||!ge||m!=="y"||M||x!==e||u||l!==1||Ce||j||ae||ee||U||F||q!==false||(o.start??"top bottom").trim()!=="top bottom"||(o.end??"bottom top").trim()!=="bottom top")return false;for(let a of E)if(!Er.has(a.prop))return false;return true}function H(){let a=`ssd-a-${++Sr}`,d=E.map(N=>`${N.prop}:${N.from}`).join(";"),z=E.map(N=>`${N.prop}:${N.to}`).join(";"),fe=document.createElement("style");fe.setAttribute("data-ssd-animate",""),fe.textContent=`@keyframes ${a}{from{${d}}to{${z}}}.${a}{animation-name:${a};animation-duration:auto;animation-timing-function:${ge};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(fe),e.classList.add(a);let D=()=>m==="x"?window.scrollX:window.scrollY,se=()=>m==="x"?window.innerWidth:window.innerHeight,Pe=()=>{let N=e.getBoundingClientRect();return Le({top:N.top,height:N.height},D(),se(),b,P)};ke(e,{type:"animate",getProgress:()=>K.getProgress(),getTrigger:Pe});let K={refresh(){},destroy(){e.classList.remove(a),fe.remove(),e.style.animationPlayState="",we(),Re(e);},replay(){e.classList.remove(a),e.offsetWidth,e.classList.add(a);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(N){let xe=Math.min(1,Math.max(0,N));e.classList.remove(a);for(let Me of E)e.style.setProperty(Me.prop,jt(Me.from,Me.to,xe));},getProgress(){let{tStart:N,tEnd:xe}=Pe();return O(Z(D(),N,xe,l))}};return K}if(ye())return H();let C=0,f=0,p=0,k=false,B=false,Ee=-1,w=0,V=false,le=NaN,He=-1,Se=0,Te=()=>M?m==="x"?M.scrollLeft:M.scrollTop:m==="x"?window.scrollX:window.scrollY,ce=()=>M?m==="x"?M.clientWidth:M.clientHeight:m==="x"?window.innerWidth:window.innerHeight,Y=x===e?E:[],ne=false;function oe(){let a=e.style,d=Y.map(se=>a.getPropertyValue(se.prop)),z=a.transition;Y.length&&(a.transition="none"),Y.forEach(se=>a.setProperty(se.prop,re.get(se.prop)??""));let fe=st(x,M,m);Y.forEach((se,Pe)=>a.setProperty(se.prop,d[Pe])),Y.length&&(e.offsetWidth,a.transition=z);let D=Le(fe,fe.scroll,ce(),b,P);ne&&Math.abs(D.tStart-C)<1&&Math.abs(D.tEnd-f)<1||(ne=true,C=D.tStart,f=D.tEnd);}function X(a){e.style.setProperty(Ut,String(a));for(let d of E)e.style.setProperty(d.prop,jt(d.from,d.to,a));Ce?.(a);}function Ve(a){if(isNaN(le)){le=a;return}le<=0&&a>0?ae?.():le>0&&a<=0&&F?.(),le<1&&a>=1?ee?.():le>=1&&a<1&&U?.(),le=a;}function W(){if(!k||B)return;let a=performance.now(),d=Te(),z=l;if(q!==false){let se=a-Se,Pe=se>0?Math.abs(d-(He<0?d:He))/se:0;z=l*Math.max(.2,1+Pe*(typeof q=="number"?q:1)*.04);}He=d,Se=a;let fe=f===C?0:(d-C)/(f-C);Ve(fe);let D=O(Z(d,C,f,z));u&&(Ee=Math.max(Ee,D),D=Ee),w=D,X(D),D>=1&&!V?(V=true,j?.()):D<1&&!u&&(V=false),p=requestAnimationFrame(W);}oe(),f===C&&be("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=O(Z(Te(),C,f,l));u&&a>0&&(Ee=a),w=a,X(a);}let R=new IntersectionObserver(a=>{a.forEach(d=>{k=d.isIntersecting,k&&!B?p=requestAnimationFrame(W):cancelAnimationFrame(p);});},{root:M??null}),ue;function me(){clearTimeout(ue),ue=setTimeout(oe,150);}window.addEventListener("resize",me),window.addEventListener("orientationchange",me);let $e=Fe([x],me);return R.observe(e),ke(e,{type:"animate",getProgress:()=>w,getTrigger:()=>({tStart:C,tEnd:f})}),{destroy(){cancelAnimationFrame(p),R.disconnect(),window.removeEventListener("resize",me),window.removeEventListener("orientationchange",me),$e(),clearTimeout(ue),we(),Re(e);},replay(){Ee=-1,V=false,w=0,B=false,X(0);},pause(){B=true,cancelAnimationFrame(p);},resume(){B&&(B=false,k&&(p=requestAnimationFrame(W)));},seek(a){let d=Math.min(1,Math.max(0,a));w=d,Ee=d,B=true,cancelAnimationFrame(p),X(d);},getProgress(){return w},refresh(){oe();}}}var ht={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function bt(e,n){if(typeof window>"u")return ht;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollCounter: element not found:",e),ht;let t=r,{from:o=0,to:s,format:l,easing:u="ease-out",trigger:m={},once:g=true,decimals:T,onComplete:q}=n,A=T!==void 0?f=>f.toFixed(T):l??(f=>String(Math.round(f))),J=typeof u=="function"?u:ie[u]??ie["ease-out"],Ce=he(m.start??"top 80%"),j=he(m.end??"top 20%");if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return t.textContent=A(s),q?.(),ht;let ee=0,U=0,F=false,$=0,O=false,b=false,P=-1,x=0,M=false,E=()=>window.scrollY,te=()=>window.innerHeight;function L(){let f=t.getBoundingClientRect(),p=Le({top:f.top,height:f.height},E(),te(),Ce,j);F&&Math.abs(p.tStart-ee)<1&&Math.abs(p.tEnd-U)<1||(F=true,ee=p.tStart,U=p.tEnd);}function re(f){t.textContent=A(o+(s-o)*f),t.style.setProperty("--scroll-draw-progress",String(f));}function we(){if(!O||b)return;let f=J(Z(E(),ee,U,1));g&&(P=Math.max(P,f),f=P),x=f,re(f),f>=1&&!M?(M=true,q?.()):f<1&&!g&&(M=false),$=requestAnimationFrame(we);}L();{let f=J(Z(E(),ee,U,1));g&&f>0&&(P=f),x=f,re(f);}let ge=new IntersectionObserver(f=>{f.forEach(p=>{O=p.isIntersecting,O&&!b?$=requestAnimationFrame(we):cancelAnimationFrame($);});}),ye;function H(){clearTimeout(ye),ye=setTimeout(L,150);}window.addEventListener("resize",H),window.addEventListener("orientationchange",H);let C=Fe([t],H);return ge.observe(t),ke(t,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:ee,tEnd:U})}),{destroy(){cancelAnimationFrame($),ge.disconnect(),window.removeEventListener("resize",H),window.removeEventListener("orientationchange",H),C(),clearTimeout(ye),Re(t);},replay(){P=-1,M=false,x=0,b=false,re(0);},pause(){b=true,cancelAnimationFrame($);},resume(){b&&(b=false,O&&($=requestAnimationFrame(we)));},seek(f){let p=Math.min(1,Math.max(0,f));x=p,P=p,b=true,cancelAnimationFrame($),re(p);},getProgress(){return x}}}var Yt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function wt(e,n={}){if(typeof window>"u")return Yt;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return be("scrollVideo: <video> element not found:",e),Yt;let t=r,{trigger:o={},easing:s="linear",once:l=false,axis:u="y",preload:m="auto",triggerElement:g,onReady:T,onComplete:q,onProgress:A}=n,J=g??t,Ce=window.matchMedia("(prefers-reduced-motion: reduce)").matches,j=typeof s=="function"?s:ie[s]??ie.linear,ae=he(o.start??"top top"),ee=he(o.end??"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=m);let U=n.from??0,F=n.to,$=0,O=0,b=0,P=false,x=false,M=-1,E=0,te=false,L=false,re=()=>u==="x"?window.scrollX:window.scrollY,we=()=>u==="x"?window.innerWidth:window.innerHeight;function ge(){let w=J.getBoundingClientRect(),V=u==="x"?w.left:w.top,le=u==="x"?w.width:w.height,He=Le({top:V,height:le},re(),we(),ae,ee);$=He.tStart,O=He.tEnd,L&&O===$&&be("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let ye=NaN;function H(w){if(!L)return;let V=F??t.duration??0,le=U+(V-U)*w;le!==ye&&(ye=le,t.currentTime=le),t.style.setProperty("--scroll-draw-progress",String(w)),A?.(w);}function C(){if(!P||x||!L||Ce)return;let w=j(Z(re(),$,O,1));l&&(M=Math.max(M,w),w=M),E=w,H(w),w>=1&&!te?(te=true,q?.()):w<1&&!l&&(te=false),b=requestAnimationFrame(C);}function f(){if(L=true,F===void 0&&(F=t.duration),Ce){H(1),T?.();return}ge(),T?.(),P&&!x&&(b=requestAnimationFrame(C));}t.readyState>=1?f():t.addEventListener("loadedmetadata",f,{once:true}),L||ge();let p=new IntersectionObserver(w=>{w.forEach(V=>{P=V.isIntersecting,P&&!x&&L?b=requestAnimationFrame(C):cancelAnimationFrame(b);});}),k;function B(){clearTimeout(k),k=setTimeout(ge,150);}window.addEventListener("resize",B),window.addEventListener("orientationchange",B);let Ee=Fe([J],B);return p.observe(t),ke(t,{type:"video",getProgress:()=>E,getTrigger:()=>({tStart:$,tEnd:O})}),{destroy(){cancelAnimationFrame(b),p.disconnect(),t.removeEventListener("loadedmetadata",f),window.removeEventListener("resize",B),window.removeEventListener("orientationchange",B),Ee(),clearTimeout(k),Re(t);},replay(){M=-1,te=false,E=0,x=false,ye=NaN,H(0);},pause(){x=true,cancelAnimationFrame(b);},resume(){x&&(x=false,P&&L&&(b=requestAnimationFrame(C)));},seek(w){let V=Math.min(1,Math.max(0,w));E=V,M=V,x=true,cancelAnimationFrame(b),ye=NaN,H(V);},getProgress(){return E}}}function Qt(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),/^\s+$/.test(r)?(t.textContent=r,t.style.whiteSpace="pre"):(t.textContent=r,t.style.display="inline-block"),e.appendChild(t),/^\s+$/.test(r)?null:t}).filter(r=>r!==null)}function xr(e){let n=e.textContent??"";return e.textContent="",n.split("").map(r=>{let t=document.createElement("span");return t.setAttribute("aria-hidden","true"),t.textContent=r,r===" "?t.style.whiteSpace="pre":t.style.display="inline-block",e.appendChild(t),r===" "?null:t}).filter(r=>r!==null)}function Xt(e){let n=Qt(e),r=new Map;for(let s of n){let l=s.offsetTop;r.has(l)||r.set(l,[]),r.get(l).push(s);}let t=[],o=Array.from(r.keys()).sort((s,l)=>s-l);for(let s of o){let l=r.get(s),u=document.createElement("span");u.setAttribute("aria-hidden","true"),u.style.display="inline-block",l.forEach((m,g)=>{let T=m.nextElementSibling;u.appendChild(m),g<l.length-1&&T&&T.style.whiteSpace==="pre"&&u.appendChild(T);}),t.push(u);}return e.textContent="",t.forEach((s,l)=>{e.appendChild(s),l<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function Mr(e,n,r,t){if(r<=1||t===0)return e;let o=(r-1)*t,s=n*t,l=s+(1-o);return l<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(l-s)))}function Ar(e,n){let r=[];if(n?.y!==void 0&&r.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&r.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&r.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let t=n.scale+(1-n.scale)*e;r.push(`scale(${t})`);}return r.join(" ")||""}var Kt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function vt(e,n={}){if(typeof window>"u")return Kt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return be("scrollText: element not found:",e),Kt;let t=r,{split:o="words",stagger:s=.04,easing:l="ease-out",from:u={opacity:0,y:24},trigger:m={},once:g=true,onComplete:T}=n,q=window.matchMedia("(prefers-reduced-motion: reduce)").matches,A=typeof l=="function"?l:ie[l]??ie["ease-out"],J=he(m.start??"top 85%"),Ce=he(m.end??"top 40%"),j=t.innerHTML;t.setAttribute("aria-label",t.textContent??"");let ae;o==="chars"?ae=xr(t):o==="lines"?ae=Xt(t):ae=Qt(t);let ee=ae.length;function U(p,k){u?.opacity!==void 0&&(p.style.opacity=String(u.opacity+(1-u.opacity)*k));let B=Ar(k,u);B&&(p.style.transform=B);}function F(p){t.style.setProperty("--scroll-draw-progress",String(p)),ae.forEach((k,B)=>{let Ee=A(Mr(p,B,ee,s));U(k,Ee);});}if(q)return F(1),T?.(),{destroy(){t.innerHTML=j,t.removeAttribute("aria-label");},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};F(0);let $=0,O=0,b=0,P=false,x=false,M=-1,E=0,te=false,L=()=>window.scrollY,re=()=>window.innerHeight;function we(){let p=t.getBoundingClientRect(),k=Le({top:p.top,height:p.height},L(),re(),J,Ce);$=k.tStart,O=k.tEnd;}function ge(){if(!P||x)return;let p=Z(L(),$,O,1);g&&(M=Math.max(M,p),p=M),E=p,F(p),p>=1&&!te?(te=true,T?.()):p<1&&!g&&(te=false),b=requestAnimationFrame(ge);}we();let ye=new IntersectionObserver(p=>{p.forEach(k=>{P=k.isIntersecting,P&&!x?b=requestAnimationFrame(ge):cancelAnimationFrame(b);});}),H;function C(){clearTimeout(H),H=setTimeout(()=>{if(o==="lines"){let p=E;t.innerHTML=j,t.setAttribute("aria-label",t.textContent??""),ae=Xt(t),F(p);}we();},150);}window.addEventListener("resize",C),window.addEventListener("orientationchange",C);let f=Fe([t],C);return ye.observe(t),ke(t,{type:"text",getProgress:()=>E,getTrigger:()=>({tStart:$,tEnd:O})}),{destroy(){cancelAnimationFrame(b),ye.disconnect(),window.removeEventListener("resize",C),window.removeEventListener("orientationchange",C),f(),clearTimeout(H),t.innerHTML=j,t.removeAttribute("aria-label"),Re(t);},replay(){M=-1,te=false,E=0,x=false,F(0);},pause(){x=true,cancelAnimationFrame(b);},resume(){x&&(x=false,P&&(b=requestAnimationFrame(ge)));},seek(p){let k=Math.min(1,Math.max(0,p));E=k,M=k,x=true,cancelAnimationFrame(b),F(k);},getProgress(){return E}}}var Ze=e=>typeof e=="function"?e():vue.unref(e);function Ne(e,n,r){let t=null,o=n(),s=()=>{t?.destroy(),t=e.value?r(e.value,Wt(o,()=>o)):null;};vue.onMounted(s),vue.watch(()=>Bt(o=n()),s),vue.onUnmounted(()=>{t?.destroy(),t=null;});}function Hn(e={}){let n=vue.ref(null);return Ne(n,()=>Ze(e),gt),n}var Zt={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},Or=[null,Boolean,[Boolean,String],[Boolean,Number]],Jt=e=>({type:e,default:void 0}),Vn=vue.defineComponent({name:"ScrollDraw",props:Object.fromEntries(Object.entries(Zt).map(([e,n])=>[e,n?Jt(Or[n]):null])),setup(e,{slots:n}){let r=vue.ref(null);return Ne(r,()=>{let t={};for(let o in Zt){let s=e[o];s!=null&&(t[o]=s);}return t},gt),()=>vue.h("div",{ref:r},n.default?.())}});function zn(e){let n=vue.ref(null);return Ne(n,()=>Ze(e),yt),n}var _n=vue.defineComponent({name:"ScrollAnimate",props:{options:{type:Object,required:true}},setup(e,{slots:n}){let r=vue.ref(null);return Ne(r,()=>e.options,yt),()=>vue.h("div",{ref:r},n.default?.())}});function qn(e){let n=vue.ref(null);return Ne(n,()=>Ze(e),bt),n}var Bn=vue.defineComponent({name:"ScrollCounter",props:{to:{type:Number,required:true},from:{type:Number},format:{type:Function},easing:{type:[String,Function]},trigger:{type:Object},once:Jt(Boolean),decimals:{type:Number},onComplete:{type:Function}},setup(e){let n=vue.ref(null);return Ne(n,()=>{let r={to:e.to};return e.from!=null&&(r.from=e.from),e.format!=null&&(r.format=e.format),e.easing!=null&&(r.easing=e.easing),e.trigger!=null&&(r.trigger=e.trigger),e.once!=null&&(r.once=e.once),e.decimals!=null&&(r.decimals=e.decimals),e.onComplete!=null&&(r.onComplete=e.onComplete),r},bt),()=>vue.h("span",{ref:n})}});function Wn(e={}){let n=vue.ref(null);return Ne(n,()=>Ze(e),wt),n}var Gn=vue.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 n=vue.ref(null);return Ne(n,()=>e.options??{},wt),()=>vue.h("video",{ref:n,src:e.src,muted:e.muted,playsinline:e.playsInline,preload:"auto",class:e.class})}});function jn(e={}){let n=vue.ref(null);return Ne(n,()=>Ze(e),vt),n}var Un=vue.defineComponent({name:"ScrollText",props:{options:{type:Object},tag:{type:String,default:"p"}},setup(e,{slots:n}){let r=vue.ref(null);return Ne(r,()=>e.options??{},vt),()=>vue.h(e.tag,{ref:r},n.default?.())}});exports.ScrollAnimate=_n;exports.ScrollCounter=Bn;exports.ScrollDraw=Vn;exports.ScrollText=Un;exports.ScrollVideo=Gn;exports.useScrollAnimate=zn;exports.useScrollCounter=qn;exports.useScrollDraw=Hn;exports.useScrollText=jn;exports.useScrollVideo=Wn;
|
package/dist/vue/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
-
import { a as ScrollDrawOptions } from '../types-
|
|
4
|
-
import { S as ScrollAnimateOptions } from '../engine-
|
|
5
|
-
import { S as ScrollCounterOptions } from '../index-
|
|
3
|
+
import { a as ScrollDrawOptions } from '../types-B0YM4nQP.mjs';
|
|
4
|
+
import { S as ScrollAnimateOptions } from '../engine-CvzRSkuk.mjs';
|
|
5
|
+
import { S as ScrollCounterOptions } from '../index-BlIjovDN.mjs';
|
|
6
6
|
import { ScrollVideoOptions } from '../video/index.mjs';
|
|
7
7
|
import { ScrollTextOptions } from '../text/index.mjs';
|
|
8
8
|
|
|
@@ -15,87 +15,9 @@ type MaybeRefOrGetter<T> = T | Ref<T> | (() => T);
|
|
|
15
15
|
*/
|
|
16
16
|
declare function useScrollDraw(options?: MaybeRefOrGetter<ScrollDrawOptions>): Ref<HTMLElement | null, HTMLElement | null>;
|
|
17
17
|
/** Component — wraps children in a <div> and initialises the engine. */
|
|
18
|
-
declare const ScrollDraw: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
19
|
-
selector: {
|
|
20
|
-
type: StringConstructor;
|
|
21
|
-
};
|
|
22
|
-
speed: {
|
|
23
|
-
type: NumberConstructor;
|
|
24
|
-
};
|
|
25
|
-
fade: {
|
|
26
|
-
type: BooleanConstructor;
|
|
27
|
-
};
|
|
28
|
-
stagger: {
|
|
29
|
-
type: NumberConstructor;
|
|
30
|
-
};
|
|
31
|
-
easing: {
|
|
32
|
-
type: (StringConstructor | FunctionConstructor)[];
|
|
33
|
-
};
|
|
34
|
-
direction: {
|
|
35
|
-
type: () => "forward" | "reverse";
|
|
36
|
-
};
|
|
37
|
-
trigger: {
|
|
38
|
-
type: ObjectConstructor;
|
|
39
|
-
};
|
|
40
|
-
onProgress: {
|
|
41
|
-
type: FunctionConstructor;
|
|
42
|
-
};
|
|
43
|
-
onStart: {
|
|
44
|
-
type: FunctionConstructor;
|
|
45
|
-
};
|
|
46
|
-
onComplete: {
|
|
47
|
-
type: FunctionConstructor;
|
|
48
|
-
};
|
|
49
|
-
once: {
|
|
50
|
-
type: BooleanConstructor;
|
|
51
|
-
};
|
|
52
|
-
debug: {
|
|
53
|
-
type: BooleanConstructor;
|
|
54
|
-
};
|
|
55
|
-
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
18
|
+
declare const ScrollDraw: vue.DefineComponent<vue.ExtractPropTypes<Record<keyof ScrollDrawOptions, null>>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
56
19
|
[key: string]: any;
|
|
57
|
-
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
58
|
-
selector: {
|
|
59
|
-
type: StringConstructor;
|
|
60
|
-
};
|
|
61
|
-
speed: {
|
|
62
|
-
type: NumberConstructor;
|
|
63
|
-
};
|
|
64
|
-
fade: {
|
|
65
|
-
type: BooleanConstructor;
|
|
66
|
-
};
|
|
67
|
-
stagger: {
|
|
68
|
-
type: NumberConstructor;
|
|
69
|
-
};
|
|
70
|
-
easing: {
|
|
71
|
-
type: (StringConstructor | FunctionConstructor)[];
|
|
72
|
-
};
|
|
73
|
-
direction: {
|
|
74
|
-
type: () => "forward" | "reverse";
|
|
75
|
-
};
|
|
76
|
-
trigger: {
|
|
77
|
-
type: ObjectConstructor;
|
|
78
|
-
};
|
|
79
|
-
onProgress: {
|
|
80
|
-
type: FunctionConstructor;
|
|
81
|
-
};
|
|
82
|
-
onStart: {
|
|
83
|
-
type: FunctionConstructor;
|
|
84
|
-
};
|
|
85
|
-
onComplete: {
|
|
86
|
-
type: FunctionConstructor;
|
|
87
|
-
};
|
|
88
|
-
once: {
|
|
89
|
-
type: BooleanConstructor;
|
|
90
|
-
};
|
|
91
|
-
debug: {
|
|
92
|
-
type: BooleanConstructor;
|
|
93
|
-
};
|
|
94
|
-
}>> & Readonly<{}>, {
|
|
95
|
-
fade: boolean;
|
|
96
|
-
once: boolean;
|
|
97
|
-
debug: boolean;
|
|
98
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<Record<keyof ScrollDrawOptions, null>>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
99
21
|
/**
|
|
100
22
|
* Composable — call with a full options object and bind the returned ref to
|
|
101
23
|
* whichever element you want to animate.
|