svg-scroll-draw 2.23.6 → 2.24.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.
Files changed (45) hide show
  1. package/README.md +84 -3
  2. package/dist/angular/index.mjs +1 -1
  3. package/dist/astro/index.mjs +1 -1
  4. package/dist/cdn/svg-scroll-draw.dev.global.js +33 -49
  5. package/dist/cdn/svg-scroll-draw.global.js +3 -3
  6. package/dist/{chunk-XNM3VKEK.mjs → chunk-32ZCSGFZ.mjs} +1 -1
  7. package/dist/{chunk-OSGWGHQJ.mjs → chunk-5SKWSPQT.mjs} +1 -1
  8. package/dist/{chunk-VJ5ZU55P.mjs → chunk-7USW2XFB.mjs} +1 -1
  9. package/dist/{chunk-K6VATIJH.mjs → chunk-7XOFQCQE.mjs} +1 -1
  10. package/dist/chunk-BDXWPUBJ.mjs +2 -0
  11. package/dist/{chunk-NYQJPPMP.mjs → chunk-BRV2B2YW.mjs} +1 -1
  12. package/dist/chunk-EBU6E26L.mjs +1 -0
  13. package/dist/{chunk-22B37AWY.mjs → chunk-NX74KN5X.mjs} +1 -1
  14. package/dist/{chunk-CZLUBJAI.mjs → chunk-QZKYGS74.mjs} +1 -1
  15. package/dist/{chunk-PAGN26EH.mjs → chunk-U5TKLHGW.mjs} +1 -1
  16. package/dist/cinematic/index.cjs +2 -2
  17. package/dist/cinematic/index.d.mts +1 -1
  18. package/dist/cinematic/index.d.ts +1 -1
  19. package/dist/cinematic/index.mjs +1 -1
  20. package/dist/devtools/index.cjs +1 -1
  21. package/dist/devtools/index.mjs +1 -1
  22. package/dist/frames/index.cjs +1 -0
  23. package/dist/frames/index.d.mts +42 -0
  24. package/dist/frames/index.d.ts +42 -0
  25. package/dist/frames/index.mjs +1 -0
  26. package/dist/group/index.mjs +1 -1
  27. package/dist/horizontal/index.mjs +1 -1
  28. package/dist/index.cjs +4 -4
  29. package/dist/index.mjs +1 -1
  30. package/dist/nuxt/index.mjs +1 -1
  31. package/dist/pin/index.mjs +1 -1
  32. package/dist/progress/index.mjs +1 -1
  33. package/dist/react/index.mjs +1 -1
  34. package/dist/reveal/index.mjs +1 -1
  35. package/dist/snap/index.mjs +1 -1
  36. package/dist/solid/index.mjs +1 -1
  37. package/dist/svelte/index.mjs +1 -1
  38. package/dist/text/index.mjs +1 -1
  39. package/dist/timeline/index.mjs +1 -1
  40. package/dist/video/index.mjs +1 -1
  41. package/dist/vue/index.mjs +1 -1
  42. package/dist/web-component/index.mjs +1 -1
  43. package/package.json +18 -2
  44. package/dist/chunk-BCV4RAIX.mjs +0 -1
  45. package/dist/chunk-BSW7W2Y5.mjs +0 -2
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import {a as a$3,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$6}from'../chunk-NYQJPPMP.mjs';import {a as a$7}from'../chunk-XNM3VKEK.mjs';import {a as a$5}from'../chunk-PAGN26EH.mjs';import {a as a$4}from'../chunk-VJ5ZU55P.mjs';import {b as b$2}from'../chunk-K6VATIJH.mjs';import'../chunk-V3Z6G5JE.mjs';import {a as a$2}from'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import {a,e,b,c}from'../chunk-NV6YTPHI.mjs';import {d as d$1}from'../chunk-THPTANES.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import B,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function Y(o,r={}){let[n,e$1]=useState(0),t=useRef(r);t.current=r;let s=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 a$3=l,{axis:i="y",scrollContainer:u,trigger:R={}}=t.current,c$1=typeof u=="string"?document.querySelector(u):u??null,U=a(R.start||"top bottom"),q=a(R.end||"bottom top"),S=0,y=0;function b$1(){return c$1?i==="x"?c$1.scrollLeft:c$1.scrollTop:i==="x"?window.scrollX:window.scrollY}function z(){return c$1?i==="x"?c$1.clientWidth:c$1.clientHeight:i==="x"?window.innerWidth:window.innerHeight}function P(){let p=a$2(a$3,c$1,i);({tStart:S,tEnd:y}=c(p,p.scroll,z(),U,q));}function G(){let{speed:p=1,easing:w="linear",once:W=false}=t.current,X=typeof w=="function"?w:d$1[w]??d$1.linear,C=b(b$1(),S,y,p),$=X(W?s.current=Math.max(s.current,C):C);e$1($);}P();let T=e(c$1??window,[a$3],()=>b(b$1(),S,y,Math.min(t.current.speed??1,1)),G,P),A=a$1(p=>{p&&(A(),T.off(),e$1(1));});return ()=>{A(),T.off();}},[]),n}function f(o,r,n){let e=useRef(r);e.current=r;let t=a$3(r);useEffect(()=>{if(!o.current)return;let s=n(o.current,b$1(e.current,()=>e.current));return ()=>s.destroy()},[t]);}var Z=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function d(o){let r={},n={};for(let[e,t]of Object.entries(o))(Z.test(e)?n:r)[e]=t;return [r,n]}function fe({children:o,className:r,style:n,...e}){let t=useRef(null),[s,l]=d(e);return f(t,s,b$2),jsx("div",{ref:t,className:r,style:n,...l,children:o})}function de({children:o,className:r,style:n,...e}){let t=useRef(null),[s,l]=d(e);return f(t,s,a$4),jsx("div",{ref:t,className:r,style:n,...l,children:o})}function ge({className:o,style:r,...n}){let e=useRef(null),[t,s]=d(n);return f(e,t,a$5),jsx("span",{ref:e,className:o,style:r,...s})}function Se({src:o,poster:r,className:n,style:e,muted:t=true,playsInline:s=true,...l}){let a=useRef(null),[i,u]=d(l);return f(a,i,a$6),jsx("video",{...u,ref:a,src:o,poster:r,className:n,style:e,muted:t,playsInline:s,preload:i.preload??"auto"})}function ye({children:o,as:r="p",className:n,style:e,...t}){let s=useRef(null),[l,a]=d(t);return f(s,l,a$7),B.createElement(r,{...a,ref:s,className:n,style:e},o)}export{de as ScrollAnimate,ge as ScrollCounter,fe as ScrollDraw,ye as ScrollText,Se as ScrollVideo,Y as useScrollDrawProgress};
2
+ import {a as a$3,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$6}from'../chunk-BRV2B2YW.mjs';import {a as a$7}from'../chunk-32ZCSGFZ.mjs';import {a as a$5}from'../chunk-U5TKLHGW.mjs';import {a as a$4}from'../chunk-7USW2XFB.mjs';import {b as b$2}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import {a as a$2}from'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import {a,e,b,c}from'../chunk-NV6YTPHI.mjs';import {d as d$1}from'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';import B,{useState,useRef,useEffect}from'react';import {jsx}from'react/jsx-runtime';function Y(o,r={}){let[n,e$1]=useState(0),t=useRef(r);t.current=r;let s=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 a$3=l,{axis:i="y",scrollContainer:u,trigger:R={}}=t.current,c$1=typeof u=="string"?document.querySelector(u):u??null,U=a(R.start||"top bottom"),q=a(R.end||"bottom top"),S=0,y=0;function b$1(){return c$1?i==="x"?c$1.scrollLeft:c$1.scrollTop:i==="x"?window.scrollX:window.scrollY}function z(){return c$1?i==="x"?c$1.clientWidth:c$1.clientHeight:i==="x"?window.innerWidth:window.innerHeight}function P(){let p=a$2(a$3,c$1,i);({tStart:S,tEnd:y}=c(p,p.scroll,z(),U,q));}function G(){let{speed:p=1,easing:w="linear",once:W=false}=t.current,X=typeof w=="function"?w:d$1[w]??d$1.linear,C=b(b$1(),S,y,p),$=X(W?s.current=Math.max(s.current,C):C);e$1($);}P();let T=e(c$1??window,[a$3],()=>b(b$1(),S,y,Math.min(t.current.speed??1,1)),G,P),A=a$1(p=>{p&&(A(),T.off(),e$1(1));});return ()=>{A(),T.off();}},[]),n}function f(o,r,n){let e=useRef(r);e.current=r;let t=a$3(r);useEffect(()=>{if(!o.current)return;let s=n(o.current,b$1(e.current,()=>e.current));return ()=>s.destroy()},[t]);}var Z=/^(data-|aria-)|^(id|role|title|tabIndex|lang|dir|hidden)$/;function d(o){let r={},n={};for(let[e,t]of Object.entries(o))(Z.test(e)?n:r)[e]=t;return [r,n]}function fe({children:o,className:r,style:n,...e}){let t=useRef(null),[s,l]=d(e);return f(t,s,b$2),jsx("div",{ref:t,className:r,style:n,...l,children:o})}function de({children:o,className:r,style:n,...e}){let t=useRef(null),[s,l]=d(e);return f(t,s,a$4),jsx("div",{ref:t,className:r,style:n,...l,children:o})}function ge({className:o,style:r,...n}){let e=useRef(null),[t,s]=d(n);return f(e,t,a$5),jsx("span",{ref:e,className:o,style:r,...s})}function Se({src:o,poster:r,className:n,style:e,muted:t=true,playsInline:s=true,...l}){let a=useRef(null),[i,u]=d(l);return f(a,i,a$6),jsx("video",{...u,ref:a,src:o,poster:r,className:n,style:e,muted:t,playsInline:s,preload:i.preload??"auto"})}function ye({children:o,as:r="p",className:n,style:e,...t}){let s=useRef(null),[l,a]=d(t);return f(s,l,a$7),B.createElement(r,{...a,ref:s,className:n,style:e},o)}export{de as ScrollAnimate,ge as ScrollCounter,fe as ScrollDraw,ye as ScrollText,Se as ScrollVideo,Y as useScrollDrawProgress};
@@ -1 +1 @@
1
- import {a}from'../chunk-VJ5ZU55P.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var M={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function N(e){let r={};e.opacity!==void 0&&(r.opacity=[e.opacity,1]);let t=[],n=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),n.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),n.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),n.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),n.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),n.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),n.push("rotateY(0deg)")),t.length>0&&(r.transform=[t.join(" "),n.join(" ")]),r}function P(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function u(e){let r=e.trim().split(/\s+/),[t,n]=r.length>1?r:/%$/.test(r[0])?["top",r[0]]:[r[0],"bottom"];return [t,/%$/.test(n)?parseFloat(n):n==="top"?0:n==="center"?50:100]}function y(e,r){let[t,n]=u(e);return `${t} ${+Math.max(0,n-r).toFixed(3)}%`}function Y(e){let r=NaN,t=0,n=0;return e.map(a=>{let o=a.getBoundingClientRect();return Math.abs(o.top-r)<=Math.max(8,Math.min(o.height,t||o.height)/2)?n++:(r=o.top,t=o.height,n=0),n})}var v={destroy:()=>{}};function A(e,r={}){if(typeof window>"u")return v;let t=P(e);if(!t.length)return b("scrollReveal: no elements found:",e),v;let{preset:n="fadeUp",from:a$1,stagger:o=.15,easing:b$1="ease-out",once:R=true,trigger:d,onEnter:x,onLeave:E}=r,S={...M[n],...a$1},X=N(S),s=d?.start||"top 88%",i=d?.end||"top 53%",f=Math.abs(u(s)[1]-u(i)[1]),g=Math.min(Math.max(o,0),1)*f,$=g>0?Y(t):t.map(()=>0),L=t.map((l,c)=>{let p=Math.min($[c]*g,f);return a(l,{props:X,easing:b$1,once:R,native:false,trigger:p>0?{start:y(s,p),end:y(i,p)}:{start:s,end:i},onEnter:c===0?x:void 0,onLeave:c===t.length-1?E:void 0})});return {destroy(){L.forEach(l=>l.destroy());}}}export{A as scrollReveal};
1
+ import {a}from'../chunk-7USW2XFB.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var M={fadeUp:{opacity:0,y:32},fadeDown:{opacity:0,y:-32},fadeLeft:{opacity:0,x:32},fadeRight:{opacity:0,x:-32},scale:{opacity:0,scale:.88},flip:{opacity:0,rotateX:20},flipX:{opacity:0,rotateY:20}};function N(e){let r={};e.opacity!==void 0&&(r.opacity=[e.opacity,1]);let t=[],n=[];return e.x!==void 0&&(t.push(`translateX(${e.x}px)`),n.push("translateX(0px)")),e.y!==void 0&&(t.push(`translateY(${e.y}px)`),n.push("translateY(0px)")),e.scale!==void 0&&(t.push(`scale(${e.scale})`),n.push("scale(1)")),e.rotate!==void 0&&(t.push(`rotate(${e.rotate}deg)`),n.push("rotate(0deg)")),e.rotateX!==void 0&&(t.push(`rotateX(${e.rotateX}deg)`),n.push("rotateX(0deg)")),e.rotateY!==void 0&&(t.push(`rotateY(${e.rotateY}deg)`),n.push("rotateY(0deg)")),t.length>0&&(r.transform=[t.join(" "),n.join(" ")]),r}function P(e){return typeof e=="string"?Array.from(document.querySelectorAll(e)):e instanceof NodeList?Array.from(e):e}function u(e){let r=e.trim().split(/\s+/),[t,n]=r.length>1?r:/%$/.test(r[0])?["top",r[0]]:[r[0],"bottom"];return [t,/%$/.test(n)?parseFloat(n):n==="top"?0:n==="center"?50:100]}function y(e,r){let[t,n]=u(e);return `${t} ${+Math.max(0,n-r).toFixed(3)}%`}function Y(e){let r=NaN,t=0,n=0;return e.map(a=>{let o=a.getBoundingClientRect();return Math.abs(o.top-r)<=Math.max(8,Math.min(o.height,t||o.height)/2)?n++:(r=o.top,t=o.height,n=0),n})}var v={destroy:()=>{}};function A(e,r={}){if(typeof window>"u")return v;let t=P(e);if(!t.length)return b("scrollReveal: no elements found:",e),v;let{preset:n="fadeUp",from:a$1,stagger:o=.15,easing:b$1="ease-out",once:R=true,trigger:d,onEnter:x,onLeave:E}=r,S={...M[n],...a$1},X=N(S),s=d?.start||"top 88%",i=d?.end||"top 53%",f=Math.abs(u(s)[1]-u(i)[1]),g=Math.min(Math.max(o,0),1)*f,$=g>0?Y(t):t.map(()=>0),L=t.map((l,c)=>{let p=Math.min($[c]*g,f);return a(l,{props:X,easing:b$1,once:R,native:false,trigger:p>0?{start:y(s,p),end:y(i,p)}:{start:s,end:i},onEnter:c===0?x:void 0,onLeave:c===t.length-1?E:void 0})});return {destroy(){L.forEach(l=>l.destroy());}}}export{A as scrollReveal};
@@ -1 +1 @@
1
- import {a}from'../chunk-AJ22VSHC.mjs';import {d}from'../chunk-THPTANES.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {a as a$3}from'../chunk-4DOJSIEQ.mjs';import {a as a$2,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var z={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function k(c){return typeof c=="string"?Array.from(document.querySelectorAll(c)):c instanceof NodeList?Array.from(c):c}function Z(c,$={}){if(typeof window>"u")return z;let i=k(c);if(!i.length)return b("scrollSnap: no sections found"),z;let{direction:B="vertical",duration:P=600,easing:g="ease-in-out",threshold:v=.3,scrollContainer:S,onSnap:_,respectReducedMotion:w=true}=$,M=w&&a(),G=w?a$1(e=>{M=e;}):()=>{},W=typeof g=="function"?g:d[g]??d["ease-in-out"],a$4=B==="horizontal",b$2=a$4?"Width":"Height",x=a$4?"left":"top",s=typeof S=="string"?document.querySelector(S):S??null,h=false,u=0;function m(){return s?a$4?s.scrollLeft:s.scrollTop:a$4?window.scrollX:window.scrollY}function L(e){let t=s??window,n=a$4?{left:e}:{top:e};try{t.scrollTo({...n,behavior:"instant"});}catch{t.scrollTo(n);}}function d$1(){let e=s??document.scrollingElement??document.documentElement,t=e[`scroll${b$2}`]-e[`client${b$2}`],n=s?s.getBoundingClientRect()[x]+s[a$4?"clientLeft":"clientTop"]:0,r=m();return i.map(l=>a$3(l.getBoundingClientRect()[x]-n+r,0,t))}function X(){let e=m(),t=d$1();return t.reduce((n,r,l)=>Math.abs(r-e)<Math.abs(t[n]-e)?l:n,0)}let o=X();function T(e){h=false,o=e,_?.(e);}function f(e){let t=a$3(e,0,i.length-1);cancelAnimationFrame(u),h=true;let n=d$1(),r=m(),l=n[t];if(Math.abs(r-l)<1)return T(t);if(M)return L(l),T(t);let Y=performance.now();function R(j){let C=a$3((j-Y)/P,0,1);L(r+(l-r)*W(C)),C<1?u=requestAnimationFrame(R):T(t);}u=requestAnimationFrame(R);}let E;function I(){h||(clearTimeout(E),E=setTimeout(()=>{let e=m(),t=d$1();if(Math.abs(e-t[o])<1)return;let n=i[o][`offset${b$2}`],r=e-t[o];r>n*v&&o<i.length-1?f(o+1):r<-(n*v)&&o>0?f(o-1):f(o);},100));}let A=s??window;return A.addEventListener("scroll",I,{passive:true}),a$2(i[0],{type:"snap",getProgress:()=>o/(i.length-1||1),getTrigger:()=>{let e=d$1();return {tStart:e[0],tEnd:e[e.length-1]}}}),{destroy(){cancelAnimationFrame(u),clearTimeout(E),A.removeEventListener("scroll",I),G(),b$1(i[0]);},snapTo:f,getCurrentIndex(){return o}}}export{Z as scrollSnap};
1
+ import {a}from'../chunk-AJ22VSHC.mjs';import {d}from'../chunk-THPTANES.mjs';import {a as a$3}from'../chunk-4DOJSIEQ.mjs';import {a as a$1}from'../chunk-5PJEKEEP.mjs';import {a as a$2,b as b$1}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var z={destroy:()=>{},snapTo:()=>{},getCurrentIndex:()=>0};function k(c){return typeof c=="string"?Array.from(document.querySelectorAll(c)):c instanceof NodeList?Array.from(c):c}function Z(c,$={}){if(typeof window>"u")return z;let i=k(c);if(!i.length)return b("scrollSnap: no sections found"),z;let{direction:B="vertical",duration:P=600,easing:g="ease-in-out",threshold:v=.3,scrollContainer:S,onSnap:_,respectReducedMotion:w=true}=$,M=w&&a(),G=w?a$1(e=>{M=e;}):()=>{},W=typeof g=="function"?g:d[g]??d["ease-in-out"],a$4=B==="horizontal",b$2=a$4?"Width":"Height",x=a$4?"left":"top",s=typeof S=="string"?document.querySelector(S):S??null,h=false,u=0;function m(){return s?a$4?s.scrollLeft:s.scrollTop:a$4?window.scrollX:window.scrollY}function L(e){let t=s??window,n=a$4?{left:e}:{top:e};try{t.scrollTo({...n,behavior:"instant"});}catch{t.scrollTo(n);}}function d$1(){let e=s??document.scrollingElement??document.documentElement,t=e[`scroll${b$2}`]-e[`client${b$2}`],n=s?s.getBoundingClientRect()[x]+s[a$4?"clientLeft":"clientTop"]:0,r=m();return i.map(l=>a$3(l.getBoundingClientRect()[x]-n+r,0,t))}function X(){let e=m(),t=d$1();return t.reduce((n,r,l)=>Math.abs(r-e)<Math.abs(t[n]-e)?l:n,0)}let o=X();function T(e){h=false,o=e,_?.(e);}function f(e){let t=a$3(e,0,i.length-1);cancelAnimationFrame(u),h=true;let n=d$1(),r=m(),l=n[t];if(Math.abs(r-l)<1)return T(t);if(M)return L(l),T(t);let Y=performance.now();function R(j){let C=a$3((j-Y)/P,0,1);L(r+(l-r)*W(C)),C<1?u=requestAnimationFrame(R):T(t);}u=requestAnimationFrame(R);}let E;function I(){h||(clearTimeout(E),E=setTimeout(()=>{let e=m(),t=d$1();if(Math.abs(e-t[o])<1)return;let n=i[o][`offset${b$2}`],r=e-t[o];r>n*v&&o<i.length-1?f(o+1):r<-(n*v)&&o>0?f(o-1):f(o);},100));}let A=s??window;return A.addEventListener("scroll",I,{passive:true}),a$2(i[0],{type:"snap",getProgress:()=>o/(i.length-1||1),getTrigger:()=>{let e=d$1();return {tStart:e[0],tEnd:e[e.length-1]}}}),{destroy(){cancelAnimationFrame(u),clearTimeout(E),A.removeEventListener("scroll",I),G(),b$1(i[0]);},snapTo:f,getCurrentIndex(){return o}}}export{Z as scrollSnap};
@@ -1 +1 @@
1
- import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-NYQJPPMP.mjs';import {a as a$4}from'../chunk-XNM3VKEK.mjs';import {a as a$2}from'../chunk-PAGN26EH.mjs';import {a as a$1}from'../chunk-VJ5ZU55P.mjs';import {b as b$1}from'../chunk-K6VATIJH.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';import {createEffect,onCleanup,untrack}from'solid-js';function o(e,f){let l,t,c,r;return createEffect(()=>{r=typeof e=="function"?e():e;let n=a(r);!l||n===c||(c=n,untrack(()=>{t?.destroy(),t=f(l,b(r,()=>r));}));}),onCleanup(()=>{t?.destroy(),t=c=void 0;}),{ref:n=>{l=n;},getInstance:()=>t}}function D(e={}){return o(e,b$1).ref}function V(e={}){return o(e,b$1)}function C(e){return o(e,a$1).ref}function H(e){return o(e,a$1)}function L(e){return o(e,a$2).ref}function g(e){return o(e,a$2)}function I(e={}){return o(e,a$3).ref}function k(e={}){return o(e,a$3)}function v(e={}){return o(e,a$4).ref}function j(e={}){return o(e,a$4)}export{H as createScrollAnimate,g as createScrollCounter,V as createScrollDraw,j as createScrollText,k as createScrollVideo,C as useScrollAnimate,L as useScrollCounter,D as useScrollDraw,v as useScrollText,I as useScrollVideo};
1
+ import {a,b}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-BRV2B2YW.mjs';import {a as a$4}from'../chunk-32ZCSGFZ.mjs';import {a as a$2}from'../chunk-U5TKLHGW.mjs';import {a as a$1}from'../chunk-7USW2XFB.mjs';import {b as b$1}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';import {createEffect,onCleanup,untrack}from'solid-js';function o(e,f){let l,t,c,r;return createEffect(()=>{r=typeof e=="function"?e():e;let n=a(r);!l||n===c||(c=n,untrack(()=>{t?.destroy(),t=f(l,b(r,()=>r));}));}),onCleanup(()=>{t?.destroy(),t=c=void 0;}),{ref:n=>{l=n;},getInstance:()=>t}}function D(e={}){return o(e,b$1).ref}function V(e={}){return o(e,b$1)}function C(e){return o(e,a$1).ref}function H(e){return o(e,a$1)}function L(e){return o(e,a$2).ref}function g(e){return o(e,a$2)}function I(e={}){return o(e,a$3).ref}function k(e={}){return o(e,a$3)}function v(e={}){return o(e,a$4).ref}function j(e={}){return o(e,a$4)}export{H as createScrollAnimate,g as createScrollCounter,V as createScrollDraw,j as createScrollText,k as createScrollVideo,C as useScrollAnimate,L as useScrollCounter,D as useScrollDraw,v as useScrollText,I as useScrollVideo};
@@ -1 +1 @@
1
- import {a as a$4,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-NYQJPPMP.mjs';import {a as a$2}from'../chunk-XNM3VKEK.mjs';import {a as a$1}from'../chunk-PAGN26EH.mjs';import {a}from'../chunk-VJ5ZU55P.mjs';import {b}from'../chunk-K6VATIJH.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';function r(n,t,o){let e=t,f=a$4(t),l=o(n,b$1(t,()=>e));return {update(c){e=c;let d=a$4(c);d!==f&&(f=d,l.destroy(),l=o(n,b$1(c,()=>e)));},destroy(){l.destroy();}}}function D(n,t={}){return r(n,t,b)}function I(n={}){let t=null;function o(e){return t=b(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function A(n,t){return r(n,t,a)}function H(n){let t=null;function o(e){return t=a(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function L(n,t){return r(n,t,a$1)}function M(n){let t=null;function o(e){return t=a$1(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function V(n,t={}){return r(n,t,a$3)}function g(n={}){let t=null;function o(e){return t=a$3(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function C(n,t={}){return r(n,t,a$2)}function v(n={}){let t=null;function o(e){return t=a$2(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}export{H as createScrollAnimate,M as createScrollCounter,I as createScrollDraw,v as createScrollText,g as createScrollVideo,A as scrollAnimate,L as scrollCounterAction,D as scrollDraw,C as scrollTextAction,V as scrollVideoAction};
1
+ import {a as a$4,b as b$1}from'../chunk-XSVTHCLO.mjs';import {a as a$3}from'../chunk-BRV2B2YW.mjs';import {a as a$2}from'../chunk-32ZCSGFZ.mjs';import {a as a$1}from'../chunk-U5TKLHGW.mjs';import {a}from'../chunk-7USW2XFB.mjs';import {b}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';function r(n,t,o){let e=t,f=a$4(t),l=o(n,b$1(t,()=>e));return {update(c){e=c;let d=a$4(c);d!==f&&(f=d,l.destroy(),l=o(n,b$1(c,()=>e)));},destroy(){l.destroy();}}}function D(n,t={}){return r(n,t,b)}function I(n={}){let t=null;function o(e){return t=b(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function A(n,t){return r(n,t,a)}function H(n){let t=null;function o(e){return t=a(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function L(n,t){return r(n,t,a$1)}function M(n){let t=null;function o(e){return t=a$1(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function V(n,t={}){return r(n,t,a$3)}function g(n={}){let t=null;function o(e){return t=a$3(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}function C(n,t={}){return r(n,t,a$2)}function v(n={}){let t=null;function o(e){return t=a$2(e,n),{destroy(){t?.destroy(),t=null;}}}return {action:o,getInstance:()=>t}}export{H as createScrollAnimate,M as createScrollCounter,I as createScrollDraw,v as createScrollText,g as createScrollVideo,A as scrollAnimate,L as scrollCounterAction,D as scrollDraw,C as scrollTextAction,V as scrollVideoAction};
@@ -1 +1 @@
1
- export{a as scrollText}from'../chunk-XNM3VKEK.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollText}from'../chunk-32ZCSGFZ.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
@@ -1,4 +1,4 @@
1
- import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-XC5NR2MU.mjs';import {a,e,c,b as b$2}from'../chunk-NV6YTPHI.mjs';import {d}from'../chunk-THPTANES.mjs';import {a as a$2}from'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$4,b as b$1}from'../chunk-BCV4RAIX.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var pe=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Re(c$1,de){let _={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return _;let q=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!q)return b("timeline: Container not found:",c$1),_;let l=q,{trigger:B={},speed:V=1,once:k=false,axis:h="y",tracks:U,onComplete:fe,repeat:x,repeatDelay:I=0,loop:R=false,loopDuration:ce=1500,debug:ue=false,label:me,respectReducedMotion:X=true}=de,ge=a(B.start||"top bottom"),ye=a(B.end||"bottom top"),w=x==="infinite"?1/0:x??0,i,L=false,C=R===true?1/0:typeof R=="number"?R:0,s=false,P=0,u=C,A=X&&a$1(),be=a$2(e=>{A=X&&e,A&&(s=false,clearTimeout(i),i=void 0);}),H=()=>C>0&&!A,z=new Map,G=U.map(e=>{let o=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,r=Array.from(l.querySelectorAll(e.selector)),n=r.map(t=>a$3(t));return r.forEach((t,a)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${n[a]}`,t.style.strokeDashoffset=`${n[a]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:r,lengths:n,easeFn:o}});function he(){for(let[e,o]of z)o?e.setAttribute("style",o):e.removeAttribute("style");}let v=0,T=0,Y=0,J=0,m=false,y=false,b$3=-1,d$1=0,p=null;ue&&(p=document.createElement("div"),Object.assign(p.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(p));function xe(e){if(!p)return;let o=me??(typeof c$1=="string"?c$1:"timeline"),r=U.map(({selector:n,from:t,to:a},j)=>{let g=pe[j%pe.length],D=a>t?Math.min(1,Math.max(0,(e-t)/(a-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
1
+ import {a as a$1}from'../chunk-AJ22VSHC.mjs';import {a as a$3}from'../chunk-XC5NR2MU.mjs';import {a,e,c,b as b$2}from'../chunk-NV6YTPHI.mjs';import {d}from'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import {a as a$2}from'../chunk-5PJEKEEP.mjs';import {a as a$4,b as b$1}from'../chunk-EBU6E26L.mjs';import {b}from'../chunk-LFSU6LR3.mjs';var pe=["#ff90e8","#ffc900","#5865F2","#22c55e","#f59e0b","#ef4444","#aaa","#60a5fa"];function Re(c$1,de){let _={destroy:()=>{},replay:()=>{},pause:()=>{},resume:()=>{},seek:()=>{},getProgress:()=>0};if(typeof window>"u")return _;let q=typeof c$1=="string"?document.querySelector(c$1):c$1;if(!q)return b("timeline: Container not found:",c$1),_;let l=q,{trigger:B={},speed:V=1,once:k=false,axis:h="y",tracks:U,onComplete:fe,repeat:x,repeatDelay:I=0,loop:R=false,loopDuration:ce=1500,debug:ue=false,label:me,respectReducedMotion:X=true}=de,ge=a(B.start||"top bottom"),ye=a(B.end||"bottom top"),w=x==="infinite"?1/0:x??0,i,L=false,C=R===true?1/0:typeof R=="number"?R:0,s=false,P=0,u=C,A=X&&a$1(),be=a$2(e=>{A=X&&e,A&&(s=false,clearTimeout(i),i=void 0);}),H=()=>C>0&&!A,z=new Map,G=U.map(e=>{let o=typeof e.easing=="function"?e.easing:d[e.easing??"linear"]??d.linear,r=Array.from(l.querySelectorAll(e.selector)),n=r.map(t=>a$3(t));return r.forEach((t,a)=>{z.has(t)||z.set(t,t.getAttribute("style")??""),t.style.strokeDasharray=`${n[a]}`,t.style.strokeDashoffset=`${n[a]}`,e.fade&&(t.style.opacity="0");}),{...e,elements:r,lengths:n,easeFn:o}});function he(){for(let[e,o]of z)o?e.setAttribute("style",o):e.removeAttribute("style");}let v=0,T=0,Y=0,J=0,m=false,y=false,b$3=-1,d$1=0,p=null;ue&&(p=document.createElement("div"),Object.assign(p.style,{position:"fixed",bottom:"16px",left:"16px",zIndex:"9999",background:"rgba(0,0,0,0.88)",backdropFilter:"blur(8px)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:"10px",padding:"10px 14px",fontFamily:"monospace",fontSize:"11px",color:"#fff",minWidth:"240px",pointerEvents:"none",lineHeight:"1.4"}),document.body.appendChild(p));function xe(e){if(!p)return;let o=me??(typeof c$1=="string"?c$1:"timeline"),r=U.map(({selector:n,from:t,to:a},j)=>{let g=pe[j%pe.length],D=a>t?Math.min(1,Math.max(0,(e-t)/(a-t))):0,S=Math.round(D*100);return `<div style="margin:4px 0">
2
2
  <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:2px">
