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 3.5.6 to 3.5.7

2

dist/Tween.js

@@ -1135,3 +1135,3 @@ (function (global, factory) {

for (property in _valuesEnd) {
value = _easingFunction[property] ? _easingFunction[property](elapsed) : typeof _easingFunction === 'function' ? _easingFunction(elapsed) : defaultEasing;
value = _easingFunction[property] ? _easingFunction[property](elapsed) : typeof _easingFunction === 'function' ? _easingFunction(elapsed) : defaultEasing(elapsed);

@@ -1138,0 +1138,0 @@ var start = _valuesStart[property];

@@ -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="undefined"!=typeof window?window:"undefined"!=typeof global?global:this;Object.assign||(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}),Object.create||(Object.create=function(t){return Object.assign({},t||{})}),Array.isArray||(Array.isArray=function(t){return t&&t.push&&t.splice}),"undefined"==typeof requestAnimationFrame&&(e.requestAnimationFrame=function(t){return e.setTimeout(t,16)}),"undefined"==typeof cancelAnimationFrame&&(e.cancelAnimationFrame=function(t){return e.clearTimeout(t)});var n,r=[],i=!1,o=!1,s=e.requestAnimationFrame,a=e.cancelAnimationFrame,u=function(t){r.push(t),o&&!i&&(n=s(c),i=!0)},f=function(t){for(var e=0;e<r.length;e++)if(t===r[e])return r[e];return null},p=function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,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}}(),c=function(t,e){if(t=void 0!==t?t:h(),n=s(c),0===r.length)return a(n),i=!1,!1;for(var o=0;o<r.length;)r[o].update(t,e),o++;return!0},l={};if(e.document&&e.document.addEventListener){var d=0,v=0;e.document.addEventListener("visibilitychange",function(){if(document.hidden)v=h(),a(n),i=!1;else{d=h()-v;for(var t=0,e=r.length;t<e;t++)r[t]._startTime+=d;n=s(c),i=!0}return!0})}var y={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-y.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*y.Bounce.In(2*t):.5*y.Bounce.Out(2*t-1)+.5}}},_="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m=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:_,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&_,r=o>>8&_,i=o&_,"rgb("+n+","+r+","+i+")"}function n(t){return"string"==typeof t?t.replace(y,""):t}function r(t,e){if("number"==typeof e)return e;var n=g[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){return b(e).match(d).map(t)}function o(t,e,n){if(n=void 0!==n?n:1e4,!d.test(e))return e;var o=i(t),s=i(e),a=f(o,s,n);if(a)return a;a=null;for(var u=null,p=null,h=[],v=0,y=s.length;v<y;v++){var _=s[v],m=o[v];h[v]="string"==typeof _&&1===_.indexOf("=")?e:null,l.test(_)?(u=v+2,p=v+11):c.test(_)&&(u=v,p=v+9),s[v]=m===_?null:null!==h[v]?r(m,_):"number"==typeof _?_-m:_}return function(t){for(var e="",i=0,a=s.length;i<a;i++){var f=o[i],c=s[i],l=h[i];e+="number"==typeof c?null!==u&&i>u&&i<p?f+c*t|0:((f+c*t)*n|0)/n:f,1===t&&null!==l&&(o[i]+=c,s[i]=r(o[i],l))}return e}}function s(t,e){for(var n=[],r=0,i=t.length;r<i;r++){var s=t[r];n[r]=m(s)?u(s,e):"object"==typeof s?p(s,e):"string"==typeof s?o(s,e):s}return function(e){for(var r=0,i=n.length;r<i;r++)t[r]=n[r](e);return t}}function a(t,e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];n[r]=h(0===r?t:e[r-1],o)}var s=e[e.length-1];n.push(h(s,s));var a=n.length-1;return function(t){var e=t*a,r=Math.floor(e),i=e-r;return(0,n[r])(i)}}function u(t,e,n){n=void 0!==n?n:1e4;for(var i=t.slice(),f=[],h=Math.min(t.length,e.length),c=0;c<h;c++){var l=i[c],d=e[c];f[c]="string"==typeof d&&1===d.indexOf("=")?d:null,i[c]=d.nodeType?d:d.update?d:l===d?null:m(d)?m(l)&&d.length===l.length?u(l,d,n):a(l,d):m(l)?s(l,d):"object"==typeof l?p(l,d,n):"string"==typeof l?o(l,d,n):void 0!==l?l:d,e[c]=null!==f[c]?r(l,d):d}return function(o){for(var s=0;s<h;s++){var a=i[s],u=e[s],p=f[s];null!==a&&void 0!==a&&(t[s]="number"==typeof a?((a+(u-a)*o)*n|0)/n:"function"==typeof a?a(o):a.update?a.update(o):u&&u.update?u.update(o):u,p&&1===o&&(i[s]=u,e[s]=r(i[s],p)))}return t}}function f(t,e,n){if(n=void 0!==n?n:1e4,2===e.length&&2===t.length&&-1!==T.indexOf(e[1])){var i=+t[0],o=+e[0],s=e[1],a="string"==typeof e[0]&&1===e[0].indexOf("=")?e[0]:null;return a&&(o=r(i,o)),function(t){var e=((i+(o-i)*t)*n|0)/n+s;return a&&1===t&&(o=r(i=o,a)),e}}return!1}function p(t,e,n){n=void 0!==n?n:1e4;var i={},f={};for(var h in t){f[h]=t[h];var c=f[h],l=e[h];i[h]="string"==typeof l&&1===l.indexOf("=")?l:null,void 0!==l&&(f[h]=l.nodeType||l.update?l:c===l?null:m(l)?m(c)&&l.length===c.length?u(c,l,n):a(c,l):m(c)?s(c,l):"object"==typeof c?p(c,l,n):"string"==typeof c?o(c,l,n):void 0!==c?c:l,e[h]=null!==i[h]?r(c,l):l)}return function(o){for(var s in e){var a=f[s],u=e[s],p=i[s];null!==a&&void 0!==a&&(t[s]="number"==typeof a?((a+(u-a)*o)*n|0)/n:"function"==typeof a?a(o):a.update?a.update(o):u.update?u.update(o):u,p&&1===o&&(f[s]=u,e[s]=r(f[s],p)))}return t}}function h(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:m(e)?m(t)&&t.length===e.length?u(t,e,n):a(t,e):m(t)?s(t,e):"object"==typeof e?p(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 c=/rgb/g,l=/argb/g,d=/\s+|([A-Za-z?().,{}:""[\]#]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,v=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,y=/\n|\r|\t/g,_=255,m=Array.isArray,g={"+=":1,"-=":1,"*=":2,"/=":3,"%=":4},b=function(t){return"string"!=typeof t?t:n(t).replace(v,e)},T=["px","pt","pc","deg","rad","turn","em","ex","cm","mm","dm","inch","in","rem","vw","vh","vmin","vmax","%"];return h})}),g={},b=function(t,e){if(!t||!t.nodeType)return e;var n=t.queueID||"queue_"+Math.round(1e3*Math.random()+Date.now());return t.queueID||(t.queueID=n),g[n]?(e&&(g[n]=Object.assign(g[n],e)),g[n]):(g[n]=e,g[n])},T=function(){this._events={}};T.prototype.on=function(t,e){return this._events[t]||(this._events[t]=[]),this._events[t].push(e),this},T.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},T.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},T.prototype.emit=function(t,e,n,r,i){var o=this._events[t];if(!o||!o.length)return this;for(var s=0,a=o.length;s<a;s++)o[s](e,n,r,i)};var O=0,w=y.Linear.None,M=function(t){function e(e,n){t.call(this),this.id=O++,void 0===e||n||e.nodeType?void 0!==e&&(this.node=e,"object"==typeof n?n=this.object=b(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._duration=1e3,this._easingFunction=w,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}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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,p(this),this._pausedTime=h(),this.emit("pause",this.object)):this},e.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=h()-this._pausedTime,u(this),this._pausedTime=h(),this.emit("play",this.object))},e.prototype.restart=function(t){return this._repeat=this._r,this._startTime=h()+(t?0:this._delayTime),this._isPlaying||u(this),this.emit("restart",this._object)},e.prototype.seek=function(t,e){return this._startTime=h()+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)n[r]&&(i=n)[r].apply(i,Array.isArray(e)?e:[e]);return this;var i},e.prototype.render=function(){var t=this;if(this._rendered)return this;var e=this,n=e._valuesEnd,r=e._valuesStart,i=e.object,o=e.Renderer;for(var s in n){var a=i[s],u=n[s];l[s]?n[s]=new l[s](t,a,u):void 0!==i[s]&&("number"==typeof a&&"number"==typeof u?(r[s]=a,n[s]=u):n[s]=m(a,u))}return o&&this.node&&(this.__render=new o(this,i,n)),this},e.prototype.start=function(t){return this._startTime=void 0!==t?t:h(),this._startTime+=this._delayTime,u(this),this._isPlaying=!0,this},e.prototype.stop=function(){var t=this,e=t._isPlaying,n=t.object;return e?(p(this),this._isPlaying=!1,this.emit("stop",n)):this},e.prototype.end=function(){var t=this,e=t._startTime,n=t._duration;return this.update(e+n)},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],a=n[o];r[o]="function"==typeof a?a(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,a=o._easingFunction,u=o._repeat,f=o._repeatDelayTime,c=o._reverseDelayTime,l=o._yoyo,d=o._reversed,v=o._startTime,y=o._duration,_=o._valuesStart,m=o._valuesEnd,g=o.object,b=o._isFinite,T=o.__render;if((t=void 0!==t?t:h())<v)return!0;s||(this._rendered||(this.render(),this._rendered=!0),this.emit("start",g),this._onStartCallbackFired=!0),n=(n=(t-v)/y)>1?1:n,n=d?1-n:n;for(i in m){r=a[i]?a[i](n):"function"==typeof a?a(n):w;var O=_[i],M=m[i];M.update?M.update(r,n):"number"==typeof M?g[i]=O+(M-O)*r:"function"==typeof M&&(g[i]=M(r))}return T&&T.update(g,n),this.emit("update",g,n),!(1===n||d&&0===n)||(u?(b&&this._repeat--,l&&(this._reversed=!d),this.emit(l&&!d?"reverse":"repeat",g),this._startTime=!d&&f?t+f:d&&c?t+c:t,!0):(e||p(this),this.emit("complete",g),this._repeat=this._r,!1))},e}(T),I=function(){this.totalTime=0,this.labels=[],this.offsets=[]};I.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),a=t.split(s);e=2===a.length?s+a[1]:null,t=a[0],o=i.indexOf(t)}if(-1!==o&&t){var u=r[o]||0;if("number"==typeof e)u=e;else if("string"==typeof e&&-1!==e.indexOf("=")){var f=e.charAt(0);e=Number(e.substr(2)),"+"===f||"-"===f?u+=parseFloat(f+e):"*"===f?u*=e:"/"===f?u/=e:"%"===f&&(u*=e/100)}return u}return"number"==typeof e?e:0},I.prototype.addLabel=function(t,e){return this.labels.push(t),this.offsets.push(this.parseLabel(t,e)),this},I.prototype.setLabel=function(t,e){var n=this.labels.indexOf(t);return-1!==n&&this.offsets.splice(n,1,this.parseLabel(t,e)),this},I.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 x=0,j=function(t){function e(e){return t.call(this),this._totalDuration=0,this._startTime=h(),this._tweens={},this._elapsed=0,this._id=x++,this._defaultParams=e,this.position=new I,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.addLabel=function(t,e){return this.position.addLabel(t,e),this},e.prototype.map=function(t){var e=this;for(var n in e._tweens){var r=e._tweens[n];t(r,+n),e._totalDuration=Math.max(e._totalDuration,r._duration+r._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 a in o)e[a](o[a]);var u="number"==typeof n?n:this.position.parseLabel(void 0!==n?n:"afterLast",null);return e._startTime=this._startTime,e._startTime+=u,this._totalDuration=Math.max(s,e._startTime+e._delayTime+e._duration),this._tweens[e.id]=e,this.position.setLabel("afterLast",this._totalDuration),this},e.prototype.restart=function(){return this._startTime+=h(),u(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.reverse=function(){return this._reversed=!this._reversed,this.emit("reverse")},e.prototype.update=function(t){var e=this,n=e._tweens,r=e._totalDuration,i=e._repeatDelayTime,o=e._reverseDelayTime,s=e._startTime,a=e._reversed,u=e._yoyo,f=e._repeat,p=e._isFinite;if(t<s)return!0;var h=Math.min(1,Math.max(0,(t-s)/r));h=a?1-h:h,this._elapsed=h;var c=t-s,l=a?r-c:c;for(var d in n){var v=n[d];if(v.skip)v.skip=!1;else{if(v.update(l))continue;v.skip=!0}}if(this.emit("update",h,c),1===h||a&&0===h){if(f){p&&this._repeat--,this.emit(a?"reverse":"repeat"),u&&this.reverse(),this._startTime+=!a&&i?r+i:a&&o?r+o:r;for(var y in n){var _=n[y];_.skip&&(_.skip=!1),_.reassignValues()}return!0}this.emit("complete"),this._repeat=this._r;for(var m in n){var g=n[m];g.skip&&(g.skip=!1)}return!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}(M);t.Plugins=l,t.Interpolator=m,t.has=function(t){return null!==f(t)},t.get=f,t.getAll=function(){return r},t.removeAll=function(){r.length=0},t.remove=p,t.add=u,t.now=h,t.update=c,t.autoPlay=function(t){o=t},t.isRunning=function(){return i},t.Tween=M,t.Easing=y,t.Timeline=j,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=t.TWEEN||{})}(this,function(t){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:this;Object.assign||(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}),Object.create||(Object.create=function(t){return Object.assign({},t||{})}),Array.isArray||(Array.isArray=function(t){return t&&t.push&&t.splice}),"undefined"==typeof requestAnimationFrame&&(e.requestAnimationFrame=function(t){return e.setTimeout(t,16)}),"undefined"==typeof cancelAnimationFrame&&(e.cancelAnimationFrame=function(t){return e.clearTimeout(t)});var n,r=[],i=!1,o=!1,s=e.requestAnimationFrame,a=e.cancelAnimationFrame,u=function(t){r.push(t),o&&!i&&(n=s(c),i=!0)},f=function(t){for(var e=0;e<r.length;e++)if(t===r[e])return r[e];return null},p=function(t){var e=r.indexOf(t);-1!==e&&r.splice(e,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}}(),c=function(t,e){if(t=void 0!==t?t:h(),n=s(c),0===r.length)return a(n),i=!1,!1;for(var o=0;o<r.length;)r[o].update(t,e),o++;return!0},l={};if(e.document&&e.document.addEventListener){var d=0,v=0;e.document.addEventListener("visibilitychange",function(){if(document.hidden)v=h(),a(n),i=!1;else{d=h()-v;for(var t=0,e=r.length;t<e;t++)r[t]._startTime+=d;n=s(c),i=!0}return!0})}var y={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-y.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*y.Bounce.In(2*t):.5*y.Bounce.Out(2*t-1)+.5}}},_="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},m=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:_,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&_,r=o>>8&_,i=o&_,"rgb("+n+","+r+","+i+")"}function n(t){return"string"==typeof t?t.replace(y,""):t}function r(t,e){if("number"==typeof e)return e;var n=g[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){return b(e).match(d).map(t)}function o(t,e,n){if(n=void 0!==n?n:1e4,!d.test(e))return e;var o=i(t),s=i(e),a=f(o,s,n);if(a)return a;a=null;for(var u=null,p=null,h=[],v=0,y=s.length;v<y;v++){var _=s[v],m=o[v];h[v]="string"==typeof _&&1===_.indexOf("=")?e:null,l.test(_)?(u=v+2,p=v+11):c.test(_)&&(u=v,p=v+9),s[v]=m===_?null:null!==h[v]?r(m,_):"number"==typeof _?_-m:_}return function(t){for(var e="",i=0,a=s.length;i<a;i++){var f=o[i],c=s[i],l=h[i];e+="number"==typeof c?null!==u&&i>u&&i<p?f+c*t|0:((f+c*t)*n|0)/n:f,1===t&&null!==l&&(o[i]+=c,s[i]=r(o[i],l))}return e}}function s(t,e){for(var n=[],r=0,i=t.length;r<i;r++){var s=t[r];n[r]=m(s)?u(s,e):"object"==typeof s?p(s,e):"string"==typeof s?o(s,e):s}return function(e){for(var r=0,i=n.length;r<i;r++)t[r]=n[r](e);return t}}function a(t,e){for(var n=[],r=0,i=e.length;r<i;r++){var o=e[r];n[r]=h(0===r?t:e[r-1],o)}var s=e[e.length-1];n.push(h(s,s));var a=n.length-1;return function(t){var e=t*a,r=Math.floor(e),i=e-r;return(0,n[r])(i)}}function u(t,e,n){n=void 0!==n?n:1e4;for(var i=t.slice(),f=[],h=Math.min(t.length,e.length),c=0;c<h;c++){var l=i[c],d=e[c];f[c]="string"==typeof d&&1===d.indexOf("=")?d:null,i[c]=d.nodeType?d:d.update?d:l===d?null:m(d)?m(l)&&d.length===l.length?u(l,d,n):a(l,d):m(l)?s(l,d):"object"==typeof l?p(l,d,n):"string"==typeof l?o(l,d,n):void 0!==l?l:d,e[c]=null!==f[c]?r(l,d):d}return function(o){for(var s=0;s<h;s++){var a=i[s],u=e[s],p=f[s];null!==a&&void 0!==a&&(t[s]="number"==typeof a?((a+(u-a)*o)*n|0)/n:"function"==typeof a?a(o):a.update?a.update(o):u&&u.update?u.update(o):u,p&&1===o&&(i[s]=u,e[s]=r(i[s],p)))}return t}}function f(t,e,n){if(n=void 0!==n?n:1e4,2===e.length&&2===t.length&&-1!==T.indexOf(e[1])){var i=+t[0],o=+e[0],s=e[1],a="string"==typeof e[0]&&1===e[0].indexOf("=")?e[0]:null;return a&&(o=r(i,o)),function(t){var e=((i+(o-i)*t)*n|0)/n+s;return a&&1===t&&(o=r(i=o,a)),e}}return!1}function p(t,e,n){n=void 0!==n?n:1e4;var i={},f={};for(var h in t){f[h]=t[h];var c=f[h],l=e[h];i[h]="string"==typeof l&&1===l.indexOf("=")?l:null,void 0!==l&&(f[h]=l.nodeType||l.update?l:c===l?null:m(l)?m(c)&&l.length===c.length?u(c,l,n):a(c,l):m(c)?s(c,l):"object"==typeof c?p(c,l,n):"string"==typeof c?o(c,l,n):void 0!==c?c:l,e[h]=null!==i[h]?r(c,l):l)}return function(o){for(var s in e){var a=f[s],u=e[s],p=i[s];null!==a&&void 0!==a&&(t[s]="number"==typeof a?((a+(u-a)*o)*n|0)/n:"function"==typeof a?a(o):a.update?a.update(o):u.update?u.update(o):u,p&&1===o&&(f[s]=u,e[s]=r(f[s],p)))}return t}}function h(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:m(e)?m(t)&&t.length===e.length?u(t,e,n):a(t,e):m(t)?s(t,e):"object"==typeof e?p(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 c=/rgb/g,l=/argb/g,d=/\s+|([A-Za-z?().,{}:""[\]#]+)|([-+/*%]+=)?([-+*/%]+)?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,v=/^#([0-9a-f]{6}|[0-9a-f]{3})$/i,y=/\n|\r|\t/g,_=255,m=Array.isArray,g={"+=":1,"-=":1,"*=":2,"/=":3,"%=":4},b=function(t){return"string"!=typeof t?t:n(t).replace(v,e)},T=["px","pt","pc","deg","rad","turn","em","ex","cm","mm","dm","inch","in","rem","vw","vh","vmin","vmax","%"];return h})}),g={},b=function(t,e){if(!t||!t.nodeType)return e;var n=t.queueID||"queue_"+Math.round(1e3*Math.random()+Date.now());return t.queueID||(t.queueID=n),g[n]?(e&&(g[n]=Object.assign(g[n],e)),g[n]):(g[n]=e,g[n])},T=function(){this._events={}};T.prototype.on=function(t,e){return this._events[t]||(this._events[t]=[]),this._events[t].push(e),this},T.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},T.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},T.prototype.emit=function(t,e,n,r,i){var o=this._events[t];if(!o||!o.length)return this;for(var s=0,a=o.length;s<a;s++)o[s](e,n,r,i)};var O=0,w=y.Linear.None,M=function(t){function e(e,n){t.call(this),this.id=O++,void 0===e||n||e.nodeType?void 0!==e&&(this.node=e,"object"==typeof n?n=this.object=b(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._duration=1e3,this._easingFunction=w,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}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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,p(this),this._pausedTime=h(),this.emit("pause",this.object)):this},e.prototype.play=function(){return this._isPlaying?this:(this._isPlaying=!0,this._startTime+=h()-this._pausedTime,u(this),this._pausedTime=h(),this.emit("play",this.object))},e.prototype.restart=function(t){return this._repeat=this._r,this._startTime=h()+(t?0:this._delayTime),this._isPlaying||u(this),this.emit("restart",this._object)},e.prototype.seek=function(t,e){return this._startTime=h()+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)n[r]&&(i=n)[r].apply(i,Array.isArray(e)?e:[e]);return this;var i},e.prototype.render=function(){var t=this;if(this._rendered)return this;var e=this,n=e._valuesEnd,r=e._valuesStart,i=e.object,o=e.Renderer;for(var s in n){var a=i[s],u=n[s];l[s]?n[s]=new l[s](t,a,u):void 0!==i[s]&&("number"==typeof a&&"number"==typeof u?(r[s]=a,n[s]=u):n[s]=m(a,u))}return o&&this.node&&(this.__render=new o(this,i,n)),this},e.prototype.start=function(t){return this._startTime=void 0!==t?t:h(),this._startTime+=this._delayTime,u(this),this._isPlaying=!0,this},e.prototype.stop=function(){var t=this,e=t._isPlaying,n=t.object;return e?(p(this),this._isPlaying=!1,this.emit("stop",n)):this},e.prototype.end=function(){var t=this,e=t._startTime,n=t._duration;return this.update(e+n)},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],a=n[o];r[o]="function"==typeof a?a(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,a=o._easingFunction,u=o._repeat,f=o._repeatDelayTime,c=o._reverseDelayTime,l=o._yoyo,d=o._reversed,v=o._startTime,y=o._duration,_=o._valuesStart,m=o._valuesEnd,g=o.object,b=o._isFinite,T=o.__render;if((t=void 0!==t?t:h())<v)return!0;s||(this._rendered||(this.render(),this._rendered=!0),this.emit("start",g),this._onStartCallbackFired=!0),n=(n=(t-v)/y)>1?1:n,n=d?1-n:n;for(i in m){r=a[i]?a[i](n):"function"==typeof a?a(n):w(n);var O=_[i],M=m[i];M.update?M.update(r,n):"number"==typeof M?g[i]=O+(M-O)*r:"function"==typeof M&&(g[i]=M(r))}return T&&T.update(g,n),this.emit("update",g,n),!(1===n||d&&0===n)||(u?(b&&this._repeat--,l&&(this._reversed=!d),this.emit(l&&!d?"reverse":"repeat",g),this._startTime=!d&&f?t+f:d&&c?t+c:t,!0):(e||p(this),this.emit("complete",g),this._repeat=this._r,!1))},e}(T),I=function(){this.totalTime=0,this.labels=[],this.offsets=[]};I.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),a=t.split(s);e=2===a.length?s+a[1]:null,t=a[0],o=i.indexOf(t)}if(-1!==o&&t){var u=r[o]||0;if("number"==typeof e)u=e;else if("string"==typeof e&&-1!==e.indexOf("=")){var f=e.charAt(0);e=Number(e.substr(2)),"+"===f||"-"===f?u+=parseFloat(f+e):"*"===f?u*=e:"/"===f?u/=e:"%"===f&&(u*=e/100)}return u}return"number"==typeof e?e:0},I.prototype.addLabel=function(t,e){return this.labels.push(t),this.offsets.push(this.parseLabel(t,e)),this},I.prototype.setLabel=function(t,e){var n=this.labels.indexOf(t);return-1!==n&&this.offsets.splice(n,1,this.parseLabel(t,e)),this},I.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 x=0,j=function(t){function e(e){return t.call(this),this._totalDuration=0,this._startTime=h(),this._tweens={},this._elapsed=0,this._id=x++,this._defaultParams=e,this.position=new I,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.addLabel=function(t,e){return this.position.addLabel(t,e),this},e.prototype.map=function(t){var e=this;for(var n in e._tweens){var r=e._tweens[n];t(r,+n),e._totalDuration=Math.max(e._totalDuration,r._duration+r._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 a in o)e[a](o[a]);var u="number"==typeof n?n:this.position.parseLabel(void 0!==n?n:"afterLast",null);return e._startTime=this._startTime,e._startTime+=u,this._totalDuration=Math.max(s,e._startTime+e._delayTime+e._duration),this._tweens[e.id]=e,this.position.setLabel("afterLast",this._totalDuration),this},e.prototype.restart=function(){return this._startTime+=h(),u(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.reverse=function(){return this._reversed=!this._reversed,this.emit("reverse")},e.prototype.update=function(t){var e=this,n=e._tweens,r=e._totalDuration,i=e._repeatDelayTime,o=e._reverseDelayTime,s=e._startTime,a=e._reversed,u=e._yoyo,f=e._repeat,p=e._isFinite;if(t<s)return!0;var h=Math.min(1,Math.max(0,(t-s)/r));h=a?1-h:h,this._elapsed=h;var c=t-s,l=a?r-c:c;for(var d in n){var v=n[d];if(v.skip)v.skip=!1;else{if(v.update(l))continue;v.skip=!0}}if(this.emit("update",h,c),1===h||a&&0===h){if(f){p&&this._repeat--,this.emit(a?"reverse":"repeat"),u&&this.reverse(),this._startTime+=!a&&i?r+i:a&&o?r+o:r;for(var y in n){var _=n[y];_.skip&&(_.skip=!1),_.reassignValues()}return!0}this.emit("complete"),this._repeat=this._r;for(var m in n){var g=n[m];g.skip&&(g.skip=!1)}return!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}(M);t.Plugins=l,t.Interpolator=m,t.has=function(t){return null!==f(t)},t.get=f,t.getAll=function(){return r},t.removeAll=function(){r.length=0},t.remove=p,t.add=u,t.now=h,t.update=c,t.autoPlay=function(t){o=t},t.isRunning=function(){return i},t.Tween=M,t.Easing=y,t.Timeline=j,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=dist/Tween.min.js.map
//# sourceMappingURL=Tween.min.js.map
{
"name": "es6-tween",
"version": "3.5.6",
"version": "3.5.7",
"description": "ES6 implementation of amazing tween.js",

@@ -21,3 +21,3 @@ "browser": "dist/Tween.min.js",

"test": "npm run lint && ava --verbose",
"prepublishOnly": "npm run lint && npm run build && npm test"
"prepublishOnly": "npm run lint && npm run build && ava --verbose"
},

@@ -24,0 +24,0 @@ "repository": {

@@ -343,3 +343,3 @@ import {

for (property in _valuesEnd) {
value = _easingFunction[property] ? _easingFunction[property](elapsed) : typeof _easingFunction === 'function' ? _easingFunction(elapsed) : defaultEasing
value = _easingFunction[property] ? _easingFunction[property](elapsed) : typeof _easingFunction === 'function' ? _easingFunction(elapsed) : defaultEasing(elapsed)

@@ -346,0 +346,0 @@ let start = _valuesStart[property]

Sorry, the diff of this file is not supported yet

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