Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

es6-tween

Package Overview
Dependencies
Maintainers
1
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-tween - npm Package Compare versions

Comparing version 0.1.5 to 0.1.6

4

dist/Tween.js

@@ -614,4 +614,4 @@ (function webpackUniversalModuleDefinition(root, factory) {

this._duration = 1000;
this._easingFunction = TWEEN.Easing.Linear.None;
this._interpolationFunction = TWEEN.Interpolation.None;
this._easingFunction = _Easing2.default.Linear.None;
this._interpolationFunction = _Interpolation2.default.None;

@@ -618,0 +618,0 @@ this._startTime = null;

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.TWEEN=n():t.TWEEN=n()}(this,function(){return function(t){function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=8)}([function(t,n,e){"use strict";Object.defineProperty(n,"__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 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?.5*(t*t*((n+1)*t-n)):.5*((t-=2)*t*((n+1)*t+n)+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}}};n.default=i},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={Linear:function(t,n){var e=t.length-1,r=e*n,o=Math.floor(r),u=i.Utils.Linear;return n<0?u(t[0],t[1],r):n>1?u(t[e],t[e-1],e-r):u(t[o],t[o+1>e?e:o+1],r-o)},Bezier:function(t,n){for(var e=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)e+=o(1-n,r-a)*o(n,a)*t[a]*u(r,a);return e},CatmullRom:function(t,n){var e=t.length-1,r=e*n,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(o=Math.floor(r=e*(1+n))),u(t[(o-1+e)%e],t[o],t[(o+1)%e],t[(o+2)%e],r-o)):n<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):n>1?t[e]-(u(t[e],t[e],t[e-1],t[e-1],r-e)-t[e]):u(t[o?o-1:0],t[o],t[e<o+1?e:o+1],t[e<o+2?e:o+2],r-o)},Utils:{Linear:function(t,n,e){return(n-t)*e+t},Bernstein:function(t,n){var e=i.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,s=r*a;return(2*n-2*e+o+u)*s+(-3*n+3*e-2*o-u)*a+o*r+n}}};n.default=i},function(t,n,e){"use strict";function i(t){p(o)?(o=t,s=requestAnimationFrame(i)):(u=!1,cancelAnimationFrame(s))}Object.defineProperty(n,"__esModule",{value:!0});var r=[],o=0,u=!1,a=!1,s=void 0,c=function(){return r},f=function(t){a=t},l=function(){r=[]},h=function(t){r.push(t),a&&!u&&(i(v()),u=!0)},d=function(t){r.filter(function(n){return n!==t})},v=function(){return o},p=function(t,n){if(t=void 0!==t?t:v(),o=t,0===r.length)return!1;for(var e=0;e<r.length;)r[e].update(t)||n?e++:r.splice(e,1);return!0};n.getAll=c,n.removeAll=l,n.remove=d,n.add=h,n.now=v,n.update=p,n.autoPlay=f},function(t,n,e){"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,n,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(n,e,i){return e&&t(n.prototype,e),i&&t(n,i),n}}(),u=(e(2),e(0)),a=(i(u),e(1)),s=(i(a),function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=n,this._valuesStart=Object.assign({},n),this._valuesStartRepeat=Object.assign({},n),this._valuesEnd={},this._chainedTweens=[],this._duration=1e3,this._easingFunction=TWEEN.Easing.Linear.None,this._interpolationFunction=TWEEN.Interpolation.None,this._startTime=null,this._delayTime=0,this._repeat=0,this._repeatDelayTime=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events=new Map,this._pausedTime=0,this}return o(t,[{key:"emit",value:function(t,n,e,i,r){return void 0!==t&&"function"==typeof n?this._events.set(t,n):"function"!=typeof n&&void 0!==this._events.get(t)&&this._events.get(t).call(this,n,e,i,r),this}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,TWEEN.remove(this),this._pausedTime=TWEEN.now(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=TWEEN.now()-this._pausedTime,TWEEN.add(this),this._pausedTime=TWEEN.now(),this.emit("play",this.object))}},{key:"duration",value:function(t){return this._duration=t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return this._valuesEnd=t,this._duration=n,this}},{key:"start",value:function(t){var n=this._startTime,e=this._delayTime;return n=void 0!==t?t:TWEEN.now(),n+=e,this._startTime=n,TWEEN.add(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,n=(this._onStopCallback,this.object);return t?(TWEEN.remove(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",n)):this}},{key:"end",value:function(){var t=this._startTime,n=this._duration;return this.update(t+n)}},{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=t,this}},{key:"repeat",value:function(t){return this._repeat=t,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime=t,this}},{key:"yoyo",value:function(t){return 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,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return this._chainedTweens=n,this}},{key:"update",value:function(t){var n=(this._onUpdateCallback,this._onStartCallback,this._onStartCallbackFired),e=(this._onCompleteCallback,this._chainedTweens),i=this._easingFunction,r=this._interpolationFunction,o=this._repeat,u=this._repeatDelayTime,a=this._delayTime,s=this._yoyo,c=this._reversed,f=this._startTime,l=this._duration,h=this._valuesStart,d=this._valuesStartRepeat,v=this._valuesEnd,p=this.object,y=void 0,_=void 0,m=void 0;if(t<f)return!0;n===!1&&(this.emit("start",p),this._onStartCallbackFired=!0),_=(t-f)/l,_=_>1?1:_,m=i(_);for(y in v){var w=h[y],b=v[y];b instanceof Array?p[y]=r(b,m):("string"==typeof b&&(b="+"===b.charAt(0)||"-"===b.charAt(0)?w+parseFloat(b):parseFloat(b)),"number"==typeof b&&(p[y]=w+(b-w)*m))}if(this.emit("update",p,_),1===_){if(o>0){isFinite(o)&&o--;for(y in d){if("string"==typeof v[y]&&(d[y]=d[y]+parseFloat(v[y])),s){var g=d[y];d[y]=v[y],v[y]=g}h[y]=d[y]}return this.emit("repeat",p,c),s&&(this._reversed=!c),u?this._startTime=t+u:this._startTime=t+a,!0}return this.emit("complete",p),e.map(function(t){return t.start(f+l)}),!1}return!0}}]),t}());n.default=s},function(t,n,e){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var i=n.shift();return n.map(function(t){for(var n in t)i[n]=t[n]}),i})},function(t,n,e){"use strict";(function(t){var n="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,e=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===n.requestAnimationFrame){var c=void 0,f=void 0,l=Date.now(),h=50/3,d=h;e.map(function(t){void 0===(c=n[t+r])&&(c=function(t){return a(function(){f=Date.now(),t(f-l),d=h+(Date.now()-f)},d)})}),void 0!==c&&(n.requestAnimationFrame=c)}if(void 0===n.cancelAnimationFrame){var v=void 0;e.map(function(t){void 0===(v=n[t+o])&&void 0===(v=n[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(n.cancelAnimationFrame=v)}}).call(n,e(3))},function(t,n,e){"use strict";(function(t){function n(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0;void 0===e.Map&&(e.Map=function t(){n(this,t);var e={};return this.set=function(t,n){return e[t]=n,this},this.get=function(t){return e[t]},this.has=function(t){return void 0!==this.get(t)},this})}).call(n,e(3))},function(t,n,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.Interpolation=n.Easing=n.Tween=n.now=n.autoPlay=n.update=n.remove=n.removeAll=n.add=n.getAll=void 0,e(5),e(6),e(7);var r=e(2),o=e(0),u=i(o),a=e(4),s=i(a),c=e(1),f=i(c);n.getAll=r.getAll,n.add=r.add,n.removeAll=r.removeAll,n.remove=r.remove,n.update=r.update,n.autoPlay=r.autoPlay,n.now=r.now,n.Tween=s.default,n.Easing=u.default,n.Interpolation=f.default}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.TWEEN=n():t.TWEEN=n()}(this,function(){return function(t){function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=t,n.c=e,n.i=function(t){return t},n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=8)}([function(t,n,e){"use strict";Object.defineProperty(n,"__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 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?.5*(t*t*((n+1)*t-n)):.5*((t-=2)*t*((n+1)*t+n)+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}}};n.default=i},function(t,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i={Linear:function(t,n){var e=t.length-1,r=e*n,o=Math.floor(r),u=i.Utils.Linear;return n<0?u(t[0],t[1],r):n>1?u(t[e],t[e-1],e-r):u(t[o],t[o+1>e?e:o+1],r-o)},Bezier:function(t,n){for(var e=0,r=t.length-1,o=Math.pow,u=i.Utils.Bernstein,a=0;a<=r;a++)e+=o(1-n,r-a)*o(n,a)*t[a]*u(r,a);return e},CatmullRom:function(t,n){var e=t.length-1,r=e*n,o=Math.floor(r),u=i.Utils.CatmullRom;return t[0]===t[e]?(n<0&&(o=Math.floor(r=e*(1+n))),u(t[(o-1+e)%e],t[o],t[(o+1)%e],t[(o+2)%e],r-o)):n<0?t[0]-(u(t[0],t[0],t[1],t[1],-r)-t[0]):n>1?t[e]-(u(t[e],t[e],t[e-1],t[e-1],r-e)-t[e]):u(t[o?o-1:0],t[o],t[e<o+1?e:o+1],t[e<o+2?e:o+2],r-o)},Utils:{Linear:function(t,n,e){return(n-t)*e+t},Bernstein:function(t,n){var e=i.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,s=r*a;return(2*n-2*e+o+u)*s+(-3*n+3*e-2*o-u)*a+o*r+n}}};n.default=i},function(t,n,e){"use strict";function i(t){p(o)?(o=t,s=requestAnimationFrame(i)):(u=!1,cancelAnimationFrame(s))}Object.defineProperty(n,"__esModule",{value:!0});var r=[],o=0,u=!1,a=!1,s=void 0,c=function(){return r},f=function(t){a=t},l=function(){r=[]},h=function(t){r.push(t),a&&!u&&(i(v()),u=!0)},d=function(t){r.filter(function(n){return n!==t})},v=function(){return o},p=function(t,n){if(t=void 0!==t?t:v(),o=t,0===r.length)return!1;for(var e=0;e<r.length;)r[e].update(t)||n?e++:r.splice(e,1);return!0};n.getAll=c,n.removeAll=l,n.remove=d,n.add=h,n.now=v,n.update=p,n.autoPlay=f},function(t,n,e){"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,n,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}function r(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var o=function(){function t(t,n){for(var e=0;e<n.length;e++){var i=n[e];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(n,e,i){return e&&t(n.prototype,e),i&&t(n,i),n}}(),u=(e(2),e(0)),a=i(u),s=e(1),c=i(s),f=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,t),this.object=n,this._valuesStart=Object.assign({},n),this._valuesStartRepeat=Object.assign({},n),this._valuesEnd={},this._chainedTweens=[],this._duration=1e3,this._easingFunction=a.default.Linear.None,this._interpolationFunction=c.default.None,this._startTime=null,this._delayTime=0,this._repeat=0,this._repeatDelayTime=0,this._isPlaying=!1,this._yoyo=!1,this._reversed=!1,this._onStartCallbackFired=!1,this._events=new Map,this._pausedTime=0,this}return o(t,[{key:"emit",value:function(t,n,e,i,r){return void 0!==t&&"function"==typeof n?this._events.set(t,n):"function"!=typeof n&&void 0!==this._events.get(t)&&this._events.get(t).call(this,n,e,i,r),this}},{key:"pause",value:function(){return this._isPlaying?(this._isPlaying=!1,TWEEN.remove(this),this._pausedTime=TWEEN.now(),this.emit("pause",this.object)):this}},{key:"play",value:function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=TWEEN.now()-this._pausedTime,TWEEN.add(this),this._pausedTime=TWEEN.now(),this.emit("play",this.object))}},{key:"duration",value:function(t){return this._duration=t,this}},{key:"to",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return this._valuesEnd=t,this._duration=n,this}},{key:"start",value:function(t){var n=this._startTime,e=this._delayTime;return n=void 0!==t?t:TWEEN.now(),n+=e,this._startTime=n,TWEEN.add(this),this._isPlaying=!0,this}},{key:"stop",value:function(){var t=this._isPlaying,n=(this._onStopCallback,this.object);return t?(TWEEN.remove(this),this._isPlaying=!1,this.stopChainedTweens(),this.emit("stop",n)):this}},{key:"end",value:function(){var t=this._startTime,n=this._duration;return this.update(t+n)}},{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=t,this}},{key:"repeat",value:function(t){return this._repeat=t,this}},{key:"repeatDelay",value:function(t){return this._repeatDelayTime=t,this}},{key:"yoyo",value:function(t){return 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,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];return this._chainedTweens=n,this}},{key:"update",value:function(t){var n=(this._onUpdateCallback,this._onStartCallback,this._onStartCallbackFired),e=(this._onCompleteCallback,this._chainedTweens),i=this._easingFunction,r=this._interpolationFunction,o=this._repeat,u=this._repeatDelayTime,a=this._delayTime,s=this._yoyo,c=this._reversed,f=this._startTime,l=this._duration,h=this._valuesStart,d=this._valuesStartRepeat,v=this._valuesEnd,p=this.object,y=void 0,_=void 0,m=void 0;if(t<f)return!0;n===!1&&(this.emit("start",p),this._onStartCallbackFired=!0),_=(t-f)/l,_=_>1?1:_,m=i(_);for(y in v){var w=h[y],b=v[y];b instanceof Array?p[y]=r(b,m):("string"==typeof b&&(b="+"===b.charAt(0)||"-"===b.charAt(0)?w+parseFloat(b):parseFloat(b)),"number"==typeof b&&(p[y]=w+(b-w)*m))}if(this.emit("update",p,_),1===_){if(o>0){isFinite(o)&&o--;for(y in d){if("string"==typeof v[y]&&(d[y]=d[y]+parseFloat(v[y])),s){var g=d[y];d[y]=v[y],v[y]=g}h[y]=d[y]}return this.emit("repeat",p,c),s&&(this._reversed=!c),u?this._startTime=t+u:this._startTime=t+a,!0}return this.emit("complete",p),e.map(function(t){return t.start(f+l)}),!1}return!0}}]),t}();n.default=f},function(t,n,e){"use strict";void 0===Object.assign&&(Object.assign=function(){for(var t=arguments.length,n=Array(t),e=0;e<t;e++)n[e]=arguments[e];var i=n.shift();return n.map(function(t){for(var n in t)i[n]=t[n]}),i})},function(t,n,e){"use strict";(function(t){var n="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0,e=["webkit","moz","ms","o"],i="AnimationFrame",r="Request"+i,o="Cancel"+i,u="CancelRequest"+i,a=setTimeout,s=clearTimeout;if(void 0===n.requestAnimationFrame){var c=void 0,f=void 0,l=Date.now(),h=50/3,d=h;e.map(function(t){void 0===(c=n[t+r])&&(c=function(t){return a(function(){f=Date.now(),t(f-l),d=h+(Date.now()-f)},d)})}),void 0!==c&&(n.requestAnimationFrame=c)}if(void 0===n.cancelAnimationFrame){var v=void 0;e.map(function(t){void 0===(v=n[t+o])&&void 0===(v=n[t+u])&&(v=function(t){return s(t)})}),void 0!==v&&(n.cancelAnimationFrame=v)}}).call(n,e(3))},function(t,n,e){"use strict";(function(t){function n(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}var e="undefined"!=typeof window?window:"undefined"!=typeof t?t:void 0;void 0===e.Map&&(e.Map=function t(){n(this,t);var e={};return this.set=function(t,n){return e[t]=n,this},this.get=function(t){return e[t]},this.has=function(t){return void 0!==this.get(t)},this})}).call(n,e(3))},function(t,n,e){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(n,"__esModule",{value:!0}),n.Interpolation=n.Easing=n.Tween=n.now=n.autoPlay=n.update=n.remove=n.removeAll=n.add=n.getAll=void 0,e(5),e(6),e(7);var r=e(2),o=e(0),u=i(o),a=e(4),s=i(a),c=e(1),f=i(c);n.getAll=r.getAll,n.add=r.add,n.removeAll=r.removeAll,n.remove=r.remove,n.update=r.update,n.autoPlay=r.autoPlay,n.now=r.now,n.Tween=s.default,n.Easing=u.default,n.Interpolation=f.default}])});
{
"name": "es6-tween",
"version": "0.1.05",
"version": "0.1.06",
"description": "ES6 implementation of amazing tween.js",

@@ -5,0 +5,0 @@ "main": "dist/Tween.js",

@@ -15,4 +15,4 @@ import { add, remove, now } from './core';

this._duration = 1000;
this._easingFunction = TWEEN.Easing.Linear.None;
this._interpolationFunction = TWEEN.Interpolation.None;
this._easingFunction = Easing.Linear.None;
this._interpolationFunction = Interpolation.None;

@@ -19,0 +19,0 @@ this._startTime = null;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc