gsap-react-marquee 0.1.9 → 0.2.1
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/LICENSE +21 -21
- package/README.md +48 -48
- package/dist/index.cjs.js +1 -45
- package/dist/index.d.ts +0 -186
- package/dist/index.esm.js +1 -45
- package/dist/types/components/gsap-react-marquee.styles.d.ts +2 -0
- package/dist/types/components/gsap-react-marquee.type.d.ts +19 -0
- package/dist/types/components/gsap-reactmarquee.utils.d.ts +8 -0
- package/dist/types/index.d.ts +3 -0
- package/package.json +65 -65
- package/dist/components/gsap-react-marquee.type.d.ts +0 -92
- package/dist/components/gsap-reactmarquee.utils.d.ts +0 -121
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.esm.css +0 -1
- package/dist/index.esm.js.map +0 -1
- /package/dist/{index.cjs.css → gsap-react-marquee.css} +0 -0
- /package/dist/{components → types/components}/gsap-react-marquee.d.ts +0 -0
package/dist/index.esm.js
CHANGED
|
@@ -1,45 +1 @@
|
|
|
1
|
-
import e,{forwardRef as t,useRef as n,useState as r,useLayoutEffect as o,useMemo as i}from"react";import{useGSAP as a}from"@gsap/react";import l from"gsap";import{clsx as s}from"clsx";import{twMerge as c}from"tailwind-merge";var u,f={exports:{}},p={};var d,h={};
|
|
2
|
-
/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.development.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/"production"===process.env.NODE_ENV?f.exports=function(){if(u)return p;u=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(t,n,r){var o=null;if(void 0!==r&&(o=""+r),void 0!==n.key&&(o=""+n.key),"key"in n)for(var i in r={},n)"key"!==i&&(r[i]=n[i]);else r=n;return n=r.ref,{$$typeof:e,type:t,key:o,ref:void 0!==n?n:null,props:r}}return p.Fragment=t,p.jsx=n,p.jsxs=n,p}():f.exports=(d||(d=1,"production"!==process.env.NODE_ENV&&function(){function t(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===S?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return"Fragment";case m:return"Profiler";case g:return"StrictMode";case b:return"Suspense";case w:return"SuspenseList";case _:return"Activity"}if("object"==typeof e)switch(e.tag,e.$$typeof){case p:return"Portal";case y:return(e.displayName||"Context")+".Provider";case v:return(e._context.displayName||"Context")+".Consumer";case x:var n=e.render;return(e=e.displayName)||(e=""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case T:return null!==(n=e.displayName||null)?n:t(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return t(e(n))}catch(e){}}return null}function n(e){return""+e}function r(e){try{n(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,o="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",o),n(e)}}function o(e){if(e===d)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===k)return"<...>";try{var n=t(e);return n?"<"+n+">":"<...>"}catch(e){return"<...>"}}function i(){return Error("react-stack-top-frame")}function a(){var e=t(this.type);return N[e]||(N[e]=!0),void 0!==(e=this.props.ref)?e:null}function l(e,n,o,i,l,u,p,d){var h,g=n.children;if(void 0!==g)if(i){if(P(g)){for(i=0;i<g.length;i++)s(g[i]);Object.freeze&&Object.freeze(g)}}else s(g);if(M.call(n,"key")){g=t(e);var m=Object.keys(n).filter(function(e){return"key"!==e});i=0<m.length?"{key: someKey, "+m.join(": ..., ")+": ...}":"{key: someKey}",D[g+i]||(m=0<m.length?"{"+m.join(": ..., ")+": ...}":"{}",D[g+i]=!0)}if(g=null,void 0!==o&&(r(o),g=""+o),function(e){if(M.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(n)&&(r(n.key),g=""+n.key),"key"in n)for(var v in o={},n)"key"!==v&&(o[v]=n[v]);else o=n;return g&&function(e){function t(){c||(c=!0)}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(o,"function"==typeof e&&(e.displayName||e.name)),function(e,t,n,r,o,i,l,s){return n=i.ref,e={$$typeof:f,type:e,key:t,props:i,_owner:o},null!==(void 0!==n?n:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:a}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,g,u,0,null===(h=E.A)?null:h.getOwner(),o,p,d)}function s(e){"object"==typeof e&&null!==e&&e.$$typeof===f&&e._store&&(e._store.validated=1)}var c,u=e,f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),y=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),S=Symbol.for("react.client.reference"),E=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,P=Array.isArray,C=console.createTask?console.createTask:function(){return null},N={},Y=(u={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(u,i)(),X=C(o(i)),D={};h.Fragment=d,h.jsx=function(e,t,n,r,i){var a=1e4>E.recentlyCreatedOwnerStacks++;return l(e,t,n,!1,0,i,a?Error("react-stack-top-frame"):Y,a?C(o(e)):X)},h.jsxs=function(e,t,n,r,i){var a=1e4>E.recentlyCreatedOwnerStacks++;return l(e,t,n,!0,0,i,a?Error("react-stack-top-frame"):Y,a?C(o(e)):X)}}()),h);var g,m,v,y,x,b,w,T,k,_=f.exports,S="transform",E=S+"Origin",M=function(e){var t=e.ownerDocument||e;!(S in e.style)&&"msTransform"in e.style&&(E=(S="msTransform")+"Origin");for(;t.parentNode&&(t=t.parentNode););if(m=window,w=new L,t){g=t,v=t.documentElement,y=t.body,(T=g.createElementNS("http://www.w3.org/2000/svg","g")).style.transform="none";var n=t.createElement("div"),r=t.createElement("div"),o=t&&(t.body||t.firstElementChild);o&&o.appendChild&&(o.appendChild(n),n.appendChild(r),n.setAttribute("style","position:static;transform:translate3d(0,0,1px)"),k=r.offsetParent!==n,o.removeChild(n))}return t},P=[],C=[],N=function(e){return e.ownerSVGElement||("svg"===(e.tagName+"").toLowerCase()?e:null)},Y=function e(t){return"fixed"===m.getComputedStyle(t).position||((t=t.parentNode)&&1===t.nodeType?e(t):void 0)},X=function e(t,n){if(t.parentNode&&(g||M(t))){var r=N(t),o=r?r.getAttribute("xmlns")||"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",i=r?n?"rect":"g":"div",a=2!==n?0:100,l=3===n?100:0,s="position:absolute;display:block;pointer-events:none;margin:0;padding:0;",c=g.createElementNS?g.createElementNS(o.replace(/^https/,"http"),i):g.createElement(i);return n&&(r?(b||(b=e(t)),c.setAttribute("width",.01),c.setAttribute("height",.01),c.setAttribute("transform","translate("+a+","+l+")"),b.appendChild(c)):(x||((x=e(t)).style.cssText=s),c.style.cssText=s+"width:0.1px;height:0.1px;top:"+l+"px;left:"+a+"px",x.appendChild(c))),c}throw"Need document and parent."},D=function(e,t){var n,r,o,i,a,l,s=N(e),c=e===s,u=s?P:C,f=e.parentNode,p=f&&!s&&f.shadowRoot&&f.shadowRoot.appendChild?f.shadowRoot:f;if(e===m)return e;if(u.length||u.push(X(e,1),X(e,2),X(e,3)),n=s?b:x,s)c?(o=function(e){var t,n=e.getCTM();return n||(t=e.style[S],e.style[S]="none",e.appendChild(T),n=T.getCTM(),e.removeChild(T),t?e.style[S]=t:e.style.removeProperty(S.replace(/([A-Z])/g,"-$1").toLowerCase())),n||w.clone()}(e),i=-o.e/o.a,a=-o.f/o.d,r=w):e.getBBox?(o=e.getBBox(),i=(r=(r=e.transform?e.transform.baseVal:{}).numberOfItems?r.numberOfItems>1?function(e){for(var t=new L,n=0;n<e.numberOfItems;n++)t.multiply(e.getItem(n).matrix);return t}(r):r.getItem(0).matrix:w).a*o.x+r.c*o.y,a=r.b*o.x+r.d*o.y):(r=new L,i=a=0),(c?s:f).appendChild(n),n.setAttribute("transform","matrix("+r.a+","+r.b+","+r.c+","+r.d+","+(r.e+i)+","+(r.f+a)+")");else{if(i=a=0,k)for(r=e.offsetParent,o=e;o&&(o=o.parentNode)&&o!==r&&o.parentNode;)(m.getComputedStyle(o)[S]+"").length>4&&(i=o.offsetLeft,a=o.offsetTop,o=0);if("absolute"!==(l=m.getComputedStyle(e)).position&&"fixed"!==l.position)for(r=e.offsetParent;f&&f!==r;)i+=f.scrollLeft||0,a+=f.scrollTop||0,f=f.parentNode;(o=n.style).top=e.offsetTop-a+"px",o.left=e.offsetLeft-i+"px",o[S]=l[S],o[E]=l[E],o.position="fixed"===l.position?"fixed":"absolute",p.appendChild(n)}return n},O=function(e,t,n,r,o,i,a){return e.a=t,e.b=n,e.c=r,e.d=o,e.e=i,e.f=a,e},L=function(){function e(e,t,n,r,o,i){void 0===e&&(e=1),void 0===t&&(t=0),void 0===n&&(n=0),void 0===r&&(r=1),void 0===o&&(o=0),void 0===i&&(i=0),O(this,e,t,n,r,o,i)}var t=e.prototype;return t.inverse=function(){var e=this.a,t=this.b,n=this.c,r=this.d,o=this.e,i=this.f,a=e*r-t*n||1e-10;return O(this,r/a,-t/a,-n/a,e/a,(n*i-r*o)/a,-(e*i-t*o)/a)},t.multiply=function(e){var t=this.a,n=this.b,r=this.c,o=this.d,i=this.e,a=this.f,l=e.a,s=e.c,c=e.b,u=e.d,f=e.e,p=e.f;return O(this,l*t+c*r,l*n+c*o,s*t+u*r,s*n+u*o,i+f*t+p*r,a+f*n+p*o)},t.clone=function(){return new e(this.a,this.b,this.c,this.d,this.e,this.f)},t.equals=function(e){var t=this.a,n=this.b,r=this.c,o=this.d,i=this.e,a=this.f;return t===e.a&&n===e.b&&r===e.c&&o===e.d&&i===e.e&&a===e.f},t.apply=function(e,t){void 0===t&&(t={});var n=e.x,r=e.y,o=this.a,i=this.b,a=this.c,l=this.d,s=this.e,c=this.f;return t.x=n*o+r*a+s||0,t.y=n*i+r*l+c||0,t},e}();
|
|
11
|
-
/*!
|
|
12
|
-
* matrix 3.13.0
|
|
13
|
-
* https://gsap.com
|
|
14
|
-
*
|
|
15
|
-
* Copyright 2008-2025, GreenSock. All rights reserved.
|
|
16
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
17
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
18
|
-
*/function A(e,t,n,r){if(!e||!e.parentNode||(g||M(e)).documentElement===e)return new L;var o=function(e){for(var t,n;e&&e!==y;)(n=e._gsap)&&n.uncache&&n.get(e,"x"),n&&!n.scaleX&&!n.scaleY&&n.renderTransform&&(n.scaleX=n.scaleY=1e-4,n.renderTransform(1,n),t?t.push(n):t=[n]),e=e.parentNode;return t}(e),i=N(e)?P:C,a=D(e),l=i[0].getBoundingClientRect(),s=i[1].getBoundingClientRect(),c=i[2].getBoundingClientRect(),u=a.parentNode,f=Y(e),p=new L((s.left-l.left)/100,(s.top-l.top)/100,(c.left-l.left)/100,(c.top-l.top)/100,l.left+(f?0:m.pageXOffset||g.scrollLeft||v.scrollLeft||y.scrollLeft||0),l.top+(f?0:m.pageYOffset||g.scrollTop||v.scrollTop||y.scrollTop||0));if(u.removeChild(a),o)for(l=o.length;l--;)(s=o[l]).scaleX=s.scaleY=0,s.renderTransform(1,s);return t?p.inverse():p}function R(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var F,B,W,H,I,j,$,q,z,V,G,U,K,Z,J,Q,ee,te,ne,re,oe,ie,ae=0,le=function(){return"undefined"!=typeof window},se=function(){return F||le()&&(F=window.gsap)&&F.registerPlugin&&F},ce=function(e){return"function"==typeof e},ue=function(e){return"object"==typeof e},fe=function(e){return void 0===e},pe=function(){return!1},de="transform",he="transformOrigin",ge=function(e){return Math.round(1e4*e)/1e4},me=Array.isArray,ve=function(e,t){var n=W.createElementNS?W.createElementNS("http://www.w3.org/1999/xhtml".replace(/^https/,"http"),e):W.createElement(e);return n.style?n:W.createElement(e)},ye=180/Math.PI,xe=1e20,be=new L,we=Date.now||function(){return(new Date).getTime()},Te=[],ke={},_e=0,Se=/^(?:a|input|textarea|button|select)$/i,Ee=0,Me={},Pe={},Ce=function(e,t){var n,r={};for(n in e)r[n]=t?e[n]*t:e[n];return r},Ne=function e(t,n){for(var r,o=t.length;o--;)n?t[o].style.touchAction=n:t[o].style.removeProperty("touch-action"),(r=t[o].children)&&r.length&&e(r,n)},Ye=function(){return Te.forEach(function(e){return e()})},Xe=function(){return!Te.length&&F.ticker.remove(Ye)},De=function(e){for(var t=Te.length;t--;)Te[t]===e&&Te.splice(t,1);F.to(Xe,{overwrite:!0,delay:15,duration:0,onComplete:Xe,data:"_draggable"})},Oe=function(e,t,n,r){if(e.addEventListener){var o=K[t];r=r||(G?{passive:!1}:null),e.addEventListener(o||t,n,r),o&&t!==o&&e.addEventListener(t,n,r)}},Le=function(e,t,n,r){if(e.removeEventListener){var o=K[t];e.removeEventListener(o||t,n,r),o&&t!==o&&e.removeEventListener(t,n,r)}},Ae=function(e){e.preventDefault&&e.preventDefault(),e.preventManipulation&&e.preventManipulation()},Re=function e(t){Z=t.touches&&ae<t.touches.length,Le(t.target,"touchend",e)},Fe=function(e){Z=e.touches&&ae<e.touches.length,Oe(e.target,"touchend",Re)},Be=function(e){return B.pageYOffset||e.scrollTop||e.documentElement.scrollTop||e.body.scrollTop||0},We=function(e){return B.pageXOffset||e.scrollLeft||e.documentElement.scrollLeft||e.body.scrollLeft||0},He=function e(t,n){Oe(t,"scroll",n),je(t.parentNode)||e(t.parentNode,n)},Ie=function e(t,n){Le(t,"scroll",n),je(t.parentNode)||e(t.parentNode,n)},je=function(e){return!(e&&e!==H&&9!==e.nodeType&&e!==W.body&&e!==B&&e.nodeType&&e.parentNode)},$e=function(e,t){var n="x"===t?"Width":"Height",r="scroll"+n,o="client"+n;return Math.max(0,je(e)?Math.max(H[r],I[r])-(B["inner"+n]||H[o]||I[o]):e[r]-e[o])},qe=function e(t,n){var r=$e(t,"x"),o=$e(t,"y");je(t)?t=Pe:e(t.parentNode,n),t._gsMaxScrollX=r,t._gsMaxScrollY=o,n||(t._gsScrollX=t.scrollLeft||0,t._gsScrollY=t.scrollTop||0)},ze=function(e,t,n){var r=e.style;r&&(fe(r[t])&&(t=z(t,e)||t),null==n?r.removeProperty&&r.removeProperty(t.replace(/([A-Z])/g,"-$1").toLowerCase()):r[t]=n)},Ve=function(e){return B.getComputedStyle(e instanceof Element?e:e.host||(e.parentNode||{}).host||e)},Ge={},Ue=function(e){if(e===B)return Ge.left=Ge.top=0,Ge.width=Ge.right=H.clientWidth||e.innerWidth||I.clientWidth||0,Ge.height=Ge.bottom=(e.innerHeight||0)-20<H.clientHeight?H.clientHeight:e.innerHeight||I.clientHeight||0,Ge;var t=e.ownerDocument||W,n=fe(e.pageX)?e.nodeType||fe(e.left)||fe(e.top)?V(e)[0].getBoundingClientRect():e:{left:e.pageX-We(t),top:e.pageY-Be(t),right:e.pageX-We(t)+1,bottom:e.pageY-Be(t)+1};return fe(n.right)&&!fe(n.width)?(n.right=n.left+n.width,n.bottom=n.top+n.height):fe(n.width)&&(n={width:n.right-n.left,height:n.bottom-n.top,right:n.right,left:n.left,bottom:n.bottom,top:n.top}),n},Ke=function(e,t,n){var r,o=e.vars,i=o[n],a=e._listeners[t];return ce(i)&&(r=i.apply(o.callbackScope||e,o[n+"Params"]||[e.pointerEvent])),a&&!1===e.dispatchEvent(t)&&(r=!1),r},Ze=function(e,t){var n,r,o,i=V(e)[0];return i.nodeType||i===B?Qe(i,t):fe(e.left)?{left:r=e.min||e.minX||e.minRotation||0,top:n=e.min||e.minY||0,width:(e.max||e.maxX||e.maxRotation||0)-r,height:(e.max||e.maxY||0)-n}:(o={x:0,y:0},{left:e.left-o.x,top:e.top-o.y,width:e.width,height:e.height})},Je={},Qe=function(e,t){t=V(t)[0];var n,r,o,i,a,l,s,c,u,f,p,d,h,g=e.getBBox&&e.ownerSVGElement,m=e.ownerDocument||W;if(e===B)o=Be(m),r=(n=We(m))+(m.documentElement.clientWidth||e.innerWidth||m.body.clientWidth||0),i=o+((e.innerHeight||0)-20<m.documentElement.clientHeight?m.documentElement.clientHeight:e.innerHeight||m.body.clientHeight||0);else{if(t===B||fe(t))return e.getBoundingClientRect();n=o=0,g?(p=(f=e.getBBox()).width,d=f.height):(e.viewBox&&(f=e.viewBox.baseVal)&&(n=f.x||0,o=f.y||0,p=f.width,d=f.height),p||(f="border-box"===(h=Ve(e)).boxSizing,p=(parseFloat(h.width)||e.clientWidth||0)+(f?0:parseFloat(h.borderLeftWidth)+parseFloat(h.borderRightWidth)),d=(parseFloat(h.height)||e.clientHeight||0)+(f?0:parseFloat(h.borderTopWidth)+parseFloat(h.borderBottomWidth)))),r=p,i=d}return e===t?{left:n,top:o,width:r-n,height:i-o}:(l=(a=A(t,!0).multiply(A(e))).apply({x:n,y:o}),s=a.apply({x:r,y:o}),c=a.apply({x:r,y:i}),u=a.apply({x:n,y:i}),{left:n=Math.min(l.x,s.x,c.x,u.x),top:o=Math.min(l.y,s.y,c.y,u.y),width:Math.max(l.x,s.x,c.x,u.x)-n,height:Math.max(l.y,s.y,c.y,u.y)-o})},et=function(e,t,n,r,o,i){var a,l,s,c={};if(t)if(1!==o&&t instanceof Array){if(c.end=a=[],s=t.length,ue(t[0]))for(l=0;l<s;l++)a[l]=Ce(t[l],o);else for(l=0;l<s;l++)a[l]=t[l]*o;n+=1.1,r-=1.1}else ce(t)?c.end=function(n){var r,i,a=t.call(e,n);if(1!==o)if(ue(a)){for(i in r={},a)r[i]=a[i]*o;a=r}else a*=o;return a}:c.end=t;return(n||0===n)&&(c.max=n),(r||0===r)&&(c.min=r),i&&(c.velocity=0),c},tt=function e(t){var n;return!(!t||!t.getAttribute||t===I)&&(!("true"!==(n=t.getAttribute("data-clickable"))&&("false"===n||!Se.test(t.nodeName+"")&&"true"!==t.getAttribute("contentEditable")))||e(t.parentNode))},nt=function(e,t){for(var n,r=e.length;r--;)(n=e[r]).ondragstart=n.onselectstart=t?null:pe,F.set(n,{lazy:!0,userSelect:t?"text":"none"})},rt=function e(t){return"fixed"===Ve(t).position||((t=t.parentNode)&&1===t.nodeType?e(t):void 0)},ot=function(e,t){e=F.utils.toArray(e)[0],t=t||{};var n,r,o,i,a,l,s=document.createElement("div"),c=s.style,u=e.firstChild,f=0,p=0,d=e.scrollTop,h=e.scrollLeft,g=e.scrollWidth,m=e.scrollHeight,v=0,y=0,x=0;oe&&!1!==t.force3D?(a="translate3d(",l="px,0px)"):de&&(a="translate(",l="px)"),this.scrollTop=function(e,t){if(!arguments.length)return-this.top();this.top(-e,t)},this.scrollLeft=function(e,t){if(!arguments.length)return-this.left();this.left(-e,t)},this.left=function(n,r){if(!arguments.length)return-(e.scrollLeft+p);var o=e.scrollLeft-h,i=p;if((o>2||o<-2)&&!r)return h=e.scrollLeft,F.killTweensOf(this,{left:1,scrollLeft:1}),this.left(-h),void(t.onKill&&t.onKill());(n=-n)<0?(p=n-.5|0,n=0):n>y?(p=n-y|0,n=y):p=0,(p||i)&&(this._skip||(c[de]=a+-p+"px,"+-f+l),p+v>=0&&(c.paddingRight=p+v+"px")),e.scrollLeft=0|n,h=e.scrollLeft},this.top=function(n,r){if(!arguments.length)return-(e.scrollTop+f);var o=e.scrollTop-d,i=f;if((o>2||o<-2)&&!r)return d=e.scrollTop,F.killTweensOf(this,{top:1,scrollTop:1}),this.top(-d),void(t.onKill&&t.onKill());(n=-n)<0?(f=n-.5|0,n=0):n>x?(f=n-x|0,n=x):f=0,(f||i)&&(this._skip||(c[de]=a+-p+"px,"+-f+l)),e.scrollTop=0|n,d=e.scrollTop},this.maxScrollTop=function(){return x},this.maxScrollLeft=function(){return y},this.disable=function(){for(u=s.firstChild;u;)i=u.nextSibling,e.appendChild(u),u=i;e===s.parentNode&&e.removeChild(s)},this.enable=function(){if((u=e.firstChild)!==s){for(;u;)i=u.nextSibling,s.appendChild(u),u=i;e.appendChild(s),this.calibrate()}},this.calibrate=function(t){var i,a,l,u=e.clientWidth===n;d=e.scrollTop,h=e.scrollLeft,u&&e.clientHeight===r&&s.offsetHeight===o&&g===e.scrollWidth&&m===e.scrollHeight&&!t||((f||p)&&(a=this.left(),l=this.top(),this.left(-e.scrollLeft),this.top(-e.scrollTop)),i=Ve(e),u&&!t||(c.display="block",c.width="auto",c.paddingRight="0px",(v=Math.max(0,e.scrollWidth-e.clientWidth))&&(v+=parseFloat(i.paddingLeft)+(ie?parseFloat(i.paddingRight):0))),c.display="inline-block",c.position="relative",c.overflow="visible",c.verticalAlign="top",c.boxSizing="content-box",c.width="100%",c.paddingRight=v+"px",ie&&(c.paddingBottom=i.paddingBottom),n=e.clientWidth,r=e.clientHeight,g=e.scrollWidth,m=e.scrollHeight,y=e.scrollWidth-n,x=e.scrollHeight-r,o=s.offsetHeight,c.display="block",(a||l)&&(this.left(a),this.top(l)))},this.content=s,this.element=e,this._skip=!1,this.enable()},it=function(e){if(le()&&document.body){var t=window&&window.navigator;B=window,W=document,H=W.documentElement,I=W.body,j=ve("div"),te=!!window.PointerEvent,($=ve("div")).style.cssText="visibility:hidden;height:1px;top:-1px;pointer-events:none;position:relative;clear:both;cursor:grab",ee="grab"===$.style.cursor?"grab":"move",J=t&&-1!==t.userAgent.toLowerCase().indexOf("android"),U="ontouchstart"in H&&"orientation"in B||t&&(t.MaxTouchPoints>0||t.msMaxTouchPoints>0),r=ve("div"),o=ve("div"),i=o.style,a=I,i.display="inline-block",i.position="relative",r.style.cssText="width:90px;height:40px;padding:10px;overflow:auto;visibility:hidden",r.appendChild(o),a.appendChild(r),n=o.offsetHeight+18>r.scrollHeight,a.removeChild(r),ie=n,K=function(e){for(var t=e.split(","),n=(("onpointerdown"in j?"pointerdown,pointermove,pointerup,pointercancel":"onmspointerdown"in j?"MSPointerDown,MSPointerMove,MSPointerUp,MSPointerCancel":e).split(",")),r={},o=4;--o>-1;)r[t[o]]=n[o],r[n[o]]=t[o];try{H.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){G=1}}))}catch(e){}return r}("touchstart,touchmove,touchend,touchcancel"),Oe(W,"touchcancel",pe),Oe(B,"touchmove",pe),I&&I.addEventListener("touchstart",pe),Oe(W,"contextmenu",function(){for(var e in ke)ke[e].isPressed&&ke[e].endDrag()}),F=q=se()}var n,r,o,i,a;F&&(Q=F.plugins.inertia,ne=F.core.context||function(){},z=F.utils.checkPrefix,de=z(de),he=z(he),V=F.utils.toArray,re=F.core.getStyleSaver,oe=!!z("perspective"))},at=function(e){var t,n;function r(t,n){var o;o=e.call(this)||this,q||it(),t=V(t)[0],o.styles=re&&re(t,"transform,left,top"),Q||(Q=F.plugins.inertia),o.vars=n=Ce(n||{}),o.target=t,o.x=o.y=o.rotation=0,o.dragResistance=parseFloat(n.dragResistance)||0,o.edgeResistance=isNaN(n.edgeResistance)?1:parseFloat(n.edgeResistance)||0,o.lockAxis=n.lockAxis,o.autoScroll=n.autoScroll||0,o.lockedAxis=null,o.allowEventDefault=!!n.allowEventDefault,F.getProperty(t,"x");var i,a,l,s,c,u,f,p,d,h,g,m,v,y,x,b,w,T,k,_,S,E,M,P,C,N,Y,X,D,O,I,j,z,G=(n.type||"x,y").toLowerCase(),oe=~G.indexOf("x")||~G.indexOf("y"),ie=-1!==G.indexOf("rotation"),le=ie?"rotation":oe?"x":"left",se=oe?"y":"top",pe=!(!~G.indexOf("x")&&!~G.indexOf("left")&&"scroll"!==G),de=!(!~G.indexOf("y")&&!~G.indexOf("top")&&"scroll"!==G),ve=n.minimumMovement||2,Se=R(o),Xe=V(n.trigger||n.handle||t),Re={},$e=0,Ge=!1,Qe=n.autoScrollMarginTop||40,at=n.autoScrollMarginRight||40,lt=n.autoScrollMarginBottom||40,st=n.autoScrollMarginLeft||40,ct=n.clickableTest||tt,ut=0,ft=t._gsap||F.core.getCache(t),pt=rt(t),dt=function(e,n){return parseFloat(ft.get(t,e,n))},ht=t.ownerDocument||W,gt=function(e){return Ae(e),e.stopImmediatePropagation&&e.stopImmediatePropagation(),!1},mt=function e(n){if(Se.autoScroll&&Se.isDragging&&(Ge||w)){var r,o,i,l,s,c,u,f,d=t,h=15*Se.autoScroll;for(Ge=!1,Pe.scrollTop=null!=B.pageYOffset?B.pageYOffset:null!=ht.documentElement.scrollTop?ht.documentElement.scrollTop:ht.body.scrollTop,Pe.scrollLeft=null!=B.pageXOffset?B.pageXOffset:null!=ht.documentElement.scrollLeft?ht.documentElement.scrollLeft:ht.body.scrollLeft,l=Se.pointerX-Pe.scrollLeft,s=Se.pointerY-Pe.scrollTop;d&&!o;)r=(o=je(d.parentNode))?Pe:d.parentNode,i=o?{bottom:Math.max(H.clientHeight,B.innerHeight||0),right:Math.max(H.clientWidth,B.innerWidth||0),left:0,top:0}:r.getBoundingClientRect(),c=u=0,de&&((f=r._gsMaxScrollY-r.scrollTop)<0?u=f:s>i.bottom-lt&&f?(Ge=!0,u=Math.min(f,h*(1-Math.max(0,i.bottom-s)/lt)|0)):s<i.top+Qe&&r.scrollTop&&(Ge=!0,u=-Math.min(r.scrollTop,h*(1-Math.max(0,s-i.top)/Qe)|0)),u&&(r.scrollTop+=u)),pe&&((f=r._gsMaxScrollX-r.scrollLeft)<0?c=f:l>i.right-at&&f?(Ge=!0,c=Math.min(f,h*(1-Math.max(0,i.right-l)/at)|0)):l<i.left+st&&r.scrollLeft&&(Ge=!0,c=-Math.min(r.scrollLeft,h*(1-Math.max(0,l-i.left)/st)|0)),c&&(r.scrollLeft+=c)),o&&(c||u)&&(B.scrollTo(r.scrollLeft,r.scrollTop),Ct(Se.pointerX+c,Se.pointerY+u)),d=r}if(w){var g=Se.x,m=Se.y;ie?(Se.deltaX=g-parseFloat(ft.rotation),Se.rotation=g,ft.rotation=g+"deg",ft.renderTransform(1,ft)):a?(de&&(Se.deltaY=m-a.top(),a.top(m)),pe&&(Se.deltaX=g-a.left(),a.left(g))):oe?(de&&(Se.deltaY=m-parseFloat(ft.y),ft.y=m+"px"),pe&&(Se.deltaX=g-parseFloat(ft.x),ft.x=g+"px"),ft.renderTransform(1,ft)):(de&&(Se.deltaY=m-parseFloat(t.style.top||0),t.style.top=m+"px"),pe&&(Se.deltaX=g-parseFloat(t.style.left||0),t.style.left=g+"px")),!p||n||X||(X=!0,!1===Ke(Se,"drag","onDrag")&&(pe&&(Se.x-=Se.deltaX),de&&(Se.y-=Se.deltaY),e(!0)),X=!1)}w=!1},vt=function(e,n){var r,o,i=Se.x,l=Se.y;t._gsap||(ft=F.core.getCache(t)),ft.uncache&&F.getProperty(t,"x"),oe?(Se.x=parseFloat(ft.x),Se.y=parseFloat(ft.y)):ie?Se.x=Se.rotation=parseFloat(ft.rotation):a?(Se.y=a.top(),Se.x=a.left()):(Se.y=parseFloat(t.style.top||(o=Ve(t))&&o.top)||0,Se.x=parseFloat(t.style.left||(o||{}).left)||0),(k||_||S)&&!n&&(Se.isDragging||Se.isThrowing)&&(S&&(Me.x=Se.x,Me.y=Se.y,(r=S(Me)).x!==Se.x&&(Se.x=r.x,w=!0),r.y!==Se.y&&(Se.y=r.y,w=!0)),k&&(r=k(Se.x))!==Se.x&&(Se.x=r,ie&&(Se.rotation=r),w=!0),_&&((r=_(Se.y))!==Se.y&&(Se.y=r),w=!0)),w&&mt(!0),e||(Se.deltaX=Se.x-i,Se.deltaY=Se.y-l,Ke(Se,"throwupdate","onThrowUpdate"))},yt=function(e,t,n,r){return null==t&&(t=-xe),null==n&&(n=xe),ce(e)?function(o){var i=Se.isPressed?1-Se.edgeResistance:1;return e.call(Se,(o>n?n+(o-n)*i:o<t?t+(o-t)*i:o)*r)*r}:me(e)?function(r){for(var o,i,a=e.length,l=0,s=xe;--a>-1;)(i=(o=e[a])-r)<0&&(i=-i),i<s&&o>=t&&o<=n&&(l=a,s=i);return e[l]}:isNaN(e)?function(e){return e}:function(){return e*r}},xt=function(){var e,r,o,i;f=!1,a?(a.calibrate(),Se.minX=g=-a.maxScrollLeft(),Se.minY=v=-a.maxScrollTop(),Se.maxX=h=Se.maxY=m=0,f=!0):n.bounds&&(e=Ze(n.bounds,t.parentNode),ie?(Se.minX=g=e.left,Se.maxX=h=e.left+e.width,Se.minY=v=Se.maxY=m=0):fe(n.bounds.maxX)&&fe(n.bounds.maxY)?(r=Ze(t,t.parentNode),Se.minX=g=Math.round(dt(le,"px")+e.left-r.left),Se.minY=v=Math.round(dt(se,"px")+e.top-r.top),Se.maxX=h=Math.round(g+(e.width-r.width)),Se.maxY=m=Math.round(v+(e.height-r.height))):(e=n.bounds,Se.minX=g=e.minX,Se.minY=v=e.minY,Se.maxX=h=e.maxX,Se.maxY=m=e.maxY),g>h&&(Se.minX=h,Se.maxX=h=g,g=Se.minX),v>m&&(Se.minY=m,Se.maxY=m=v,v=Se.minY),ie&&(Se.minRotation=g,Se.maxRotation=h),f=!0),n.liveSnap&&(o=!0===n.liveSnap?n.snap||{}:n.liveSnap,i=me(o)||ce(o),ie?(k=yt(i?o:o.rotation,g,h,1),_=null):o.points?S=function(e,t,n,r,o,i,a){return i=i&&i<xe?i*i:xe,ce(e)?function(l){var s,c,u,f=Se.isPressed?1-Se.edgeResistance:1,p=l.x,d=l.y;return l.x=p=p>n?n+(p-n)*f:p<t?t+(p-t)*f:p,l.y=d=d>o?o+(d-o)*f:d<r?r+(d-r)*f:d,(s=e.call(Se,l))!==l&&(l.x=s.x,l.y=s.y),1!==a&&(l.x*=a,l.y*=a),i<xe&&(c=l.x-p)*c+(u=l.y-d)*u>i&&(l.x=p,l.y=d),l}:me(e)?function(t){for(var n,r,o,a,l=e.length,s=0,c=xe;--l>-1;)(a=(n=(o=e[l]).x-t.x)*n+(r=o.y-t.y)*r)<c&&(s=l,c=a);return c<=i?e[s]:t}:function(e){return e}}(i?o:o.points,g,h,v,m,o.radius,a?-1:1):(pe&&(k=yt(i?o:o.x||o.left||o.scrollLeft,g,h,a?-1:1)),de&&(_=yt(i?o:o.y||o.top||o.scrollTop,v,m,a?-1:1))))},bt=function(){Se.isThrowing=!1,Ke(Se,"throwcomplete","onThrowComplete")},wt=function(){Se.isThrowing=!1},Tt=function(e,r){var o,i,l,s;e&&Q?(!0===e&&(o=n.snap||n.liveSnap||{},i=me(o)||ce(o),e={resistance:(n.throwResistance||n.resistance||1e3)/(ie?10:1)},ie?e.rotation=et(Se,i?o:o.rotation,h,g,1,r):(pe&&(e[le]=et(Se,i?o:o.points||o.x||o.left,h,g,a?-1:1,r||"x"===Se.lockedAxis)),de&&(e[se]=et(Se,i?o:o.points||o.y||o.top,m,v,a?-1:1,r||"y"===Se.lockedAxis)),(o.points||me(o)&&ue(o[0]))&&(e.linkedProps=le+","+se,e.radius=o.radius))),Se.isThrowing=!0,s=isNaN(n.overshootTolerance)?1===n.edgeResistance?0:1-Se.edgeResistance+.2:n.overshootTolerance,e.duration||(e.duration={max:Math.max(n.minDuration||0,"maxDuration"in n?n.maxDuration:2),min:isNaN(n.minDuration)?0===s||ue(e)&&e.resistance>1e3?0:.5:n.minDuration,overshoot:s}),Se.tween=l=F.to(a||t,{inertia:e,data:"_draggable",inherit:!1,onComplete:bt,onInterrupt:wt,onUpdate:n.fastMode?Ke:vt,onUpdateParams:n.fastMode?[Se,"onthrowupdate","onThrowUpdate"]:o&&o.radius?[!1,!0]:[]}),n.fastMode||(a&&(a._skip=!0),l.render(1e9,!0,!0),vt(!0,!0),Se.endX=Se.x,Se.endY=Se.y,ie&&(Se.endRotation=Se.x),l.play(0),vt(!0,!0),a&&(a._skip=!1))):f&&Se.applyBounds()},kt=function(e){var n,r=P;P=A(t.parentNode,!0),e&&Se.isPressed&&!P.equals(r||new L)&&(n=r.inverse().apply({x:l,y:s}),P.apply(n,n),l=n.x,s=n.y),P.equals(be)&&(P=null)},_t=function(){var e,n,r,o=1-Se.edgeResistance,i=pt?We(ht):0,p=pt?Be(ht):0;oe&&(ft.x=dt(le,"px")+"px",ft.y=dt(se,"px")+"px",ft.renderTransform()),kt(!1),Je.x=Se.pointerX-i,Je.y=Se.pointerY-p,P&&P.apply(Je,Je),l=Je.x,s=Je.y,w&&(Ct(Se.pointerX,Se.pointerY),mt(!0)),j=A(t),a?(xt(),u=a.top(),c=a.left()):(St()?(vt(!0,!0),xt()):Se.applyBounds(),ie?(e=t.ownerSVGElement?[ft.xOrigin-t.getBBox().x,ft.yOrigin-t.getBBox().y]:(Ve(t)[he]||"0 0").split(" "),b=Se.rotationOrigin=A(t).apply({x:parseFloat(e[0])||0,y:parseFloat(e[1])||0}),vt(!0,!0),n=Se.pointerX-b.x-i,r=b.y-Se.pointerY+p,c=Se.x,u=Se.y=Math.atan2(r,n)*ye):(u=dt(se,"px"),c=dt(le,"px"))),f&&o&&(c>h?c=h+(c-h)/o:c<g&&(c=g-(g-c)/o),ie||(u>m?u=m+(u-m)/o:u<v&&(u=v-(v-u)/o))),Se.startX=c=ge(c),Se.startY=u=ge(u)},St=function(){return Se.tween&&Se.tween.isActive()},Et=function(){!$.parentNode||St()||Se.isDragging||$.parentNode.removeChild($)},Mt=function(e,o){var c;if(!i||Se.isPressed||!e||!("mousedown"!==e.type&&"pointerdown"!==e.type||o)&&we()-ut<30&&K[Se.pointerEvent.type])I&&e&&i&&Ae(e);else{if(C=St(),z=!1,Se.pointerEvent=e,K[e.type]?(M=~e.type.indexOf("touch")?e.currentTarget||e.target:ht,Oe(M,"touchend",Nt),Oe(M,"touchmove",Pt),Oe(M,"touchcancel",Nt),Oe(ht,"touchstart",Fe)):(M=null,Oe(ht,"mousemove",Pt)),Y=null,te&&M||(Oe(ht,"mouseup",Nt),e&&e.target&&Oe(e.target,"mouseup",Nt)),E=ct.call(Se,e.target)&&!1===n.dragClickables&&!o)return Oe(e.target,"change",Nt),Ke(Se,"pressInit","onPressInit"),Ke(Se,"press","onPress"),nt(Xe,!0),void(I=!1);var u;if(N=!(!M||pe===de||!1===Se.vars.allowNativeTouchScrolling||Se.vars.allowContextMenu&&e&&(e.ctrlKey||e.which>2))&&(pe?"y":"x"),(I=!N&&!Se.allowEventDefault)&&(Ae(e),Oe(B,"touchforcechange",Ae)),e.changedTouches?(e=y=e.changedTouches[0],x=e.identifier):e.pointerId?x=e.pointerId:y=x=null,ae++,u=mt,Te.push(u),1===Te.length&&F.ticker.add(Ye),s=Se.pointerY=e.pageY,l=Se.pointerX=e.pageX,Ke(Se,"pressInit","onPressInit"),(N||Se.autoScroll)&&qe(t.parentNode),!t.parentNode||!Se.autoScroll||a||ie||!t.parentNode._gsMaxScrollX||$.parentNode||t.getBBox||($.style.width=t.parentNode.scrollWidth+"px",t.parentNode.appendChild($)),_t(),Se.tween&&Se.tween.kill(),Se.isThrowing=!1,F.killTweensOf(a||t,Re,!0),a&&F.killTweensOf(t,{scrollTo:1},!0),Se.tween=Se.lockedAxis=null,(n.zIndexBoost||!ie&&!a&&!1!==n.zIndexBoost)&&(t.style.zIndex=r.zIndex++),Se.isPressed=!0,p=!(!n.onDrag&&!Se._listeners.drag),d=!(!n.onMove&&!Se._listeners.move),!1!==n.cursor||n.activeCursor)for(c=Xe.length;--c>-1;)F.set(Xe[c],{cursor:n.activeCursor||n.cursor||("grab"===ee?"grabbing":ee)});Ke(Se,"press","onPress")}},Pt=function(e){var n,r,o,a,c,u,f=e;if(i&&!Z&&Se.isPressed&&e){if(Se.pointerEvent=e,n=e.changedTouches){if((e=n[0])!==y&&e.identifier!==x){for(a=n.length;--a>-1&&(e=n[a]).identifier!==x&&e.target!==t;);if(a<0)return}}else if(e.pointerId&&x&&e.pointerId!==x)return;M&&N&&!Y&&(Je.x=e.pageX-(pt?We(ht):0),Je.y=e.pageY-(pt?Be(ht):0),P&&P.apply(Je,Je),r=Je.x,o=Je.y,((c=Math.abs(r-l))!==(u=Math.abs(o-s))&&(c>ve||u>ve)||J&&N===Y)&&(Y=c>u&&pe?"x":"y",N&&Y!==N&&Oe(B,"touchforcechange",Ae),!1!==Se.vars.lockAxisOnTouchScroll&&pe&&de&&(Se.lockedAxis="x"===Y?"y":"x",ce(Se.vars.onLockAxis)&&Se.vars.onLockAxis.call(Se,f)),J&&N===Y))?Nt(f):(Se.allowEventDefault||N&&(!Y||N===Y)||!1===f.cancelable?I&&(I=!1):(Ae(f),I=!0),Se.autoScroll&&(Ge=!0),Ct(e.pageX,e.pageY,d))}else I&&e&&i&&Ae(e)},Ct=function(e,t,n){var r,o,i,a,p,d,y=1-Se.dragResistance,x=1-Se.edgeResistance,T=Se.pointerX,E=Se.pointerY,M=u,C=Se.x,N=Se.y,Y=Se.endX,X=Se.endY,D=Se.endRotation,O=w;Se.pointerX=e,Se.pointerY=t,pt&&(e-=We(ht),t-=Be(ht)),ie?(a=Math.atan2(b.y-t,e-b.x)*ye,(p=Se.y-a)>180?(u-=360,Se.y=a):p<-180&&(u+=360,Se.y=a),Se.x!==c||Math.max(Math.abs(l-e),Math.abs(s-t))>ve?(Se.y=a,i=c+(u-a)*y):i=c):(P&&(d=e*P.a+t*P.c+P.e,t=e*P.b+t*P.d+P.f,e=d),(o=t-s)<ve&&o>-ve&&(o=0),(r=e-l)<ve&&r>-ve&&(r=0),(Se.lockAxis||Se.lockedAxis)&&(r||o)&&((d=Se.lockedAxis)||(Se.lockedAxis=d=pe&&Math.abs(r)>Math.abs(o)?"y":de?"x":null,d&&ce(Se.vars.onLockAxis)&&Se.vars.onLockAxis.call(Se,Se.pointerEvent)),"y"===d?o=0:"x"===d&&(r=0)),i=ge(c+r*y),a=ge(u+o*y)),(k||_||S)&&(Se.x!==i||Se.y!==a&&!ie)&&(S&&(Me.x=i,Me.y=a,d=S(Me),i=ge(d.x),a=ge(d.y)),k&&(i=ge(k(i))),_&&(a=ge(_(a)))),f&&(i>h?i=h+Math.round((i-h)*x):i<g&&(i=g+Math.round((i-g)*x)),ie||(a>m?a=Math.round(m+(a-m)*x):a<v&&(a=Math.round(v+(a-v)*x)))),(Se.x!==i||Se.y!==a&&!ie)&&(ie?(Se.endRotation=Se.x=Se.endX=i,w=!0):(de&&(Se.y=Se.endY=a,w=!0),pe&&(Se.x=Se.endX=i,w=!0)),n&&!1===Ke(Se,"move","onMove")?(Se.pointerX=T,Se.pointerY=E,u=M,Se.x=C,Se.y=N,Se.endX=Y,Se.endY=X,Se.endRotation=D,w=O):!Se.isDragging&&Se.isPressed&&(Se.isDragging=z=!0,Ke(Se,"dragstart","onDragStart")))},Nt=function e(r,o){if(i&&Se.isPressed&&(!r||null==x||o||!(r.pointerId&&r.pointerId!==x&&r.target!==t||r.changedTouches&&!function(e,t){for(var n=e.length;n--;)if(e[n].identifier===t)return!0}(r.changedTouches,x)))){Se.isPressed=!1;var a,l,s,c,u,f=r,p=Se.isDragging,d=Se.vars.allowContextMenu&&r&&(r.ctrlKey||r.which>2),h=F.delayedCall(.001,Et);if(M?(Le(M,"touchend",e),Le(M,"touchmove",Pt),Le(M,"touchcancel",e),Le(ht,"touchstart",Fe)):Le(ht,"mousemove",Pt),Le(B,"touchforcechange",Ae),te&&M||(Le(ht,"mouseup",e),r&&r.target&&Le(r.target,"mouseup",e)),w=!1,p&&($e=Ee=we(),Se.isDragging=!1),De(mt),E&&!d)return r&&(Le(r.target,"change",e),Se.pointerEvent=f),nt(Xe,!1),Ke(Se,"release","onRelease"),Ke(Se,"click","onClick"),void(E=!1);for(l=Xe.length;--l>-1;)ze(Xe[l],"cursor",n.cursor||(!1!==n.cursor?ee:null));if(ae--,r){if((a=r.changedTouches)&&(r=a[0])!==y&&r.identifier!==x){for(l=a.length;--l>-1&&(r=a[l]).identifier!==x&&r.target!==t;);if(l<0&&!o)return}Se.pointerEvent=f,Se.pointerX=r.pageX,Se.pointerY=r.pageY}return d&&f?(Ae(f),I=!0,Ke(Se,"release","onRelease")):f&&!p?(I=!1,C&&(n.snap||n.bounds)&&Tt(n.inertia||n.throwProps),Ke(Se,"release","onRelease"),J&&"touchmove"===f.type||-1!==f.type.indexOf("cancel")||(Ke(Se,"click","onClick"),we()-ut<300&&Ke(Se,"doubleclick","onDoubleClick"),c=f.target||t,ut=we(),u=function(){ut===D||!Se.enabled()||Se.isPressed||f.defaultPrevented||(c.click?c.click():ht.createEvent&&((s=ht.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,B,1,Se.pointerEvent.screenX,Se.pointerEvent.screenY,Se.pointerX,Se.pointerY,!1,!1,!1,!1,0,null),c.dispatchEvent(s)))},J||f.defaultPrevented||F.delayedCall(.05,u))):(Tt(n.inertia||n.throwProps),Se.allowEventDefault||!f||!1===n.dragClickables&&ct.call(Se,f.target)||!p||N&&(!Y||N!==Y)||!1===f.cancelable?I=!1:(I=!0,Ae(f)),Ke(Se,"release","onRelease")),St()&&h.duration(Se.tween.duration()),p&&Ke(Se,"dragend","onDragEnd"),!0}I&&r&&i&&Ae(r)},Yt=function(e){if(e&&Se.isDragging&&!a){var n=e.target||t.parentNode,r=n.scrollLeft-n._gsScrollX,o=n.scrollTop-n._gsScrollY;(r||o)&&(P?(l-=r*P.a+o*P.c,s-=o*P.d+r*P.b):(l-=r,s-=o),n._gsScrollX+=r,n._gsScrollY+=o,Ct(Se.pointerX,Se.pointerY))}},Xt=function(e){var t=we(),n=t-ut<100,r=t-$e<50,o=n&&D===ut,i=Se.pointerEvent&&Se.pointerEvent.defaultPrevented,a=n&&O===ut,l=e.isTrusted||null==e.isTrusted&&n&&o;if((o||r&&!1!==Se.vars.suppressClickOnDrag)&&e.stopImmediatePropagation&&e.stopImmediatePropagation(),n&&(!Se.pointerEvent||!Se.pointerEvent.defaultPrevented)&&(!o||l&&!a))return l&&o&&(O=ut),void(D=ut);(Se.isPressed||r||n)&&(l&&e.detail&&n&&!i||Ae(e)),n||r||z||(e&&e.target&&(Se.pointerEvent=e),Ke(Se,"click","onClick"))},Dt=function(e){return P?{x:e.x*P.a+e.y*P.c+P.e,y:e.x*P.b+e.y*P.d+P.f}:{x:e.x,y:e.y}};return(T=r.get(t))&&T.kill(),o.startDrag=function(e,n){var r,o,i,a;Mt(e||Se.pointerEvent,!0),n&&!Se.hitTest(e||Se.pointerEvent)&&(r=Ue(e||Se.pointerEvent),o=Ue(t),i=Dt({x:r.left+r.width/2,y:r.top+r.height/2}),a=Dt({x:o.left+o.width/2,y:o.top+o.height/2}),l-=i.x-a.x,s-=i.y-a.y),Se.isDragging||(Se.isDragging=z=!0,Ke(Se,"dragstart","onDragStart"))},o.drag=Pt,o.endDrag=function(e){return Nt(e||Se.pointerEvent,!0)},o.timeSinceDrag=function(){return Se.isDragging?0:(we()-$e)/1e3},o.timeSinceClick=function(){return(we()-ut)/1e3},o.hitTest=function(e,t){return r.hitTest(Se.target,e,t)},o.getDirection=function(e,n){var r,o,i,a,l,s,f="velocity"===e&&Q?e:ue(e)&&!ie?"element":"start";return"element"===f&&(l=Ue(Se.target),s=Ue(e)),r="start"===f?Se.x-c:"velocity"===f?Q.getVelocity(t,le):l.left+l.width/2-(s.left+s.width/2),ie?r<0?"counter-clockwise":"clockwise":(n=n||2,o="start"===f?Se.y-u:"velocity"===f?Q.getVelocity(t,se):l.top+l.height/2-(s.top+s.height/2),a=(i=Math.abs(r/o))<1/n?"":r<0?"left":"right",i<n&&(""!==a&&(a+="-"),a+=o<0?"up":"down"),a)},o.applyBounds=function(e,r){var o,i,a,l,s,c;if(e&&n.bounds!==e)return n.bounds=e,Se.update(!0,r);if(vt(!0),xt(),f&&!St()){if(o=Se.x,i=Se.y,o>h?o=h:o<g&&(o=g),i>m?i=m:i<v&&(i=v),(Se.x!==o||Se.y!==i)&&(a=!0,Se.x=Se.endX=o,ie?Se.endRotation=o:Se.y=Se.endY=i,w=!0,mt(!0),Se.autoScroll&&!Se.isDragging))for(qe(t.parentNode),l=t,Pe.scrollTop=null!=B.pageYOffset?B.pageYOffset:null!=ht.documentElement.scrollTop?ht.documentElement.scrollTop:ht.body.scrollTop,Pe.scrollLeft=null!=B.pageXOffset?B.pageXOffset:null!=ht.documentElement.scrollLeft?ht.documentElement.scrollLeft:ht.body.scrollLeft;l&&!c;)s=(c=je(l.parentNode))?Pe:l.parentNode,de&&s.scrollTop>s._gsMaxScrollY&&(s.scrollTop=s._gsMaxScrollY),pe&&s.scrollLeft>s._gsMaxScrollX&&(s.scrollLeft=s._gsMaxScrollX),l=s;Se.isThrowing&&(a||Se.endX>h||Se.endX<g||Se.endY>m||Se.endY<v)&&Tt(n.inertia||n.throwProps,a)}return Se},o.update=function(e,n,r){if(n&&Se.isPressed){var o=A(t),i=j.apply({x:Se.x-c,y:Se.y-u}),a=A(t.parentNode,!0);a.apply({x:o.e-i.x,y:o.f-i.y},i),Se.x-=i.x-a.e,Se.y-=i.y-a.f,mt(!0),_t()}var l=Se.x,s=Se.y;return kt(!n),e?Se.applyBounds():(w&&r&&mt(!0),vt(!0)),n&&(Ct(Se.pointerX,Se.pointerY),w&&mt(!0)),Se.isPressed&&!n&&(pe&&Math.abs(l-Se.x)>.01||de&&Math.abs(s-Se.y)>.01&&!ie)&&_t(),Se.autoScroll&&(qe(t.parentNode,Se.isDragging),Ge=Se.isDragging,mt(!0),Ie(t,Yt),He(t,Yt)),Se},o.enable=function(e){var r,o,l,s={lazy:!0};if(!1!==n.cursor&&(s.cursor=n.cursor||ee),F.utils.checkPrefix("touchCallout")&&(s.touchCallout="none"),"soft"!==e){for(Ne(Xe,pe===de?"none":n.allowNativeTouchScrolling&&t.scrollHeight===t.clientHeight==(t.scrollWidth===t.clientHeight)||n.allowEventDefault?"manipulation":pe?"pan-y":"pan-x"),o=Xe.length;--o>-1;)l=Xe[o],te||Oe(l,"mousedown",Mt),Oe(l,"touchstart",Mt),Oe(l,"click",Xt,!0),F.set(l,s),l.getBBox&&l.ownerSVGElement&&pe!==de&&F.set(l.ownerSVGElement,{touchAction:n.allowNativeTouchScrolling||n.allowEventDefault?"manipulation":pe?"pan-y":"pan-x"}),n.allowContextMenu||Oe(l,"contextmenu",gt);nt(Xe,!1)}return He(t,Yt),i=!0,Q&&"soft"!==e&&Q.track(a||t,oe?"x,y":ie?"rotation":"top,left"),t._gsDragID=r=t._gsDragID||"d"+_e++,ke[r]=Se,a&&(a.enable(),a.element._gsDragID=r),(n.bounds||ie)&&_t(),n.bounds&&Se.applyBounds(),Se},o.disable=function(e){for(var n,r=Se.isDragging,o=Xe.length;--o>-1;)ze(Xe[o],"cursor",null);if("soft"!==e){for(Ne(Xe,null),o=Xe.length;--o>-1;)n=Xe[o],ze(n,"touchCallout",null),Le(n,"mousedown",Mt),Le(n,"touchstart",Mt),Le(n,"click",Xt,!0),Le(n,"contextmenu",gt);nt(Xe,!0),M&&(Le(M,"touchcancel",Nt),Le(M,"touchend",Nt),Le(M,"touchmove",Pt)),Le(ht,"mouseup",Nt),Le(ht,"mousemove",Pt)}return Ie(t,Yt),i=!1,Q&&"soft"!==e&&(Q.untrack(a||t,oe?"x,y":ie?"rotation":"top,left"),Se.tween&&Se.tween.kill()),a&&a.disable(),De(mt),Se.isDragging=Se.isPressed=E=!1,r&&Ke(Se,"dragend","onDragEnd"),Se},o.enabled=function(e,t){return arguments.length?e?Se.enable(t):Se.disable(t):i},o.kill=function(){return Se.isThrowing=!1,Se.tween&&Se.tween.kill(),Se.disable(),F.set(Xe,{clearProps:"userSelect"}),delete ke[t._gsDragID],Se},o.revert=function(){this.kill(),this.styles&&this.styles.revert()},~G.indexOf("scroll")&&(a=o.scrollProxy=new ot(t,function(e,t){for(var n in t)n in e||(e[n]=t[n]);return e}({onKill:function(){Se.isPressed&&Nt(null)}},n)),t.style.overflowY=de&&!U?"auto":"hidden",t.style.overflowX=pe&&!U?"auto":"hidden",t=a.content),ie?Re.rotation=1:(pe&&(Re[le]=1),de&&(Re[se]=1)),ft.force3D=!("force3D"in n)||n.force3D,ne(R(o)),o.enable(),o}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.register=function(e){F=e,it()},r.create=function(e,t){return q||it(),V(e).map(function(e){return new r(e,t)})},r.get=function(e){return ke[(V(e)[0]||{})._gsDragID]},r.timeSinceDrag=function(){return(we()-Ee)/1e3},r.hitTest=function(e,t,n){if(e===t)return!1;var r,o,i,a=Ue(e),l=Ue(t),s=a.top,c=a.left,u=a.right,f=a.bottom,p=a.width,d=a.height,h=l.left>u||l.right<c||l.top>f||l.bottom<s;return h||!n?!h:(i=-1!==(n+"").indexOf("%"),n=parseFloat(n)||0,(r={left:Math.max(c,l.left),top:Math.max(s,l.top)}).width=Math.min(u,l.right)-r.left,r.height=Math.min(f,l.bottom)-r.top,!(r.width<0||r.height<0)&&(i?(n*=.01,(o=r.width*r.height)>=p*d*n||o>=l.width*l.height*n):r.width>n&&r.height>n))},r}(function(){function e(e){this._listeners={},this.target=e||this}var t=e.prototype;return t.addEventListener=function(e,t){var n=this._listeners[e]||(this._listeners[e]=[]);~n.indexOf(t)||n.push(t)},t.removeEventListener=function(e,t){var n=this._listeners[e],r=n&&n.indexOf(t);r>=0&&n.splice(r,1)},t.dispatchEvent=function(e){var t,n=this;return(this._listeners[e]||[]).forEach(function(r){return!1===r.call(n,{type:e,target:n.target})&&(t=!1)}),t},e}());function lt(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}
|
|
19
|
-
/*!
|
|
20
|
-
* Observer 3.13.0
|
|
21
|
-
* https://gsap.com
|
|
22
|
-
*
|
|
23
|
-
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
|
24
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
25
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
26
|
-
*/!function(e,t){for(var n in t)n in e||(e[n]=t[n])}(at.prototype,{pointerX:0,pointerY:0,startX:0,startY:0,deltaX:0,deltaY:0,isDragging:!1,isPressed:!1}),at.zIndex=1e3,at.version="3.13.0",se()&&F.registerPlugin(at);var st,ct,ut,ft,pt,dt,ht,gt,mt,vt,yt,xt,bt,wt=function(){return st||"undefined"!=typeof window&&(st=window.gsap)&&st.registerPlugin&&st},Tt=1,kt=[],_t=[],St=[],Et=Date.now,Mt=function(e,t){return t},Pt=function(e){return!!~vt.indexOf(e)},Ct=function(e,t,n,r,o){return e.addEventListener(t,n,{passive:!1!==r,capture:!!o})},Nt=function(e,t,n,r){return e.removeEventListener(t,n,!!r)},Yt="scrollLeft",Xt="scrollTop",Dt=function(){return yt&&yt.isPressed||_t.cache++},Ot=function(e,t){var n=function n(r){if(r||0===r){Tt&&(ut.history.scrollRestoration="manual");var o=yt&&yt.isPressed;r=n.v=Math.round(r)||(yt&&yt.iOS?1:0),e(r),n.cacheID=_t.cache,o&&Mt("ss",r)}else(t||_t.cache!==n.cacheID||Mt("ref"))&&(n.cacheID=_t.cache,n.v=e());return n.v+n.offset};return n.offset=0,e&&n},Lt={s:Yt,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:Ot(function(e){return arguments.length?ut.scrollTo(e,At.sc()):ut.pageXOffset||ft[Yt]||pt[Yt]||dt[Yt]||0})},At={s:Xt,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:Lt,sc:Ot(function(e){return arguments.length?ut.scrollTo(Lt.sc(),e):ut.pageYOffset||ft[Xt]||pt[Xt]||dt[Xt]||0})},Rt=function(e,t){var n=t.s,r=t.sc;Pt(e)&&(e=ft.scrollingElement||pt);var o=_t.indexOf(e),i=r===At.sc?1:2;!~o&&(o=_t.push(e)-1),_t[o+i]||Ct(e,"scroll",Dt);var a=_t[o+i],l=a||(_t[o+i]=Ot(function(e,t){return~St.indexOf(e)&&St[St.indexOf(e)+1][t]}(e,n),!0)||(Pt(e)?r:Ot(function(t){return arguments.length?e[n]=t:e[n]})));return l.target=e,a||(l.smooth="smooth"===st.getProperty(e,"scrollBehavior")),l},Ft=function(e,t,n){var r=e,o=e,i=Et(),a=i,l=t,s=Math.max(500,3*l),c=function(e,t){var n=Et();t||n-i>l?(o=r,r=e,a=i,i=n):r+=e};return{update:c,reset:function(){o=r=0,a=i=0},getVelocity:function(e){var t=a,n=o,l=Et();return(e||0===e)&&e!==r&&c(e),i===a||l-a>s?0:(r+n)/(l-t)*1e3}}},Bt=function(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e},Wt=function(e){var t=Math.max.apply(Math,e),n=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(n)?t:n},Ht=function(){var e,t,n,r;(mt=st.core.globals().ScrollTrigger)&&mt.core&&(e=mt.core,t=e.bridge||{},n=e._scrollers,r=e._proxies,n.push.apply(n,_t),r.push.apply(r,St),_t=n,St=r,Mt=function(e,n){return t[e](n)})},It=function(e){return st=e||wt(),!ct&&st&&"undefined"!=typeof document&&document.body&&(ut=window,ft=document,pt=ft.documentElement,dt=ft.body,vt=[ut,ft,pt,dt],st.utils.clamp,bt=st.core.context||function(){},gt="onpointerenter"in dt?"pointer":"mouse",ht=jt.isTouch=ut.matchMedia&&ut.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in ut||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?2:0,xt=jt.eventTypes=("ontouchstart"in pt?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in pt?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return Tt=0},500),Ht(),ct=1),ct};Lt.op=At,_t.cache=0;var jt=function(){function e(e){this.init(e)}return e.prototype.init=function(e){ct||It(st),mt||Ht();var t=e.tolerance,n=e.dragMinimum,r=e.type,o=e.target,i=e.lineHeight,a=e.debounce,l=e.preventDefault,s=e.onStop,c=e.onStopDelay,u=e.ignore,f=e.wheelSpeed,p=e.event,d=e.onDragStart,h=e.onDragEnd,g=e.onDrag,m=e.onPress,v=e.onRelease,y=e.onRight,x=e.onLeft,b=e.onUp,w=e.onDown,T=e.onChangeX,k=e.onChangeY,_=e.onChange,S=e.onToggleX,E=e.onToggleY,M=e.onHover,P=e.onHoverEnd,C=e.onMove,N=e.ignoreCheck,Y=e.isNormalizer,X=e.onGestureStart,D=e.onGestureEnd,O=e.onWheel,L=e.onEnable,A=e.onDisable,R=e.onClick,F=e.scrollSpeed,B=e.capture,W=e.allowClicks,H=e.lockAxis,I=e.onLockAxis;this.target=o=function(e,t){return(t&&t._ctx&&t._ctx.selector||st.utils.toArray)(e)[0]||("string"==typeof e&&!1!==st.config().nullTargetWarn?void 0:null)}(o)||pt,this.vars=e,u&&(u=st.utils.toArray(u)),t=t||1e-9,n=n||0,f=f||1,F=F||1,r=r||"wheel,touch,pointer",a=!1!==a,i||(i=parseFloat(ut.getComputedStyle(dt).lineHeight)||22);var j,$,q,z,V,G,U,K=this,Z=0,J=0,Q=e.passive||!l&&!1!==e.passive,ee=Rt(o,Lt),te=Rt(o,At),ne=ee(),re=te(),oe=~r.indexOf("touch")&&!~r.indexOf("pointer")&&"pointerdown"===xt[0],ie=Pt(o),ae=o.ownerDocument||ft,le=[0,0,0],se=[0,0,0],ce=0,ue=function(){return ce=Et()},fe=function(e,t){return(K.event=e)&&u&&function(e,t){for(var n=t.length;n--;)if(t[n]===e||t[n].contains(e))return!0;return!1}(e.target,u)||t&&oe&&"touch"!==e.pointerType||N&&N(e,t)},pe=function(){var e=K.deltaX=Wt(le),n=K.deltaY=Wt(se),r=Math.abs(e)>=t,o=Math.abs(n)>=t;_&&(r||o)&&_(K,e,n,le,se),r&&(y&&K.deltaX>0&&y(K),x&&K.deltaX<0&&x(K),T&&T(K),S&&K.deltaX<0!=Z<0&&S(K),Z=K.deltaX,le[0]=le[1]=le[2]=0),o&&(w&&K.deltaY>0&&w(K),b&&K.deltaY<0&&b(K),k&&k(K),E&&K.deltaY<0!=J<0&&E(K),J=K.deltaY,se[0]=se[1]=se[2]=0),(z||q)&&(C&&C(K),q&&(d&&1===q&&d(K),g&&g(K),q=0),z=!1),G&&!(G=!1)&&I&&I(K),V&&(O(K),V=!1),j=0},de=function(e,t,n){le[n]+=e,se[n]+=t,K._vx.update(e),K._vy.update(t),a?j||(j=requestAnimationFrame(pe)):pe()},he=function(e,t){H&&!U&&(K.axis=U=Math.abs(e)>Math.abs(t)?"x":"y",G=!0),"y"!==U&&(le[2]+=e,K._vx.update(e,!0)),"x"!==U&&(se[2]+=t,K._vy.update(t,!0)),a?j||(j=requestAnimationFrame(pe)):pe()},ge=function(e){if(!fe(e,1)){var t=(e=Bt(e,l)).clientX,r=e.clientY,o=t-K.x,i=r-K.y,a=K.isDragging;K.x=t,K.y=r,(a||(o||i)&&(Math.abs(K.startX-t)>=n||Math.abs(K.startY-r)>=n))&&(q=a?2:1,a||(K.isDragging=!0),he(o,i))}},me=K.onPress=function(e){fe(e,1)||e&&e.button||(K.axis=U=null,$.pause(),K.isPressed=!0,e=Bt(e),Z=J=0,K.startX=K.x=e.clientX,K.startY=K.y=e.clientY,K._vx.reset(),K._vy.reset(),Ct(Y?o:ae,xt[1],ge,Q,!0),K.deltaX=K.deltaY=0,m&&m(K))},ve=K.onRelease=function(e){if(!fe(e,1)){Nt(Y?o:ae,xt[1],ge,!0);var t=!isNaN(K.y-K.startY),n=K.isDragging,r=n&&(Math.abs(K.x-K.startX)>3||Math.abs(K.y-K.startY)>3),i=Bt(e);!r&&t&&(K._vx.reset(),K._vy.reset(),l&&W&&st.delayedCall(.08,function(){if(Et()-ce>300&&!e.defaultPrevented)if(e.target.click)e.target.click();else if(ae.createEvent){var t=ae.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,ut,1,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(t)}})),K.isDragging=K.isGesturing=K.isPressed=!1,s&&n&&!Y&&$.restart(!0),q&&pe(),h&&n&&h(K),v&&v(K,r)}},ye=function(e){return e.touches&&e.touches.length>1&&(K.isGesturing=!0)&&X(e,K.isDragging)},xe=function(){return(K.isGesturing=!1)||D(K)},be=function(e){if(!fe(e)){var t=ee(),n=te();de((t-ne)*F,(n-re)*F,1),ne=t,re=n,s&&$.restart(!0)}},we=function(e){if(!fe(e)){e=Bt(e,l),O&&(V=!0);var t=(1===e.deltaMode?i:2===e.deltaMode?ut.innerHeight:1)*f;de(e.deltaX*t,e.deltaY*t,0),s&&!Y&&$.restart(!0)}},Te=function(e){if(!fe(e)){var t=e.clientX,n=e.clientY,r=t-K.x,o=n-K.y;K.x=t,K.y=n,z=!0,s&&$.restart(!0),(r||o)&&he(r,o)}},ke=function(e){K.event=e,M(K)},_e=function(e){K.event=e,P(K)},Se=function(e){return fe(e)||Bt(e,l)&&R(K)};$=K._dc=st.delayedCall(c||.25,function(){K._vx.reset(),K._vy.reset(),$.pause(),s&&s(K)}).pause(),K.deltaX=K.deltaY=0,K._vx=Ft(0,50),K._vy=Ft(0,50),K.scrollX=ee,K.scrollY=te,K.isDragging=K.isGesturing=K.isPressed=!1,bt(this),K.enable=function(e){return K.isEnabled||(Ct(ie?ae:o,"scroll",Dt),r.indexOf("scroll")>=0&&Ct(ie?ae:o,"scroll",be,Q,B),r.indexOf("wheel")>=0&&Ct(o,"wheel",we,Q,B),(r.indexOf("touch")>=0&&ht||r.indexOf("pointer")>=0)&&(Ct(o,xt[0],me,Q,B),Ct(ae,xt[2],ve),Ct(ae,xt[3],ve),W&&Ct(o,"click",ue,!0,!0),R&&Ct(o,"click",Se),X&&Ct(ae,"gesturestart",ye),D&&Ct(ae,"gestureend",xe),M&&Ct(o,gt+"enter",ke),P&&Ct(o,gt+"leave",_e),C&&Ct(o,gt+"move",Te)),K.isEnabled=!0,K.isDragging=K.isGesturing=K.isPressed=z=q=!1,K._vx.reset(),K._vy.reset(),ne=ee(),re=te(),e&&e.type&&me(e),L&&L(K)),K},K.disable=function(){K.isEnabled&&(kt.filter(function(e){return e!==K&&Pt(e.target)}).length||Nt(ie?ae:o,"scroll",Dt),K.isPressed&&(K._vx.reset(),K._vy.reset(),Nt(Y?o:ae,xt[1],ge,!0)),Nt(ie?ae:o,"scroll",be,B),Nt(o,"wheel",we,B),Nt(o,xt[0],me,B),Nt(ae,xt[2],ve),Nt(ae,xt[3],ve),Nt(o,"click",ue,!0),Nt(o,"click",Se),Nt(ae,"gesturestart",ye),Nt(ae,"gestureend",xe),Nt(o,gt+"enter",ke),Nt(o,gt+"leave",_e),Nt(o,gt+"move",Te),K.isEnabled=K.isPressed=K.isDragging=!1,A&&A(K))},K.kill=K.revert=function(){K.disable();var e=kt.indexOf(K);e>=0&&kt.splice(e,1),yt===K&&(yt=0)},kt.push(K),Y&&Pt(o)&&(yt=K),K.enable(p)},lt(e,[{key:"velocityX",get:function(){return this._vx.getVelocity()}},{key:"velocityY",get:function(){return this._vy.getVelocity()}}]),e}();jt.version="3.13.0",jt.create=function(e){return new jt(e)},jt.register=It,jt.getAll=function(){return kt.slice()},jt.getById=function(e){return kt.filter(function(t){return t.vars.id===e})[0]},wt()&&st.registerPlugin(jt);
|
|
27
|
-
/*!
|
|
28
|
-
* VelocityTracker: 3.13.0
|
|
29
|
-
* https://gsap.com
|
|
30
|
-
*
|
|
31
|
-
* Copyright 2008-2025, GreenSock. All rights reserved.
|
|
32
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
33
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
34
|
-
*/
|
|
35
|
-
var $t,qt,zt,Vt,Gt,Ut,Kt,Zt,Jt=function(){return $t||"undefined"!=typeof window&&($t=window.gsap)},Qt={},en=function(e){return Zt(e).id},tn=function(e){return Qt[en("string"==typeof e?zt(e)[0]:e)]},nn=function(e){var t,n=Gt;if(e-Kt>=.05)for(Kt=e;n;)((t=n.g(n.t,n.p))!==n.v1||e-n.t1>.2)&&(n.v2=n.v1,n.v1=t,n.t2=n.t1,n.t1=e),n=n._next},rn={deg:360,rad:2*Math.PI},on=function(){($t=Jt())&&(zt=$t.utils.toArray,Vt=$t.utils.getUnit,Zt=$t.core.getCache,Ut=$t.ticker,qt=1)},an=function(e,t,n,r){this.t=e,this.p=t,this.g=e._gsap.get,this.rCap=rn[n||Vt(this.g(e,t))],this.v1=this.v2=0,this.t1=this.t2=Ut.time,r&&(this._next=r,r._prev=this)},ln=function(){function e(e,t){qt||on(),this.target=zt(e)[0],Qt[en(this.target)]=this,this._props={},t&&this.add(t)}e.register=function(e){$t=e,on()};var t=e.prototype;return t.get=function(e,t){var n,r,o,i=this._props[e]||void 0;return n=parseFloat(t?i.v1:i.g(i.t,i.p))-parseFloat(i.v2),(r=i.rCap)&&(n%=r)!==n%(r/2)&&(n=n<0?n+r:n-r),o=n/((t?i.t1:Ut.time)-i.t2),Math.round(1e4*o)/1e4},t.getAll=function(){var e,t={},n=this._props;for(e in n)t[e]=this.get(e);return t},t.isTracking=function(e){return e in this._props},t.add=function(e,t){e in this._props||(Gt||(Ut.add(nn),Kt=Ut.time),Gt=this._props[e]=new an(this.target,e,t,Gt))},t.remove=function(e){var t,n,r=this._props[e];r&&(t=r._prev,n=r._next,t&&(t._next=n),n?n._prev=t:Gt===r&&(Ut.remove(nn),Gt=0),delete this._props[e])},t.kill=function(e){for(var t in this._props)this.remove(t);e||delete Qt[en(this.target)]},e.track=function(t,n,r){qt||on();for(var o,i,a=[],l=zt(t),s=n.split(","),c=(r||"").split(","),u=l.length;u--;){for(o=tn(l[u])||new e(l[u]),i=s.length;i--;)o.add(s[i],c[i]||c[0]);a.push(o)}return a},e.untrack=function(e,t){var n=(t||"").split(",");zt(e).forEach(function(e){var t=tn(e);t&&(n.length?n.forEach(function(e){return t.remove(e)}):t.kill(1))})},e.isTracking=function(e,t){var n=tn(e);return n&&n.isTracking(t)},e.getVelocity=function(e,t){var n=tn(e);return n&&n.isTracking(t)?n.get(t):void 0},e}();ln.getByTarget=tn,Jt()&&$t.registerPlugin(ln);
|
|
36
|
-
/*!
|
|
37
|
-
* InertiaPlugin 3.13.0
|
|
38
|
-
* https://gsap.com
|
|
39
|
-
*
|
|
40
|
-
* @license Copyright 2008-2025, GreenSock. All rights reserved.
|
|
41
|
-
* Subject to the terms at https://gsap.com/standard-license
|
|
42
|
-
* @author: Jack Doyle, jack@greensock.com
|
|
43
|
-
*/
|
|
44
|
-
var sn,cn,un,fn,pn,dn,hn,gn,mn,vn,yn,xn,bn,wn,Tn=ln.getByTarget,kn=function(){return sn||"undefined"!=typeof window&&(sn=window.gsap)&&sn.registerPlugin&&sn},_n=function(e){return"number"==typeof e},Sn=function(e){return"object"==typeof e},En=function(e){return"function"==typeof e},Mn=Array.isArray,Pn=function(e){return e},Cn=1e10,Nn=function(e){return Math.round(1e4*e)/1e4},Yn=function(e,t,n){for(var r in t)r in e||r===n||(e[r]=t[r]);return e},Xn=function e(t){var n,r,o={};for(n in t)o[n]=Sn(r=t[n])&&!Mn(r)?e(r):r;return o},Dn=function(e,t,n,r,o){var i,a,l,s,c=t.length,u=0,f=Cn;if(Sn(e)){for(;c--;){for(l in i=t[c],a=0,e)a+=(s=i[l]-e[l])*s;a<f&&(u=c,f=a)}if((o||Cn)<Cn&&o<Math.sqrt(f))return e}else for(;c--;)(a=(i=t[c])-e)<0&&(a=-a),a<f&&i>=r&&i<=n&&(u=c,f=a);return t[u]},On=function(e,t,n,r,o,i,a){if("auto"===e.end)return e;var l,s,c=e.end;if(n=isNaN(n)?Cn:n,r=isNaN(r)?-Cn:r,Sn(t)){if(l=t.calculated?t:(En(c)?c(t,a):Dn(t,c,n,r,i))||t,!t.calculated){for(s in l)t[s]=l[s];t.calculated=!0}l=l[o]}else l=En(c)?c(t,a):Mn(c)?Dn(t,c,n,r,i):parseFloat(c);return l>n?l=n:l<r&&(l=r),{max:l,min:l,unitFactor:e.unitFactor}},Ln=function(e,t,n){return isNaN(e[t])?n:+e[t]},An=function(e,t){return.05*t*e/vn},Rn=function(e,t,n){return Math.abs((t-e)*vn/n/.05)},Fn={resistance:1,checkpoint:1,preventOvershoot:1,linkedProps:1,radius:1,duration:1},Bn=function(e,t,n,r){if(t.linkedProps){var o,i,a,l,s,c,u=t.linkedProps.split(","),f={};for(o=0;o<u.length;o++)(a=t[i=u[o]])&&(l=_n(a.velocity)?a.velocity:(s=s||Tn(e))&&s.isTracking(i)?s.get(i):0,c=Math.abs(l/Ln(a,"resistance",r)),f[i]=parseFloat(n(e,i))+An(l,c));return f}},Wn=function(){(sn=kn())&&(un=sn.parseEase,fn=sn.utils.toArray,hn=sn.utils.getUnit,mn=sn.core.getCache,yn=sn.utils.clamp,bn=sn.core.getStyleSaver,wn=sn.core.reverting||function(){},pn=un("power3"),vn=pn(.05),gn=sn.core.PropTween,sn.config({resistance:100,unitFactors:{time:1e3,totalTime:1e3,progress:1e3,totalProgress:1e3}}),dn=sn.config(),sn.registerPlugin(ln),cn=1)},Hn={version:"3.13.0",name:"inertia",register:function(e){sn=e,Wn()},init:function(e,t,n,r,o){cn||Wn();var i=Tn(e);if("auto"===t){if(!i)return;t=i.getAll()}this.styles=bn&&"object"==typeof e.style&&bn(e),this.target=e,this.tween=n,xn=t;var a,l,s,c,u,f,p,d,h,g=e._gsap,m=g.get,v=t.duration,y=Sn(v),x=t.preventOvershoot||y&&0===v.overshoot,b=Ln(t,"resistance",dn.resistance),w=_n(v)?v:function(e,t,n,r,o){if(void 0===n&&(n=10),void 0===r&&(r=.2),void 0===o&&(o=1),"string"==typeof e&&(e=fn(e)[0]),!e)return 0;var i,a,l,s,c,u,f,p,d,h,g=0,m=Cn,v=t.inertia||t,y=mn(e).get,x=Ln(v,"resistance",dn.resistance);for(i in h=Bn(e,v,y,x),v)Fn[i]||(a=v[i],Sn(a)||((p=p||Tn(e))&&p.isTracking(i)?a=_n(a)?{velocity:a}:{velocity:p.get(i)}:(s=+a||0,l=Math.abs(s/x))),Sn(a)&&(s=_n(a.velocity)?a.velocity:(p=p||Tn(e))&&p.isTracking(i)?p.get(i):0,l=yn(r,n,Math.abs(s/Ln(a,"resistance",x))),u=(c=parseFloat(y(e,i))||0)+An(s,l),"end"in a&&(a=On(a,h&&i in h?h:u,a.max,a.min,i,v.radius,s),xn===t&&(xn=v=Xn(t)),v[i]=Yn(a,v[i],"end")),"max"in a&&u>+a.max+1e-10?(d=a.unitFactor||dn.unitFactors[i]||1,(f=c>a.max&&a.min!==a.max||s*d>-15&&s*d<45?r+.1*(n-r):Rn(c,a.max,s))+o<m&&(m=f+o)):"min"in a&&u<+a.min-1e-10&&(d=a.unitFactor||dn.unitFactors[i]||1,(f=c<a.min&&a.min!==a.max||s*d>-45&&s*d<15?r+.1*(n-r):Rn(c,a.min,s))+o<m&&(m=f+o)),f>g&&(g=f)),l>g&&(g=l));return g>m&&(g=m),g>n?n:g<r?r:g}(e,t,y&&v.max||10,y&&v.min||.2,y&&"overshoot"in v?+v.overshoot:x?0:1);for(a in t=xn,xn=0,h=Bn(e,t,m,b),t)Fn[a]||(l=t[a],En(l)&&(l=l(r,e,o)),_n(l)?u=l:Sn(l)&&!isNaN(l.velocity)?u=+l.velocity:i&&i.isTracking(a)&&(u=i.get(a)),f=An(u,w),d=0,s=m(e,a),c=hn(s),s=parseFloat(s),Sn(l)&&(p=s+f,"end"in l&&(l=On(l,h&&a in h?h:p,l.max,l.min,a,t.radius,u)),"max"in l&&+l.max<p?x||l.preventOvershoot?f=l.max-s:d=l.max-s-f:"min"in l&&+l.min>p&&(x||l.preventOvershoot?f=l.min-s:d=l.min-s-f)),this._props.push(a),this.styles&&this.styles.save(a),this._pt=new gn(this._pt,e,a,s,0,Pn,0,g.set(e,a,this)),this._pt.u=c||0,this._pt.c1=f,this._pt.c2=d);return n.duration(w),1},render:function(e,t){var n=t._pt;if((e=pn(t.tween._time/t.tween._dur))||!wn())for(;n;)n.set(n.t,n.p,Nn(n.s+n.c1*e+n.c2*e*e)+n.u,n.d,e),n=n._next;else t.styles.revert()}};"track,untrack,isTracking,getVelocity,getByTarget".split(",").forEach(function(e){return Hn[e]=ln[e]}),kn()&&sn.registerPlugin(Hn);const In=(...e)=>c(s(e)),jn=e=>{let t=e;for(;t;){const e=window.getComputedStyle(t).backgroundColor;if(e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e)return e;t=t.parentElement}return"transparent"},$n=(e,t,n,r,o)=>{const{spacing:i=16,alignRotationWithY:a=!1}=o;if(l.set(e,{gap:`${i}px`,rotate:r?90:"0"}),r){const t=e.parentNode;l.set(e,{width:t.offsetHeight}),l.set(n,{overflow:"visible"})}if(a&&t.length>0){const r=t[0].offsetHeight;l.set(e,{alignItems:"center"}),l.set(n,{rotate:-90,x:(e.offsetWidth-i)/2-i,display:"flex",flexWrap:"wrap",width:r,wordBreak:"break-all",whiteSpace:"break-spaces"}),l.set(t,{height:e.offsetWidth-i})}},qn=(e,t,n,r)=>{if(!r.fill)return 1;const o=n?window.innerHeight:t;return e<o?Math.ceil(o/e):1},zn=(e,t,n,r)=>{const{fill:o=!1,alignRotationWithY:i=!1}=r;return o?"auto":i&&e.length>0?`${e[0].offsetHeight}px`:t<n?"100%":`${t}px`},Vn=(e,t,n,r,o,i,a)=>{const{spacing:s=16,speed:c=100,delay:u=0,paused:f=!1,alignRotationWithY:p=!1}=a,d=[],h=[],g=e.length-1;l.set(e,{xPercent:(e,t)=>{const n=d[e]=parseFloat(String(l.getProperty(t,"width","px")));return h[e]=parseFloat(String(l.getProperty(t,"x","px")))/n*100+Number(l.getProperty(t,"xPercent")),h[e]}}),l.set(e,{x:0});const m=e[g].offsetLeft+h[g]/100*d[g]-t+e[g].offsetWidth+s;if(e.forEach((e,r)=>{const o=h[r]/100*d[r],i=e.offsetLeft+o-t,a=p?i+e.offsetHeight-s:i+d[r];n.to(e,{xPercent:(o-a)/d[r]*100,duration:a/c},0).fromTo(e,{xPercent:(o-a+m)/d[r]*100},{xPercent:h[r],duration:(o-a+m-o)/c,immediateRender:!1},a/c)}),n.delay(u),r){if(f)return void n.pause();n.progress(1).pause(),l.delayedCall(u,()=>{n.reverse(),n.eventCallback("onReverseComplete",()=>{n.totalTime(n.rawTime()+100*n.duration())})})}let v;if("function"==typeof at&&a.draggable){v=document.createElement("div");const e=l.utils.wrap(0,1);let t,a;const s=()=>{const r=i?c.startY-c.y:c.startX-c.x;n.progress(e(a+r*t))},c=at.create(v,{trigger:o,type:i?"y":"x",onPress(){l.killTweensOf(n),n.pause(),a=n.progress(),t=1/m,l.set(v,{x:a/-t})},onDrag:s,onThrowUpdate:s,overshootTolerance:0,inertia:!0,onThrowComplete:()=>{if(r){if(f)return void n.pause();n.progress(n.progress()).pause(),l.delayedCall(u,()=>{n.reverse(),n.eventCallback("onReverseComplete",()=>{n.totalTime(n.rawTime()+100*n.duration())})})}else n.play()}})[0]}};l.registerPlugin(a,jt,Hn,at);const Gn=t((e,t)=>{const{children:s,className:c,dir:u="left",loop:f=-1,paused:p=!1,fill:d=!1,followScrollDir:h=!1,scrollSpeed:g=2.5,gradient:m=!1,gradientColor:v=null,pauseOnHover:y=!1}=e,x=n(null),b=t||x,w=n(null),[T,k]=r(1),[S,E]=r(null);o(()=>{if(!m||!(null==b?void 0:b.current))return;const e=jn(b.current);E(e)},[m]);const M="up"===u||"down"===u,P="down"===u||"right"===u;a((t,n)=>{if(!(null==w?void 0:w.current)||!b.current||!n)return;const r=null==b?void 0:b.current,o=l.utils.toArray(r.querySelectorAll(".gsap-react-marquee")),i=l.utils.toArray(r.querySelectorAll(".gsap-react-marquee .gsap-react-marquee-content")),a=w.current;if(!a||!i)return;const s=l.timeline({paused:p,repeat:f,defaults:{ease:"none"},onReverseComplete(){s.totalTime(s.rawTime()+100*s.duration())}});$n(r,o,i,M,e);const c=r.offsetWidth,u=i[0].offsetWidth,m=i[0].offsetLeft;let v=null;const x=Math.min(4,Math.max(1.1,g));k(qn(u,c,M,e));const T=l.utils.toArray(a.children).map(e=>e.offsetWidth).reduce((e,t)=>e+t,0);l.set(o,{minWidth:zn(i,T,c,e),flex:d?"0 0 auto":"1"}),Vn(d?i:o,m,s,P,o,M,e),h&&(v=jt.create({onChangeY(e){let t=x*(P?-1:1);e.deltaY<0&&(t*=-1),l.timeline({defaults:{ease:"none"}}).to(s,{timeScale:t*x,duration:.2,overwrite:!0}).to(s,{timeScale:t/x,duration:1},"+=0.3")}}));const _=n(()=>{s.timeScale(0)}),S=n(()=>{s.timeScale(1)});return y&&(r.addEventListener("mouseenter",_),r.addEventListener("mouseleave",S)),()=>{r.removeEventListener("mouseenter",_),r.removeEventListener("mouseleave",S),s.kill(),null==v||v.kill()}},{dependencies:[T,u,f,p,d,h,g,m,v,y]});const C=i(()=>!Number.isFinite(T)||T<=0?null:Array.from({length:T},(e,t)=>_.jsx("div",{className:In("gsap-react-marquee"),children:_.jsx("div",{className:In("gsap-react-marquee-content",c),children:s})},t)),[T,c,s]);return _.jsxs("div",{ref:b,style:{"--gradient-color":v||(m&&S?S:"transparent")},className:In("gsap-react-marquee-container flex w-full overflow-hidden whitespace-nowrap"),children:[_.jsx("div",{ref:w,className:In("gsap-react-marquee"),children:_.jsx("div",{className:In("gsap-react-marquee-content",c),children:s})}),C]})});Gn.displayName="GSAPReactMarquee";export{qn as calculateDuplicates,In as cn,Vn as coreAnimation,Gn as default,jn as getEffectiveBackgroundColor,zn as getMinWidth,$n as setupContainerStyles};
|
|
45
|
-
//# sourceMappingURL=index.esm.js.map
|
|
1
|
+
import e,{forwardRef as t,useRef as r,useState as n,useLayoutEffect as a,useMemo as o}from"react";import{useGSAP as i}from"@gsap/react";import l from"gsap";import{Draggable as s,InertiaPlugin as c,Observer as u}from"gsap/all";import{clsx as f}from"clsx";import{twMerge as p}from"tailwind-merge";var d,m,y={exports:{}},g={},h={};"production"===process.env.NODE_ENV?y.exports=function(){if(d)return g;d=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(t,r,n){var a=null;if(void 0!==n&&(a=""+n),void 0!==r.key&&(a=""+r.key),"key"in r)for(var o in n={},r)"key"!==o&&(n[o]=r[o]);else n=r;return r=n.ref,{$$typeof:e,type:t,key:a,ref:void 0!==r?r:null,props:n}}return g.Fragment=t,g.jsx=r,g.jsxs=r,g}():y.exports=(m||(m=1,"production"!==process.env.NODE_ENV&&function(){function t(e){if(null==e)return null;if("function"==typeof e)return e.$$typeof===j?null:e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case d:return"Fragment";case y:return"Profiler";case m:return"StrictMode";case w:return"Suspense";case x:return"SuspenseList";case _:return"Activity"}if("object"==typeof e)switch(e.tag,e.$$typeof){case p:return"Portal";case v:return(e.displayName||"Context")+".Provider";case g:return(e._context.displayName||"Context")+".Consumer";case b:var r=e.render;return(e=e.displayName)||(e=""!==(e=r.displayName||r.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case S:return null!==(r=e.displayName||null)?r:t(e.type)||"Memo";case k:r=e._payload,e=e._init;try{return t(e(r))}catch(e){}}return null}function r(e){return""+e}function n(e){try{r(e);var t=!1}catch(e){t=!0}if(t){var n=(t=console).error,a="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",a),r(e)}}function a(e){if(e===d)return"<>";if("object"==typeof e&&null!==e&&e.$$typeof===k)return"<...>";try{var r=t(e);return r?"<"+r+">":"<...>"}catch(e){return"<...>"}}function o(){return Error("react-stack-top-frame")}function i(){var e=t(this.type);return C[e]||(C[e]=!0),void 0!==(e=this.props.ref)?e:null}function l(e,r,a,o,l,u,p,d){var m,y=r.children;if(void 0!==y)if(o){if(T(y)){for(o=0;o<y.length;o++)s(y[o]);Object.freeze&&Object.freeze(y)}}else s(y);if(O.call(r,"key")){y=t(e);var g=Object.keys(r).filter(function(e){return"key"!==e});o=0<g.length?"{key: someKey, "+g.join(": ..., ")+": ...}":"{key: someKey}",R[y+o]||(g=0<g.length?"{"+g.join(": ..., ")+": ...}":"{}",R[y+o]=!0)}if(y=null,void 0!==a&&(n(a),y=""+a),function(e){if(O.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(r)&&(n(r.key),y=""+r.key),"key"in r)for(var h in a={},r)"key"!==h&&(a[h]=r[h]);else a=r;return y&&function(e){function t(){c||(c=!0)}t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}(a,"function"==typeof e&&(e.displayName||e.name)),function(e,t,r,n,a,o,l,s){return r=o.ref,e={$$typeof:f,type:e,key:t,props:o,_owner:a},null!==(void 0!==r?r:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:l}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(e,y,u,0,null===(m=N.A)?null:m.getOwner(),a,p,d)}function s(e){"object"==typeof e&&null!==e&&e.$$typeof===f&&e._store&&(e._store.validated=1)}var c,u=e,f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),m=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),v=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),x=Symbol.for("react.suspense_list"),S=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),j=Symbol.for("react.client.reference"),N=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=Object.prototype.hasOwnProperty,T=Array.isArray,P=console.createTask?console.createTask:function(){return null},C={},E=(u={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(u,o)(),q=P(a(o)),R={};h.Fragment=d,h.jsx=function(e,t,r,n,o){var i=1e4>N.recentlyCreatedOwnerStacks++;return l(e,t,r,!1,0,o,i?Error("react-stack-top-frame"):E,i?P(a(e)):q)},h.jsxs=function(e,t,r,n,o){var i=1e4>N.recentlyCreatedOwnerStacks++;return l(e,t,r,!0,0,o,i?Error("react-stack-top-frame"):E,i?P(a(e)):q)}}()),h);var v=y.exports;!function(e,t){void 0===t&&(t={});var r=t.insertAt;if("undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],a=document.createElement("style");a.type="text/css","top"===r&&n.firstChild?n.insertBefore(a,n.firstChild):n.appendChild(a),a.styleSheet?a.styleSheet.cssText=e:a.appendChild(document.createTextNode(e))}}('.gsap-react-marquee-container{display:flex;overflow:hidden;white-space:preserve nowrap;width:100%}.gsap-react-marquee-container:after{background:linear-gradient(270deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);left:0}.gsap-react-marquee-container:after,.gsap-react-marquee-container:before{content:"";height:100%;pointer-events:none;position:absolute;top:0;width:15%;z-index:10}.gsap-react-marquee-container:before{background:linear-gradient(90deg,hsla(0,0%,100%,0) 0,var(--gradient-color) 75%);right:0}.gsap-react-marquee{flex:1;height:max-content;width:auto}.gsap-react-marquee,.gsap-react-marquee-content{display:flex;line-height:100%;white-space:preserve nowrap}.gsap-react-marquee-content{overflow:hidden;width:max-content}');const b=(...e)=>p(f(e)),w=e=>{let t=e;for(;t;){const e=window.getComputedStyle(t).backgroundColor;if(e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e)return e;t=t.parentElement}return"transparent"},x=(e,t,r,n,a)=>{const{spacing:o=16,alignRotationWithY:i=!1}=a;if(l.set(e,{gap:`${o}px`,rotate:n?90:"0"}),n){const t=e.parentNode;l.set(e,{width:t.offsetHeight}),l.set(r,{overflow:"visible"})}if(i&&t.length>0){const n=t[0].offsetHeight;l.set(e,{alignItems:"center"}),l.set(r,{rotate:-90,x:(e.offsetWidth-o)/2-o,display:"flex",flexWrap:"wrap",width:n,wordBreak:"break-all",whiteSpace:"break-spaces"}),l.set(t,{height:e.offsetWidth-o})}},S=(e,t,r,n)=>{if(!n.fill)return 1;const a=r?window.innerHeight:t;return e<a?Math.ceil(a/e):1},k=(e,t,r,n)=>{const{fill:a=!1,alignRotationWithY:o=!1}=n;return a?"auto":o&&e.length>0?`${e[0].offsetHeight}px`:t<r?"100%":`${t}px`},_=(e,t,r,n,a,o,i)=>{const{spacing:c=16,speed:u=100,delay:f=0,paused:p=!1,alignRotationWithY:d=!1}=i,m=[],y=[],g=e.length-1;l.set(e,{xPercent:(e,t)=>{const r=m[e]=parseFloat(String(l.getProperty(t,"width","px")));return y[e]=parseFloat(String(l.getProperty(t,"x","px")))/r*100+Number(l.getProperty(t,"xPercent")),y[e]}}),l.set(e,{x:0});const h=e[g].offsetLeft+y[g]/100*m[g]-t+e[g].offsetWidth+c;if(e.forEach((e,n)=>{const a=y[n]/100*m[n],o=e.offsetLeft+a-t,i=d?o+e.offsetHeight-c:o+m[n];r.to(e,{xPercent:(a-i)/m[n]*100,duration:i/u},0).fromTo(e,{xPercent:(a-i+h)/m[n]*100},{xPercent:y[n],duration:(a-i+h-a)/u,immediateRender:!1},i/u)}),r.delay(f),n){if(p)return void r.pause();r.progress(1).pause(),l.delayedCall(f,()=>{r.reverse(),r.eventCallback("onReverseComplete",()=>{r.totalTime(r.rawTime()+100*r.duration())})})}let v;if("function"==typeof s&&i.draggable){v=document.createElement("div");const e=l.utils.wrap(0,1);let t,i;const c=()=>{const n=o?u.startY-u.y:u.startX-u.x;r.progress(e(i+n*t))},u=s.create(v,{trigger:a,type:o?"y":"x",onPress(){l.killTweensOf(r),r.pause(),i=r.progress(),t=1/h,l.set(v,{x:i/-t})},onDrag:c,onThrowUpdate:c,overshootTolerance:0,inertia:!0,onThrowComplete:()=>{if(n){if(p)return void r.pause();r.progress(r.progress()).pause(),l.delayedCall(f,()=>{r.reverse(),r.eventCallback("onReverseComplete",()=>{r.totalTime(r.rawTime()+100*r.duration())})})}else r.play()}})[0]}};l.registerPlugin(i,u,c,s);const j=t((e,t)=>{const{children:s,className:c,dir:f="left",loop:p=-1,paused:d=!1,fill:m=!1,followScrollDir:y=!1,scrollSpeed:g=2.5,gradient:h=!1,gradientColor:j=null,pauseOnHover:N=!1}=e,O=r(null),T=t||O,P=r(null),[C,E]=n(1),[q,R]=n(null);a(()=>{if(!h||!(null==T?void 0:T.current))return;const e=w(T.current);R(e)},[h]);const A="up"===f||"down"===f,$="down"===f||"right"===f;i((t,r)=>{if(!(null==P?void 0:P.current)||!T.current||!r)return;const n=null==T?void 0:T.current,a=l.utils.toArray(n.querySelectorAll(".gsap-react-marquee")),o=l.utils.toArray(n.querySelectorAll(".gsap-react-marquee .gsap-react-marquee-content")),i=P.current;if(!i||!o)return;const s=l.timeline({paused:d,repeat:p,defaults:{ease:"none"},onReverseComplete(){s.totalTime(s.rawTime()+100*s.duration())}});x(n,a,o,A,e);const c=n.offsetWidth,f=o[0].offsetWidth,h=o[0].offsetLeft;let v=null;const b=Math.min(4,Math.max(1.1,g));E(S(f,c,A,e));const w=l.utils.toArray(i.children).map(e=>e.offsetWidth).reduce((e,t)=>e+t,0);l.set(a,{minWidth:k(o,w,c,e),flex:m?"0 0 auto":"1"}),_(m?o:a,h,s,$,a,A,e),y&&(v=u.create({onChangeY(e){let t=b*($?-1:1);e.deltaY<0&&(t*=-1),l.timeline({defaults:{ease:"none"}}).to(s,{timeScale:t*b,duration:.2,overwrite:!0}).to(s,{timeScale:t/b,duration:1},"+=0.3")}}));const j=r(()=>{s.timeScale(0)}),O=r(()=>{s.timeScale(1)});return N&&(n.addEventListener("mouseenter",j),n.addEventListener("mouseleave",O)),()=>{n.removeEventListener("mouseenter",j),n.removeEventListener("mouseleave",O),s.kill(),null==v||v.kill()}},{dependencies:[C,f,p,d,m,y,g,h,j,N]});const W=o(()=>!Number.isFinite(C)||C<=0?null:Array.from({length:C},(e,t)=>v.jsx("div",{className:b("gsap-react-marquee"),children:v.jsx("div",{className:b("gsap-react-marquee-content",c),children:s})},t)),[C,c,s]);return v.jsxs("div",{ref:T,style:{"--gradient-color":j||(h&&q?q:"transparent")},className:b("gsap-react-marquee-container"),children:[v.jsx("div",{ref:P,className:b("gsap-react-marquee"),children:v.jsx("div",{className:b("gsap-react-marquee-content",c),children:s})}),W]})});j.displayName="GSAPReactMarquee";export{S as calculateDuplicates,b as cn,_ as coreAnimation,j as default,w as getEffectiveBackgroundColor,k as getMinWidth,x as setupContainerStyles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const marqueeStyles = "\n.gsap-react-marquee-container::after {\n content: \"\";\n position: absolute;\n top: 0;\n left: 0;\n width: 15%;\n height: 100%;\n background: linear-gradient(\n 270deg,\n rgba(255, 255, 255, 0) 0%,\n var(--gradient-color) 75%\n );\n z-index: 10;\n pointer-events: none;\n}\n\n.gsap-react-marquee-container::before {\n content: \"\";\n position: absolute;\n top: 0;\n right: 0;\n width: 15%;\n height: 100%;\n background: linear-gradient(\n 90deg,\n rgba(255, 255, 255, 0) 0%,\n var(--gradient-color) 75%\n );\n z-index: 10;\n pointer-events: none;\n}\n\n.gsap-react-marquee {\n width: auto;\n height: max-content;\n line-height: 100%;\n white-space: preserve nowrap;\n display: flex;\n flex: 1;\n}\n\n.gsap-react-marquee-content {\n width: max-content;\n line-height: 100%;\n white-space: preserve nowrap;\n display: flex;\n overflow: hidden;\n}\n";
|
|
2
|
+
export declare const injectStyles: () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export type GSAPReactMarqueeProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
dir?: "right" | "left" | "up" | "down";
|
|
6
|
+
loop?: number;
|
|
7
|
+
paused?: boolean;
|
|
8
|
+
alignRotationWithY?: boolean;
|
|
9
|
+
delay?: number;
|
|
10
|
+
speed?: number;
|
|
11
|
+
fill?: boolean;
|
|
12
|
+
pauseOnHover?: boolean;
|
|
13
|
+
gradient?: boolean;
|
|
14
|
+
gradientColor?: string;
|
|
15
|
+
spacing?: number;
|
|
16
|
+
draggable?: boolean;
|
|
17
|
+
followScrollDir?: boolean;
|
|
18
|
+
scrollSpeed?: number;
|
|
19
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ClassValue } from "clsx";
|
|
2
|
+
import type { GSAPReactMarqueeProps } from "./gsap-react-marquee.type";
|
|
3
|
+
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
4
|
+
export declare const getEffectiveBackgroundColor: (el: HTMLElement) => string;
|
|
5
|
+
export declare const setupContainerStyles: (containerMarquee: HTMLElement, marquees: HTMLElement[], marqueesChildren: HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
|
|
6
|
+
export declare const calculateDuplicates: (marqueeChildrenWidth: number, containerMarqueeWidth: number, isVertical: boolean, props: GSAPReactMarqueeProps) => number;
|
|
7
|
+
export declare const getMinWidth: (marqueesChildren: HTMLElement[], totalWidth: number, containerMarqueeWidth: number, props: GSAPReactMarqueeProps) => string | number;
|
|
8
|
+
export declare const coreAnimation: (elementsToAnimate: HTMLElement[], startX: number, tl: gsap.core.Timeline, isReverse: boolean, draggableTrigger: HTMLElement | HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
|
package/package.json
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "gsap-react-marquee",
|
|
3
|
-
"author": "David Domenico Piscopo",
|
|
4
|
-
"description": "A high-performance React marquee component powered by GSAP",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"version": "0.1
|
|
7
|
-
"type": "module",
|
|
8
|
-
"main": "dist/index.cjs.js",
|
|
9
|
-
"module": "dist/index.esm.js",
|
|
10
|
-
"types": "dist/index.d.ts",
|
|
11
|
-
"files": [
|
|
12
|
-
"dist",
|
|
13
|
-
"README.md",
|
|
14
|
-
"LICENSE"
|
|
15
|
-
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "rollup -c",
|
|
18
|
-
"build:watch": "rollup -c -w",
|
|
19
|
-
"prepare": "npm run build"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"react",
|
|
23
|
-
"marquee",
|
|
24
|
-
"gsap",
|
|
25
|
-
"animation",
|
|
26
|
-
"scroll",
|
|
27
|
-
"infinite",
|
|
28
|
-
"component",
|
|
29
|
-
"typescript"
|
|
30
|
-
],
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "git+https://github.com/daviddpi/gsap-react-marquee.git"
|
|
34
|
-
},
|
|
35
|
-
"bugs": {
|
|
36
|
-
"url": "https://github.com/daviddpi/gsap-react-marquee/issues"
|
|
37
|
-
},
|
|
38
|
-
"homepage": "https://github.com/daviddpi/gsap-react-marquee#readme",
|
|
39
|
-
"peerDependencies": {
|
|
40
|
-
"@gsap/react": "^2.1.1",
|
|
41
|
-
"clsx": "^2.1.0",
|
|
42
|
-
"gsap": "^3.12.0",
|
|
43
|
-
"react": ">=18",
|
|
44
|
-
"react-dom": ">=18",
|
|
45
|
-
"tailwind-merge": "^2.2.0"
|
|
46
|
-
},
|
|
47
|
-
"devDependencies": {
|
|
48
|
-
"@gsap/react": "^2.1.1",
|
|
49
|
-
"@rollup/plugin-commonjs": "^25.0.7",
|
|
50
|
-
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
51
|
-
"@rollup/plugin-typescript": "^11.1.6",
|
|
52
|
-
"@types/react": "^18.3.3",
|
|
53
|
-
"@types/react-dom": "^18.3.0",
|
|
54
|
-
"clsx": "^2.1.1",
|
|
55
|
-
"rollup": "^4.18.0",
|
|
56
|
-
"rollup-plugin-dts": "^6.1.1",
|
|
57
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
58
|
-
"tailwind-merge": "^2.3.0",
|
|
59
|
-
"tslib": "^2.8.1",
|
|
60
|
-
"typescript": "^5.5.2"
|
|
61
|
-
},
|
|
62
|
-
"dependencies": {
|
|
63
|
-
"@rollup/plugin-terser": "^0.4.4"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "gsap-react-marquee",
|
|
3
|
+
"author": "David Domenico Piscopo",
|
|
4
|
+
"description": "A high-performance React marquee component powered by GSAP",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"version": "0.2.1",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.cjs.js",
|
|
9
|
+
"module": "dist/index.esm.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "rollup -c",
|
|
18
|
+
"build:watch": "rollup -c -w",
|
|
19
|
+
"prepare": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"react",
|
|
23
|
+
"marquee",
|
|
24
|
+
"gsap",
|
|
25
|
+
"animation",
|
|
26
|
+
"scroll",
|
|
27
|
+
"infinite",
|
|
28
|
+
"component",
|
|
29
|
+
"typescript"
|
|
30
|
+
],
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "git+https://github.com/daviddpi/gsap-react-marquee.git"
|
|
34
|
+
},
|
|
35
|
+
"bugs": {
|
|
36
|
+
"url": "https://github.com/daviddpi/gsap-react-marquee/issues"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/daviddpi/gsap-react-marquee#readme",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@gsap/react": "^2.1.1",
|
|
41
|
+
"clsx": "^2.1.0",
|
|
42
|
+
"gsap": "^3.12.0",
|
|
43
|
+
"react": ">=18",
|
|
44
|
+
"react-dom": ">=18",
|
|
45
|
+
"tailwind-merge": "^2.2.0"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@gsap/react": "^2.1.1",
|
|
49
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
50
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
51
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
52
|
+
"@types/react": "^18.3.3",
|
|
53
|
+
"@types/react-dom": "^18.3.0",
|
|
54
|
+
"clsx": "^2.1.1",
|
|
55
|
+
"rollup": "^4.18.0",
|
|
56
|
+
"rollup-plugin-dts": "^6.1.1",
|
|
57
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
58
|
+
"tailwind-merge": "^2.3.0",
|
|
59
|
+
"tslib": "^2.8.1",
|
|
60
|
+
"typescript": "^5.5.2"
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@rollup/plugin-terser": "^0.4.4"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type GSAPReactMarqueeProps = {
|
|
3
|
-
/** Content to render inside the marquee */
|
|
4
|
-
children: ReactNode;
|
|
5
|
-
/** Additional CSS classes for styling */
|
|
6
|
-
className?: string;
|
|
7
|
-
/**
|
|
8
|
-
* @description Direction of the marquee movement
|
|
9
|
-
* @type {"right" | "left" | "up" | "down"}
|
|
10
|
-
* @default "right"
|
|
11
|
-
*/
|
|
12
|
-
dir?: "right" | "left" | "up" | "down";
|
|
13
|
-
/**
|
|
14
|
-
* @description The number of times the marquee should loop, -1 is equivalent to infinite
|
|
15
|
-
* @type {number}
|
|
16
|
-
* @default -1
|
|
17
|
-
*/
|
|
18
|
-
loop?: number;
|
|
19
|
-
/**
|
|
20
|
-
* @description Whether the marquee animation should be paused
|
|
21
|
-
* @type {boolean}
|
|
22
|
-
* @default false
|
|
23
|
-
*/
|
|
24
|
-
paused?: boolean;
|
|
25
|
-
/**
|
|
26
|
-
* @description Correctly orients (rotates) the content with respect to the Y axis.
|
|
27
|
-
* Useful for vertical movement ("up" | "down") to keep items upright via rotation fix.
|
|
28
|
-
* @issue ⚠️ Not recommended to use together with "left" or "right" direction, as it may cause layout issues.
|
|
29
|
-
* @type {boolean}
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
alignRotationWithY?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @description Delay before the animation starts
|
|
35
|
-
* @type {number}
|
|
36
|
-
* @default 0
|
|
37
|
-
*/
|
|
38
|
-
delay?: number;
|
|
39
|
-
/**
|
|
40
|
-
* @description Speed of the marquee animation in px/s
|
|
41
|
-
* @type {number}
|
|
42
|
-
* @default 100
|
|
43
|
-
*/
|
|
44
|
-
speed?: number;
|
|
45
|
-
/**
|
|
46
|
-
* @description Whether the marquee should continuously fill the space
|
|
47
|
-
* @type {boolean}
|
|
48
|
-
* @default false
|
|
49
|
-
*/
|
|
50
|
-
fill?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* @description Pause the marquee when hovering
|
|
53
|
-
* @type {boolean}
|
|
54
|
-
* @default false
|
|
55
|
-
*/
|
|
56
|
-
pauseOnHover?: boolean;
|
|
57
|
-
/**
|
|
58
|
-
* @description Enable gradient overlay
|
|
59
|
-
* @type {boolean}
|
|
60
|
-
* @default false
|
|
61
|
-
*/
|
|
62
|
-
gradient?: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* @description Color of the gradient if enabled
|
|
65
|
-
* @type {string}
|
|
66
|
-
*/
|
|
67
|
-
gradientColor?: string;
|
|
68
|
-
/**
|
|
69
|
-
* @description Spacing between repeated elements in px
|
|
70
|
-
* @type {number}
|
|
71
|
-
* @default 16
|
|
72
|
-
*/
|
|
73
|
-
spacing?: number;
|
|
74
|
-
/**
|
|
75
|
-
* @description Enable dragging to scroll manually
|
|
76
|
-
* @type {boolean}
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
draggable?: boolean;
|
|
80
|
-
/**
|
|
81
|
-
* @description Whether to sync with page scroll direction
|
|
82
|
-
* @type {boolean}
|
|
83
|
-
* @default false
|
|
84
|
-
*/
|
|
85
|
-
followScrollDir?: boolean;
|
|
86
|
-
/**
|
|
87
|
-
* @description Speed factor when syncing with page scroll, max value is 4
|
|
88
|
-
* @type {number}
|
|
89
|
-
* @default 2.5
|
|
90
|
-
*/
|
|
91
|
-
scrollSpeed?: number;
|
|
92
|
-
};
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { type ClassValue } from "clsx";
|
|
2
|
-
import type { GSAPReactMarqueeProps } from "./gsap-react-marquee.type";
|
|
3
|
-
/**
|
|
4
|
-
* Utility function to merge Tailwind classes with clsx
|
|
5
|
-
*
|
|
6
|
-
* Combines clsx for conditional classes with tailwind-merge to handle
|
|
7
|
-
* conflicting Tailwind classes by keeping the last occurrence.
|
|
8
|
-
* This prevents issues like "p-4 p-2" where both would be applied.
|
|
9
|
-
*
|
|
10
|
-
* @param inputs - Array of class values (strings, conditionals, objects)
|
|
11
|
-
* @returns Merged and deduplicated class string
|
|
12
|
-
*/
|
|
13
|
-
export declare const cn: (...inputs: ClassValue[]) => string;
|
|
14
|
-
/**
|
|
15
|
-
* Traverses the DOM tree upward to find the first non-transparent background color
|
|
16
|
-
*
|
|
17
|
-
* This function walks up the element hierarchy starting from the given element,
|
|
18
|
-
* checking each parent's computed backgroundColor style until it finds a visible
|
|
19
|
-
* (non-transparent) background color. This is useful for automatically detecting
|
|
20
|
-
* the effective background behind an element for gradient overlays.
|
|
21
|
-
*
|
|
22
|
-
* The traversal stops at the first element with a visible background color,
|
|
23
|
-
* which could be the element itself or any of its ancestors up to the document root.
|
|
24
|
-
*
|
|
25
|
-
* @param el - The HTMLElement to start the background color search from
|
|
26
|
-
* @returns The first non-transparent background color found in the hierarchy,
|
|
27
|
-
* or "transparent" if no visible background is found
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* // Element with white parent background
|
|
31
|
-
* const color = getEffectiveBackgroundColor(marqueeElement);
|
|
32
|
-
* // Returns: "rgb(255, 255, 255)" or "#ffffff"
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* // Element with no background set anywhere in hierarchy
|
|
36
|
-
* const color = getEffectiveBackgroundColor(marqueeElement);
|
|
37
|
-
* // Returns: "transparent"
|
|
38
|
-
*/
|
|
39
|
-
export declare const getEffectiveBackgroundColor: (el: HTMLElement) => string;
|
|
40
|
-
/**
|
|
41
|
-
* Sets up container styles and rotation handling for the marquee
|
|
42
|
-
*
|
|
43
|
-
* This function handles the complex styling requirements for different marquee orientations:
|
|
44
|
-
*
|
|
45
|
-
* 1. **Basic Setup**: Applies gap spacing and rotation for vertical marquees
|
|
46
|
-
* 2. **Vertical Mode**: Rotates container 90° and adjusts width to parent height
|
|
47
|
-
* 3. **Rotation Alignment**: Special mode for vertical text that remains readable
|
|
48
|
-
*
|
|
49
|
-
* @param containerMarquee - The main container element that holds all marquee instances
|
|
50
|
-
* @param marquees - Array of individual marquee wrapper elements
|
|
51
|
-
* @param marqueesChildren - Array of content container elements within each marquee
|
|
52
|
-
* @param isVertical - Boolean indicating if marquee moves up/down instead of left/right
|
|
53
|
-
* @param props - Configuration object containing spacing and alignment options
|
|
54
|
-
*/
|
|
55
|
-
export declare const setupContainerStyles: (containerMarquee: HTMLElement, marquees: HTMLElement[], marqueesChildren: HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
|
|
56
|
-
/**
|
|
57
|
-
* Calculates the number of content duplicates needed for seamless looping
|
|
58
|
-
*
|
|
59
|
-
* For smooth infinite scrolling, we need enough content copies to fill the visible area
|
|
60
|
-
* plus buffer space. This prevents gaps when content loops back to the beginning.
|
|
61
|
-
*
|
|
62
|
-
* Algorithm:
|
|
63
|
-
* 1. If not in fill mode, only one copy is needed (content already spans container)
|
|
64
|
-
* 2. Determine target width (viewport height for vertical, container width for horizontal)
|
|
65
|
-
* 3. Calculate how many copies fit in the target space, rounding up for complete coverage
|
|
66
|
-
*
|
|
67
|
-
* @param marqueeChildrenWidth - Width of a single content instance
|
|
68
|
-
* @param containerMarqueeWidth - Width of the marquee container
|
|
69
|
-
* @param isVertical - Whether the marquee scrolls vertically
|
|
70
|
-
* @param props - Configuration object containing fill mode setting
|
|
71
|
-
* @returns Number of content duplicates needed (minimum 1)
|
|
72
|
-
*/
|
|
73
|
-
export declare const calculateDuplicates: (marqueeChildrenWidth: number, containerMarqueeWidth: number, isVertical: boolean, props: GSAPReactMarqueeProps) => number;
|
|
74
|
-
/**
|
|
75
|
-
* Determines the minimum width for marquee elements based on content and container
|
|
76
|
-
*
|
|
77
|
-
* This function ensures marquee elements have appropriate dimensions for their content
|
|
78
|
-
* and container context, handling different modes and orientations.
|
|
79
|
-
*
|
|
80
|
-
* Width determination logic:
|
|
81
|
-
* 1. **Fill mode**: Auto width lets content size naturally
|
|
82
|
-
* 2. **Rotation alignment**: Use content height as width (rotated dimensions)
|
|
83
|
-
* 3. **Undersized content**: Stretch to 100% to fill container
|
|
84
|
-
* 4. **Oversized content**: Use actual content width for overflow scrolling
|
|
85
|
-
*
|
|
86
|
-
* @param marqueesChildren - Array of content elements for dimension measurement
|
|
87
|
-
* @param totalWidth - Combined width of all content elements
|
|
88
|
-
* @param containerMarqueeWidth - Available container width
|
|
89
|
-
* @param props - Configuration object containing fill and alignment settings
|
|
90
|
-
* @returns CSS width value (string with units or number for pixels)
|
|
91
|
-
*/
|
|
92
|
-
export declare const getMinWidth: (marqueesChildren: HTMLElement[], totalWidth: number, containerMarqueeWidth: number, props: GSAPReactMarqueeProps) => string | number;
|
|
93
|
-
/**
|
|
94
|
-
* Creates a complex marquee animation with seamless looping and draggable support
|
|
95
|
-
*
|
|
96
|
-
* This is the core animation engine that creates smooth, continuous scrolling.
|
|
97
|
-
* It handles the complex math required for seamless looping by calculating
|
|
98
|
-
* precise positions and durations for each content element.
|
|
99
|
-
*
|
|
100
|
-
* Animation Strategy:
|
|
101
|
-
* 1. **Position Calculation**: Convert pixel positions to percentages for responsive scaling
|
|
102
|
-
* 2. **Seamless Looping**: Calculate track length and loop points to prevent gaps
|
|
103
|
-
* 3. **Staggered Animation**: Each element starts at different times for smooth flow
|
|
104
|
-
* 4. **Direction Handling**: Support forward and reverse directions with proper timing
|
|
105
|
-
* 5. **Integrated Draggable**: Optional support for drag interaction with manual control
|
|
106
|
-
*
|
|
107
|
-
* Technical Details:
|
|
108
|
-
* - Uses xPercent for percentage-based positioning (responsive to element width changes)
|
|
109
|
-
* - Creates two-part animation: main movement + seamless loop reset
|
|
110
|
-
* - Calculates precise durations based on distance and speed for consistent motion
|
|
111
|
-
* - Implements draggable with intelligent pause/resume animation handling
|
|
112
|
-
*
|
|
113
|
-
* @param elementsToAnimate - Array of DOM elements to animate (content or containers)
|
|
114
|
-
* @param startX - Starting X position reference point
|
|
115
|
-
* @param tl - GSAP timeline to add animations to
|
|
116
|
-
* @param isReverse - Whether animation should play in reverse direction
|
|
117
|
-
* @param draggableTrigger - Element(s) that will trigger the draggable functionality
|
|
118
|
-
* @param isVertical - Whether the marquee scrolls vertically
|
|
119
|
-
* @param props - Configuration object with spacing, speed, delay, and other settings
|
|
120
|
-
*/
|
|
121
|
-
export declare const coreAnimation: (elementsToAnimate: HTMLElement[], startX: number, tl: gsap.core.Timeline, isReverse: boolean, draggableTrigger: HTMLElement | HTMLElement[], isVertical: boolean, props: GSAPReactMarqueeProps) => void;
|