3
3
  <span style="color:${g};max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${n}</span>
4
4
  <span style="color:#666;margin-left:8px">${S}%</span>
@@ -1 +1 @@
1
- export{a as scrollVideo}from'../chunk-NYQJPPMP.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{a as scrollVideo}from'../chunk-BRV2B2YW.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
@@ -1 +1 @@
1
- export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-OSGWGHQJ.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-NYQJPPMP.mjs';import'../chunk-XNM3VKEK.mjs';import'../chunk-PAGN26EH.mjs';import'../chunk-VJ5ZU55P.mjs';import'../chunk-K6VATIJH.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';
1
+ export{d as ScrollAnimate,f as ScrollCounter,b as ScrollDraw,j as ScrollText,h as ScrollVideo,c as useScrollAnimate,e as useScrollCounter,a as useScrollDraw,i as useScrollText,g as useScrollVideo}from'../chunk-5SKWSPQT.mjs';import'../chunk-XSVTHCLO.mjs';import'../chunk-BRV2B2YW.mjs';import'../chunk-32ZCSGFZ.mjs';import'../chunk-U5TKLHGW.mjs';import'../chunk-7USW2XFB.mjs';import'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';
@@ -1 +1 @@
1
- import {b}from'../chunk-K6VATIJH.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-BCV4RAIX.mjs';import'../chunk-LFSU6LR3.mjs';if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class s extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(d=>this.getAttribute(d)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let t={},n=this.getAttribute("speed"),r=this.getAttribute("easing"),a=this.getAttribute("stagger"),c=this.getAttribute("direction"),o=this.getAttribute("selector");n&&(t.speed=parseFloat(n)),r&&(t.easing=r),a&&(t.stagger=parseFloat(a)),c&&(t.direction=c),o&&(t.selector=o),this.hasAttribute("fade")&&(t.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(t.once=this.getAttribute("once")!=="false"),this.instance=b(this,t);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}s.observedAttributes=e,customElements.define("scroll-draw",s);}
1
+ import {b}from'../chunk-7XOFQCQE.mjs';import'../chunk-V3Z6G5JE.mjs';import'../chunk-UPWWULKI.mjs';import'../chunk-XC5NR2MU.mjs';import'../chunk-2PYLM3E7.mjs';import'../chunk-NV6YTPHI.mjs';import'../chunk-THPTANES.mjs';import'../chunk-4DOJSIEQ.mjs';import'../chunk-5PJEKEEP.mjs';import'../chunk-EBU6E26L.mjs';import'../chunk-LFSU6LR3.mjs';if(typeof HTMLElement<"u"&&typeof customElements<"u"&&!customElements.get("scroll-draw")){let e=["speed","easing","stagger","direction","selector","fade","once"];class s extends HTMLElement{constructor(){super(...arguments);this.instance=null;this.key="";}connectedCallback(){this.build();}attributeChangedCallback(){this.instance&&this.build();}build(){let i=JSON.stringify(e.map(d=>this.getAttribute(d)));if(this.instance&&i===this.key)return;this.instance?.destroy(),this.key=i;let t={},n=this.getAttribute("speed"),r=this.getAttribute("easing"),a=this.getAttribute("stagger"),c=this.getAttribute("direction"),o=this.getAttribute("selector");n&&(t.speed=parseFloat(n)),r&&(t.easing=r),a&&(t.stagger=parseFloat(a)),c&&(t.direction=c),o&&(t.selector=o),this.hasAttribute("fade")&&(t.fade=this.getAttribute("fade")!=="false"),this.hasAttribute("once")&&(t.once=this.getAttribute("once")!=="false"),this.instance=b(this,t);}disconnectedCallback(){this.instance?.destroy(),this.instance=null;}}s.observedAttributes=e,customElements.define("scroll-draw",s);}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "svg-scroll-draw",
3
- "version": "2.23.6",
4
- "description": "SVG line drawing on scroll, on the browser's own scroll timeline (CSS animation-timeline, JS fallback). Drop-in for AOS, ScrollReveal and vivus. Plus reveal, pin, snap, text, video. Zero dependencies. React, Vue, Svelte, Solid, Angular, Astro, vanilla JS",
3
+ "version": "2.24.0",
4
+ "description": "SVG line drawing on scroll, on the browser's own scroll timeline (CSS animation-timeline, JS fallback). Drop-in for AOS, ScrollReveal and vivus. Plus reveal, pin, snap, text, video and image-sequence scrub. Zero dependencies. React, Vue, Svelte, Solid, Angular, Astro, vanilla JS",
5
5
  "keywords": [
6
6
  "svg",
7
7
  "scroll",
@@ -54,6 +54,9 @@
54
54
  "split-text",
55
55
  "text-animation",
56
56
  "scroll-video",
57
+ "image-sequence",
58
+ "scroll-frames",
59
+ "canvas-animation",
57
60
  "counter",
58
61
  "gsap-alternative",
59
62
  "scrolltrigger-alternative",
@@ -137,6 +140,9 @@
137
140
  "video": [
138
141
  "./dist/video/index.d.ts"
139
142
  ],
143
+ "frames": [
144
+ "./dist/frames/index.d.ts"
145
+ ],
140
146
  "text": [
141
147
  "./dist/text/index.d.ts"
142
148
  ],
@@ -317,6 +323,16 @@
317
323
  "default": "./dist/video/index.cjs"
318
324
  }
