12 lines
7.3 KiB
JavaScript
12 lines
7.3 KiB
JavaScript
|
|
/*!
|
||
|
|
* InertiaPlugin 3.11.0
|
||
|
|
* https://greensock.com
|
||
|
|
*
|
||
|
|
* @license Copyright 2022, GreenSock. All rights reserved.
|
||
|
|
* This plugin is a membership benefit of Club GreenSock and is only authorized for use in sites/apps/products developed by individuals/companies with an active Club GreenSock membership. See https://greensock.com/club
|
||
|
|
* @author: Jack Doyle, jack@greensock.com
|
||
|
|
*/
|
||
|
|
|
||
|
|
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function m(){return i||"undefined"!=typeof window&&(i=window.gsap)}function p(t){return c(t).id}function q(t){return f[p("string"==typeof t?g(t)[0]:t)]}function r(t){var e,r=o;if(.05<=t-s)for(s=t;r;)((e=r.g(r.t,r.p))!==r.v1||.2<t-r.t1)&&(r.v2=r.v1,r.v1=e,r.t2=r.t1,r.t1=t),r=r._next}function t(){(i=m())&&(g=i.utils.toArray,n=i.utils.getUnit,c=i.core.getCache,a=i.ticker,l=1)}function u(t,e,r,i){this.t=t,this.p=e,this.g=t._gsap.get,this.rCap=v[r||n(this.g(t,e))],this.v1=this.v2=0,this.t1=this.t2=a.time,i&&((this._next=i)._prev=this)}var i,l,g,n,o,a,s,c,f={},v={deg:360,rad:2*Math.PI},d=function(){function VelocityTracker(e,r){l||t(),this.target=g(e)[0],(f[p(this.target)]=this)._props={},r&&this.add(r)}VelocityTracker.register=function register(e){i=e,t()};var e=VelocityTracker.prototype;return e.get=function get(t,e){var r,i,n=this._props[t]||console.warn("Not tracking "+t+" velocity.");return r=parseFloat(e?n.v1:n.g(n.t,n.p))-parseFloat(n.v2),(i=n.rCap)&&(r%=i)!==r%(i/2)&&(r=r<0?r+i:r-i),function _round(t){return Math.round(1e4*t)/1e4}(r/((e?n.t1:a.time)-n.t2))},e.getAll=function getAll(){var t,e={},r=this._props;for(t in r)e[t]=this.get(t);return e},e.isTracking=function isTracking(t){return t in this._props},e.add=function add(t,e){t in this._props||(o||(a.add(r),s=a.time),o=this._props[t]=new u(this.target,t,e,o))},e.remove=function remove(t){var e,i,n=this._props[t];n&&(e=n._prev,i=n._next,e&&(e._next=i),i?i._prev=e:o===n&&(a.remove(r),o=0),delete this._props[t])},e.kill=function kill(t){for(var e in this._props)this.remove(e);t||delete f[p(this.target)]},VelocityTracker.track=function track(e,r,i){l||t();for(var n,o,a=[],s=g(e),c=r.split(","),u=(i||"").split(","),f=s.length;f--;){for(n=q(s[f])||new VelocityTracker(s[f]),o=c.length;o--;)n.add(c[o],u[o]||u[0]);a.push(n)}return a},VelocityTracker.untrack=function untrack(t,e){var r=(e||"").split(",");g(t).forEach(function(t){var e=q(t);e&&(r.length?r.forEach(function(t){return e.remove(t)}):e.kill(1))})},VelocityTracker.isTracking=function isTracking(t,e){var r=q(t);return r&&r.isTracking(e)},VelocityTracker.getVelocity=function getVelocity(t,e){var r=q(t);return r&&r.isTracking(e)?r.get(e):console.warn("Not tracking velocity of "+e)},VelocityTracker}();d.getByTarget=q,m()&&i.registerPlugin(d);function L(){return h||"undefined"!=typeof window&&(h=window.gsap)&&h.registerPlugin&&h}function N(t){return"number"==typeof t}function O(t){return"object"==typeof t}function P(t){return"function"==typeof t}function S(t){return t}function W(t){return Math.round(1e4*t)/1e4}function X(t,e,r){for(var i in e)i in t||i===r||(t[i]=e[i]);return t}function Y(t){var e,r,i={};for(e in t)i[e]=O(r=t[e])&&!I(r)?Y(r):r;return i}function Z(t,e,r,i,n){var o,a,s,c,u=e.length,f=0,l=R;if(O(t)){for(;u--;){for(s in o=e[u],a=0,t)a+=(c=o[s]-t[s])*c;a<l&&(f=u,l=a)}if((n||R)<R&&n<Math.sqrt(l))return t}else for(;u--;)(a=(o=e[u])-t)<0&&(a=-a),a<l&&i<=o&&o<=r&&(f=u,l=a);return e[f]}function $(t,e,r,i,n,o,a){if("auto"===t.end)return t;var s,c,u=t.end;if(r=isNaN(r)?R:r,i=isNaN(i)?-R:i,O(e)){if(s=e.calculated?e:(P(u)?u(e,a):Z(e,u,r,i,o))||e,!e.calculated){for(c in s)e[c]=s[c];e.calculated=!0}s=s[n]}else s=P(u)?u(e,a):I(u)?Z(e,u,r,i,o):parseFloat(u);return r<s?s=r:s<i&&(s=i),{max:s,min:s,unitFactor:t.unitFactor}}function _(t,e,r){return isNaN(t[e])?r:+t[e]}function aa(t,e){return.05*e*t/T}function ba(t,e,r){return Math.abs((e-t)*T/r/.05)}function da(t,e,r,i){if(e.linkedProps){var n,o,a,s,c,u,f=e.linkedProps.split(","),l={};for(n=0;n<f.length;n++)(a=e[o=f[n]])&&(s=N(a.velocity)?a.velocity:(c=c||B(t))&&c.isTracking(o)?c.get(o):0,u=Math.abs(s/_(a,"resistance",i)),l[o]=parseFloat(r(t,o))+aa(s,u));return l}}function fa(){(h=L())&&(y=h.parseEase,F=h.utils.toArray,b=h.utils.getUnit,A=h.core.getCache,E=h.utils.clamp,C=h.core.getStyleSaver,w=h.core.reverting||function(){},k=y("power3"),T=k(.05),M=h.core.PropTween,h.confi
|
||
|
|
|