install gsap

This commit is contained in:
anielsen99 committed 2026-03-25 17:12:46 +01:00
1 parent 1fc081a048
commit d9b2762b72
182 files changed
+111895

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
/*!
* MotionPathHelper 3.14.2
* https://gsap.com
*
* @license Copyright 2025, GreenSock. All rights reserved.
* Subject to the terms at https://gsap.com/standard-license.
* @author: Jack Doyle, jack@greensock.com
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(t){"use strict";function n(t){return Math.round(1e5*t)/1e5||0}function o(t){return t.closed=Math.abs(t[0]-t[t.length-2])<.001&&Math.abs(t[1]-t[t.length-1])<.001}function p(t,e){return e.totalLength=t.totalLength,t.samples?(e.samples=t.samples.slice(0),e.lookup=t.lookup.slice(0),e.minLength=t.minLength,e.resolution=t.resolution):t.totalPoints&&(e.totalPoints=t.totalPoints),e}var P,w=/[achlmqstvz]|(-?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,S=/[\+\-]?\d*\.?\d+e[\+\-]?\d+/gi,B=Math.PI/180,F=Math.sin,W=Math.cos,U=Math.abs,Z=Math.sqrt,A=1e8;function copyRawPath(t){for(var e=[],n=0;n<t.length;n++)e[n]=p(t[n],t[n].slice(0));return p(t,e)}function transformRawPath(t,e,n,i,s,a,o){for(var r,h,l,c,d,u=t.length;-1<--u;)for(h=(r=t[u]).length,l=0;l<h;l+=2)c=r[l],d=r[l+1],r[l]=c*e+d*i+a,r[l+1]=c*n+d*s+o;return t._dirty=1,t}function arcToSegment(t,e,n,i,s,a,o,r,h){if(t!==r||e!==h){n=U(n),i=U(i);var l=s%360*B,c=W(l),d=F(l),u=Math.PI,p=2*u,g=(t-r)/2,f=(e-h)/2,_=c*g+d*f,m=-d*g+c*f,v=_*_,b=m*m,y=v/(n*n)+b/(i*i);1<y&&(n=Z(y)*n,i=Z(y)*i);var P=n*n,A=i*i,C=(P*A-P*b-A*v)/(P*b+A*v);C<0&&(C=0);var w=(a===o?-1:1)*Z(C),S=n*m/i*w,x=-i*_/n*w,D=c*S-d*x+(t+r)/2,k=d*S+c*x+(e+h)/2,E=(_-S)/n,M=(m-x)/i,T=(-_-S)/n,H=(-m-x)/i,R=E*E+M*M,N=(M<0?-1:1)*Math.acos(E/Z(R)),I=(E*H-M*T<0?-1:1)*Math.acos((E*T+M*H)/Z(R*(T*T+H*H)));isNaN(I)&&(I=u),!o&&0<I?I-=p:o&&I<0&&(I+=p),N%=p,I%=p;var O,L=Math.ceil(U(I)/(p/4)),X=[],q=I/L,G=4/3*F(q/2)/(1+W(q/2)),j=c*n,z=d*n,V=d*-i,Y=c*i;for(O=0;O<L;O++)_=W(s=N+O*q),m=F(s),E=W(s+=q),M=F(s),X.push(_-G*m,m+G*_,E+G*M,M-G*E,E,M);for(O=0;O<X.length;O+=2)_=X[O],m=X[O+1],X[O]=_*j+m*V+D,X[O+1]=_*z+m*Y+k;return X[O-2]=r,X[O-1]=h,X}}function stringToRawPath(t){function ud(t,e,n,i){d=(n-t)/3,u=(i-e)/3,h.push(t+d,e+u,n-d,i-u,n,i)}var e,n,i,s,a,r,h,l,c,d,u,p,g,f,_,m=(t+"").replace(S,function(t){var e=+t;return e<1e-4&&-1e-4<e?0:e}).match(w)||[],v=[],b=0,y=0,P=m.length,A=0,C="ERROR: malformed path: "+t;if(!t||!isNaN(m[0])||isNaN(m[1]))return console.log(C),v;for(e=0;e<P;e++)if(g=a,isNaN(m[e])?r=(a=m[e].toUpperCase())!==m[e]:e--,i=+m[e+1],s=+m[e+2],r&&(i+=b,s+=y),e||(l=i,c=s),"M"===a)h&&(h.length<8?--v.length:A+=h.length,o(h)),b=l=i,y=c=s,h=[i,s],v.push(h),e+=2,a="L";else if("C"===a)r||(b=y=0),(h=h||[0,0]).push(i,s,b+1*m[e+3],y+1*m[e+4],b+=1*m[e+5],y+=1*m[e+6]),e+=6;else if("S"===a)d=b,u=y,"C"!==g&&"S"!==g||(d+=b-h[h.length-4],u+=y-h[h.length-3]),r||(b=y=0),h.push(d,u,i,s,b+=1*m[e+3],y+=1*m[e+4]),e+=4;else if("Q"===a)d=b+2/3*(i-b),u=y+2/3*(s-y),r||(b=y=0),b+=1*m[e+3],y+=1*m[e+4],h.push(d,u,b+2/3*(i-b),y+2/3*(s-y),b,y),e+=4;else if("T"===a)d=b-h[h.length-4],u=y-h[h.length-3],h.push(b+d,y+u,i+2/3*(b+1.5*d-i),s+2/3*(y+1.5*u-s),b=i,y=s),e+=2;else if("H"===a)ud(b,y,b=i,y),e+=1;else if("V"===a)ud(b,y,b,y=i+(r?y-b:0)),e+=1;else if("L"===a||"Z"===a)"Z"===a&&(i=l,s=c,h.closed=!0),("L"===a||.5<U(b-i)||.5<U(y-s))&&(ud(b,y,i,s),"L"===a&&(e+=2)),b=i,y=s;else if("A"===a){if(f=m[e+4],_=m[e+5],d=m[e+6],u=m[e+7],n=7,1<f.length&&(f.length<3?(u=d,d=_,n--):(u=_,d=f.substr(2),n-=2),_=f.charAt(1),f=f.charAt(0)),p=arcToSegment(b,y,+m[e+1],+m[e+2],+m[e+3],+f,+_,(r?b:0)+1*d,(r?y:0)+1*u),e+=n,p)for(n=0;n<p.length;n++)h.push(p[n]);b=h[h.length-2],y=h[h.length-1]}else console.log(C);return(e=h.length)<6?(v.pop(),e=0):o(h),v.totalPoints=A+e,v}function bezierToPoints(t,e,n,i,s,a,o,r,h,l,c){var d,u=(t+n)/2,p=(e+i)/2,g=(n+s)/2,f=(i+a)/2,_=(s+o)/2,m=(a+r)/2,v=(u+g)/2,b=(p+f)/2,y=(g+_)/2,P=(f+m)/2,A=(v+y)/2,C=(b+P)/2,w=o-t,S=r-e,x=U((n-o)*S-(i-r)*w),D=U((s-o)*S-(a-r)*w);return l||(l=[t,e,o,r],c=2),l.splice(c||l.length-2,0,A,C),h*(w*w+S*S)<(x+D)*(x+D)&&(d=l.length,bezierToPoints(t,e,u,p,v,b,A,C,h,l,c),bezierToPoints(A,C,y,P,_,m,o,r,h,l,c+2+(l.length-d))),l}function pointsToSegment(t,e){U(t[0]-t[2])<1e-4&&U(t[1]-t[3])<1e-4&&(t=t.slice(2));var i,s,a,o,r,h,l,c,d,u,p,g,f,_,m=t.length-2,v=+t[0],b=+t[1],y=+t[2],P=+t[3],A=[v,b,v,b],C=y-v,w=P-b,S=t.nonSmooth||[],x=Math.abs(t[m]-v)<.001&&Math.abs(t[m+1]-b)<.001;if(!m)return[v,b,v,b,v,b,v,b];for(x&&(t.push(y,P),y=v,P=b,v=t[m-2],b=t[m-1],t.unshift(v,b),m+=4,S=[0,0].concat(S)),e=e||0===e?+e:1,a=2;a<m;a+=2)i=v,s=b,v=y,b=P,y=+t[a+2],P=+t[a+3],v===y&&b===P||(o=C,r=w,C=y-v,w=P-b,S[a]?A.push(v-(v-i)/4,b-(b-s)/4,v,b,v+(y-v)/4,b+(P-b)/4):(c=((h=Z(o*o+r*r))+(l=Z(C*C+w*w)))*e*.25/Z(Math.pow(C/l+o/h,2)+Math.pow(w/l+r/h,2)),p=v-((d=v-(v-i)*(h?c/h:0))+(((u=v+(y-v)*(l?c/l:0))-d)*(3*h/(h+l)+.5)/4||0)),_=b-((g=b-(b-s)*(h?c/h:0))+(((f=b+(P-b)*(l?c/l:0))-g)*(3*h/(h+l)+.5)/4||0)),A.push(n(d+p),n(g+_),n(v),n(b),n(u+p),n(f+_))));return v!==y||b!==P||A.length<4?A.push(n(y),n(P),n(y),n(P)):A.length-=2,2===A.length?A.push(v,b,v,b,v,b):x&&(A.splice(0,6),A.length-=6),A.closed=x,A}function simplifyPoints(t,e){var n,i,s,a,o,r,h,l=parseFloat(t[0]),c=parseFloat(t[1]),d=[l,c],u=t.length-2;for(e=Math.pow(e||1,2),n=2;n<u;n+=2)e<(a=l-(i=parseFloat(t[n])))*a+(o=c-(s=parseFloat(t[n+1]))Line truncated