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

tina

Package Overview
Dependencies
Maintainers
2
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.0 to 0.3.1

47

build/tina.min.js
(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){
function Temporisation(t,i,n,s){this.start=t,this.end=t+i,this.duration=i,this.properties=s,this.to=n}function AbstractTween(t,i){if(this._object=t,(null===i||void 0===i)&&t instanceof Array){i=[];for(var n=0;n<t.length;n+=1)i[n]=n}this._properties=i,this._from=null,this._interpolations=null,this._index=0,this._transitions=[],this._relative=!1,this._time=0,this._duration=0}var Transition=require("./Transition"),TransitionRelative=require("./TransitionRelative"),easingFunctions=require("./easing"),interpolationFunctions=require("./interpolation");Temporisation.prototype.update=function(t){for(var i=0;i<this.properties.length;i+=1){var n=this.properties[i];t[n]=this.to[n]}},module.exports=AbstractTween,AbstractTween.prototype.relative=function(t){return this._relative=t,this},AbstractTween.prototype.reset=function(){return this._index=0,this._duration=0,this._transitions=[],this},AbstractTween.prototype.interpolations=function(t){for(var i=0;i<this._properties.length;i+=1){var n=this._properties[i],s=t[n];void 0!==s?"string"==typeof s&&(void 0===interpolationFunctions[s]?(console.warn("[AbstractTween.interpolations] Given interpolation does not exist"),t[n]=interpolationFunctions.linear):t[n]=interpolationFunctions[s]):t[n]=interpolationFunctions.linear}return this._interpolations=t,this},AbstractTween.prototype.from=function(t){return this._from=t,this._transitions.length>0&&(this._transitions[0].from=t),this},AbstractTween.prototype._setFrom=function(){this._from={};for(var t=0;t<this._properties.length;t+=1){var i=this._properties[t];this._from[i]=this._relative===!0?0:this._object[i]}return this._from},AbstractTween.prototype._getLastTransitionEnding=function(){return this._transitions.length>0?this._transitions[this._transitions.length-1].to:null===this._from?this._setFrom():this._from},AbstractTween.prototype.to=function(t,i,n,s,e){"string"==typeof n&&(void 0===easingFunctions[n]?(console.warn("[AbstractTween.to] Given easing does not exist"),n=void 0):n=easingFunctions[n]);var r=this._getLastTransitionEnding(),o=this._relative===!0?TransitionRelative:Transition,a=new o(this._properties,r,t,this._duration,i,n,s,this._interpolations,e);return this._transitions.push(a),this._duration+=i,this},AbstractTween.prototype.wait=function(t){var i=this._getLastTransitionEnding();return this._transitions.push(new Temporisation(this._duration,t,i,this._properties)),this._duration+=t,this},AbstractTween.prototype._update=function(){for(var t=this._transitions[this._index];t.end<=this._time;){if(this._index===this._transitions.length-1)return void t.update(this._object,1);t=this._transitions[++this._index]}for(;this._time<=t.start;){if(0===this._index)return void t.update(this._object,0);t=this._transitions[--this._index]}t.update(this._object,(this._time-t.start)/t.duration)},AbstractTween.prototype._validate=function(){return 0===this._transitions.length?(console.warn("[AbstractTween._validate] Cannot start a tween with no transition:",this),!1):!0};
},{"./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._persist=!1,this._pingpong=!1}module.exports=BriefExtension,BriefExtension.prototype.onComplete=function(t){return this._onComplete=t,this},BriefExtension.prototype.getDuration=function(){return this._duration*this._iterations/this._speed},BriefExtension.prototype.goToEnd=function(){return this.goTo(this.getDuration(),this._iterations-1),this},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._onPlayableChange(this),this)},BriefExtension.prototype.persist=function(t){return this._persist=t,null!==this._player&&this._player._onPlayableChange(this),this},BriefExtension.prototype.pingpong=function(t){return this._pingpong=t,null!==this._player&&this._player._onPlayableChange(this),this},BriefExtension.prototype._complete=function(t){return this._persist===!0?(this._startTime+=t,void this._player._onPlayableChange(this)):this._player._inactivate(this)===!1?this:void(null!==this._onComplete&&this._onComplete(t))},BriefExtension.prototype._moveTo=function(t,i){i*=this._speed;var e;if(0!==i)if(1===this._iterations)this._time=(t-this._startTime)*this._speed,i>0?this._time>=this._duration&&(e=this._time-this._duration,i-=e,this._time=this._duration):0>i&&this._time<=0&&(e=this._time,i-=e,this._time=0);else{t=(t-this._startTime)*this._speed;var s=t/this._duration;i>0?s<this._iterations?this._time=t%this._duration:(e=(s-this._iterations)*this._duration,i-=e,this._time=this._duration*(1-(Math.ceil(this._iterations)-this._iterations))):0>i&&(s>0?this._time=t%this._duration:(e=s*this._duration,i-=e,this._time=0)),this._pingpong===!0&&(Math.ceil(this._iterations)===this._iterations?void 0===e?0===(1&Math.ceil(s))&&(this._time=this._duration-this._time):1===(1&Math.ceil(s))&&(this._time=this._duration-this._time):0===(1&Math.ceil(s))&&(this._time=this._duration-this._time))}this._update(i),null!==this._onUpdate&&this._onUpdate(this._time,i),void 0!==e&&this._complete(e)};
},{"./Transition":15,"./TransitionRelative":16,"./easing":19,"./interpolation":22}],2:[function(require,module,exports){
function BriefExtension(){this._duration=0,this._onComplete=null,this._iterations=1,this._persist=!1,this._pingpong=!1}module.exports=BriefExtension,BriefExtension.prototype.onComplete=function(t){return this._onComplete=t,this},BriefExtension.prototype.getDuration=function(){return this._duration*this._iterations/this._speed},BriefExtension.prototype.goToEnd=function(){return this.goTo(this.getDuration(),this._iterations-1),this},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,null!==this._player&&this._player._onPlayableChanged(this),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))},BriefExtension.prototype._moveTo=function(t,i){i*=this._speed;var e;if(0!==i)if(1===this._iterations)this._time=(t-this._startTime)*this._speed,i>0?this._time>=this._duration&&(e=this._time-this._duration,i-=e,this._time=this._duration):0>i&&this._time<=0&&(e=this._time,i-=e,this._time=0);else{t=(t-this._startTime)*this._speed;var s=t/this._duration;i>0?s<this._iterations?this._time=t%this._duration:(e=(s-this._iterations)*this._duration,i-=e,this._time=this._duration*(1-(Math.ceil(this._iterations)-this._iterations))):0>i&&(s>0?this._time=t%this._duration:(e=s*this._duration,i-=e,this._time=0)),this._pingpong===!0&&(Math.ceil(this._iterations)===this._iterations?void 0===e?0===(1&Math.ceil(s))&&(this._time=this._duration-this._time):1===(1&Math.ceil(s))&&(this._time=this._duration-this._time):0===(1&Math.ceil(s))&&(this._time=this._duration-this._time))}this._update(i),null!==this._onUpdate&&this._onUpdate(this._time,i),void 0!==e&&this._complete(e)};

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

},{"./BriefExtension":2,"./Playable":8,"./inherit":22}],4:[function(require,module,exports){
function BriefPlayer(){PlayableHandler.call(this),BriefExtension.call(this)}var inherit=require("./inherit"),PlayableHandler=require("./PlayableHandler"),BriefExtension=require("./BriefExtension");BriefPlayer.prototype=Object.create(PlayableHandler.prototype),BriefPlayer.prototype.constructor=BriefPlayer,inherit(BriefPlayer,BriefExtension),module.exports=BriefPlayer;
},{"./BriefExtension":2,"./Playable":8,"./inherit":21}],4:[function(require,module,exports){
function BriefPlayer(){Player.call(this),BriefExtension.call(this)}var inherit=require("./inherit"),Player=require("./Player"),BriefExtension=require("./BriefExtension");BriefPlayer.prototype=Object.create(Player.prototype),BriefPlayer.prototype.constructor=BriefPlayer,inherit(BriefPlayer,BriefExtension),module.exports=BriefPlayer,BriefPlayer.prototype._onAllPlayablesRemoved=function(){};
},{"./BriefExtension":2,"./PlayableHandler":9,"./inherit":22}],5:[function(require,module,exports){
},{"./BriefExtension":2,"./Player":9,"./inherit":21}],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;

