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.2 to 0.3.3

4

.jshintrc.json

@@ -53,3 +53,3 @@ {

"funcscope" : false, // true: Tolerate defining variables inside control statements
"globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
"globalstrict" : true, // true: Allow global "use strict" (also enables 'strict')
"iterator" : false, // true: Tolerate using the `__iterator__` property

@@ -80,3 +80,3 @@ "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block

"mootools" : false, // MooTools
"node" : false, // Node.js
"node" : true, // Node.js
"nonstandard" : false, // Widely adopted globals (escape, unescape, etc)

@@ -83,0 +83,0 @@ "phantom" : false, // PhantomJS

(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};
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._extendDuration(i),this},AbstractTween.prototype.wait=function(t){var i=this._getLastTransitionEnding();return this._transitions.push(new Temporisation(this._duration,t,i,this._properties)),this._extendDuration(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":15,"./TransitionRelative":16,"./easing":19,"./interpolation":22}],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.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)};
function BriefExtension(){this._duration=0,this._onComplete=null,this._iterations=1,this._pingpong=!1,this._persist=!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._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.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,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,e){if(i*=this._speed,void 0===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))}}else i>0?(e=Math.max((t-this._startTime)*this._speed-this._duration*this.iterations,0),this._time=this._duration):(e=Math.min((t-this._startTime)*this._speed,0),this._time=0),i-=e;this._update(i,e),null!==this._onUpdate&&this._onUpdate(this._time,i),void 0!==e&&this._complete(e)};

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

},{"./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(){};
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(){this._duration=0},BriefPlayer.prototype._updateDuration=function(){var e,t,r,i=0;for(e=this._activePlayables.first;null!==e;e=e.next)t=e.object,r=t._getEndTime()-this._duration,r>i&&(i=r);for(e=this._inactivePlayables.first;null!==e;e=e.next)t=e.object,r=t._getEndTime()-this._duration,r>i&&(i=r);i>0&&this._extendDuration(i)},BriefPlayer.prototype._onPlayableRemoved=function(){this._updateDuration()},BriefPlayer.prototype._onPlayableChanged=function(e){this._warn("[BriefPlayer._onPlayableChanged] Changing a playable's property after attaching it to a player may have unwanted side effects","playable:",e,"player:",this)};

@@ -21,14 +21,14 @@ },{"./BriefExtension":2,"./Player":9,"./inherit":21}],5:[function(require,module,exports){

},{}],7:[function(require,module,exports){
function NestedTween(e,t){if(this instanceof NestedTween==!1)return new NestedTween(e,t);BriefPlayable.call(this),this._tweensPerObject={},this._tweens=[],this._propertyChains={},this._propertyChainStrings=[];for(var r,n,s={},i={},o=0;o<t.length;o+=1){var h=t[o];if(n=h.substring(0,h.lastIndexOf(".")),void 0===i[n]){for(var p=h.split("."),a=p.length-1,_=e,w=0;a>w;w+=1)_=_[p[w]];r=p[a],_[r]instanceof Array?(i[h]=null,s[h]=_[r],this._propertyChainStrings.push(h),this._propertyChains[h]=p):(i[n]=[r],s[n]=_,this._propertyChainStrings.push(n),p.pop(),this._propertyChains[n]=p)}else r=h.substring(h.lastIndexOf(".")+1),i[n].push(r)}for(n in s){var f=s[n],l=i[n],u=new AbstractTween(f,l);this._tweens.push(u),this._tweensPerObject[n]=u}}var BriefPlayable=require("./BriefPlayable"),AbstractTween=require("./AbstractTween");NestedTween.prototype=Object.create(BriefPlayable.prototype),NestedTween.prototype.constructor=NestedTween,module.exports=NestedTween,NestedTween.prototype.relative=function(e){for(var t=0;t<this._tweens.length;t+=1)this._tweens[t].relative(e);return this},NestedTween.prototype.reset=function(){for(var e=0;e<this._tweens.length;e+=1)this._tweens[e].reset();return this._duration=0,this},NestedTween.prototype.interpolations=function(e){for(var t=0;t<this._propertyChainStrings.length;t+=1){for(var r=this._propertyChainStrings[t],n=this._propertyChains[r],s=n.length,i=e,o=0;s>o&&void 0!==i;o+=1)i=i[n[o]];void 0!==i&&this._tweensPerObject[r].interpolations(i)}return this},NestedTween.prototype.from=function(e){for(var t=0;t<this._propertyChainStrings.length;t+=1){for(var r=this._propertyChainStrings[t],n=this._propertyChains[r],s=n.length,i=e,o=0;s>o&&void 0!==i;o+=1)i=i[n[o]];void 0!==i&&this._tweensPerObject[r].from(i)}return this},NestedTween.prototype.to=function(e,t,r,n,s){for(var i=0;i<this._propertyChainStrings.length;i+=1){for(var o=this._propertyChainStrings[i],h=this._propertyChains[o],p=h.length,a=e,_=0;p>_;_+=1)a=a[h[_]];var w=s;for(_=0;p>_&&void 0!==w;_+=1)w=w[h[_]];this._tweensPerObject[o].to(a,t,r,n,w)}return this._duration+=t,this},NestedTween.prototype.wait=function(e){for(var t=0;t<this._tweens.length;t+=1)this._tweens[t].wait(e);return this._duration+=e,this},NestedTween.prototype._update=function(){for(var e=0;e<this._tweens.length;e+=1){var t=this._tweens[e];t._time=this._time,t._update()}};
function NestedTween(e,t){if(this instanceof NestedTween==!1)return new NestedTween(e,t);BriefPlayable.call(this),this._tweensPerObject={},this._tweens=[],this._propertyChains={},this._propertyChainStrings=[];for(var r,n,s={},i={},o=0;o<t.length;o+=1){var h=t[o];if(n=h.substring(0,h.lastIndexOf(".")),void 0===i[n]){for(var p=h.split("."),a=p.length-1,_=e,w=0;a>w;w+=1)_=_[p[w]];r=p[a],_[r]instanceof Array?(i[h]=null,s[h]=_[r],this._propertyChainStrings.push(h),this._propertyChains[h]=p):(i[n]=[r],s[n]=_,this._propertyChainStrings.push(n),p.pop(),this._propertyChains[n]=p)}else r=h.substring(h.lastIndexOf(".")+1),i[n].push(r)}for(n in s){var f=s[n],l=i[n],u=new AbstractTween(f,l);this._tweens.push(u),this._tweensPerObject[n]=u}}var BriefPlayable=require("./BriefPlayable"),AbstractTween=require("./AbstractTween");NestedTween.prototype=Object.create(BriefPlayable.prototype),NestedTween.prototype.constructor=NestedTween,module.exports=NestedTween,NestedTween.prototype.relative=function(e){for(var t=0;t<this._tweens.length;t+=1)this._tweens[t].relative(e);return this},NestedTween.prototype.reset=function(){for(var e=0;e<this._tweens.length;e+=1)this._tweens[e].reset();return this._duration=0,this},NestedTween.prototype.interpolations=function(e){for(var t=0;t<this._propertyChainStrings.length;t+=1){for(var r=this._propertyChainStrings[t],n=this._propertyChains[r],s=n.length,i=e,o=0;s>o&&void 0!==i;o+=1)i=i[n[o]];void 0!==i&&this._tweensPerObject[r].interpolations(i)}return this},NestedTween.prototype.from=function(e){for(var t=0;t<this._propertyChainStrings.length;t+=1){for(var r=this._propertyChainStrings[t],n=this._propertyChains[r],s=n.length,i=e,o=0;s>o&&void 0!==i;o+=1)i=i[n[o]];void 0!==i&&this._tweensPerObject[r].from(i)}return this},NestedTween.prototype.to=function(e,t,r,n,s){for(var i=0;i<this._propertyChainStrings.length;i+=1){for(var o=this._propertyChainStrings[i],h=this._propertyChains[o],p=h.length,a=e,_=0;p>_;_+=1)a=a[h[_]];var w=s;for(_=0;p>_&&void 0!==w;_+=1)w=w[h[_]];this._tweensPerObject[o].to(a,t,r,n,w)}return this._extendDuration(t),this},NestedTween.prototype.wait=function(e){for(var t=0;t<this._tweens.length;t+=1)this._tweens[t].wait(e);return this._extendDuration(e),this},NestedTween.prototype._update=function(){for(var e=0;e<this._tweens.length;e+=1){var t=this._tweens[e];t._time=this._time,t._update()}};
},{"./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._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(){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.getDuration=function(){return 1/0},Playable.prototype._getEndTime=function(){return this._speed>=0?1/0:this._startTime},Playable.prototype._getStartTime=function(){return this._speed>0?this._startTime:-(1/0)},Playable.prototype._isWithin=function(t){return this._speed>0?this._startTime<t:this._speed<0?t<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._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(){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 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())}},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(){};
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,t._isTimeWithin(this._time)&&(this._activate(t),t._start())}},Player.prototype._update=function(e,a){this._updatePlayableList(e);for(var t=this._activePlayables.first;null!==t;t=t.next)t.object._moveTo(this._time,e,a)},Player.prototype._onPlayableChanged=function(){},Player.prototype._onPlayableRemoved=function(){},Player.prototype._onAllPlayablesRemoved=function(){};
},{"./DoublyList":6,"./Playable":8}],10:[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};
function Sequence(){return this instanceof Sequence==!1?new Sequence:void Timeline.call(this)}var Timeline=require("./Timeline"),Delay=require("./Delay");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.add(new Delay(e))},Sequence.prototype._onPlayableRemoved=function(e){var t,i,r=e._startTime,n=r+e.getDuration();if(r>n){var a=r;r=n,n=a}if(this._time<n){var o=n-this._time;for(t=this._activePlayables.first;null!==t;t=t.next)i=t.object,e._startTime<i._startTime&&(i._startTime-=o);for(t=this._inactivePlayables.first;null!==t;t=t.next)i=t.object,e._startTime<i._startTime&&(i._startTime-=o)}if(this._time>r){var s=this._time-r;this._startTime+=s}this._updateDuration()};
},{"./Timeline":13}],11:[function(require,module,exports){
},{"./Delay":5,"./Timeline":13}],11:[function(require,module,exports){
(function (global){

@@ -42,3 +42,3 @@ 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;0>e?(e=1,this._startTime-=1,this._time+=1):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(){var t=clock.now(),e=t-this._time;this._startTime+=e,this._time=0},start:function(){if(this._startAutomaticUpdate()!==!1){null!==this._onStart&&this._onStart();for(var t=0;t<this._tweeners.length;t+=1)this._tweeners[t]._start();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.reset(),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();for(var t=0;t<this._tweeners.length;t+=1)this._tweeners[t]._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;

},{"./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};
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){(null===i||void 0===i)&&(i=0),e._setStartTime(i),this._add(e);var t=e._getEndTime();return t>this._duration&&this._setDuration(t),this};

@@ -49,6 +49,6 @@ },{"./BriefPlayer":4}],14:[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;
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,o){this.start=a,this.end=a+r,this.duration=r,this.from=i,this.to=s;var e;h?(e=1,this.easing=h,this.easingParam=p):e=0;var u;null===n?u=0:(u=1,this.interps=n,this.interpParams=o||{});var d;1===t.length?(d=0,this.prop=t[0],this.props=null):(d=1,this.prop=null,this.props=t),this.update=updateMethods[e][u][d]}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];module.exports=Transition;
},{}],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;
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;