319
325
  },
326
+ "./frames": {
327
+ "import": {
328
+ "types": "./dist/frames/index.d.mts",
329
+ "default": "./dist/frames/index.mjs"
330
+ },
331
+ "require": {
332
+ "types": "./dist/frames/index.d.ts",
333
+ "default": "./dist/frames/index.cjs"
334
+ }
335
+ },
320
336
  "./text": {
321
337
  "import": {
322
338
  "types": "./dist/text/index.d.mts",
@@ -1 +0,0 @@
1
- var n=Symbol.for("svg-scroll-draw.registry");function t(){let e=globalThis;return e[n]||(e[n]=new Map)}function o(e,r){t().set(e,r);}function s(e){t().delete(e);}function i(){return t()}export{o as a,s as b,i as c};
@@ -1,2 +0,0 @@
1
- import {d}from'./chunk-THPTANES.mjs';import {a as a$1}from'./chunk-5PJEKEEP.mjs';import {a,b as b$1}from'./chunk-BCV4RAIX.mjs';import {b}from'./chunk-LFSU6LR3.mjs';var M="http://www.w3.org/2000/svg",P="cinematic-photo",S=a=>a<0?0:a>1?1:a;function p(a){let s=parseFloat(a);return Number.isFinite(s)?S(s/100):0}function L(a){return d[a]??d.linear}var R={destroy:()=>{},getProgress:()=>0},T=class{constructor(s){if(typeof document>"u"){this.mount=null;return}this.mount=typeof s.wrapper=="string"?document.querySelector(s.wrapper):s.wrapper,this.mount||b("Cinematic: wrapper not found:",s.wrapper);}loadStory(s){let i=this.mount;if(typeof window>"u"||!i)return R;i.style.position="relative",i.style.height=s.totalHeight,i.style.display="block";let c=document.createElement("div");c.setAttribute("data-cinematic-stage",""),c.style.cssText="position:sticky;top:0;height:100vh;width:100%;overflow:hidden;display:block;",i.appendChild(c);let f=[];for(let e of s.scenes){if(e.background){let t=document.createElement("img");t.id=P,t.src=e.background,t.alt="",t.style.cssText="position:absolute;inset:0;width:100%;height:100%;object-fit:contain;opacity:0;pointer-events:none;",c.appendChild(t);}let n=e.animations.filter(t=>t.type==="draw");if(n.length){let t=document.createElementNS(M,"svg");t.setAttribute("viewBox",`0 0 ${s.canvas.width} ${s.canvas.height}`),t.setAttribute("preserveAspectRatio","xMidYMid meet"),t.style.cssText="position:absolute;inset:0;width:100%;height:100%;overflow:visible;",c.appendChild(t);for(let o of n){let r=document.createElementNS(M,"path");r.id=o.target.replace(/^#/,""),r.setAttribute("d",o.d),r.setAttribute("fill","none"),r.setAttribute("stroke",o.stroke),r.setAttribute("stroke-width",String(o.strokeWidth)),r.setAttribute("stroke-linecap","round"),r.setAttribute("stroke-linejoin","round");let b=o.length||r.getTotalLength?.()||0;r.style.strokeDasharray=String(b),r.style.strokeDashoffset=String(b),t.appendChild(r),f.push({kind:"draw",el:r,start:p(o.start),end:p(o.end),ease:L(o.easing),length:b});}}for(let t of e.animations){if(t.type!=="fade")continue;let o=c.querySelector(t.target)??document.querySelector(t.target);o&&(o.style.opacity=String(t.from),f.push({kind:"fade",el:o,start:p(t.start),end:p(t.end),ease:d["ease-in-out"]??d.linear,from:t.from,to:t.to}));}}let d$1=0,v=()=>{let e=i.offsetHeight-window.innerHeight;return e<=0?i.getBoundingClientRect().top<=0?1:0:S(-i.getBoundingClientRect().top/e)},l=e=>{for(let n of f){let t=n.end-n.start,o=t<=0?e>=n.end?1:0:S((e-n.start)/t),r=n.ease(o);n.kind==="draw"?n.el.style.strokeDashoffset=String(n.length*(1-r)):n.el.style.opacity=String(n.from+(n.to-n.from)*r);}};if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return l(1),{destroy:()=>{},getProgress:()=>1};let g=0,u=false,A=false,k=()=>{d$1=v(),l(d$1),u&&(g=requestAnimationFrame(k));},I=()=>{u||(u=true,g=requestAnimationFrame(k));},h=()=>{u=false,cancelAnimationFrame(g);},y=new IntersectionObserver(e=>{for(let n of e)A=n.isIntersecting,A?I():h();},{threshold:0});y.observe(c),d$1=v(),l(d$1),a(i,{type:"draw",getProgress:()=>d$1,getTrigger:()=>{let e=i.getBoundingClientRect().top+window.scrollY;return {tStart:e,tEnd:e+Math.max(0,i.offsetHeight-window.innerHeight)}}});let E=a$1(e=>{e&&(E(),h(),y.disconnect(),b$1(i),d$1=1,l(1));});return {destroy(){E(),h(),y.disconnect(),b$1(i);},getProgress:()=>d$1}}};
2
- export{T as a};