@@ -24,14 +24,11 @@

},{"./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){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._onPlayableChange(this)}}),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.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._onPlayableChange(this),this},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._getDefaultTweener()),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(t){null!==this._onStart&&this._onStart()},Playable.prototype.stop=function(){return this._player._inactivate(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._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(){};
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){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)}}),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.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.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._getDefaultTweener()),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(t){null!==this._onStart&&this._onStart()},Playable.prototype.stop=function(){return this._player._inactivate(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._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 PlayableHandler(){Playable.call(this),this._activePlayables=new DoublyList,this._inactivePlayables=new DoublyList,this._playablesToRemove=new DoublyList,this._silent=!1,this._debug=!1}var Playable=require("./Playable"),DoublyList=require("./DoublyList");PlayableHandler.prototype=Object.create(Playable.prototype),PlayableHandler.prototype.constructor=PlayableHandler,module.exports=PlayableHandler,PlayableHandler.prototype._add=function(e,a){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("[PlayableHandler._add] Playable is already present, and active"),!1):e._handle.container===this._inactivePlayables?(this._warn("[PlayableHandler._add] Playable is already present, but inactive (could be starting)"),!1):(this._warn("[PlayableHandler._add] Playable is used elsewhere"),!1)},PlayableHandler.prototype._remove=function(e){return null===e._handle?(this._warn("[PlayableHandler._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("[PlayableHandler._remove] Playable is already being removed"),!1):(this._warn("[PlayableHandler._add] Playable is used elsewhere"),!1)},PlayableHandler.prototype.remove=function(e){return e._handle.container===this._activePlayables&&e.stop(),e._handle.container!==this._playablesToRemove&&this._remove(e),this._onRemovePlayables(),this},PlayableHandler.prototype.removeAll=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next;e.object.stop(),e=a}return this._handlePlayablesToRemove(),this._onRemovePlayables(),this},PlayableHandler.prototype.possess=function(e){return null===e._handle?!1:e._handle.container===this._activePlayables||e._handle.container===this._inactivePlayables},PlayableHandler.prototype._handlePlayablesToRemove=function(){for(;this._playablesToRemove.length>0;){var e=this._playablesToRemove.pop(),a=e.object;a._handle=this._activePlayables.removeByReference(e),a._player=null}},PlayableHandler.prototype.clear=function(){return this._activePlayables.clear(),this._inactivePlayables.clear(),this._playablesToRemove.clear(),this._controls.clear(),this},PlayableHandler.prototype._warn=function(e){this._silent===!1&&console.warn(e),this._debug===!0},PlayableHandler.prototype.silent=function(e){return this._silent=e,this},PlayableHandler.prototype.debug=function(e){return this._debug=e,this},PlayableHandler.prototype.stop=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next,l=e.object;l.stop(),e=a}this._handlePlayablesToRemove(),Playable.prototype.stop.call(this)},PlayableHandler.prototype._activate=function(e){this._inactivePlayables.removeByReference(e._handle),e._handle=this._activePlayables.addBack(e)},PlayableHandler.prototype._inactivate=function(e){this._activePlayables.removeByReference(e._handle),e._handle=this._inactivePlayables.addBack(e)},PlayableHandler.prototype._updatePlayableList=function(e){this._handlePlayablesToRemove();for(var a=this._inactivePlayables.first;null!==a;){var l=a.object;a=a.next;var t=l._startTime,n=t+l.getDuration();t<=this._time&&this._time<=n&&(this._inactivePlayables.removeByReference(l._handle),l._handle=this._activePlayables.addBack(l),l._start(this._time-t))}},PlayableHandler.prototype._update=function(e){this._updatePlayableList(e);for(var a=this._activePlayables.first;null!==a;a=a.next)a.object._moveTo(this._time,e)},PlayableHandler.prototype._onRemovePlayables=function(){},PlayableHandler.prototype._onPlayableChange=function(){console.log("nada")};
function Player(){Playable.call(this),this._activePlayables=new DoublyList,this._inactivePlayables=new DoublyList,this._playablesToRemove=new DoublyList,this._silent=!1,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,a){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(),e._handle.container!==this._playablesToRemove&&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._onAllPlayablesRemoved(),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),a._player=null}},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,this},Player.prototype.debug=function(e){return this._debug=e,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){this._activePlayables.removeByReference(e._handle),e._handle=this._inactivePlayables.addBack(e)},Player.prototype._updatePlayableList=function(e){this._handlePlayablesToRemove();for(var a=this._inactivePlayables.first;null!==a;){var t=a.object;a=a.next;var l=t._startTime,i=l+t.getDuration();l<=this._time&&this._time<=i&&(this._inactivePlayables.removeByReference(t._handle),t._handle=this._activePlayables.addBack(t),t._start(this._time-l))}},Player.prototype._update=function(e){this._updatePlayableList(e);for(var a=this._activePlayables.first;null!==a;a=a.next)a.object._moveTo(this._time,e)},Player.prototype._onPlayableChanged=function(){},Player.prototype._onPlayableRemoved=function(){},Player.prototype._onAllPlayablesRemoved=function(){};
},{"./DoublyList":6,"./Playable":8}],10:[function(require,module,exports){
function Player(){PlayableHandler.call(this)}var PlayableHandler=require("./PlayableHandler");Player.prototype=Object.create(PlayableHandler.prototype),Player.prototype.constructor=Player,module.exports=Player;
},{"./PlayableHandler":9}],11:[function(require,module,exports){
function Sequence(){return this instanceof Sequence==!1?new Sequence:void Timeline.call(this)}var Timeline=require("./Timeline");Sequence.prototype=Object.create(Timeline.prototype),Sequence.prototype.constructor=Sequence,module.exports=Sequence,Sequence.prototype.add=function(e){return Timeline.prototype.add.call(this,e,this._duration)},Sequence.prototype.addDelay=function(e){return this._duration+=e,this};
},{"./Timeline":14}],12:[function(require,module,exports){
},{"./Timeline":13}],11:[function(require,module,exports){
(function (global){

@@ -41,34 +38,34 @@ var 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(t){root.setTimeout(t,1e3/60)}}(),clock=root.performance||Date,TINA={_tweeners:[],_defaultTweener:null,_startTime:0,_time:0,_running:!1,_onStart:null,_onPause:null,_onResume:null,_onUpdate:null,_onStop:null,_pauseOnLostFocus:!1,_pauseOnLostFocusInitialised:!1,onStart:function(t){return this._onStart=t,this},onUpdate:function(t){return this._onUpdate=t,this},onStop:function(t){return this._onStop=t,this},onPause:function(t){return this._onPause=t,this},isRunning:function(){return this._running===!0},update:function(){var t=clock.now()-this._startTime,e=t-this._time;if(!(0>e)){this._time=t;for(var n=this._tweeners.slice(0),i=0;i<n.length;i+=1)n[i]._moveTo(this._time,e);null!==this._onUpdate&&this._onUpdate(this._time,e)}},reset:function(){this._startTime=clock.now(),this._time=0},start:function(){if(this._startAutomaticUpdate()!==!1){null!==this._onStart&&this._onStart(),this._startTime=clock.now(),this._time=0;for(var t=0;t<this._tweeners.length;t+=1)this._tweeners[t]._start(0);return this}},stop:function(){if(this._stopAutomaticUpdate()!==!1){for(var t=this._tweeners.slice(0),e=0;e<t.length;e+=1)t[e].stop();return this._tweeners=t,null!==this._onStop&&this._onStop(),this}},_startAutomaticUpdate:function(){function t(){TINA._running===!0&&(TINA.update(),requestAnimFrame(t))}return this._running===!0?(console.warn("[TINA.start] TINA is already running"),!1):(this._running=!0,requestAnimFrame(t),!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 t=0;t<this._tweeners.length;t+=1)this._tweeners[t]._pause();return null!==this._onPause&&this._onPause(),this}},resume:function(){if(this._startAutomaticUpdate()!==!1){null!==this._onResume&&this._onResume();var t=clock.now(),e=t-this._time;this._startTime+=e;for(var n=0;n<this._tweeners.length;n+=1)this._tweeners[n]._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 t,e;if("undefined"!=typeof document.hidden?(t="hidden",e="visibilitychange"):"undefined"!=typeof document.mozHidden?(t="mozHidden",e="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(t="msHidden",e="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(t="webkitHidden",e="webkitvisibilitychange"),"undefined"==typeof document[t])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(e,function(){document[t]&&(n=TINA.isRunning(),n&&TINA._pauseOnLostFocus&&TINA.pause()),document[t]||n&&TINA._pauseOnLostFocus&&TINA.resume()},!1)}},pauseOnLostFocus:function(t){return t===!0&&this._pauseOnLostFocusInitialised===!1&&this._initialisePauseOnLostFocus(),this._pauseOnLostFocus=t,this},setDefaultTweener:function(t){this._defaultTweener=t,this._tweeners.push(this._defaultTweener)},getDefaultTweener:function(){return this._defaultTweener},_add:function(t){this._running===!1&&this.start(),this._tweeners.push(t)},add:function(t){return this._tweeners.push(t),this},_inactivate:function(t){var e=this._tweeners.indexOf(t);-1!==e&&this._tweeners.splice(e,1)},remove:function(t){return this._inactivate(t),this},_getDefaultTweener:function(){if(null===this._defaultTweener){var t=this.Timer;this._defaultTweener=(new t).start()}return this._defaultTweener}};module.exports=global.TINA=TINA;

}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],13:[function(require,module,exports){
function Ticker(t){return this instanceof Ticker==!1?new Ticker(t):(Tweener.call(this),this._tupt=t||1,void(this._nbTicks=0))}var Tweener=require("./Tweener");Ticker.prototype=Object.create(Tweener.prototype),Ticker.prototype.constructor=Ticker,module.exports=Ticker,Object.defineProperty(Ticker.prototype,"tupt",{get:function(){return this._tupt},set:function(t){0>t&&(this._warn("[Timer.tupt] tupt cannot be negative, stop messing with time."),t=0),this._tupt=t}}),Ticker.prototype._getElapsedTime=function(){return this._tupt*this._nbTicks++},Ticker.prototype._getSingleStepDuration=function(){return this._tupt},Ticker.prototype.convertToTicks=function(t){return t/this._tupt},Ticker.prototype.convertToTimeUnits=function(t){return t*this._tupt};
},{}],12:[function(require,module,exports){
function Ticker(t){return this instanceof Ticker==!1?new Ticker(t):(Tweener.call(this),void(this.tupt=t||1))}var Tweener=require("./Tweener");Ticker.prototype=Object.create(Tweener.prototype),Ticker.prototype.constructor=Ticker,module.exports=Ticker,Ticker.prototype._getElapsedTime=function(){return this._nbTicks+=this.tupt,this._nbTicks},Ticker.prototype._getSingleStepDuration=function(){return this.tupt},Ticker.prototype.convertToTicks=function(t){return t/this.tupt},Ticker.prototype.convertToTimeUnits=function(t){return t*this.tupt};
},{"./Tweener":19}],14:[function(require,module,exports){
},{"./Tweener":18}],13:[function(require,module,exports){
function Timeline(){return this instanceof Timeline==!1?new Timeline:void BriefPlayer.call(this)}var BriefPlayer=require("./BriefPlayer");Timeline.prototype=Object.create(BriefPlayer.prototype),Timeline.prototype.constructor=Timeline,module.exports=Timeline,Timeline.prototype.add=function(e,i){return(null===i||void 0===i)&&(i=0),e._startTime=i,this._add(e),this._duration=Math.max(this._duration,i+e.getDuration()),this};
},{"./BriefPlayer":4}],15:[function(require,module,exports){
},{"./BriefPlayer":4}],14:[function(require,module,exports){
function Timer(t){return this instanceof Timer==!1?new Timer(t):(Tweener.call(this),void(this._tups=t||1e3))}var Tweener=require("./Tweener");Timer.prototype=Object.create(Tweener.prototype),Timer.prototype.constructor=Timer,module.exports=Timer,Object.defineProperty(Timer.prototype,"tups",{get:function(){return this._tups},set:function(t){0>t&&(this._warn("[Timer.tups] tups cannot be negative, stop messing with time."),t=0),0===t?this._startTime+=this._time/this._tups-this._time:0===this._tups?this._startTime=this._time-this._time/t:this._startTime=this._time/this._tups-this._time/t,this._tups=t}}),Timer.prototype._getElapsedTime=function(t){return this._tups*(t-this._startTime)/1e3},Timer.prototype._getSingleStepDuration=function(t){return this._tups*t/1e3},Timer.prototype.convertToSeconds=function(t){return t/this._tups},Timer.prototype.convertToTimeUnits=function(t){return t*this._tups};
},{"./Tweener":19}],16:[function(require,module,exports){
},{"./Tweener":18}],15:[function(require,module,exports){
function update(t,i){var s=this.prop;t[s]=this.from[s]*(1-i)+this.to[s]*i}function updateP(t,i){for(var s=this.props,a=0;a<this.props.length;a+=1){var r=s[a];t[r]=this.from[r]*(1-i)+this.to[r]*i}}function updateI(t,i){var s=this.prop;t[s]=this.interps[s](i,this.from[s],this.to[s],this.interpParams[s])}function updatePI(t,i){for(var s=this.props,a=0;a<s.length;a+=1){var r=s[a];t[r]=this.interps[r](i,this.from[r],this.to[r],this.interpParams[r])}}function updateE(t,i){i=this.easing(i,this.easingParam);var s=this.prop;t[s]=this.from[s]*(1-i)+this.to[s]*i}function updatePE(t,i){var s=this.props;i=this.easing(i,this.easingParam);for(var a=0;a<s.length;a+=1){var r=s[a];t[r]=this.from[r]*(1-i)+this.to[r]*i}}function updateIE(t,i){var s=this.prop;t[s]=this.interps[s](this.easing(i,this.easingParam),this.from[s],this.to[s],this.interpParams[s])}function updatePIE(t,i){var s=this.props;i=this.easing(i,this.easingParam);for(var a=0;a<s.length;a+=1){var r=s[a];t[r]=this.interps[r](i,this.from[r],this.to[r],this.interpParams[r])}}function Transition(t,i,s,a,r,h,p,n,e){this.start=a,this.end=a+r,this.duration=r,this.from=i,this.to=s;var o;h?(o=1,this.easing=h,this.easingParam=p):o=0;var u;null===n?u=0:(u=1,this.interps=n,this.interpParams=e||{});var d;1===t.length?(d=0,this.prop=t[0]):(d=1,this.props=t),this.update=updateMethods[o][u][d]}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];module.exports=Transition;
},{}],17:[function(require,module,exports){
},{}],16:[function(require,module,exports){
function update(t,i){var s=this.prop,r=this.from[s]*(1-i)+this.to[s]*i;t[s]=t[s]+(r-this.prev),this.prev=r}function updateP(t,i){for(var s=this.props,r=0;r<this.props.length;r+=1){var h=s[r],e=this.from[h]*(1-i)+this.to[h]*i;t[h]=t[h]+(e-this.prev[h]),this.prev[h]=e}}function updateI(t,i){var s=this.prop,r=this.interps[s](i,this.from[s],this.to[s],this.interpParams[s]);t[s]=t[s]+(r-this.prev),this.prev=r}function updatePI(t,i){for(var s=this.properties,r=0;r<s.length;r+=1){var h=s[r],e=this.interps[h](i,this.from[h],this.to[h],this.interpParams[h]);t[h]=t[h]+(e-this.prev[h]),this.prev[h]=e}}function updateE(t,i){i=this.easing(i,this.easingParams);var s=this.prop,r=this.from[s]*(1-i)+this.to[s]*i;t[s]=t[s]+(r-this.prev),this.prev=r}function updatePE(t,i){var s=this.properties;i=this.easing(i,this.easingParams);for(var r=0;r<s.length;r+=1){var h=s[r],e=this.from[h]*(1-i)+this.to[h]*i;t[h]=t[h]+(e-this.prev[h]),this.prev[h]=e}}function updateIE(t,i){var s=this.prop,r=this.interps[s](this.easing(i,this.easingParams),this.from[s],this.to[s],this.interpParams[s]);t[s]=t[s]+(r-this.prev),this.prev=r}function updatePIE(t,i){var s=this.properties;i=this.easing(i,this.easingParams);for(var r=0;r<s.length;r+=1){var h=s[r],e=this.interps[h](i,this.from[h],this.to[h],this.interpParams[h]);t[h]=t[h]+(e-this.prev[h]),this.prev[h]=e}}function Transition(t,i,s,r,h,e,a,p,n){this.start=r,this.end=r+h,this.duration=h,this.from=i,this.to=s;var o;e?(o=1,this.easing=e,this.easingParam=a):o=0;var v;null===p?v=0:(v=1,this.interps=p,this.interpParams=n||{});var u;if(1===t.length)u=0,this.prop=t[0],this.prev=0;else{u=1,this.props=t,this.prev={};for(var d=0;d<t.length;d+=1)this.prev[t[d]]=0}this.update=updateMethods[o][v][u]}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];module.exports=Transition;
},{}],18:[function(require,module,exports){
},{}],17:[function(require,module,exports){
function Tween(e,t){return this instanceof Tween==!1?new Tween(e,t):(BriefPlayable.call(this),void AbstractTween.call(this,e,t))}var BriefPlayable=require("./BriefPlayable"),AbstractTween=require("./AbstractTween"),inherit=require("./inherit");Tween.prototype=Object.create(BriefPlayable.prototype),Tween.prototype.constructor=Tween,inherit(Tween,AbstractTween),module.exports=Tween;
},{"./AbstractTween":1,"./BriefPlayable":3,"./inherit":22}],19:[function(require,module,exports){
},{"./AbstractTween":1,"./BriefPlayable":3,"./inherit":21}],18:[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._moveTo=function(e,t){t=this._getSingleStepDuration(t)*this._speed,this._time=this._getElapsedTime(e-this._startTime)*this._speed,this._updatePlayableList(t),this._update(t),null!==this._onUpdate&&this._onUpdate(this._time,t)},Tweener.prototype.useAsDefault=function(){return TINA.setDefaultTweener(this),this};
},{"./Player":10,"./TINA":12}],20:[function(require,module,exports){
},{"./Player":9,"./TINA":11}],19:[function(require,module,exports){
var PI=Math.PI,PI_OVER_TWO=Math.PI/2,TWO_PI=2*Math.PI,EXP=2.718281828;exports.none=function(){return 1},exports.linear=function(t){return t},exports.flash=function(t,n){return t+t*n-t*t*n},exports.parabolic=function(t){var n=2*t-1;return 1-n*n},exports.trigo=function(t,n){return.5*(1-Math.cos(TWO_PI*t*n))},exports.elastic=function(t,n){if(1===t)return 1;n/=n+1;var r=(1+n)*Math.log(1-t)/Math.log(n);return Math.cos(r-PI_OVER_TWO)*Math.pow(n,r)},exports.quadIn=function(t){return t*t},exports.quadOut=function(t){return 2*t-t*t},exports.quadInOut=function(t){return.5>t?2*t*t:2*(2*t-t*t)-1},exports.cubicIn=function(t){return t*t*t},exports.cubicOut=function(t){return 3*t-3*t*t+t*t*t},exports.cubicInOut=function(t){return.5>t?4*t*t*t:4*(3*t-3*t*t+t*t*t)-3},exports.quarticIn=function(t){return t*t*t*t},exports.quarticOut=function(t){var n=t*t;return 4*t-6*n+4*n*t-n*n},exports.quarticOut=function(t){if(.5>t)return 8*t*t*t*t;var n=t*t;return 8*(4*t-6*n+4*n*t-n*n)-7},exports.polyIn=function(t,n){return Math.pow(t,n)},exports.polyOut=function(t,n){return 1-Math.pow(1-t,n)},exports.polyInOut=function(t,n){return.5>t?Math.pow(2*t,n)/2:(2-Math.pow(2*(1-t),n))/2},exports.sineIn=function(t){return 1-Math.cos(PI_OVER_TWO*t)},exports.sineOut=function(t){return Math.sin(PI_OVER_TWO*t)},exports.sineInOut=function(t){return.5>t?(1-Math.cos(PI*t))/2:(1+Math.sin(PI*(t-.5)))/2},exports.expIn=function(t,n){return(1-Math.pow(EXP,n*t))/(1-Math.pow(EXP,n))},exports.expOut=function(t,n){return(1-Math.pow(EXP,-n*t))/(1-Math.pow(EXP,-n))},exports.expInOut=function(t,n){return.5>t?(1-Math.pow(EXP,2*n*t))/(1-Math.pow(EXP,n))/2:.5+(1-Math.pow(EXP,n-2*n*t))/(1-Math.pow(EXP,-n))/2},exports.circIn=function(t){return 1-Math.sqrt(1-Math.pow(t,2))},exports.circOut=function(t){return Math.sqrt(1-Math.pow(1-t,2))},exports.circInOut=function(t){return.5>t?(1-Math.sqrt(1-4*t*t))/2:(1+Math.sqrt(-3+8*t-4*t*t))/2},exports.elasticIn=function(t,n){if(0===t)return 0;n/=n+1;var r=(1+n)*Math.log(t)/Math.log(n);return Math.cos(r)*Math.pow(n,r)},exports.elasticOut=function(t,n){if(1===t)return 1;n/=n+1;var r=(1+n)*Math.log(1-t)/Math.log(n);return 1-Math.cos(r)*Math.pow(n,r)},exports.elasticInOut=function(t,n){var r;return.5>t?0===t?0:(n/=n+1,r=(1+n)*Math.log(2*t)/Math.log(n),.5*Math.cos(r)*Math.pow(n,r)):1===t?1:(n/=n+1,r=(1+n)*Math.log(2-2*t)/Math.log(n),.5+.5*(1-Math.cos(r)*Math.pow(n,r)))},exports.bounceIn=function(t,n){if(0===t)return 0;n/=n+1;var r=(1+n)*Math.log(t)/Math.log(n);return Math.abs(Math.cos(r)*Math.pow(n,r))},exports.bounceOut=function(t,n){if(1===t)return 1;n/=n+1;var r=(1+n)*Math.log(1-t)/Math.log(n);return 1-Math.abs(Math.cos(r)*Math.pow(n,r))},exports.bounceInOut=function(t,n){var r;return.5>t?0===t?0:(n/=n+1,r=(1+n)*Math.log(2*t)/Math.log(n),Math.abs(.5*Math.cos(r)*Math.pow(n,r))):1===t?1:(n/=n+1,r=(1+n)*Math.log(2-2*t)/Math.log(n),.5+.5*(1-Math.abs(Math.cos(r)*Math.pow(n,r))))},exports.backIn=function(t,n){return t*t*((n+1)*t-n)},exports.backOut=function(t,n){return t-=1,t*t*((n+1)*t+n)+1},exports.backInOut=function(t,n){return.5>t?(t*=2,.5*(t*t*((n+1)*t-n))):(t=2*t-2,.5*(t*t*((n+1)*t+n))+1)};
},{}],21:[function(require,module,exports){
var TINA=require("./TINA.js");TINA.Delay=require("./Delay"),TINA.BriefExtension=require("./BriefExtension"),TINA.BriefPlayable=require("./BriefPlayable"),TINA.BriefPlayer=require("./BriefPlayer"),TINA.easing=require("./easing"),TINA.interpolation=require("./interpolation"),TINA.NestedTween=require("./NestedTween"),TINA.PixiTween=require("./NestedTween"),TINA.Playable=require("./Playable"),TINA.PlayableHandler=require("./PlayableHandler"),TINA.Player=require("./Player"),TINA.Sequence=require("./Sequence"),TINA.Ticker=require("./Ticker"),TINA.Timeline=require("./Timeline"),TINA.Timer=require("./Timer"),TINA.Tween=require("./Tween"),TINA.Tweener=require("./Tweener"),module.exports=TINA;
},{"./BriefExtension":2,"./BriefPlayable":3,"./BriefPlayer":4,"./Delay":5,"./NestedTween":7,"./Playable":8,"./PlayableHandler":9,"./Player":10,"./Sequence":11,"./TINA.js":12,"./Ticker":13,"./Timeline":14,"./Timer":15,"./Tween":18,"./Tweener":19,"./easing":20,"./interpolation":23}],22:[function(require,module,exports){
},{}],20:[function(require,module,exports){
var TINA=require("./TINA.js");TINA.Delay=require("./Delay"),TINA.BriefExtension=require("./BriefExtension"),TINA.BriefPlayable=require("./BriefPlayable"),TINA.BriefPlayer=require("./BriefPlayer"),TINA.easing=require("./easing"),TINA.interpolation=require("./interpolation"),TINA.NestedTween=require("./NestedTween"),TINA.PixiTween=require("./NestedTween"),TINA.Playable=require("./Playable"),TINA.Player=require("./Player"),TINA.Sequence=require("./Sequence"),TINA.Ticker=require("./Ticker"),TINA.Timeline=require("./Timeline"),TINA.Timer=require("./Timer"),TINA.Tween=require("./Tween"),TINA.Tweener=require("./Tweener"),module.exports=TINA;
},{"./BriefExtension":2,"./BriefPlayable":3,"./BriefPlayer":4,"./Delay":5,"./NestedTween":7,"./Playable":8,"./Player":9,"./Sequence":10,"./TINA.js":11,"./Ticker":12,"./Timeline":13,"./Timer":14,"./Tween":17,"./Tweener":18,"./easing":19,"./interpolation":22}],21:[function(require,module,exports){
module.exports=function(o,t){for(var e=Object.keys(t.prototype),p=0;p<e.length;p+=1){var r=e[p];o.prototype[r]=t.prototype[r]}};
},{}],23:[function(require,module,exports){
},{}],22:[function(require,module,exports){
exports.none=function(r,t,o){return o},exports.linear=function(r,t,o){return t*(1-r)+o*r},exports.discrete=function(r,t,o,n){return void 0===n&&(n=1),Math.floor((t*(1-r)+o*r)/n)*n},exports.vectorXY=function(r,t,o){return{x:t.x*(1-r)+o.x*r,y:t.y*(1-r)+o.y*r}},exports.vectorXYZ=function(r,t,o){return{x:t.x*(1-r)+o.x*r,y:t.y*(1-r)+o.y*r,z:t.z*(1-r)+o.z*r}},exports.vector=function(r,t,o){for(var n=[],e=0;e<t.length;e+=1)n[e]=t[e]*(1-r)+o[e]*r;return n},exports.state=function(r,t,o,n){var e=o.length+2,a=Math.floor(r*e);return 1>a?t:a>=e-1?o:n[a-1]},exports.colorRGB=function(r,t,o){return{r:t.r*(1-r)+o.r*r,g:t.g*(1-r)+o.g*r,b:t.b*(1-r)+o.b*r}},exports.colorRGBA=function(r,t,o){return{r:t.r*(1-r)+o.r*r,g:t.g*(1-r)+o.g*r,b:t.b*(1-r)+o.b*r,a:t.a*(1-r)+o.a*r}},exports.colorRGBToHexa=function(r,t,o){var n=Math.round(t.r*(1-r)+o.r*r),e=Math.round(t.g*(1-r)+o.g*r),a=Math.round(t.b*(1-r)+o.b*r);return"#"+n.toString(16)+e.toString(16)+a.toString(16)},exports.colorRGBToString=function(r,t,o){var n=Math.round(t.r*(1-r)+o.r*r),e=Math.round(t.g*(1-r)+o.g*r),a=Math.round(t.b*(1-r)+o.b*r);return"rgb("+n.toString(16)+","+e.toString(16)+","+a.toString(16)+")"},exports.colorRGBAToString=function(r,t,o){var n=Math.round(t.r*(1-r)+o.r*r),e=Math.round(t.g*(1-r)+o.g*r),a=Math.round(t.b*(1-r)+o.b*r),u=Math.round(t.a*(1-r)+o.a*r);return"rgba("+n.toString(16)+","+e.toString(16)+","+a.toString(16)+","+u+")"},exports.string=function(r,t,o){for(var n=t.length,e=o.length,a="",u=0;e>u;u+=1){var i=o.charCodeAt(u),f=u>=n?97>i?65:97:t.charCodeAt(u),c=Math.round(f*(1-r)+i*r);a+=String.fromCharCode(c)}return a},exports.bezierQuadratic=function(r,t,o,n){var e=1-r;return e*e*t+r*(2*e*n[0]+r*o)},exports.bezierCubic=function(r,t,o,n){var e=1-r;return e*e*e*t+r*(3*e*e*n[0]+r*(3*e*n[1]+r*o))},exports.bezierQuartic=function(r,t,o,n){var e=1-r,a=2*e;return a*a*t+r*(4*e*a*n[0]+r*(6*a*n[1]+r*(4*e*n[2]+r*o)))},exports.bezierQuintic=function(r,t,o,n){var e=1-r,a=2*e;return a*a*e*t+r*(5*a*a*n[0]+r*(10*e*a*n[1]+r*(10*a*n[2]+r*(5*e*n[3]+r*o))))},exports.bezier=function(r,t,o,n){var e=n.length,a=1-r,u=o,i=e;for(k=1;k<e;k-=1)u=u*r+i*Math.pow(a,k)*n[e-k],i*=(e-k)/(k+1);return u*r+t*Math.pow(a,e)},exports.bezier2d=function(r,t,o,n){for(var e,a,u=n.length,i=1-r,f=o[0],c=o[1],h=u,g=1;u>g;g-=1)e=h*Math.pow(i,g),a=n[u-g],f=f*r+e*a[0],c=c*r+e*a[1],h*=(u-g)/(g+1);return e=Math.pow(i,u),[f*r+t[0]*e,c*r+t[1]*e]},exports.bezier3d=function(r,t,o,n){for(var e,a,u=n.length,i=1-r,f=o[0],c=o[1],h=o[2],g=u,x=1;u>x;x-=1)e=g*Math.pow(i,x),a=n[u-x],f=f*r+e*a[0],c=c*r+e*a[1],h=h*r+e*a[2],g*=(u-x)/(x+1);return e=Math.pow(i,u),[f*r+t[0]*e,c*r+t[1]*e,h*r+t[2]*e]},exports.bezierKd=function(r,t,o,n){for(var e=n.length,a=1-r,u=t.length,i=[],f=0;u>f;f+=1)i[f]=o[f];for(var c,h,g=e,x=1;e>x;x-=1){for(c=g*Math.pow(a,x),h=n[e-x],f=0;u>f;f+=1)i[f]=i[f]*r+c*h[f];g*=(e-x)/(x+1)}for(c=Math.pow(a,e),f=0;u>f;f+=1)i[f]=i[f]*r+t[f]*c;return i},exports.catmullRom=function(r,t,o,n){if(1===r)return n;var e=t.length,a=o.length+1;r*=a;var u=Math.floor(r);r-=u;for(var i=r*r,f=r*i,c=-.5*f+1*i-.5*r,h=1.5*f-2.5*i+1,g=-1.5*f+2*i+.5*r,x=.5*f-.5*i,p=u-2,v=u-1,s=u,l=u+1,M=0>p?t:o[p],b=0>v?t:o[v],d=a-2>l?o[s]:n,S=a-2>l?o[l]:n,y=[],z=0;e>z;z+=1)y[z]=M[z]*c+b[z]*h+d[z]*g+S[z]*x;return y},exports.noise=function(){var r=[182,235,131,26,88,132,100,117,202,176,10,19,83,243,75,52,252,194,32,30,72,15,124,53,236,183,121,103,175,39,253,120,166,33,237,141,99,180,18,143,69,136,173,21,210,189,16,142,190,130,109,186,104,80,62,51,165,25,122,119,42,219,146,61,149,177,54,158,27,170,60,201,159,193,203,58,154,222,78,138,220,41,98,14,156,31,29,246,81,181,40,161,192,227,35,241,135,150,89,68,134,114,230,123,187,179,67,217,71,218,7,148,228,251,93,8,140,125,73,37,82,28,112,24,174,118,232,137,191,133,147,245,6,172,95,113,185,205,254,116,55,198,57,152,128,233,74,225,34,223,79,111,215,85,200,9,242,12,167,44,20,110,107,126,86,231,234,76,207,102,214,238,221,145,213,64,197,38,168,157,87,92,255,212,49,196,240,90,63,0,77,94,1,108,91,17,224,188,153,250,249,199,127,59,46,184,36,43,209,206,248,4,56,47,226,13,144,22,11,247,70,244,48,97,151,195,96,101,45,66,239,178,171,160,84,65,23,3,211,162,163,50,105,129,155,169,115,5,106,2,208,204,139,229,164,216,182],t=[-1,1];return function(o,n,e,a){for(var u=2,i=a.per||1,f=a.frq||2,c=a.oct||4,h=a.off||0,g=0,x=a.x+h,p=0;c>p;p+=1){var v=255&(x|x),s=x-(x|x),l=1-s;g+=u*(l*l*s*(3-2*l)*t[1&r[v]]-s*s*l*(3-2*s)*t[1&r[v+1]]),x*=(x-h)*f+h,u*=i}var M=1===i?1/c:.5*(1-i)/(1-Math.pow(i,c));return o+=g*M,n*(1-o)+e*o}}(),exports.simplex2d=function(){function r(r,t,o){return r[0]*t+r[1]*o}var t=[182,235,131,26,88,132,100,117,202,176,10,19,83,243,75,52,252,194,32,30,72,15,124,53,236,183,121,103,175,39,253,120,166,33,237,141,99,180,18,143,69,136,173,21,210,189,16,142,190,130,109,186,104,80,62,51,165,25,122,119,42,219,146,61,149,177,54,158,27,170,60,201,159,193,203,58,154,222,78,138,220,41,98,14,156,31,29,246,81,181,40,161,192,227,35,241,135,150,89,68,134,114,230,123,187,179,67,217,71,218,7,148,228,251,93,8,140,125,73,37,82,28,112,24,174,118,232,137,191,133,147,245,6,172,95,113,185,205,254,116,55,198,57,152,128,233,74,225,34,223,79,111,215,85,200,9,242,12,167,44,20,110,107,126,86,231,234,76,207,102,214,238,221,145,213,64,197,38,168,157,87,92,255,212,49,196,240,90,63,0,77,94,1,108,91,17,224,188,153,250,249,199,127,59,46,184,36,43,209,206,248,4,56,47,226,13,144,22,11,247,70,244,48,97,151,195,96,101,45,66,239,178,171,160,84,65,23,3,211,162,163,50,105,129,155,169,115,5,106,2,208,204,139,229,164,216,182,235,131,26,88,132,100,117,202,176,10,19,83,243,75,52,252,194,32,30,72,15,124,53,236,183,121,103,175,39,253,120,166,33,237,141,99,180,18,143,69,136,173,21,210,189,16,142,190,130,109,186,104,80,62,51,165,25,122,119,42,219,146,61,149,177,54,158,27,170,60,201,159,193,203,58,154,222,78,138,220,41,98,14,156,31,29,246,81,181,40,161,192,227,35,241,135,150,89,68,134,114,230,123,187,179,67,217,71,218,7,148,228,251,93,8,140,125,73,37,82,28,112,24,174,118,232,137,191,133,147,245,6,172,95,113,185,205,254,116,55,198,57,152,128,233,74,225,34,223,79,111,215,85,200,9,242,12,167,44,20,110,107,126,86,231,234,76,207,102,214,238,221,145,213,64,197,38,168,157,87,92,255,212,49,196,240,90,63,0,77,94,1,108,91,17,224,188,153,250,249,199,127,59,46,184,36,43,209,206,248,4,56,47,226,13,144,22,11,247,70,244,48,97,151,195,96,101,45,66,239,178,171,160,84,65,23,3,211,162,163,50,105,129,155,169,115,5,106,2,208,204,139,229,164,216],o=[[1,1],[-1,1],[1,-1],[-1,-1],[1,0],[-1,0],[1,0],[-1,0],[0,1],[0,-1],[0,1],[0,-1],[1,1],[-1,1],[1,-1],[-1,-1]];return function(n,e,a,u){for(var i=2,f=u.per||1,c=u.frq||2,h=u.oct||4,g=u.off||{x:0,y:0},x=x,p=u.x+g.x,v=u.y+g.y,s=0;h>s;s+=1){var l,M,b,d=.5*(Math.sqrt(3)-1),S=(p+v)*d,y=Math.floor(p+S),z=Math.floor(v+S),w=(3-Math.sqrt(3))/6,k=(y+z)*w,R=y-k,B=z-k;R=p-R,B=v-B;var C,G;R>B?(C=1,G=0):(C=0,G=1);var m=R-C+w,q=B-G+w,A=R-1+2*w,Q=B-1+2*w,T=255&y,X=255&z,Y=.5-R*R-B*B,H=.5-m*m-q*q,K=.5-A*A-Q*Q;if(0>Y)l=0;else{var Z=15&t[T+t[X]];Y*=Y,l=Y*Y*r(o[Z],R,B)}if(0>H)M=0;else{var j=15&t[T+C+t[X+G]];H*=H,M=H*H*r(o[j],m,q)}if(0>K)b=0;else{var D=15&t[T+1+t[X+1]];K*=K,b=K*K*r(o[D],A,Q)}x+=70*i*(l+M+b),p*=(p-g.x)*c+g.x,v*=(v-g.y)*c+g.y,i*=f}var E=1===f?1/h:.5*(1-f)/(1-Math.pow(f,h));return n+=x*E,e*(1-n)+a*n}}();
},{}]},{},[21]);
},{}]},{},[20]);
{
"name": "tina",
"version": "0.3.0",
"version": "0.3.1",
"description": "Tweening and INterpolations for Animation",

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

@@ -26,3 +26,3 @@ # TINA

Warning: Still in beta version!
Warning: Still in beta version! Do not be shy, [report issues](https://github.com/Wizcorp/tina.js/issues)

@@ -29,0 +29,0 @@ ## How to use

@@ -44,3 +44,3 @@

if (this._player !== null) {
this._player._onPlayableChange(this);
this._player._onPlayableChanged(this);
}

@@ -53,3 +53,3 @@ return this;

if (this._player !== null) {
this._player._onPlayableChange(this);
this._player._onPlayableChanged(this);
}

@@ -62,3 +62,3 @@ return this;

if (this._player !== null) {
this._player._onPlayableChange(this);
this._player._onPlayableChanged(this);
}

@@ -73,3 +73,3 @@ return this;

this._startTime += overflow;
this._player._onPlayableChange(this);
this._player._onPlayableChanged(this);
return;

@@ -76,0 +76,0 @@ }

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

var inherit = require('./inherit');
var PlayableHandler = require('./PlayableHandler');
var BriefExtension = require('./BriefExtension');
var inherit = require('./inherit');
var Player = require('./Player');
var BriefExtension = require('./BriefExtension');

@@ -10,9 +10,15 @@ /**

function BriefPlayer() {
PlayableHandler.call(this);
Player.call(this);
BriefExtension.call(this);
}
BriefPlayer.prototype = Object.create(PlayableHandler.prototype);
BriefPlayer.prototype = Object.create(Player.prototype);
BriefPlayer.prototype.constructor = BriefPlayer;
inherit(BriefPlayer, BriefExtension);
module.exports = BriefPlayer;
module.exports = BriefPlayer;
// BriefPlayer.prototype._onPlayableChanged = function (/* playable */) {};
// BriefPlayer.prototype._onPlayableRemoved = function (/* playable */) {};
BriefPlayer.prototype._onAllPlayablesRemoved = function () {
};

