es6-tween
Advanced tools
Comparing version 3.6.0 to 3.7.0
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.TWEEN = global.TWEEN || {}))); | ||
(factory((global.TWEEN = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -416,3 +416,3 @@ | ||
var intertween = createCommonjsModule(function (module) { | ||
var intertween$1 = createCommonjsModule(function (module) { | ||
/** | ||
@@ -838,2 +838,3 @@ * @name InterTween | ||
this._easingFunction = defaultEasing; | ||
this._easingReverse = defaultEasing; | ||
@@ -1002,7 +1003,10 @@ this._startTime = 0; | ||
for (var property in _valuesEnd) { | ||
var start = object[property]; | ||
var start = object && object[property]; | ||
var end = _valuesEnd[property]; | ||
if (Plugins[property]) { | ||
_valuesFunc[property] = new Plugins[property](this$1, start, end); | ||
var plugin = Plugins[property].prototype.update ? new Plugins[property](this$1, start, end, property, object) : Plugins[property](this$1, start, end, property, object); | ||
if (plugin) { | ||
_valuesFunc[property] = plugin; | ||
} | ||
continue | ||
@@ -1019,3 +1023,3 @@ } | ||
} else { | ||
_valuesFunc[property] = intertween(start, end); | ||
_valuesFunc[property] = intertween$1(start, end); | ||
} | ||
@@ -1088,4 +1092,5 @@ } | ||
Tween.prototype.yoyo = function yoyo (state) { | ||
this._yoyo = typeof (state) === 'function' ? state(this._yoyo) : state; | ||
Tween.prototype.yoyo = function yoyo (state, _easingReverse) { | ||
this._yoyo = typeof (state) === 'function' ? state(this._yoyo) : state === null ? this._yoyo : state; | ||
this._easingReverse = _easingReverse || defaultEasing; | ||
@@ -1131,2 +1136,3 @@ return this | ||
var _easingFunction = ref._easingFunction; | ||
var _easingReverse = ref._easingReverse; | ||
var _repeat = ref._repeat; | ||
@@ -1150,2 +1156,3 @@ var _repeatDelayTime = ref._repeatDelayTime; | ||
var property; | ||
var currentEasing; | ||
@@ -1173,2 +1180,4 @@ time = time !== undefined ? time : now(); | ||
currentEasing = _reversed ? _easingReverse : _easingFunction; | ||
if (!object) { | ||
@@ -1179,3 +1188,3 @@ return true | ||
for (property in _valuesEnd) { | ||
value = _easingFunction[property] ? _easingFunction[property](elapsed) : typeof _easingFunction === 'function' ? _easingFunction(elapsed) : defaultEasing(elapsed); | ||
value = currentEasing[property] ? currentEasing[property](elapsed) : typeof currentEasing === 'function' ? currentEasing(elapsed) : defaultEasing(elapsed); | ||
@@ -1226,8 +1235,8 @@ var start = _valuesStart[property]; | ||
if (!preserve) { | ||
this._isPlaying = false; | ||
remove(this); | ||
_id--; | ||
} | ||
this._isPlaying = false; | ||
this.emit(EVENT_COMPLETE, object); | ||
this._repeat = this._r; | ||
_id--; | ||
@@ -1305,5 +1314,18 @@ return false | ||
var shuffle = function (a) { | ||
var j; | ||
var x; | ||
var i; | ||
for (i = a.length; i; i -= 1) { | ||
j = Math.floor(Math.random() * i); | ||
x = a[i - 1]; | ||
a[i - 1] = a[j]; | ||
a[j] = x; | ||
} | ||
return a | ||
}; | ||
var _id$1 = 0; | ||
var Timeline = (function (Tween$$1) { | ||
function Timeline (params) { | ||
function Timeline(params) { | ||
Tween$$1.call(this); | ||
@@ -1326,3 +1348,36 @@ this._totalDuration = 0; | ||
Timeline.prototype.constructor = Timeline; | ||
Timeline.prototype.mapTotal = function mapTotal (fn) { | ||
fn.call(this, this._tweens); | ||
return this | ||
}; | ||
Timeline.prototype.timingOrder = function timingOrder (fn) { | ||
var timing = fn(this._tweens.map(function (t) { return t._startTime; })); | ||
this._tweens.map(function (tween, i) { tween._startTime = timing[i]; }); | ||
return this | ||
}; | ||
Timeline.prototype.getTiming = function getTiming (mode, nodes, params, offset) { | ||
if ( offset === void 0 ) offset = 0; | ||
if (mode === 'reverse') { | ||
var stagger = params.stagger; | ||
var totalStagger = (stagger || 0) * (nodes.length - 1); | ||
return nodes.map(function (node, i) { return totalStagger - ((stagger || 0) * i) + offset; }) | ||
} else if (mode === 'async') { | ||
return nodes.map(function (node) { return offset; }) | ||
} else if (mode === 'sequence' || mode === 'delayed') { | ||
var stagger$1 = params.stagger; | ||
if (!stagger$1) { | ||
stagger$1 = (params.duration || 1000) / (nodes.length - 1); | ||
} | ||
return nodes.map(function (node, i) { return (stagger$1 * i) + offset; }) | ||
} else if (mode === 'oneByOne') { | ||
return nodes.map(function (node) { return params.duration; }) | ||
} else if (mode === 'shuffle') { | ||
var stagger$2 = params.stagger; | ||
return shuffle(nodes.map(function (node, i) { return ((stagger$2 || 0) * i) + offset; })) | ||
} else { | ||
var stagger$3 = params.stagger; | ||
return nodes.map(function (node, i) { return ((stagger$3 || 0) * i) + offset; }) | ||
} | ||
}; | ||
Timeline.prototype.fromTo = function fromTo (nodes, from, to, params) { | ||
@@ -1333,8 +1388,9 @@ var this$1 = this; | ||
if (this._defaultParams) { | ||
params = Object.assign(this._defaultParams, params); | ||
params = Object.assign({}, this._defaultParams, params); | ||
} | ||
var position = params.label; | ||
var offset = typeof position === 'number' ? position : this.position.parseLabel(typeof position !== 'undefined' ? position : 'afterLast', null); | ||
var mode = this.getTiming(params.mode, nodes, params, offset); | ||
nodes.map(function (node, i) { | ||
this$1.add(Tween$$1.fromTo(node, typeof from === 'function' ? from(i, nodes.length) : from, typeof to === 'function' ? to(i, nodes.length) : to, typeof params === 'function' ? params(i, nodes.length) : params), offset + (params.stagger || 0) * i); | ||
this$1.add(Tween$$1.fromTo(node, typeof from === 'function' ? from(i, nodes.length) : Object.assign({}, from), typeof to === 'function' ? to(i, nodes.length) : to, typeof params === 'function' ? params(i, nodes.length) : params), mode[i]); | ||
}); | ||
@@ -1441,2 +1497,3 @@ } | ||
elapsed = ((elapsed * 1000) | 0) / 1000; | ||
if (elapsed === _elapsed) { | ||
@@ -1452,3 +1509,3 @@ return true | ||
while (i < _tweens.length) { | ||
_tweens[i].update(_timing); | ||
_tweens[i].update(_timing, true); | ||
i++; | ||
@@ -1469,2 +1526,3 @@ } | ||
this._reversed = !_reversed; | ||
this.timingOrder(function (timing) { return timing.reverse(); }); | ||
} | ||
@@ -1512,3 +1570,3 @@ | ||
exports.Plugins = Plugins; | ||
exports.Interpolator = intertween; | ||
exports.Interpolator = intertween$1; | ||
exports.has = has; | ||
@@ -1515,0 +1573,0 @@ exports.get = get; |
@@ -1,3 +0,3 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TWEEN=t.TWEEN||{})}(this,function(t){"use strict";var e=Object.create||function(t){return Object.assign({},t||{})},n=Object.assign||function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e.length;r<i;r++){var o=e[r];for(var s in o)t[s]=o[s]}return t};Array.isArray||(Array.isArray=function(t){return t&&t.push&&t.splice});var r,i="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,o=[],s=!1,u=!1,a=i.requestAnimationFrame||function(t){return i.setTimeout(t,16)},f=i.cancelAnimationFrame||function(t){return i.clearTimeout(t)},h=function(t){o.push(t),u&&!s&&(r=a(d),s=!0)},p=function(t){for(var e=0;e<o.length;e++)if(t===o[e])return o[e];return null},l=function(t){var e=o.indexOf(t);-1!==e&&o.splice(e,1)},c=function(){if("undefined"!=typeof process&&void 0!==process.hrtime)return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==i.performance&&void 0!==i.performance.now)return i.performance.now.bind(i.performance);var t=i.performance&&i.performance.timing&&i.performance.timing.navigationStart?i.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),d=function(t,e){if(t=void 0!==t?t:c(),r=a(d),0===o.length)return f(r),s=!1,!1;for(var n=0;n<o.length;)o[n].update(t,e),n++;return!0},y={};if(i.document&&i.document.addEventListener){var _=0,v=0;i.document.addEventListener("visibilitychange",function(){if(document.hidden)v=c(),f(r),s=!1;else{_=c()-v;for(var t=0,e=o.length;t<e;t++)o[t]._startTime+=_;r=a(d),s=!0}return!0})}var m={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(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},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(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*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?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-m.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*m.Bounce.In(2*t):.5*m.Bounce.Out(2*t-1)+.5}}},g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b=function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t){!function(e,n){t.exports?t.exports=n():e.InterTween=n()}("undefined"!=typeof window?window:g,function(){function t(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}function e(t,e){var n,r,i;3===e.length&&(e=(n=e[0])+n+(r=e[1])+r+(i=e[2])+i);var o=parseInt(e,16);return n=o>>16&m,r=o>>8&m,i=o&m,"rgb("+n+","+r+","+i+")"}function n(t){return"string"==typeof t?t.replace(_,"").replace(v,","):t}function r(t,e){if("number"==typeof e)return e;var n=b[e.substr(0,2)],r=e.substr(2);if(1===n){var i=e[0]+r;return t+parseFloat(i)}return 2===n?t*+r:3===n?t/+r:4===n?t*(+r/100):e}function i(e){var n=T(e);return"string"==typeof n?n.match(d).map(t):e}function o(t,e,n){if(n=void 0!==n?n:1e4,!d.test(e))return e;var o=i(t),s=i(e),u=f(o,s,n);if(u)return u;u=null;for(var a=null,h=null,p=[],y=0,_=s.length;y<_;y++){var v=s[y],m=o[y];p[y]="string"==typeof v&&1===v.indexOf("=")?e:null,c.test(v)?(a=y+2,h=y+11):l.test(v)&&(a=y,h=y+9),s[y]=m===v?null:null!==p[y]?r(m,v):v}return function(t){var e="";for(y=0;y<_;y++){var i=o[y],u=s[y],f=p[y];e+="number"==typeof u?null!==a&&y>a&&y<h?i+(u-i)*t|0:((i+(u-i)*t)*n|0)/n:i,1===t&&null!==f&&(o[y]=u,s[y]=r(u,f))}return e}}function s(t,e){for(var n=[],r=0,i=t.length;r<i;r++){var s=t[r];n[r]=g(s)?a(s,e):"object"==typeof s?h(s,e):"string"==typeof s?o(s,e):s}return function(r){for(var i=0,o=n.length;i<o;i++)t[i]="function"==typeof n[i]?n[i](r):"number"==typeof n[i]?n[i]+(e-n[i])*r:n[i];return t}}function u(t,e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];n[r]=p(0===r?t:e[r-1],o)}var s=e[e.length-1];n.push(p(s,s));var u=n.length-1;return function(t){var e=t*u,r=Math.floor(e),i=e-r;return(0,n[r])(i)}}function a(t,e,n){n=void 0!==n?n:1e4;for(var i=t.slice(),f=[],p=Math.min(t.length,e.length),l=0;l<p;l++){var c=i[l],d=e[l];f[l]="string"==typeof d&&1===d.indexOf("=")?d:null,i[l]=d.nodeType||d.update?d.update:c===d?null:g(d)?g(c)&&d.length===c.length?a(c,d,n):u(c,d):g(c)?s(c,d):"object"==typeof c?h(c,d,n):"string"==typeof c?o(c,d,n):void 0!==c?c:d,e[l]=null!==f[l]?r(c,d):d}return function(o){for(var s=0;s<p;s++){var u=i[s],a=e[s],h=f[s];null!==u&&void 0!==u&&(t[s]="number"==typeof u?((u+(a-u)*o)*n|0)/n:"function"==typeof u?u(o):u.update?u.update(o):a&&a.update?a.update(o):a,h&&1===o&&(i[s]=a,e[s]=r(i[s],h)))}return t}}function f(t,e,n){if(n=void 0!==n?n:1e4,2===e.length&&2===t.length&&-1!==O.indexOf(e[1])){var i=+t[0],o=+e[0],s=e[1],u="string"==typeof e[0]&&1===e[0].indexOf("=")?e[0]:null;return u&&(o=r(i,o)),i===o&&e[0]===s?e:function(t){var e=((i+(o-i)*t)*n|0)/n+s;return u&&1===t&&(o=r(i=o,u)),e}}return!1}function h(t,e,n){n=void 0!==n?n:1e4;var i={},f={};for(var p in e){f[p]=t&&t[p];var l=f[p],c=e[p];i[p]="string"==typeof c&&1===c.indexOf("=")?c:null,void 0!==t[p]&&(f[p]=c.nodeType?c:c.update?c:l===c?null:g(c)?g(l)&&c.length===l.length?a(l,c,n):u(l,c):g(l)?s(l,c):"object"==typeof l?h(l,c,n):"string"==typeof l?o(l,c,n):void 0!==l?l:c,e[p]=null!==i[p]?r(l,c):c)}return function(o){for(var s in e){var u=f[s],a=e[s],h=i[s];null!==u&&void 0!==u&&(t[s]="number"==typeof u?((u+(a-u)*o)*n|0)/n:"function"==typeof u?u(o):u.update?u.update(o):a.update?a.update(o):a,h&&1===o&&(f[s]=a,e[s]=r(f[s],h)))}return t}}function p(t,e,n){n=void 0!==n?n:1e4;var i="string"==typeof e&&"number"==typeof t&&1===e.indexOf("=")?e:null;return i&&(e=r(t,i)),e.nodeType?e:t.nodeType?t:g(e)?g(t)&&t.length===e.length?a(t,e,n):u(t,e):g(t)?s(t,e):"object"==typeof e?h(t,e,n):"string"==typeof e?o(t,e,n):"function"==typeof e?e:function(o){var s="number"==typeof e?((t+(e-t)*o)*n|0)/n:t;return i&&1===o&&(e=r(t+=e,i)),s}}var l=/rgb/g,c=/argb/g,d=/\s+|([A-Za-z?().,{}:""[\]#\%]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,y=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,_=/\n|\r|\t/g,v=/, | ,| , /g,m=255,g=Array.isArray,b={"+=":1,"-=":1,"*=":2,"/=":3,"%=":4},T=function(t){return"string"!=typeof t?t:n(t).replace(y,e)},O=["px","pt","pc","deg","rad","turn","em","ex","cm","mm","dm","inch","in","rem","vw","vh","vmin","vmax","%"];return p})}),T={},O=function(t,e){if(!t||!t.nodeType||!e)return e;var r=t.queueID||"queue_"+Math.round(1e3*Math.random()+Date.now());return t.queueID||(t.queueID=r),T[r]?(e&&(T[r]=n(T[r],e)),T[r]):(T[r]=e,T[r])},w=function(){this._events={}};w.prototype.on=function(t,e){return this._events[t]||(this._events[t]=[]),this._events[t].push(e),this},w.prototype.once=function(t,e){var n=this;this._events[t]||(this._events[t]=[]);var r=this._events,i=r[t].length;return this._events[t].push(function(){for(var o=[],s=arguments.length;s--;)o[s]=arguments[s];e.apply(n,o),r[t].splice(i,1)}),this},w.prototype.off=function(t,e){var n=this._events;return void 0!==t&&n[t]?(e?this._events[t]=this._events[t].filter(function(t){return t!==e}):this._events[t].length=0,this):this},w.prototype.emit=function(t,e,n,r,i){var o=this._events[t];if(!o||!o.length)return this;for(var s=0,u=o.length;s<u;s++)o[s](e,n,r,i)},Object.create=e;var I=0,M=m.Linear.None,x=function(t){function e(e,n){t.call(this),this.id=I++,void 0===e||n||e.nodeType?void 0!==e&&(this.node=e,"object"==typeof n?n=this.object=O(e,n):this.object=n):(n=this.object=e,e=null);var r=this.isArr=Array.isArray(n);return this._valuesStart=r?[]:{},this._valuesEnd=null,this._valuesFunc={},this._duration=1e3,this._easingFunction=M,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._pausedTime=null,this._isFinite=!0,this._elapsed=0,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fromTo=function(t,n,r,i){void 0===i&&(i={}),i.quickRender=i.quickRender?i.quickRender:!r;var o=new e(t,n).to(r,i);return i.quickRender&&(o.render().update(o._startTime),o._rendered=!1,o._onStartCallbackFired=!1),o},e.to=function(t,n,r){return e.fromTo(t,null,n,r)},e.from=function(t,n,r){return e.fromTo(t,n,null,r)},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isStarted=function(){return this._onStartCallbackFired},e.prototype.reverse=function(){var t=this._reversed;return this._reversed=!t,this},e.prototype.reversed=function(){return this._reversed},e.prototype.pause=function(){return this._isPlaying?(this._isPlaying=!1,l(this),this._pausedTime=c(),this.emit("pause",this.object)):this},e.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=c()-this._pausedTime,h(this),this._pausedTime=c(),this.emit("play",this.object))},e.prototype.restart=function(t){return this._repeat=this._r,this._startTime=c()+(t?0:this._delayTime),this._isPlaying||h(this),this.emit("restart",this._object)},e.prototype.seek=function(t,e){return this._startTime=c()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()},e.prototype.duration=function(t){return this._duration="function"==typeof t?t(this._duration):t,this},e.prototype.to=function(t,e){var n=this;if(void 0===e&&(e=1e3),this._valuesEnd=t,"number"==typeof e||"function"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"==typeof e)for(var r in e)if("function"==typeof n[r]){var i=Array.isArray(e[r])?e[r]:[e[r]],o=i[0],s=i[1],u=i[2],a=i[3];n[r](o,s,u,a)}return this},e.prototype.render=function(){var t=this;if(this._rendered)return this;var e=this,n=e._valuesEnd,r=e._valuesFunc,i=e._valuesStart,o=e.object,s=e.Renderer,u=e.node,a=e.InitialValues;u&&a&&(o?n||(n=this._valuesEnd=a(u,o)):o=this.object=O(u,a(u,n)));for(var f in n){var h=o[f],p=n[f];y[f]?r[f]=new y[f](t,h,p):o&&void 0!==o[f]&&("number"==typeof p&&"number"==typeof h?(i[f]=h,n[f]=p):r[f]=b(h,p))}return s&&this.node&&(this.__render=new s(this,o,n)),this},e.prototype.start=function(t){return this._startTime=void 0!==t?t:c(),this._startTime+=this._delayTime,h(this),this._isPlaying=!0,this},e.prototype.stop=function(){var t=this,e=t._isPlaying,n=t.object,r=t._startTime,i=t._duration;return e?(this.update(r+i),l(this),this._isPlaying=!1,this.emit("stop",n)):this},e.prototype.delay=function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this._startTime+=this._delayTime,this},e.prototype.repeat=function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this._isFinite=isFinite(t),this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this},e.prototype.reverseDelay=function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this},e.prototype.yoyo=function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this},e.prototype.easing=function(t){return this._easingFunction=t,this},e.prototype.reassignValues=function(){var t=this,e=t._valuesStart,n=t._valuesEnd,r=t.object,i=t.isArr;for(var o in n){i&&(o*=1);var s=e[o],u=n[o];r[o]="function"==typeof u?u(0):s}return this},e.prototype.get=function(t){return this.update(t),this.object},e.prototype.update=function(t,e){var n,r,i,o=this,s=o._onStartCallbackFired,u=o._easingFunction,a=o._repeat,f=o._repeatDelayTime,h=o._reverseDelayTime,p=o._yoyo,d=o._reversed,y=o._startTime,_=o._duration,v=o._valuesStart,m=o._valuesEnd,g=o._valuesFunc,b=o.object,T=o._isFinite,O=o._isPlaying,w=o.__render;if(t=void 0!==t?t:c(),!O||t<y)return!0;if(s||(this._rendered||(this.render(),this._rendered=!0),this.emit("start",b),this._onStartCallbackFired=!0),n=(t-y)/_,n=n>1?1:n,n=d?1-n:n,!b)return!0;for(i in m){r=u[i]?u[i](n):"function"==typeof u?u(n):M(n);var x=v[i],P=m[i],j=g[i];j&&j.update?j.update(r,n):b[i]=j?j(r):"number"==typeof P?x+(P-x)*r:P}return w&&w.update(b,n),this.emit("update",b,n),!(1===n||d&&0===n)||(a?(T&&this._repeat--,p&&(this._reversed=!d),this.emit(p&&!d?"reverse":"repeat",b),this._startTime=!d&&f?t+f:d&&h?t+h:t,!0):(e||l(this),this._isPlaying=!1,this.emit("complete",b),this._repeat=this._r,I--,!1))},e}(w),P=function(){this.totalTime=0,this.labels=[],this.offsets=[]};P.prototype.parseLabel=function(t,e){var n=this,r=n.offsets,i=n.labels,o=i.indexOf(t);if("string"==typeof t&&-1!==t.indexOf("=")&&!e&&-1===o){var s=t.substr(t.indexOf("=")-1,2),u=t.split(s);e=2===u.length?s+u[1]:null,t=u[0],o=i.indexOf(t)}if(-1!==o&&t){var a=r[o]||0;if("number"==typeof e)a=e;else if("string"==typeof e&&-1!==e.indexOf("=")){var f=e.charAt(0);e=Number(e.substr(2)),"+"===f||"-"===f?a+=parseFloat(f+e):"*"===f?a*=e:"/"===f?a/=e:"%"===f&&(a*=e/100)}return a}return"number"==typeof e?e:0},P.prototype.addLabel=function(t,e){return this.labels.push(t),this.offsets.push(this.parseLabel(t,e)),this},P.prototype.setLabel=function(t,e){var n=this.labels.indexOf(t);return-1!==n&&this.offsets.splice(n,1,this.parseLabel(t,e)),this},P.prototype.eraseLabel=function(t){var e=this.labels.indexOf(t);return-1!==e&&(this.labels.splice(e,1),this.offsets.splice(e,1)),this};var j=0,D=function(t){function e(e){return t.call(this),this._totalDuration=0,this._startTime=c(),this._tweens=[],this._elapsed=0,this._id=j++,this._defaultParams=e,this.position=new P,this.position.addLabel("afterLast",this._totalDuration),this.position.addLabel("afterInit",this._startTime),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fromTo=function(e,n,r,i){var o=this;if(Array.isArray(e)){this._defaultParams&&(i=Object.assign(this._defaultParams,i));var s=i.label,u="number"==typeof s?s:this.position.parseLabel(void 0!==s?s:"afterLast",null);e.map(function(s,a){o.add(t.fromTo(s,"function"==typeof n?n(a,e.length):n,"function"==typeof r?r(a,e.length):r,"function"==typeof i?i(a,e.length):i),u+(i.stagger||0)*a)})}return this.start()},e.prototype.from=function(t,e,n){return this.fromTo(t,e,null,n)},e.prototype.to=function(t,e,n){return this.fromTo(t,null,e,n)},e.prototype.addLabel=function(t,e){return this.position.addLabel(t,e),this},e.prototype.map=function(t){for(var e=this,n=0,r=this._tweens.length;n<r;n++){var i=e._tweens[n];t(i,n),e._totalDuration=Math.max(e._totalDuration,i._duration+i._startTime)}return this},e.prototype.add=function(e,n){var r=this;if(Array.isArray(e))return e.map(function(t){r.add(t,n)}),this;"object"!=typeof e||e instanceof t||(e=new t(e.from).to(e.to,e));var i=this,o=i._defaultParams,s=i._totalDuration;if(o)for(var u in o)"function"==typeof e[u]&&e[u](o[u]);var a="number"==typeof n?n:this.position.parseLabel(void 0!==n?n:"afterLast",null);return e._startTime=Math.max(this._startTime,e._delayTime),e._startTime+=a,e._isPlaying=!0,this._totalDuration=Math.max(s,e._startTime+e._delayTime+e._duration),this._tweens.push(e),this.position.setLabel("afterLast",this._totalDuration),this},e.prototype.restart=function(){return this._startTime+=c(),h(this),this.emit("restart")},e.prototype.easing=function(t){return this.map(function(e){return e.easing(t)})},e.prototype.interpolation=function(t){return this.map(function(e){return e.interpolation(t)})},e.prototype.update=function(t){var e=this,n=e._tweens,r=e._totalDuration,i=e._repeatDelayTime,o=e._reverseDelayTime,s=e._startTime,u=e._reversed,a=e._yoyo,f=e._repeat,h=e._isFinite,p=e._elapsed;if(!e._isPlaying||t<s)return!0;var c=(t-s)/r;if(c=c>1?1:c,c=u?1-c:c,(c=(1e3*c|0)/1e3)===p)return!0;this._elapsed=c;for(var d=t-s,y=u?r-d:d,_=0;_<n.length;)n[_].update(y),_++;if(this.emit("update",c,d),1===c||u&&0===c){if(f){for(h&&this._repeat--,this.emit(u?"reverse":"repeat"),a&&(this._reversed=!u),this._startTime=!u&&i?t+i:u&&o?t+o:t;_<n.length;)n[_].reassignValues(),_++;return!0}return this.emit("complete"),this._repeat=this._r,l(this),this._isPlaying=!1,!1}return!0},e.prototype.elapsed=function(t){return void 0!==t?this.update(t*this._totalDuration):this._elapsed},e.prototype.seek=function(t){return this.update(t<1.1?t*this._totalDuration:t)},e}(x);t.Plugins=y,t.Interpolator=b,t.has=function(t){return null!==p(t)},t.get=p,t.getAll=function(){return o},t.removeAll=function(){o.length=0},t.remove=l,t.add=h,t.now=c,t.update=d,t.autoPlay=function(t){u=t},t.isRunning=function(){return s},t.Tween=x,t.Easing=m,t.Timeline=D,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.TWEEN={})}(this,function(t){"use strict";var e=Object.create||function(t){return Object.assign({},t||{})},n=Object.assign||function(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];for(var r=0,i=e.length;r<i;r++){var o=e[r];for(var s in o)t[s]=o[s]}return t};Array.isArray||(Array.isArray=function(t){return t&&t.push&&t.splice});var r,i="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,o=[],s=!1,u=!1,a=i.requestAnimationFrame||function(t){return i.setTimeout(t,16)},f=i.cancelAnimationFrame||function(t){return i.clearTimeout(t)},h=function(t){o.push(t),u&&!s&&(r=a(d),s=!0)},p=function(t){for(var e=0;e<o.length;e++)if(t===o[e])return o[e];return null},l=function(t){var e=o.indexOf(t);-1!==e&&o.splice(e,1)},c=function(){if("undefined"!=typeof process&&void 0!==process.hrtime)return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==i.performance&&void 0!==i.performance.now)return i.performance.now.bind(i.performance);var t=i.performance&&i.performance.timing&&i.performance.timing.navigationStart?i.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),d=function(t,e){if(t=void 0!==t?t:c(),r=a(d),0===o.length)return f(r),s=!1,!1;for(var n=0;n<o.length;)o[n].update(t,e),n++;return!0},y={};if(i.document&&i.document.addEventListener){var _=0,v=0;i.document.addEventListener("visibilitychange",function(){if(document.hidden)v=c(),f(r),s=!1;else{_=c()-v;for(var t=0,e=o.length;t<e;t++)o[t]._startTime+=_;r=a(d),s=!0}return!0})}var m={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(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},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(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*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?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)}},Bounce:{In:function(t){return 1-m.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*m.Bounce.In(2*t):.5*m.Bounce.Out(2*t-1)+.5}}},g="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},b=function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t){!function(e,n){t.exports?t.exports=n():e.InterTween=n()}("undefined"!=typeof window?window:g,function(){function t(t){var e=parseFloat(t);return"number"!=typeof e||isNaN(e)?t:e}function e(t,e){var n,r,i;3===e.length&&(e=(n=e[0])+n+(r=e[1])+r+(i=e[2])+i);var o=parseInt(e,16);return n=o>>16&m,r=o>>8&m,i=o&m,"rgb("+n+","+r+","+i+")"}function n(t){return"string"==typeof t?t.replace(_,"").replace(v,","):t}function r(t,e){if("number"==typeof e)return e;var n=b[e.substr(0,2)],r=e.substr(2);if(1===n){var i=e[0]+r;return t+parseFloat(i)}return 2===n?t*+r:3===n?t/+r:4===n?t*(+r/100):e}function i(e){var n=T(e);return"string"==typeof n?n.match(d).map(t):e}function o(t,e,n){if(n=void 0!==n?n:1e4,!d.test(e))return e;var o=i(t),s=i(e),u=f(o,s,n);if(u)return u;u=null;for(var a=null,h=null,p=[],y=0,_=s.length;y<_;y++){var v=s[y],m=o[y];p[y]="string"==typeof v&&1===v.indexOf("=")?e:null,c.test(v)?(a=y+2,h=y+11):l.test(v)&&(a=y,h=y+9),s[y]=m===v?null:null!==p[y]?r(m,v):v}return function(t){var e="";for(y=0;y<_;y++){var i=o[y],u=s[y],f=p[y];e+="number"==typeof u?null!==a&&y>a&&y<h?i+(u-i)*t|0:((i+(u-i)*t)*n|0)/n:i,1===t&&null!==f&&(o[y]=u,s[y]=r(u,f))}return e}}function s(t,e){for(var n=[],r=0,i=t.length;r<i;r++){var s=t[r];n[r]=g(s)?a(s,e):"object"==typeof s?h(s,e):"string"==typeof s?o(s,e):s}return function(r){for(var i=0,o=n.length;i<o;i++)t[i]="function"==typeof n[i]?n[i](r):"number"==typeof n[i]?n[i]+(e-n[i])*r:n[i];return t}}function u(t,e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];n[r]=p(0===r?t:e[r-1],o)}var s=e[e.length-1];n.push(p(s,s));var u=n.length-1;return function(t){var e=t*u,r=Math.floor(e),i=e-r;return(0,n[r])(i)}}function a(t,e,n){n=void 0!==n?n:1e4;for(var i=t.slice(),f=[],p=Math.min(t.length,e.length),l=0;l<p;l++){var c=i[l],d=e[l];f[l]="string"==typeof d&&1===d.indexOf("=")?d:null,i[l]=d.nodeType||d.update?d.update:c===d?null:g(d)?g(c)&&d.length===c.length?a(c,d,n):u(c,d):g(c)?s(c,d):"object"==typeof c?h(c,d,n):"string"==typeof c?o(c,d,n):void 0!==c?c:d,e[l]=null!==f[l]?r(c,d):d}return function(o){for(var s=0;s<p;s++){var u=i[s],a=e[s],h=f[s];null!==u&&void 0!==u&&(t[s]="number"==typeof u?((u+(a-u)*o)*n|0)/n:"function"==typeof u?u(o):u.update?u.update(o):a&&a.update?a.update(o):a,h&&1===o&&(i[s]=a,e[s]=r(i[s],h)))}return t}}function f(t,e,n){if(n=void 0!==n?n:1e4,2===e.length&&2===t.length&&-1!==O.indexOf(e[1])){var i=+t[0],o=+e[0],s=e[1],u="string"==typeof e[0]&&1===e[0].indexOf("=")?e[0]:null;return u&&(o=r(i,o)),i===o&&e[0]===s?e:function(t){var e=((i+(o-i)*t)*n|0)/n+s;return u&&1===t&&(o=r(i=o,u)),e}}return!1}function h(t,e,n){n=void 0!==n?n:1e4;var i={},f={};for(var p in e){f[p]=t&&t[p];var l=f[p],c=e[p];i[p]="string"==typeof c&&1===c.indexOf("=")?c:null,void 0!==t[p]&&(f[p]=c.nodeType?c:c.update?c:l===c?null:g(c)?g(l)&&c.length===l.length?a(l,c,n):u(l,c):g(l)?s(l,c):"object"==typeof l?h(l,c,n):"string"==typeof l?o(l,c,n):void 0!==l?l:c,e[p]=null!==i[p]?r(l,c):c)}return function(o){for(var s in e){var u=f[s],a=e[s],h=i[s];null!==u&&void 0!==u&&(t[s]="number"==typeof u?((u+(a-u)*o)*n|0)/n:"function"==typeof u?u(o):u.update?u.update(o):a.update?a.update(o):a,h&&1===o&&(f[s]=a,e[s]=r(f[s],h)))}return t}}function p(t,e,n){n=void 0!==n?n:1e4;var i="string"==typeof e&&"number"==typeof t&&1===e.indexOf("=")?e:null;return i&&(e=r(t,i)),e.nodeType?e:t.nodeType?t:g(e)?g(t)&&t.length===e.length?a(t,e,n):u(t,e):g(t)?s(t,e):"object"==typeof e?h(t,e,n):"string"==typeof e?o(t,e,n):"function"==typeof e?e:function(o){var s="number"==typeof e?((t+(e-t)*o)*n|0)/n:t;return i&&1===o&&(e=r(t+=e,i)),s}}var l=/rgb/g,c=/argb/g,d=/\s+|([A-Za-z?().,{}:""[\]#\%]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,y=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,_=/\n|\r|\t/g,v=/, | ,| , /g,m=255,g=Array.isArray,b={"+=":1,"-=":1,"*=":2,"/=":3,"%=":4},T=function(t){return"string"!=typeof t?t:n(t).replace(y,e)},O=["px","pt","pc","deg","rad","turn","em","ex","cm","mm","dm","inch","in","rem","vw","vh","vmin","vmax","%"];return p})}),T={},O=function(t,e){if(!t||!t.nodeType||!e)return e;var r=t.queueID||"queue_"+Math.round(1e3*Math.random()+Date.now());return t.queueID||(t.queueID=r),T[r]?(e&&(T[r]=n(T[r],e)),T[r]):(T[r]=e,T[r])},w=function(){this._events={}};w.prototype.on=function(t,e){return this._events[t]||(this._events[t]=[]),this._events[t].push(e),this},w.prototype.once=function(t,e){var n=this;this._events[t]||(this._events[t]=[]);var r=this._events,i=r[t].length;return this._events[t].push(function(){for(var o=[],s=arguments.length;s--;)o[s]=arguments[s];e.apply(n,o),r[t].splice(i,1)}),this},w.prototype.off=function(t,e){var n=this._events;return void 0!==t&&n[t]?(e?this._events[t]=this._events[t].filter(function(t){return t!==e}):this._events[t].length=0,this):this},w.prototype.emit=function(t,e,n,r,i){var o=this._events[t];if(!o||!o.length)return this;for(var s=0,u=o.length;s<u;s++)o[s](e,n,r,i)},Object.create=e;var I=0,M=m.Linear.None,x=function(t){function e(e,n){t.call(this),this.id=I++,void 0===e||n||e.nodeType?void 0!==e&&(this.node=e,"object"==typeof n?n=this.object=O(e,n):this.object=n):(n=this.object=e,e=null);var r=this.isArr=Array.isArray(n);return this._valuesStart=r?[]:{},this._valuesEnd=null,this._valuesFunc={},this._duration=1e3,this._easingFunction=M,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._pausedTime=null,this._isFinite=!0,this._elapsed=0,this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.fromTo=function(t,n,r,i){void 0===i&&(i={}),i.quickRender=i.quickRender?i.quickRender:!r;var o=new e(t,n).to(r,i);return i.quickRender&&(o.render().update(o._startTime),o._rendered=!1,o._onStartCallbackFired=!1),o},e.to=function(t,n,r){return e.fromTo(t,null,n,r)},e.from=function(t,n,r){return e.fromTo(t,n,null,r)},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isStarted=function(){return this._onStartCallbackFired},e.prototype.reverse=function(){var t=this._reversed;return this._reversed=!t,this},e.prototype.reversed=function(){return this._reversed},e.prototype.pause=function(){return this._isPlaying?(this._isPlaying=!1,l(this),this._pausedTime=c(),this.emit("pause",this.object)):this},e.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=c()-this._pausedTime,h(this),this._pausedTime=c(),this.emit("play",this.object))},e.prototype.restart=function(t){return this._repeat=this._r,this._startTime=c()+(t?0:this._delayTime),this._isPlaying||h(this),this.emit("restart",this._object)},e.prototype.seek=function(t,e){return this._startTime=c()+Math.max(0,Math.min(t,this._duration)),this.emit("seek",t,this._object),e?this:this.pause()},e.prototype.duration=function(t){return this._duration="function"==typeof t?t(this._duration):t,this},e.prototype.to=function(t,e){var n=this;if(void 0===e&&(e=1e3),this._valuesEnd=t,"number"==typeof e||"function"==typeof e)this._duration="function"==typeof e?e(this._duration):e;else if("object"==typeof e)for(var r in e)if("function"==typeof n[r]){var i=Array.isArray(e[r])?e[r]:[e[r]],o=i[0],s=i[1],u=i[2],a=i[3];n[r](o,s,u,a)}return this},e.prototype.render=function(){var t=this;if(this._rendered)return this;var e=this,n=e._valuesEnd,r=e._valuesFunc,i=e._valuesStart,o=e.object,s=e.Renderer,u=e.node,a=e.InitialValues;u&&a&&(o?n||(n=this._valuesEnd=a(u,o)):o=this.object=O(u,a(u,n)));for(var f in n){var h=o[f],p=n[f];if(y[f]){var l=y[f].prototype.update?new y[f](t,h,p,f,o):y[f](t,h,p,f,o);l&&(r[f]=l)}else o&&void 0!==o[f]&&("number"==typeof p&&"number"==typeof h?(i[f]=h,n[f]=p):r[f]=b(h,p))}return s&&this.node&&(this.__render=new s(this,o,n)),this},e.prototype.start=function(t){return this._startTime=void 0!==t?t:c(),this._startTime+=this._delayTime,h(this),this._isPlaying=!0,this},e.prototype.stop=function(){var t=this,e=t._isPlaying,n=t.object,r=t._startTime,i=t._duration;return e?(this.update(r+i),l(this),this._isPlaying=!1,this.emit("stop",n)):this},e.prototype.delay=function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this._startTime+=this._delayTime,this},e.prototype.repeat=function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this._isFinite=isFinite(t),this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this},e.prototype.reverseDelay=function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this},e.prototype.yoyo=function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this},e.prototype.easing=function(t){return this._easingFunction=t,this},e.prototype.reassignValues=function(){var t=this,e=t._valuesStart,n=t._valuesEnd,r=t.object,i=t.isArr;for(var o in n){i&&(o*=1);var s=e[o],u=n[o];r[o]="function"==typeof u?u(0):s}return this},e.prototype.get=function(t){return this.update(t),this.object},e.prototype.update=function(t,e){var n,r,i,o=this,s=o._onStartCallbackFired,u=o._easingFunction,a=o._repeat,f=o._repeatDelayTime,h=o._reverseDelayTime,p=o._yoyo,d=o._reversed,y=o._startTime,_=o._duration,v=o._valuesStart,m=o._valuesEnd,g=o._valuesFunc,b=o.object,T=o._isFinite,O=o._isPlaying,w=o.__render;if(t=void 0!==t?t:c(),!O||t<y)return!0;if(s||(this._rendered||(this.render(),this._rendered=!0),this.emit("start",b),this._onStartCallbackFired=!0),n=(t-y)/_,n=n>1?1:n,n=d?1-n:n,!b)return!0;for(i in m){r=u[i]?u[i](n):"function"==typeof u?u(n):M(n);var x=v[i],P=m[i],j=g[i];j&&j.update?j.update(r,n):b[i]=j?j(r):"number"==typeof P?x+(P-x)*r:P}return w&&w.update(b,n),this.emit("update",b,n),!(1===n||d&&0===n)||(a?(T&&this._repeat--,p&&(this._reversed=!d),this.emit(p&&!d?"reverse":"repeat",b),this._startTime=!d&&f?t+f:d&&h?t+h:t,!0):(e||l(this),this._isPlaying=!1,this.emit("complete",b),this._repeat=this._r,I--,!1))},e}(w),P=function(){this.totalTime=0,this.labels=[],this.offsets=[]};P.prototype.parseLabel=function(t,e){var n=this,r=n.offsets,i=n.labels,o=i.indexOf(t);if("string"==typeof t&&-1!==t.indexOf("=")&&!e&&-1===o){var s=t.substr(t.indexOf("=")-1,2),u=t.split(s);e=2===u.length?s+u[1]:null,t=u[0],o=i.indexOf(t)}if(-1!==o&&t){var a=r[o]||0;if("number"==typeof e)a=e;else if("string"==typeof e&&-1!==e.indexOf("=")){var f=e.charAt(0);e=Number(e.substr(2)),"+"===f||"-"===f?a+=parseFloat(f+e):"*"===f?a*=e:"/"===f?a/=e:"%"===f&&(a*=e/100)}return a}return"number"==typeof e?e:0},P.prototype.addLabel=function(t,e){return this.labels.push(t),this.offsets.push(this.parseLabel(t,e)),this},P.prototype.setLabel=function(t,e){var n=this.labels.indexOf(t);return-1!==n&&this.offsets.splice(n,1,this.parseLabel(t,e)),this},P.prototype.eraseLabel=function(t){var e=this.labels.indexOf(t);return-1!==e&&(this.labels.splice(e,1),this.offsets.splice(e,1)),this};var j=0,D=function(t){function e(e){return t.call(this),this._totalDuration=0,this._startTime=c(),this._tweens=[],this._elapsed=0,this._id=j++,this._defaultParams=e,this.position=new P,this.position.addLabel("afterLast",this._totalDuration),this.position.addLabel("afterInit",this._startTime),this}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.fromTo=function(e,n,r,i){var o=this;if(Array.isArray(e)){this._defaultParams&&(i=Object.assign(this._defaultParams,i));var s=i.label,u="number"==typeof s?s:this.position.parseLabel(void 0!==s?s:"afterLast",null);e.map(function(s,a){o.add(t.fromTo(s,"function"==typeof n?n(a,e.length):n,"function"==typeof r?r(a,e.length):r,"function"==typeof i?i(a,e.length):i),u+(i.stagger||0)*a)})}return this.start()},e.prototype.from=function(t,e,n){return this.fromTo(t,e,null,n)},e.prototype.to=function(t,e,n){return this.fromTo(t,null,e,n)},e.prototype.addLabel=function(t,e){return this.position.addLabel(t,e),this},e.prototype.map=function(t){for(var e=this,n=0,r=this._tweens.length;n<r;n++){var i=e._tweens[n];t(i,n),e._totalDuration=Math.max(e._totalDuration,i._duration+i._startTime)}return this},e.prototype.add=function(e,n){var r=this;if(Array.isArray(e))return e.map(function(t){r.add(t,n)}),this;"object"!=typeof e||e instanceof t||(e=new t(e.from).to(e.to,e));var i=this,o=i._defaultParams,s=i._totalDuration;if(o)for(var u in o)"function"==typeof e[u]&&e[u](o[u]);var a="number"==typeof n?n:this.position.parseLabel(void 0!==n?n:"afterLast",null);return e._startTime=Math.max(this._startTime,e._delayTime),e._startTime+=a,e._isPlaying=!0,this._totalDuration=Math.max(s,e._startTime+e._delayTime+e._duration),this._tweens.push(e),this.position.setLabel("afterLast",this._totalDuration),this},e.prototype.restart=function(){return this._startTime+=c(),h(this),this.emit("restart")},e.prototype.easing=function(t){return this.map(function(e){return e.easing(t)})},e.prototype.interpolation=function(t){return this.map(function(e){return e.interpolation(t)})},e.prototype.update=function(t){var e=this,n=e._tweens,r=e._totalDuration,i=e._repeatDelayTime,o=e._reverseDelayTime,s=e._startTime,u=e._reversed,a=e._yoyo,f=e._repeat,h=e._isFinite,p=e._elapsed;if(!e._isPlaying||t<s)return!0;var c=(t-s)/r;if(c=c>1?1:c,c=u?1-c:c,(c=(1e3*c|0)/1e3)===p)return!0;this._elapsed=c;for(var d=t-s,y=u?r-d:d,_=0;_<n.length;)n[_].update(y),_++;if(this.emit("update",c,d),1===c||u&&0===c){if(f){for(h&&this._repeat--,this.emit(u?"reverse":"repeat"),a&&(this._reversed=!u),this._startTime=!u&&i?t+i:u&&o?t+o:t;_<n.length;)n[_].reassignValues(),_++;return!0}return this.emit("complete"),this._repeat=this._r,l(this),this._isPlaying=!1,!1}return!0},e.prototype.elapsed=function(t){return void 0!==t?this.update(t*this._totalDuration):this._elapsed},e.prototype.seek=function(t){return this.update(t<1.1?t*this._totalDuration:t)},e}(x);t.Plugins=y,t.Interpolator=b,t.has=function(t){return null!==p(t)},t.get=p,t.getAll=function(){return o},t.removeAll=function(){o.length=0},t.remove=l,t.add=h,t.now=c,t.update=d,t.autoPlay=function(t){u=t},t.isRunning=function(){return s},t.Tween=x,t.Easing=m,t.Timeline=D,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=dist/Tween.min.js.map | ||
//# sourceMappingURL=Tween.min.js.map |
10
lite.js
@@ -35,9 +35,11 @@ import buble from 'rollup-plugin-buble' | ||
export default { | ||
entry: 'src/Tween.Lite.js', | ||
input: 'src/Tween.Lite.js', | ||
output: { | ||
format: 'umd', | ||
sourceMap: true, | ||
file: `lite/Tween${minSuffix}.js` | ||
}, | ||
sourcemap: true, | ||
context: 'this', | ||
dest: `lite/Tween${minSuffix}.js`, | ||
moduleName: 'TWEEN', | ||
name: 'TWEEN', | ||
plugins: plugins | ||
} |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(factory((global.TWEEN = global.TWEEN || {}))); | ||
(factory((global.TWEEN = {}))); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -6,0 +6,0 @@ |
@@ -1,3 +0,3 @@ | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.TWEEN=t.TWEEN||{})}(this,function(t){"use strict";Array.isArray||(Array.isArray=function(t){return t&&t.push&&t.splice});var n,e="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,i=[],r=!1,o=!1,u=e.requestAnimationFrame||function(t){return e.setTimeout(t,16)},a=e.cancelAnimationFrame||function(t){return e.clearTimeout(t)},s=function(t){i.push(t),o&&!r&&(n=u(l),r=!0)},f=function(t){for(var n=0;n<i.length;n++)if(t===i[n])return i[n];return null},c=function(t){var n=i.indexOf(t);-1!==n&&i.splice(n,1)},h=function(){if("undefined"!=typeof process&&void 0!==process.hrtime)return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==e.performance&&void 0!==e.performance.now)return e.performance.now.bind(e.performance);var t=e.performance&&e.performance.timing&&e.performance.timing.navigationStart?e.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),l=function(t,e){if(t=void 0!==t?t:h(),n=u(l),0===i.length)return a(n),r=!1,!1;for(var o=0;o<i.length;)i[o].update(t,e),o++;return!0},p={};if(e.document&&e.document.addEventListener){var _=0,y=0;e.document.addEventListener("visibilitychange",function(){if(document.hidden)y=h(),a(n),r=!1;else{_=h()-y;for(var t=0,e=i.length;t<e;t++)i[t]._startTime+=_;n=u(l),r=!0}return!0})}var d={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(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},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(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var n=1.70158;return t*t*((n+1)*t-n)},Out:function(t){var n=1.70158;return--t*t*((n+1)*t+n)+1},InOut:function(t){var n=2.5949095;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-d.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*d.Bounce.In(2*t):.5*d.Bounce.Out(2*t-1)+.5}}},v={Linear:function(t,n){var e=t.length-1,i=e*n,r=Math.floor(i),o=v.Utils.Linear;return n<0?o(t[0],t[1],i):n>1?o(t[e],t[e-1],e-i):o(t[r],t[r+1>e?e:r+1],i-r)},Bezier:function(t,n){for(var e=0,i=t.length-1,r=Math.pow,o=v.Utils.Bernstein,u=0;u<=i;u++)e+=r(1-n,i-u)*r(n,u)*t[u]*o(i,u);return e},CatmullRom:function(t,n){var e=t.length-1,i=e*n,r=Math.floor(i),o=v.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(r=Math.floor(i=e*(1+n))),o(t[(r-1+e)%e],t[r],t[(r+1)%e],t[(r+2)%e],i-r)):n<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):n>1?t[e]-(o(t[e],t[e],t[e-1],t[e-1],i-e)-t[e]):o(t[r?r-1:0],t[r],t[e<r+1?e:r+1],t[e<r+2?e:r+2],i-r)},Utils:{Linear:function(t,n,e){return"function"==typeof t?t(e):(n-t)*e+t},Bernstein:function(t,n){var e=v.Utils.Factorial;return e(t)/e(n)/e(t-n)},Factorial:function(){var t=[1];return function(n){var e=1;if(t[n])return t[n];for(var i=n;i>1;i--)e*=i;return t[n]=e,e}}(),CatmullRom:function(t,n,e,i,r){var o=.5*(e-t),u=.5*(i-n),a=r*r;return(2*n-2*e+o+u)*(r*a)+(-3*n+3*e-2*o-u)*a+o*r+n}}},m=0,g=function(t){return this.id=m++,this.object=t,this._valuesStart={},this._valuesEnd=null,this._valuesStartRepeat={},this._duration=1e3,this._easingFunction=d.Linear.None,this._interpolationFunction=v.Linear,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._pausedTime=null,this._isFinite=!0,this._onStartCallback=null,this._onUpdateCallback=null,this._onCompleteCallback=null,this};g.prototype.onStart=function(t){return this._onStartCallback=t,this},g.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},g.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},g.prototype.isPlaying=function(){return this._isPlaying},g.prototype.isStarted=function(){return this._onStartCallbackFired},g.prototype.pause=function(){return this._isPlaying?(this._isPlaying=!1,c(this),this._pausedTime=h(),this):this},g.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=h()-this._pausedTime,s(this),this._pausedTime=h(),this)},g.prototype.duration=function(t){return this._duration="function"==typeof t?t(this._duration):t,this},g.prototype.to=function(t,n){return void 0===n&&(n=1e3),this._valuesEnd=t,this._duration=n,this},g.prototype.start=function(t){this._startTime=void 0!==t?t:h(),this._startTime+=this._delayTime;var n=this,e=n._valuesEnd,i=n._valuesStartRepeat,r=n._valuesStart,o=n._interpolationFunction,u=n.object;for(var a in e)!function(t){var n=u[t],a=e[t];if(u&&void 0!==u[t]){var s=u[t];if("number"==typeof n){if("string"==typeof a)i[t]=a,a=n+parseFloat(a);else if(Array.isArray(a)){a.unshift(n);var f=a;a=function(t){return o(f,t)}}}else if("object"==typeof a)if(Array.isArray(a)){var c=a,h=n.map(function(t){return t}),l=void 0,p=a.length;a=function(t){for(l=0;l<p;l++)s[l]="number"==typeof h[l]?h[l]+(c[l]-h[l])*t:c[l];return s}}else{var _=a,y={};for(var d in n)y[d]=n[d];a=function(t){for(var n in a)s[n]="number"==typeof y[n]?y[n]+(_[n]-y[n])*t:_[n];return s}}r[t]=n,e[t]=a}}(a);return s(this),this._isPlaying=!0,this},g.prototype.stop=function(){var t=this,n=t._isPlaying,e=t._startTime,i=t._duration;return n?(this.update(e+i),c(this),this._isPlaying=!1,this):this},g.prototype.delay=function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this},g.prototype.repeat=function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this._isFinite=isFinite(t),this},g.prototype.repeatDelay=function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this},g.prototype.reverseDelay=function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this},g.prototype.yoyo=function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this},g.prototype.easing=function(t){return"function"==typeof t&&(this._easingFunction=t),this},g.prototype.interpolation=function(t){return"function"==typeof t&&(this._interpolationFunction=t),this},g.prototype.reassignValues=function(){var t=this,n=t._valuesStart,e=t._valuesEnd,i=t.object;for(var r in e){var o=n[r];i[r]=o}return this},g.prototype.update=function(t,n){var e,i,r,o=this,u=o._onStartCallbackFired,a=o._easingFunction,s=o._repeat,f=o._repeatDelayTime,l=o._reverseDelayTime,p=o._yoyo,_=o._reversed,y=o._startTime,d=o._duration,v=o._valuesStart,g=o._valuesEnd,M=o._valuesStartRepeat,b=o.object,I=o._isFinite,T=o._isPlaying,O=o._onStartCallback,C=o._onUpdateCallback,P=o._onCompleteCallback;if(t=void 0!==t?t:h(),!T||t<y)return!0;u||(O&&O(b),this._onStartCallbackFired=!0),e=(e=(t-y)/d)>1?1:e,i=a(e=_?1-e:e);for(r in g){var F=v[r],w=g[r];void 0!==F&&("function"==typeof w?b[r]=w(i):"number"==typeof w&&(b[r]=F+(w-F)*i))}if(C&&C(b,e),1===e||_&&0===e){if(s){if(I&&this._repeat--,!_)for(r in M)v[r]=g[r],g[r]+=parseFloat(M[r]);return p&&(this._reversed=!_),this._startTime=!_&&f?t+f:_&&l?t+l:t,!0}return n||c(this),this._isPlaying=!1,P&&P(),this._repeat=this._r,m--,!1}return!0},t.Plugins=p,t.has=function(t){return null!==f(t)},t.get=f,t.getAll=function(){return i},t.removeAll=function(){i.length=0},t.remove=c,t.add=s,t.now=h,t.update=l,t.autoPlay=function(t){o=t},t.isRunning=function(){return r},t.Tween=g,t.Easing=d,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.TWEEN={})}(this,function(t){"use strict";Array.isArray||(Array.isArray=function(t){return t&&t.push&&t.splice});var n,e="undefined"!=typeof window?window:"undefined"!=typeof global?global:this,i=[],r=!1,o=!1,u=e.requestAnimationFrame||function(t){return e.setTimeout(t,16)},a=e.cancelAnimationFrame||function(t){return e.clearTimeout(t)},s=function(t){i.push(t),o&&!r&&(n=u(l),r=!0)},f=function(t){for(var n=0;n<i.length;n++)if(t===i[n])return i[n];return null},c=function(t){var n=i.indexOf(t);-1!==n&&i.splice(n,1)},h=function(){if("undefined"!=typeof process&&void 0!==process.hrtime)return function(){var t=process.hrtime();return 1e3*t[0]+t[1]/1e6};if(void 0!==e.performance&&void 0!==e.performance.now)return e.performance.now.bind(e.performance);var t=e.performance&&e.performance.timing&&e.performance.timing.navigationStart?e.performance.timing.navigationStart:Date.now();return function(){return Date.now()-t}}(),l=function(t,e){if(t=void 0!==t?t:h(),n=u(l),0===i.length)return a(n),r=!1,!1;for(var o=0;o<i.length;)i[o].update(t,e),o++;return!0},p={};if(e.document&&e.document.addEventListener){var _=0,y=0;e.document.addEventListener("visibilitychange",function(){if(document.hidden)y=h(),a(n),r=!1;else{_=h()-y;for(var t=0,e=i.length;t<e;t++)i[t]._startTime+=_;n=u(l),r=!0}return!0})}var d={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(2,-10*t)},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))}},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(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)},Out:function(t){return 0===t?0:1===t?1:Math.pow(2,-10*t)*Math.sin(5*(t-.1)*Math.PI)+1},InOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?-.5*Math.pow(2,10*(t-1))*Math.sin(5*(t-1.1)*Math.PI):.5*Math.pow(2,-10*(t-1))*Math.sin(5*(t-1.1)*Math.PI)+1}},Back:{In:function(t){var n=1.70158;return t*t*((n+1)*t-n)},Out:function(t){var n=1.70158;return--t*t*((n+1)*t+n)+1},InOut:function(t){var n=2.5949095;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},Bounce:{In:function(t){return 1-d.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*d.Bounce.In(2*t):.5*d.Bounce.Out(2*t-1)+.5}}},v={Linear:function(t,n){var e=t.length-1,i=e*n,r=Math.floor(i),o=v.Utils.Linear;return n<0?o(t[0],t[1],i):n>1?o(t[e],t[e-1],e-i):o(t[r],t[r+1>e?e:r+1],i-r)},Bezier:function(t,n){for(var e=0,i=t.length-1,r=Math.pow,o=v.Utils.Bernstein,u=0;u<=i;u++)e+=r(1-n,i-u)*r(n,u)*t[u]*o(i,u);return e},CatmullRom:function(t,n){var e=t.length-1,i=e*n,r=Math.floor(i),o=v.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(r=Math.floor(i=e*(1+n))),o(t[(r-1+e)%e],t[r],t[(r+1)%e],t[(r+2)%e],i-r)):n<0?t[0]-(o(t[0],t[0],t[1],t[1],-i)-t[0]):n>1?t[e]-(o(t[e],t[e],t[e-1],t[e-1],i-e)-t[e]):o(t[r?r-1:0],t[r],t[e<r+1?e:r+1],t[e<r+2?e:r+2],i-r)},Utils:{Linear:function(t,n,e){return"function"==typeof t?t(e):(n-t)*e+t},Bernstein:function(t,n){var e=v.Utils.Factorial;return e(t)/e(n)/e(t-n)},Factorial:function(){var t=[1];return function(n){var e=1;if(t[n])return t[n];for(var i=n;i>1;i--)e*=i;return t[n]=e,e}}(),CatmullRom:function(t,n,e,i,r){var o=.5*(e-t),u=.5*(i-n),a=r*r;return(2*n-2*e+o+u)*(r*a)+(-3*n+3*e-2*o-u)*a+o*r+n}}},m=0,g=function(t){return this.id=m++,this.object=t,this._valuesStart={},this._valuesEnd=null,this._valuesStartRepeat={},this._duration=1e3,this._easingFunction=d.Linear.None,this._interpolationFunction=v.Linear,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._pausedTime=null,this._isFinite=!0,this._onStartCallback=null,this._onUpdateCallback=null,this._onCompleteCallback=null,this};g.prototype.onStart=function(t){return this._onStartCallback=t,this},g.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},g.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},g.prototype.isPlaying=function(){return this._isPlaying},g.prototype.isStarted=function(){return this._onStartCallbackFired},g.prototype.pause=function(){return this._isPlaying?(this._isPlaying=!1,c(this),this._pausedTime=h(),this):this},g.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=h()-this._pausedTime,s(this),this._pausedTime=h(),this)},g.prototype.duration=function(t){return this._duration="function"==typeof t?t(this._duration):t,this},g.prototype.to=function(t,n){return void 0===n&&(n=1e3),this._valuesEnd=t,this._duration=n,this},g.prototype.start=function(t){this._startTime=void 0!==t?t:h(),this._startTime+=this._delayTime;var n=this,e=n._valuesEnd,i=n._valuesStartRepeat,r=n._valuesStart,o=n._interpolationFunction,u=n.object;for(var a in e)!function(t){var n=u[t],a=e[t];if(u&&void 0!==u[t]){var s=u[t];if("number"==typeof n){if("string"==typeof a)i[t]=a,a=n+parseFloat(a);else if(Array.isArray(a)){a.unshift(n);var f=a;a=function(t){return o(f,t)}}}else if("object"==typeof a)if(Array.isArray(a)){var c=a,h=n.map(function(t){return t}),l=void 0,p=a.length;a=function(t){for(l=0;l<p;l++)s[l]="number"==typeof h[l]?h[l]+(c[l]-h[l])*t:c[l];return s}}else{var _=a,y={};for(var d in n)y[d]=n[d];a=function(t){for(var n in a)s[n]="number"==typeof y[n]?y[n]+(_[n]-y[n])*t:_[n];return s}}r[t]=n,e[t]=a}}(a);return s(this),this._isPlaying=!0,this},g.prototype.stop=function(){var t=this,n=t._isPlaying,e=t._startTime,i=t._duration;return n?(this.update(e+i),c(this),this._isPlaying=!1,this):this},g.prototype.delay=function(t){return this._delayTime="function"==typeof t?t(this._delayTime):t,this},g.prototype.repeat=function(t){return this._repeat="function"==typeof t?t(this._repeat):t,this._r=this._repeat,this._isFinite=isFinite(t),this},g.prototype.repeatDelay=function(t){return this._repeatDelayTime="function"==typeof t?t(this._repeatDelayTime):t,this},g.prototype.reverseDelay=function(t){return this._reverseDelayTime="function"==typeof t?t(this._reverseDelayTime):t,this},g.prototype.yoyo=function(t){return this._yoyo="function"==typeof t?t(this._yoyo):t,this},g.prototype.easing=function(t){return"function"==typeof t&&(this._easingFunction=t),this},g.prototype.interpolation=function(t){return"function"==typeof t&&(this._interpolationFunction=t),this},g.prototype.reassignValues=function(){var t=this,n=t._valuesStart,e=t._valuesEnd,i=t.object;for(var r in e){var o=n[r];i[r]=o}return this},g.prototype.update=function(t,n){var e,i,r,o=this,u=o._onStartCallbackFired,a=o._easingFunction,s=o._repeat,f=o._repeatDelayTime,l=o._reverseDelayTime,p=o._yoyo,_=o._reversed,y=o._startTime,d=o._duration,v=o._valuesStart,g=o._valuesEnd,M=o._valuesStartRepeat,b=o.object,I=o._isFinite,T=o._isPlaying,O=o._onStartCallback,C=o._onUpdateCallback,P=o._onCompleteCallback;if(t=void 0!==t?t:h(),!T||t<y)return!0;u||(O&&O(b),this._onStartCallbackFired=!0),e=(e=(t-y)/d)>1?1:e,i=a(e=_?1-e:e);for(r in g){var F=v[r],w=g[r];void 0!==F&&("function"==typeof w?b[r]=w(i):"number"==typeof w&&(b[r]=F+(w-F)*i))}if(C&&C(b,e),1===e||_&&0===e){if(s){if(I&&this._repeat--,!_)for(r in M)v[r]=g[r],g[r]+=parseFloat(M[r]);return p&&(this._reversed=!_),this._startTime=!_&&f?t+f:_&&l?t+l:t,!0}return n||c(this),this._isPlaying=!1,P&&P(),this._repeat=this._r,m--,!1}return!0},t.Plugins=p,t.has=function(t){return null!==f(t)},t.get=f,t.getAll=function(){return i},t.removeAll=function(){i.length=0},t.remove=c,t.add=s,t.now=h,t.update=l,t.autoPlay=function(t){o=t},t.isRunning=function(){return r},t.Tween=g,t.Easing=d,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=lite/Tween.min.js.map | ||
//# sourceMappingURL=Tween.min.js.map |
119
package.json
{ | ||
"name": "es6-tween", | ||
"version": "3.6.0", | ||
"description": "ES6 implementation of amazing tween.js", | ||
"browser": "dist/Tween.min.js", | ||
"cdn": "dist/Tween.min.js", | ||
"main": "dist/Tween.min.js", | ||
"directories": { | ||
"example": "examples" | ||
}, | ||
"types": "Tween.d.ts", | ||
"scripts": { | ||
"source": "rollup -c --environment min:false", | ||
"minify": "rollup -c --environment min:true", | ||
"build": "npm run source && npm run minify", | ||
"source-lite": "rollup -c lite.js --environment min:false", | ||
"minify-lite": "rollup -c lite.js --environment min:true", | ||
"build-lite": "npm run source-lite && npm run minify-lite", | ||
"prepare": "npm run build && npm run build-lite", | ||
"dev": "rollup -c -w", | ||
"dev-lite": "rollup -c lite.js -w", | ||
"lint": "eslint src", | ||
"fix": "eslint --fix src", | ||
"test-unit": "nodeunit test/unit/nodeunitheadless.js", | ||
"test": "npm run lint && ava --verbose", | ||
"prepublishOnly": "npm run lint && npm run prepare && ava --verbose" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tweenjs/es6-tween.git" | ||
}, | ||
"keywords": [ | ||
"tween", | ||
"tweening", | ||
"es6", | ||
"numeric", | ||
"interpolation", | ||
"easing", | ||
"emit" | ||
], | ||
"author": "es6-tween contributors", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/tweenjs/es6-tween/issues" | ||
}, | ||
"homepage": "https://github.com/tweenjs/es6-tween#readme", | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"eslint": "latest", | ||
"eslint-plugin-import": "latest", | ||
"rollup": "latest", | ||
"rollup-plugin-buble": "latest", | ||
"rollup-plugin-commonjs": "latest", | ||
"rollup-plugin-node-resolve": "latest", | ||
"rollup-plugin-uglify": "latest", | ||
"rollup-watch": "latest", | ||
"uglify-es": "latest" | ||
}, | ||
"dependencies": { | ||
"intertween": "0.0.14" | ||
} | ||
"name": "es6-tween", | ||
"version": "3.7.0", | ||
"description": "ES6 implementation of amazing tween.js", | ||
"browser": "dist/Tween.min.js", | ||
"cdn": "dist/Tween.min.js", | ||
"main": "dist/Tween.min.js", | ||
"directories": { | ||
"example": "examples" | ||
}, | ||
"types": "Tween.d.ts", | ||
"scripts": { | ||
"source": "rollup -c --environment min:false", | ||
"minify": "rollup -c --environment min:true", | ||
"build": "npm run source && npm run minify", | ||
"source-lite": "rollup -c lite.js --environment min:false", | ||
"minify-lite": "rollup -c lite.js --environment min:true", | ||
"build-lite": "npm run source-lite && npm run minify-lite", | ||
"prepare": "npm run build && npm run build-lite", | ||
"dev": "rollup -c -w", | ||
"dev-lite": "rollup -c lite.js -w", | ||
"lint": "eslint src", | ||
"fix": "eslint --fix src", | ||
"test": "npm run lint && ava --verbose", | ||
"prepublishOnly": "npm run lint && npm run prepare && ava --verbose" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/tweenjs/es6-tween.git" | ||
}, | ||
"keywords": [ | ||
"tween", | ||
"tweening", | ||
"es6", | ||
"numeric", | ||
"interpolation", | ||
"easing", | ||
"emit" | ||
], | ||
"author": "es6-tween contributors", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/tweenjs/es6-tween/issues" | ||
}, | ||
"homepage": "https://github.com/tweenjs/es6-tween#readme", | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"eslint": "latest", | ||
"eslint-plugin-import": "latest", | ||
"rollup": "^0.49.2", | ||
"rollup-plugin-buble": "latest", | ||
"rollup-plugin-commonjs": "latest", | ||
"rollup-plugin-node-resolve": "latest", | ||
"rollup-plugin-uglify": "latest", | ||
"rollup-watch": "latest", | ||
"uglify-es": "latest" | ||
}, | ||
"dependencies": { | ||
"intertween": "0.0.14" | ||
} | ||
} |
117
README.md
@@ -5,22 +5,2 @@ # es6-tween | ||
# News (`Lite` version is released)! | ||
You can use the `Lite` version of ES6 which lighter (~8Kb minified), faster (~10% faster executioin), simpler (like the original one), memory effecient and better (can tween second-level Objects/Array). Optimized for runtime performance, no-lag anymore. | ||
When you want building mobile apps that loading files from server, use `Lite` for better performance. | ||
Differences when using `Lite`: | ||
* 2-times lighter size | ||
* No `Timeline` instance | ||
* No `String` tween support | ||
* No `Deep tween` support (does 2-level) | ||
* Uses original `Interpolation` instances for `Bezier` interpolation | ||
* Faster performance and execution speed | ||
* Memory effecient | ||
* No more shims required | ||
* No `Plugins` support | ||
* No `DOM Get/Set`, `Renderer` instance/plugin/add-on support | ||
* No full-Event system, just 3 event support (`onStart`, `onUpdate`, `onComplete`) | ||
* No `seek`, `reverse` support | ||
* No event fire when `stop`, `pause`, `etc` | ||
* No `*`, `/`, `%` relatives support | ||
[![size](http://img.badgesize.io/https://unpkg.com/es6-tween?cache=false)](http://unpkg.com/es6-tween) | ||
@@ -51,5 +31,31 @@ [![gzipsize](http://img.badgesize.io/https://unpkg.com/es6-tween?compression=gzip&cache=false)](http://unpkg.com/es6-tween) | ||
# Adversiting | ||
* Backers will be show there | ||
* The user @dalisoft is looking for job, you can contact to me via [e-mail](mailto:dalisoft@mail.ru), or at [Twitter](https://twitter.com/dalisoft) | ||
# News (`Lite` version is released)! | ||
You can use the `Lite` version of ES6 which lighter (~8Kb minified), faster (~10% faster executioin), simpler (like the original one), memory effecient and better (can tween second-level Objects/Array). Optimized for runtime performance, no-lag anymore. | ||
When you want building mobile apps that loading files from server, use `Lite` for better performance. | ||
Differences when using `Lite`: | ||
* 2-times lighter size | ||
* No `Timeline` instance | ||
* No `String` tween support | ||
* No `Deep tween` support (does 2-level) | ||
* Uses original `Interpolation` instances for `Bezier` interpolation | ||
* Faster performance and execution speed | ||
* Memory effecient | ||
* No more shims required | ||
* No `Plugins` support | ||
* No `DOM Get/Set`, `Renderer` instance/plugin/add-on support | ||
* No full-Event system, just 3 event support (`onStart`, `onUpdate`, `onComplete`) | ||
* No `seek`, `reverse` support | ||
* No event fire when `stop`, `pause`, `etc` | ||
* No `*`, `/`, `%` relatives support | ||
## Plugins | ||
Starting at `v3`, we provide excluded plugins from core, so our core has lighter and faster. [Here our plugins list](https://www.npmjs.com/browse/keyword/es6-tween) | ||
Starting at `v3`, we provide excluded plugins from core, so our core becomes lighter and faster. [Here our plugins list](https://www.npmjs.com/browse/keyword/es6-tween) | ||
@@ -76,8 +82,28 @@ | ||
* Now you can load from CDN both version `Full` and `Lite` | ||
```html | ||
<!-- jsDelivr --> | ||
<!-- Full --> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-tween"></script> | ||
<!-- or may you want --> | ||
<!-- Lite --> | ||
<script src="https://cdn.jsdelivr.net/npm/es6-tween/lite/Tween.min.js"></script> | ||
<!-- unpkg --> | ||
<!-- Full --> | ||
<script src="https://unpkg.com/es6-tween"></script> | ||
<!-- or like this --> | ||
<!-- Lite --> | ||
<script src="https://unpkg.com/es6-tween/lite/Tween.min.js"></script> | ||
<!-- npmcdn --> | ||
<!-- Full --> | ||
<script src="https://npmcdn.com/es6-tween"></script> | ||
<!-- Lite --> | ||
<script src="https://npmcdn.com/es6-tween/lite/Tween.min.js"></script> | ||
``` | ||
@@ -99,3 +125,7 @@ | ||
```javascript | ||
import { Easing, Interpolation, Tween, autoPlay } from 'es6-tween'; | ||
// Full | ||
import { Easing, Tween, autoPlay } from 'es6-tween' | ||
// Lite | ||
import { Easing, Interpolation, Tween, autoPlay } from 'es6-tween/src/Tween.Lite' | ||
``` | ||
@@ -108,5 +138,16 @@ | ||
<script type="x-module"> | ||
import { Easing, Interpolation, Tween, autoPlay } from 'es6-tween'; | ||
// or you can follow second way | ||
// const { Tween, Easing, Interpolation, autoPlay } = require('es6-tween'); | ||
// ES6 | ||
// Full | ||
import { Easing, Tween, autoPlay } from 'es6-tween' | ||
// Lite | ||
import { Easing, Interpolation, Tween, autoPlay } from 'es6-tween/src/Tween.Lite' | ||
// CommonJS | ||
// Full | ||
const { Tween, Easing, autoPlay } = require('es6-tween') | ||
// Lite | ||
const { Easing, Interpolation, Tween, autoPlay } = require('es6-tween/lite/Tween') | ||
</script> | ||
@@ -128,3 +169,7 @@ ``` | ||
```javascript | ||
const { Tween, Easing, Interpolation, autoPlay } = require('es6-tween'); | ||
// Full | ||
const { Tween, Easing, autoPlay } = require('es6-tween'); | ||
// Lite | ||
const { Tween, Interpolation, Easing, autoPlay } = require('es6-tween/lite/Tween'); | ||
``` | ||
@@ -157,5 +202,5 @@ | ||
* Tweens everything you give them, string (numbers only), number, number of arrays, number of object, etc... | ||
* Tweens everything you give them, string, number, number of arrays, number of object, all-to, interpolators and much more. Endless possibilites | ||
* Can use CSS units (e.g. appending `px`) | ||
* Can interpolate colours (partially) | ||
* Can interpolate colours | ||
* Easing functions are reusable outside of Tween | ||
@@ -186,11 +231,3 @@ * Can also use custom easing functions | ||
You need to install `npm` first--this comes with node.js, so install that one first. Then, cd to `es6-tween`'s directory and run: | ||
```bash | ||
npm install | ||
``` | ||
if running the tests for the first time, to install additional dependencies for running tests, and then run | ||
```bash | ||
npm test | ||
@@ -210,4 +247,4 @@ ``` | ||
## Thanks to: | ||
* [tween.js contributors](https://github.com/tweenjs/tween.js/graphs/contributors) | ||
* Rollup, Buble, Travis CI, and others (make issue, if i'm missed you) with their teams, devs and supporters | ||
* [es6-tween contributors](https://github.com/tweenjs/es6-tween/graphs/contributors) | ||
* Rollup, Buble, Travis CI, BrowserStack and others (make issue, if i'm missed you) with their teams, devs and supporters | ||
@@ -214,0 +251,0 @@ ## Projects using es6-tween |
@@ -44,9 +44,11 @@ import buble from 'rollup-plugin-buble' | ||
export default { | ||
entry: 'src/Tween.js', | ||
input: 'src/Tween.js', | ||
output: { | ||
format: 'umd', | ||
sourceMap: true, | ||
file: `dist/Tween${minSuffix}.js` | ||
}, | ||
sourcemap: true, | ||
context: 'this', | ||
dest: `dist/Tween${minSuffix}.js`, | ||
moduleName: 'TWEEN', | ||
name: 'TWEEN', | ||
plugins: plugins | ||
} |
@@ -5,2 +5,15 @@ import Tween, { EVENT_UPDATE, EVENT_RS, EVENT_REPEAT, EVENT_REVERSE, EVENT_COMPLETE } from './Tween' | ||
export const shuffle = a => { | ||
let j | ||
let x | ||
let i | ||
for (i = a.length; i; i -= 1) { | ||
j = Math.floor(Math.random() * i) | ||
x = a[i - 1] | ||
a[i - 1] = a[j] | ||
a[j] = x | ||
} | ||
return a | ||
} | ||
let _id = 0 | ||
@@ -22,12 +35,44 @@ class Timeline extends Tween { | ||
} | ||
mapTotal (fn) { | ||
fn.call(this, this._tweens) | ||
return this | ||
} | ||
timingOrder (fn) { | ||
const timing = fn(this._tweens.map(t => t._startTime)) | ||
this._tweens.map((tween, i) => { tween._startTime = timing[i] }) | ||
return this | ||
} | ||
getTiming (mode, nodes, params, offset = 0) { | ||
if (mode === 'reverse') { | ||
const { stagger } = params | ||
const totalStagger = (stagger || 0) * (nodes.length - 1) | ||
return nodes.map((node, i) => totalStagger - ((stagger || 0) * i) + offset) | ||
} else if (mode === 'async') { | ||
return nodes.map(node => offset) | ||
} else if (mode === 'sequence' || mode === 'delayed') { | ||
let { stagger } = params | ||
if (!stagger) { | ||
stagger = (params.duration || 1000) / (nodes.length - 1) | ||
} | ||
return nodes.map((node, i) => (stagger * i) + offset) | ||
} else if (mode === 'oneByOne') { | ||
return nodes.map(node => params.duration) | ||
} else if (mode === 'shuffle') { | ||
const { stagger } = params | ||
return shuffle(nodes.map((node, i) => ((stagger || 0) * i) + offset)) | ||
} else { | ||
const { stagger } = params | ||
return nodes.map((node, i) => ((stagger || 0) * i) + offset) | ||
} | ||
} | ||
fromTo (nodes, from, to, params) { | ||
if (Array.isArray(nodes)) { | ||
if (this._defaultParams) { | ||
params = Object.assign(this._defaultParams, params) | ||
params = { ...this._defaultParams, ...params } | ||
} | ||
const position = params.label | ||
const offset = typeof position === 'number' ? position : this.position.parseLabel(typeof position !== 'undefined' ? position : 'afterLast', null) | ||
const mode = this.getTiming(params.mode, nodes, params, offset) | ||
nodes.map((node, i) => { | ||
this.add(Tween.fromTo(node, typeof from === 'function' ? from(i, nodes.length) : from, typeof to === 'function' ? to(i, nodes.length) : to, typeof params === 'function' ? params(i, nodes.length) : params), offset + (params.stagger || 0) * i) | ||
this.add(Tween.fromTo(node, typeof from === 'function' ? from(i, nodes.length) : { ...from }, typeof to === 'function' ? to(i, nodes.length) : to, typeof params === 'function' ? params(i, nodes.length) : params), mode[i]) | ||
}) | ||
@@ -132,2 +177,3 @@ } | ||
elapsed = ((elapsed * 1000) | 0) / 1000 | ||
if (elapsed === _elapsed) { | ||
@@ -143,3 +189,3 @@ return true | ||
while (i < _tweens.length) { | ||
_tweens[i].update(_timing) | ||
_tweens[i].update(_timing, true) | ||
i++ | ||
@@ -160,2 +206,3 @@ } | ||
this._reversed = !_reversed | ||
this.timingOrder(timing => timing.reverse()) | ||
} | ||
@@ -162,0 +209,0 @@ |
@@ -70,2 +70,3 @@ import { | ||
this._easingFunction = defaultEasing | ||
this._easingReverse = defaultEasing | ||
@@ -204,7 +205,10 @@ this._startTime = 0 | ||
for (let property in _valuesEnd) { | ||
let start = object[property] | ||
let start = object && object[property] | ||
let end = _valuesEnd[property] | ||
if (Plugins[property]) { | ||
_valuesFunc[property] = new Plugins[property](this, start, end) | ||
let plugin = Plugins[property].prototype.update ? new Plugins[property](this, start, end, property, object) : Plugins[property](this, start, end, property, object) | ||
if (plugin) { | ||
_valuesFunc[property] = plugin | ||
} | ||
continue | ||
@@ -290,4 +294,5 @@ } | ||
yoyo (state) { | ||
this._yoyo = typeof (state) === 'function' ? state(this._yoyo) : state | ||
yoyo (state, _easingReverse) { | ||
this._yoyo = typeof (state) === 'function' ? state(this._yoyo) : state === null ? this._yoyo : state | ||
this._easingReverse = _easingReverse || defaultEasing | ||
@@ -334,2 +339,3 @@ return this | ||
_easingFunction, | ||
_easingReverse, | ||
_repeat, | ||
@@ -354,2 +360,3 @@ _repeatDelayTime, | ||
let property | ||
let currentEasing | ||
@@ -377,2 +384,4 @@ time = time !== undefined ? time : now() | ||
currentEasing = _reversed ? _easingReverse : _easingFunction | ||
if (!object) { | ||
@@ -383,3 +392,3 @@ return true | ||
for (property in _valuesEnd) { | ||
value = _easingFunction[property] ? _easingFunction[property](elapsed) : typeof _easingFunction === 'function' ? _easingFunction(elapsed) : defaultEasing(elapsed) | ||
value = currentEasing[property] ? currentEasing[property](elapsed) : typeof currentEasing === 'function' ? currentEasing(elapsed) : defaultEasing(elapsed) | ||
@@ -430,8 +439,8 @@ let start = _valuesStart[property] | ||
if (!preserve) { | ||
this._isPlaying = false | ||
remove(this) | ||
_id-- | ||
} | ||
this._isPlaying = false | ||
this.emit(EVENT_COMPLETE, object) | ||
this._repeat = this._r | ||
_id-- | ||
@@ -438,0 +447,0 @@ return false |
declare namespace TWEEN { | ||
export function autoPlay(state: boolean): void; | ||
export function update (time: number, preserve?: boolean): boolean; | ||
export class Tween { | ||
constructor (node: any, object?: any): any; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
1251415
44
15864
256
2
3