svg-scroll-draw 2.23.3 → 2.23.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/angular/index.cjs +3 -3
- package/dist/angular/index.mjs +1 -1
- package/dist/astro/index.cjs +3 -3
- package/dist/astro/index.mjs +1 -1
- package/dist/cdn/svg-scroll-draw.dev.global.js +64 -59
- package/dist/cdn/svg-scroll-draw.global.js +3 -3
- package/dist/chunk-6TWFLRUB.mjs +3 -0
- package/dist/{chunk-BLY6F6EC.mjs → chunk-DSFD227B.mjs} +1 -1
- package/dist/chunk-I73SOXBN.mjs +1 -0
- package/dist/chunk-NLPSVYFP.mjs +1 -0
- package/dist/chunk-OPXWNJBG.mjs +1 -0
- package/dist/chunk-QFSTKVA3.mjs +1 -0
- package/dist/chunk-XC5NR2MU.mjs +1 -0
- package/dist/{chunk-ETACBG7W.mjs → chunk-XTPAW6XR.mjs} +1 -1
- package/dist/{chunk-4I7MLTP5.mjs → chunk-ZNCZYV3Q.mjs} +1 -1
- package/dist/group/index.cjs +3 -3
- package/dist/group/index.mjs +1 -1
- package/dist/horizontal/index.cjs +1 -1
- package/dist/horizontal/index.d.mts +10 -7
- package/dist/horizontal/index.d.ts +10 -7
- package/dist/horizontal/index.mjs +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +1 -1
- package/dist/nuxt/index.cjs +3 -3
- package/dist/nuxt/index.mjs +1 -1
- package/dist/react/index.cjs +2 -2
- package/dist/react/index.d.mts +3 -1
- package/dist/react/index.d.ts +3 -1
- package/dist/react/index.mjs +1 -1
- package/dist/reveal/index.cjs +1 -1
- package/dist/reveal/index.d.mts +9 -3
- package/dist/reveal/index.d.ts +9 -3
- package/dist/reveal/index.mjs +1 -1
- package/dist/snap/index.cjs +1 -1
- package/dist/snap/index.mjs +1 -1
- package/dist/solid/index.cjs +3 -3
- package/dist/solid/index.mjs +1 -1
- package/dist/svelte/index.cjs +3 -3
- package/dist/svelte/index.mjs +1 -1
- package/dist/text/index.cjs +1 -1
- package/dist/text/index.mjs +1 -1
- package/dist/timeline/index.cjs +1 -1
- package/dist/timeline/index.mjs +1 -1
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.mjs +1 -1
- package/dist/vue/index.cjs +3 -3
- package/dist/vue/index.mjs +1 -1
- package/dist/web-component/index.cjs +3 -3
- package/dist/web-component/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-23EALNDF.mjs +0 -3
- package/dist/chunk-4H2SGMAQ.mjs +0 -1
- package/dist/chunk-GMBIGV3M.mjs +0 -1
- package/dist/chunk-LGJQWZHH.mjs +0 -1
- package/dist/chunk-V4L3ELVC.mjs +0 -1
- package/dist/chunk-YZV4Z3EQ.mjs +0 -1
package/dist/chunk-4H2SGMAQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';function B(e,r){let t=document.createElement("span");t.textContent=r,t.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;user-select:none",e.appendChild(t);}function _(e){let r=e.textContent??"";return e.textContent="",r.split(/(\s+)/).filter(Boolean).map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),/^\s+$/.test(t)?(n.textContent=t,n.style.whiteSpace="pre"):(n.textContent=t,n.style.display="inline-block"),e.appendChild(n),/^\s+$/.test(t)?null:n}).filter(t=>t!==null)}function Q(e){let r=e.textContent??"";return e.textContent="",r.split("").map(t=>{let n=document.createElement("span");return n.setAttribute("aria-hidden","true"),n.textContent=t,t===" "?n.style.whiteSpace="pre":n.style.display="inline-block",e.appendChild(n),t===" "?null:n}).filter(t=>t!==null)}function W(e){let r=_(e),t=new Map;for(let s of r){let i=s.offsetTop;t.has(i)||t.set(i,[]),t.get(i).push(s);}let n=[],c=Array.from(t.keys()).sort((s,i)=>s-i);for(let s of c){let i=t.get(s),l=document.createElement("span");l.setAttribute("aria-hidden","true"),l.style.display="inline-block",i.forEach((g,b)=>{let h=g.nextElementSibling;l.appendChild(g),b<i.length-1&&h&&h.style.whiteSpace==="pre"&&l.appendChild(h);}),n.push(l);}return e.textContent="",n.forEach((s,i)=>{e.appendChild(s),i<n.length-1&&e.appendChild(document.createTextNode(" "));}),n}function Z(e,r,t,n){if(t<=1||n===0)return e;let c=(t-1)*n,s=r*n,i=s+(1-c);return i<=s?e>=s?1:0:Math.min(1,Math.max(0,(e-s)/(i-s)))}function ee(e,r){let t=[];if(r?.y!==void 0&&t.push(`translateY(${r.y*(1-e)}px)`),r?.x!==void 0&&t.push(`translateX(${r.x*(1-e)}px)`),r?.rotate!==void 0&&t.push(`rotate(${r.rotate*(1-e)}deg)`),r?.scale!==void 0){let n=r.scale+(1-r.scale)*e;t.push(`scale(${n})`);}return t.join(" ")||""}var Y={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(e,r={}){if(typeof window>"u")return Y;let t=typeof e=="string"?document.querySelector(e):e;if(!t)return b("scrollText: element not found:",e),Y;let n=t;return a(r,(c,s)=>te(n,c,s))}function te(e,r,t){let{split:n="words",stagger:c$1=.04,easing:s="ease-out",from:i={opacity:0,y:24},trigger:l={},once:g=true,onComplete:b}=r,h=typeof s=="function"?s:d[s]??d["ease-out"],j=a$1(l.start||"top 85%"),G=a$1(l.end||"top 40%"),S=e.innerHTML,I=e.textContent??"",m;n==="chars"?m=Q(e):n==="lines"?m=W(e):m=_(e),B(e,I);let U=m.length;function V(o,a){i?.opacity!==void 0&&(o.style.opacity=String(i.opacity+(1-i.opacity)*a));let E=ee(a,i);E&&(o.style.transform=E);}function d$2(o){e.style.setProperty("--scroll-draw-progress",String(o)),m.forEach((a,E)=>{let K=h(Z(o,E,U,c$1));V(a,K);});}if(t)return d$2(1),b?.(),{destroy(){e.innerHTML=S;},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>1};d$2(0);let C=0,M=0,p=0,x=false,u=false,y=-1,f=0,w=false,F=()=>window.scrollY,X=()=>window.innerHeight;function P(){let o=e.getBoundingClientRect(),a=c({top:o.top,height:o.height},F(),X(),j,G);C=a.tStart,M=a.tEnd;}function L(){if(!x||u)return;let o=b$2(F(),C,M,1);g&&(y=Math.max(y,o),o=y),f=o,d$2(o),o>=1&&!w?(w=true,b?.()):o<1&&!g&&(w=false),p=requestAnimationFrame(L);}P();let O=new IntersectionObserver(o=>{o.forEach(a=>{x=a.isIntersecting,x&&!u?p=requestAnimationFrame(L):cancelAnimationFrame(p);});}),v;function T(){clearTimeout(v),v=setTimeout(()=>{if(n==="lines"){let o=f;e.innerHTML=S,m=W(e),B(e,I),d$2(o);}P();},150);}window.addEventListener("resize",T),window.addEventListener("orientationchange",T);let J=d$1([e],T);return O.observe(e),a$2(e,{type:"text",getProgress:()=>f,getTrigger:()=>({tStart:C,tEnd:M})}),{destroy(){cancelAnimationFrame(p),O.disconnect(),window.removeEventListener("resize",T),window.removeEventListener("orientationchange",T),J(),clearTimeout(v),e.innerHTML=S,b$1(e);},replay(){y=-1,w=false,f=0,u=false,d$2(0);},pause(){u=true,cancelAnimationFrame(p);},resume(){u&&(u=false,x&&(p=requestAnimationFrame(L)));},seek(o){let a=Math.min(1,Math.max(0,o));f=a,y=a,u=true,cancelAnimationFrame(p),d$2(a);},getProgress(){return f}}}export{le as a};
|
package/dist/chunk-GMBIGV3M.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a,d as d$1,c,b as b$2}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var j={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function le(m,E={}){if(typeof window>"u")return j;let b$3=typeof m=="string"?document.querySelector(m):m;if(!b$3||b$3.tagName.toLowerCase()!=="video")return b("scrollVideo: <video> element not found:",m),j;let t=b$3,{trigger:P={},easing:T="linear",once:C=false,axis:u="y",preload:J="auto",triggerElement:K,onReady:I,onComplete:Q,onProgress:U}=E,R=K??t,f=window.matchMedia("(prefers-reduced-motion: reduce)").matches,V=typeof T=="function"?T:d[T]??d.linear,Z=a(P.start||"top top"),$=a(P.end||"bottom top");t.pause(),t.hasAttribute("preload")||(t.preload=J);let q=E.from??0,A=E.to,g=0,p=0,o=0,a$3=false,n=false,S=-1,w=0,s=0,v=false,i=false,O=()=>u==="x"?window.scrollX:window.scrollY,ee=()=>u==="x"?window.innerWidth:window.innerHeight;function x(){let e=R.getBoundingClientRect(),r=u==="x"?e.left:e.top,d=u==="x"?e.width:e.height,H=c({top:r,height:d},O(),ee(),Z,$);g=H.tStart,p=H.tEnd,i&&p===g&&b("scrollVideo: zero-length trigger window, so it never scrubs. In a sticky stage, set triggerElement.",t);}let h=NaN;function l(e){if(!i)return;let r=A??t.duration??0,d=q+(r-q)*e;d!==h&&(h=d,t.currentTime=d),t.style.setProperty("--scroll-draw-progress",String(e)),U?.(e);}function y(){if(!a$3||n||!i||f)return;let e=b$2(O(),g,p,1),r=C?Math.max(S,V(w=Math.max(w,e))):V(e);s=r,l(r),r>=1&&!v?(v=true,Q?.()):r<1&&!C&&(v=false),o=requestAnimationFrame(y);}function L(){if(i=true,A===void 0&&(A=t.duration),f){l(1),I?.();return}x(),I?.(),a$3&&!n&&(o=requestAnimationFrame(y));}t.readyState>=1?L():t.addEventListener("loadedmetadata",L,{once:true}),i||x();let k=f?()=>{}:a$1(e=>{e&&(k(),f=true,cancelAnimationFrame(o),l(1));}),D=new IntersectionObserver(e=>{e.forEach(r=>{a$3=r.isIntersecting,a$3&&!n&&i?o=requestAnimationFrame(y):cancelAnimationFrame(o);});}),N;function c$1(){clearTimeout(N),N=setTimeout(x,150);}window.addEventListener("resize",c$1),window.addEventListener("orientationchange",c$1);let te=d$1([R],c$1);return D.observe(t),a$2(t,{type:"video",getProgress:()=>s,getTrigger:()=>({tStart:g,tEnd:p})}),{destroy(){cancelAnimationFrame(o),D.disconnect(),t.removeEventListener("loadedmetadata",L),window.removeEventListener("resize",c$1),window.removeEventListener("orientationchange",c$1),te(),k(),clearTimeout(N),b$1(t);},replay(){S=-1,w=0,v=false,s=0,n=false,h=NaN,l(0);},pause(){n=true,cancelAnimationFrame(o);},resume(){n&&(n=false,a$3&&i&&(o=requestAnimationFrame(y)));},seek(e){let r=Math.min(1,Math.max(0,e));s=r,S=r,w=0,n=true,cancelAnimationFrame(o),h=NaN,l(r);},getProgress(){return s}}}export{le as a};
|
package/dist/chunk-LGJQWZHH.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$1,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$2}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var F={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function $(r,w){if(typeof window>"u")return F;let m=typeof r=="string"?document.querySelector(r):r;return m?a(w,(l,f)=>j(m,l,f)):(b("scrollCounter: element not found:",r),F)}function j(r,w,m){let{from:l=0,to:f,format:B,easing:h="ease-out",trigger:M={},once:x=true,decimals:I,onComplete:P}=w,z=I!==void 0?e=>e.toFixed(I):B??(e=>String(Math.round(e))),b=typeof h=="function"?h:d[h]??d["ease-out"],G=a$1(M.start||"top 80%"),V=a$1(M.end||"top 20%");if(m)return r.textContent=z(f),P?.(),{...F,getProgress:()=>1};let a=0,c$1=0,L=false,n=0,g=false,o=false,y=-1,i=0,s=0,p=false,v=()=>window.scrollY,W=()=>window.innerHeight;function O(){let e=r.getBoundingClientRect(),t=c({top:e.top,height:e.height},v(),W(),G,V);L&&Math.abs(t.tStart-a)<1&&Math.abs(t.tEnd-c$1)<1||(L=true,a=t.tStart,c$1=t.tEnd);}function d$2(e){r.textContent=z(l+(f-l)*e),r.style.setProperty("--scroll-draw-progress",String(e));}function S(){if(!g||o)return;let e=b$1(v(),a,c$1,1),t=x?Math.max(y,b(i=Math.max(i,e))):b(e);s=t,d$2(t),t>=1&&!p?(p=true,P?.()):t<1&&!x&&(p=false),n=requestAnimationFrame(S);}O();{i=b$1(v(),a,c$1,1);let e=b(i);s=e,d$2(e);}let R=new IntersectionObserver(e=>{e.forEach(t=>{g=t.isIntersecting,g&&!o?n=requestAnimationFrame(S):cancelAnimationFrame(n);});}),C;function u(){clearTimeout(C),C=setTimeout(O,150);}window.addEventListener("resize",u),window.addEventListener("orientationchange",u);let Y=d$1([r],u);return R.observe(r),a$2(r,{type:"counter",getProgress:()=>s,getTrigger:()=>({tStart:a,tEnd:c$1})}),{destroy(){cancelAnimationFrame(n),R.disconnect(),window.removeEventListener("resize",u),window.removeEventListener("orientationchange",u),Y(),clearTimeout(C),b$2(r);},replay(){y=-1,i=0,p=false,s=0,o=false,d$2(0);},pause(){o=true,cancelAnimationFrame(n);},resume(){o&&(o=false,g&&(n=requestAnimationFrame(S)));},seek(e){let t=Math.min(1,Math.max(0,e));s=t,y=t,i=0,o=true,cancelAnimationFrame(n),d$2(t);},getProgress(){return s}}}export{$ as a};
|
package/dist/chunk-V4L3ELVC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b,a as a$4}from'./chunk-OJFWQ6CU.mjs';import {a as a$3}from'./chunk-UPWWULKI.mjs';import {a}from'./chunk-2PYLM3E7.mjs';import {a as a$1,b as b$2,d as d$1,c}from'./chunk-A4JCC3QQ.mjs';import {d}from'./chunk-DM6EDKWH.mjs';import {a as a$2,b as b$3}from'./chunk-BCV4RAIX.mjs';import {b as b$1}from'./chunk-LFSU6LR3.mjs';function $e(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}function de(e){let i=[],l=/([\w]+)\(([^)]*)\)/g,s;for(;(s=l.exec(e))!==null;){let m=[],r=[],u=s[2].trim();if(u)for(let c of u.split(/[\s,]+/)){let o=c.match(/^([-+]?[\d.eE]+)(.*)$/);m.push(o?parseFloat(o[1]):0),r.push(o?o[2]:"");}i.push({fn:s[1],nums:m,units:r});}return i}function Ce(e,i,l){let s=de(e),m=de(i);return s.length===0||s.length!==m.length?l<1?e:i:s.map((r,u)=>{let c=m[u];return r.fn!==c.fn||r.nums.length!==c.nums.length?l<1?`${r.fn}(${r.nums.map((o,p)=>`${o}${r.units[p]}`).join(", ")})`:`${c.fn}(${c.nums.map((o,p)=>`${o}${c.units[p]}`).join(", ")})`:`${r.fn}(${r.nums.map((o,p)=>`${o+(c.nums[p]-o)*l}${r.units[p]}`).join(", ")})`}).join(" ")}function ye(e,i,l){if(typeof e=="number"&&typeof i=="number")return String(e+(i-e)*l);let s=String(e),m=String(i);if($e(s))return a$4(s,m,l);if(s.includes("("))return Ce(s,m,l);let r=s.match(/^([-+]?[\d.]+)(.*)$/),u=m.match(/^([-+]?[\d.]+)(.*)$/);if(r&&u){let c=parseFloat(r[1]),o=parseFloat(u[1]);return `${c+(o-c)*l}${r[2]||u[2]}`}return l<1?s:m}function He(e){return e.replace(/([A-Z])/g,i=>`-${i.toLowerCase()}`)}var xe=new Set(["opacity","transform","background-color","color","filter","scale","translate","rotate"]),Fe=0,he="--scroll-draw-progress";function Ie(){return typeof CSS<"u"&&typeof CSS.supports=="function"&&CSS.supports("animation-timeline: view()")}var be={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};function De(e,i){return typeof window>"u"?be:i.respectReducedMotion===false?Ee(e,i,false):a(i,(l,s)=>Ee(e,l,s))}function Ee(e,i,l){let{props:s,trigger:m={},easing:r="ease-out",speed:u=1,once:c$1=false,axis:o="y",scrollContainer:p,native:ve=true,velocityScale:C=false,triggerElement:Se,onProgress:J,onComplete:O,onEnter:K,onLeave:Q,onEnterBack:ee,onLeaveBack:te}=i,H=typeof r=="function"?r:d[r]??d["ease-out"],ne=a$1(m.start||"top bottom"),re=a$1(m.end||"bottom top"),x=Se??e,d$2=typeof p=="string"?document.querySelector(p):p??null,y=Object.entries(s).map(([t,n])=>({prop:He(t),from:Array.isArray(n)?n[0]:"",to:Array.isArray(n)?n[1]:n}));function we(){let t=window.getComputedStyle(e);for(let n of y)n.from===""&&(n.from=t.getPropertyValue(n.prop).trim()||"0");}function Te(){for(let t of y)e.style.setProperty(t.prop,String(t.to));}let z=new Map;for(let t of [...y.map(n=>n.prop),he])z.set(t,e.style.getPropertyValue(t));function W(){for(let[t,n]of z)n?e.style.setProperty(t,n):e.style.removeProperty(t);}if(l)return Te(),O?.(),{...be,destroy:W,getProgress:()=>1};we();let F=()=>d$2?o==="x"?d$2.scrollLeft:d$2.scrollTop:o==="x"?window.scrollX:window.scrollY,oe=()=>d$2?o==="x"?d$2.clientWidth:d$2.clientHeight:o==="x"?window.innerWidth:window.innerHeight,se=typeof r=="string"?b(r):null;function Le(){if(!ve||!Ie()||!se||o!=="y"||d$2||x!==e||c$1||u!==1||J||O||K||Q||ee||te||C!==false||(m.start||"top bottom").trim()!=="top bottom"||(m.end||"bottom top").trim()!=="bottom top")return false;for(let t of y)if(!xe.has(t.prop))return false;return true}function Pe(){let t=`ssd-a-${++Fe}`,n=y.map(a=>`${a.prop}:${a.from}`).join(";"),P=y.map(a=>`${a.prop}:${a.to}`).join(";"),E=document.createElement("style");E.setAttribute("data-ssd-animate",""),E.textContent=`@keyframes ${t}{from{${n}}to{${P}}}.${t}{animation-name:${t};animation-duration:auto;animation-timing-function:${se};animation-fill-mode:both;animation-timeline:view();animation-range:cover 0% cover 100%;}`,document.head.appendChild(E),e.classList.add(t);let g=()=>{let a=e.getBoundingClientRect();return c({top:a.top,height:a.height},F(),oe(),ne,re)};a$2(e,{type:"animate",getProgress:()=>f.getProgress(),getTrigger:g});let f={refresh(){},destroy(){e.classList.remove(t),E.remove(),e.style.animationPlayState="",W(),b$3(e);},replay(){e.classList.remove(t),e.offsetWidth,e.classList.add(t);},pause(){e.style.animationPlayState="paused";},resume(){e.style.animationPlayState="";},seek(a){let $=Math.min(1,Math.max(0,a));e.classList.remove(t);for(let k of y)e.style.setProperty(k.prop,ye(k.from,k.to,$));},getProgress(){let{tStart:a,tEnd:$}=g();return H(b$2(F(),a,$,u))}};return f}if(Le())return Pe();let h=0,b$4=0,v=0,I=false,S=false,B=-1,L=0,w=0,N=false,T=NaN,j=-1,ie=0,M=x===e?y:[],ae=false;function D(){let t=e.style,n=M.map(f=>t.getPropertyValue(f.prop)),P=t.transition;M.length&&(t.transition="none"),M.forEach(f=>t.setProperty(f.prop,z.get(f.prop)??""));let E=a$3(x,d$2,o);M.forEach((f,a)=>t.setProperty(f.prop,n[a])),M.length&&(e.offsetWidth,t.transition=P);let g=c(E,E.scroll,oe(),ne,re);ae&&Math.abs(g.tStart-h)<1&&Math.abs(g.tEnd-b$4)<1||(ae=true,h=g.tStart,b$4=g.tEnd);}function R(t){e.style.setProperty(he,String(t));for(let n of y)e.style.setProperty(n.prop,ye(n.from,n.to,t));J?.(t);}function Me(t){if(isNaN(T)){T=t;return}T<=0&&t>0?K?.():T>0&&t<=0&&te?.(),T<1&&t>=1?Q?.():T>=1&&t<1&&ee?.(),T=t;}function _(){if(!I||S)return;let t=performance.now(),n=F(),P=u;if(C!==false){let a=t-ie,$=a>0?Math.abs(n-(j<0?n:j))/a:0;P=u*Math.max(.2,1+$*(typeof C=="number"?C:1)*.04);}j=n,ie=t;let E=b$4===h?0:(n-h)/(b$4-h);Me(E);let g=b$2(n,h,b$4,P),f=c$1?Math.max(B,H(L=Math.max(L,g))):H(g);w=f,R(f),f>=1&&!N?(N=true,O?.()):f<1&&!c$1&&(N=false),v=requestAnimationFrame(_);}D(),b$4===h&&b$1("scrollAnimate: the trigger window has zero length (start and end resolve to the same scroll position), so this element will never animate. If the target is inside a position:sticky stage, measure the trigger from the container that holds the scroll room via `triggerElement`.",e),L=b$2(F(),h,b$4,u),w=H(L),R(w);let le=new IntersectionObserver(t=>{t.forEach(n=>{I=n.isIntersecting,I&&!S?v=requestAnimationFrame(_):cancelAnimationFrame(v);});},{root:d$2??null}),q;function A(){clearTimeout(q),q=setTimeout(D,150);}window.addEventListener("resize",A),window.addEventListener("orientationchange",A);let Ae=d$1([x],A);return le.observe(e),a$2(e,{type:"animate",getProgress:()=>w,getTrigger:()=>({tStart:h,tEnd:b$4})}),{destroy(){cancelAnimationFrame(v),le.disconnect(),window.removeEventListener("resize",A),window.removeEventListener("orientationchange",A),Ae(),clearTimeout(q),W(),b$3(e);},replay(){B=-1,L=0,N=false,w=0,S=false,R(0);},pause(){S=true,cancelAnimationFrame(v);},resume(){S&&(S=false,I&&(v=requestAnimationFrame(_)));},seek(t){let n=Math.min(1,Math.max(0,t));w=n,B=n,L=0,S=true,cancelAnimationFrame(v),R(n);},getProgress(){return w},refresh(){D();}}}export{De as a};
|
package/dist/chunk-YZV4Z3EQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function a(t){let r=t.tagName.toLowerCase();if(r==="rect"){let e=parseFloat(t.getAttribute("width")??"0"),n=parseFloat(t.getAttribute("height")??"0");return 2*(e+n)}if(r==="circle"){let e=parseFloat(t.getAttribute("r")??"0");return 2*Math.PI*e}return t.getTotalLength()}export{a};
|