@@ -13,3 +13,2 @@ var TINA = require('./TINA.js');

TINA.Playable = require('./Playable');
TINA.PlayableHandler = require('./PlayableHandler');
TINA.Player = require('./Player');

@@ -16,0 +15,0 @@ // TINA.Recorder = require('./Recorder');

@@ -50,3 +50,3 @@ /** @class */

if (this._player !== null) {
this._player._onPlayableChange(this);
this._player._onPlayableChanged(this);
}

@@ -101,3 +101,3 @@ }

if (this._player !== null) {
this._player._onPlayableChange(this);
this._player._onPlayableChanged(this);
}

@@ -183,2 +183,7 @@ return this;

Playable.prototype._moveTo = function (time, dt) {
// N.B local time is calculated as follow: localTime = (GlobalTime - startTime) * speed
// Rather than using the following equation: localTime += dt
// The goal is to avoid stacking up rounding errors that could (in very rare cases)
// lead to callbacks not being triggered simultaneously, or not being triggered at all
dt *= this._speed;

@@ -185,0 +190,0 @@

@@ -1,2 +0,3 @@

var PlayableHandler = require('./PlayableHandler');
var Playable = require('./Playable');
var DoublyList = require('./DoublyList');

@@ -8,7 +9,226 @@ /**

function Player() {
PlayableHandler.call(this);
Playable.call(this);
// A DoublyList, rather than an Array, is used to store playables.
// It allows for faster removal and is similar in speed for iterations.
// Quick note: as of mid 2014 iterating through linked list was slower than iterating through arrays
// in safari and firefox as only V8 managed to have linked lists work as fast as arrays.
// As of mid 2015 it seems that performances are now identical in every major browsers.
// (KUDOs to the JS engines guys)
// List of active playables handled by this player
this._activePlayables = new DoublyList();
// List of inactive playables handled by this player
this._inactivePlayables = new DoublyList();
// List of playables that are not handled by this player anymore and are waiting to be removed
this._playablesToRemove = new DoublyList();
// Whether to silence warnings
this._silent = false;
// Whether to trigger the debugger on warnings
this._debug = false;
}
Player.prototype = Object.create(PlayableHandler.prototype);
Player.prototype = Object.create(Playable.prototype);
Player.prototype.constructor = Player;
module.exports = Player;
module.exports = Player;
Player.prototype._add = function (playable, delay) {
if (playable._handle === null) {
// Playable can be added
playable._handle = this._inactivePlayables.add(playable);
playable._player = this;
return true;
}
// Playable is already handled, either by this player or by another one
if (playable._handle.container === this._playablesToRemove) {
// Playable was being removed, removing from playables to remove
playable._handle = this._playablesToRemove.removeByReference(playable._handle);
return true;
}
if (playable._handle.container === this._activePlayables) {
this._warn('[Player._add] Playable is already present, and active');
return false;
}
if (playable._handle.container === this._inactivePlayables) {
this._warn('[Player._add] Playable is already present, but inactive (could be starting)');
return false;
}
this._warn('[Player._add] Playable is used elsewhere');
return false;
};
Player.prototype._remove = function (playable) {
if (playable._handle === null) {
this._warn('[Player._remove] Playable is not being used');
return false;
}
// Playable is handled, either by this player or by another one
if (playable._handle.container === this._activePlayables) {
// Playable was active, adding to remove list
playable._handle = this._playablesToRemove.add(playable._handle);
return true;
}
if (playable._handle.container === this._inactivePlayables) {
// Playable was inactive, removing from inactive playables
playable._handle = this._inactivePlayables.removeByReference(playable._handle);
return true;
}
if (playable._handle.container === this._playablesToRemove) {
this._warn('[Player._remove] Playable is already being removed');
return false;
}
this._warn('[Player._add] Playable is used elsewhere');
return false;
};
Player.prototype.remove = function (playable) {
if (playable._handle.container === this._activePlayables) {
playable.stop();
}
if (playable._handle.container !== this._playablesToRemove) {
this._remove(playable);
}
this._onPlayableRemoved(playable);
return this;
};
Player.prototype.removeAll = function () {
// Stopping all active playables
var handle = this._activePlayables.first;
while (handle !== null) {
var next = handle.next;
handle.object.stop();
handle = next;
}
this._handlePlayablesToRemove();
this._onAllPlayablesRemoved();
return this;
};
Player.prototype.possess = function (playable) {
if (playable._handle === null) {
return false;
}
return (playable._handle.container === this._activePlayables) || (playable._handle.container === this._inactivePlayables);
};
Player.prototype._handlePlayablesToRemove = function () {
while (this._playablesToRemove.length > 0) {
// O(1) where O stands for "Oh yeah"
// Removing from list of playables to remove
var handle = this._playablesToRemove.pop();
// Removing from list of active playables
var playable = handle.object;
playable._handle = this._activePlayables.removeByReference(handle);
playable._player = null;
}
};
Player.prototype.clear = function () {
this._activePlayables.clear();
this._inactivePlayables.clear();
this._playablesToRemove.clear();
this._controls.clear();
return this;
};
Player.prototype._warn = function (warning) {
// jshint debug: true
if (this._silent === false) {
console.warn(warning);
}
if (this._debug === true) {
debugger;
}
};
Player.prototype.silent = function (silent) {
this._silent = silent;
return this;
};
Player.prototype.debug = function (debug) {
this._debug = debug;
return this;
};
Player.prototype.stop = function () {
// Stopping all active playables
var handle = this._activePlayables.first;
while (handle !== null) {
var next = handle.next;
var playable = handle.object;
playable.stop();
handle = next;
}
this._handlePlayablesToRemove();
Playable.prototype.stop.call(this);
};
Player.prototype._activate = function (playable) {
// O(1)
this._inactivePlayables.removeByReference(playable._handle);
playable._handle = this._activePlayables.addBack(playable);
};
Player.prototype._inactivate = function (playable) {
// O(1)
this._activePlayables.removeByReference(playable._handle);
playable._handle = this._inactivePlayables.addBack(playable);
};
Player.prototype._updatePlayableList = function (dt) {
this._handlePlayablesToRemove();
// Activating playables
var handle = this._inactivePlayables.first;
while (handle !== null) {
var playable = handle.object;
// Fetching handle of next playable
handle = handle.next;
var startTime = playable._startTime;
var endTime = startTime + playable.getDuration();
if (startTime <= this._time && this._time <= endTime) {
// O(1)
this._inactivePlayables.removeByReference(playable._handle);
playable._handle = this._activePlayables.addBack(playable);
playable._start(this._time - startTime);
}
}
};
Player.prototype._update = function (dt) {
this._updatePlayableList(dt);
for (var handle = this._activePlayables.first; handle !== null; handle = handle.next) {
handle.object._moveTo(this._time, dt);
}
};
// Overridable methods
Player.prototype._onPlayableChanged = function (/* playable */) {};
Player.prototype._onPlayableRemoved = function (/* playable */) {};
Player.prototype._onAllPlayablesRemoved = function () {};

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