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

tina

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tina - npm Package Compare versions

Comparing version 0.3.20 to 0.3.21

14

build/tina.min.js

@@ -5,3 +5,3 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){

},{"./Transition":16,"./TransitionRelative":17,"./easing":20,"./interpolation":23}],2:[function(require,module,exports){
function BriefExtension(){this._duration=0,this._onComplete=null,this._iterations=1,this._pingpong=!1,this._persist=!1}module.exports=BriefExtension,BriefExtension.prototype.setSpeed=function(t){0===t?0!==this._speed&&(this._startTime+=this._time/this._speed-this._time):0===this._speed?this._startTime+=this._time-this._time/t:this._startTime+=this._time/this._speed-this._time/t,this._speed=t,null!==this._player&&this._player._onPlayableChanged(this)},BriefExtension.prototype.onComplete=function(t){return this._onComplete=t,this},BriefExtension.prototype.getDuration=function(){return this._duration*this._iterations/this._speed},BriefExtension.prototype._setDuration=function(t){this._duration=t,null!==this._player&&this._player._onPlayableChanged(this)},BriefExtension.prototype._extendDuration=function(t){this._duration+=t,null!==this._player&&this._player._onPlayableChanged(this)},BriefExtension.prototype._getEndTime=function(){return this._speed>0?this._startTime+this.getDuration():this._speed<0?this._startTime:1/0},BriefExtension.prototype._setStartTime=function(t){this._speed>0?this._startTime=t:this._speed<0?this._startTime=t-this.getDuration():this._startTime=1/0},BriefExtension.prototype._getStartTime=function(){return this._speed>0?this._startTime:this._speed<0?this._startTime+this.getDuration():-(1/0)},BriefExtension.prototype._isTimeWithin=function(t){return this._speed>0?this._startTime<t&&t<this._startTime+this.getDuration():this._speed<0?this._startTime+this.getDuration()<t&&t<this._startTime:!0},BriefExtension.prototype._overlaps=function(t,i){return this._speed>0?(this._startTime-i)*(this._startTime+this.getDuration()-t)<=0:this._speed<0?(this._startTime+this.getDuration()-i)*(this._startTime-t)<=0:!0},BriefExtension.prototype.goToEnd=function(){return this.goTo(this.getDuration(),this._iterations-1)},BriefExtension.prototype.loop=function(){return this.iterations(1/0)},BriefExtension.prototype.iterations=function(t){return 0>t?(console.warn("[BriefExtension.iterations] Number of iterations cannot be negative"),this):(this._iterations=t,null!==this._player&&this._player._onPlayableChanged(this),this)},BriefExtension.prototype.persist=function(t){return this._persist=t,this},BriefExtension.prototype.pingpong=function(t){return this._pingpong=t,null!==this._player&&this._player._onPlayableChanged(this),this},BriefExtension.prototype._complete=function(t){return this._persist===!0?(this._startTime+=t,void this._player._onPlayableChanged(this)):this._player._inactivate(this)===!1?this:void(null!==this._onComplete&&this._onComplete(t))};var epsilon=1e-6;BriefExtension.prototype._moveTo=function(t,i,e){i*=this._speed;var s;if(0!==i)if(1===this._iterations)this._time=(t-this._startTime)*this._speed,i>0?this._time>=this._duration?(s=this._time-this._duration,this._time=this._duration):this._time<0:0>i&&this._time<=0&&(s=this._time,this._time=0);else{t=(t-this._startTime)*this._speed;var n=t/this._duration;i>0?n>0&&n<this._iterations?this._time=t%this._duration:(s=(n-this._iterations)*this._duration,this._time=this._duration*(1-(Math.ceil(this._iterations)-this._iterations))):0>i&&(n>0&&n<this._iterations?this._time=t%this._duration:(s=n*this._duration,this._time=0)),this._pingpong===!0&&(void 0===s?0===(1&Math.ceil(n))&&(this._time=this._duration-this._time):Math.ceil(this._iterations)===this._iterations&&0===(1&Math.ceil(this._iterations))&&(this._time=this._duration-this._time))}void 0!==e&&void 0===s&&(i>0&&this.duration-this._time<epsilon?(s=e,this._time=this._duration):0>i&&this._time<epsilon&&(s=e,this._time=0)),this._update(i,s),null!==this._onUpdate&&(void 0===s?this._onUpdate(this._time,i):this._onUpdate(this._time,i-s)),void 0!==s&&this._complete(s)};
function BriefExtension(){this._duration=0,this._onComplete=null,this._onceComplete=null,this._iterations=1,this._pingpong=!1,this._persist=!1}module.exports=BriefExtension,BriefExtension.prototype.setSpeed=function(t){0===t?0!==this._speed&&(this._startTime+=this._time/this._speed-this._time):0===this._speed?this._startTime+=this._time-this._time/t:this._startTime+=this._time/this._speed-this._time/t,this._speed=t,null!==this._player&&this._player._onPlayableChanged(this)},BriefExtension.prototype.onComplete=function(t){return this._onComplete=t,this},BriefExtension.prototype.onceComplete=function(t){return this._onceComplete=t,this},BriefExtension.prototype.getDuration=function(){return this._duration*this._iterations/this._speed},BriefExtension.prototype._setDuration=function(t){this._duration=t,null!==this._player&&this._player._onPlayableChanged(this)},BriefExtension.prototype._extendDuration=function(t){this._duration+=t,null!==this._player&&this._player._onPlayableChanged(this)},BriefExtension.prototype._getEndTime=function(){return this._speed>0?this._startTime+this.getDuration():this._speed<0?this._startTime:1/0},BriefExtension.prototype._setStartTime=function(t){this._speed>0?this._startTime=t:this._speed<0?this._startTime=t-this.getDuration():this._startTime=1/0},BriefExtension.prototype._getStartTime=function(){return this._speed>0?this._startTime:this._speed<0?this._startTime+this.getDuration():-(1/0)},BriefExtension.prototype._isTimeWithin=function(t){return this._speed>0?this._startTime<t&&t<this._startTime+this.getDuration():this._speed<0?this._startTime+this.getDuration()<t&&t<this._startTime:!0},BriefExtension.prototype._overlaps=function(t,i){return this._speed>0?(this._startTime-i)*(this._startTime+this.getDuration()-t)<=0:this._speed<0?(this._startTime+this.getDuration()-i)*(this._startTime-t)<=0:!0},BriefExtension.prototype.goToEnd=function(){return this._iterations===1/0?this.goTo(this._duration/this._speed,0):this.goTo(this.getDuration(),this._iterations-1)},BriefExtension.prototype.loop=function(){return this.iterations(1/0)},BriefExtension.prototype.iterations=function(t){return 0>t?(console.warn("[BriefExtension.iterations] Number of iterations cannot be negative"),this):(this._iterations=t,null!==this._player&&this._player._onPlayableChanged(this),this)},BriefExtension.prototype.persist=function(t){return this._persist=t,this},BriefExtension.prototype.pingpong=function(t){return this._pingpong=t,null!==this._player&&this._player._onPlayableChanged(this),this},BriefExtension.prototype._complete=function(t){if(this._persist===!0)return this._startTime+=t,void this._player._onPlayableChanged(this);if(this._player._inactivate(this)===!1)return this;if(null!==this._onComplete&&this._onComplete(t),null!==this._onceComplete){var i=this._onceComplete;this._onceComplete=null,i(t)}};var epsilon=1e-6;BriefExtension.prototype._moveTo=function(t,i,e){i*=this._speed;var s;if(0!==i)if(1===this._iterations)this._time=(t-this._startTime)*this._speed,i>0?this._time>=this._duration?(s=this._time-this._duration,this._time=this._duration):this._time<0:0>i&&this._time<=0&&(s=this._time,this._time=0);else{t=(t-this._startTime)*this._speed;var n=t/this._duration;i>0?n>0&&n<this._iterations?this._time=t%this._duration:(s=(n-this._iterations)*this._duration,this._time=this._duration*(1-(Math.ceil(this._iterations)-this._iterations))):0>i&&(n>0&&n<this._iterations?this._time=t%this._duration:(s=n*this._duration,this._time=0)),this._pingpong===!0&&(void 0===s?0===(1&Math.ceil(n))&&(this._time=this._duration-this._time):Math.ceil(this._iterations)===this._iterations&&0===(1&Math.ceil(this._iterations))&&(this._time=this._duration-this._time))}void 0!==e&&void 0===s&&(i>0&&this.duration-this._time<epsilon?(s=e,this._time=this._duration):0>i&&this._time<epsilon&&(s=e,this._time=0)),this._update(i,s),null!==this._onUpdate&&(void 0===s?this._onUpdate(this._time,i):this._onUpdate(this._time,i-s)),void 0!==s&&this._complete(s)};

@@ -15,3 +15,3 @@ },{}],3:[function(require,module,exports){

},{"./BriefExtension":2,"./Player":9,"./inherit":22}],5:[function(require,module,exports){
function Delay(e){return this instanceof Delay==!1?new Delay(e):(BriefPlayable.call(this),void(this._duration=e))}var BriefPlayable=require("./BriefPlayable");Delay.prototype=Object.create(BriefPlayable.prototype),Delay.prototype.constructor=Delay,module.exports=Delay;
function Delay(e,t){return this instanceof Delay==!1?new Delay(e):(BriefPlayable.call(this),void this.reset(e,t))}var BriefPlayable=require("./BriefPlayable");Delay.prototype=Object.create(BriefPlayable.prototype),Delay.prototype.constructor=Delay,module.exports=Delay,Delay.prototype.reset=function(e,t){return this._duration=e,void 0!==t&&this.onComplete(t),this};

@@ -25,6 +25,6 @@ },{"./BriefPlayable":3}],6:[function(require,module,exports){

},{"./AbstractTween":1,"./BriefPlayable":3}],8:[function(require,module,exports){
function Playable(){this._player=null,this._handle=null,this._startTime=0,this._time=0,this._speed=1,this._onStart=null,this._onPause=null,this._onResume=null,this._onUpdate=null,this._onStop=null}module.exports=Playable,Object.defineProperty(Playable.prototype,"speed",{get:function(){return this._speed},set:function(t){this.setSpeed(t)}}),Object.defineProperty(Playable.prototype,"time",{get:function(){return this._time},set:function(t){this.goTo(t)}}),Playable.prototype.onStart=function(t){return this._onStart=t,this},Playable.prototype.onUpdate=function(t){return this._onUpdate=t,this},Playable.prototype.onStop=function(t){return this._onStop=t,this},Playable.prototype.onPause=function(t){return this._onPause=t,this},Playable.prototype.onResume=function(t){return this._onResume=t,this},Playable.prototype.tweener=function(t){return null===t||void 0===t?(console.warn("[Playable.tweener] Given tweener is invalid:",t),this):(this._player=t,this)},Playable.prototype.setSpeed=function(t){return 0>t?void console.warn("[Playable.speed] This playable cannot have negative speed"):(0===t?0!==this._speed&&(this._startTime+=this._time/this._speed-this._time):0===this._speed?this._startTime+=this._time-this._time/t:this._startTime+=this._time/this._speed-this._time/t,this._speed=t,void(null!==this._player&&this._player._onPlayableChanged(this)))},Playable.prototype.goTo=function(t,e){return 1===this._iterations?0===this._speed?this._startTime+=this._time-t:this._startTime+=(this._time-t)/this._speed:(e=e||0,0===this._speed?this._startTime+=this._time-t-e*this._duration:this._startTime+=(this._time-t-e*this._duration)/this._speed),this._time=t,null!==this._player&&this._player._onPlayableChanged(this),this},Playable.prototype.goToBeginning=function(){return this.goTo(0,0)},Playable.prototype.getDuration=function(){return 1/0},Playable.prototype._getEndTime=function(){return 1/0},Playable.prototype._setStartTime=function(t){this._startTime=t},Playable.prototype._getStartTime=function(){return this._startTime},Playable.prototype._isWithin=function(t){return this._startTime<t},Playable.prototype._overlaps=function(t,e){return(t-this._startTime)*(e-this._startTime)<=0},Playable.prototype.rewind=function(){return this.goTo(0,0),this},Playable.prototype.delay=function(t){return this.start(-t)},Playable.prototype.start=function(t){return null===this._player&&(this._player=TINA._startDefaultTweener()),this._validate()===!1?this:this._player._add(this)===!1?this:((void 0===t||null===t)&&(t=0),this._startTime=this._player._time-t,this)},Playable.prototype._start=function(){null!==this._onStart&&this._onStart()},Playable.prototype.stop=function(){return null===this._player?void console.warn("[Playable.stop] Trying to stop a playable that was never started."):this._player._remove(this)===!1?this:(null!==this._onStop&&this._onStop(),this)},Playable.prototype.resume=function(){return this._player._activate(this)===!1?this:(null!==this._onResume&&this._onResume(),this)},Playable.prototype.pause=function(){return this._player._remove(this)===!1?this:(null!==this._onPause&&this._onPause(),this)},Playable.prototype._moveTo=function(t,e){e*=this._speed,this._time=(t-this._startTime)*this._speed,this._update(e),null!==this._onUpdate&&this._onUpdate(this._time,e)},Playable.prototype._update=function(){},Playable.prototype._validate=function(){};
function Playable(){this._player=null,this._handle=null,this._active=!0,this._startTime=0,this._time=0,this._speed=1,this._onStart=null,this._onPause=null,this._onResume=null,this._onUpdate=null,this._onStop=null}module.exports=Playable,Object.defineProperty(Playable.prototype,"speed",{get:function(){return this._speed},set:function(t){this.setSpeed(t)}}),Object.defineProperty(Playable.prototype,"time",{get:function(){return this._time},set:function(t){this.goTo(t)}}),Playable.prototype.onStart=function(t){return this._onStart=t,this},Playable.prototype.onUpdate=function(t){return this._onUpdate=t,this},Playable.prototype.onStop=function(t){return this._onStop=t,this},Playable.prototype.onPause=function(t){return this._onPause=t,this},Playable.prototype.onResume=function(t){return this._onResume=t,this},Playable.prototype.tweener=function(t){return null===t||void 0===t?(console.warn("[Playable.tweener] Given tweener is invalid:",t),this):(this._player=t,this)},Playable.prototype.setSpeed=function(t){return 0>t?void console.warn("[Playable.speed] This playable cannot have negative speed"):(0===t?0!==this._speed&&(this._startTime+=this._time/this._speed-this._time):0===this._speed?this._startTime+=this._time-this._time/t:this._startTime+=this._time/this._speed-this._time/t,this._speed=t,void(null!==this._player&&this._player._onPlayableChanged(this)))},Playable.prototype.goTo=function(t,e){return 1===this._iterations?0===this._speed?this._startTime+=this._time-t:this._startTime+=(this._time-t)/this._speed:(e=e||0,0===this._speed?this._startTime+=this._time-t-e*this._duration:this._startTime+=(this._time-t-e*this._duration)/this._speed),this._time=t,null!==this._player&&this._player._onPlayableChanged(this),this},Playable.prototype.goToBeginning=function(){return this.goTo(0,0)},Playable.prototype.getDuration=function(){return 1/0},Playable.prototype._getEndTime=function(){return 1/0},Playable.prototype._setStartTime=function(t){this._startTime=t},Playable.prototype._getStartTime=function(){return this._startTime},Playable.prototype._isWithin=function(t){return this._startTime<t},Playable.prototype._overlaps=function(t,e){return(t-this._startTime)*(e-this._startTime)<=0},Playable.prototype.rewind=function(){return this.goTo(0,0),this},Playable.prototype.delay=function(t){return this.start(-t)},Playable.prototype.start=function(t){return null===this._player&&(this._player=TINA._startDefaultTweener()),this._validate()===!1?this:((void 0===t||null===t)&&(t=0),this._time=t,this._startTime=this._player._time-t,this._player._reactivate(this)===!1?this:this)},Playable.prototype._start=function(){null!==this._onStart&&this._onStart()},Playable.prototype.stop=function(){return null===this._player?this:this._player._remove(this)===!1?this:(null!==this._onStop&&this._onStop(),this)},Playable.prototype.resume=function(){return null===this._player||this._player._reactivate(this)===!1?this:(this._startTime=this._player._time-this._time/this._speed,null!==this._onResume&&this._onResume(),this)},Playable.prototype.pause=function(){return null===this._player||this._player._inactivate(this)===!1?this:(null!==this._onPause&&this._onPause(),this)},Playable.prototype._moveTo=function(t,e){e*=this._speed,this._time=(t-this._startTime)*this._speed,this._update(e),null!==this._onUpdate&&this._onUpdate(this._time,e)},Playable.prototype._update=function(){},Playable.prototype._validate=function(){};
},{}],9:[function(require,module,exports){
function Player(){Playable.call(this),this._activePlayables=new DoublyList,this._inactivePlayables=new DoublyList,this._playablesToRemove=new DoublyList,this._silent=!0,this._debug=!1}var Playable=require("./Playable"),DoublyList=require("./DoublyList");Player.prototype=Object.create(Playable.prototype),Player.prototype.constructor=Player,module.exports=Player,Player.prototype._add=function(e){return null===e._handle?(e._handle=this._inactivePlayables.add(e),e._player=this,!0):e._handle.container===this._playablesToRemove?(e._handle=this._playablesToRemove.removeByReference(e._handle),!0):e._handle.container===this._activePlayables?(this._warn("[Player._add] Playable is already present, and active"),!1):e._handle.container===this._inactivePlayables?(this._warn("[Player._add] Playable is already present, but inactive (could be starting)"),!1):(this._warn("[Player._add] Playable is used elsewhere"),!1)},Player.prototype._remove=function(e){return null===e._handle?(this._warn("[Player._remove] Playable is not being used"),!1):e._handle.container===this._activePlayables?(e._handle=this._playablesToRemove.add(e._handle),!0):e._handle.container===this._inactivePlayables?(e._handle=this._inactivePlayables.removeByReference(e._handle),!0):e._handle.container===this._playablesToRemove?(this._warn("[Player._remove] Playable is already being removed"),!1):(this._warn("[Player._add] Playable is used elsewhere"),!1)},Player.prototype.remove=function(e){return e._handle.container===this._activePlayables&&e.stop(),this._remove(e),this._onPlayableRemoved(e),this},Player.prototype.removeAll=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next;e.object.stop(),e=a}return this._handlePlayablesToRemove(),this},Player.prototype.possess=function(e){return null===e._handle?!1:e._handle.container===this._activePlayables||e._handle.container===this._inactivePlayables},Player.prototype._handlePlayablesToRemove=function(){for(;this._playablesToRemove.length>0;){var e=this._playablesToRemove.pop(),a=e.object;a._handle=this._activePlayables.removeByReference(e)}0===this._activePlayables.length&&0===this._inactivePlayables.length&&this._onAllPlayablesRemoved()},Player.prototype.clear=function(){return this._activePlayables.clear(),this._inactivePlayables.clear(),this._playablesToRemove.clear(),this._controls.clear(),this},Player.prototype._warn=function(e){this._silent===!1&&console.warn(e),this._debug===!0},Player.prototype.silent=function(e){return this._silent=e||!1,this},Player.prototype.debug=function(e){return this._debug=e||!1,this},Player.prototype.stop=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next,t=e.object;t.stop(),e=a}this._handlePlayablesToRemove(),Playable.prototype.stop.call(this)},Player.prototype._activate=function(e){this._inactivePlayables.removeByReference(e._handle),e._handle=this._activePlayables.addBack(e)},Player.prototype._inactivate=function(e){return null===e._handle?void this._warn("[Playable.stop] Cannot stop a playable that is not running"):(this._activePlayables.removeByReference(e._handle),void(e._handle=this._inactivePlayables.addBack(e)))},Player.prototype._updatePlayableList=function(e){this._handlePlayablesToRemove();var a,t;e>0?(a=this._time-e,t=this._time):(a=this._time,t=this._time-e);for(var l=this._inactivePlayables.first;null!==l;){var i=l.object;l=l.next,i._overlaps(a,t)&&(this._activate(i),i._start())}},Player.prototype._update=function(e,a){this._updatePlayableList(e);for(var t=this._activePlayables.first;null!==t;t=t.next)void 0===a?t.object._moveTo(this._time,e):t.object._moveTo(this._time,e,a)},Player.prototype._onPlayableChanged=function(){},Player.prototype._onPlayableRemoved=function(){},Player.prototype._onAllPlayablesRemoved=function(){};
function Player(){Playable.call(this),this._activePlayables=new DoublyList,this._inactivePlayables=new DoublyList,this._playablesToRemove=new DoublyList,this._silent=!0,this._debug=!1}var Playable=require("./Playable"),DoublyList=require("./DoublyList");Player.prototype=Object.create(Playable.prototype),Player.prototype.constructor=Player,module.exports=Player,Player.prototype._add=function(e){return null===e._handle?(e._handle=this._inactivePlayables.add(e),e._player=this,!0):e._handle.container===this._playablesToRemove?(e._handle=this._playablesToRemove.removeByReference(e._handle),e._handle=e._handle.object,!0):e._handle.container===this._activePlayables?(this._warn("[Player._add] Playable is already present, and active"),!1):e._handle.container===this._inactivePlayables?(this._warn("[Player._add] Playable is already present, but inactive (could be starting)"),!1):(this._warn("[Player._add] Playable is used elsewhere"),!1)},Player.prototype._remove=function(e){return null===e._handle?(this._warn("[Player._remove] Playable is not being used"),!1):e._handle.container===this._activePlayables?(e._handle=this._playablesToRemove.add(e._handle),!0):e._handle.container===this._inactivePlayables?(e._handle=this._inactivePlayables.removeByReference(e._handle),!0):e._handle.container===this._playablesToRemove?(this._warn("[Player._remove] Playable is already being removed"),!1):(this._warn("[Player._remove] Playable is used elsewhere"),!1)},Player.prototype.remove=function(e){return e._handle.container===this._activePlayables&&e.stop(),this._remove(e),this._onPlayableRemoved(e),this},Player.prototype.removeAll=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next;e.object.stop(),e=a}return this._handlePlayablesToRemove(),this},Player.prototype.possess=function(e){return null===e._handle?!1:e._handle.container===this._activePlayables||e._handle.container===this._inactivePlayables},Player.prototype._handlePlayablesToRemove=function(){for(;this._playablesToRemove.length>0;){var e=this._playablesToRemove.pop(),a=e.object;a._handle=this._activePlayables.removeByReference(e)}0===this._activePlayables.length&&0===this._inactivePlayables.length&&this._onAllPlayablesRemoved()},Player.prototype.clear=function(){return this._activePlayables.clear(),this._inactivePlayables.clear(),this._playablesToRemove.clear(),this._controls.clear(),this},Player.prototype._warn=function(e){this._silent===!1&&console.warn("[TINA]"+e),this._debug===!0},Player.prototype.silent=function(e){return this._silent=e||!1,this},Player.prototype.debug=function(e){return this._debug=e||!1,this},Player.prototype.stop=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next,t=e.object;t.stop(),e=a}this._handlePlayablesToRemove(),Playable.prototype.stop.call(this)},Player.prototype._activate=function(e){return e._handle.container===this._inactivePlayables?(this._inactivePlayables.removeByReference(e._handle),e._handle=this._activePlayables.addBack(e)):e._handle.container===this._playablesToRemove&&(this._playablesToRemove.removeByReference(e._handle),e._handle=e._handle.object),e._active=!0,!0},Player.prototype._reactivate=Player.prototype._activate,Player.prototype._inactivate=function(e){return null===e._handle?(this._warn("[Player._inactivate] Cannot stop a playable that is not running"),!1):(e._handle.container===this._activePlayables&&(this._activePlayables.removeByReference(e._handle),e._handle=this._inactivePlayables.addBack(e)),e._active=!1,!0)},Player.prototype._updatePlayableList=function(e){this._handlePlayablesToRemove();var a,t;e>0?(a=this._time-e,t=this._time):(a=this._time,t=this._time-e);for(var l=this._inactivePlayables.first;null!==l;){var i=l.object;l=l.next,i._active&&i._overlaps(a,t)&&(this._activate(i),i._start())}},Player.prototype._update=function(e,a){this._updatePlayableList(e);for(var t=this._activePlayables.first;null!==t;t=t.next)void 0===a?t.object._moveTo(this._time,e):t.object._moveTo(this._time,e,a)},Player.prototype._onPlayableChanged=function(){},Player.prototype._onPlayableRemoved=function(){},Player.prototype._onAllPlayablesRemoved=function(){};

