es6-tween
Advanced tools
Comparing version 1.11.2 to 1.11.3
@@ -128,2 +128,3 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
var object = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var instate = arguments[1]; | ||
@@ -153,2 +154,7 @@ _classCallCheck(this, Tween); | ||
if (instate && instate.to) { | ||
return new Tween(object).to(instate.to, instate); | ||
} | ||
return this; | ||
@@ -328,3 +334,5 @@ } | ||
for (var prop in duration) { | ||
this[prop](typeof duration[prop] === "function" ? duration[prop](this._duration) : duration); | ||
if (this[prop]) { | ||
this[prop](typeof duration[prop] === "function" ? duration[prop](this._duration) : duration); | ||
} | ||
} | ||
@@ -331,0 +339,0 @@ } |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TWEEN=e():t.TWEEN=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=15)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="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},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(4),s=n(1),f=i(s),c=n(2),l=i(c),h=n(6),d=i(h),v=n(13),p=i(v),y=n(14),m=i(y),_=/\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi,b=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=e,this._valuesStart=t.createEmptyConst(e),this._valuesEnd=t.createEmptyConst(e),this._chainedTweens=[],this._duration=1e3,this._easingFunction=f.default.Linear.None,this._interpolationFunction=l.default.None,this._startTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events={},this._pausedTime=0,this}return u(t,[{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(){var t=this._reversed;return this._reversed=!t,this}},{key:"reversed",value:function(){return this._reversed}},{key:"off",value:function(t,e){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==e)for(var n=this._events[t],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else void 0!==t&&void 0===e&&(this._events[t]=[]);return this}},{key:"on",value:function(t,e){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(e),this}},{key:"once",value:function(t,e){var n=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];e.call.apply(e,[n].concat(r)),n.off(t)})}},{key:"emit",value:function(t,e,n,i,r,o){var u=this._events,a=u[t];if(!a)return this;for(var s=a.length;s--;)a[s].call(this,e,n,i,r,o);return this}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,(0,a.remove)(this),this._pausedTime=(0,a.now)(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=(0,a.now)()-this._pausedTime,(0,a.add)(this),this._pausedTime=(0,a.now)(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this._startTime=(0,a.now)()+(t?0:this._delayTime),this._isPlaying||(0,a.add)(this),this.emit("restart",this._object)}},{key:"seek",value:function(t,e){return this._startTime=(0,a.now)()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if("number"==typeof t){var n={Number:t};this._valuesEnd=n}else this._valuesEnd=t;if("number"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"===("undefined"==typeof e?"undefined":o(e)))for(var i in e)this[i]("function"==typeof e[i]?e[i](this._duration):e);return this}},{key:"start",value:function(e){var n=this._startTime,i=this._delayTime,r=this._valuesEnd,u=(this._valuesStart,this.object);n=void 0!==e?e:(0,a.now)(),n+=i,this._startTime=n;for(var s in r){if("object"===o(r[s]))if(Array.isArray(r[s]))if("number"==typeof u[s])this._valuesEnd[s]=[u[s]].concat(r[s]);else{var f=(0,d.default)(this,{object:u[s],_valuesEnd:r[s],_events:{}}).start().stop();this._valuesEnd[s]=f}else{var c=(0,d.default)(this,{object:u[s],_valuesEnd:r[s],_events:{}}).start().stop();this._valuesStart[s]=1,this._valuesEnd[s]=c}else if("string"==typeof r[s]&&"string"==typeof u[s]&&_.test(u[s])&&_.test(r[s])){var l=u[s].match(_);l=l.map(m.default);var h=r[s].match(_);h=h.map(m.default);var v=(0,d.default)(this,{object:l,_valuesEnd:h,_events:{}}).start().stop();v.join=!0,this._valuesStart[s]=1,this._valuesEnd[s]=v}"function"==typeof u[s]&&(u[s]=this.object[s]=u[s](this)),"function"==typeof r[s]&&(this._valuesEnd[s]=r[s](this)),t.checkValidness(u[s])!==!1&&u[s]!==r[s]&&(this._valuesStart[s]=u[s])}return(0,a.add)(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,e=this.object;return t?((0,a.remove)(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this}},{key:"end",value:function(){var t=this._startTime,e=this._duration;return this.update(t+e)}},{key:"stopChainedTweens",value:function(){var t=this._chainedTweens;return t.map(function(t){return t.stop()}),this}},{key:"delay",value:function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this}},{key:"repeat",value:function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this}},{key:"yoyo",value:function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return this._interpolationFunction=t,this}},{key:"chain",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._chainedTweens=e,this}},{key:"get",value:function(t){return this.update(t),this.object}},{key:"update",value:function(e){var n=this._onStartCallbackFired,i=this._chainedTweens,r=this._easingFunction,o=this._interpolationFunction,u=this._repeat,s=this._repeatDelayTime,f=this._reverseDelayTime,c=(this._delayTime,this._yoyo),l=this._reversed,h=this._startTime,d=this._duration,v=this._valuesStart,y=this._valuesEnd,m=this.object,_=void 0,b=void 0,g=void 0;if(e=void 0!==e?e:(0,a.now)(),e<h)return!0;n||(this.emit("start",m),this._onStartCallbackFired=!0),b=(e-h)/d,b=b>1?1:b,b=l?1-b:b,g=r(b);for(_ in y)if(void 0!==v[_]){var w=v[_],T=y[_];if(T instanceof t){var M=T.get(e);T.join?m[_]=(0,p.default)(M):m[_]=M}else Array.isArray(T)?m[_]=o(T,g):"string"==typeof T?(T="+"===T.charAt(0)||"-"===T.charAt(0)?w+parseFloat(T):parseFloat(T),"number"==typeof T&&(m[_]=w+(T-w)*g)):"number"==typeof T&&(m[_]=w+(T-w)*g)}if(this.emit("update",m,g,b),1===b||l&&0===b){if(u){isFinite(u)&&this._repeat--;for(_ in y)"string"==typeof y[_]&&"number"==typeof v[_]&&(this._valuesStart[_]=v[_]+parseFloat(y[_]));return this.emit(l?"reverse":"repeat",m),c&&(this._reversed=!l),!l&&s?this._startTime+=d+s:l&&f?this._startTime+=d+f:this._startTime+=d,!0}return this.emit("complete",m),i.map(function(t){return t.start(h+d)}),!1}return!0}}],[{key:"createEmptyConst",value:function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"===("undefined"==typeof t?"undefined":o(t))?{}:""}},{key:"checkValidness",value:function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0}}]),t}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(-10*t,2)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(-10*(t-1),2)+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(-10*t,2)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(-10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Bounce.Out(1-t)},Out: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},InOut:function(t){return t<.5?.5*i.Bounce.In(2*t):.5*i.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(e){return Math.floor(e*t)/t}},Noisy:function(t,e){var n=1-t;return function(i){return t*Math.random()+n*e(i)}},get bezier(){var t,e;return t=function(t,e,n,i,r){var o=Math.pow(1-t,3),u=3*Math.pow(1-t,2)*t,a=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*e.x+u*n.x+a*i.x+t*r.x,y:o*e.y+u*n.y+a*i.y+t*r.y}},e=function(t,e){var n,i,r=0,o=0,u=e.length,a=0,s=1,f=(s+a)/2;for(n=null;o<u&&(i=e[o],t>=i(0).x&&t<=i(1).x&&(n=i),null===n);)o++;if(!n)return 1;for(i=n(f).x;1e-4<Math.abs(t-i)&&100>r;)t>i?a=f:s=f,f=(s+a)/2,i=n(f).x,r++;return n(f).y},function(n){null==n&&(n={});var i=n.points,r=function(){var e,n=0,o=i.length;for(r=[],e=function(e,n){return r.push(function(i){return t(i,e,e.cp[e.cp.length-1],n.cp[0],n)})};n<o&&!(n>=i.length-1);)e(i[n],i[n+1]),n++;return r}();return function(t){return e(t,r)}}},easeInOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeInOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},easeIn:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeIn.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},spring:function(t){var e,n,r,o,u;return null==t&&(t={}),Tools.extend(t,i.spring.defaults,!0),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),u=t.anticipationSize/1e3,e=function(e){var n,i;return i=u/(1-u),n=(i-0)/(i-0),(.8-n)/i*e*t.anticipationStrength/100+n},n=function(t){return Math.pow(o/10,-t)*(1-t)},function(t){var i,o,a,s;return s=t/(1-u)-u/(1-u),t<u?(a=u/(1-u)-u/(1-u),i=0/(1-u)-u/(1-u),a=Math.acos(1/e(a)),o=(Math.acos(1/e(i))-a)/(r*-u),i=e):(i=n,a=0,o=1),1-i(s)*Math.cos(r*(t-u)*o+a)}},bounce:function(t){var e,n,r,o;return null==t&&(t={}),Tools.extend(t,i.bounce.defaults),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),e=function(t){return Math.pow(o/10,-t)*(1-t)},n=function(t){return e(t)*Math.cos(r*t*1+-1.57)},n.initialForce=!0,n},gravity:function(t){var e,n,r,o,u,a;return null==t&&(t={}),Tools.extend(t,i.gravity.defaults),n=Math.min(t.bounciness/1250,.8),o=t.elasticity/1e3,r=[],e=function(){var i;for(i=Math.sqrt(.02),i={a:-i,b:i,H:1},t.initialForce&&(i.a=0,i.b*=2);.001<i.H;)e=i.b-i.a,i={a:i.b,b:i.b+e*n,H:i.H*n*n};return i.b}(),a=function(n,i,r,o){return e=i-n,n=2/e*o-1-2*n/e,r=n*n*r-r+1,t.initialForce&&(r=1-r),r},function(){var i,u,a;for(i=Math.sqrt(2/(100*e*e)),u={a:-i,b:i,H:1},t.initialForce&&(u.a=0,u.b*=2),r.push(u),a=[];1>u.b&&.001<u.H;)i=u.b-u.a,u={a:u.b,b:u.b+i*n,H:u.H*o},a.push(r.push(u));return a}(),u=function e(n){var i,e;for(e=0,i=r[e];!(n>=i.a&&n<=i.b)&&(e+=1,i=r[e]););return i?a(i.a,i.b,i.H,n):t.initialForce?0:1},u.initialForce=t.initialForce,u},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,i.forceWithGravity.defaults),t.initialForce=!0,i.gravity(t)}};i.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},i.bounce.defaults={frequency:300,friction:200},i.forceWithGravity.defaults=i.gravity.defaults={bounciness:400,elasticity:200},i.easeInOut.defaults=i.easeIn.defaults=i.easeOut.defaults={friction:500},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[n],t[n-1],n-r):u(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*u(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),u(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(u(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):u(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),u=.5*(i-e),a=r*r,s=r*a;return(2*e-2*n+o+u)*s+(-3*e+3*n-2*o-u)*a+o*r+e}}};e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o={filter:{grayscale:1,brightness:1,sepia:1,invert:1,saturate:1,contrast:1,blur:1,hueRotate:1,dropShadow:1},transform:{translate:1,translateX:1,translateY:1,translateZ:1,rotate:1,rotateX:1,rotateY:1,rotateZ:1,scale:1,scaleX:1,scaleY:1,scaleZ:1,skew:1,skewX:1,skewY:1}},u=function(){function t(){i(this,t)}return r(t,null,[{key:"DOM",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){for(var i in e)n[i]=e[i]}}}},{key:"Transform",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){var i="";for(var r in e)"x"===r||"y"===r||"z"===r?i+=" translate3d( "+(e.x||"0px")+", "+(e.y||"0px")+", "+(e.z||"0px")+")":o.transform[r]&&(i+=" "+r+"( "+e[r]+")");i&&(n.transform=i)}}}},{key:"Filter",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){var i="";for(var r in e)o.filter[r]&&(i+=" "+r+"( "+e[r]+")");i&&(n.webkitFilter=n.filter=i)}}}},{key:"Scroll",value:function(t){var e=t.domNode;return{update:function(t,n){for(var i in n)e[i]=n[i]}}}}]),t}();e.default=u},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0});var i=[],r=!1,o=!1,u=void 0,a={},s="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,f=function(){return i},c=function(t){o=t},l=function(){i=[]},h=function(t,e,n,i,r,o){var u=a[t];if(u)for(var s=u.length;s--;)u[s].call(void 0,e,n,i,r,o)},d=function(t,e){if(void 0!==t&&void 0!==a[t])if(void 0!==e)for(var n=a[name],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else a[name]=[]},v=function(t){i.push(t),o&&!r&&(b(),r=!0,h("start")),h("add",t,i)},p=function(t,e){void 0===a[t]&&(a[t]=[]),a[t].push(e)},y=function(t,e){void 0===a[t]&&(a[t]=[]),p(t,function(){e.apply(void 0,arguments),d(t)})},m=function(t){i.filter(function(e){return e!==t});for(var e=0,n=void 0;e<i.length;)n=i[e],n===t&&(h("remove",t,i),i.splice(e,1)),e++},_=function(){if("undefined"!=typeof n&&void 0!==n.hrtime)return function(){var t=n.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==s.performance&&void 0!==s.performance.now)return s.performance.now.bind(s.performance);var t=s.performance&&s.performance.timing&&s.performance.timing.navigationStart?s.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),b=function t(e,n){if(e=void 0!==e?e:_(),o&&(u=requestAnimationFrame(t)),h("update",e,i),0===i.length)return r=!1,cancelAnimationFrame(u),h("stop",e),!1;for(var a=0;a<i.length;)i[a].update(e)||n?a++:i.splice(a,1);return!0};if(s.document){var g=s.document,w=0,T=0;g.addEventListener("visibilitychange",function(t){return 0!==i.length&&(document.hidden?T=_():(w=_()-T,i.map(function(t){return t._startTime+=w})),!0)})}e.getAll=f,e.removeAll=l,e.remove=m,e.add=v,e.now=_,e.update=b,e.autoPlay=c,e.on=p,e.once=y,e.off=d,e.emit=h}).call(e,n(5),n(12))},function(t,e,n){"use strict";var i,r="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};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default,i=new n;for(var r in t)void 0!==e[r]?i[r]=e[r]:i[r]=t[r];return i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var o=n(0),u=i(o)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=n(6),a=i(u),s=n(3),f=i(s),c=function(){function t(e){r(this,t);this.domNode=e,this.plugins={};var n=this.plugins;return this.render=function(t){for(var e in n)n[e]&&n[e].update&&n[e].update(this,t);return this},this.fetch=function(){if(Object.keys(this.object).length)return this;for(var t in n)n[t]&&n[t].fetch&&n[t].fetch(this);return this},this.init=function(t){for(var e in n)n[e]&&n[e].init&&n[e].init(this,t);return this},this}return o(t,[{key:"applyPlugin",value:function(t){return void 0!==f.default[t]&&(this.plugins[t]=f.default[t](this)),this}},{key:"cloneLayer",value:function(){return(0,a.default)(this,{},t)}},{key:"appendTo",value:function(t){return t.appendChild(this.domNode),this}},{key:"object",set:function(t){return this.render(t)}}]),t}();e.default=c},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="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},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(0),s=i(a),f=function(){function t(){return r(this,t),this._private={tweens:[],fullTime:0},this}return u(t,[{key:"add",value:function(t){var e=this;if(t instanceof s.default)this._private.tweens.push(t);else if(Array.isArray(t)||"object"!==("undefined"==typeof t?"undefined":o(t)))"object"===("undefined"==typeof t?"undefined":o(t))&&t.map(function(t){e.add(t)});else{var n=new s.default({x:0});for(var i in t)n[i](t[i]);this.add(n)}return this}},{key:"start",value:function(){var t=this;return this._private.tweens.map(function(e){e.start(t._private.fullTime)}),this._private.fullTime=Math.max.apply(0,this._private.tweens.reduce(function(t,e){return e._duration>t?e._duration:t},0)),this}}]),t}();e.default=f},function(t,e,n){"use strict";var i="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};void 0===Array.isArray&&(Array.isArray=function(t){return void 0!==t&&"object"===("undefined"==typeof t?"undefined":i(t))&&t.length&&void 0!==t.push&&void 0!==t.splice})},function(t,e,n){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e.shift();return e.map(function(t){for(var e in t)i[e]=t[e]}),i})},function(t,e,n){"use strict";(function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,n=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===e.requestAnimationFrame){var f=void 0,c=void 0,l=Date.now(),h=50/3,d=h;n.map(function(t){void 0===(f=e[t+r])&&(f=function(t){return a(function(){c=Date.now(),t(c-l),d=h+(Date.now()-c)},d)})}),void 0!==f&&(e.requestAnimationFrame=f)}if(void 0===e.cancelAnimationFrame&&void 0===(e.cancelAnimationFrame=e.cancelRequestAnimationFrame)){var v=void 0;n.map(function(t){void 0===(v=e[t+o])&&void 0===(v=e[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(e.cancelAnimationFrame=v)}}).call(e,n(5))},function(t,e,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===i||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function u(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function a(){y&&v&&(y=!1,v.length?p=v.concat(p):m=-1,p.length&&s())}function s(){if(!y){var t=o(a);y=!0;for(var e=p.length;e;){for(v=p,p=[];++m<e;)v&&v[m].run();m=-1,e=p.length}v=null,y=!1,u(t)}}function f(t,e){this.fun=t,this.array=e}function c(){}var l,h,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:i}catch(t){l=i}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var v,p=[],y=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new f(t,e)),1!==p.length||y||o(s)},f.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){"use strict";function i(t){for(var e="",n=0,i=t.length;n<i;n++)e+=t[n];return e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Plugins=e.Timeline=e.Composite=e.Interpolation=e.Easing=e.Tween=e.emit=e.off=e.once=e.on=e.autoPlay=e.update=e.now=e.add=e.remove=e.removeAll=e.getAll=void 0,n(10),n(11),n(9);var r=n(4),o=n(1),u=i(o),a=n(0),s=i(a),f=n(2),c=i(f),l=n(7),h=i(l),d=n(8),v=i(d),p=n(3),y=i(p);e.getAll=r.getAll,e.removeAll=r.removeAll,e.remove=r.remove,e.add=r.add,e.now=r.now,e.update=r.update,e.autoPlay=r.autoPlay,e.on=r.on,e.once=r.once,e.off=r.off,e.emit=r.emit,e.Tween=s.default,e.Easing=u.default,e.Interpolation=c.default,e.Composite=h.default,e.Timeline=v.default,e.Plugins=y.default}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TWEEN=e():t.TWEEN=e()}(this,function(){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=15)}([function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="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},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(4),s=n(1),f=i(s),c=n(2),l=i(c),h=n(6),d=i(h),v=n(13),p=i(v),y=n(14),m=i(y),_=/\s+|([A-Za-z?().,{}:""\[\]#]+)|([-+\/*%]+=)?([-+*\/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/gi,b=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments[1];return r(this,t),this.object=e,this._valuesStart=t.createEmptyConst(e),this._valuesEnd=t.createEmptyConst(e),this._chainedTweens=[],this._duration=1e3,this._easingFunction=f.default.Linear.None,this._interpolationFunction=l.default.None,this._startTime=0,this._delayTime=0,this._repeat=0,this._r=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events={},this._pausedTime=0,n&&n.to?new t(e).to(n.to,n):this}return u(t,[{key:"isPlaying",value:function(){return this._isPlaying}},{key:"isStarted",value:function(){return this._onStartCallbackFired}},{key:"reverse",value:function(){var t=this._reversed;return this._reversed=!t,this}},{key:"reversed",value:function(){return this._reversed}},{key:"off",value:function(t,e){if(void 0===this._events[t])return this;if(void 0!==t&&void 0!==e)for(var n=this._events[t],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else void 0!==t&&void 0===e&&(this._events[t]=[]);return this}},{key:"on",value:function(t,e){return void 0===this._events[t]&&(this._events[t]=[]),this._events[t].push(e),this}},{key:"once",value:function(t,e){var n=this;return void 0===this._events[t]&&(this._events[t]=[]),this.on(t,function(){for(var i=arguments.length,r=Array(i),o=0;o<i;o++)r[o]=arguments[o];e.call.apply(e,[n].concat(r)),n.off(t)})}},{key:"emit",value:function(t,e,n,i,r,o){var u=this._events,a=u[t];if(!a)return this;for(var s=a.length;s--;)a[s].call(this,e,n,i,r,o);return this}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,(0,a.remove)(this),this._pausedTime=(0,a.now)(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=(0,a.now)()-this._pausedTime,(0,a.add)(this),this._pausedTime=(0,a.now)(),this.emit("play",this.object))}},{key:"restart",value:function(t){return this._repeat=this._r,this._startTime=(0,a.now)()+(t?0:this._delayTime),this._isPlaying||(0,a.add)(this),this.emit("restart",this._object)}},{key:"seek",value:function(t,e){return this._startTime=(0,a.now)()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()}},{key:"duration",value:function(t){return this._duration="function"==typeof t?t(this._duration):t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;if("number"==typeof t){var n={Number:t};this._valuesEnd=n}else this._valuesEnd=t;if("number"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"===("undefined"==typeof e?"undefined":o(e)))for(var i in e)this[i]&&this[i]("function"==typeof e[i]?e[i](this._duration):e);return this}},{key:"start",value:function(e){var n=this._startTime,i=this._delayTime,r=this._valuesEnd,u=(this._valuesStart,this.object);n=void 0!==e?e:(0,a.now)(),n+=i,this._startTime=n;for(var s in r){if("object"===o(r[s]))if(Array.isArray(r[s]))if("number"==typeof u[s])this._valuesEnd[s]=[u[s]].concat(r[s]);else{var f=(0,d.default)(this,{object:u[s],_valuesEnd:r[s],_events:{}}).start().stop();this._valuesEnd[s]=f}else{var c=(0,d.default)(this,{object:u[s],_valuesEnd:r[s],_events:{}}).start().stop();this._valuesStart[s]=1,this._valuesEnd[s]=c}else if("string"==typeof r[s]&&"string"==typeof u[s]&&_.test(u[s])&&_.test(r[s])){var l=u[s].match(_);l=l.map(m.default);var h=r[s].match(_);h=h.map(m.default);var v=(0,d.default)(this,{object:l,_valuesEnd:h,_events:{}}).start().stop();v.join=!0,this._valuesStart[s]=1,this._valuesEnd[s]=v}"function"==typeof u[s]&&(u[s]=this.object[s]=u[s](this)),"function"==typeof r[s]&&(this._valuesEnd[s]=r[s](this)),t.checkValidness(u[s])!==!1&&u[s]!==r[s]&&(this._valuesStart[s]=u[s])}return(0,a.add)(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,e=this.object;return t?((0,a.remove)(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",e)):this}},{key:"end",value:function(){var t=this._startTime,e=this._duration;return this.update(t+e)}},{key:"stopChainedTweens",value:function(){var t=this._chainedTweens;return t.map(function(t){return t.stop()}),this}},{key:"delay",value:function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this}},{key:"repeat",value:function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this}},{key:"reverseDelay",value:function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this}},{key:"yoyo",value:function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this}},{key:"easing",value:function(t){return this._easingFunction=t,this}},{key:"interpolation",value:function(t){return this._interpolationFunction=t,this}},{key:"chain",value:function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];return this._chainedTweens=e,this}},{key:"get",value:function(t){return this.update(t),this.object}},{key:"update",value:function(e){var n=this._onStartCallbackFired,i=this._chainedTweens,r=this._easingFunction,o=this._interpolationFunction,u=this._repeat,s=this._repeatDelayTime,f=this._reverseDelayTime,c=(this._delayTime,this._yoyo),l=this._reversed,h=this._startTime,d=this._duration,v=this._valuesStart,y=this._valuesEnd,m=this.object,_=void 0,b=void 0,g=void 0;if(e=void 0!==e?e:(0,a.now)(),e<h)return!0;n||(this.emit("start",m),this._onStartCallbackFired=!0),b=(e-h)/d,b=b>1?1:b,b=l?1-b:b,g=r(b);for(_ in y)if(void 0!==v[_]){var w=v[_],T=y[_];if(T instanceof t){var M=T.get(e);T.join?m[_]=(0,p.default)(M):m[_]=M}else Array.isArray(T)?m[_]=o(T,g):"string"==typeof T?(T="+"===T.charAt(0)||"-"===T.charAt(0)?w+parseFloat(T):parseFloat(T),"number"==typeof T&&(m[_]=w+(T-w)*g)):"number"==typeof T&&(m[_]=w+(T-w)*g)}if(this.emit("update",m,g,b),1===b||l&&0===b){if(u){isFinite(u)&&this._repeat--;for(_ in y)"string"==typeof y[_]&&"number"==typeof v[_]&&(this._valuesStart[_]=v[_]+parseFloat(y[_]));return this.emit(l?"reverse":"repeat",m),c&&(this._reversed=!l),!l&&s?this._startTime+=d+s:l&&f?this._startTime+=d+f:this._startTime+=d,!0}return this.emit("complete",m),i.map(function(t){return t.start(h+d)}),!1}return!0}}],[{key:"createEmptyConst",value:function(t){return"number"==typeof t?0:Array.isArray(t)?[]:"object"===("undefined"==typeof t?"undefined":o(t))?{}:""}},{key:"checkValidness",value:function(t){return void 0!==t&&null!==t&&""!==t&&NaN!==t&&t!==1/0}}]),t}();e.default=b},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:{None:function(t){return t}},Quadratic:{In:function(t){return t*t},Out:function(t){return t*(2-t)},InOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)}},Cubic:{In:function(t){return t*t*t},Out:function(t){return--t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)}},Quartic:{In:function(t){return t*t*t*t},Out:function(t){return 1- --t*t*t*t},InOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)}},Quintic:{In:function(t){return t*t*t*t*t},Out:function(t){return--t*t*t*t*t+1},InOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},Sinusoidal:{In:function(t){return 1-Math.cos(t*Math.PI/2)},Out:function(t){return Math.sin(t*Math.PI/2)},InOut:function(t){return.5*(1-Math.cos(Math.PI*t))}},Exponential:{In:function(t){return 0===t?0:Math.pow(1024,t-1)},Out:function(t){return 1===t?1:1-Math.pow(-10*t,2)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(-10*(t-1),2)+2)}},Circular:{In:function(t){return 1-Math.sqrt(1-t*t)},Out:function(t){return Math.sqrt(1- --t*t)},InOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},Elastic:{In:function(t){return 0===t?0:1===t?1:-Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(-10*t,2)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2,t<1?-.5*Math.pow(10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(-10*(t-1),2)*Math.sin(5*(t-1.1)*Math.PI)+1)}},Back:{In:function(t){var e=1.70158;return t*t*((e+1)*t-e)},Out:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},InOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-i.Bounce.Out(1-t)},Out: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},InOut:function(t){return t<.5?.5*i.Bounce.In(2*t):.5*i.Bounce.Out(2*t-1)+.5}},Stepped:function(t){return function(e){return Math.floor(e*t)/t}},Noisy:function(t,e){var n=1-t;return function(i){return t*Math.random()+n*e(i)}},get bezier(){var t,e;return t=function(t,e,n,i,r){var o=Math.pow(1-t,3),u=3*Math.pow(1-t,2)*t,a=3*(1-t)*Math.pow(t,2);return t=Math.pow(t,3),{x:o*e.x+u*n.x+a*i.x+t*r.x,y:o*e.y+u*n.y+a*i.y+t*r.y}},e=function(t,e){var n,i,r=0,o=0,u=e.length,a=0,s=1,f=(s+a)/2;for(n=null;o<u&&(i=e[o],t>=i(0).x&&t<=i(1).x&&(n=i),null===n);)o++;if(!n)return 1;for(i=n(f).x;1e-4<Math.abs(t-i)&&100>r;)t>i?a=f:s=f,f=(s+a)/2,i=n(f).x,r++;return n(f).y},function(n){null==n&&(n={});var i=n.points,r=function(){var e,n=0,o=i.length;for(r=[],e=function(e,n){return r.push(function(i){return t(i,e,e.cp[e.cp.length-1],n.cp[0],n)})};n<o&&!(n>=i.length-1);)e(i[n],i[n+1]),n++;return r}();return function(t){return e(t,r)}}},easeInOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeInOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},easeIn:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeIn.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:.92-e/1e3,y:0}]},{x:1,y:1,cp:[{x:1,y:1}]}]})},easeOut:function(t){var e,n;return null==t&&(t={}),e=null!=(n=t.friction)?n:i.easeOut.defaults.friction,i.bezier({points:[{x:0,y:0,cp:[{x:0,y:0}]},{x:1,y:1,cp:[{x:.08+e/1e3,y:1}]}]})},spring:function(t){var e,n,r,o,u;return null==t&&(t={}),Tools.extend(t,i.spring.defaults,!0),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),u=t.anticipationSize/1e3,e=function(e){var n,i;return i=u/(1-u),n=(i-0)/(i-0),(.8-n)/i*e*t.anticipationStrength/100+n},n=function(t){return Math.pow(o/10,-t)*(1-t)},function(t){var i,o,a,s;return s=t/(1-u)-u/(1-u),t<u?(a=u/(1-u)-u/(1-u),i=0/(1-u)-u/(1-u),a=Math.acos(1/e(a)),o=(Math.acos(1/e(i))-a)/(r*-u),i=e):(i=n,a=0,o=1),1-i(s)*Math.cos(r*(t-u)*o+a)}},bounce:function(t){var e,n,r,o;return null==t&&(t={}),Tools.extend(t,i.bounce.defaults),r=Math.max(1,t.frequency/20),o=Math.pow(20,t.friction/100),e=function(t){return Math.pow(o/10,-t)*(1-t)},n=function(t){return e(t)*Math.cos(r*t*1+-1.57)},n.initialForce=!0,n},gravity:function(t){var e,n,r,o,u,a;return null==t&&(t={}),Tools.extend(t,i.gravity.defaults),n=Math.min(t.bounciness/1250,.8),o=t.elasticity/1e3,r=[],e=function(){var i;for(i=Math.sqrt(.02),i={a:-i,b:i,H:1},t.initialForce&&(i.a=0,i.b*=2);.001<i.H;)e=i.b-i.a,i={a:i.b,b:i.b+e*n,H:i.H*n*n};return i.b}(),a=function(n,i,r,o){return e=i-n,n=2/e*o-1-2*n/e,r=n*n*r-r+1,t.initialForce&&(r=1-r),r},function(){var i,u,a;for(i=Math.sqrt(2/(100*e*e)),u={a:-i,b:i,H:1},t.initialForce&&(u.a=0,u.b*=2),r.push(u),a=[];1>u.b&&.001<u.H;)i=u.b-u.a,u={a:u.b,b:u.b+i*n,H:u.H*o},a.push(r.push(u));return a}(),u=function e(n){var i,e;for(e=0,i=r[e];!(n>=i.a&&n<=i.b)&&(e+=1,i=r[e]););return i?a(i.a,i.b,i.H,n):t.initialForce?0:1},u.initialForce=t.initialForce,u},forceWithGravity:function(t){return null==t&&(t={}),Tools.extend(t,i.forceWithGravity.defaults),t.initialForce=!0,i.gravity(t)}};i.spring.defaults={frequency:300,friction:200,anticipationSize:0,anticipationStrength:0},i.bounce.defaults={frequency:300,friction:200},i.forceWithGravity.defaults=i.gravity.defaults={bounciness:400,elasticity:200},i.easeInOut.defaults=i.easeIn.defaults=i.easeOut.defaults={friction:500},e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i={Linear:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.Linear;return e<0?u(t[0],t[1],r):e>1?u(t[n],t[n-1],n-r):u(t[o],t[o+1>n?n:o+1],r-o)},Bezier:function(t,e){for(var n=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)n+=o(1-e,r-a)*o(e,a)*t[a]*u(r,a);return n},CatmullRom:function(t,e){var n=t.length-1,r=n*e,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[n]?(e<0&&(o=Math.floor(r=n*(1+e))),u(t[(o-1+n)%n],t[o],t[(o+1)%n],t[(o+2)%n],r-o)):e<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):e>1?t[n]-(u(t[n],t[n],t[n-1],t[n-1],r-n)-t[n]):u(t[o?o-1:0],t[o],t[n<o+1?n:o+1],t[n<o+2?n:o+2],r-o)},Utils:{Linear:function(t,e,n){return(e-t)*n+t},Bernstein:function(t,e){var n=i.Utils.Factorial;return n(t)/n(e)/n(t-e)},Factorial:function(){var t=[1];return function(e){var n=1;if(t[e])return t[e];for(var i=e;i>1;i--)n*=i;return t[e]=n,n}}(),CatmullRom:function(t,e,n,i,r){var o=.5*(n-t),u=.5*(i-e),a=r*r,s=r*a;return(2*e-2*n+o+u)*s+(-3*e+3*n-2*o-u)*a+o*r+e}}};e.default=i},function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o={filter:{grayscale:1,brightness:1,sepia:1,invert:1,saturate:1,contrast:1,blur:1,hueRotate:1,dropShadow:1},transform:{translate:1,translateX:1,translateY:1,translateZ:1,rotate:1,rotateX:1,rotateY:1,rotateZ:1,scale:1,scaleX:1,scaleY:1,scaleZ:1,skew:1,skewX:1,skewY:1}},u=function(){function t(){i(this,t)}return r(t,null,[{key:"DOM",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){for(var i in e)n[i]=e[i]}}}},{key:"Transform",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){var i="";for(var r in e)"x"===r||"y"===r||"z"===r?i+=" translate3d( "+(e.x||"0px")+", "+(e.y||"0px")+", "+(e.z||"0px")+")":o.transform[r]&&(i+=" "+r+"( "+e[r]+")");i&&(n.transform=i)}}}},{key:"Filter",value:function(t){var e=t.domNode,n=e.style;return{update:function(t,e){var i="";for(var r in e)o.filter[r]&&(i+=" "+r+"( "+e[r]+")");i&&(n.webkitFilter=n.filter=i)}}}},{key:"Scroll",value:function(t){var e=t.domNode;return{update:function(t,n){for(var i in n)e[i]=n[i]}}}}]),t}();e.default=u},function(t,e,n){"use strict";(function(t,n){Object.defineProperty(e,"__esModule",{value:!0});var i=[],r=!1,o=!1,u=void 0,a={},s="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,f=function(){return i},c=function(t){o=t},l=function(){i=[]},h=function(t,e,n,i,r,o){var u=a[t];if(u)for(var s=u.length;s--;)u[s].call(void 0,e,n,i,r,o)},d=function(t,e){if(void 0!==t&&void 0!==a[t])if(void 0!==e)for(var n=a[name],i=0;i<n.length;)n[i]===e&&n.splice(i,1),i++;else a[name]=[]},v=function(t){i.push(t),o&&!r&&(b(),r=!0,h("start")),h("add",t,i)},p=function(t,e){void 0===a[t]&&(a[t]=[]),a[t].push(e)},y=function(t,e){void 0===a[t]&&(a[t]=[]),p(t,function(){e.apply(void 0,arguments),d(t)})},m=function(t){i.filter(function(e){return e!==t});for(var e=0,n=void 0;e<i.length;)n=i[e],n===t&&(h("remove",t,i),i.splice(e,1)),e++},_=function(){if("undefined"!=typeof n&&void 0!==n.hrtime)return function(){var t=n.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==s.performance&&void 0!==s.performance.now)return s.performance.now.bind(s.performance);var t=s.performance&&s.performance.timing&&s.performance.timing.navigationStart?s.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),b=function t(e,n){if(e=void 0!==e?e:_(),o&&(u=requestAnimationFrame(t)),h("update",e,i),0===i.length)return r=!1,cancelAnimationFrame(u),h("stop",e),!1;for(var a=0;a<i.length;)i[a].update(e)||n?a++:i.splice(a,1);return!0};if(s.document){var g=s.document,w=0,T=0;g.addEventListener("visibilitychange",function(t){return 0!==i.length&&(document.hidden?T=_():(w=_()-T,i.map(function(t){return t._startTime+=w})),!0)})}e.getAll=f,e.removeAll=l,e.remove=m,e.add=v,e.now=_,e.update=b,e.autoPlay=c,e.on=p,e.once=y,e.off=d,e.emit=h}).call(e,n(5),n(12))},function(t,e,n){"use strict";var i,r="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};i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"===("undefined"==typeof window?"undefined":r(window))&&(i=window)}t.exports=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u.default,i=new n;for(var r in t)void 0!==e[r]?i[r]=e[r]:i[r]=t[r];return i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var o=n(0),u=i(o)},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),u=n(6),a=i(u),s=n(3),f=i(s),c=function(){function t(e){r(this,t);this.domNode=e,this.plugins={};var n=this.plugins;return this.render=function(t){for(var e in n)n[e]&&n[e].update&&n[e].update(this,t);return this},this.fetch=function(){if(Object.keys(this.object).length)return this;for(var t in n)n[t]&&n[t].fetch&&n[t].fetch(this);return this},this.init=function(t){for(var e in n)n[e]&&n[e].init&&n[e].init(this,t);return this},this}return o(t,[{key:"applyPlugin",value:function(t){return void 0!==f.default[t]&&(this.plugins[t]=f.default[t](this)),this}},{key:"cloneLayer",value:function(){return(0,a.default)(this,{},t)}},{key:"appendTo",value:function(t){return t.appendChild(this.domNode),this}},{key:"object",set:function(t){return this.render(t)}}]),t}();e.default=c},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var o="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},u=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),a=n(0),s=i(a),f=function(){function t(){return r(this,t),this._private={tweens:[],fullTime:0},this}return u(t,[{key:"add",value:function(t){var e=this;if(t instanceof s.default)this._private.tweens.push(t);else if(Array.isArray(t)||"object"!==("undefined"==typeof t?"undefined":o(t)))"object"===("undefined"==typeof t?"undefined":o(t))&&t.map(function(t){e.add(t)});else{var n=new s.default({x:0});for(var i in t)n[i](t[i]);this.add(n)}return this}},{key:"start",value:function(){var t=this;return this._private.tweens.map(function(e){e.start(t._private.fullTime)}),this._private.fullTime=Math.max.apply(0,this._private.tweens.reduce(function(t,e){return e._duration>t?e._duration:t},0)),this}}]),t}();e.default=f},function(t,e,n){"use strict";var i="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};void 0===Array.isArray&&(Array.isArray=function(t){return void 0!==t&&"object"===("undefined"==typeof t?"undefined":i(t))&&t.length&&void 0!==t.push&&void 0!==t.splice})},function(t,e,n){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,e=Array(t),n=0;n<t;n++)e[n]=arguments[n];var i=e.shift();return e.map(function(t){for(var e in t)i[e]=t[e]}),i})},function(t,e,n){"use strict";(function(t){var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,n=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===e.requestAnimationFrame){var f=void 0,c=void 0,l=Date.now(),h=50/3,d=h;n.map(function(t){void 0===(f=e[t+r])&&(f=function(t){return a(function(){c=Date.now(),t(c-l),d=h+(Date.now()-c)},d)})}),void 0!==f&&(e.requestAnimationFrame=f)}if(void 0===e.cancelAnimationFrame&&void 0===(e.cancelAnimationFrame=e.cancelRequestAnimationFrame)){var v=void 0;n.map(function(t){void 0===(v=e[t+o])&&void 0===(v=e[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(e.cancelAnimationFrame=v)}}).call(e,n(5))},function(t,e,n){"use strict";function i(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function o(t){if(l===setTimeout)return setTimeout(t,0);if((l===i||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function u(t){if(h===clearTimeout)return clearTimeout(t);if((h===r||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(t);try{return h(t)}catch(e){try{return h.call(null,t)}catch(e){return h.call(this,t)}}}function a(){y&&v&&(y=!1,v.length?p=v.concat(p):m=-1,p.length&&s())}function s(){if(!y){var t=o(a);y=!0;for(var e=p.length;e;){for(v=p,p=[];++m<e;)v&&v[m].run();m=-1,e=p.length}v=null,y=!1,u(t)}}function f(t,e){this.fun=t,this.array=e}function c(){}var l,h,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:i}catch(t){l=i}try{h="function"==typeof clearTimeout?clearTimeout:r}catch(t){h=r}}();var v,p=[],y=!1,m=-1;d.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];p.push(new f(t,e)),1!==p.length||y||o(s)},f.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(t){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(t){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},function(t,e,n){"use strict";function i(t){for(var e="",n=0,i=t.length;n<i;n++)e+=t[n];return e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.Plugins=e.Timeline=e.Composite=e.Interpolation=e.Easing=e.Tween=e.emit=e.off=e.once=e.on=e.autoPlay=e.update=e.now=e.add=e.remove=e.removeAll=e.getAll=void 0,n(10),n(11),n(9);var r=n(4),o=n(1),u=i(o),a=n(0),s=i(a),f=n(2),c=i(f),l=n(7),h=i(l),d=n(8),v=i(d),p=n(3),y=i(p);e.getAll=r.getAll,e.removeAll=r.removeAll,e.remove=r.remove,e.add=r.add,e.now=r.now,e.update=r.update,e.autoPlay=r.autoPlay,e.on=r.on,e.once=r.once,e.off=r.off,e.emit=r.emit,e.Tween=s.default,e.Easing=u.default,e.Interpolation=c.default,e.Composite=h.default,e.Timeline=v.default,e.Plugins=y.default}])}); |
{ | ||
"name": "es6-tween", | ||
"version": "1.11.2", | ||
"version": "1.11.3", | ||
"description": "ES6 implementation of amazing tween.js", | ||
@@ -5,0 +5,0 @@ "main": "dist/Tween.js", |
@@ -55,7 +55,11 @@ # es6-tween | ||
#### Using `cdnjs` (TO-DO) | ||
#### Using [cdnjs](https://github.com/cdnjs) hosted version | ||
Sorry for that, but `cdnjs` doesn't accept none of my app, so if someone can from `cdnjs` contributors, would be nice. | ||
You can also reference a @cdnjs-hosted version in your code, thanks to [cdnjs](https://github.com/cdnjs). For example: | ||
```html | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/es6-tween/1.11.2/Tween.min.js"></script> | ||
``` | ||
### More advanced users might want to... | ||
@@ -62,0 +66,0 @@ |
@@ -19,3 +19,3 @@ import { | ||
class Tween { | ||
constructor(object = {}) { | ||
constructor(object = {}, instate) { | ||
@@ -43,2 +43,8 @@ this.object = object; | ||
if (instate && instate.to) { | ||
return new Tween(object).to(instate.to, instate); | ||
} | ||
return this; | ||
@@ -196,3 +202,5 @@ | ||
for (let prop in duration) { | ||
if (this[prop]) { | ||
this[prop](typeof duration[prop] === "function" ? duration[prop](this._duration) : duration); | ||
} | ||
} | ||
@@ -199,0 +207,0 @@ } |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
458708
3235
197
32