3 lines
13 KiB
JavaScript
3 lines
13 KiB
JavaScript
/*! For license information please see shifty.core.js.LICENSE.txt */
|
|
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("shifty",[],n):"object"==typeof exports?exports.shifty=n():t.shifty=n()}(self,(function(){return function(){"use strict";var t={868:function(t,n,e){e.r(n),e.d(n,{Tweenable:function(){return wt},processTweens:function(){return _t},tween:function(){return bt}});var r={};e.r(r),e.d(r,{bounce:function(){return E},bouncePast:function(){return q},easeFrom:function(){return D},easeFromTo:function(){return Q},easeInBack:function(){return k},easeInCirc:function(){return S},easeInCubic:function(){return s},easeInExpo:function(){return w},easeInOutBack:function(){return T},easeInOutCirc:function(){return P},easeInOutCubic:function(){return f},easeInOutExpo:function(){return O},easeInOutQuad:function(){return a},easeInOutQuart:function(){return p},easeInOutQuint:function(){return d},easeInOutSine:function(){return g},easeInQuad:function(){return u},easeInQuart:function(){return h},easeInQuint:function(){return _},easeInSine:function(){return y},easeOutBack:function(){return I},easeOutBounce:function(){return j},easeOutCirc:function(){return M},easeOutCubic:function(){return c},easeOutExpo:function(){return b},easeOutQuad:function(){return o},easeOutQuart:function(){return l},easeOutQuint:function(){return v},easeOutSine:function(){return m},easeTo:function(){return R},elastic:function(){return A},linear:function(){return i},swingFrom:function(){return x},swingFromTo:function(){return F},swingTo:function(){return C}});var i=function(t){return t},u=function(t){return Math.pow(t,2)},o=function(t){return-(Math.pow(t-1,2)-1)},a=function(t){return(t/=.5)<1?.5*Math.pow(t,2):-.5*((t-=2)*t-2)},s=function(t){return Math.pow(t,3)},c=function(t){return Math.pow(t-1,3)+1},f=function(t){return(t/=.5)<1?.5*Math.pow(t,3):.5*(Math.pow(t-2,3)+2)},h=function(t){return Math.pow(t,4)},l=function(t){return-(Math.pow(t-1,4)-1)},p=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},_=function(t){return Math.pow(t,5)},v=function(t){return Math.pow(t-1,5)+1},d=function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)},y=function(t){return 1-Math.cos(t*(Math.PI/2))},m=function(t){return Math.sin(t*(Math.PI/2))},g=function(t){return-.5*(Math.cos(Math.PI*t)-1)},w=function(t){return 0===t?0:Math.pow(2,10*(t-1))},b=function(t){return 1===t?1:1-Math.pow(2,-10*t)},O=function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},S=function(t){return-(Math.sqrt(1-t*t)-1)},M=function(t){return Math.sqrt(1-Math.pow(t-1,2))},P=function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},j=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},k=function(t){var n=1.70158;return t*t*((n+1)*t-n)},I=function(t){var n=1.70158;return(t-=1)*t*((n+1)*t+n)+1},T=function(t){var n=1.70158;return(t/=.5)<1?t*t*((1+(n*=1.525))*t-n)*.5:.5*((t-=2)*t*((1+(n*=1.525))*t+n)+2)},A=function(t){return-1*Math.pow(4,-8*t)*Math.sin((6*t-1)*(2*Math.PI)/2)+1},F=function(t){var n=1.70158;return(t/=.5)<1?t*t*((1+(n*=1.525))*t-n)*.5:.5*((t-=2)*t*((1+(n*=1.525))*t+n)+2)},x=function(t){var n=1.70158;return t*t*((n+1)*t-n)},C=function(t){var n=1.70158;return(t-=1)*t*((n+1)*t+n)+1},E=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},q=function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?2-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?2-(7.5625*(t-=2.25/2.75)*t+.9375):2-(7.5625*(t-=2.625/2.75)*t+.984375)},Q=function(t){return(t/=.5)<1?.5*Math.pow(t,4):-.5*((t-=2)*Math.pow(t,3)-2)},D=function(t){return Math.pow(t,4)},R=function(t){return Math.pow(t,.25)};function B(t,n,e,r,i,u){var o,a,s,c,f,h=0,l=0,p=0,_=function(t){return((h*t+l)*t+p)*t},v=function(t){return(3*h*t+2*l)*t+p},d=function(t){return t>=0?t:0-t};return h=1-(p=3*n)-(l=3*(r-n)-p),s=1-(f=3*e)-(c=3*(i-e)-f),o=t,a=function(t){return 1/(200*t)}(u),function(t){return((s*t+c)*t+f)*t}(function(t,n){var e,r,i,u,o,a;for(i=t,a=0;a<8;a++){if(u=_(i)-t,d(u)<n)return i;if(o=v(i),d(o)<1e-6)break;i-=u/o}if((i=t)<(e=0))return e;if(i>(r=1))return r;for(;e<r;){if(u=_(i),d(u-t)<n)return i;t>u?e=i:r=i,i=.5*(r-e)+e}return i}(o,a))}var z,U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:.25,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.25,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.75,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:.75;return function(i){return B(i,t,n,e,r,1)}};function $(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function G(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function J(t){return function(t){if(Array.isArray(t))return K(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,n){if(t){if("string"==typeof t)return K(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?K(t,n):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function K(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}function L(t,n){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),e.push.apply(e,r)}return e}function N(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{};n%2?L(Object(e),!0).forEach((function(n){V(t,n,e[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)):L(Object(e)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))}))}return t}function V(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var W,X,Y,Z="linear",tt="undefined"!=typeof window?window:e.g,nt="afterTween",et="afterTweenEnd",rt="beforeTween",it="tweenCreated",ut="function",ot="string",at=tt.requestAnimationFrame||tt.webkitRequestAnimationFrame||tt.oRequestAnimationFrame||tt.msRequestAnimationFrame||tt.mozCancelRequestAnimationFrame&&tt.mozRequestAnimationFrame||setTimeout,st=function(){},ct=null,ft=null,ht=N({},r),lt=function(t,n,e,r,i,u,o){var a,s,c,f=t<u?0:(t-u)/i,h=!1;for(var l in o&&o.call&&(h=!0,a=o(f)),n)h||(a=((s=o[l]).call?s:ht[s])(f)),c=e[l],n[l]=c+(r[l]-c)*a;return n},pt=function(t,n){var e=t._timestamp,r=t._currentState,i=t._delay;if(!(n<e+i)){var u=t._duration,o=t._targetState,a=e+i+u,s=n>a?a:n;t._hasEnded=s>=a;var c=u-(a-s),f=t._filters.length>0;if(t._hasEnded)return t._render(o,t._data,c),t.stop(!0);f&&t._applyFilter(rt),s<e+i?e=u=s=1:e+=i,lt(s,r,t._originalState,o,u,e,t._easing),f&&t._applyFilter(nt),t._render(r,t._data,c)}},_t=function(){for(var t,n=wt.now(),e=ct;e;)t=e._next,pt(e,n),e=t},vt=Date.now||function(){return+new Date},dt=!1,yt=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Z,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Array.isArray(n)){var r=U.apply(void 0,J(n));return r}var i=H(n);if(ht[n])return ht[n];if(i===ot||i===ut)for(var u in t)e[u]=n;else for(var o in t)e[o]=n[o]||Z;return e},mt=function(t){t===ct?(ct=t._next)?ct._previous=null:ft=null:t===ft?(ft=t._previous)?ft._next=null:ct=null:(X=t._previous,Y=t._next,X._next=Y,Y._previous=X),t._previous=t._next=null},gt="function"==typeof Promise?Promise:null;z=Symbol.toStringTag;var wt=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;$(this,t),V(this,z,"Promise"),this._config={},this._data={},this._delay=0,this._filters=[],this._next=null,this._previous=null,this._timestamp=null,this._hasEnded=!1,this._resolve=null,this._reject=null,this._currentState=n||{},this._originalState={},this._targetState={},this._start=st,this._render=st,this._promiseCtor=gt,e&&this.setConfig(e)}var n,e;return n=t,e=[{key:"_applyFilter",value:function(t){for(var n=this._filters.length;n>0;n--){var e=this._filters[n-n][t];e&&e(this)}}},{key:"tween",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;return this._isPlaying&&this.stop(),!n&&this._config||this.setConfig(n),this._pausedAtTime=null,this._timestamp=t.now(),this._start(this.get(),this._data),this._delay&&this._render(this._currentState,this._data,0),this._resume(this._timestamp)}},{key:"setConfig",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this._config;for(var r in n)e[r]=n[r];var i=e.promise,u=void 0===i?this._promiseCtor:i,o=e.start,a=void 0===o?st:o,s=e.finish,c=e.render,f=void 0===c?this._config.step||st:c,h=e.step,l=void 0===h?st:h;this._data=e.data||e.attachment||this._data,this._isPlaying=!1,this._pausedAtTime=null,this._scheduleId=null,this._delay=n.delay||0,this._start=a,this._render=f||l,this._duration=e.duration||500,this._promiseCtor=u,s&&(this._resolve=s);var p=n.from,_=n.to,v=void 0===_?{}:_,d=this._currentState,y=this._originalState,m=this._targetState;for(var g in p)d[g]=p[g];var w=!1;for(var b in d){var O=d[b];w||H(O)!==ot||(w=!0),y[b]=O,m[b]=v.hasOwnProperty(b)?v[b]:O}if(this._easing=yt(this._currentState,e.easing,this._easing),this._filters.length=0,w){for(var S in t.filters)t.filters[S].doesApply(this)&&this._filters.push(t.filters[S]);this._applyFilter(it)}return this}},{key:"then",value:function(t,n){var e=this;return this._promise=new this._promiseCtor((function(t,n){e._resolve=t,e._reject=n})),this._promise.then(t,n)}},{key:"catch",value:function(t){return this.then().catch(t)}},{key:"finally",value:function(t){return this.then().finally(t)}},{key:"get",value:function(){return N({},this._currentState)}},{key:"set",value:function(t){this._currentState=t}},{key:"pause",value:function(){if(this._isPlaying)return this._pausedAtTime=t.now(),this._isPlaying=!1,mt(this),this}},{key:"resume",value:function(){return this._resume()}},{key:"_resume",value:function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.now();return null===this._timestamp?this.tween():this._isPlaying?this._promise:(this._pausedAtTime&&(this._timestamp+=n-this._pausedAtTime,this._pausedAtTime=null),this._isPlaying=!0,null===ct?(ct=this,ft=this):(this._previous=ft,ft._next=this,ft=this),this)}},{key:"seek",value:function(n){n=Math.max(n,0);var e=t.now();return this._timestamp+n===0||(this._timestamp=e-n,pt(this,e)),this}},{key:"stop",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._isPlaying)return this;this._isPlaying=!1,mt(this);var n=this._filters.length>0;return t&&(n&&this._applyFilter(rt),lt(1,this._currentState,this._originalState,this._targetState,1,0,this._easing),n&&(this._applyFilter(nt),this._applyFilter(et))),this._resolve&&this._resolve({data:this._data,state:this._currentState,tweenable:this}),this._resolve=null,this._reject=null,this}},{key:"cancel",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this._currentState,e=this._data,r=this._isPlaying;return r?(this._reject&&this._reject({data:e,state:n,tweenable:this}),this._resolve=null,this._reject=null,this.stop(t)):this}},{key:"isPlaying",value:function(){return this._isPlaying}},{key:"hasEnded",value:function(){return this._hasEnded}},{key:"setScheduleFunction",value:function(n){t.setScheduleFunction(n)}},{key:"data",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t&&(this._data=N({},t)),this._data}},{key:"dispose",value:function(){for(var t in this)delete this[t]}}],e&&G(n.prototype,e),t}();function bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=new wt;return n.tween(t),n.tweenable=n,n}V(wt,"now",(function(){return W})),V(wt,"setScheduleFunction",(function(t){return at=t})),V(wt,"filters",{}),V(wt,"formulas",ht),!0&&dt||(dt=true,function t(){W=vt(),dt&&at.call(tt,t,16.666666666666668),_t()}())}},n={};function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{}};return t[r](i,i.exports,e),i.exports}return e.d=function(t,n){for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e(868)}()}));
|
|
//# sourceMappingURL=shifty.core.js.map
|