@@ -39,3 +39,3 @@ },{"./DoublyList":6,"./Playable":8}],10:[function(require,module,exports){

(function (global){
var DoublyList=require("./DoublyList"),root;"undefined"!=typeof window?root=window:"undefined"!=typeof global?root=global:(console.warn("[TINA] Your environment might not support TINA."),root=this);var requestAnimFrame=function(){return root.requestAnimationFrame||root.webkitRequestAnimationFrame||root.mozRequestAnimationFrame||root.oRequestAnimationFrame||root.msRequestAnimationFrame||function(e){root.setTimeout(e,1e3/60)}}(),clock=root.performance||Date,TINA={_activeTweeners:new DoublyList,_inactiveTweeners:new DoublyList,_tweenersToRemove:new DoublyList,_defaultTweener:null,_startTime:0,_time:0,_running:!1,_onStart:null,_onPause:null,_onResume:null,_onUpdate:null,_onStop:null,_pauseOnLostFocus:!1,_pauseOnLostFocusInitialised:!1,onStart:function(e){return this._onStart=e,this},onUpdate:function(e){return this._onUpdate=e,this},onStop:function(e){return this._onStop=e,this},onPause:function(e){return this._onPause=e,this},isRunning:function(){return this._running===!0},update:function(){var e=clock.now()-this._startTime,t=e-this._time;for(0>t?(t=1,this._startTime-=1,this._time+=1):this._time=e;this._tweenersToRemove.length>0;){var n=this._tweenersToRemove.pop();n._handle=this._activeTweeners.removeByReference(n._handle)}for(;this._inactiveTweeners.length>0;){var i=this._inactiveTweeners.pop();i._handle=this._activeTweeners.addBack(i),i._start()}for(var s=this._activeTweeners.first;null!==s;s=s.next)s.object._moveTo(this._time,t);null!==this._onUpdate&&this._onUpdate(this._time,t)},reset:function(){var e=clock.now(),t=e-this._time;this._startTime+=t,this._time=0},start:function(){if(this._startAutomaticUpdate()!==!1){for(null!==this._onStart&&this._onStart();this._inactiveTweeners.length>0;){var e=this._inactiveTweeners.first;this._activate(e.object)}return this}},stop:function(){if(this._stopAutomaticUpdate()!==!1){for(;this._activePlayables.length>0;){var e=this._activePlayables.first;e.object.stop()}return null!==this._onStop&&this._onStop(),this}},_startAutomaticUpdate:function(){function e(){TINA._running===!0&&(TINA.update(),requestAnimFrame(e))}return this._running===!0?(console.warn("[TINA.start] TINA is already running"),!1):(this.reset(),this._running=!0,requestAnimFrame(e),!0)},_stopAutomaticUpdate:function(){return this._running===!1?(console.warn("[TINA.pause] TINA is not running"),!1):(this._running=!1,!0)},pause:function(){if(this._stopAutomaticUpdate()!==!1){for(var e=this._activeTweeners.first;null!==e;e=e.next)e.object._pause();return null!==this._onPause&&this._onPause(),this}},resume:function(){if(this._startAutomaticUpdate()!==!1){null!==this._onResume&&this._onResume();for(var e=this._activeTweeners.first;null!==e;e=e.next)e.object._resume();return this}},_initialisePauseOnLostFocus:function(){if(this._pauseOnLostFocusInitialised!==!0){if(void 0===document)return void console.warn("[TINA.pauseOnLostFocus] Cannot pause on lost focus because TINA is not running in a webpage (node.js does not allow this functionality)");var e,t;if("undefined"!=typeof document.hidden?(e="hidden",t="visibilitychange"):"undefined"!=typeof document.mozHidden?(e="mozHidden",t="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(e="msHidden",t="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e="webkitHidden",t="webkitvisibilitychange"),"undefined"==typeof document[e])return void console.warn("[Tweener] Cannot pause on lost focus because the browser does not support the Page Visibility API");this._pauseOnLostFocusInitialised=!0;var n=!1;document.addEventListener(t,function(){document[e]&&(n=TINA.isRunning(),n&&TINA._pauseOnLostFocus&&TINA.pause()),document[e]||n&&TINA._pauseOnLostFocus&&TINA.resume()},!1)}},pauseOnLostFocus:function(e){return e===!0&&this._pauseOnLostFocusInitialised===!1&&this._initialisePauseOnLostFocus(),this._pauseOnLostFocus=e,this},_add:function(e){return this._running===!1&&this.start(),null===e._handle?(e._handle=this._inactiveTweeners.add(e),void(e._player=this)):e._handle.container===this._tweenersToRemove?void(e._handle=this._tweenersToRemove.removeByReference(e._handle)):void 0},add:function(e){return this._add(e),this},_inactivate:function(e){null!==e._handle&&this._activePlayables.removeByReference(e._handle),e._handle=this._inactivePlayables.addBack(e)},_remove:function(e){return null!==e._handle?e._handle.container===this._activeTweeners?void(e._handle=this._tweenersToRemove.add(e._handle)):e._handle.container===this._inactiveTweeners?void(e._handle=this._inactiveTweeners.removeByReference(e._handle)):void 0:void 0},remove:function(e){return this._remove(e),this},setDefaultTweener:function(e){return this._defaultTweener=e,this},getDefaultTweener:function(){if(null===this._defaultTweener){var e=this.Timer;this._defaultTweener=new e}return this._defaultTweener},_startDefaultTweener:function(){var e=this.getDefaultTweener();return this._add(e),e}};module.exports=root.TINA=TINA;
var DoublyList=require("./DoublyList"),root;"undefined"!=typeof window?root=window:"undefined"!=typeof global?root=global:(console.warn("[TINA] Your environment might not support TINA."),root=this);var requestAnimFrame=function(){return root.requestAnimationFrame||root.webkitRequestAnimationFrame||root.mozRequestAnimationFrame||root.oRequestAnimationFrame||root.msRequestAnimationFrame||function(e){root.setTimeout(e,1e3/60)}}(),cancelAnimationFrame=window.cancelAnimationFrame||window.mozCancelAnimationFrame||window.clearTimeout,clock=root.performance||Date,TINA={_activeTweeners:new DoublyList,_inactiveTweeners:new DoublyList,_tweenersToRemove:new DoublyList,_defaultTweener:null,_startTime:0,_time:0,_requestFrameId:null,_paused:!1,_onStart:null,_onPause:null,_onResume:null,_onUpdate:null,_onStop:null,_pauseOnLostFocus:!1,_pauseOnLostFocusInitialised:!1,onStart:function(e){return this._onStart=e,this},onUpdate:function(e){return this._onUpdate=e,this},onStop:function(e){return this._onStop=e,this},onPause:function(e){return this._onPause=e,this},_onPlayableChanged:function(){},_onPlayableRemoved:function(){},_onAllPlayablesRemoved:function(){},isRunning:function(){return null!==this._requestFrameId},update:function(){if(!this._paused){var e=clock.now()-this._startTime,t=e-this._time;for(0>t?(t=1,this._startTime-=1,this._time+=1):this._time=e;this._tweenersToRemove.length>0;){var n=this._tweenersToRemove.pop();n._handle=this._activeTweeners.removeByReference(n._handle)}for(;this._inactiveTweeners.length>0;){var i=this._inactiveTweeners.pop();i._handle=this._activeTweeners.addBack(i),i._start()}for(var s=this._activeTweeners.first;null!==s;s=s.next)s.object._moveTo(this._time,t);null!==this._onUpdate&&this._onUpdate(this._time,t)}},reset:function(){var e=clock.now(),t=e-this._time;this._startTime+=t,this._time=0},start:function(){if(this._startAutomaticUpdate()!==!1){for(null!==this._onStart&&this._onStart();this._inactiveTweeners.length>0;){var e=this._inactiveTweeners.first;this._activate(e.object)}return this}},stop:function(){if(this._stopAutomaticUpdate()!==!1){for(;this._activePlayables.length>0;){var e=this._activePlayables.first;e.object.stop()}return null!==this._onStop&&this._onStop(),this}},_startAutomaticUpdate:function(){function e(){TINA.update(),this._requestFrameId=requestAnimFrame(e)}return null!==this._requestFrameId?!1:(this.reset(),this._requestFrameId=requestAnimFrame(e),!0)},_stopAutomaticUpdate:function(){return null===this._requestFrameId?!1:(cancelAnimationFrame(this._requestFrameId),this._requestFrameId=null,!0)},pause:function(){return this._paused=!0,null!==this._onPause&&this._onPause(),this},resume:function(){return this._paused=!1,this._startTime=clock.now()-this._time,null!==this._onResume&&this._onResume(),this},_initialisePauseOnLostFocus:function(){if(this._pauseOnLostFocusInitialised!==!0){if(void 0===document)return void console.warn("[TINA.pauseOnLostFocus] Cannot pause on lost focus because TINA is not running in a webpage (node.js does not allow this functionality)");var e,t;if("undefined"!=typeof document.hidden?(e="hidden",t="visibilitychange"):"undefined"!=typeof document.mozHidden?(e="mozHidden",t="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(e="msHidden",t="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e="webkitHidden",t="webkitvisibilitychange"),"undefined"==typeof document[e])return void console.warn("[Tweener] Cannot pause on lost focus because the browser does not support the Page Visibility API");this._pauseOnLostFocusInitialised=!0;var n=!1;document.addEventListener(t,function(){document[e]&&(n=TINA.isRunning(),n&&TINA._pauseOnLostFocus&&TINA.pause()),document[e]||n&&TINA._pauseOnLostFocus&&TINA.resume()},!1)}},pauseOnLostFocus:function(e){return e===!0&&this._pauseOnLostFocusInitialised===!1&&this._initialisePauseOnLostFocus(),this._pauseOnLostFocus=e,this},_add:function(e){return null===this._requestFrameId&&this.start(),null===e._handle?(e._handle=this._inactiveTweeners.add(e),e._player=this,void(e._time=(this._time-e._startTime)*e._speed)):e._handle.container===this._tweenersToRemove?void(e._handle=this._tweenersToRemove.removeByReference(e._handle)):void 0},add:function(e){return this._add(e),this},_reactivate:function(e){return this._add(e),this},_inactivate:function(e){null!==e._handle&&this._activePlayables.removeByReference(e._handle),e._handle=this._inactiveTweeners.addBack(e)},_remove:function(e){return null!==e._handle?e._handle.container===this._activeTweeners?void(e._handle=this._tweenersToRemove.add(e._handle)):e._handle.container===this._inactiveTweeners?void(e._handle=this._inactiveTweeners.removeByReference(e._handle)):void 0:void 0},remove:function(e){return this._remove(e),this},setDefaultTweener:function(e){return this._defaultTweener=e,this},getDefaultTweener:function(){if(null===this._defaultTweener){var e=this.Timer;this._defaultTweener=new e}return this._defaultTweener},_startDefaultTweener:function(){var e=this.getDefaultTweener();return this._add(e),e}};module.exports=root.TINA=TINA;

@@ -56,3 +56,3 @@ }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})

},{}],17:[function(require,module,exports){
function update(t,s){var i=this.prop,r=this.from[i]*(1-s)+this.to[i]*s;t[i]=t[i]+(r-this.prev),this.prev=r}function updateP(t,s){for(var i=this.props,r=0;r<this.props.length;r+=1){var h=i[r],p=this.from[h]*(1-s)+this.to[h]*s;t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function updateI(t,s){var i=this.prop,r=this.interps[i](s,this.from[i],this.to[i],this.interpParams[i]);t[i]=t[i]+(r-this.prev),this.prev=r}function updatePI(t,s){for(var i=this.props,r=0;r<i.length;r+=1){var h=i[r],p=this.interps[h](s,this.from[h],this.to[h],this.interpParams[h]);t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function updateE(t,s){s=this.easing(s,this.easingParams);var i=this.prop,r=this.from[i]*(1-s)+this.to[i]*s;t[i]=t[i]+(r-this.prev),this.prev=r}function updatePE(t,s){var i=this.props;s=this.easing(s,this.easingParams);for(var r=0;r<i.length;r+=1){var h=i[r],p=this.from[h]*(1-s)+this.to[h]*s;t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function updateIE(t,s){var i=this.prop,r=this.interps[i](this.easing(s,this.easingParams),this.from[i],this.to[i],this.interpParams[i]);t[i]=t[i]+(r-this.prev),this.prev=r}function updatePIE(t,s){var i=this.props;s=this.easing(s,this.easingParams);for(var r=0;r<i.length;r+=1){var h=i[r],p=this.interps[h](s,this.from[h],this.to[h],this.interpParams[h]);t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function Transition(t,s,i,r,h,p,e,a,n){this.start=r,this.end=r+h,this.duration=h,this.from=s,this.to=i;var o;p?(o=1,this.easing=p,this.easingParam=e):o=0;var v;null===a?v=0:(v=1,this.interps=a,this.interpParams=n||{});var u;if(1===t.length)u=0,this.prop=t[0],this.props=null,this.prev=0,this.prevs=null;else{u=1,this.prop=null,this.props=t,this.prev=null,this.prevs={};for(var d=0;d<t.length;d+=1)this.prevs[t[d]]=0}this.update=updateMethods[o][v][u]}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];module.exports=Transition;
function update(t,s){var i=this.prop,r=this.from[i]*(1-s)+this.to[i]*s;t[i]=t[i]+(r-this.prev),this.prev=r}function updateP(t,s){for(var i=this.props,r=0;r<this.props.length;r+=1){var h=i[r],p=this.from[h]*(1-s)+this.to[h]*s;t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function updateI(t,s){var i=this.prop,r=this.interps[i](s,this.from[i],this.to[i],this.interpParams[i]);t[i]=t[i]+(r-this.prev),this.prev=r}function updatePI(t,s){for(var i=this.props,r=0;r<i.length;r+=1){var h=i[r],p=this.interps[h](s,this.from[h],this.to[h],this.interpParams[h]);t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function updateE(t,s){s=this.easing(s,this.easingParam);var i=this.prop,r=this.from[i]*(1-s)+this.to[i]*s;t[i]=t[i]+(r-this.prev),this.prev=r}function updatePE(t,s){var i=this.props;s=this.easing(s,this.easingParam);for(var r=0;r<i.length;r+=1){var h=i[r],p=this.from[h]*(1-s)+this.to[h]*s;t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function updateIE(t,s){var i=this.prop,r=this.interps[i](this.easing(s,this.easingParam),this.from[i],this.to[i],this.interpParams[i]);t[i]=t[i]+(r-this.prev),this.prev=r}function updatePIE(t,s){var i=this.props;s=this.easing(s,this.easingParam);for(var r=0;r<i.length;r+=1){var h=i[r],p=this.interps[h](s,this.from[h],this.to[h],this.interpParams[h]);t[h]=t[h]+(p-this.prevs[h]),this.prevs[h]=p}}function Transition(t,s,i,r,h,p,e,a,n){this.start=r,this.end=r+h,this.duration=h,this.from=s,this.to=i;var o;p?(o=1,this.easing=p,this.easingParam=e):o=0;var v;null===a?v=0:(v=1,this.interps=a,this.interpParams=n||{});var u;if(1===t.length)u=0,this.prop=t[0],this.props=null,this.prev=0,this.prevs=null;else{u=1,this.prop=null,this.props=t,this.prev=null,this.prevs={};for(var d=0;d<t.length;d+=1)this.prevs[t[d]]=0}this.update=updateMethods[o][v][u]}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];module.exports=Transition;

@@ -63,3 +63,3 @@ },{}],18:[function(require,module,exports){

},{"./AbstractTween":1,"./BriefPlayable":3,"./inherit":22}],19:[function(require,module,exports){
function Tweener(){Player.call(this),this._player=TINA}var Player=require("./Player"),TINA=require("./TINA");Tweener.prototype=Object.create(Player.prototype),Tweener.prototype.constructor=Tweener,module.exports=Tweener,Tweener.prototype._inactivate=function(e){this._remove(e)},Tweener.prototype.useAsDefault=function(){return TINA.setDefaultTweener(this),this};
function Tweener(){Player.call(this),this._player=TINA}var Player=require("./Player"),TINA=require("./TINA");Tweener.prototype=Object.create(Player.prototype),Tweener.prototype.constructor=Tweener,module.exports=Tweener,Tweener.prototype._reactivate=function(e){null===e._handle&&this._add(e),Player.prototype._activate.call(this,e)},Tweener.prototype._inactivate=function(e){null!==e._handle&&(e._handle.container===this._activePlayables&&(e._handle=this._playablesToRemove.add(e._handle)),e._handle.container===this._inactivePlayables&&(e._handle=this._inactivePlayables.removeByReference(e._handle))),e._active=!1},Tweener.prototype.useAsDefault=function(){return TINA.setDefaultTweener(this),this};

@@ -66,0 +66,0 @@ },{"./Player":9,"./TINA":12}],20:[function(require,module,exports){

{
"name": "tina",
"version": "0.3.20",
"version": "0.3.21",
"description": "Tweening and INterpolations for Animation",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -215,3 +215,3 @@

if (dt > 0) {
if (0 < iteration && iteration < this._iterations) {
if (0 <= iteration && iteration < this._iterations) {
this._time = time % this._duration;

@@ -223,3 +223,3 @@ } else {

} else if (dt < 0) {
if (0 < iteration && iteration < this._iterations) {
if (0 <= iteration && iteration < this._iterations) {
this._time = time % this._duration;

@@ -226,0 +226,0 @@ } else {

Sorry, the diff of this file is too big to display

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