svg-scroll-draw 2.24.0 → 2.26.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 +174 -30
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.d.mts +60 -6
- package/dist/angular/index.d.ts +60 -6
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +2 -2
- package/dist/astro/index.d.mts +3 -3
- package/dist/astro/index.d.ts +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +69 -31
- package/dist/cdn/svg-scroll-draw.global.js +2 -2
- package/dist/chunk-5SJE7725.mjs +1 -0
- package/dist/{chunk-NX74KN5X.mjs → chunk-5U4JXBHR.mjs} +1 -1
- package/dist/chunk-7LDSB4FT.mjs +1 -0
- package/dist/chunk-ASCOHQQD.mjs +2 -0
- package/dist/chunk-GBFWTY5L.mjs +1 -0
- package/dist/chunk-HAGTU5EX.mjs +1 -0
- package/dist/chunk-HJTHOZK5.mjs +1 -0
- package/dist/chunk-IXR6RML7.mjs +1 -0
- package/dist/chunk-KN2YB54Z.mjs +1 -0
- package/dist/chunk-NJV6S5LD.mjs +1 -0
- package/dist/chunk-UBH4K5YD.mjs +1 -0
- package/dist/chunk-UF3MO5XQ.mjs +1 -0
- package/dist/chunk-XLXVGQ3P.mjs +3 -0
- package/dist/chunk-YOOPMYT6.mjs +1 -0
- package/dist/chunk-Z72TVDHY.mjs +1 -0
- package/dist/cinematic/index.cjs +2 -2
- package/dist/cinematic/index.d.mts +3 -1
- package/dist/cinematic/index.d.ts +3 -1
- package/dist/cinematic/index.mjs +1 -1
- package/dist/{engine-6VsjEwzb.d.ts → engine-Bi2x8-X-.d.mts} +2 -2
- package/dist/{engine-BLWKCfxC.d.mts → engine-DAlvk6i0.d.ts} +2 -2
- package/dist/frames/index.cjs +1 -1
- package/dist/frames/index.d.mts +2 -2
- package/dist/frames/index.d.ts +2 -2
- package/dist/frames/index.mjs +1 -1
- package/dist/group/index.cjs +3 -3
- 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 +2 -2
- package/dist/horizontal/index.d.ts +2 -2
- package/dist/horizontal/index.mjs +1 -1
- package/dist/{index-BN8yKeQ3.d.ts → index-BMMZ8aW7.d.mts} +2 -2
- package/dist/{index-hSQqLVbg.d.ts → index-CEMsUTEG.d.ts} +3 -3
- package/dist/{index-DAiRJgtF.d.mts → index-ClAFxNEp.d.mts} +3 -3
- package/dist/{index-DVjblK_4.d.mts → index-MdQ4ti_z.d.ts} +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/lenis/index.cjs +1 -1
- package/dist/lenis/index.d.mts +15 -16
- package/dist/lenis/index.d.ts +15 -16
- package/dist/lenis/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.d.mts +8 -5
- package/dist/nuxt/index.d.ts +8 -5
- package/dist/nuxt/index.mjs +1 -1
- package/dist/progress/index.cjs +1 -1
- package/dist/progress/index.d.mts +2 -2
- package/dist/progress/index.d.ts +2 -2
- package/dist/progress/index.mjs +1 -1
- package/dist/react/index.cjs +3 -3
- package/dist/react/index.d.mts +21 -5
- package/dist/react/index.d.ts +21 -5
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +2 -2
- package/dist/reveal/index.d.ts +2 -2
- package/dist/reveal/index.mjs +1 -1
- package/dist/{scroll-draw-Fzir8hlU.d.mts → scroll-draw-CKZysh22.d.mts} +1 -1
- package/dist/{scroll-draw-BsU_Ohmu.d.ts → scroll-draw-DbY8RUJE.d.ts} +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.d.mts +2 -2
- package/dist/snap/index.d.ts +2 -2
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.d.mts +40 -4
- package/dist/solid/index.d.ts +40 -4
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.d.mts +47 -4
- package/dist/svelte/index.d.ts +47 -4
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.d.mts +2 -2
- package/dist/text/index.d.ts +2 -2
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +10 -10
- package/dist/timeline/index.d.mts +2 -2
- package/dist/timeline/index.d.ts +2 -2
- package/dist/timeline/index.mjs +2 -2
- package/dist/{types-9bcJdVcg.d.mts → types-iITMwrru.d.mts} +10 -2
- package/dist/{types-9bcJdVcg.d.ts → types-iITMwrru.d.ts} +10 -2
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.d.mts +2 -2
- package/dist/video/index.d.ts +2 -2
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.d.mts +37 -4
- package/dist/vue/index.d.ts +37 -4
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/dist/wrapper-BOHrDnBO.d.mts +8 -0
- package/dist/wrapper-Cm7JTIVl.d.ts +8 -0
- package/package.json +1 -1
- package/dist/chunk-32ZCSGFZ.mjs +0 -1
- package/dist/chunk-5SKWSPQT.mjs +0 -1
- package/dist/chunk-7USW2XFB.mjs +0 -1
- package/dist/chunk-7XOFQCQE.mjs +0 -3
- package/dist/chunk-BDXWPUBJ.mjs +0 -2
- package/dist/chunk-BRV2B2YW.mjs +0 -1
- package/dist/chunk-QZKYGS74.mjs +0 -1
- package/dist/chunk-THPTANES.mjs +0 -1
- package/dist/chunk-U5TKLHGW.mjs +0 -1
- package/dist/chunk-V3Z6G5JE.mjs +0 -1
- package/dist/chunk-XSVTHCLO.mjs +0 -1
package/dist/nuxt/index.d.mts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollText, ScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo } from '../vue/index.mjs';
|
|
2
|
-
export { a as ScrollDrawOptions } from '../types-
|
|
1
|
+
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollFrames, ScrollText, ScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollFrames, useScrollText, useScrollVideo } from '../vue/index.mjs';
|
|
2
|
+
export { a as ScrollDrawOptions } from '../types-iITMwrru.mjs';
|
|
3
3
|
import { App } from 'vue';
|
|
4
|
-
export { S as ScrollAnimateOptions } from '../engine-
|
|
5
|
-
export { S as ScrollCounterOptions } from '../index-
|
|
4
|
+
export { S as ScrollAnimateOptions } from '../engine-Bi2x8-X-.mjs';
|
|
5
|
+
export { S as ScrollCounterOptions } from '../index-BMMZ8aW7.mjs';
|
|
6
|
+
export { ScrollFramesOptions } from '../frames/index.mjs';
|
|
6
7
|
export { ScrollTextOptions } from '../text/index.mjs';
|
|
7
8
|
export { ScrollVideoOptions } from '../video/index.mjs';
|
|
9
|
+
import '../wrapper-BOHrDnBO.mjs';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Nuxt 3 integration for svg-scroll-draw.
|
|
@@ -17,6 +19,7 @@ export { ScrollVideoOptions } from '../video/index.mjs';
|
|
|
17
19
|
* import { useScrollDraw, ScrollDraw } from 'svg-scroll-draw/nuxt';
|
|
18
20
|
* import { useScrollAnimate, ScrollAnimate } from 'svg-scroll-draw/nuxt';
|
|
19
21
|
* import { useScrollText, useScrollCounter } from 'svg-scroll-draw/nuxt';
|
|
22
|
+
* import { useScrollFrames, ScrollFrames } from 'svg-scroll-draw/nuxt';
|
|
20
23
|
* ```
|
|
21
24
|
*
|
|
22
25
|
* ## Option B — Global auto-registration via Nuxt plugin
|
|
@@ -35,7 +38,7 @@ export { ScrollVideoOptions } from '../video/index.mjs';
|
|
|
35
38
|
* Vue plugin that globally registers all svg-scroll-draw components.
|
|
36
39
|
* Pass to nuxtApp.vueApp.use() inside a Nuxt plugin.
|
|
37
40
|
*
|
|
38
|
-
* Registers: <ScrollDraw>, <ScrollAnimate>, <ScrollCounter>, <ScrollVideo>, <ScrollText>
|
|
41
|
+
* Registers: <ScrollDraw>, <ScrollAnimate>, <ScrollCounter>, <ScrollVideo>, <ScrollFrames>, <ScrollText>
|
|
39
42
|
*/
|
|
40
43
|
declare function createScrollDrawPlugin(): {
|
|
41
44
|
install(app: App): void;
|
package/dist/nuxt/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollText, ScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollText, useScrollVideo } from '../vue/index.js';
|
|
2
|
-
export { a as ScrollDrawOptions } from '../types-
|
|
1
|
+
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollFrames, ScrollText, ScrollVideo, useScrollAnimate, useScrollCounter, useScrollDraw, useScrollFrames, useScrollText, useScrollVideo } from '../vue/index.js';
|
|
2
|
+
export { a as ScrollDrawOptions } from '../types-iITMwrru.js';
|
|
3
3
|
import { App } from 'vue';
|
|
4
|
-
export { S as ScrollAnimateOptions } from '../engine-
|
|
5
|
-
export { S as ScrollCounterOptions } from '../index-
|
|
4
|
+
export { S as ScrollAnimateOptions } from '../engine-DAlvk6i0.js';
|
|
5
|
+
export { S as ScrollCounterOptions } from '../index-MdQ4ti_z.js';
|
|
6
|
+
export { ScrollFramesOptions } from '../frames/index.js';
|
|
6
7
|
export { ScrollTextOptions } from '../text/index.js';
|
|
7
8
|
export { ScrollVideoOptions } from '../video/index.js';
|
|
9
|
+
import '../wrapper-Cm7JTIVl.js';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Nuxt 3 integration for svg-scroll-draw.
|
|
@@ -17,6 +19,7 @@ export { ScrollVideoOptions } from '../video/index.js';
|
|
|
17
19
|
* import { useScrollDraw, ScrollDraw } from 'svg-scroll-draw/nuxt';
|
|
18
20
|
* import { useScrollAnimate, ScrollAnimate } from 'svg-scroll-draw/nuxt';
|
|
19
21
|
* import { useScrollText, useScrollCounter } from 'svg-scroll-draw/nuxt';
|
|
22
|
+
* import { useScrollFrames, ScrollFrames } from 'svg-scroll-draw/nuxt';
|
|
20
23
|
* ```
|
|
21
24
|
*
|
|
22
25
|
* ## Option B — Global auto-registration via Nuxt plugin
|
|
@@ -35,7 +38,7 @@ export { ScrollVideoOptions } from '../video/index.js';
|
|
|
35
38
|
* Vue plugin that globally registers all svg-scroll-draw components.
|
|
36
39
|
* Pass to nuxtApp.vueApp.use() inside a Nuxt plugin.
|
|
37
40
|
*
|
|
38
|
-
* Registers: <ScrollDraw>, <ScrollAnimate>, <ScrollCounter>, <ScrollVideo>, <ScrollText>
|
|
41
|
+
* Registers: <ScrollDraw>, <ScrollAnimate>, <ScrollCounter>, <ScrollVideo>, <ScrollFrames>, <ScrollText>
|
|
39
42
|
*/
|
|
40
43
|
declare function createScrollDrawPlugin(): {
|
|
41
44
|
install(app: App): void;
|
package/dist/nuxt/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,d,f,h,j}from'../chunk-
|
|
1
|
+
import {b,d,f,h,j,l}from'../chunk-5SJE7725.mjs';export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollFrames,l as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollFrames,k as useScrollText,g as useScrollVideo}from'../chunk-5SJE7725.mjs';import'../chunk-NJV6S5LD.mjs';import'../chunk-KN2YB54Z.mjs';import'../chunk-HJTHOZK5.mjs';import'../chunk-GBFWTY5L.mjs';import'../chunk-UF3MO5XQ.mjs';import'../chunk-Z72TVDHY.mjs';import'../chunk-HAGTU5EX.mjs';import'../chunk-XLXVGQ3P.mjs';import'../chunk-7LDSB4FT.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-YOOPMYT6.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';function x(){return {install(o){o.component("ScrollDraw",b),o.component("ScrollAnimate",d),o.component("ScrollCounter",f),o.component("ScrollVideo",h),o.component("ScrollFrames",j),o.component("ScrollText",l);}}}export{x as createScrollDrawPlugin};
|
package/dist/progress/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function
|
|
1
|
+
'use strict';var Q=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function M(e,...n){Q&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function Z({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function ee({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),i=Math.sqrt(r),o=0,s=[];for(let u=0;u<t;u++){let a=Math.pow(i,u);s.push(a),o+=a;}let m=[0],l=0;for(let u=0;u<t;u++)l+=s[u]/o,m.push(l);return u=>{if(u<=0)return 0;if(u>=1)return 1;for(let a=0;a<t;a++)if(u<=m[a+1]){let g=(u-m[a])/(m[a+1]-m[a]);if(a===0)return g*(2-g);let b=1-Math.pow(r,a);return b+(1-b)*(2*g-1)*(2*g-1)}return 1}}function te({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),i=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return o=>o<=0?0:o>=1?1:t*Math.pow(2,-10*o)*Math.sin((o-i)*(2*Math.PI)/r)+1}var x={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:Z(),bounce:ee(),elastic:te()};function ne(e,n,t,r){let i=(o,s,m)=>((1+3*o-3*s)*m+3*s-6*o)*m*m+3*o*m;return o=>{if(o<=0||o>=1)return +(o>0);let s=o;for(let m=0;m<8;m++)s-=(i(e,t,s)-o)/((3*(1+3*e-3*t)*s+6*t-12*e)*s+3*e);if(!(s>=0&&s<=1&&Math.abs(i(e,t,s)-o)<1e-9))for(let m=0,l=0,u=1;m<30;m++)s=(l+u)/2,i(e,t,s)<o?l=s:u=s;return i(n,r,s)}}function re(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [ne(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var N=new Set;function C(e,n="linear"){if(typeof e=="function")return e;if(e==null)return x[n];if({}.hasOwnProperty.call(x,e))return x[e];let t=re(String(e));return t?t[0]:(!N.has(e)&&N.add(e)&&M(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),x[n])}function F(e,n,t){return Math.min(t,Math.max(n,e))}function z(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var V=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function A(e,n,t,r){return e+t+n*V(r,0)}function I(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:V(e,1))}function _(e,n,t,r){return t===n?0:F((e-n)/(t-n)*r,0,1)}function W(e,n,t,r,i){let o=A(e.top,e.height,n,r.element)-I(r.viewport,t),s=A(e.top,e.height,n,i.element)-I(i.viewport,t);return {tStart:o,tEnd:s}}function k(e,n,t){let r=e.getBoundingClientRect(),i=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:i,scroll:0}:{top:t==="x"?r.left:r.top,height:i,scroll:t==="x"?window.scrollX:window.scrollY}}var G=Symbol.for("svg-scroll-draw.registry");function B(){let e=globalThis;return e[G]||(e[G]=new Map)}function q(e,n){B().set(e,n);}function $(e){B().delete(e);}var v,R=new Set,T=new WeakMap,S=new Map,Y=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function oe(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function H(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();v??(v=new ResizeObserver(i=>{let o=false;for(let{target:s}of i)T.get(s)!==Y(s)&&(o=true),T.set(s,"");o&&R.forEach(s=>s());})),R.add(t);let r=oe(e);return [document.body,document.documentElement].forEach(i=>i&&r.add(i)),r.forEach(i=>{T.has(i)||T.set(i,Y(i)),S.set(i,(S.get(i)??0)+1),v.observe(i);}),()=>{R.delete(t)&&(r.forEach(i=>{let o=(S.get(i)??1)-1;if(o)return void S.set(i,o);S.delete(i),v?.unobserve(i);}),R.size||(v?.disconnect(),v=void 0));}}function X(e,n,t,r,i){let o,s=NaN,m,l,u=()=>{o=0,r(),!m&&!o&&(s=t())>0&&s<1&&(o=requestAnimationFrame(u));},a=()=>{!o&&!m&&t()!==s&&(o=requestAnimationFrame(u));},g=d=>{m=d,cancelAnimationFrame(o),o=s=NaN,a();},b=()=>{clearTimeout(l),i(),a();},w=()=>{clearTimeout(l),l=setTimeout(b,150);},P=H(n,w),f=d=>{e[d]("scroll",a,{passive:true}),window[d]("resize",w),window[d]("orientationchange",w);};return f("addEventListener"),a(),{hold:g,remeasure:b,off(){g(true),f("removeEventListener"),P(),clearTimeout(l);}}}var J={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Se(e,n={}){if(typeof window>"u")return J;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return M("scrollProgress: element not found:",e),J;let r=t,{variable:i="--scroll-progress",easedVariable:o="--scroll-progress-eased",trigger:s={},easing:m="linear",speed:l=1,axis:u="y",scrollContainer:a,onProgress:g}=n,b=C(m),w=z(s.start||"top bottom"),P=z(s.end||"bottom top"),f=typeof a=="string"?document.querySelector(a):a??null,d=0,h=0,y=0,L=()=>f?u==="x"?f.scrollLeft:f.scrollTop:u==="x"?window.scrollX:window.scrollY,K=()=>f?u==="x"?f.clientWidth:f.clientHeight:u==="x"?window.innerWidth:window.innerHeight;function D(){let c=k(r,f,u),p=W(c,c.scroll,K(),w,P);d=p.tStart,h=p.tEnd;}function O(c,p){r.style.setProperty(i,String(c)),o!=null&&r.style.setProperty(o,String(p)),g?.(c,p);}function U(){let c=_(L(),d,h,l),p=b(c);y=c,O(c,p);}D();{let c=_(L(),d,h,l),p=b(c);y=c,O(c,p);}let E=X(f??window,[r],()=>_(L(),d,h,Math.min(l,1)),U,D);return q(t,{type:"animate",getProgress:()=>y,getTrigger:()=>({tStart:d,tEnd:h})}),{destroy(){E.off(),r.style.removeProperty(i),o!=null&&r.style.removeProperty(o),$(t);},replay:E.remeasure,pause:()=>E.hold(true),resume:()=>E.hold(false),seek(c){let p=Math.min(1,Math.max(0,c)),j=b(p);y=p,E.hold(true),O(p,j);},getProgress(){return y}}}exports.scrollProgress=Se;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TriggerConfig, E as
|
|
1
|
+
import { T as TriggerConfig, E as Easing, S as ScrollDrawInstance } from '../types-iITMwrru.mjs';
|
|
2
2
|
|
|
3
3
|
interface ScrollProgressOptions {
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ interface ScrollProgressOptions {
|
|
|
12
12
|
*/
|
|
13
13
|
easedVariable?: string | null;
|
|
14
14
|
trigger?: TriggerConfig;
|
|
15
|
-
easing?:
|
|
15
|
+
easing?: Easing;
|
|
16
16
|
speed?: number;
|
|
17
17
|
/** Scroll axis. Default: 'y'. */
|
|
18
18
|
axis?: 'x' | 'y';
|
package/dist/progress/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { T as TriggerConfig, E as
|
|
1
|
+
import { T as TriggerConfig, E as Easing, S as ScrollDrawInstance } from '../types-iITMwrru.js';
|
|
2
2
|
|
|
3
3
|
interface ScrollProgressOptions {
|
|
4
4
|
/**
|
|
@@ -12,7 +12,7 @@ interface ScrollProgressOptions {
|
|
|
12
12
|
*/
|
|
13
13
|
easedVariable?: string | null;
|
|
14
14
|
trigger?: TriggerConfig;
|
|
15
|
-
easing?:
|
|
15
|
+
easing?: Easing;
|
|
16
16
|
speed?: number;
|
|
17
17
|
/** Scroll axis. Default: 'y'. */
|
|
18
18
|
axis?: 'x' | 'y';
|
package/dist/progress/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$2}from'../chunk-UPWWULKI.mjs';import {a,b as b$1,e,c}from'../chunk-NV6YTPHI.mjs';import {
|
|
1
|
+
import {a as a$2}from'../chunk-UPWWULKI.mjs';import {a,b as b$1,e,c}from'../chunk-NV6YTPHI.mjs';import {f}from'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$1,b as b$2}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var D={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Y(c$1,H={}){if(typeof window>"u")return D;let g=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!g)return b("scrollProgress: element not found:",c$1),D;let o=g,{variable:b$3="--scroll-progress",easedVariable:m="--scroll-progress-eased",trigger:h={},easing:I="linear",speed:p=1,axis:n="y",scrollContainer:d,onProgress:k}=H,f$1=f(I),q=a(h.start||"top bottom"),F=a(h.end||"bottom top"),t=typeof d=="string"?document.querySelector(d):d??null,s=0,i=0,l=0,y=()=>t?n==="x"?t.scrollLeft:t.scrollTop:n==="x"?window.scrollX:window.scrollY,L=()=>t?n==="x"?t.clientWidth:t.clientHeight:n==="x"?window.innerWidth:window.innerHeight;function E(){let e=a$2(o,t,n),r=c(e,e.scroll,L(),q,F);s=r.tStart,i=r.tEnd;}function w(e,r){o.style.setProperty(b$3,String(e)),m!=null&&o.style.setProperty(m,String(r)),k?.(e,r);}function R(){let e=b$1(y(),s,i,p),r=f$1(e);l=e,w(e,r);}E();{let e=b$1(y(),s,i,p),r=f$1(e);l=e,w(e,r);}let a$3=e(t??window,[o],()=>b$1(y(),s,i,Math.min(p,1)),R,E);return a$1(g,{type:"animate",getProgress:()=>l,getTrigger:()=>({tStart:s,tEnd:i})}),{destroy(){a$3.off(),o.style.removeProperty(b$3),m!=null&&o.style.removeProperty(m),b$2(g);},replay:a$3.remeasure,pause:()=>a$3.hold(true),resume:()=>a$3.hold(false),seek(e){let r=Math.min(1,Math.max(0,e)),V=f$1(r);l=r,a$3.hold(true),w(r,V);},getProgress(){return l}}}export{Y as scrollProgress};
|
package/dist/react/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
'use strict';var
|
|
3
|
-
<div style="position:absolute;${
|
|
4
|
-
<div style="position:absolute;${f?`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 Bt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,qt=/[MmLlHhVvCcSsQqTtAaZz]/g;function $r(e,n,r){if(!Ge)return;let t=(e.match(qt)??[]).join("").toUpperCase(),o=(n.match(qt)??[]).join("").toUpperCase(),s=(e.match(Bt)??[]).length,a=(n.match(Bt)??[]).length;if(t!==o){le(`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!==a&&le(`morphTo: coordinate count differs (${s} \u2192 ${a}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,r);}function kr(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 a=parseFloat(s),u=t[o++]??a;return String(+(a+(u-a)*r).toFixed(4))})}function Qt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:He(n,(r,t)=>Rr(e,r,t))}function Rr(e,n,r){let{preset:t,...o}=n,s=t?{...It[t],...o}:o,{selector:a="path, polyline, line, polygon, rect, circle",speed:u=1,fade:f=false,easing:m="linear",trigger:g={},stagger:h=0,direction:b="forward",once:O=false,debug:H=false,axis:w="y",scrollContainer:k,autoReverse:ie=false,delay:R=0,strokeColor:T,strokeWidth:x,fillOpacity:L,waypoints:y,velocityScale:S=false,threshold:N=0,rootMargin:Y="0px",repeat:_=0,repeatDelay:I=0,morphTo:W,clip:M,autoplay:K=false,duration:v=1e3,native:$=true,onProgress:Te,onStart:J,onComplete:G,onEnter:me,onLeave:xe,onEnterBack:ye,onLeaveBack:pe}=s,E=M===true?"left":typeof M=="string"?M:false,P=typeof m=="function"?m:Q[m]??Q.linear,he=X(g.start||"top bottom"),Oe=X(g.end||"bottom top"),Z=typeof k=="string"?document.querySelector(k):k??null,Pe=Array.isArray(T)?T[0]:null,Le=Array.isArray(T)?T[1]:typeof T=="string"?T:null,be=Array.isArray(x)?x[0]:null,Ne=Array.isArray(x)?x[1]:typeof x=="number"?x:null,Ce=Array.isArray(L)?L[0]:null,we=Array.isArray(L)?L[1]:typeof L=="number"?L:null;function Ae(i){let c=i*100;switch(E){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 l=E?[]:Array.from(e.querySelectorAll(a)),p=[],ee=[],D=0,z=0,U=h,j=0,De=0,te=false,$e=false,ke=0,ft=-1,et=[],tt=-1,de=false,Me=0,Ie=0,Fe,mt=false,pt=null;function vt(){pt?.destroy(),pt=null;}let Ve=new Set,Et=NaN,_e=true,rt=-1,St=performance.now(),We=NaN;function nt(){return Z?w==="x"?Z.scrollLeft:Z.scrollTop:w==="x"?window.scrollX:window.scrollY}function Tt(){return Z?w==="x"?Z.clientWidth:Z.clientHeight:w==="x"?window.innerWidth:window.innerHeight}function xt(){let i=ze(e,Z,w);return fe(i,i.scroll,Tt(),he,Oe)}function fr(){let i=z-D,c=l.length-1,d=Z??document.documentElement,A=w==="x"?"Width":"Height";if(U=h,h>0&&c>0&&i>0){let ne=d[`scroll${A}`]-d[`client${A}`]-1-D-i/u;ne>=0&&(U=Math.min(h,ne/(c*i)));}let re=Math.max(0,c)*U*i,ce=i/Math.min(u,1);j=D+Math.min(0,re,ce,re+ce),De=D+Math.max(0,re,ce,re+ce);}function Mt(){(({tStart:D,tEnd:z}=xt())),fr(),H&&Ge&&(vt(),pt=Ar(D,z,w));}function dt(i,c=xt){Ee(e,{type:"draw",getProgress:()=>i.getProgress(),getTrigger:c});let d=i.destroy;return i.destroy=()=>{d.call(i),Se(e);},i}function Pt(i,c){return O&&!ie?Math.max(ft,P(et[i]=Math.max(et[i]??0,c))):P(c)}function mr(i,c){if(e.style.setProperty("--scroll-draw-progress",String(i)),E){let d=c==="reverse"?1-i:i;e.style.clipPath=Ae(d);return}l.forEach((d,A)=>gt(d,A,i,c));}function gt(i,c,d,A){i.style.strokeDashoffset=A==="reverse"?`${p[c]*d}`:`${p[c]*(1-d)}`,f&&(i.style.opacity=A==="reverse"?`${1-d}`:`${d}`),Pe&&Le?i.style.stroke=st(Pe,Le,d):Le&&(i.style.stroke=Le),be!==null&&Ne!==null?i.style.strokeWidth=`${be+(Ne-be)*d}`:Ne!==null&&(i.style.strokeWidth=`${Ne}`),Ce!==null&&we!==null?i.style.fillOpacity=`${Ce+(we-Ce)*d}`:we!==null&&(i.style.fillOpacity=`${we}`),W&&i.tagName.toLowerCase()==="path"&&ee[c]&&i.setAttribute("d",kr(ee[c],W,d));}function yt(){if(e.style.setProperty("--scroll-draw-progress","0"),E){e.style.clipPath=Ae(b==="reverse"?1:0);return}l.forEach((i,c)=>{i.style.strokeDasharray=`${p[c]}`,i.style.strokeDashoffset=b==="reverse"?"0":`${p[c]}`,f?i.style.opacity=b==="reverse"?"1":"0":i.style.opacity="",Pe&&(i.style.stroke=Pe),be!==null&&(i.style.strokeWidth=`${be}`),Ce!==null&&(i.style.fillOpacity=`${Ce}`),W&&i.tagName.toLowerCase()==="path"&&ee[c]&&i.setAttribute("d",ee[c]);});}function qe(i,c){let d=i.getAttribute("d"),A=ot(i);if(W&&ee[c]){i.setAttribute("d",W);let re=ot(i);i.setAttribute("d",ee[c]),A=Math.max(ot(i),re),i.setAttribute("d",d);}p[c]=A,i.style.strokeDasharray=`${A}`;}if(l.forEach((i,c)=>{Cr(i);let d=i.tagName.toLowerCase()==="path";d?ee.push(i.getAttribute("d")??""):ee.push(""),qe(i,c);let A=p[c];W&&(d?$r(ee[ee.length-1],W,i):le(`morphTo only applies to <path> elements \u2014 ignored on <${i.tagName}>.`,i)),r?(i.style.strokeDashoffset=b==="reverse"?`${A}`:"0",f&&(i.style.opacity="1"),Le&&(i.style.stroke=Le),Ne!==null&&(i.style.strokeWidth=`${Ne}`),we!==null&&(i.style.fillOpacity=`${we}`),W&&i.tagName.toLowerCase()==="path"&&i.setAttribute("d",W)):(i.style.strokeDashoffset=b==="reverse"?"0":`${A}`,f?i.style.opacity=b==="reverse"?"1":"0":i.style.opacity="",Pe&&(i.style.stroke=Pe),be!==null&&(i.style.strokeWidth=`${be}`),Ce!==null&&(i.style.fillOpacity=`${Ce}`));}),r)return E&&(e.style.clipPath=Ae(1)),G?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};E&&(e.style.clipPath=Ae(b==="reverse"?1:0));let Lt=typeof m=="string"?it(m):null;function pr(){return !($===false||K||H&&Ge||!Lr()||!l.length||!Lt||E||w!=="y"||Z||u!==1||h!==0||O||ie||S!==false||W||y||_||R>0||Te||J||G||me||xe||ye||pe||T!=null||x!=null||L!=null||(g.start||"top bottom").trim()!=="top bottom"||(g.end||"bottom top").trim()!=="bottom top")}function dr(){let i=++Pr,c=`svg-scroll-draw-${i}`,d=`svg-scroll-draw-host-${i}`,A=`--svg-scroll-draw-${i}`,re=b==="reverse"?"0":"var(--ssd-len)",ce=b==="reverse"?"var(--ssd-len)":"0",ne=`stroke-dashoffset:${re};`,B=`stroke-dashoffset:${ce};`;f&&(ne+=`opacity:${b==="reverse"?1:0};`,B+=`opacity:${b==="reverse"?0:1};`);let q=document.createElement("style");q.setAttribute("data-svg-scroll-draw",""),q.textContent=`@keyframes ${c}{from{${ne}}to{${B}}}.${d}{view-timeline-name:${A};view-timeline-axis:block;}.${c}{animation-name:${c};animation-duration:auto;animation-timing-function:${Lt};animation-fill-mode:both;animation-timeline:${A};animation-range:cover 0% cover 100%;}`,document.head.appendChild(q),e.classList.add(d);function ae(C,F){C.style.setProperty("--ssd-len",String(p[F])),C.style.strokeDasharray=`${p[F]}`,C.style.strokeDashoffset="",C.style.opacity="",C.style.animationPlayState="",C.classList.add(c);}l.forEach(ae);let oe=false,ue=-1;function ge(){if(ue>=0)return ue;let C=e.getBoundingClientRect(),{tStart:F,tEnd:se}=fe({top:C.top,height:C.height},nt(),Tt(),he,Oe);return P(V(nt(),F,se,u))}return {destroy(){e.classList.remove(d),l.forEach(C=>{C.classList.remove(c),C.style.removeProperty("--ssd-len"),C.style.animationPlayState="";}),q.remove();},replay(){oe=false,ue=-1,l.forEach(ae);},pause(){oe=true,l.forEach(C=>{C.style.animationPlayState="paused";});},resume(){oe&&(oe=false,l.forEach(C=>{C.style.animationPlayState="running";}));},seek(C){let F=Math.min(1,Math.max(0,C));ue=F,oe=true,l.forEach((se,Re)=>{se.classList.remove(c),se.style.strokeDashoffset=b==="reverse"?`${p[Re]*F}`:`${p[Re]*(1-F)}`,f&&(se.style.opacity=b==="reverse"?`${1-F}`:`${F}`);});},getProgress(){return ge()},refresh(){l.forEach((C,F)=>{qe(C,F),C.style.setProperty("--ssd-len",String(p[F]));});}}}if(pr())return dt(dr());function gr(){let i=Math.max(1,v),c=E?i:i*(1+Math.max(0,l.length-1)*h),d=0,A=0,re=false;function ce(ue){let ge=true,C=Math.min(1,Math.max(0,ue/c));if(E){let F=Math.min(1,Math.max(0,ue/i)),se=P(F);Me=se,e.style.setProperty("--scroll-draw-progress",String(se)),e.style.clipPath=Ae(b==="reverse"?1-se:se),Te?.(se),F<1&&(ge=false);}else {l.forEach((se,Re)=>{let hr=Re*h*i,Rt=Math.min(1,Math.max(0,(ue-hr)/i));gt(se,Re,P(Rt),b),Rt<1&&(ge=false);});let F=P(C);Me=F,Te?.(F),e.style.setProperty("--scroll-draw-progress",String(F));}if(y){let F=P(C);for(let se in y){let Re=parseFloat(se);F>=Re&&!Ve.has(Re)&&(Ve.add(Re),y[se]?.());}}return ge}function ne(ue){if(de)return;let ge=ue-d;$e||($e=true,J?.());let C=ce(ge);if(C&&!te){te=true,ce(c),G?.(),Ie<(_==="infinite"?1/0:_??0)&&(Ie++,Fe=setTimeout(()=>{d=performance.now(),$e=false,te=false,Ve.clear(),yt(),ke=requestAnimationFrame(ne);},I));return}C||(ke=requestAnimationFrame(ne));}function B(){cancelAnimationFrame(ke),clearTimeout(Fe),d=performance.now(),A=0,de=false,$e=false,te=false,Ie=0,re=true,Me=0,Ve.clear(),yt(),ke=requestAnimationFrame(ne);}let q=new IntersectionObserver(ue=>{ue.forEach(ge=>{ge.isIntersecting&&!(O&&te)?B():!ge.isIntersecting&&!O&&!te&&(cancelAnimationFrame(ke),clearTimeout(Fe),re=false);});},{root:Z??null,threshold:N,rootMargin:Y}),ae;function oe(){clearTimeout(ae),ae=setTimeout(()=>l.forEach(qe),150);}return window.addEventListener("resize",oe),window.addEventListener("orientationchange",oe),R>0?setTimeout(()=>q.observe(e),R):q.observe(e),{destroy(){cancelAnimationFrame(ke),clearTimeout(Fe),q.disconnect(),window.removeEventListener("resize",oe),window.removeEventListener("orientationchange",oe),clearTimeout(ae);},replay(){Ie=0,B();},pause(){de||!re||(de=true,A=performance.now()-d,cancelAnimationFrame(ke));},resume(){de&&(de=false,re=true,d=performance.now()-A,ke=requestAnimationFrame(ne));},seek(ue){let ge=Math.min(1,Math.max(0,ue));Me=ge,de=true,A=ge*c,d=performance.now()-A,cancelAnimationFrame(ke),ce(A);},getProgress(){return Me},refresh(){clearTimeout(ae),l.forEach(qe);}}}if(K)return dt(gr());Mt();let Ct=()=>V(nt(),j,De,1);function At(){te=true,G?.(),Ie<(_==="infinite"?1/0:_)&&(Ie++,Fe=setTimeout(()=>{mt=true;},I));}function $t(){ft=-1,et=[],$e=false,te=false,mt=false,Ve.clear(),yt(),_e=true;}function yr(){let i=performance.now(),c=nt();if(mt&&Ct()%1&&$t(),!_e&&S===false&&c===Et)return;_e=false,Et=c;let d=u;if(S!==false){let B=i-St,q=B>0?Math.abs(c-(rt<0?c:rt))/B:0;d=u*Math.max(.2,1+q*(typeof S=="number"?S:1)*.04);}rt=c,St=i;let A=ie?tt===-1||c>=tt?"forward":"reverse":b;tt=c;let re=z-D,ce=true,ne=re===0?0:(c-D)/re;if(isNaN(We)||(We<=0&&ne>0&&me?.(),We<1&&ne>=1&&xe?.(),We>=1&&ne<1&&ye?.(),We>0&&ne<=0&&pe?.()),We=ne,E){let B=Pt(0,V(c,D,z,d));Me=B,e.style.setProperty("--scroll-draw-progress",String(B));let q=A==="reverse"?1-B:B;e.style.clipPath=Ae(q),Te?.(B),!$e&&V(c,D,z,d)>0&&($e=true,J?.()),B>=1&&!te?At():B<1&&!O&&(te=false);return}if(l.forEach((B,q)=>{let ae=q*U*re,oe=Pt(q,V(c,D+ae,z+ae,d));gt(B,q,oe,A),q===0&&(Me=oe,Te?.(oe),e.style.setProperty("--scroll-draw-progress",String(oe))),oe<1&&(ce=false);}),y){let B=P(V(c,D,z,d));for(let q in y){let ae=parseFloat(q);B>=ae&&!Ve.has(ae)&&(Ve.add(ae),y[q]?.());}}!$e&&V(c,D,z,d)>0&&($e=true,J?.()),ce&&!te?At():!ce&&!O&&(te=false);}let Qe=ve(Z??window,[e],Ct,yr,()=>{let i=p.join();l.forEach(qe),Mt(),_e=true,p.join()!==i&&Ue();}),ht=R>0;function Ue(){Qe.hold(de||ht);}let kt;return ht&&(kt=setTimeout(()=>{ht=false,Ue();},R)),Ue(),dt({destroy(){clearTimeout(Fe),clearTimeout(kt),Qe.off(),vt();},replay(){$t(),tt=-1,rt=-1,Ie=0,de=false,Me=0,clearTimeout(Fe),Ue();},pause(){de=true,Qe.hold(true);},resume(){de&&(de=false,_e=true,Ue());},seek(i){let c=Math.min(1,Math.max(0,i));Me=c,ft=c,et=[],de=true,Qe.hold(true),mr(c,b),_e=true;},getProgress(){return Me},refresh:Qe.remeasure},()=>({tStart:D,tEnd:z}))}var Ut=new WeakMap,Or=0;function Yt(e){return JSON.stringify(e,(n,r)=>{if(typeof r=="function")return "\u0192";if(typeof Element<"u"&&r instanceof Element){let t=Ut.get(r);return t===void 0&&Ut.set(r,t=++Or),`el#${t}`}return r})}function Xt(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 Nr(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function Kt(e){let n=[],r=/([\w]+)\(([^)]*)\)/g,t;for(;(t=r.exec(e))!==null;){let o=[],s=[],a=t[2].trim();if(a)for(let u of a.split(/[\s,]+/)){let f=u.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(f?parseFloat(f[1]):0),s.push(f?f[2]:"");}n.push({fn:t[1],nums:o,units:s});}return n}function Dr(e,n,r){let t=Kt(e),o=Kt(n);return t.length===0||t.length!==o.length?r<1?e:n:t.map((s,a)=>{let u=o[a];return s.fn!==u.fn||s.nums.length!==u.nums.length?r<1?`${s.fn}(${s.nums.map((f,m)=>`${f}${s.units[m]}`).join(", ")})`:`${u.fn}(${u.nums.map((f,m)=>`${f}${u.units[m]}`).join(", ")})`:`${s.fn}(${s.nums.map((f,m)=>`${f+(u.nums[m]-f)*r}${s.units[m]}`).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(Nr(t))return st(t,o,r);if(t.includes("("))return Dr(t,o,r);let s=t.match(/^([-+]?[\d.]+)(.*)$/),a=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&a){let u=parseFloat(s[1]),f=parseFloat(a[1]);return `${u+(f-u)*r}${s[2]||a[2]}`}return r<1?t:o}function Hr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Ir=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fr=0,Zt="--scroll-draw-progress";function Vr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var tr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function rr(e,n){return typeof window>"u"?tr:n.respectReducedMotion===false?er(e,n,false):He(n,(r,t)=>er(e,r,t))}function er(e,n,r){let{props:t,trigger:o={},easing:s="ease-out",speed:a=1,once:u=false,axis:f="y",scrollContainer:m,native:g=true,velocityScale:h=false,triggerElement:b,onProgress:O,onComplete:H,onEnter:w,onLeave:k,onEnterBack:ie,onLeaveBack:R}=n,T=typeof s=="function"?s:Q[s]??Q["ease-out"],x=X(o.start||"top bottom"),L=X(o.end||"bottom top"),y=b??e,S=typeof m=="string"?document.querySelector(m):m??null,N=Object.entries(t).map(([l,p])=>({prop:Hr(l),from:Array.isArray(p)?p[0]:"",to:Array.isArray(p)?p[1]:p}));function Y(){let l=window.getComputedStyle(e);for(let p of N)p.from===""&&(p.from=l.getPropertyValue(p.prop).trim()||"0");}function _(){for(let l of N)e.style.setProperty(l.prop,String(l.to));}let I=new Map;for(let l of [...N.map(p=>p.prop),Zt])I.set(l,e.style.getPropertyValue(l));function W(){for(let[l,p]of I)p?e.style.setProperty(l,p):e.style.removeProperty(l);}if(r)return _(),H?.(),{...tr,destroy:W,getProgress:()=>1};Y();let M=()=>S?f==="x"?S.scrollLeft:S.scrollTop:f==="x"?window.scrollX:window.scrollY,K=()=>S?f==="x"?S.clientWidth:S.clientHeight:f==="x"?window.innerWidth:window.innerHeight,v=typeof s=="string"?it(s):null;function $(){if(!g||!Vr()||!v||f!=="y"||S||y!==e||u||a!==1||O||H||w||k||ie||R||h!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let l of N)if(!Ir.has(l.prop))return false;return true}function Te(){let l=`ssd-a-${++Fr}`,p=N.map(j=>`${j.prop}:${j.from}`).join(";"),ee=N.map(j=>`${j.prop}:${j.to}`).join(";"),D=document.createElement("style");D.setAttribute("data-ssd-animate",""),D.textContent=`@keyframes ${l}{from{${p}}to{${ee}}}.${l}{animation-name:${l};animation-duration:auto;animation-timing-function:${v};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(D),e.classList.add(l);let z=()=>{let j=e.getBoundingClientRect();return fe({top:j.top,height:j.height},M(),K(),x,L)};Ee(e,{type:"animate",getProgress:()=>U.getProgress(),getTrigger:z});let U={refresh(){},destroy(){e.classList.remove(l),D.remove(),e.style.animationPlayState="",W(),Se(e);},replay(){e.classList.remove(l),e.offsetWidth,e.classList.add(l);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(j){let De=Math.min(1,Math.max(0,j));e.classList.remove(l);for(let te of N)e.style.setProperty(te.prop,Jt(te.from,te.to,De));},getProgress(){let{tStart:j,tEnd:De}=z();return T(V(M(),j,De,a))}};return U}if($())return Te();let J=0,G=0,me=false,xe=-1,ye=0,pe=0,E=false,P=NaN,he=-1,Oe=0,Z=y===e?N:[],Pe=false;function Le(){let l=e.style,p=Z.map(U=>l.getPropertyValue(U.prop)),ee=l.transition;Z.length&&(l.transition="none"),Z.forEach(U=>l.setProperty(U.prop,I.get(U.prop)??""));let D=ze(y,S,f);Z.forEach((U,j)=>l.setProperty(U.prop,p[j])),Z.length&&(e.offsetWidth,l.transition=ee);let z=fe(D,D.scroll,K(),x,L);Pe&&Math.abs(z.tStart-J)<1&&Math.abs(z.tEnd-G)<1||(Pe=true,J=z.tStart,G=z.tEnd);}function be(l){e.style.setProperty(Zt,String(l));for(let p of N)e.style.setProperty(p.prop,Jt(p.from,p.to,l));O?.(l);}function Ne(l){if(isNaN(P)){P=l;return}P<=0&&l>0&&w?.(),P<1&&l>=1&&k?.(),P>=1&&l<1&&ie?.(),P>0&&l<=0&&R?.(),P=l;}function Ce(){if(me)return;let l=performance.now(),p=M(),ee=a;if(h!==false){let j=l-Oe,De=j>0?Math.abs(p-(he<0?p:he))/j:0;ee=a*Math.max(.2,1+De*(typeof h=="number"?h:1)*.04);}he=p,Oe=l;let D=G===J?0:(p-J)/(G-J);Ne(D);let z=V(p,J,G,ee),U=u?Math.max(xe,T(ye=Math.max(ye,z))):T(z);pe=U,be(U),U>=1&&!E?(E=true,H?.()):U<1&&!u&&(E=false);}let we=ve(S??window,[y],()=>V(M(),J,G,Math.min(a,1)),Ce,Le);Le(),G===J&&le("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),ye=V(M(),J,G,a),pe=T(ye),be(pe),Ee(e,{type:"animate",getProgress:()=>pe,getTrigger:()=>({tStart:J,tEnd:G})});function Ae(){me=true,we.hold(true);}return {destroy(){me=true,we.off(),W(),Se(e);},replay(){xe=-1,ye=0,E=false,pe=0,me=false,be(0),we.hold(false);},pause:Ae,resume(){me&&(me=false,we.hold(false));},seek(l){let p=Math.min(1,Math.max(0,l));pe=p,xe=p,ye=0,Ae(),be(p);},getProgress(){return pe},refresh:we.remeasure}}var bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function nr(e,n){if(typeof window>"u")return bt;let r=typeof e=="string"?document.querySelector(e):e;return r?He(n,(t,o)=>_r(r,t,o)):(le("scrollCounter: element not found:",e),bt)}function _r(e,n,r){let{from:t=0,to:o,format:s,easing:a="ease-out",trigger:u={},once:f=true,decimals:m,onComplete:g}=n,h=m!==void 0?v=>v.toFixed(m):s??(v=>String(Math.round(v))),b=typeof a=="function"?a:Q[a]??Q["ease-out"],O=X(u.start||"top 80%"),H=X(u.end||"top 20%");if(r)return e.textContent=h(o),g?.(),{...bt,getProgress:()=>1};let w=0,k=0,ie=false,R=-1,T=0,x=0,L=false,y=()=>window.scrollY,S=()=>window.innerHeight;function N(){let v=e.getBoundingClientRect(),$=fe({top:v.top,height:v.height},y(),S(),O,H);ie&&Math.abs($.tStart-w)<1&&Math.abs($.tEnd-k)<1||(ie=true,w=$.tStart,k=$.tEnd);}let Y=e.style.getPropertyValue("--scroll-draw-progress");function _(v){e.textContent=h(t+(o-t)*v),e.style.setProperty("--scroll-draw-progress",String(v));}let I=()=>V(y(),w,k,1);function W(){let v=I(),$=f?Math.max(R,b(T=Math.max(T,v))):b(v);x=$,_($),$>=1&&!L?(L=true,g?.()):$<1&&!f&&(L=false);}N();{T=V(y(),w,k,1);let v=b(T);x=v,_(v);}let M=ve(window,[e],I,W,N);Ee(e,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:w,tEnd:k})});let K=()=>M.hold(false);return {destroy(){M.off(),e.style.setProperty("--scroll-draw-progress",Y),Se(e);},replay(){R=-1,T=0,L=false,x=0,_(0),K();},pause:()=>M.hold(true),resume:K,seek(v){let $=Math.min(1,Math.max(0,v));x=$,R=$,T=0,M.hold(true),_($);},getProgress(){return x}}}var or={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function sr(e,n={}){if(typeof window>"u")return or;let r=typeof e=="string"?document.querySelector(e):e;if(!r||r.tagName.toLowerCase()!=="video")return le("scrollVideo: <video> element not found:",e),or;let t=r,{trigger:o={},easing:s="linear",once:a=false,axis:u="y",preload:f="auto",triggerElement:m,onReady:g,onComplete:h,onProgress:b}=n,O=m??t,H=window.matchMedia("(prefers-reduced-motion: reduce)").matches,w=typeof s=="function"?s:Q[s]??Q.linear,k=X(o.start||"top top"),ie=X(o.end||"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=f);let R=n.from??0,T=n.to,x=0,L=0,y=false,S=-1,N=0,Y=0,_=false,I=false,W=()=>u==="x"?window.scrollX:window.scrollY,M=()=>u==="x"?window.innerWidth:window.innerHeight;function K(){let E=O.getBoundingClientRect(),P=u==="x"?E.left:E.top,he=u==="x"?E.width:E.height,Oe=fe({top:P,height:he},W(),M(),k,ie);x=Oe.tStart,L=Oe.tEnd,I&&L===x&&le("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let v=NaN;function $(E){if(!I)return;let P=T??t.duration??0,he=R+(P-R)*E;he!==v&&(v=he,t.currentTime=he),t.style.setProperty("--scroll-draw-progress",String(E)),b?.(E);}let Te=()=>V(W(),x,L,1);function J(){if(!I||H)return;let E=Te(),P=a?Math.max(S,w(N=Math.max(N,E))):w(E);Y=P,$(P),P>=1&&!_?(_=true,h?.()):P<1&&!a&&(_=false);}let G=ve(window,[O],Te,J,K),me=()=>G.hold(y||!I||H);me();function xe(){if(I=true,T===void 0&&(T=t.duration),H){$(1),g?.();return}K(),g?.(),y?$(Y):me();}t.readyState>=1?xe():t.addEventListener("loadedmetadata",xe,{once:true}),I||K();let ye=H?()=>{}:je(E=>{E&&(ye(),H=true,G.hold(true),$(1));});Ee(t,{type:"video",getProgress:()=>Y,getTrigger:()=>({tStart:x,tEnd:L})});function pe(){y&&(y=false,me());}return {destroy(){G.off(),t.removeEventListener("loadedmetadata",xe),ye(),Se(t);},replay(){S=-1,N=0,_=false,Y=0,v=NaN,$(0),pe();},pause(){y=true,G.hold(true);},resume:pe,seek(E){let P=Math.min(1,Math.max(0,E));Y=P,S=P,N=0,y=true,G.hold(true),v=NaN,$(P);},getProgress(){return Y}}}function ir(e,n){let r=document.createElement("span");r.textContent=n,r.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(r);}function ct(e=""){let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=e,n}function lr(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(r=>{let t=e.appendChild(ct(r)),o=/^\s+$/.test(r);return o?t.style.whiteSpace="pre":t.style.display="inline-block",o?null:t}).filter(r=>r!==null)}function Wr(e){let n=e.textContent??"";e.textContent="";let r=[],t=null;for(let o of n){let s=ct(o),a=o===" ";a?s.style.whiteSpace="pre":(s.style.display="inline-block",r.push(s)),a||o>"\u0DFF"?t=null:t||(t=e.appendChild(ct()),t.style.cssText="display:inline-block;white-space:nowrap"),(t??e).appendChild(s);}return r}function ar(e){let n=lr(e),r=new Map;for(let s of n){let a=s.offsetTop;r.has(a)||r.set(a,[]),r.get(a).push(s);}let t=[],o=Array.from(r.keys()).sort((s,a)=>s-a);for(let s of o){let a=r.get(s),u=ct();u.style.display="inline-block",a.forEach((f,m)=>{let g=f.nextElementSibling;u.appendChild(f),m<a.length-1&&g&&g.style.whiteSpace==="pre"&&u.appendChild(g);}),t.push(u);}return e.textContent="",t.forEach((s,a)=>{e.appendChild(s),a<t.length-1&&e.appendChild(document.createTextNode(" "));}),t}function zr(e,n,r,t){if(r<=1||t===0)return e;t=Math.min(t,1/r);let o=(r-1)*t,s=n*t,a=s+(1-o);return a<=s?e>=s?1:0:Ye((e-s)/(a-s),0,1)}function Gr(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 wt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function cr(e,n={}){if(typeof window>"u")return wt;let r=typeof e=="string"?document.querySelector(e):e;if(!r)return le("scrollText: element not found:",e),wt;let t=r;return He(n,(o,s)=>jr(t,o,s))}function jr(e,n,r){let{split:t="words",stagger:o=.04,easing:s="ease-out",from:a={opacity:0,y:24},trigger:u={},once:f=true,onComplete:m}=n,g=typeof s=="function"?s:Q[s]??Q["ease-out"],h=X(u.start||"top 85%"),b=X(u.end||"top 40%"),O=e.innerHTML,H=e.textContent??"",w;t==="chars"?w=Wr(e):t==="lines"?w=ar(e):w=lr(e),ir(e,H);let k=w.length;function ie(M,K){a?.opacity!==void 0&&(M.style.opacity=String(a.opacity+(1-a.opacity)*K));let v=Gr(K,a);v&&(M.style.transform=v);}function R(M){e.style.setProperty("--scroll-draw-progress",String(M)),w.forEach((K,v)=>{let $=g(zr(M,v,k,o));ie(K,$);});}if(r)return R(1),m?.(),{...wt,destroy:()=>{e.innerHTML=O;},getProgress:()=>1};R(0);let T=0,x=0,L=-1,y=0,S=false;function N(){({tStart:T,tEnd:x}=fe(e.getBoundingClientRect(),window.scrollY,window.innerHeight,h,b));}let Y=()=>V(window.scrollY,T,x,1);function _(){let M=f?L=Math.max(L,Y()):Y();y=M,R(M),M>=1&&!S?(S=true,m?.()):M<1&&!f&&(S=false);}N();let I=ve(window,[e],Y,_,()=>{t==="lines"&&(e.innerHTML=O,w=ar(e),ir(e,H),R(y)),N();});Ee(e,{type:"text",getProgress:()=>y,getTrigger:()=>({tStart:T,tEnd:x})});let W=()=>I.hold(false);return {destroy(){I.off(),e.innerHTML=O,Se(e);},replay(){L=-1,S=false,y=0,R(0),W();},pause:()=>I.hold(true),resume:W,seek(M){I.hold(true),R(y=L=Ye(M,0,1));},getProgress(){return y}}}function Qr(e,n={}){let[r,t]=Ur.useState(0),o=Ur.useRef(n);o.current=n;let s=Ur.useRef(0);return Ur.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){t(1);return}let a=typeof e=="string"?document.querySelector(e):e.current;if(!a)return;let u=a,{axis:f="y",scrollContainer:m,trigger:g={}}=o.current,h=typeof m=="string"?document.querySelector(m):m??null,b=X(g.start||"top bottom"),O=X(g.end||"bottom top"),H=0,w=0;function k(){return h?f==="x"?h.scrollLeft:h.scrollTop:f==="x"?window.scrollX:window.scrollY}function ie(){return h?f==="x"?h.clientWidth:h.clientHeight:f==="x"?window.innerWidth:window.innerHeight}function R(){let y=ze(u,h,f);({tStart:H,tEnd:w}=fe(y,y.scroll,ie(),b,O));}function T(){let{speed:y=1,easing:S="linear",once:N=false}=o.current,Y=typeof S=="function"?S:Q[S]??Q.linear,_=V(k(),H,w,y),I=Y(N?s.current=Math.max(s.current,_):_);t(I);}R();let x=ve(h??window,[u],()=>V(k(),H,w,Math.min(o.current.speed??1,1)),T,R),L=je(y=>{y&&(L(),x.off(),t(1));});return ()=>{L(),x.off();}},[]),r}function Je(e,n,r){let t=Ur.useRef(n);t.current=n;let o=Yt(n);Ur.useEffect(()=>{if(!e.current)return;let s=r(e.current,Xt(t.current,()=>t.current));return ()=>s.destroy()},[o]);}var Xr=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function Ze(e){let n={},r={};for(let[t,o]of Object.entries(e))(Xr.test(t)?r:n)[t]=o;return [n,r]}function So({children:e,className:n,style:r,...t}){let o=Ur.useRef(null),[s,a]=Ze(t);return Je(o,s,Qt),jsxRuntime.jsx("div",{ref:o,className:n,style:r,...a,children:e})}function To({children:e,className:n,style:r,...t}){let o=Ur.useRef(null),[s,a]=Ze(t);return Je(o,s,rr),jsxRuntime.jsx("div",{ref:o,className:n,style:r,...a,children:e})}function xo({className:e,style:n,...r}){let t=Ur.useRef(null),[o,s]=Ze(r);return Je(t,o,nr),jsxRuntime.jsx("span",{ref:t,className:e,style:n,...s})}function Mo({src:e,poster:n,className:r,style:t,muted:o=true,playsInline:s=true,...a}){let u=Ur.useRef(null),[f,m]=Ze(a);return Je(u,f,sr),jsxRuntime.jsx("video",{...m,ref:u,src:e,poster:n,className:r,style:t,muted:o,playsInline:s,preload:f.preload??"auto"})}function Po({children:e,as:n="p",className:r,style:t,...o}){let s=Ur.useRef(null),[a,u]=Ze(o);return Je(s,a,cr),Ur__default.default.createElement(n,{...u,ref:s,className:r,style:t},e)}exports.ScrollAnimate=To;exports.ScrollCounter=xo;exports.ScrollDraw=So;exports.ScrollText=Po;exports.ScrollVideo=Mo;exports.useScrollDrawProgress=Qr;
|
|
2
|
+
'use strict';var an=require('react'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var an__default=/*#__PURE__*/_interopDefault(an);var Ke=typeof __SVG_SCROLL_DRAW_DEV__<"u"?__SVG_SCROLL_DRAW_DEV__:typeof process<"u"&&typeof process.env<"u"&&process.env.NODE_ENV!=="production";function z(e,...n){Ke&&console.warn(`[svg-scroll-draw] ${e}`,...n);}function Lr({tension:e=2.5,friction:n=2.2}={}){return t=>1-Math.cos(t*Math.PI*e)*Math.pow(1-t,n)}function Cr({bounces:e=3,decay:n=.5}={}){let t=Math.max(1,Math.round(e)),r=Math.max(.01,Math.min(.99,n)),o=Math.sqrt(r),s=0,i=[];for(let p=0;p<t;p++){let y=Math.pow(o,p);i.push(y),s+=y;}let l=[0],c=0;for(let p=0;p<t;p++)c+=i[p]/s,l.push(c);return p=>{if(p<=0)return 0;if(p>=1)return 1;for(let y=0;y<t;y++)if(p<=l[y+1]){let v=(p-l[y])/(l[y+1]-l[y]);if(y===0)return v*(2-v);let S=1-Math.pow(r,y);return S+(1-S)*(2*v-1)*(2*v-1)}return 1}}function Ar({amplitude:e=1,period:n=.4}={}){let t=Math.max(1,e),r=Math.max(.1,n),o=t<=1?r/4:r/(2*Math.PI)*Math.asin(1/t);return s=>s<=0?0:s>=1?1:t*Math.pow(2,-10*s)*Math.sin((s-o)*(2*Math.PI)/r)+1}var Je={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:Lr(),bounce:Cr(),elastic:Ar()};function kr(e,n,t,r){let o=(s,i,l)=>((1+3*s-3*i)*l+3*i-6*s)*l*l+3*s*l;return s=>{if(s<=0||s>=1)return +(s>0);let i=s;for(let l=0;l<8;l++)i-=(o(e,t,i)-s)/((3*(1+3*e-3*t)*i+6*t-12*e)*i+3*e);if(!(i>=0&&i<=1&&Math.abs(o(e,t,i)-s)<1e-9))for(let l=0,c=0,p=1;l<30;l++)i=(c+p)/2,o(e,t,i)<s?c=i:p=i;return o(n,r,i)}}function xt(e){let n=/^cubic-bezier\((.*)\)$/.exec(e==="ease"?"cubic-bezier(.25,.1,.25,1)":e.trim()),t=n?n[1].split(",").map(parseFloat):[];if(t.length===4&&t.every(Number.isFinite)&&t[0]*(1-t[0])>=0&&t[2]*(1-t[2])>=0)return [kr(t[0],t[1],t[2],t[3]),`cubic-bezier(${t})`]}var It=new Set;function Le(e,n="linear"){if(typeof e=="function")return e;if(e==null)return Je[n];if({}.hasOwnProperty.call(Je,e))return Je[e];let t=xt(String(e));return t?t[0]:(!It.has(e)&&It.add(e)&&z(`Unknown easing ${JSON.stringify(e)}: use a name, cubic-bezier() or a function.`),Je[n])}function st(e,n,t){return Math.min(t,Math.max(n,e))}function ee(e="top bottom"){let n=e.trim();if(/^\d+(\.\d+)?%$/.test(n))return {element:"top",viewport:n};let[t="top",r="bottom"]=n.split(/\s+/).filter(Boolean);return {element:t,viewport:r}}var zt=(e,n)=>e==="top"?0:e==="center"?.5:e==="bottom"?1:n;function _t(e,n,t,r){return e+t+n*zt(r,0)}function Vt(e,n){return n*(/^\d+(\.\d+)?%$/.test(e)?parseFloat(e)/100:zt(e,1))}function j(e,n,t,r){return t===n?0:st((e-n)/(t-n)*r,0,1)}function he(e,n,t,r,o){let s=_t(e.top,e.height,n,r.element)-Vt(r.viewport,t),i=_t(e.top,e.height,n,o.element)-Vt(o.viewport,t);return {tStart:s,tEnd:i}}function Ze(e,n,t){let r=e.getBoundingClientRect(),o=t==="x"?r.width:r.height;return n?{top:t==="x"?r.left-n.getBoundingClientRect().left-n.clientLeft+n.scrollLeft:r.top-n.getBoundingClientRect().top-n.clientTop+n.scrollTop,height:o,scroll:0}:{top:t==="x"?r.left:r.top,height:o,scroll:t==="x"?window.scrollX:window.scrollY}}function mt(e){let n=parseFloat(e.getAttribute("pathLength")??"");if(n>0)return n;let t=e.tagName.toLowerCase();if(t==="rect"){let r=parseFloat(e.getAttribute("width")??"0"),o=parseFloat(e.getAttribute("height")??"0");return 2*(r+o)}if(t==="circle"){let r=parseFloat(e.getAttribute("r")??"0");return 2*Math.PI*r}return e.getTotalLength()}function pt(e){return `${e} ${e*2}`}function Wt(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 t=/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(t)return [parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)];let r=/^rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i.exec(e);return r?[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])]:null}function dt(e,n,t){let r=Wt(e),o=Wt(n);return !r||!o?e:`rgb(${Math.round(r[0]+(o[0]-r[0])*t)},${Math.round(r[1]+(o[1]-r[1])*t)},${Math.round(r[2]+(o[2]-r[2])*t)})`}var Gt={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 Or="cubic-bezier(0.333333, 0, 0.666667, 0.333333)",$r="cubic-bezier(0.333333, 0.666667, 0.666667, 1)",Bt=33;function Rr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timing-function: linear(0, 1)")}function Fr(e){let n=[];for(let t=0;t<Bt;t++){let r=t/(Bt-1);n.push(String(Math.round(e(r)*1e5)/1e5));}return `linear(${n.join(",")})`}function gt(e){switch(e){case "linear":return "linear";case "ease-in":return Or;case "ease-out":return $r;case "ease-in-out":return Rr()?Fr(Je["ease-in-out"]):null;default:return xt(e)?.[1]??null}}var jt=Symbol.for("svg-scroll-draw.registry");function qt(){let e=globalThis;return e[jt]||(e[jt]=new Map)}function $e(e,n){qt().set(e,n);}function Re(e){qt().delete(e);}function Be(e){if(typeof window>"u"||typeof window.matchMedia!="function")return ()=>{};let n=window.matchMedia("(prefers-reduced-motion: reduce)"),t=o=>e(!!o.matches);if(typeof n.addEventListener=="function")return n.addEventListener("change",t),()=>n.removeEventListener("change",t);let r=n;return r.addListener?.(t),()=>r.removeListener?.(t)}function je(e,n){if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return n(e,true);let t=n(e,false),r=Be(s=>{if(!s)return;r();let i=(t.getProgress?.()??0)>=1;t.destroy(),t=n(i?{...e,onComplete:void 0}:e,true);}),o={};for(let s of Object.keys(t))o[s]=(...i)=>t[s]?.(...i);return o.destroy=()=>{r(),t.destroy();},o}var it,ht=new Set,yt=new WeakMap,at=new Map,Ut=e=>{let n=e.getBoundingClientRect();return n.width+" "+n.height};function Hr(e){let n=new Set;for(let t of e)for(;t&&t!==document.body;t=t.parentElement)for(let r=t;r;r=r.previousElementSibling)n.add(r);return n}function Yt(e,n){if(typeof ResizeObserver>"u"||typeof document>"u")return ()=>{};let t=()=>n();it??(it=new ResizeObserver(o=>{let s=false;for(let{target:i}of o)yt.get(i)!==Ut(i)&&(s=true),yt.set(i,"");s&&ht.forEach(i=>i());})),ht.add(t);let r=Hr(e);return [document.body,document.documentElement].forEach(o=>o&&r.add(o)),r.forEach(o=>{yt.has(o)||yt.set(o,Ut(o)),at.set(o,(at.get(o)??0)+1),it.observe(o);}),()=>{ht.delete(t)&&(r.forEach(o=>{let s=(at.get(o)??1)-1;if(s)return void at.set(o,s);at.delete(o),it?.unobserve(o);}),ht.size||(it?.disconnect(),it=void 0));}}function Ce(e,n,t,r,o){let s,i=NaN,l,c,p=()=>{s=0,r(),!l&&!s&&(i=t())>0&&i<1&&(s=requestAnimationFrame(p));},y=()=>{!s&&!l&&t()!==i&&(s=requestAnimationFrame(p));},v=R=>{l=R,cancelAnimationFrame(s),s=i=NaN,y();},S=()=>{clearTimeout(c),o(),y();},W=()=>{clearTimeout(c),c=setTimeout(S,150);},B=Yt(n,W),b=R=>{e[R]("scroll",y,{passive:true}),window[R]("resize",W),window[R]("orientationchange",W);};return b("addEventListener"),y(),{hold:v,remeasure:S,off(){v(true),b("removeEventListener"),B(),clearTimeout(c);}}}var Nr=0;function Dr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")&&CSS.supports("view-timeline-name: --x")}function Qt(e,n){let t="";try{t=getComputedStyle(e).getPropertyValue(n).trim();}catch{}return t||(e.getAttribute(n)??"").trim()}var Xt=new Set(["","none","transparent","rgba(0, 0, 0, 0)"]);function Ir(e){if(!Ke)return;let n=Qt(e,"stroke");if(!n||n==="none"){z("Element has no stroke \u2014 path will not be visible.",e);return}let t=(e.getAttribute("fill")??"").trim();t&&!Xt.has(t)&&!Xt.has(Qt(e,"fill"))&&z("Element has a fill \u2014 it may obscure the stroke animation.",e);}function _r(e,n,t){let r=document.createElement("div");r.setAttribute("data-svg-scroll-draw-debug",""),r.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=t==="x"?window.scrollX:window.scrollY,i=e-s,l=n-s,c=t==="x";r.innerHTML=`
|
|
3
|
+
<div style="position:absolute;${c?`left:${i}px;top:0;bottom:0;border-left:2px dashed #22c55e;`:`top:${i}px;left:0;right:0;border-top:2px dashed #22c55e;`}padding:2px 6px;color:#22c55e;background:rgba(0,0,0,.6)">\u25B6 start</div>
|
|
4
|
+
<div style="position:absolute;${c?`left:${l}px;top:0;bottom:0;border-left:2px dashed #ef4444;`:`top:${l}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(r),window.addEventListener("scroll",o,{passive:true}),o(),{el:r,destroy(){window.removeEventListener("scroll",o),r.remove();}}}var Kt=/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,Jt=/[MmLlHhVvCcSsQqTtAaZz]/g;function Vr(e,n,t){if(!Ke)return;let r=(e.match(Jt)??[]).join("").toUpperCase(),o=(n.match(Jt)??[]).join("").toUpperCase(),s=(e.match(Kt)??[]).length,i=(n.match(Kt)??[]).length;if(r!==o){z(`morphTo: command sequence differs (${r||"\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.`,t);return}s!==i&&z(`morphTo: coordinate count differs (${s} \u2192 ${i}). Extra coordinates are ignored and missing ones hold their start value, so the result will not reach the target shape.`,t);}function zr(e,n,t){let r=(n.match(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g)??[]).map(Number),o=0;return e.replace(/[-+]?(?:\d*\.)?\d+(?:[eE][-+]?\d+)?/g,s=>{let i=parseFloat(s),l=r[o++]??i;return String(+(i+(l-i)*t).toFixed(4))})}function Zt(e,n={}){return typeof window>"u"?{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0}:je(n,(t,r)=>Wr(e,t,r))}function Wr(e,n,t){let{preset:r,...o}=n,s=r?{...Gt[r],...o}:o,{selector:i="path, polyline, line, polygon, rect, circle",speed:l=1,fade:c=false,easing:p="linear",trigger:y={},stagger:v=0,direction:S="forward",once:W=false,debug:B=false,axis:b="y",scrollContainer:R,autoReverse:K=false,delay:k=0,strokeColor:C,strokeWidth:x,fillOpacity:O,waypoints:h,velocityScale:$=false,threshold:D=0,rootMargin:te="0px",repeat:q=0,repeatDelay:F=0,morphTo:I,clip:M,autoplay:J=false,duration:T=1e3,native:A=true,onProgress:ye,onStart:_,onComplete:Y,onEnter:ue,onLeave:Se,onEnterBack:fe,onLeaveBack:ae}=s,P=M===true?"left":typeof M=="string"?M:false,L=Le(p),oe=ee(y.start||"top bottom"),Fe=ee(y.end||"bottom top"),Z=typeof R=="string"?document.querySelector(R):R??null,He=Array.isArray(C)?C[0]:null,Te=Array.isArray(C)?C[1]:typeof C=="string"?C:null,be=Array.isArray(x)?x[0]:null,_e=Array.isArray(x)?x[1]:typeof x=="number"?x:null,Ne=Array.isArray(O)?O[0]:null,xe=Array.isArray(O)?O[1]:typeof O=="number"?O:null;function Ae(a){let m=a*100;switch(P){case "right":return `inset(0 0 0 ${100-m}%)`;case "top":return `inset(0 0 ${100-m}% 0)`;case "bottom":return `inset(${100-m}% 0 0 0)`;case "center":return `circle(${a*150}% at 50% 50%)`;default:return `inset(0 ${100-m}% 0 0)`}}let u=P?[]:Array.from(e.querySelectorAll(i)),g=[],se=[],H=0,G=0,U=v,Q=0,Ie=0,ie=false,De=false,we=0,Qe=-1,qe=[],Ue=-1,me=false,f=0,d=0,E,le=false,ve=null;function Ve(){ve?.destroy(),ve=null;}let ke=new Set,ze=NaN,We=true,ut=-1,Lt=performance.now(),Xe=NaN;function ft(){return Z?b==="x"?Z.scrollLeft:Z.scrollTop:b==="x"?window.scrollX:window.scrollY}function Ct(){return Z?b==="x"?Z.clientWidth:Z.clientHeight:b==="x"?window.innerWidth:window.innerHeight}function At(){let a=Ze(e,Z,b);return he(a,a.scroll,Ct(),oe,Fe)}function vr(){let a=G-H,m=u.length-1,w=Z??document.documentElement,V=b==="x"?"Width":"Height";if(U=v,v>0&&m>0&&a>0){let pe=w[`scroll${V}`]-w[`client${V}`]-1-H-a/l;pe>=0&&(U=Math.min(v,pe/(m*a)));}let ce=Math.max(0,m)*U*a,Me=a/Math.min(l,1);Q=H+Math.min(0,ce,Me,ce+Me),Ie=H+Math.max(0,ce,Me,ce+Me);}function kt(){(({tStart:H,tEnd:G}=At())),vr(),B&&Ke&&(Ve(),ve=_r(H,G,b));}function vt(a,m=At){$e(e,{type:"draw",getProgress:()=>a.getProgress(),getTrigger:m});let w=a.destroy;return a.destroy=()=>{w.call(a),Re(e);},a}function Ot(a,m){return W&&!K?Math.max(Qe,L(qe[a]=Math.max(qe[a]??0,m))):L(m)}function Er(a,m){if(e.style.setProperty("--scroll-draw-progress",String(a)),P){let w=m==="reverse"?1-a:a;e.style.clipPath=Ae(w);return}u.forEach((w,V)=>Et(w,V,a,m));}function Et(a,m,w,V){a.style.strokeDashoffset=V==="reverse"?`${g[m]*w}`:`${g[m]*(1-w)}`,c&&(a.style.opacity=V==="reverse"?`${1-w}`:`${w}`),He&&Te?a.style.stroke=dt(He,Te,w):Te&&(a.style.stroke=Te),be!==null&&_e!==null?a.style.strokeWidth=`${be+(_e-be)*w}`:_e!==null&&(a.style.strokeWidth=`${_e}`),Ne!==null&&xe!==null?a.style.fillOpacity=`${Ne+(xe-Ne)*w}`:xe!==null&&(a.style.fillOpacity=`${xe}`),I&&a.tagName.toLowerCase()==="path"&&se[m]&&a.setAttribute("d",zr(se[m],I,w));}function St(){if(e.style.setProperty("--scroll-draw-progress","0"),P){e.style.clipPath=Ae(S==="reverse"?1:0);return}u.forEach((a,m)=>{a.style.strokeDasharray=pt(g[m]),a.style.strokeDashoffset=S==="reverse"?"0":`${g[m]}`,c?a.style.opacity=S==="reverse"?"1":"0":a.style.opacity="",He&&(a.style.stroke=He),be!==null&&(a.style.strokeWidth=`${be}`),Ne!==null&&(a.style.fillOpacity=`${Ne}`),I&&a.tagName.toLowerCase()==="path"&&se[m]&&a.setAttribute("d",se[m]);});}function rt(a,m){let w=a.getAttribute("d"),V=mt(a);if(I&&se[m]){a.setAttribute("d",I);let ce=mt(a);a.setAttribute("d",se[m]),V=Math.max(mt(a),ce),a.setAttribute("d",w);}g[m]=V,a.style.strokeDasharray=pt(V);}if(u.forEach((a,m)=>{Ir(a);let w=a.tagName.toLowerCase()==="path";w?se.push(a.getAttribute("d")??""):se.push(""),rt(a,m);let V=g[m];I&&(w?Vr(se[se.length-1],I,a):z(`morphTo only applies to <path> elements \u2014 ignored on <${a.tagName}>.`,a)),t?(a.style.strokeDashoffset=S==="reverse"?`${V}`:"0",c&&(a.style.opacity="1"),Te&&(a.style.stroke=Te),_e!==null&&(a.style.strokeWidth=`${_e}`),xe!==null&&(a.style.fillOpacity=`${xe}`),I&&a.tagName.toLowerCase()==="path"&&a.setAttribute("d",I)):(a.style.strokeDashoffset=S==="reverse"?"0":`${V}`,c?a.style.opacity=S==="reverse"?"1":"0":a.style.opacity="",He&&(a.style.stroke=He),be!==null&&(a.style.strokeWidth=`${be}`),Ne!==null&&(a.style.fillOpacity=`${Ne}`));}),t)return P&&(e.style.clipPath=Ae(1)),Y?.(),{destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};P&&(e.style.clipPath=Ae(S==="reverse"?1:0));let $t=typeof p=="string"?gt(p):null;function Sr(){return !(A===false||J||B&&Ke||!Dr()||!u.length||!$t||P||b!=="y"||Z||l!==1||v!==0||W||K||$!==false||I||h||q||k>0||ye||_||Y||ue||Se||fe||ae||C!=null||x!=null||O!=null||(y.start||"top bottom").trim()!=="top bottom"||(y.end||"bottom top").trim()!=="bottom top")}function Tr(){let a=++Nr,m=`svg-scroll-draw-${a}`,w=`svg-scroll-draw-host-${a}`,V=`--svg-scroll-draw-${a}`,ce=S==="reverse"?"0":"var(--ssd-len)",Me=S==="reverse"?"var(--ssd-len)":"0",pe=`stroke-dashoffset:${ce};`,re=`stroke-dashoffset:${Me};`;c&&(pe+=`opacity:${S==="reverse"?1:0};`,re+=`opacity:${S==="reverse"?0:1};`);let ne=document.createElement("style");ne.setAttribute("data-svg-scroll-draw",""),ne.textContent=`@keyframes ${m}{from{${pe}}to{${re}}}.${w}{view-timeline-name:${V};view-timeline-axis:block;}.${m}{animation-name:${m};animation-duration:auto;animation-timing-function:${$t};animation-fill-mode:both;animation-timeline:${V};animation-range:cover 0% cover 100%;}`,document.head.appendChild(ne),e.classList.add(w);function Ee(N,X){N.style.setProperty("--ssd-len",String(g[X])),N.style.strokeDasharray=pt(g[X]),N.style.strokeDashoffset="",N.style.opacity="",N.style.animationPlayState="",N.classList.add(m);}u.forEach(Ee);let de=false,Pe=-1;function Oe(){if(Pe>=0)return Pe;let N=e.getBoundingClientRect(),{tStart:X,tEnd:ge}=he({top:N.top,height:N.height},ft(),Ct(),oe,Fe);return L(j(ft(),X,ge,l))}return {destroy(){e.classList.remove(w),u.forEach(N=>{N.classList.remove(m),N.style.removeProperty("--ssd-len"),N.style.animationPlayState="";}),ne.remove();},replay(){de=false,Pe=-1,u.forEach(Ee);},pause(){de=true,u.forEach(N=>{N.style.animationPlayState="paused";});},resume(){de&&(de=false,u.forEach(N=>{N.style.animationPlayState="running";}));},seek(N){let X=Math.min(1,Math.max(0,N));Pe=X,de=true,u.forEach((ge,Ge)=>{ge.classList.remove(m),ge.style.strokeDashoffset=S==="reverse"?`${g[Ge]*X}`:`${g[Ge]*(1-X)}`,c&&(ge.style.opacity=S==="reverse"?`${1-X}`:`${X}`);});},getProgress(){return Oe()},refresh(){u.forEach((N,X)=>{rt(N,X),N.style.setProperty("--ssd-len",String(g[X]));});}}}if(Sr())return vt(Tr());function xr(){let a=Math.max(1,T),m=P?a:a*(1+Math.max(0,u.length-1)*v),w=0,V=0,ce=false;function Me(Pe){let Oe=true,N=Math.min(1,Math.max(0,Pe/m));if(P){let X=Math.min(1,Math.max(0,Pe/a)),ge=L(X);f=ge,e.style.setProperty("--scroll-draw-progress",String(ge)),e.style.clipPath=Ae(S==="reverse"?1-ge:ge),ye?.(ge),X<1&&(Oe=false);}else {u.forEach((ge,Ge)=>{let Pr=Ge*v*a,Dt=Math.min(1,Math.max(0,(Pe-Pr)/a));Et(ge,Ge,L(Dt),S),Dt<1&&(Oe=false);});let X=L(N);f=X,ye?.(X),e.style.setProperty("--scroll-draw-progress",String(X));}if(h){let X=L(N);for(let ge in h){let Ge=parseFloat(ge);X>=Ge&&!ke.has(Ge)&&(ke.add(Ge),h[ge]?.());}}return Oe}function pe(Pe){if(me)return;let Oe=Pe-w;De||(De=true,_?.());let N=Me(Oe);if(N&&!ie){ie=true,Me(m),Y?.(),d<(q==="infinite"?1/0:q??0)&&(d++,E=setTimeout(()=>{w=performance.now(),De=false,ie=false,ke.clear(),St(),we=requestAnimationFrame(pe);},F));return}N||(we=requestAnimationFrame(pe));}function re(){cancelAnimationFrame(we),clearTimeout(E),w=performance.now(),V=0,me=false,De=false,ie=false,d=0,ce=true,f=0,ke.clear(),St(),we=requestAnimationFrame(pe);}let ne=new IntersectionObserver(Pe=>{Pe.forEach(Oe=>{Oe.isIntersecting&&!(W&&ie)?re():!Oe.isIntersecting&&!W&&!ie&&(cancelAnimationFrame(we),clearTimeout(E),ce=false);});},{root:Z??null,threshold:D,rootMargin:te}),Ee;function de(){clearTimeout(Ee),Ee=setTimeout(()=>u.forEach(rt),150);}return window.addEventListener("resize",de),window.addEventListener("orientationchange",de),k>0?setTimeout(()=>ne.observe(e),k):ne.observe(e),{destroy(){cancelAnimationFrame(we),clearTimeout(E),ne.disconnect(),window.removeEventListener("resize",de),window.removeEventListener("orientationchange",de),clearTimeout(Ee);},replay(){d=0,re();},pause(){me||!ce||(me=true,V=performance.now()-w,cancelAnimationFrame(we));},resume(){me&&(me=false,ce=true,w=performance.now()-V,we=requestAnimationFrame(pe));},seek(Pe){let Oe=Math.min(1,Math.max(0,Pe));f=Oe,me=true,V=Oe*m,w=performance.now()-V,cancelAnimationFrame(we),Me(V);},getProgress(){return f},refresh(){clearTimeout(Ee),u.forEach(rt);}}}if(J)return vt(xr());kt();let Rt=()=>j(ft(),Q,Ie,1);function Ft(){ie=true,Y?.(),d<(q==="infinite"?1/0:q)&&(d++,E=setTimeout(()=>{le=true;},F));}function Ht(){Qe=-1,qe=[],De=false,ie=false,le=false,ke.clear(),St(),We=true;}function Mr(){let a=performance.now(),m=ft();if(le&&Rt()%1&&Ht(),!We&&$===false&&m===ze)return;We=false,ze=m;let w=l;if($!==false){let re=a-Lt,ne=re>0?Math.abs(m-(ut<0?m:ut))/re:0;w=l*Math.max(.2,1+ne*(typeof $=="number"?$:1)*.04);}ut=m,Lt=a;let V=K?Ue===-1||m>=Ue?"forward":"reverse":S;Ue=m;let ce=G-H,Me=true,pe=ce===0?0:(m-H)/ce;if(isNaN(Xe)||(Xe<=0&&pe>0&&ue?.(),Xe<1&&pe>=1&&Se?.(),Xe>=1&&pe<1&&fe?.(),Xe>0&&pe<=0&&ae?.()),Xe=pe,P){let re=Ot(0,j(m,H,G,w));f=re,e.style.setProperty("--scroll-draw-progress",String(re));let ne=V==="reverse"?1-re:re;e.style.clipPath=Ae(ne),ye?.(re),!De&&j(m,H,G,w)>0&&(De=true,_?.()),re>=1&&!ie?Ft():re<1&&!W&&(ie=false);return}if(u.forEach((re,ne)=>{let Ee=ne*U*ce,de=Ot(ne,j(m,H+Ee,G+Ee,w));Et(re,ne,de,V),ne===0&&(f=de,ye?.(de),e.style.setProperty("--scroll-draw-progress",String(de))),de<1&&(Me=false);}),h){let re=L(j(m,H,G,w));for(let ne in h){let Ee=parseFloat(ne);re>=Ee&&!ke.has(Ee)&&(ke.add(Ee),h[ne]?.());}}!De&&j(m,H,G,w)>0&&(De=true,_?.()),Me&&!ie?Ft():!Me&&!W&&(ie=false);}let nt=Ce(Z??window,[e],Rt,Mr,()=>{let a=g.join();u.forEach(rt),kt(),We=true,g.join()!==a&&ot();}),Tt=k>0;function ot(){nt.hold(me||Tt);}let Nt;return Tt&&(Nt=setTimeout(()=>{Tt=false,ot();},k)),ot(),vt({destroy(){clearTimeout(E),clearTimeout(Nt),nt.off(),Ve();},replay(){Ht(),Ue=-1,ut=-1,d=0,me=false,f=0,clearTimeout(E),ot();},pause(){me=true,nt.hold(true);},resume(){me&&(me=false,We=true,ot());},seek(a){let m=Math.min(1,Math.max(0,a));f=m,Qe=m,qe=[],me=true,nt.hold(true),Er(m,S),We=true;},getProgress(){return f},refresh:nt.remeasure},()=>({tStart:H,tEnd:G}))}var er=new WeakMap,Gr=0;function lt(e){return JSON.stringify(e,(n,t)=>{if(typeof t=="function")return "\u0192";if(typeof Element<"u"&&t instanceof Element){let r=er.get(t);return r===void 0&&er.set(t,r=++Gr),`el#${r}`}return t})}function tr(e,n){let t={...e};for(let r of Object.keys(t))typeof t[r]=="function"&&(t[r]=(...o)=>n()[r]?.(...o));return t}function Br(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function rr(e){let n=[],t=/([\w]+)\(([^)]*)\)/g,r;for(;(r=t.exec(e))!==null;){let o=[],s=[],i=r[2].trim();if(i)for(let l of i.split(/[\s,]+/)){let c=l.match(/^([-+]?[\d.eE]+)(.*)$/);o.push(c?parseFloat(c[1]):0),s.push(c?c[2]:"");}n.push({fn:r[1],nums:o,units:s});}return n}function jr(e,n,t){let r=rr(e),o=rr(n);return r.length===0||r.length!==o.length?t<1?e:n:r.map((s,i)=>{let l=o[i];return s.fn!==l.fn||s.nums.length!==l.nums.length?t<1?`${s.fn}(${s.nums.map((c,p)=>`${c}${s.units[p]}`).join(", ")})`:`${l.fn}(${l.nums.map((c,p)=>`${c}${l.units[p]}`).join(", ")})`:`${s.fn}(${s.nums.map((c,p)=>`${c+(l.nums[p]-c)*t}${s.units[p]}`).join(", ")})`}).join(" ")}function nr(e,n,t){if(typeof e=="number"&&typeof n=="number")return String(e+(n-e)*t);let r=String(e),o=String(n);if(Br(r))return dt(r,o,t);if(r.includes("("))return jr(r,o,t);let s=r.match(/^([-+]?[\d.]+)(.*)$/),i=o.match(/^([-+]?[\d.]+)(.*)$/);if(s&&i){let l=parseFloat(s[1]),c=parseFloat(i[1]);return `${l+(c-l)*t}${s[2]||i[2]}`}return t<1?r:o}function qr(e){return e.replace(/([A-Z])/g,n=>`-${n.toLowerCase()}`)}var Ur=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Yr=0,or="--scroll-draw-progress";function Qr(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var ir={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ar(e,n){return typeof window>"u"?ir:n.respectReducedMotion===false?sr(e,n,false):je(n,(t,r)=>sr(e,t,r))}function sr(e,n,t){let{props:r,trigger:o={},easing:s="ease-out",speed:i=1,once:l=false,axis:c="y",scrollContainer:p,native:y=true,velocityScale:v=false,triggerElement:S,onProgress:W,onComplete:B,onEnter:b,onLeave:R,onEnterBack:K,onLeaveBack:k}=n,C=Le(s,"ease-out"),x=ee(o.start||"top bottom"),O=ee(o.end||"bottom top"),h=S??e,$=typeof p=="string"?document.querySelector(p):p??null,D=Object.entries(r).map(([u,g])=>({prop:qr(u),from:Array.isArray(g)?g[0]:"",to:Array.isArray(g)?g[1]:g}));function te(){let u=window.getComputedStyle(e);for(let g of D)g.from===""&&(g.from=u.getPropertyValue(g.prop).trim()||"0");}function q(){for(let u of D)e.style.setProperty(u.prop,String(u.to));}let F=new Map;for(let u of [...D.map(g=>g.prop),or])F.set(u,e.style.getPropertyValue(u));function I(){for(let[u,g]of F)g?e.style.setProperty(u,g):e.style.removeProperty(u);}if(t)return q(),B?.(),{...ir,destroy:I,getProgress:()=>1};te();let M=()=>$?c==="x"?$.scrollLeft:$.scrollTop:c==="x"?window.scrollX:window.scrollY,J=()=>$?c==="x"?$.clientWidth:$.clientHeight:c==="x"?window.innerWidth:window.innerHeight,T=typeof s=="string"?gt(s):null;function A(){if(!y||!Qr()||!T||c!=="y"||$||h!==e||l||i!==1||W||B||b||R||K||k||v!==false||(o.start||"top bottom").trim()!=="top bottom"||(o.end||"bottom top").trim()!=="bottom top")return false;for(let u of D)if(!Ur.has(u.prop))return false;return true}function ye(){let u=`ssd-a-${++Yr}`,g=D.map(Q=>`${Q.prop}:${Q.from}`).join(";"),se=D.map(Q=>`${Q.prop}:${Q.to}`).join(";"),H=document.createElement("style");H.setAttribute("data-ssd-animate",""),H.textContent=`@keyframes ${u}{from{${g}}to{${se}}}.${u}{animation-name:${u};animation-duration:auto;animation-timing-function:${T};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(H),e.classList.add(u);let G=()=>{let Q=e.getBoundingClientRect();return he({top:Q.top,height:Q.height},M(),J(),x,O)};$e(e,{type:"animate",getProgress:()=>U.getProgress(),getTrigger:G});let U={refresh(){},destroy(){e.classList.remove(u),H.remove(),e.style.animationPlayState="",I(),Re(e);},replay(){e.classList.remove(u),e.offsetWidth,e.classList.add(u);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(Q){let Ie=Math.min(1,Math.max(0,Q));e.classList.remove(u);for(let ie of D)e.style.setProperty(ie.prop,nr(ie.from,ie.to,Ie));},getProgress(){let{tStart:Q,tEnd:Ie}=G();return C(j(M(),Q,Ie,i))}};return U}if(A())return ye();let _=0,Y=0,ue=false,Se=-1,fe=0,ae=0,P=false,L=NaN,oe=-1,Fe=0,Z=h===e?D:[],He=false;function Te(){let u=e.style,g=Z.map(U=>u.getPropertyValue(U.prop)),se=u.transition;Z.length&&(u.transition="none"),Z.forEach(U=>u.setProperty(U.prop,F.get(U.prop)??""));let H=Ze(h,$,c);Z.forEach((U,Q)=>u.setProperty(U.prop,g[Q])),Z.length&&(e.offsetWidth,u.transition=se);let G=he(H,H.scroll,J(),x,O);He&&Math.abs(G.tStart-_)<1&&Math.abs(G.tEnd-Y)<1||(He=true,_=G.tStart,Y=G.tEnd);}function be(u){e.style.setProperty(or,String(u));for(let g of D)e.style.setProperty(g.prop,nr(g.from,g.to,u));W?.(u);}function _e(u){if(isNaN(L)){L=u;return}L<=0&&u>0&&b?.(),L<1&&u>=1&&R?.(),L>=1&&u<1&&K?.(),L>0&&u<=0&&k?.(),L=u;}function Ne(){if(ue)return;let u=performance.now(),g=M(),se=i;if(v!==false){let Q=u-Fe,Ie=Q>0?Math.abs(g-(oe<0?g:oe))/Q:0;se=i*Math.max(.2,1+Ie*(typeof v=="number"?v:1)*.04);}oe=g,Fe=u;let H=Y===_?0:(g-_)/(Y-_);_e(H);let G=j(g,_,Y,se),U=l?Math.max(Se,C(fe=Math.max(fe,G))):C(G);ae=U,be(U),U>=1&&!P?(P=true,B?.()):U<1&&!l&&(P=false);}let xe=Ce($??window,[h],()=>j(M(),_,Y,Math.min(i,1)),Ne,Te);Te(),Y===_&&z("scrollAnimate: zero-length trigger window, so it never animates. In a sticky stage, set triggerElement.",e),fe=j(M(),_,Y,i),ae=C(fe),be(ae),$e(e,{type:"animate",getProgress:()=>ae,getTrigger:()=>({tStart:_,tEnd:Y})});function Ae(){ue=true,xe.hold(true);}return {destroy(){ue=true,xe.off(),I(),Re(e);},replay(){Se=-1,fe=0,P=false,ae=0,ue=false,be(0),xe.hold(false);},pause:Ae,resume(){ue&&(ue=false,xe.hold(false));},seek(u){let g=Math.min(1,Math.max(0,u));ae=g,Se=g,fe=0,Ae(),be(g);},getProgress(){return ae},refresh:xe.remeasure}}var Mt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function lr(e,n){if(typeof window>"u")return Mt;let t=typeof e=="string"?document.querySelector(e):e;return t?je(n,(r,o)=>Xr(t,r,o)):(z("scrollCounter: element not found:",e),Mt)}function Xr(e,n,t){let{from:r=0,to:o,format:s,easing:i="ease-out",trigger:l={},once:c=true,decimals:p,onComplete:y}=n,v=p!==void 0?T=>T.toFixed(p):s??(T=>String(Math.round(T))),S=Le(i,"ease-out"),W=ee(l.start||"top 80%"),B=ee(l.end||"top 20%");if(t)return e.textContent=v(o),y?.(),{...Mt,getProgress:()=>1};let b=0,R=0,K=false,k=-1,C=0,x=0,O=false,h=()=>window.scrollY,$=()=>window.innerHeight;function D(){let T=e.getBoundingClientRect(),A=he({top:T.top,height:T.height},h(),$(),W,B);K&&Math.abs(A.tStart-b)<1&&Math.abs(A.tEnd-R)<1||(K=true,b=A.tStart,R=A.tEnd);}let te=e.style.getPropertyValue("--scroll-draw-progress");function q(T){e.textContent=v(r+(o-r)*T),e.style.setProperty("--scroll-draw-progress",String(T));}let F=()=>j(h(),b,R,1);function I(){let T=F(),A=c?Math.max(k,S(C=Math.max(C,T))):S(T);x=A,q(A),A>=1&&!O?(O=true,y?.()):A<1&&!c&&(O=false);}D();{C=j(h(),b,R,1);let T=S(C);x=T,q(T);}let M=Ce(window,[e],F,I,D);$e(e,{type:"counter",getProgress:()=>x,getTrigger:()=>({tStart:b,tEnd:R})});let J=()=>M.hold(false);return {destroy(){M.off(),e.style.setProperty("--scroll-draw-progress",te),Re(e);},replay(){k=-1,C=0,O=false,x=0,q(0),J();},pause:()=>M.hold(true),resume:J,seek(T){let A=Math.min(1,Math.max(0,T));x=A,k=A,C=0,M.hold(true),q(A);},getProgress(){return x}}}var cr={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function ur(e,n={}){if(typeof window>"u")return cr;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="video")return z("scrollVideo: <video> element not found:",e),cr;let r=t,{trigger:o={},easing:s="linear",once:i=false,axis:l="y",preload:c="auto",triggerElement:p,onReady:y,onComplete:v,onProgress:S}=n,W=p??r,B=window.matchMedia("(prefers-reduced-motion: reduce)").matches,b=Le(s),R=ee(o.start||"top top"),K=ee(o.end||"bottom top");r.pause(),r.hasAttribute("preload")||(r.preload=c);let k=n.from??0,C=n.to,x=0,O=0,h=false,$=-1,D=0,te=0,q=false,F=false,I=()=>l==="x"?window.scrollX:window.scrollY,M=()=>l==="x"?window.innerWidth:window.innerHeight;function J(){let P=W.getBoundingClientRect(),L=l==="x"?P.left:P.top,oe=l==="x"?P.width:P.height,Fe=he({top:L,height:oe},I(),M(),R,K);x=Fe.tStart,O=Fe.tEnd,F&&O===x&&z("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r);}let T=NaN;function A(P){if(!F)return;let L=C??r.duration??0,oe=k+(L-k)*P;oe!==T&&(T=oe,r.currentTime=oe),r.style.setProperty("--scroll-draw-progress",String(P)),S?.(P);}let ye=()=>j(I(),x,O,1);function _(){if(!F||B)return;let P=ye(),L=i?Math.max($,b(D=Math.max(D,P))):b(P);te=L,A(L),L>=1&&!q?(q=true,v?.()):L<1&&!i&&(q=false);}let Y=Ce(window,[W],ye,_,J),ue=()=>Y.hold(h||!F||B);ue();function Se(){if(F=true,C===void 0&&(C=r.duration),B){A(1),y?.();return}J(),y?.(),h?A(te):ue();}r.readyState>=1?Se():r.addEventListener("loadedmetadata",Se,{once:true}),F||J();let fe=B?()=>{}:Be(P=>{P&&(fe(),B=true,Y.hold(true),A(1));});$e(r,{type:"video",getProgress:()=>te,getTrigger:()=>({tStart:x,tEnd:O})});function ae(){h&&(h=false,ue());}return {destroy(){Y.off(),r.removeEventListener("loadedmetadata",Se),fe(),Re(r);},replay(){$=-1,D=0,q=false,te=0,T=NaN,A(0),ae();},pause(){h=true,Y.hold(true);},resume:ae,seek(P){let L=Math.min(1,Math.max(0,P));te=L,$=L,D=0,h=true,Y.hold(true),T=NaN,A(L);},getProgress(){return te}}}var bt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function Kr(e){let n=e>1?[0,e-1]:[0],t=[[0,e-1]];for(let r=0;r<t.length;r++){let[o,s]=t[r];if(s-o<2)continue;let i=o+s>>1;n.push(i),t.push([o,i],[i,s]);}return n}function fr(e,n){if(typeof window>"u")return bt;let t=typeof e=="string"?document.querySelector(e):e;if(!t||t.tagName.toLowerCase()!=="canvas")return z("scrollFrames: <canvas> element not found:",e),bt;let r=t,{frames:o,trigger:s={},easing:i="linear",once:l=false,axis:c="y",fit:p="cover",triggerElement:y,onReady:v,onLoad:S,onComplete:W,onProgress:B}=n||{},b=Array.isArray(o)?o:null,R=n?.count,K=Math.floor(b?Math.min(R??b.length,b.length):R??NaN);if(!(b||typeof o=="function")||!Number.isFinite(K)||K<1)return z("scrollFrames: no frames. Pass `frames` as an array of URLs, or a function with a finite `count` of 1 or more.",r),bt;let k=n.concurrency??6;(!Number.isFinite(k)||k<1)&&(z("scrollFrames: `concurrency` must be a finite number of 1 or more; using 6.",n.concurrency),k=6),k=Math.floor(k);let C=r.getContext("2d");if(!C)return z("scrollFrames: the canvas has no 2D context.",r),bt;let x=K-1,O=y??r,h=window.matchMedia("(prefers-reduced-motion: reduce)").matches,$=Le(i),D=f=>{let d=$(f);return d===d?d:0},te=ee(s.start||"top top"),q=ee(s.end||"bottom top"),F=0,I=0,M=false,J=-1,T=0,A=0,ye=false,_=false,Y=false,ue=false,Se=0,fe=-1,ae=new Array(K),P=new Uint8Array(K),L=new Set,oe=h?[x]:Kr(K),Fe=0,Z=0,He=false,Te=(f,...d)=>{if(f)try{f(...d);}catch(E){typeof reportError=="function"?reportError(E):setTimeout(()=>{throw E});}},be=false,_e=f=>{let d;try{d=b?b[f]:o(f);}catch(E){d=E;}return typeof d=="string"&&d?d:(be||(be=true,z(`scrollFrames: no URL for frame ${f}; it is skipped for its nearest neighbour.`,d)),null)},Ne=()=>c==="x"?window.scrollX:window.scrollY,xe=()=>c==="x"?window.innerWidth:window.innerHeight;function Ae(){!He&&Z===oe.length&&(He=true,Te(S));}function u(){for(;!_&&L.size<k&&Fe<oe.length;){let f=oe[Fe++];P[f]||g(f);}}function g(f){P[f]=1;let d=_e(f);if(d===null){Z++,queueMicrotask(()=>{_||Ae();});return}let E=new Image,le=false,ve=Ve=>{le||_||(le=true,E.onload=E.onerror=null,L.delete(E),Ve?ae[f]=E:z("scrollFrames: a frame failed to load; its nearest neighbour shows instead:",d),Z++,u(),G(),Ae());};L.add(E),E.decoding="async",E.onerror=()=>ve(false),E.src=d,typeof E.decode=="function"?E.decode().then(()=>ve(true),()=>{E.complete?ve(E.naturalWidth>0):E.onload=()=>ve(true);}):E.onload=()=>ve(true);}function se(f){for(let d=0;d<=x;d++){if(ae[f-d])return f-d;if(ae[f+d])return f+d}return -1}function H(){let f=r.clientWidth,d=r.clientHeight;if(!f||!d)return;let E=Math.min(window.devicePixelRatio||1,2),le=Math.round(f*E),ve=Math.round(d*E);if(Math.abs(r.width-le)<=1&&Math.abs(r.height-ve)<=1)return;r.width=le,r.height=ve,fe=-1;let Ve=r.clientWidth,ke=r.clientHeight;if(Ve!==f||ke!==d){let ze=r.style;Ve!==f&&ke!==d?(ze.width=`${f}px`,ze.height=`${d}px`):ze.aspectRatio=`${f} / ${d}`;}}function G(){let f=se(Se);if(f<0||f===fe)return;let d=ae[f],E=r.width,le=r.height,ve=d.naturalWidth||E,Ve=d.naturalHeight||le,ke=(p==="contain"?Math.min:Math.max)(E/ve,le/Ve),ze=ve*ke,We=Ve*ke;C.clearRect(0,0,E,le),C.drawImage(d,(E-ze)/2,(le-We)/2,ze,We),fe=f,Y||(Y=true,Te(v));}function U(f){Se=Math.min(x,Math.max(0,Math.round(f*x))),r.style.setProperty("--scroll-draw-progress",String(f)),G(),Te(B,f,Se);}function Q(){let f=O.getBoundingClientRect(),d=c==="x"?f.left:f.top,E=c==="x"?f.width:f.height,le=he({top:d,height:E},Ne(),xe(),te,q);F=le.tStart,I=le.tEnd,I===F&&E>0&&!h&&!ue&&(ue=true,z("scrollFrames: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",r));}let Ie=()=>j(Ne(),F,I,1);function ie(){if(h)return;let f=Ie(),d=l?Math.max(J,D(T=Math.max(T,f))):D(f);A=d,U(d),d>=1&&!ye?(ye=true,Te(W)):d<1&&!l&&(ye=false);}function De(){A=1,U(1);}H(),h||Q();let we=Ce(window,[O],Ie,ie,()=>{H(),h||Q(),G();}),Qe=()=>we.hold(M||h);Qe(),h&&De(),u();let qe=typeof ResizeObserver=="function"?new ResizeObserver(()=>{H(),G();}):null;qe?.observe(r);let Ue=h?()=>{}:Be(f=>{f&&(Ue(),h=true,we.hold(true),oe=oe.slice(0,Fe),P[x]||oe.push(x),Ae(),De(),u());});$e(r,{type:"frames",getProgress:()=>A,getTrigger:()=>({tStart:F,tEnd:I})});function me(){_||!M||(M=false,Qe());}return {destroy(){if(!_){_=true,we.off(),qe?.disconnect(),Ue();for(let f of L)f.onload=f.onerror=null,f.src="";L.clear(),Re(r);}},replay(){_||(J=-1,T=0,ye=false,A=0,U(0),me());},pause(){_||(M=true,we.hold(true));},resume:me,seek(f){if(_)return;let d=Math.min(1,Math.max(0,f===f?f:0));A=d,J=d,T=0,M=true,we.hold(true),U(d);},getProgress(){return A}}}var Jr=1e4;function mr(e){let{frames:n,count:t}=e;if(typeof n!="function")return lt(e);let r=Number.isFinite(t)?Math.min(Math.max(Math.floor(t),0),Jr):0,o;try{o=Array.from({length:r},(s,i)=>n(i));}catch{o=["throws"];}return lt({...e,frames:o})}function pr(e,n="<ScrollFrames>"){if(!e||e.getAttribute("aria-hidden")==="true")return;let t=e.getAttribute("role");t==="presentation"||t==="none"||e.getAttribute("aria-label")||e.getAttribute("aria-labelledby")||z(`${n}: the canvas has no aria-label. Say what the frames show, or set aria-hidden="true" if they are decoration.`,e);}function dr(e,n){let t=document.createElement("span");t.textContent=n,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function wt(e=""){let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=e,n}function hr(e){let n=e.textContent??"";return e.textContent="",n.split(/(\s+)/).filter(Boolean).map(t=>{let r=e.appendChild(wt(t)),o=/^\s+$/.test(t);return o?r.style.whiteSpace="pre":r.style.display="inline-block",o?null:r}).filter(t=>t!==null)}function Zr(e){let n=e.textContent??"";e.textContent="";let t=[],r=null;for(let o of n){let s=wt(o),i=o===" ";i?s.style.whiteSpace="pre":(s.style.display="inline-block",t.push(s)),i||o>"\u0DFF"?r=null:r||(r=e.appendChild(wt()),r.style.cssText="display:inline-block;white-space:nowrap"),(r??e).appendChild(s);}return t}function gr(e){let n=hr(e),t=new Map;for(let s of n){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let r=[],o=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of o){let i=t.get(s),l=wt();l.style.display="inline-block",i.forEach((c,p)=>{let y=c.nextElementSibling;l.appendChild(c),p<i.length-1&&y&&y.style.whiteSpace==="pre"&&l.appendChild(y);}),r.push(l);}return e.textContent="",r.forEach((s,i)=>{e.appendChild(s),i<r.length-1&&e.appendChild(document.createTextNode(" "));}),r}function en(e,n,t,r){if(t<=1||r===0)return e;r=Math.min(r,1/t);let o=(t-1)*r,s=n*r,i=s+(1-o);return i<=s?e>=s?1:0:st((e-s)/(i-s),0,1)}function tn(e,n){let t=[];if(n?.y!==void 0&&t.push(`translateY(${n.y*(1-e)}px)`),n?.x!==void 0&&t.push(`translateX(${n.x*(1-e)}px)`),n?.rotate!==void 0&&t.push(`rotate(${n.rotate*(1-e)}deg)`),n?.scale!==void 0){let r=n.scale+(1-n.scale)*e;t.push(`scale(${r})`);}return t.join(" ")}var Pt={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function yr(e,n={}){if(typeof window>"u")return Pt;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return z("scrollText: element not found:",e),Pt;let r=t;return je(n,(o,s)=>rn(r,o,s))}function rn(e,n,t){let{split:r="words",stagger:o=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:c=true,onComplete:p}=n,y=Le(s,"ease-out"),v=ee(l.start||"top 85%"),S=ee(l.end||"top 40%"),W=e.innerHTML,B=e.textContent??"",b;r==="chars"?b=Zr(e):r==="lines"?b=gr(e):b=hr(e),dr(e,B);let R=b.length;function K(M,J){i?.opacity!==void 0&&(M.style.opacity=String(i.opacity+(1-i.opacity)*J));let T=tn(J,i);T&&(M.style.transform=T);}function k(M){e.style.setProperty("--scroll-draw-progress",String(M)),b.forEach((J,T)=>{let A=y(en(M,T,R,o));K(J,A);});}if(t)return k(1),p?.(),{...Pt,destroy:()=>{e.innerHTML=W;},getProgress:()=>1};k(0);let C=0,x=0,O=-1,h=0,$=false;function D(){({tStart:C,tEnd:x}=he(e.getBoundingClientRect(),window.scrollY,window.innerHeight,v,S));}let te=()=>j(window.scrollY,C,x,1);function q(){let M=c?O=Math.max(O,te()):te();h=M,k(M),M>=1&&!$?($=true,p?.()):M<1&&!c&&($=false);}D();let F=Ce(window,[e],te,q,()=>{r==="lines"&&(e.innerHTML=W,b=gr(e),dr(e,B),k(h)),D();});$e(e,{type:"text",getProgress:()=>h,getTrigger:()=>({tStart:C,tEnd:x})});let I=()=>F.hold(false);return {destroy(){F.off(),e.innerHTML=W,Re(e);},replay(){O=-1,$=false,h=0,k(0),I();},pause:()=>F.hold(true),resume:I,seek(M){F.hold(true),k(h=O=st(M,0,1));},getProgress(){return h}}}function sn(e,n={}){let[t,r]=an.useState(0),o=an.useRef(n);o.current=n;let s=an.useRef(0);return an.useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){r(1);return}let i=typeof e=="string"?document.querySelector(e):e.current;if(!i)return;let l=i,{axis:c="y",scrollContainer:p,trigger:y={}}=o.current,v=typeof p=="string"?document.querySelector(p):p??null,S=ee(y.start||"top bottom"),W=ee(y.end||"bottom top"),B=0,b=0;function R(){return v?c==="x"?v.scrollLeft:v.scrollTop:c==="x"?window.scrollX:window.scrollY}function K(){return v?c==="x"?v.clientWidth:v.clientHeight:c==="x"?window.innerWidth:window.innerHeight}function k(){let h=Ze(l,v,c);({tStart:B,tEnd:b}=he(h,h.scroll,K(),S,W));}function C(){let{speed:h=1,easing:$="linear",once:D=false}=o.current,te=Le($),q=j(R(),B,b,h),F=te(D?s.current=Math.max(s.current,q):q);r(F);}k();let x=Ce(v??window,[l],()=>j(R(),B,b,Math.min(o.current.speed??1,1)),C,k),O=Be(h=>{h&&(O(),x.off(),r(1));});return ()=>{O(),x.off();}},[]),t}function et(e,n,t,r=lt(n)){let o=an.useRef(n);o.current=n,an.useEffect(()=>{if(!e.current)return;let s=t(e.current,tr(o.current,()=>o.current));return ()=>s.destroy()},[r]);}var ln=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function tt(e){let n={},t={};for(let[r,o]of Object.entries(e))(ln.test(r)?t:n)[r]=o;return [n,t]}function Yo({children:e,className:n,style:t,...r}){let o=an.useRef(null),[s,i]=tt(r);return et(o,s,Zt),jsxRuntime.jsx("div",{ref:o,className:n,style:t,...i,children:e})}function Qo({children:e,className:n,style:t,...r}){let o=an.useRef(null),[s,i]=tt(r);return et(o,s,ar),jsxRuntime.jsx("div",{ref:o,className:n,style:t,...i,children:e})}function Xo({className:e,style:n,...t}){let r=an.useRef(null),[o,s]=tt(t);return et(r,o,lr),jsxRuntime.jsx("span",{ref:r,className:e,style:n,...s})}function Ko({src:e,poster:n,className:t,style:r,muted:o=true,playsInline:s=true,...i}){let l=an.useRef(null),[c,p]=tt(i);return et(l,c,ur),jsxRuntime.jsx("video",{...p,ref:l,src:e,poster:n,className:t,style:r,muted:o,playsInline:s,preload:c.preload??"auto"})}function Jo({className:e,style:n,role:t="img",triggerElement:r,...o}){let s=an.useRef(null),[i,l]=tt(o),c=r&&"current"in r?r:null;return !c&&r&&(i.triggerElement=r),et(s,i,(p,y)=>fr(p,{...y,frames:i.frames,...c&&{triggerElement:c.current??void 0}}),mr(i)+(c?"+ref":"")),an.useEffect(()=>pr(s.current),[]),jsxRuntime.jsx("canvas",{...l,ref:s,role:t,className:e,style:n})}function Zo({children:e,as:n="p",className:t,style:r,...o}){let s=an.useRef(null),[i,l]=tt(o);return et(s,i,yr),an__default.default.createElement(n,{...l,ref:s,className:t,style:r},e)}exports.ScrollAnimate=Qo;exports.ScrollCounter=Xo;exports.ScrollDraw=Yo;exports.ScrollFrames=Jo;exports.ScrollText=Zo;exports.ScrollVideo=Ko;exports.useScrollDrawProgress=sn;
|
package/dist/react/index.d.mts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import { E as
|
|
3
|
-
import { S as ScrollAnimateOptions } from '../engine-
|
|
4
|
-
import { S as ScrollCounterOptions } from '../index-
|
|
2
|
+
import { E as Easing, T as TriggerConfig, a as ScrollDrawOptions } from '../types-iITMwrru.mjs';
|
|
3
|
+
import { S as ScrollAnimateOptions } from '../engine-Bi2x8-X-.mjs';
|
|
4
|
+
import { S as ScrollCounterOptions } from '../index-BMMZ8aW7.mjs';
|
|
5
5
|
import { ScrollVideoOptions } from '../video/index.mjs';
|
|
6
|
+
import { ScrollFramesOptions } from '../frames/index.mjs';
|
|
6
7
|
import { ScrollTextOptions } from '../text/index.mjs';
|
|
7
8
|
|
|
8
9
|
interface UseScrollDrawProgressOptions {
|
|
9
10
|
/** Same speed multiplier as ScrollDraw. Values > 1 complete faster. Default 1. */
|
|
10
11
|
speed?: number;
|
|
11
12
|
/** Same easing curves as ScrollDraw. Default 'linear'. */
|
|
12
|
-
easing?:
|
|
13
|
+
easing?: Easing;
|
|
13
14
|
/** Same trigger syntax as ScrollDraw. Default: start 'top bottom', end 'bottom top'. */
|
|
14
15
|
trigger?: TriggerConfig;
|
|
15
16
|
/** Scroll axis. Default 'y'. */
|
|
@@ -61,6 +62,21 @@ type ScrollVideoProps = ScrollVideoOptions & ElementAttrs & {
|
|
|
61
62
|
playsInline?: boolean;
|
|
62
63
|
};
|
|
63
64
|
declare function ScrollVideo({ src, poster, className, style, muted, playsInline, ...rest }: ScrollVideoProps): React.JSX.Element;
|
|
65
|
+
type ScrollFramesProps = Omit<ScrollFramesOptions, 'triggerElement'> & ElementAttrs & {
|
|
66
|
+
/**
|
|
67
|
+
* The tall track behind a sticky stage: an element, or a ref to one. A ref is
|
|
68
|
+
* read when the film starts, after React has attached it, so the track can
|
|
69
|
+
* be an ancestor rendered by the same component.
|
|
70
|
+
*/
|
|
71
|
+
triggerElement?: Element | RefObject<Element | null> | null;
|
|
72
|
+
className?: string;
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* A <canvas> that scrubs an image sequence with the scroll (scrollFrames). It
|
|
77
|
+
* renders role="img": pass an aria-label saying what the frames show.
|
|
78
|
+
*/
|
|
79
|
+
declare function ScrollFrames({ className, style, role, triggerElement, ...rest }: ScrollFramesProps): React.JSX.Element;
|
|
64
80
|
type ScrollTextProps = ScrollTextOptions & ElementAttrs & {
|
|
65
81
|
children: string;
|
|
66
82
|
as?: keyof React.JSX.IntrinsicElements;
|
|
@@ -73,4 +89,4 @@ declare function ScrollText({ children, as: Tag, className, style, ...rest }: Sc
|
|
|
73
89
|
style: React.CSSProperties | undefined;
|
|
74
90
|
}, string | React.JSXElementConstructor<any>>;
|
|
75
91
|
|
|
76
|
-
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollText, ScrollVideo, type UseScrollDrawProgressOptions, useScrollDrawProgress };
|
|
92
|
+
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollFrames, ScrollText, ScrollVideo, type UseScrollDrawProgressOptions, useScrollDrawProgress };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React, { RefObject } from 'react';
|
|
2
|
-
import { E as
|
|
3
|
-
import { S as ScrollAnimateOptions } from '../engine-
|
|
4
|
-
import { S as ScrollCounterOptions } from '../index-
|
|
2
|
+
import { E as Easing, T as TriggerConfig, a as ScrollDrawOptions } from '../types-iITMwrru.js';
|
|
3
|
+
import { S as ScrollAnimateOptions } from '../engine-DAlvk6i0.js';
|
|
4
|
+
import { S as ScrollCounterOptions } from '../index-MdQ4ti_z.js';
|
|
5
5
|
import { ScrollVideoOptions } from '../video/index.js';
|
|
6
|
+
import { ScrollFramesOptions } from '../frames/index.js';
|
|
6
7
|
import { ScrollTextOptions } from '../text/index.js';
|
|
7
8
|
|
|
8
9
|
interface UseScrollDrawProgressOptions {
|
|
9
10
|
/** Same speed multiplier as ScrollDraw. Values > 1 complete faster. Default 1. */
|
|
10
11
|
speed?: number;
|
|
11
12
|
/** Same easing curves as ScrollDraw. Default 'linear'. */
|
|
12
|
-
easing?:
|
|
13
|
+
easing?: Easing;
|
|
13
14
|
/** Same trigger syntax as ScrollDraw. Default: start 'top bottom', end 'bottom top'. */
|
|
14
15
|
trigger?: TriggerConfig;
|
|
15
16
|
/** Scroll axis. Default 'y'. */
|
|
@@ -61,6 +62,21 @@ type ScrollVideoProps = ScrollVideoOptions & ElementAttrs & {
|
|
|
61
62
|
playsInline?: boolean;
|
|
62
63
|
};
|
|
63
64
|
declare function ScrollVideo({ src, poster, className, style, muted, playsInline, ...rest }: ScrollVideoProps): React.JSX.Element;
|
|
65
|
+
type ScrollFramesProps = Omit<ScrollFramesOptions, 'triggerElement'> & ElementAttrs & {
|
|
66
|
+
/**
|
|
67
|
+
* The tall track behind a sticky stage: an element, or a ref to one. A ref is
|
|
68
|
+
* read when the film starts, after React has attached it, so the track can
|
|
69
|
+
* be an ancestor rendered by the same component.
|
|
70
|
+
*/
|
|
71
|
+
triggerElement?: Element | RefObject<Element | null> | null;
|
|
72
|
+
className?: string;
|
|
73
|
+
style?: React.CSSProperties;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* A <canvas> that scrubs an image sequence with the scroll (scrollFrames). It
|
|
77
|
+
* renders role="img": pass an aria-label saying what the frames show.
|
|
78
|
+
*/
|
|
79
|
+
declare function ScrollFrames({ className, style, role, triggerElement, ...rest }: ScrollFramesProps): React.JSX.Element;
|
|
64
80
|
type ScrollTextProps = ScrollTextOptions & ElementAttrs & {
|
|
65
81
|
children: string;
|
|
66
82
|
as?: keyof React.JSX.IntrinsicElements;
|
|
@@ -73,4 +89,4 @@ declare function ScrollText({ children, as: Tag, className, style, ...rest }: Sc
|
|
|
73
89
|
style: React.CSSProperties | undefined;
|
|
74
90
|
}, string | React.JSXElementConstructor<any>>;
|
|
75
91
|
|
|
76
|
-
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollText, ScrollVideo, type UseScrollDrawProgressOptions, useScrollDrawProgress };
|
|
92
|
+
export { ScrollAnimate, ScrollCounter, ScrollDraw, ScrollFrames, ScrollText, ScrollVideo, type UseScrollDrawProgressOptions, useScrollDrawProgress };
|
package/dist/react/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import {c,d as d$1,b as b$1,a as a$4}from'../chunk-KN2YB54Z.mjs';import {a as a$7}from'../chunk-HJTHOZK5.mjs';import {a as a$2}from'../chunk-GBFWTY5L.mjs';import {a as a$8}from'../chunk-UF3MO5XQ.mjs';import {a as a$6}from'../chunk-Z72TVDHY.mjs';import {a as a$5}from'../chunk-HAGTU5EX.mjs';import {b as b$2}from'../chunk-XLXVGQ3P.mjs';import'../chunk-7LDSB4FT.mjs';import {a as a$3}from'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-YOOPMYT6.mjs';import'../chunk-2PYLM3E7.mjs';import {a,e,b,c as c$1}from'../chunk-NV6YTPHI.mjs';import {f as f$1}from'../chunk-IXR6RML7.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';import ee,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function _(o,r={}){let[s,e$1]=useState(0),t=useRef(r);t.current=r;let n=useRef(0);return useEffect(()=>{if(typeof window>"u")return;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches){e$1(1);return}let l=typeof o=="string"?document.querySelector(o):o.current;if(!l)return;let c=l,{axis:i="y",scrollContainer:m,trigger:g={}}=t.current,a$2=typeof m=="string"?document.querySelector(m):m??null,K=a(g.start||"top bottom"),W=a(g.end||"bottom top"),y=0,E=0;function R(){return a$2?i==="x"?a$2.scrollLeft:a$2.scrollTop:i==="x"?window.scrollX:window.scrollY}function X(){return a$2?i==="x"?a$2.clientWidth:a$2.clientHeight:i==="x"?window.innerWidth:window.innerHeight}function x(){let u=a$3(c,a$2,i);({tStart:y,tEnd:E}=c$1(u,u.scroll,X(),K,W));}function $(){let{speed:u=1,easing:G="linear",once:J=false}=t.current,Y=f$1(G),T=b(R(),y,E,u),B=Y(J?n.current=Math.max(n.current,T):T);e$1(B);}x();let P=e(a$2??window,[c],()=>b(R(),y,E,Math.min(t.current.speed??1,1)),$,x),b$1=a$1(u=>{u&&(b$1(),P.off(),e$1(1));});return ()=>{b$1(),P.off();}},[]),s}function f(o,r,s,e=a$4(r)){let t=useRef(r);t.current=r,useEffect(()=>{if(!o.current)return;let n=s(o.current,b$1(t.current,()=>t.current));return ()=>n.destroy()},[e]);}var te=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function d(o){let r={},s={};for(let[e,t]of Object.entries(o))(te.test(e)?s:r)[e]=t;return [r,s]}function Ee({children:o,className:r,style:s,...e}){let t=useRef(null),[n,l]=d(e);return f(t,n,b$2),jsx("div",{ref:t,className:r,style:s,...l,children:o})}function Oe({children:o,className:r,style:s,...e}){let t=useRef(null),[n,l]=d(e);return f(t,n,a$5),jsx("div",{ref:t,className:r,style:s,...l,children:o})}function we({className:o,style:r,...s}){let e=useRef(null),[t,n]=d(s);return f(e,t,a$6),jsx("span",{ref:e,className:o,style:r,...n})}function Re({src:o,poster:r,className:s,style:e,muted:t=true,playsInline:n=true,...l}){let c=useRef(null),[i,m]=d(l);return f(c,i,a$7),jsx("video",{...m,ref:c,src:o,poster:r,className:s,style:e,muted:t,playsInline:n,preload:i.preload??"auto"})}function xe({className:o,style:r,role:s="img",triggerElement:e,...t}){let n=useRef(null),[l,c$1]=d(t),i=e&&"current"in e?e:null;return !i&&e&&(l.triggerElement=e),f(n,l,(m,g)=>a$2(m,{...g,frames:l.frames,...i&&{triggerElement:i.current??void 0}}),c(l)+(i?"+ref":"")),useEffect(()=>d$1(n.current),[]),jsx("canvas",{...c$1,ref:n,role:s,className:o,style:r})}function Pe({children:o,as:r="p",className:s,style:e,...t}){let n=useRef(null),[l,c]=d(t);return f(n,l,a$8),ee.createElement(r,{...c,ref:n,className:s,style:e},o)}export{Oe as ScrollAnimate,we as ScrollCounter,Ee as ScrollDraw,xe as ScrollFrames,Pe as ScrollText,Re as ScrollVideo,_ as useScrollDrawProgress};
|