LocalCDN-Firefox-Chrome-Brave/resources/gsap/3.11.1/ScrollTrigger.min.jsm

12 lines
38 KiB
JavaScript
Raw Normal View History

2022-09-04 07:44:31 +02:00
/*!
* ScrollTrigger 3.11.1
* https://greensock.com
*
* @license Copyright 2022, GreenSock. All rights reserved.
* Subject to the terms at https://greensock.com/standard-license or for Club GreenSock members, the agreement issued with that membership.
* @author: Jack Doyle, jack@greensock.com
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).window=e.window||{})}(this,function(e){"use strict";function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function q(){return we||"undefined"!=typeof window&&(we=window.gsap)&&we.registerPlugin&&we}function y(e,t){return~He.indexOf(e)&&He[He.indexOf(e)+1][t]}function z(e){return!!~t.indexOf(e)}function A(e,t,r,n,i){return e.addEventListener(t,r,{passive:!n,capture:!!i})}function B(e,t,r,n){return e.removeEventListener(t,r,!!n)}function E(){return ze&&ze.isPressed||k.cache++}function F(r,n){function Pc(e){if(e||0===e){i&&(ke.history.scrollRestoration="manual");var t=ze&&ze.isPressed;e=Pc.v=Math.round(e)||(ze&&ze.iOS?1:0),r(e),Pc.cacheID=k.cache,t&&o("ss",e)}else(n||k.cache!==Pc.cacheID||o("ref"))&&(Pc.cacheID=k.cache,Pc.v=r());return Pc.v+Pc.offset}return Pc.offset=0,r&&Pc}function I(e){return we.utils.toArray(e)[0]||("string"==typeof e&&!1!==we.config().nullTargetWarn?console.warn("Element not found:",e):null)}function J(t,e){var r=e.s,n=e.sc,i=k.indexOf(t),o=n===Je.sc?1:2;return~i||(i=k.push(t)-1),k[i+o]||(k[i+o]=F(y(t,r),!0)||(z(t)?n:F(function(e){return arguments.length?t[r]=e:t[r]})))}function K(e,t,i){function jd(e,t){var r=je();t||n<r-s?(a=o,o=e,l=s,s=r):i?o+=e:o=a+(e-a)/(r-l)*(s-l)}var o=e,a=e,s=je(),l=s,n=t||50,c=Math.max(500,3*n);return{update:jd,reset:function reset(){a=o=i?0:o,l=s=0},getVelocity:function getVelocity(e){var t=l,r=a,n=je();return!e&&0!==e||e===o||jd(e),s===l||c<n-l?0:(o+(i?r:-r))/((i?n:s)-t)*1e3}}}function L(e,t){return t&&!e._gsapAllow&&e.preventDefault(),e.changedTouches?e.changedTouches[0]:e}function M(e){var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e);return Math.abs(t)>=Math.abs(r)?t:r}function N(){(Be=we.core.globals().ScrollTrigger)&&Be.core&&function _integrate(){var e=Be.core,r=e.bridge||{},t=e._scrollers,n=e._proxies;t.push.apply(t,k),n.push.apply(n,He),k=t,He=n,o=function _bridge(e,t){return r[e](t)}}()}function O(e){return(we=e||q())&&"undefined"!=typeof document&&document.body&&(ke=window,Ce=(Me=document).documentElement,Ae=Me.body,t=[ke,Me,Ce,Ae],we.utils.clamp,Ie="onpointerenter"in Ae?"pointer":"mouse",Ee=P.isTouch=ke.matchMedia&&ke.matchMedia("(hover: none), (pointer: coarse)").matches?1:"ontouchstart"in ke||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints?2:0,De=P.eventTypes=("ontouchstart"in Ce?"touchstart,touchmove,touchcancel,touchend":"onpointerdown"in Ce?"pointerdown,pointermove,pointercancel,pointerup":"mousedown,mousemove,mouseup,mouseup").split(","),setTimeout(function(){return i=0},500),N(),_e=1),_e}var we,_e,ke,Me,Ce,Ae,Ee,Ie,Be,t,ze,De,i=1,Re=[],k=[],He=[],je=Date.now,o=function _bridge(e,t){return t},r="scrollLeft",n="scrollTop",Fe={s:r,p:"left",p2:"Left",os:"right",os2:"Right",d:"width",d2:"Width",a:"x",sc:F(function(e){return arguments.length?ke.scrollTo(e,Je.sc()):ke.pageXOffset||Me[r]||Ce[r]||Ae[r]||0})},Je={s:n,p:"top",p2:"Top",os:"bottom",os2:"Bottom",d:"height",d2:"Height",a:"y",op:Fe,sc:F(function(e){return arguments.length?ke.scrollTo(Fe.sc(),e):ke.pageYOffset||Me[n]||Ce[n]||Ae[n]||0})};Fe.op=Je,k.cache=0;var P=(Observer.prototype.init=function init(e){_e||O(we)||console.warn("Please gsap.registerPlugin(Observer)"),Be||N();var i=e.tolerance,a=e.dragMinimum,t=e.type,n=e.target,r=e.lineHeight,o=e.debounce,s=e.preventDefault,l=e.onStop,c=e.onStopDelay,u=e.ignore,f=e.wheelSpeed,d=e.event,p=e.onDragStart,g=e.onDragEnd,h=e.onDrag,b=e.onPress,v=e.onRelease,m=e.onRight,y=e.onLeft,x=e.onUp,w=e.onDown,S=e.onChangeX,_=e.onChangeY,T=e.onChange,k=e.onToggleX,P=e.onToggleY,C=e.onHover,D=e.onHoverEnd,X=e.onMove,Y=e.ignoreCheck,R=e.isNormalizer,H=e.onGestureStart,j=e.onGestureEnd,F=e.onWheel,W=e.onEnable,V=e.onDisable,G=e.onClick,U=e.scrollSpeed,q=e.capture,$=e.allowClicks,Q=e.lockAxis,Z=e.onLockAxis;function Ke(){return ye=je()}function Le(e,t){return(se.event=e)&&u&&~u.indexOf(e.ta