@@ -55,0 +55,0 @@ },{}],17:[function(require,module,exports){

{
"name": "tina",
"version": "0.3.2",
"version": "0.3.3",
"description": "Tweening and INterpolations for Animation",

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

@@ -172,3 +172,3 @@ var Transition = require('./Transition');

this._transitions.push(transition);
this._duration += duration;
this._extendDuration(duration);
return this;

@@ -180,3 +180,3 @@ };

this._transitions.push(new Temporisation(this._duration, duration, toObject, this._properties));
this._duration += duration;
this._extendDuration(duration);
return this;

@@ -183,0 +183,0 @@ };

@@ -27,2 +27,56 @@

BriefExtension.prototype._setDuration = function (duration) {
this._duration = duration;
if (this._player !== null) {
this._player._onPlayableChanged(this);
}
};
BriefExtension.prototype._extendDuration = function (durationExtension) {
this._duration += durationExtension;
if (this._player !== null) {
this._player._onPlayableChanged(this);
}
};
BriefExtension.prototype._getEndTime = function () {
if (this._speed > 0) {
return this._startTime + this.getDuration();
} else if (this._speed < 0) {
return this._startTime;
} else {
return Infinity;
}
};
BriefExtension.prototype._setStartTime = function (startTime) {
if (this._speed > 0) {
this._startTime = startTime;
} else if (this._speed < 0) {
this._startTime = startTime - this.getDuration();
} else {
this._startTime = Infinity;
}
};
BriefExtension.prototype._getStartTime = function () {
if (this._speed > 0) {
return this._startTime;
} else if (this._speed < 0) {
return this._startTime + this.getDuration();
} else {
return -Infinity;
}
};
BriefExtension.prototype._isTimeWithin = function (time) {
if (this._speed > 0) {
return (this._startTime < time) && (time < this._startTime + this.getDuration());
} else if (this._speed < 0) {
return (this._startTime + this.getDuration() < time) && (time < this._startTime);
} else {
return true;
}
};
BriefExtension.prototype.goToEnd = function () {

@@ -52,5 +106,2 @@ this.goTo(this.getDuration(), this._iterations - 1);

this._persist = persist;
if (this._player !== null) {
this._player._onPlayableChanged(this);
}
return this;

@@ -88,69 +139,91 @@ };

BriefExtension.prototype._moveTo = function (time, dt) {
BriefExtension.prototype._moveTo = function (time, dt, overflow) {
dt *= this._speed;
// Computing overflow and clamping time
var overflow;
if (dt !== 0) {
if (this._iterations === 1) {
// Converting into local time (relative to speed and starting time)
this._time = (time - this._startTime) * this._speed;
if (dt > 0) {
if (this._time >= this._duration) {
overflow = this._time - this._duration;
dt -= overflow;
this._time = this._duration;
// So many conditions!!
// That is why this extension exists
if (overflow === undefined) {
// Computing overflow and clamping time
if (dt !== 0) {
if (this._iterations === 1) {
// Converting into local time (relative to speed and starting time)
this._time = (time - this._startTime) * this._speed;
if (dt > 0) {
if (this._time >= this._duration) {
overflow = this._time - this._duration;
dt -= overflow;
this._time = this._duration;
}
} else if (dt < 0) {
if (this._time <= 0) {
overflow = this._time;
dt -= overflow;
this._time = 0;
}
}
} else if (dt < 0) {
if (this._time <= 0) {
overflow = this._time;
dt -= overflow;
this._time = 0;
}
}
} else {
time = (time - this._startTime) * this._speed;
} else {
time = (time - this._startTime) * this._speed;
// Iteration at current update
var iteration = time / this._duration;
// Iteration at current update
var iteration = time / this._duration;
if (dt > 0) {
if (iteration < this._iterations) {
this._time = time % this._duration;
} else {
overflow = (iteration - this._iterations) * this._duration;
dt -= overflow;
this._time = this._duration * (1 - (Math.ceil(this._iterations) - this._iterations));
if (dt > 0) {
if (iteration < this._iterations) {
// if (this._time !== 0 && Math.ceil(iteration) !== Math.ceil(this._time / this._duration)) {
// }
this._time = time % this._duration;
} else {
overflow = (iteration - this._iterations) * this._duration;
dt -= overflow;
this._time = this._duration * (1 - (Math.ceil(this._iterations) - this._iterations));
}
} else if (dt < 0) {
if (0 < iteration) {
// if (this._time !== this._duration && Math.ceil(iteration) !== Math.ceil(this._time / this._duration)) {
// }
this._time = time % this._duration;
} else {
overflow = iteration * this._duration;
dt -= overflow;
this._time = 0;
}
}
} else if (dt < 0) {
if (0 < iteration) {
this._time = time % this._duration;
} else {
overflow = iteration * this._duration;
dt -= overflow;
this._time = 0;
}
}
if ((this._pingpong === true)) {
if (Math.ceil(this._iterations) === this._iterations) {
if (overflow === undefined) {
if ((Math.ceil(iteration) & 1) === 0) {
this._time = this._duration - this._time;
if ((this._pingpong === true)) {
if (Math.ceil(this._iterations) === this._iterations) {
if (overflow === undefined) {
if ((Math.ceil(iteration) & 1) === 0) {
this._time = this._duration - this._time;
}
} else {
if ((Math.ceil(iteration) & 1) === 1) {
this._time = this._duration - this._time;
}
}
} else {
if ((Math.ceil(iteration) & 1) === 1) {
if ((Math.ceil(iteration) & 1) === 0) {
this._time = this._duration - this._time;
}
}
} else {
if ((Math.ceil(iteration) & 1) === 0) {
this._time = this._duration - this._time;
}
}
}
}
} else {
// Ensuring that the playable overflows when its player overflows
// This conditional is to deal with Murphy's law:
// There is one in a billion chance that a player completes while one of his playable
// does not complete due to stupid rounding errors
if (dt > 0) {
overflow = Math.max((time - this._startTime) * this._speed - this._duration * this.iterations, 0);
this._time = this._duration;
} else {
overflow = Math.min((time - this._startTime) * this._speed, 0);
this._time = 0;
}
dt -= overflow;
}
this._update(dt);
this._update(dt, overflow);

@@ -157,0 +230,0 @@ if (this._onUpdate !== null) {

@@ -5,6 +5,2 @@ var inherit = require('./inherit');

/**
* @classdesc
* Manages the update of a list of playable with respect to a given elapsed time.
*/
function BriefPlayer() {

@@ -20,6 +16,48 @@ Player.call(this);

// BriefPlayer.prototype._onPlayableChanged = function (/* playable */) {};
// BriefPlayer.prototype._onPlayableRemoved = function (/* playable */) {};
BriefPlayer.prototype._onAllPlayablesRemoved = function () {
this._duration = 0;
};
BriefPlayer.prototype._updateDuration = function () {
var durationExtension = 0;
var handle, playable, overflow;
for (handle = this._activePlayables.first; handle !== null; handle = handle.next) {
playable = handle.object;
overflow = playable._getEndTime() - this._duration;
if (overflow > durationExtension) {
durationExtension = overflow;
}
}
for (handle = this._inactivePlayables.first; handle !== null; handle = handle.next) {
playable = handle.object;
overflow = playable._getEndTime() - this._duration;
if (overflow > durationExtension) {
durationExtension = overflow;
}
}
if (durationExtension > 0) {
this._extendDuration(durationExtension);
}
};
BriefPlayer.prototype._onPlayableRemoved = function () {
this._updateDuration();
};
BriefPlayer.prototype._onPlayableChanged = function (changedPlayable) {
this._warn('[BriefPlayer._onPlayableChanged] Changing a playable\'s property after attaching it to a player may have unwanted side effects',
'playable:', changedPlayable, 'player:', this);
// N.B The following code should work
// // Updating timeline duration
// var endTime = changedPlayable._startTime + changedPlayable.getDuration();
// if (endTime > this._duration) {
// this._duration = endTime;
// } else {
// // Making sure the duration is correct
// this._updateDuration();
// }
};

@@ -167,3 +167,3 @@ var BriefPlayable = require('./BriefPlayable');

this._duration += duration;
this._extendDuration(duration);
return this;

@@ -178,3 +178,3 @@ };

this._duration += duration;
this._extendDuration(duration);
return this;

@@ -181,0 +181,0 @@ };

@@ -10,17 +10,17 @@ /** @class */

// Starting time, is global (relative to its player time)
this._startTime = 0;
this._startTime = 0;
// Current time, is local (relative to starting time)
// i.e this._time === 0 implies this._player._time === this._startTime
this._time = 0;
this._time = 0;
// Playing speed of the playable
this._speed = 1;
this._speed = 1;
// Callbacks
this._onStart = null;
this._onPause = null;
this._onResume = null;
this._onUpdate = null;
this._onStop = null;
this._onStart = null;
this._onPause = null;
this._onResume = null;
this._onUpdate = null;
this._onStop = null;
}

@@ -106,2 +106,33 @@

Playable.prototype.getDuration = function () {
return Infinity;
};
Playable.prototype._getEndTime = function () {
if (this._speed >= 0) {
return Infinity;
} else {
return this._startTime;
}
};
Playable.prototype._getStartTime = function () {
if (this._speed > 0) {
return this._startTime;
} else {
return -Infinity;
}
};
Playable.prototype._isWithin = function (time) {
if (this._speed > 0) {
return this._startTime < time;
} else if (this._speed < 0) {
return time < this._startTime;
} else {
// speed is 0
return true;
}
};
Playable.prototype.rewind = function () {

@@ -179,2 +210,3 @@ this.goTo(0, 0);

}
return this;

@@ -181,0 +213,0 @@ };

@@ -204,3 +204,3 @@ var Playable = require('./Playable');

// Activating playables
var handle = this._inactivePlayables.first;
var handle = this._inactivePlayables.first;
while (handle !== null) {

@@ -212,9 +212,5 @@ var playable = handle.object;

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);
// Starting if player time within playable bounds
if (playable._isTimeWithin(this._time)) {
this._activate(playable);
playable._start();

@@ -225,6 +221,6 @@ }

Player.prototype._update = function (dt) {
Player.prototype._update = function (dt, overflow) {
this._updatePlayableList(dt);
for (var handle = this._activePlayables.first; handle !== null; handle = handle.next) {
handle.object._moveTo(this._time, dt);
handle.object._moveTo(this._time, dt, overflow);
}

@@ -231,0 +227,0 @@ };

@@ -119,8 +119,4 @@ var BriefPlayable = require('./BriefPlayable');

this.isIn = !this.isIn;
if (isIn === true) {
if (this.onIn !== null) {
this.onIn();
}
} else {
isOut = true;
if (isIn === true && this.onIn !== null) {
this.onIn();
}

@@ -200,3 +196,2 @@ } else if (this.isIn === false) {

// Can end only in playing mode
// TODO: set starting time and duration when switching to playing mode
this._duration = Infinity;

@@ -313,2 +308,5 @@

// Setting duration to Infinity, so that the recording never completes
this._duration = Infinity;
if (this._onStartRecording !== null) {

@@ -337,2 +335,11 @@ this._onStartRecording();

// Setting playing head to the beginning of the recordings
// and setting duration to the total recording duration
if (this._time > this._recordingDuration) {
this._startTime += this._time - this._recordingDuration;
this._duration = this._recordingDuration;
} else {
this._duration = this._time;
}
if (this._onStartPlaying !== null) {

@@ -380,3 +387,2 @@ this._onStartPlaying();

}
};
var Timeline = require('./Timeline');
var Delay = require('./Delay');

@@ -31,4 +32,46 @@ /**

Sequence.prototype.addDelay = function (duration) {
this._duration += duration;
return this;
};
return this.add(new Delay(duration));
};
Sequence.prototype._onPlayableRemoved = function (removedPlayable) {
var handle, playable;
var startTime = removedPlayable._startTime;
var endTime = startTime + removedPlayable.getDuration();
if (startTime > endTime) {
var tmp = startTime;
startTime = endTime;
endTime = tmp;
}
if (this._time < endTime) { // Playing head is before the end of the removed playable
// Shifting all the playables that come after the removed playable
var leftShit = endTime - this._time;
for (handle = this._activePlayables.first; handle !== null; handle = handle.next) {
playable = handle.object;
if (removedPlayable._startTime < playable._startTime) {
playable._startTime -= leftShit;
}
}
for (handle = this._inactivePlayables.first; handle !== null; handle = handle.next) {
playable = handle.object;
if (removedPlayable._startTime < playable._startTime) {
playable._startTime -= leftShit;
}
}
}
if (this._time > startTime) { // Playing head is after the start of the removed playable
// Shifting the starting time of the sequence
var rightShift = this._time - startTime;
this._startTime += rightShift;
}
this._updateDuration();
};
// TODO:
// Sequence.prototype.substitute = function (playableA, playableB) {
// };

@@ -31,6 +31,11 @@ var BriefPlayer = require('./BriefPlayer');

playable._startTime = startTime;
playable._setStartTime(startTime);
this._add(playable);
this._duration = Math.max(this._duration, startTime + playable.getDuration());
var endTime = playable._getEndTime();
if (endTime > this._duration) {
this._setDuration(endTime);
}
return this;
};
};

@@ -123,7 +123,9 @@ // The file is a good representation of the constant fight between maintainability and performance

if (properties.length === 1) {
propsFlag = 0;
this.prop = properties[0];
propsFlag = 0;
this.prop = properties[0]; // string
this.props = null;
} else {
propsFlag = 1;
this.props = properties;
this.prop = null;
this.props = properties; // array
}

@@ -130,0 +132,0 @@

@@ -16,4 +16,4 @@

var now = this.from[p] * (1 - t) + this.to[p] * t;
object[p] = object[p] + (now - this.prev[p]);
this.prev[p] = now;
object[p] = object[p] + (now - this.prevs[p]);
this.prevs[p] = now;
}

@@ -33,8 +33,8 @@ }

function updatePI(object, t) {
var q = this.properties;
var q = this.props;
for (var i = 0; i < q.length; i += 1) {
var p = q[i];
var now = this.interps[p](t, this.from[p], this.to[p], this.interpParams[p]);
object[p] = object[p] + (now - this.prev[p]);
this.prev[p] = now;
object[p] = object[p] + (now - this.prevs[p]);
this.prevs[p] = now;
}

@@ -55,3 +55,3 @@ }

function updatePE(object, t) {
var q = this.properties;
var q = this.props;
t = this.easing(t, this.easingParams);

@@ -61,4 +61,4 @@ for (var i = 0; i < q.length; i += 1) {

var now = this.from[p] * (1 - t) + this.to[p] * t;
object[p] = object[p] + (now - this.prev[p]);
this.prev[p] = now;
object[p] = object[p] + (now - this.prevs[p]);
this.prevs[p] = now;
}

@@ -80,3 +80,3 @@ }

function updatePIE(object, t) {
var q = this.properties;
var q = this.props;
t = this.easing(t, this.easingParams);

@@ -86,4 +86,4 @@ for (var i = 0; i < q.length; i += 1) {

var now = this.interps[p](t, this.from[p], this.to[p], this.interpParams[p]);
object[p] = object[p] + (now - this.prev[p]);
this.prev[p] = now;
object[p] = object[p] + (now - this.prevs[p]);
this.prevs[p] = now;
}

@@ -139,11 +139,15 @@ }

if (properties.length === 1) {
propsFlag = 0;
this.prop = properties[0];
this.prev = 0;
propsFlag = 0;
this.prop = properties[0]; // string
this.props = null;
this.prev = 0;
this.prevs = null;
} else {
propsFlag = 1;
this.props = properties;
this.prev = {};
this.prop = null;
this.props = properties; // array
this.prev = null;
this.prevs = {};
for (var p = 0; p < properties.length; p += 1) {
this.prev[properties[p]] = 0;
this.prevs[properties[p]] = 0;
}

@@ -150,0 +154,0 @@ }

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