Comparing version 0.2.7 to 0.2.8
@@ -1,2 +0,66 @@ | ||
function require(name){var module=require.modules[name];if(!module)throw new Error('failed to require "'+name+'"');if(!("exports"in module)&&typeof module.definition==="function"){module.client=module.component=true;module.definition.call(this,module.exports={},module);delete module.definition}return module.exports}require.loader="component";require.helper={};require.helper.semVerSort=function(a,b){var aArray=a.version.split(".");var bArray=b.version.split(".");for(var i=0;i<aArray.length;++i){var aInt=parseInt(aArray[i],10);var bInt=parseInt(bArray[i],10);if(aInt===bInt){var aLex=aArray[i].substr((""+aInt).length);var bLex=bArray[i].substr((""+bInt).length);if(aLex===""&&bLex!=="")return 1;if(aLex!==""&&bLex==="")return-1;if(aLex!==""&&bLex!=="")return aLex>bLex?1:-1;continue}else if(aInt>bInt){return 1}else{return-1}}return 0};require.latest=function(name,returnPath){function showError(name){throw new Error('failed to find latest module of "'+name+'"')}var versionRegexp=/(.*)~(.*)@v?(\d+\.\d+\.\d+[^\/]*)$/;var remoteRegexp=/(.*)~(.*)/;if(!remoteRegexp.test(name))showError(name);var moduleNames=Object.keys(require.modules);var semVerCandidates=[];var otherCandidates=[];for(var i=0;i<moduleNames.length;i++){var moduleName=moduleNames[i];if(new RegExp(name+"@").test(moduleName)){var version=moduleName.substr(name.length+1);var semVerMatch=versionRegexp.exec(moduleName);if(semVerMatch!=null){semVerCandidates.push({version:version,name:moduleName})}else{otherCandidates.push({version:version,name:moduleName})}}}if(semVerCandidates.concat(otherCandidates).length===0){showError(name)}if(semVerCandidates.length>0){var module=semVerCandidates.sort(require.helper.semVerSort).pop().name;if(returnPath===true){return module}return require(module)}var module=otherCandidates.sort(function(a,b){return a.name>b.name})[0].name;if(returnPath===true){return module}return require(module)};require.modules={};require.register=function(name,definition){require.modules[name]={definition:definition}};require.define=function(name,exports){require.modules[name]={exports:exports}};require.register("tina/src/AbstractTween.js",function(exports,module){var Transition=require("tina/src/Transition.js");var TransitionRelative=require("tina/src/TransitionRelative.js");var easingFunctions=require("tina/src/easing.js");var interpolationFunctions=require("tina/src/interpolation.js");function Temporisation(start,duration,toObject,properties){this.start=start;this.end=start+duration;this.duration=duration;this.properties=properties;this.to=toObject}Temporisation.prototype.update=function(object){for(var p=0;p<this.properties.length;p+=1){var property=this.properties[p];object[property]=this.to[property]}};function AbstractTween(object,properties){this._object=object;if((properties===null||properties===undefined)&&object instanceof Array){properties=[];for(var p=0;p<object.length;p+=1){properties[p]=p}}this._properties=properties;this._from=null;this._interpolations=null;this._index=0;this._transitions=[];this._relative=false;this._time=0;this._duration=0}module.exports=AbstractTween;AbstractTween.prototype.relative=function(relative){this._relative=relative;return this};AbstractTween.prototype.reset=function(){this._index=0;this._transitions=[];return this};AbstractTween.prototype.interpolations=function(interpolations){for(var p=0;p<this._properties.length;p+=1){var property=this._properties[p];var interpolation=interpolations[property];if(interpolation===undefined){interpolations[property]=interpolationFunctions.linear;continue}if(typeof interpolation==="string"){if(interpolationFunctions[interpolation]===undefined){console.warn("[AbstractTween.interpolations] Given interpolation does not exist");interpolations[property]=interpolationFunctions.linear}else{interpolations[property]=interpolationFunctions[interpolation]}}}this._interpolations=interpolations;return this};AbstractTween.prototype.from=function(fromObject){this._from=fromObject;if(this._transitions.length>0){this._transitions[0].from=fromObject}return this};AbstractTween.prototype._setFrom=function(){this._from={};for(var p=0;p<this._properties.length;p+=1){var property=this._properties[p];this._from[property]=this._relative===true?0:this._object[property]}return this._from};AbstractTween.prototype._getLastTransitionEnding=function(){if(this._transitions.length>0){return this._transitions[this._transitions.length-1].to}else{return this._from===null?this._setFrom():this._from}};AbstractTween.prototype.to=function(toObject,duration,easing,easingParam,interpolationParams){if(typeof easing==="string"){if(easingFunctions[easing]===undefined){console.warn("[AbstractTween.to] Given easing does not exist");easing=undefined}else{easing=easingFunctions[easing]}}var fromObject=this._getLastTransitionEnding();var TransitionConstructor=this._relative===true?TransitionRelative:Transition;var transition=new TransitionConstructor(this._properties,fromObject,toObject,this._duration,duration,easing,easingParam,this._interpolations,interpolationParams);this._transitions.push(transition);this._duration+=duration;return this};AbstractTween.prototype.wait=function(duration){var toObject=this._getLastTransitionEnding();this._transitions.push(new Temporisation(this._duration,duration,toObject,this._properties));this._duration+=duration;return this};AbstractTween.prototype._update=function(){var transition=this._transitions[this._index];while(transition.end<=this._time){if(this._index===this._transitions.length-1){transition.update(this._object,1);return}transition=this._transitions[++this._index]}while(this._time<=transition.start){if(this._index===0){transition.update(this._object,0);return}transition=this._transitions[--this._index]}transition.update(this._object,(this._time-transition.start)/transition.duration)}});require.register("tina/src/BoundedPlayable.js",function(exports,module){var Playable=require("tina/src/Playable.js");function BoundedPlayable(){Playable.call(this);this._duration=0;this._iterations=1;this._persist=false;this._pingpong=false;this._onComplete=null}BoundedPlayable.prototype=Object.create(Playable.prototype);BoundedPlayable.prototype.constructor=BoundedPlayable;module.exports=BoundedPlayable;BoundedPlayable.prototype.onComplete=function(onComplete){this._onComplete=onComplete;return this};BoundedPlayable.prototype.getDuration=function(){return this._duration*this._iterations/this._speed};BoundedPlayable.prototype.goToEnd=function(){this.goTo(this.getDuration(),this._iterations-1);return this};BoundedPlayable.prototype.loop=function(){return this.iterations(Infinity)};BoundedPlayable.prototype.iterations=function(iterations){if(iterations<0){console.warn("[BoundedPlayable.iterations] Number of iterations cannot be negative");return this}this._iterations=iterations;return this};BoundedPlayable.prototype.persist=function(persist){this._persist=persist;return this};BoundedPlayable.prototype.pingpong=function(pingpong){this._pingpong=pingpong;return this};BoundedPlayable.prototype._complete=function(overflow){if(this._persist===true){this._startTime+=overflow;return}if(this._player._inactivate(this)===false){return this}if(this._onComplete!==null){this._onComplete(overflow)}};BoundedPlayable.prototype._moveTo=function(time,dt){dt*=this._speed;var overflow;if(this._speed!==0){if(this._iterations===1){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{time=(time-this._startTime)*this._speed;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))}}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}}else{if((Math.ceil(iteration)&1)===1){this._time=this._duration-this._time}}}else{if((Math.ceil(iteration)&1)===0){this._time=this._duration-this._time}}}}}this._update(dt);if(this._onUpdate!==null){this._onUpdate(this._time,dt)}if(overflow!==undefined){this._complete(overflow)}};BoundedPlayable.prototype._update=function(){}});require.register("tina/src/BoundedPlayer.js",function(exports,module){var BoundedPlayable=require("tina/src/BoundedPlayable.js");var PlayableHandler=require("tina/src/PlayableHandler.js");var inherit=require("tina/src/inherit.js");function BoundedPlayer(){BoundedPlayable.call(this);PlayableHandler.call(this)}BoundedPlayer.prototype=Object.create(BoundedPlayable.prototype);BoundedPlayer.prototype.constructor=BoundedPlayer;inherit(BoundedPlayer,PlayableHandler);module.exports=BoundedPlayer;BoundedPlayer.prototype._delay=function(){this._warn("[BoundedPlayer._delay] This player does not support the delay functionality",this)};BoundedPlayer.prototype.stop=function(){var handle=this._activePlayables.first;while(handle!==null){var next=handle.next;var playable=handle.object;playable.stop();handle=next}this._handlePlayablesToRemove();if(this._player._inactivate(this)===false){return this}this._stop();return this};BoundedPlayer.prototype._moveTo=function(time,dt){dt*=this._speed;var overflow;if(this._iterations===1){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{time=(time-this._startTime)*this._speed;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))}}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}}else{if((Math.ceil(iteration)&1)===1){this._time=this._duration-this._time}}}else{if((Math.ceil(iteration)&1)===0){this._time=this._duration-this._time}}}}this._updatePlayableList();this._update(dt);if(this._onUpdate!==null){this._onUpdate(this._time,dt)}if(overflow!==undefined){this._complete(overflow)}};BoundedPlayer.prototype._updatePlayableList=function(){}});require.register("tina/src/Delay.js",function(exports,module){var BoundedPlayable=require("tina/src/BoundedPlayable.js");function Delay(duration){if(this instanceof Delay===false){return new Delay(duration)}BoundedPlayable.call(this);this._duration=duration}Delay.prototype=Object.create(BoundedPlayable.prototype);Delay.prototype.constructor=Delay;module.exports=Delay});require.register("tina/src/DoublyList.js",function(exports,module){function ListNode(obj,prev,next,container){this.object=obj;this.prev=prev;this.next=next;this.container=container}function DoublyList(){this.first=null;this.last=null;this.length=0}module.exports=DoublyList;DoublyList.prototype.addFront=function(obj){var newNode=new ListNode(obj,null,this.first,this);if(this.first===null){this.first=newNode;this.last=newNode}else{this.first.prev=newNode;this.first=newNode}this.length+=1;return newNode};DoublyList.prototype.add=DoublyList.prototype.addFront;DoublyList.prototype.addBack=function(obj){var newNode=new ListNode(obj,this.last,null,this);if(this.first===null){this.first=newNode;this.last=newNode}else{this.last.next=newNode;this.last=newNode}this.length+=1;return newNode};DoublyList.prototype.popFront=function(obj){var object=this.first.object;this.remove(this.first);return object};DoublyList.prototype.pop=DoublyList.prototype.popFront;DoublyList.prototype.popBack=function(obj){var object=this.last.object;this.remove(this.last);return object};DoublyList.prototype.remove=function(node){if(node.container!==this){console.warn("[DoublyList.remove] Trying to remove a node that does not belong to the list");return node}if(node.next===null){this.last=node.prev}else{node.next.prev=node.prev}if(node.prev===null){this.first=node.next}else{node.prev.next=node.next}node.container=null;this.length-=1;return null};DoublyList.prototype.clear=function(){for(var node=this.first;node!==null;node=node.next){node.container=null}this.first=null;this.last=null;this.length=0}});require.register("tina/src/easing.js",function(exports,module){var PI=Math.PI;var PI_OVER_TWO=Math.PI/2;var TWO_PI=Math.PI*2;var EXP=2.718281828;exports.none=function(){return 1};exports.linear=function(t){return t};exports.flash=function(t,ease){return t+t*ease-t*t*ease};exports.parabolic=function(t){var r=2*t-1;return 1-r*r};exports.trigo=function(t,n){return.5*(1-Math.cos(TWO_PI*t*n))};exports.elastic=function(t,e){if(t===1)return 1;e/=e+1;var n=(1+e)*Math.log(1-t)/Math.log(e);return Math.cos(n-PI_OVER_TWO)*Math.pow(e,n)};exports.polyIn=function(t,p){return Math.pow(t,p)};exports.polyOut=function(t,p){return 1-Math.pow((1-t)/1,p)};exports.polyInOut=function(t,p){if(t<.5){return Math.pow(2*t,p)/2}else{return(1+(1-Math.pow(2*(1-t),p)))/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){if(t<.5){return(1-Math.cos(PI*t))/2}else{return(1+Math.sin(PI*(t-.5)))/2}};exports.expIn=function(t,e){return(1-Math.pow(EXP,e*t))/(1-Math.pow(EXP,e))};exports.expOut=function(t,e){return(1-Math.pow(EXP,-e*t))/(1-Math.pow(EXP,-e))};exports.expInOut=function(t,e){if(t<.5){return(1-Math.pow(EXP,2*e*t))/(1-Math.pow(EXP,e))/2}else{return.5+(1-Math.pow(EXP,e-2*e*t))/(1-Math.pow(EXP,-e))/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){if(t<.5){return(1-Math.sqrt(1-4*t*t))/2}else{return(1+Math.sqrt(-3+8*t-4*t*t))/2}};exports.elasticIn=function(t,e){if(t===0){return 0}e/=e+1;var n=(1+e)*Math.log(t)/Math.log(e);return Math.cos(n)*Math.pow(e,n)};exports.elasticOut=function(t,e){if(t===1){return 1}e/=e+1;var n=(1+e)*Math.log(1-t)/Math.log(e);return 1-Math.cos(n)*Math.pow(e,n)};exports.elasticInOut=function(t,e){var n;if(t<.5){if(t===0){return 0}e/=e+1;n=(1+e)*Math.log(2*t)/Math.log(e);return.5*Math.cos(n)*Math.pow(e,n)}if(t===1){return 1}e/=e+1;n=(1+e)*Math.log(2-2*t)/Math.log(e);return.5+.5*(1-Math.cos(n)*Math.pow(e,n))};exports.bounceIn=function(t,e){if(t===0){return 0}e/=e+1;var n=(1+e)*Math.log(t)/Math.log(e);return Math.abs(Math.cos(n)*Math.pow(e,n))};exports.bounceOut=function(t,e){if(t===1){return 1}e/=e+1;var n=(1+e)*Math.log(1-t)/Math.log(e);return 1-Math.abs(Math.cos(n)*Math.pow(e,n))};exports.bounceInOut=function(t,e){var n;if(t<.5){if(t===0){return 0}e/=e+1;n=(1+e)*Math.log(2*t)/Math.log(e);return Math.abs(.5*Math.cos(n)*Math.pow(e,n))}if(t===1){return 1}e/=e+1;n=(1+e)*Math.log(2-2*t)/Math.log(e);return.5+.5*(1-Math.abs(Math.cos(n)*Math.pow(e,n)))};exports.backIn=function(t,e){return t*t*((e+1)*t-e)};exports.backOut=function(t,e){t-=1;return t*t*((e+1)*t+e)+1};exports.backInOut=function(t,e){if(t<.5){t*=2;return.5*(t*t*((e+1)*t-e))}t=2*t-2;return.5*(t*t*((e+1)*t+e))+1}});require.register("tina",function(exports,module){var TINA=require("tina/src/TINA.js");TINA.Tweener=require("tina/src/Tweener.js");TINA.Timer=require("tina/src/Timer.js");TINA.Ticker=require("tina/src/Ticker.js");TINA.Playable=require("tina/src/Playable.js");TINA.BoundedPlayable=require("tina/src/BoundedPlayable.js");TINA.PlayableHandler=require("tina/src/PlayableHandler.js");TINA.BoundedPlayer=require("tina/src/BoundedPlayer.js");TINA.Player=require("tina/src/Player.js");TINA.Tween=require("tina/src/Tween.js");TINA.NestedTween=require("tina/src/NestedTween.js");TINA.PixiTween=require("tina/src/NestedTween.js");TINA.Timeline=require("tina/src/Timeline.js");TINA.Sequence=require("tina/src/Sequence.js");TINA.Delay=require("tina/src/Delay.js");TINA.easing=require("tina/src/easing.js");TINA.interpolation=require("tina/src/interpolation.js");module.exports=TINA});require.register("tina/src/inherit.js",function(exports,module){module.exports=function(subobject,superobject){var prototypes=Object.keys(superobject.prototype);for(var p=0;p<prototypes.length;p+=1){var prototypeName=prototypes[p];subobject.prototype[prototypeName]=superobject.prototype[prototypeName]}}});require.register("tina/src/interpolation.js",function(exports,module){exports.none=function(t,a,b){return b};exports.linear=function(t,a,b){return a*(1-t)+b*t};exports.discrete=function(t,a,b,d){if(d===undefined){d=1}return Math.floor((a*(1-t)+b*t)/d)*d};exports.vector=function(t,a,b){var c=[];for(var i=0;i<a.length;i+=1){c[i]=a[i]*(1-t)+b[i]*t}return c};exports.state=function(t,a,b,c){var nbStates=b.length+2;var stateIdx=Math.floor(t*nbStates);if(stateIdx<1){return a}if(stateIdx>=nbStates-1){return b}return c[stateIdx-1]};exports.colorRGB=function(t,a,b){return{r:a.r*(1-t)+b.r*t,g:a.g*(1-t)+b.g*t,b:a.b*(1-t)+b.b*t}};exports.colorRGBA=function(t,a,b){return{r:a.r*(1-t)+b.r*t,g:a.g*(1-t)+b.g*t,b:a.b*(1-t)+b.b*t,a:a.a*(1-t)+b.a*t}};exports.colorRGBToHexa=function(t,a,b){var cr=Math.round(a.r*(1-t)+b.r*t);var cg=Math.round(a.g*(1-t)+b.g*t);var cb=Math.round(a.b*(1-t)+b.b*t);return"#"+cr.toString(16)+cg.toString(16)+cb.toString(16)};exports.colorRGBToString=function(t,a,b){var cr=Math.round(a.r*(1-t)+b.r*t);var cg=Math.round(a.g*(1-t)+b.g*t);var cb=Math.round(a.b*(1-t)+b.b*t);return"rgb("+cr.toString(16)+","+cg.toString(16)+","+cb.toString(16)+")"};exports.colorRGBAToString=function(t,a,b){var cr=Math.round(a.r*(1-t)+b.r*t);var cg=Math.round(a.g*(1-t)+b.g*t);var cb=Math.round(a.b*(1-t)+b.b*t);var ca=Math.round(a.a*(1-t)+b.a*t);return"rgba("+cr.toString(16)+","+cg.toString(16)+","+cb.toString(16)+","+ca+")"};exports.string=function(t,a,b){var nbCharsA=a.length;var nbCharsB=b.length;var newString="";for(var c=0;c<nbCharsB;c+=1){var charCodeB=b.charCodeAt(c);var charCodeA=c>=nbCharsA?charCodeB<97?65:97:a.charCodeAt(c);var charCode=Math.round(charCodeA*(1-t)+charCodeB*t);newString+=String.fromCharCode(charCode)}return newString};exports.bezierQuadratic=function(t,a,b,c){var u=1-t;return u*u*a+t*(2*u*c[0]+t*b)};exports.bezierCubic=function(t,a,b,c){var u=1-t;return u*u*u*a+t*(3*u*u*c[0]+t*(3*u*c[1]+t*b))};exports.bezierQuartic=function(t,a,b,c){var u=1-t;var u2=2*u;return u2*u2*a+t*(4*u*u2*c[0]+t*(6*u2*c[1]+t*(4*u*c[2]+t*b)))};exports.bezierQuintic=function(t,a,b,c){var u=1-t;var u2=2*u;return u2*u2*u*a+t*(5*u2*u2*c[0]+t*(10*u*u2*c[1]+t*(10*u2*c[2]+t*(5*u*c[3]+t*b))))};exports.bezier=function(t,a,b,c){var n=c.length;var u=1-t;var x=b;var term=n;for(k=1;k<n;k-=1){x=x*t+term*Math.pow(u,k)*c[n-k];term*=(n-k)/(k+1)}return x*t+a*Math.pow(u,n)};exports.bezier2d=function(t,a,b,c){var n=c.length;var u=1-t;var x=b[0];var y=b[1];var p,q;var term=n;for(var k=1;k<n;k-=1){p=term*Math.pow(u,k);q=c[n-k];x=x*t+p*q[0];y=y*t+p*q[1];term*=(n-k)/(k+1)}p=Math.pow(u,n);return[x*t+a[0]*p,y*t+a[1]*p]};exports.bezier3d=function(t,a,b,c){var n=c.length;var u=1-t;var x=b[0];var y=b[1];var z=b[2];var p,q;var term=n;for(var k=1;k<n;k-=1){p=term*Math.pow(u,k);q=c[n-k];x=x*t+p*q[0];y=y*t+p*q[1];z=z*t+p*q[2];term*=(n-k)/(k+1)}p=Math.pow(u,n);return[x*t+a[0]*p,y*t+a[1]*p,z*t+a[2]*p]};exports.bezierKd=function(t,a,b,c){var n=c.length;var u=1-t;var k=a.length;var res=[];for(var i=0;i<k;i+=1){res[i]=b[i]}var p,q;var term=n;for(var l=1;l<n;l-=1){p=term*Math.pow(u,l);q=c[n-l];for(i=0;i<k;i+=1){res[i]=res[i]*t+p*q[i]}term*=(n-l)/(l+1)}p=Math.pow(u,n);for(i=0;i<k;i+=1){res[i]=res[i]*t+a[i]*p}return res};exports.catmullRom=function(t,a,b,c){if(t===1){return c}var k=a.length;var n=b.length+1;t*=n;var i=Math.floor(t);t-=i;var t2=t*t;var t3=t*t2;var w=-.5*t3+1*t2-.5*t;var x=1.5*t3-2.5*t2+1;var y=-1.5*t3+2*t2+.5*t;var z=.5*t3-.5*t2;var i0=i-2;var i1=i-1;var i2=i;var i3=i+1;var p0=i0<0?a:b[i0];var p1=i1<0?a:b[i1];var p2=i3<n-2?b[i2]:c;var p3=i3<n-2?b[i3]:c;var res=[];for(var j=0;j<k;j+=1){res[j]=p0[j]*w+p1[j]*x+p2[j]*y+p3[j]*z}return res};exports.noise=function(){var perm=[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];var grad=[-1,1];return function(t,a,b,p){var amp=2;var per=p.per||1;var frq=p.frq||2;var oct=p.oct||4;var off=p.off||0;var c=0;var x=p.x+off;for(var o=0;o<oct;o+=1){var i=(x|x)&255;var x1=x-(x|x);var x0=1-x1;c+=amp*(x0*x0*x1*(3-2*x0)*grad[perm[i]&1]-x1*x1*x0*(3-2*x1)*grad[perm[i+1]&1]);x*=(x-off)*frq+off;amp*=per}var scale=per===1?1/oct:.5*(1-per)/(1-Math.pow(per,oct));t=t+c*scale;return a*(1-t)+b*t}}();exports.simplex2d=function(){var perm=[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];var grad=[[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]];function dot2D(g,x,y){return g[0]*x+g[1]*y}return function(t,a,b,p){var amp=2;var per=p.per||1;var frq=p.frq||2;var oct=p.oct||4;var off=p.off||{x:0,y:0};var c=c;var x=p.x+off.x;var y=p.y+off.y;for(var o=0;o<oct;o+=1){var n0,n1,n2;var f2=.5*(Math.sqrt(3)-1);var s=(x+y)*f2;var i=Math.floor(x+s);var j=Math.floor(y+s);var g2=(3-Math.sqrt(3))/6;var t=(i+j)*g2;var x0=i-t;var y0=j-t;x0=x-x0;y0=y-y0;var i1,j1;if(x0>y0){i1=1;j1=0}else{i1=0;j1=1}var x1=x0-i1+g2;var y1=y0-j1+g2;var x2=x0-1+2*g2;var y2=y0-1+2*g2;var ii=i&255;var jj=j&255;var t0=.5-x0*x0-y0*y0;var t1=.5-x1*x1-y1*y1;var t2=.5-x2*x2-y2*y2;if(t0<0){n0=0}else{var gi0=perm[ii+perm[jj]]&15;t0*=t0;n0=t0*t0*dot2D(grad[gi0],x0,y0)}if(t1<0){n1=0}else{var gi1=perm[ii+i1+perm[jj+j1]]&15;t1*=t1;n1=t1*t1*dot2D(grad[gi1],x1,y1)}if(t2<0){n2=0}else{var gi2=perm[ii+1+perm[jj+1]]&15;t2*=t2;n2=t2*t2*dot2D(grad[gi2],x2,y2)}c+=amp*70*(n0+n1+n2);x*=(x-off.x)*frq+off.x;y*=(y-off.y)*frq+off.y;amp*=per}var scale=per===1?1/oct:.5*(1-per)/(1-Math.pow(per,oct));t=t+c*scale;return a*(1-t)+b*t}}()});require.register("tina/src/NestedTween.js",function(exports,module){var BoundedPlayable=require("tina/src/BoundedPlayable.js");var AbstractTween=require("tina/src/AbstractTween.js");function NestedTween(object,properties){if(this instanceof NestedTween===false){return new NestedTween(object,properties)}BoundedPlayable.call(this);this._tweensPerObject={};this._tweens=[];this._propertyChains={};this._propertyChainStrings=[];var propertiesPerObject={};var objects={};for(var p=0;p<properties.length;p+=1){var propertyString=properties[p];var propertyChainString=propertyString.substring(0,propertyString.lastIndexOf("."));if(propertiesPerObject[propertyChainString]===undefined){var propertyChain=propertyString.split(".");var propertyIndex=propertyChain.length-1;var propertyObject=object;for(var c=0;c<propertyIndex;c+=1){propertyObject=propertyObject[propertyChain[c]]}var property=propertyChain[propertyIndex];if(propertyObject[property]instanceof Array){propertiesPerObject[propertyString]=null;objects[propertyString]=propertyObject[property];this._propertyChainStrings.push(propertyString);this._propertyChains[propertyChain]=propertyChain}else{propertiesPerObject[propertyChainString]=[property];objects[propertyChainString]=propertyObject;this._propertyChainStrings.push(propertyChainString);propertyChain.pop();this._propertyChains[propertyChainString]=propertyChain}}else{var property=propertyString.substring(propertyString.lastIndexOf(".")+1);propertiesPerObject[propertyChainString].push(property)}}for(var propertyChainString in objects){var tweenObject=objects[propertyChainString];var tweenProperties=propertiesPerObject[propertyChainString];var tween=new AbstractTween(tweenObject,tweenProperties);this._tweens.push(tween);this._tweensPerObject[propertyChainString]=tween}}NestedTween.prototype=Object.create(BoundedPlayable.prototype);NestedTween.prototype.constructor=NestedTween;module.exports=NestedTween;NestedTween.prototype.relative=function(relative){for(var t=0;t<this._tweens.length;t+=1){this._tweens[t].relative(relative)}return this};NestedTween.prototype.reset=function(){for(var t=0;t<this._tweens.length;t+=1){this._tweens[t].reset}this._duration=0;return this};NestedTween.prototype.interpolations=function(interpolations){for(var o=0;o<this._propertyChainStrings.length;o+=1){var propertyChainString=this._propertyChainStrings[o];var propertyChain=this._propertyChains[propertyChainString];var chainLength=propertyChain.length;var objectInterpolations=interpolations;for(var c=0;c<chainLength&&objectInterpolations!==undefined;c+=1){objectInterpolations=objectInterpolations[propertyChain[c]]}if(objectInterpolations!==undefined){this._tweensPerObject[propertyChainString].interpolations(objectInterpolations)}}return this};NestedTween.prototype.from=function(fromObject){for(var o=0;o<this._propertyChainStrings.length;o+=1){var propertyChainString=this._propertyChainStrings[o];var propertyChain=this._propertyChains[propertyChainString];var chainLength=propertyChain.length;var object=fromObject;for(var c=0;c<chainLength&&object!==undefined;c+=1){object=object[propertyChain[c]]}if(object!==undefined){this._tweensPerObject[propertyChainString].from(object)}}return this};NestedTween.prototype.to=function(toObject,duration,easing,easingParam,interpolationParams){for(var o=0;o<this._propertyChainStrings.length;o+=1){var propertyChainString=this._propertyChainStrings[o];var propertyChain=this._propertyChains[propertyChainString];var chainLength=propertyChain.length;var object=toObject;for(var c=0;c<chainLength;c+=1){object=object[propertyChain[c]]}var objectInterpolationParams=interpolationParams;for(var c=0;c<chainLength&&objectInterpolationParams!==undefined;c+=1){objectInterpolationParams=objectInterpolationParams[propertyChain[c]]}this._tweensPerObject[propertyChainString].to(object,duration,easing,easingParam,objectInterpolationParams)}this._duration+=duration;return this};NestedTween.prototype.wait=function(duration){for(var t=0;t<this._tweens.length;t+=1){this._tweens[t].wait(duration)}this._duration+=duration;return this};NestedTween.prototype._update=function(){for(var t=0;t<this._tweens.length;t+=1){var tween=this._tweens[t];tween._time=this._time;tween._update()}}});require.register("tina/src/Playable.js",function(exports,module){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(speed){if(this._player!==null&&this._player._duration!==undefined){console.warn("[Playable.speed] It is not recommended to change the speed of a playable that is attached to the given player:",this._player)}if(speed===0){if(this._speed!==0){this._startTime+=this._time/this._speed-this._time}}else{if(this._speed===0){this._startTime+=this._time-this._time/speed}else{this._startTime+=this._time/this._speed-this._time/speed}}this._speed=speed}});Object.defineProperty(Playable.prototype,"time",{get:function(){return this._time},set:function(time){if(this._player!==null&&this._player._duration!==undefined){console.warn("[Playable.time] It is not recommended to change the time of a playable that is attached to the given player:",this._player)}this.goTo(time)}});Playable.prototype.onStart=function(onStart){this._onStart=onStart;return this};Playable.prototype.onUpdate=function(onUpdate){this._onUpdate=onUpdate;return this};Playable.prototype.onStop=function(onStop){this._onStop=onStop;return this};Playable.prototype.onPause=function(onPause){this._onPause=onPause;return this};Playable.prototype.onResume=function(onResume){this._onResume=onResume;return this};Playable.prototype._update=function(){if(this._onUpdate!==null){this._onUpdate()}};Playable.prototype._stop=function(){if(this._onStop!==null){this._onStop()}};Playable.prototype._pause=function(){if(this._onPause!==null){this._onPause()}};Playable.prototype._resume=function(){if(this._onResume!==null){this._onResume()}};Playable.prototype.tweener=function(tweener){this._player=tweener;return this};Playable.prototype.goTo=function(timePosition,iteration){if(this._iterations===1){if(this._speed===0){this._startTime+=this._time-timePosition}else{this._startTime+=(this._time-timePosition)/this._speed}}else{iteration=iteration||0;if(this._speed===0){this._startTime+=this._time-timePosition-iteration*this._duration}else{this._startTime+=(this._time-timePosition-iteration*this._duration)/this._speed}}this._time=timePosition;return this};Playable.prototype.rewind=function(){this.goTo(0,0);return this};Playable.prototype.delay=function(delay){if(this._player===null){this._player=TINA._getDefaultTweener()}this._player._delay(this,delay);return this};Playable.prototype.start=function(timeOffset){var player=this._player;if(player===null){player=TINA._getDefaultTweener()}if(player._add(this)===false){return this}if(timeOffset===undefined||timeOffset===null){timeOffset=0}this._start(timeOffset-player._time);return this};Playable.prototype._start=function(timeOffset){this._startTime=-timeOffset;if(this._onStart!==null){this._onStart()}};Playable.prototype.stop=function(){ | ||
if(this._player._inactivate(this)===false){return this}this._stop();return this};Playable.prototype.resume=function(){if(this._player._add(this)===false){return this}this._resume();return this};Playable.prototype.pause=function(){if(this._player._inactivate(this)===false){return this}this._pause();return this};Playable.prototype._moveTo=function(time,dt){dt*=this._speed;this._time=(time-this._startTime)*this._speed;this._update(dt);if(this._onUpdate!==null){this._onUpdate(this._time,dt)}};Playable.prototype._update=function(){}});require.register("tina/src/PlayableHandler.js",function(exports,module){var DoublyList=require("tina/src/DoublyList.js");function PlayableHandle(playable){this.playable=playable;this.handle=null}function PlayableHandler(){this._activePlayables=new DoublyList;this._inactivePlayables=new DoublyList;this._playablesToRemove=new DoublyList;this._silent=false;this._debug=false}module.exports=PlayableHandler;PlayableHandler.prototype._add=function(playable){if(playable._handle===null){playable._handle=this._inactivePlayables.add(playable);playable._player=this;return true}if(playable._handle.container===this._playablesToRemove){playable._handle=this._playablesToRemove.remove(playable._handle);return true}if(playable._handle.container===this._activePlayables){this._warn("[PlayableHandler._add] Playable is already present, and active");return false}if(playable._handle.container===this._inactivePlayables){this._warn("[PlayableHandler._add] Playable is already present, but inactive (could be starting)");return false}this._warn("[PlayableHandler._add] Playable is used elsewhere");return false};PlayableHandler.prototype._remove=function(playable){if(playable._handle===null){this._warn("[PlayableHandler._remove] Playable is not being used");return false}if(playable._handle.container===this._activePlayables){playable._handle=this._playablesToRemove.add(playable._handle);playable._stop();return true}if(playable._handle.container===this._inactivePlayables){playable._handle=this._inactivePlayables.remove(playable._handle);return true}if(playable._handle.container===this._playablesToRemove){this._warn("[PlayableHandler._remove] Playable is already being removed");return false}this._warn("[PlayableHandler._add] Playable is used elsewhere");return false};PlayableHandler.prototype.remove=function(playable){this._remove(playable);this._onRemovePlayables();return this};PlayableHandler.prototype.removeAll=function(){var handle=this._activePlayables.first;while(handle!==null){var next=handle.next;this._remove(handle.object);handle=next}this._handlePlayablesToRemove();this._onRemovePlayables();return this};PlayableHandler.prototype._onRemovePlayables=function(){};PlayableHandler.prototype.possess=function(playable){if(playable._handle===null){return false}return playable._handle.container===this._activePlayables||playable._handle.container===this._inactivePlayables};PlayableHandler.prototype._inactivate=function(playable){this._activePlayables.remove(playable._handle);playable._handle=this._inactivePlayables.add(playable)};PlayableHandler.prototype._handlePlayablesToRemove=function(){while(this._playablesToRemove.length>0){var handle=this._playablesToRemove.pop();var playable=handle.object;playable._handle=this._activePlayables.remove(handle);playable._player=null}};PlayableHandler.prototype.clear=function(){this._handledPlayables.clear();this._activePlayables.clear();this._inactivePlayables.clear();this._playablesToRemove.clear();return this};PlayableHandler.prototype._warn=function(warning){if(this._silent===false){console.warn(warning)}if(this._debug===true){debugger}};PlayableHandler.prototype.silent=function(silent){this._silent=silent;return this};PlayableHandler.prototype.debug=function(debug){this._debug=debug;return this}});require.register("tina/src/Player.js",function(exports,module){var Delay=require("tina/src/Delay.js");var Playable=require("tina/src/Playable.js");var PlayableHandler=require("tina/src/PlayableHandler.js");var inherit=require("tina/src/inherit.js");function Player(){Playable.call(this);PlayableHandler.call(this)}Player.prototype=Object.create(Playable.prototype);Player.prototype.constructor=Player;inherit(Player,PlayableHandler);module.exports=Player;Player.prototype._delay=function(playable,delay){if(delay<=0){this._warn("[Tweener.add] Delay null or negative ("+delay+")."+"Starting the playable with a delay of 0.");playable.start();return}Delay(delay).tweener(this).onComplete(function(timeOverflow){playable.start(timeOverflow)}).start()};Player.prototype.stop=function(){this.removeAll();if(this._player._inactivate(this)===false){return this}this._stop();return this};Player.prototype._moveTo=function(time,dt){this._time=time-this._startTime;var overflow;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}}this._updatePlayableList();this._update(dt);if(this._onUpdate!==null){this._onUpdate(this._time,dt)}if(overflow!==undefined){this._complete(overflow)}};Player.prototype._updatePlayableList=function(){}});require.register("tina/src/Recorder.js",function(exports,module){var BoundedPlayable=require("tina/src/BoundedPlayable.js");function ObjectRecorder(object,properties,onIn,onOut){this.object=object;this.properties=properties;this.timestamps=[];this.records=[];this.playingHead=1;this.isIn=false;this.onIn=onIn||null;this.onOut=onOut||null}ObjectRecorder.prototype.record=function(time){for(var p=0;p<this.properties.length;p+=1){this.records.push(this.object[this.properties[p]])}this.timestamps.push(time)};ObjectRecorder.prototype.play=function(time,smooth){var nbProperties=this.properties.length;var lastRecord=this.timestamps.length-1;var playingHead=this.playingHead;var isIn=this.timestamps[0]<=time&&time<=this.timestamps[lastRecord];if(isIn===true){if(this.playing===false){this.playing=true;if(this.onIn!==null){this.onIn()}}}else{if(this.playing===true){this.playing=false;if(this.onOut!==null){this.onOut()}}return}while(playingHead<lastRecord&&time<=this.timestamps[playingHead]){playingHead+=1}while(playingHead>1&&time>this.timestamps[playingHead]){playingHead-=1}if(smooth){var t0=this.timestamps[playingHead-1];var t1=this.timestamps[playingHead];var dt=t1-t0;var delta0=(t-t0)/dt;var delta1=(t1-t)/dt;var recordIdx1=nbProperties*playingHead;var recordIdx0=nbProperties*playingHead-nbProperties;for(var p=0;p<nbProperties;p+=1){this.object[this.properties[p]]=this.records[recordIdx0+p]*delta0+this.records[recordIdx1+p]*delta1}}else{var recordIdx=nbProperties*playingHead;for(var p=0;p<nbProperties;p+=1){this.object[this.properties[p]]=this.records[recordIdx+p]}}};function Recorder(){if(this instanceof Recorder===false){return new Recorder}BoundedPlayable.call(this);this._duration=Infinity;this._recordedObjects=[];this._recordingObjects={};this._recordingObjectLabels=[];this._recording=true;this._playing=false;this._smooth=false;this._onStartRecording=null;this._onStopRecording=null;this._onStartPlaying=null;this._onStopPlaying=null}Recorder.prototype=Object.create(BoundedPlayable.prototype);Recorder.prototype.constructor=Recorder;module.exports=Recorder;Recorder.prototype.onStartRecording=function(onStartRecording){this._onStartRecording=onStartRecording;return this};Recorder.prototype.onStopRecording=function(onStopRecording){this._onStopRecording=onStopRecording;return this};Recorder.prototype.onStartPlaying=function(onStartPlaying){this._onStartPlaying=onStartPlaying;return this};Recorder.prototype.onStopPlaying=function(onStopPlaying){this._onStopPlaying=onStopPlaying;return this};Recorder.prototype.reset=function(){this._recordedObjects=[];this._recordingObjects={};this._recordingObjectLabels=[];return this};Recorder.prototype.record=function(label,object,properties,onIn,onOut){var objectRecorder=new ObjectRecorder(object,properties,onIn,onOut);this._recordingObjects[label]=objectRecorder;this._recordedObjects.push(objectRecorder);this._recordingObjectLabels.push(label);return this};Recorder.prototype.stopRecordingObject=function(label){delete this._recordingObjects[label];var labelIdx=this._recordingObjectLabels.indexOf(label);if(labelIdx===-1){console.warn("[Recorder.stopRecordingObject] Trying to stop recording an object that is not being recording:",label);return this}this._recordingObjectLabels.splice(labelIdx,1);return this};Recorder.prototype.removeRecordedObject=function(label){var recorder=this._recordingObjects[label];delete this._recordingObjects[label];var labelIdx=this._recordingObjectLabels.indexOf(label);if(labelIdx!==-1){this._recordingObjectLabels.splice(labelIdx,1)}var recorderIdx=this._recordedObjects.indexOf(recorder);if(recorderIdx===-1){console.warn("[Recorder.removeRecordedObject] Trying to remove an object that was not recorded:",label);return this}this._recordingObjectLabels.splice(recorderIdx,1);return this};Recorder.prototype.recording=function(recording){if(this._recording!==recording){this._recording=recording;if(this._recording===true){if(this._playing===true){if(this._onStopPlaying!==null){this._onStopPlaying()}this._playing=false}if(this._onStartRecording!==null){this._onStartRecording()}}else{if(this._onStopRecording!==null){this._onStopRecording()}}}return this};Recorder.prototype.playing=function(playing){if(this._playing!==playing){this._playing=playing;if(this._playing===true){if(this._recording===true){if(this._onStopRecording!==null){this._onStopRecording()}this._recording=false}if(this._onStartPlaying!==null){this._onStartPlaying()}}else{if(this._onStopPlaying!==null){this._onStopPlaying()}}}return this};Recorder.prototype.smooth=function(smooth){this._smooth=smooth;return this};Recorder.prototype.update=function(){if(this._recording){var nbRecordingObjects=this._recordingObjectLabels.length;for(var r=0;r<nbRecordingObjects;r+=1){var label=this._recordingObjectLabels[r];this._recordingObjects[label].record(this._time)}}if(this._playing){var nbObjectRecorded=this._recordedObjects.length;for(var r=0;r<nbObjectRecorded;r+=1){this._recordedObjects[r].play(this._time,this._smooth)}}}});require.register("tina/src/Sequence.js",function(exports,module){var Timeline=require("tina/src/Timeline.js");function Sequence(){if(this instanceof Sequence===false){return new Sequence}Timeline.call(this)}Sequence.prototype=Object.create(Timeline.prototype);Sequence.prototype.constructor=Sequence;module.exports=Sequence;Sequence.prototype.add=function(playable){playable._startTime=this._duration;this._duration+=playable._duration;this._add(playable);return this};Sequence.prototype.addDelay=function(duration){this._duration+=duration;return this}});require.register("tina/src/Ticker.js",function(exports,module){var Tweener=require("tina/src/Tweener.js");function Ticker(tupt){if(this instanceof Ticker===false){return new Ticker(tupt)}Tweener.call(this);SOmethingElse.call(this);this._tupt=tupt||1;this._nbTicks=0}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(tupt){if(tupt<0){this._warn("[Timer.tupt] tupt cannot be negative, stop messing with time.");tupt=0}var dt=this._nbTicks;if(tupt===0){this._nbTicks=this._time-dt*this._tupt}else{if(this._tupt===0){this._nbTicks=this._time-dt/tupt}else{this._nbTicks=this._time-dt*this._tupt/tupt}}this._tupt=tupt}});Ticker.prototype._getElapsedTime=function(){return this._tupt*this._nbTicks++};Ticker.prototype._getSingleStepDuration=function(){return this._tupt};Ticker.prototype.convertToTicks=function(timeUnits){return timeUnits/this._tupt};Ticker.prototype.convertToTimeUnits=function(nbTicks){return nbTicks*this._tupt}});require.register("tina/src/Timeline.js",function(exports,module){var BoundedPlayer=require("tina/src/BoundedPlayer.js");function Timeline(){if(this instanceof Timeline===false){return new Timeline}BoundedPlayer.call(this)}Timeline.prototype=Object.create(BoundedPlayer.prototype);Timeline.prototype.constructor=Timeline;module.exports=Timeline;Timeline.prototype.add=function(startTime,playable){playable._startTime=startTime;this._add(playable);this._duration=Math.max(this._duration,startTime+playable.getDuration());return this};Timeline.prototype._computeDuration=function(){var duration=0;for(var handle=this._inactivePlayables.first;handle!==null;handle=handle.next){var playable=handle.object;duration=Math.max(duration,playable._startTime+playable.getDuration())}for(handle=this._activePlayables.first;handle!==null;handle=handle.next){playable=handle.object;duration=Math.max(duration,playable._startTime+playable.getDuration())}this._duration=duration};Timeline.prototype._onRemovePlayables=Timeline.prototype._computeDuration;Timeline.prototype._start=function(player,timeOffset){BoundedPlayer.prototype._start.call(this,player,timeOffset);this._computeDuration()};Timeline.prototype._updatePlayableList=function(){this._handlePlayablesToRemove();var handle=this._inactivePlayables.first;while(handle!==null){var playable=handle.object;handle=handle.next;var startTime=playable._startTime;var endTime=startTime+playable.getDuration();if(startTime<=this._time&&this._time<=endTime){this._inactivePlayables.remove(playable._handle);playable._handle=this._activePlayables.addBack(playable);playable._start(-startTime)}}};Timeline.prototype._update=function(dt){for(var handle=this._activePlayables.first;handle!==null;handle=handle.next){var playable=handle.object;playable._moveTo(this._time,dt)}}});require.register("tina/src/Timer.js",function(exports,module){var Tweener=require("tina/src/Tweener.js");var clock=window.performance||Date;function Timer(tups){if(this instanceof Timer===false){return new Timer(tups)}Tweener.call(this);this._tups=tups||1e3}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(tups){if(tups<0){this._warn("[Timer.tups] tups cannot be negative, stop messing with time.");tups=0}var dt=this._time-this._startTime;if(tups===0){this._startTime=this._time-dt*this._tups}else{if(this._tups===0){this._startTime=this._time-dt/tups}else{this._startTime=this._time-dt*this._tups/tups}}this._tups=tups}});Timer.prototype._getElapsedTime=function(time){return this._tups*(time-this._startTime)/1e3};Timer.prototype._getSingleStepDuration=function(dt){return this._tups*dt/1e3};Timer.prototype.convertToSeconds=function(timeUnits){return timeUnits/this._tups};Timer.prototype.convertToTimeUnits=function(seconds){return seconds*this._tups}});require.register("tina/src/TINA.js",function(exports,module){var requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(callback){window.setTimeout(callback,1e3/60)}}();var clock=window.performance||Date;var TINA={_tweeners:[],_defaultTweener:null,_running:false,_startTime:0,_time:0,_onStart:null,_onPause:null,_onResume:null,_onUpdate:null,_onStop:null,_pauseOnLostFocus:false,onStart:function(onStart){this._onStart=onStart;return this},onUpdate:function(onUpdate){this._onUpdate=onUpdate;return this},onStop:function(onStop){this._onStop=onStop;return this},onPause:function(onPause){this._onPause=onPause;return this},isRunning:function(){return this._running},update:function(){var now=clock.now()-this._startTime;var dt=now-this._time;if(dt<0){return}this._time=now;var runningTweeners=this._tweeners.slice(0);for(var t=0;t<runningTweeners.length;t+=1){runningTweeners[t]._moveTo(this._time,dt)}if(this._onUpdate!==null){this._onUpdate(this._time,dt)}},reset:function(){this._startTime=clock.now();this._time=0},start:function(){if(this._running===true){console.warn("[TINA.start] TINA is already running");return this}function updateTINA(){if(TINA._running===true){TINA.update();requestAnimFrame(updateTINA)}}if(this._onStart!==null){this._onStart()}this._startTime=clock.now();this._time=0;for(var t=0;t<this._tweeners.length;t+=1){this._tweeners[t]._start()}this._running=true;requestAnimFrame(updateTINA);return this},pause:function(){if(this._running===false){console.warn("[TINA.pause] TINA is not running");return this}this._running=false;for(var t=0;t<this._tweeners.length;t+=1){this._tweeners[t]._pause()}if(this._onPause!==null){this._onPause()}return this},resume:function(){if(this._running===true){console.warn("[TINA.resume] TINA is already running");return this}this._running=true;if(this._onResume!==null){this._onResume()}for(var t=0;t<this._tweeners.length;t+=1){this._tweeners[t]._resume()}var now=clock.now();var dt=now-this._time;this._startTime+=dt;return this},stop:function(){this._running=false;var runningTweeners=this._tweeners.slice(0);for(var t=0;t<runningTweeners.length;t+=1){runningTweeners[t]._stop()}this._tweeners=runningTweeners;if(this._onStop!==null){this._onStop()}return this},pauseOnLostFocus:function(pauseOnLostFocus){this._pauseOnLostFocus=pauseOnLostFocus;return this},setDefaultTweener:function(tweener){this._defaultTweener=tweener;this._tweeners.push(this._defaultTweener)},getDefaultTweener:function(){return this._defaultTweener},_add:function(tweener){if(this._running===false){this.start()}this._tweeners.push(tweener)},add:function(tweener){this._tweeners.push(tweener);return this},_inactivate:function(tweener){var tweenerIdx=this._tweeners.indexOf(tweener);if(tweenerIdx!==-1){this._tweeners.splice(tweenerIdx,1)}},remove:function(tweener){this._inactivate(tweener);return this},_getDefaultTweener:function(){if(this._defaultTweener===null){var DefaultTweener=this.Timer;this._defaultTweener=(new DefaultTweener).start()}return this._defaultTweener}};var hidden,visbilityChange;if(typeof document.hidden!=="undefined"){hidden="hidden";visbilityChange="visibilitychange"}else if(typeof document.mozHidden!=="undefined"){hidden="mozHidden";visbilityChange="mozvisibilitychange"}else if(typeof document.msHidden!=="undefined"){hidden="msHidden";visbilityChange="msvisibilitychange"}else if(typeof document.webkitHidden!=="undefined"){hidden="webkitHidden";visbilityChange="webkitvisibilitychange"}if(typeof document[hidden]==="undefined"){this._warn("[Tweener] Cannot pause on lost focus because the browser does not support the Page Visibility API")}else{var wasRunning=false;document.addEventListener(visbilityChange,function(){if(document[hidden]){wasRunning=TINA.isRunning();if(wasRunning&&TINA._pauseOnLostFocus){TINA.pause()}}if(!document[hidden]){if(wasRunning&&TINA._pauseOnLostFocus){TINA.resume()}}},false)}(function(root){root.TINA=TINA;if(root!==window&&window){window.TINA=TINA}})(this);module.exports=TINA});require.register("tina/src/Transition.js",function(exports,module){function update(object,t){var p=this.prop;object[p]=this.from[p]*(1-t)+this.to[p]*t}function updateP(object,t){var q=this.props;for(var i=0;i<this.props.length;i+=1){var p=q[i];object[p]=this.from[p]*(1-t)+this.to[p]*t}}function updateI(object,t){var p=this.prop;object[p]=this.interps[p](t,this.from[p],this.to[p],this.interpParams[p])}function updatePI(object,t){var q=this.props;for(var i=0;i<q.length;i+=1){var p=q[i];object[p]=this.interps[p](t,this.from[p],this.to[p],this.interpParams[p])}}function updateE(object,t){t=this.easing(t,this.easingParam);var p=this.prop;object[p]=this.from[p]*(1-t)+this.to[p]*t}function updatePE(object,t){var q=this.props;t=this.easing(t,this.easingParam);for(var i=0;i<q.length;i+=1){var p=q[i];object[p]=this.from[p]*(1-t)+this.to[p]*t}}function updateIE(object,t){var p=this.prop;object[p]=this.interps[p](this.easing(t,this.easingParam),this.from[p],this.to[p],this.interpParams[p])}function updatePIE(object,t){var q=this.props;t=this.easing(t,this.easingParam);for(var i=0;i<q.length;i+=1){var p=q[i];object[p]=this.interps[p](t,this.from[p],this.to[p],this.interpParams[p])}}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];function Transition(properties,from,to,start,duration,easing,easingParam,interpolations,interpolationParams){this.start=start;this.end=start+duration;this.duration=duration;this.from=from;this.to=to;var easingFlag;if(easing){easingFlag=1;this.easing=easing;this.easingParam=easingParam}else{easingFlag=0}var interpFlag;if(interpolations===null){interpFlag=0}else{interpFlag=1;this.interps=interpolations;this.interpParams=interpolationParams||{}}var propsFlag;if(properties.length===1){propsFlag=0;this.prop=properties[0]}else{propsFlag=1;this.props=properties}this.update=updateMethods[easingFlag][interpFlag][propsFlag]}module.exports=Transition});require.register("tina/src/TransitionRelative.js",function(exports,module){function update(object,t){var p=this.prop;var now=this.from[p]*(1-t)+this.to[p]*t;object[p]=object[p]+(now-this.prev);this.prev=now}function updateP(object,t){var q=this.props;for(var i=0;i<this.props.length;i+=1){var p=q[i];var now=this.from[p]*(1-t)+this.to[p]*t;object[p]=object[p]+(now-this.prev[p]);this.prev[p]=now}}function updateI(object,t){var p=this.prop;var now=this.interps[p](t,this.from[p],this.to[p],this.interpParams[p]);object[p]=object[p]+(now-this.prev);this.prev=now}function updatePI(object,t){var q=this.properties;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}}function updateE(object,t){t=this.easing(t,this.easingParams);var p=this.prop;var now=this.from[p]*(1-t)+this.to[p]*t;object[p]=object[p]+(now-this.prev);this.prev=now}function updatePE(object,t){var q=this.properties;t=this.easing(t,this.easingParams);for(var i=0;i<q.length;i+=1){var p=q[i];var now=this.from[p]*(1-t)+this.to[p]*t;object[p]=object[p]+(now-this.prev[p]);this.prev[p]=now}}function updateIE(object,t){var p=this.prop;var now=this.interps[p](this.easing(t,this.easingParams),this.from[p],this.to[p],this.interpParams[p]);object[p]=object[p]+(now-this.prev);this.prev=now}function updatePIE(object,t){var q=this.properties;t=this.easing(t,this.easingParams);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}}var updateMethods=[[[update,updateP],[updateI,updatePI]],[[updateE,updatePE],[updateIE,updatePIE]]];function Transition(properties,from,to,start,duration,easing,easingParam,interpolations,interpolationParams){this.start=start;this.end=start+duration;this.duration=duration;this.from=from;this.to=to;var easingFlag;if(easing){easingFlag=1;this.easing=easing;this.easingParam=easingParam}else{easingFlag=0}var interpFlag;if(interpolations===null){interpFlag=0}else{interpFlag=1;this.interps=interpolations;this.interpParams=interpolationParams||{}}var propsFlag;if(properties.length===1){propsFlag=0;this.prop=properties[0];this.prev=0}else{propsFlag=1;this.props=properties;this.prev={};for(var p=0;p<properties.length;p+=1){this.prev[properties[p]]=0}}this.update=updateMethods[easingFlag][interpFlag][propsFlag]}module.exports=Transition});require.register("tina/src/Tween.js",function(exports,module){var BoundedPlayable=require("tina/src/BoundedPlayable.js");var AbstractTween=require("tina/src/AbstractTween.js");var inherit=require("tina/src/inherit.js");function Tween(object,properties){if(this instanceof Tween===false){return new Tween(object,properties)}BoundedPlayable.call(this);AbstractTween.call(this,object,properties)}Tween.prototype=Object.create(BoundedPlayable.prototype);Tween.prototype.constructor=Tween;inherit(Tween,AbstractTween);module.exports=Tween});require.register("tina/src/Tweener.js",function(exports,module){var Player=require("tina/src/Player.js");var TINA=require("tina/src/TINA.js");function Tweener(){Player.call(this);this._player=TINA}Tweener.prototype=Object.create(Player.prototype);Tweener.prototype.constructor=Tweener;module.exports=Tweener;Tweener.prototype._inactivate=function(playable){this._remove(playable)};Tweener.prototype._moveTo=function(time,dt){this._time=this._getElapsedTime(time-this._startTime);dt=this._getSingleStepDuration(dt);this._handlePlayablesToRemove();while(this._inactivePlayables.length>0){playable=this._inactivePlayables.pop();playable._handle=this._activePlayables.add(playable)}for(var handle=this._activePlayables.first;handle!==null;handle=handle.next){handle.object._moveTo(this._time,dt)}if(this._onUpdate!==null){this._onUpdate(this._time,dt)}};Tweener.prototype.useAsDefault=function(){TINA.setDefaultTweener(this);return this}});require("tina"); | ||
(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._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)}; | ||
},{"./Transition":15,"./TransitionRelative":16,"./easing":19,"./interpolation":22}],2:[function(require,module,exports){ | ||
function BoundedPlayable(){Playable.call(this),this._duration=0,this._iterations=1,this._persist=!1,this._pingpong=!1,this._onComplete=null}var Playable=require("./Playable");BoundedPlayable.prototype=Object.create(Playable.prototype),BoundedPlayable.prototype.constructor=BoundedPlayable,module.exports=BoundedPlayable,BoundedPlayable.prototype.onComplete=function(t){return this._onComplete=t,this},BoundedPlayable.prototype.getDuration=function(){return this._duration*this._iterations/this._speed},BoundedPlayable.prototype.goToEnd=function(){return this.goTo(this.getDuration(),this._iterations-1),this},BoundedPlayable.prototype.loop=function(){return this.iterations(1/0)},BoundedPlayable.prototype.iterations=function(t){return 0>t?(console.warn("[BoundedPlayable.iterations] Number of iterations cannot be negative"),this):(this._iterations=t,this)},BoundedPlayable.prototype.persist=function(t){return this._persist=t,this},BoundedPlayable.prototype.pingpong=function(t){return this._pingpong=t,this},BoundedPlayable.prototype._complete=function(t){return this._persist===!0?void(this._startTime+=t):this._player._inactivate(this)===!1?this:void(null!==this._onComplete&&this._onComplete(t))},BoundedPlayable.prototype._start=function(t){this._startTime=-t,null!==this._onStart&&this._onStart(),t>=this.getDuration()&&this._moveTo(this._startTime+t,t)},BoundedPlayable.prototype._moveTo=function(t,i){i*=this._speed;var e;if(0!==this._speed)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 o=t/this._duration;i>0?o<this._iterations?this._time=t%this._duration:(e=(o-this._iterations)*this._duration,i-=e,this._time=this._duration*(1-(Math.ceil(this._iterations)-this._iterations))):0>i&&(o>0?this._time=t%this._duration:(e=o*this._duration,i-=e,this._time=0)),this._pingpong===!0&&(Math.ceil(this._iterations)===this._iterations?void 0===e?0===(1&Math.ceil(o))&&(this._time=this._duration-this._time):1===(1&Math.ceil(o))&&(this._time=this._duration-this._time):0===(1&Math.ceil(o))&&(this._time=this._duration-this._time))}this._update(i),null!==this._onUpdate&&this._onUpdate(this._time,i),void 0!==e&&this._complete(e)},BoundedPlayable.prototype._update=function(){}; | ||
},{"./Playable":7}],3:[function(require,module,exports){ | ||
function BoundedPlayer(){BoundedPlayable.call(this),PlayableHandler.call(this)}var BoundedPlayable=require("./BoundedPlayable"),PlayableHandler=require("./PlayableHandler"),inherit=require("./inherit");BoundedPlayer.prototype=Object.create(BoundedPlayable.prototype),BoundedPlayer.prototype.constructor=BoundedPlayer,inherit(BoundedPlayer,PlayableHandler),module.exports=BoundedPlayer,BoundedPlayer.prototype._delay=function(){this._warn("[BoundedPlayer._delay] This player does not support the delay functionality",this)},BoundedPlayer.prototype.stop=function(){for(var t=this._activePlayables.first;null!==t;){var i=t.next,e=t.object;e.stop(),t=i}return this._handlePlayablesToRemove(),this._player._inactivate(this)===!1?this:(this._stop(),this)},BoundedPlayer.prototype._moveTo=function(t,i){i*=this._speed;var e;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 a=t/this._duration;i>0?a<this._iterations?this._time=t%this._duration:(e=(a-this._iterations)*this._duration,i-=e,this._time=this._duration*(1-(Math.ceil(this._iterations)-this._iterations))):0>i&&(a>0?this._time=t%this._duration:(e=a*this._duration,i-=e,this._time=0)),this._pingpong===!0&&(Math.ceil(this._iterations)===this._iterations?void 0===e?0===(1&Math.ceil(a))&&(this._time=this._duration-this._time):1===(1&Math.ceil(a))&&(this._time=this._duration-this._time):0===(1&Math.ceil(a))&&(this._time=this._duration-this._time))}this._updatePlayableList(),this._update(i),null!==this._onUpdate&&this._onUpdate(this._time,i),void 0!==e&&this._complete(e)},BoundedPlayer.prototype._updatePlayableList=function(){}; | ||
},{"./BoundedPlayable":2,"./PlayableHandler":8,"./inherit":21}],4:[function(require,module,exports){ | ||
function Delay(e){return this instanceof Delay==!1?new Delay(e):(BoundedPlayable.call(this),void(this._duration=e))}var BoundedPlayable=require("./BoundedPlayable");Delay.prototype=Object.create(BoundedPlayable.prototype),Delay.prototype.constructor=Delay,module.exports=Delay; | ||
},{"./BoundedPlayable":2}],5:[function(require,module,exports){ | ||
function ListNode(t,e,o,i){this.object=t,this.prev=e,this.next=o,this.container=i}function DoublyList(){this.first=null,this.last=null,this.length=0}module.exports=DoublyList,DoublyList.prototype.addFront=function(t){var e=new ListNode(t,null,this.first,this);return null===this.first?(this.first=e,this.last=e):(this.first.prev=e,this.first=e),this.length+=1,e},DoublyList.prototype.add=DoublyList.prototype.addFront,DoublyList.prototype.addBack=function(t){var e=new ListNode(t,this.last,null,this);return null===this.first?(this.first=e,this.last=e):(this.last.next=e,this.last=e),this.length+=1,e},DoublyList.prototype.popFront=function(t){var e=this.first.object;return this.removeByReference(this.first),e},DoublyList.prototype.pop=DoublyList.prototype.popFront,DoublyList.prototype.popBack=function(t){var e=this.last.object;return this.removeByReference(this.last),e},DoublyList.prototype.removeByReference=function(t){return t.container!==this?(console.warn("[DoublyList.removeByReference] Trying to remove a node that does not belong to the list"),t):(null===t.next?this.last=t.prev:t.next.prev=t.prev,null===t.prev?this.first=t.next:t.prev.next=t.next,t.container=null,this.length-=1,null)},DoublyList.prototype.remove=function(t){for(var e=this.first;null!==e;e=e.next)if(e.object===t)return this.removeByReference(e),!0;return!1},DoublyList.prototype.clear=function(){for(var t=this.first;null!==t;t=t.next)t.container=null;this.first=null,this.last=null,this.length=0},DoublyList.prototype.forEach=function(t,e){for(var o=this.first;o;o=o.next)t(o.object,e)},DoublyList.prototype.toArray=function(){for(var t=[],e=this.first;null!==e;e=e.next)t.push(e.object);return t}; | ||
},{}],6:[function(require,module,exports){ | ||
function NestedTween(e,t){if(this instanceof NestedTween==!1)return new NestedTween(e,t);BoundedPlayable.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,d=0;a>d;d+=1)_=_[p[d]];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 w=s[n],u=i[n],l=new AbstractTween(w,u);this._tweens.push(l),this._tweensPerObject[n]=l}}var BoundedPlayable=require("./BoundedPlayable"),AbstractTween=require("./AbstractTween");NestedTween.prototype=Object.create(BoundedPlayable.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 d=s;for(_=0;p>_&&void 0!==d;_+=1)d=d[h[_]];this._tweensPerObject[o].to(a,t,r,n,d)}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()}}; | ||
},{"./AbstractTween":1,"./BoundedPlayable":2}],7:[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){null!==this._player&&void 0!==this._player._duration&&console.warn("[Playable.speed] It is not recommended to change the speed of a playable that is attached to the given player:",this._player),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}}),Object.defineProperty(Playable.prototype,"time",{get:function(){return this._time},set:function(t){null!==this._player&&void 0!==this._player._duration&&console.warn("[Playable.time] It is not recommended to change the time of a playable that is attached to the given player:",this._player),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._update=function(){null!==this._onUpdate&&this._onUpdate()},Playable.prototype._stop=function(){null!==this._onStop&&this._onStop()},Playable.prototype._pause=function(){null!==this._onPause&&this._onPause()},Playable.prototype._resume=function(){null!==this._onResume&&this._onResume()},Playable.prototype.tweener=function(t){return 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,this},Playable.prototype.rewind=function(){return this.goTo(0,0),this},Playable.prototype.delay=function(t){return null===this._player&&(this._player=TINA._getDefaultTweener()),this._player._delay(this,t),this},Playable.prototype.start=function(t){var e=this._player;return null===e&&(e=TINA._getDefaultTweener()),e._add(this)===!1?this:((void 0===t||null===t)&&(t=0),this._start(t-e._time),this)},Playable.prototype._start=function(t){this._startTime=-t,null!==this._onStart&&this._onStart()},Playable.prototype.stop=function(){return this._player._inactivate(this)===!1?this:(this._stop(),this)},Playable.prototype.resume=function(){return this._player._add(this)===!1?this:(this._resume(),this)},Playable.prototype.pause=function(){return this._player._inactivate(this)===!1?this:(this._pause(),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(){}; | ||
},{}],8:[function(require,module,exports){ | ||
function PlayableHandle(e){this.playable=e,this.handle=null}function PlayableHandler(){this._activePlayables=new DoublyList,this._inactivePlayables=new DoublyList,this._playablesToRemove=new DoublyList,this._silent=!1,this._debug=!1}var DoublyList=require("./DoublyList");module.exports=PlayableHandler,PlayableHandler.prototype._add=function(e){return null===e._handle?(e._handle=this._inactivePlayables.add(e),e._player=this,!0):e._handle.container===this._playablesToRemove?(e._handle=this._playablesToRemove.removeByReference(e._handle),!0):e._handle.container===this._activePlayables?(this._warn("[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),e._stop(),!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 this._remove(e),this._onRemovePlayables(),this},PlayableHandler.prototype.removeAll=function(){for(var e=this._activePlayables.first;null!==e;){var a=e.next;this._remove(e.object),e=a}return this._handlePlayablesToRemove(),this._onRemovePlayables(),this},PlayableHandler.prototype._onRemovePlayables=function(){},PlayableHandler.prototype.possess=function(e){return null===e._handle?!1:e._handle.container===this._activePlayables||e._handle.container===this._inactivePlayables},PlayableHandler.prototype._inactivate=function(e){this._activePlayables.removeByReference(e._handle),e._handle=this._inactivePlayables.add(e)},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._handledPlayables.clear(),this._activePlayables.clear(),this._inactivePlayables.clear(),this._playablesToRemove.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}; | ||
},{"./DoublyList":5}],9:[function(require,module,exports){ | ||
function Player(){Playable.call(this),PlayableHandler.call(this)}var Delay=require("./Delay"),Playable=require("./Playable"),PlayableHandler=require("./PlayableHandler"),inherit=require("./inherit");Player.prototype=Object.create(Playable.prototype),Player.prototype.constructor=Player,inherit(Player,PlayableHandler),module.exports=Player,Player.prototype._delay=function(t,e){return 0>=e?(this._warn("[Tweener.add] Delay null or negative ("+e+").Starting the playable with a delay of 0."),void t.start()):void Delay(e).tweener(this).onComplete(function(e){t.start(e)}).start()},Player.prototype.stop=function(){return this.removeAll(),this._player._inactivate(this)===!1?this:(this._stop(),this)},Player.prototype._moveTo=function(t,e){this._time=t-this._startTime;var a;e>0?this._time>=this._duration&&(a=this._time-this._duration,e-=a,this._time=this._duration):0>e&&this._time<=0&&(a=this._time,e-=a,this._time=0),this._updatePlayableList(),this._update(e),null!==this._onUpdate&&this._onUpdate(this._time,e),void 0!==a&&this._complete(a)},Player.prototype._updatePlayableList=function(){}; | ||
},{"./Delay":4,"./Playable":7,"./PlayableHandler":8,"./inherit":21}],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 e._startTime=this._duration,this._duration+=e._duration,this._add(e),this},Sequence.prototype.addDelay=function(e){return this._duration+=e,this}; | ||
},{"./Timeline":13}],11:[function(require,module,exports){ | ||
var requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(n){window.setTimeout(n,1e3/60)}}(),clock=window.performance||Date,TINA={_tweeners:[],_defaultTweener:null,_running:!1,_startTime:0,_time:0,_onStart:null,_onPause:null,_onResume:null,_onUpdate:null,_onStop:null,_pauseOnLostFocus:!1,onStart:function(n){return this._onStart=n,this},onUpdate:function(n){return this._onUpdate=n,this},onStop:function(n){return this._onStop=n,this},onPause:function(n){return this._onPause=n,this},isRunning:function(){return this._running},update:function(){var n=clock.now()-this._startTime,e=n-this._time;if(!(0>e)){this._time=n;for(var t=this._tweeners.slice(0),i=0;i<t.length;i+=1)t[i]._moveTo(this._time,e);null!==this._onUpdate&&this._onUpdate(this._time,e)}},reset:function(){this._startTime=clock.now(),this._time=0},start:function(){function n(){TINA._running===!0&&(TINA.update(),requestAnimFrame(n))}if(this._running===!0)return console.warn("[TINA.start] TINA is already running"),this;null!==this._onStart&&this._onStart(),this._startTime=clock.now(),this._time=0;for(var e=0;e<this._tweeners.length;e+=1)this._tweeners[e]._start();return this._running=!0,requestAnimFrame(n),this},pause:function(){if(this._running===!1)return console.warn("[TINA.pause] TINA is not running"),this;this._running=!1;for(var n=0;n<this._tweeners.length;n+=1)this._tweeners[n]._pause();return null!==this._onPause&&this._onPause(),this},resume:function(){if(this._running===!0)return console.warn("[TINA.resume] TINA is already running"),this;this._running=!0,null!==this._onResume&&this._onResume();for(var n=0;n<this._tweeners.length;n+=1)this._tweeners[n]._resume();var e=clock.now(),t=e-this._time;return this._startTime+=t,this},stop:function(){this._running=!1;for(var n=this._tweeners.slice(0),e=0;e<n.length;e+=1)n[e]._stop();return this._tweeners=n,null!==this._onStop&&this._onStop(),this},pauseOnLostFocus:function(n){return this._pauseOnLostFocus=n,this},setDefaultTweener:function(n){this._defaultTweener=n,this._tweeners.push(this._defaultTweener)},getDefaultTweener:function(){return this._defaultTweener},_add:function(n){this._running===!1&&this.start(),this._tweeners.push(n)},add:function(n){return this._tweeners.push(n),this},_inactivate:function(n){var e=this._tweeners.indexOf(n);-1!==e&&this._tweeners.splice(e,1)},remove:function(n){return this._inactivate(n),this},_getDefaultTweener:function(){if(null===this._defaultTweener){var n=this.Timer;this._defaultTweener=(new n).start()}return this._defaultTweener}},hidden,visbilityChange;if("undefined"!=typeof document.hidden?(hidden="hidden",visbilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(hidden="mozHidden",visbilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(hidden="msHidden",visbilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(hidden="webkitHidden",visbilityChange="webkitvisibilitychange"),"undefined"==typeof document[hidden])this._warn("[Tweener] Cannot pause on lost focus because the browser does not support the Page Visibility API");else{var wasRunning=!1;document.addEventListener(visbilityChange,function(){document[hidden]&&(wasRunning=TINA.isRunning(),wasRunning&&TINA._pauseOnLostFocus&&TINA.pause()),document[hidden]||wasRunning&&TINA._pauseOnLostFocus&&TINA.resume()},!1)}!function(n){n.TINA=TINA,n!==window&&window&&(window.TINA=TINA)}(this),module.exports=TINA; | ||
},{}],12:[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}; | ||
},{"./Tweener":18}],13:[function(require,module,exports){ | ||
function Timeline(){return this instanceof Timeline==!1?new Timeline:void BoundedPlayer.call(this)}var BoundedPlayer=require("./BoundedPlayer");Timeline.prototype=Object.create(BoundedPlayer.prototype),Timeline.prototype.constructor=Timeline,module.exports=Timeline,Timeline.prototype.add=function(e,t){return t._startTime=e,this._add(t),this._duration=Math.max(this._duration,e+t.getDuration()),this},Timeline.prototype._computeDuration=function(){for(var e,t=0,i=this._inactivePlayables.first;null!==i;i=i.next)e=i.object,t=Math.max(t,e._startTime+e.getDuration());for(i=this._activePlayables.first;null!==i;i=i.next)e=i.object,t=Math.max(t,e._startTime+e.getDuration());this._duration=t},Timeline.prototype._onRemovePlayables=Timeline.prototype._computeDuration,Timeline.prototype._start=function(e,t){BoundedPlayer.prototype._start.call(this,e,t),this._computeDuration()},Timeline.prototype._updatePlayableList=function(){this._handlePlayablesToRemove();for(var e=this._inactivePlayables.first;null!==e;){var t=e.object;e=e.next;var i=t._startTime,a=i+t.getDuration();i<=this._time&&this._time<=a&&(this._inactivePlayables.removeByReference(t._handle),t._handle=this._activePlayables.addBack(t),t._start(-i))}},Timeline.prototype._update=function(e){for(var t=this._activePlayables.first;null!==t;t=t.next){var i=t.object;i._moveTo(this._time,e)}}; | ||
},{"./BoundedPlayer":3}],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"),clock=window.performance||Date;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);this._time-this._startTime;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":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; | ||
},{}],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; | ||
},{}],17:[function(require,module,exports){ | ||
function Tween(e,t){return this instanceof Tween==!1?new Tween(e,t):(BoundedPlayable.call(this),void AbstractTween.call(this,e,t))}var BoundedPlayable=require("./BoundedPlayable"),AbstractTween=require("./AbstractTween"),inherit=require("./inherit");Tween.prototype=Object.create(BoundedPlayable.prototype),Tween.prototype.constructor=Tween,inherit(Tween,AbstractTween),module.exports=Tween; | ||
},{"./AbstractTween":1,"./BoundedPlayable":2,"./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){for(this._time=this._getElapsedTime(e-this._startTime),t=this._getSingleStepDuration(t),this._handlePlayablesToRemove();this._inactivePlayables.length>0;)playable=this._inactivePlayables.pop(),playable._handle=this._activePlayables.add(playable);for(var a=this._activePlayables.first;null!==a;a=a.next)a.object._moveTo(this._time,t);null!==this._onUpdate&&this._onUpdate(this._time,t)},Tweener.prototype.useAsDefault=function(){return TINA.setDefaultTweener(this),this}; | ||
},{"./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,o){return t+t*o-t*t*o},exports.parabolic=function(t){var o=2*t-1;return 1-o*o},exports.trigo=function(t,o){return.5*(1-Math.cos(TWO_PI*t*o))},exports.elastic=function(t,o){if(1===t)return 1;o/=o+1;var n=(1+o)*Math.log(1-t)/Math.log(o);return Math.cos(n-PI_OVER_TWO)*Math.pow(o,n)},exports.polyIn=function(t,o){return Math.pow(t,o)},exports.polyOut=function(t,o){return 1-Math.pow((1-t)/1,o)},exports.polyInOut=function(t,o){return.5>t?Math.pow(2*t,o)/2:(1+(1-Math.pow(2*(1-t),o)))/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,o){return(1-Math.pow(EXP,o*t))/(1-Math.pow(EXP,o))},exports.expOut=function(t,o){return(1-Math.pow(EXP,-o*t))/(1-Math.pow(EXP,-o))},exports.expInOut=function(t,o){return.5>t?(1-Math.pow(EXP,2*o*t))/(1-Math.pow(EXP,o))/2:.5+(1-Math.pow(EXP,o-2*o*t))/(1-Math.pow(EXP,-o))/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,o){if(0===t)return 0;o/=o+1;var n=(1+o)*Math.log(t)/Math.log(o);return Math.cos(n)*Math.pow(o,n)},exports.elasticOut=function(t,o){if(1===t)return 1;o/=o+1;var n=(1+o)*Math.log(1-t)/Math.log(o);return 1-Math.cos(n)*Math.pow(o,n)},exports.elasticInOut=function(t,o){var n;return.5>t?0===t?0:(o/=o+1,n=(1+o)*Math.log(2*t)/Math.log(o),.5*Math.cos(n)*Math.pow(o,n)):1===t?1:(o/=o+1,n=(1+o)*Math.log(2-2*t)/Math.log(o),.5+.5*(1-Math.cos(n)*Math.pow(o,n)))},exports.bounceIn=function(t,o){if(0===t)return 0;o/=o+1;var n=(1+o)*Math.log(t)/Math.log(o);return Math.abs(Math.cos(n)*Math.pow(o,n))},exports.bounceOut=function(t,o){if(1===t)return 1;o/=o+1;var n=(1+o)*Math.log(1-t)/Math.log(o);return 1-Math.abs(Math.cos(n)*Math.pow(o,n))},exports.bounceInOut=function(t,o){var n;return.5>t?0===t?0:(o/=o+1,n=(1+o)*Math.log(2*t)/Math.log(o),Math.abs(.5*Math.cos(n)*Math.pow(o,n))):1===t?1:(o/=o+1,n=(1+o)*Math.log(2-2*t)/Math.log(o),.5+.5*(1-Math.abs(Math.cos(n)*Math.pow(o,n))))},exports.backIn=function(t,o){return t*t*((o+1)*t-o)},exports.backOut=function(t,o){return t-=1,t*t*((o+1)*t+o)+1},exports.backInOut=function(t,o){return.5>t?(t*=2,.5*(t*t*((o+1)*t-o))):(t=2*t-2,.5*(t*t*((o+1)*t+o))+1)}; | ||
},{}],20:[function(require,module,exports){ | ||
var TINA=require("./TINA.js");TINA.Tweener=require("./Tweener"),TINA.Timer=require("./Timer"),TINA.Ticker=require("./Ticker"),TINA.Playable=require("./Playable"),TINA.BoundedPlayable=require("./BoundedPlayable"),TINA.PlayableHandler=require("./PlayableHandler"),TINA.BoundedPlayer=require("./BoundedPlayer"),TINA.Player=require("./Player"),TINA.Tween=require("./Tween"),TINA.NestedTween=require("./NestedTween"),TINA.PixiTween=require("./NestedTween"),TINA.Timeline=require("./Timeline"),TINA.Sequence=require("./Sequence"),TINA.Delay=require("./Delay"),TINA.easing=require("./easing"),TINA.interpolation=require("./interpolation"),module.exports=TINA; | ||
},{"./BoundedPlayable":2,"./BoundedPlayer":3,"./Delay":4,"./NestedTween":6,"./Playable":7,"./PlayableHandler":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]}}; | ||
},{}],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}}(); | ||
},{}]},{},[20]); |
{ | ||
"name": "tina", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "Tweening and INterpolations for Animation", | ||
"main": "src/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"build": "jshint src && browserify -t uglifyify src/index.js -o build/tina.min.js && browserify src/index.js -o build/tina.js", | ||
"test": "jshint src" | ||
}, | ||
@@ -13,2 +14,7 @@ "repository": { | ||
}, | ||
"devDependencies": { | ||
"jshint": "~2.8.0", | ||
"uglifyify": "~3.0.1", | ||
"browserify": "~11.0.0" | ||
}, | ||
"keywords": [ | ||
@@ -15,0 +21,0 @@ "tween", |
325
README.md
@@ -18,3 +18,3 @@ # TINA | ||
* A consequent library of **easing and interpolation methods** | ||
* A variety of components such as **Timeline** and **Sequence** (**Recorder** and CSSTween coming soon) | ||
* A variety of components such as **Timeline** and **Sequence** (**Recorder** and **CSSTween** coming soon) | ||
* **Good synchronisation** between tweens | ||
@@ -43,8 +43,8 @@ * **Relative tweening** enables the possibility to alter objects while they are tweening | ||
``` javascript | ||
var myObject = { x: 0 }; | ||
var propertiesToTween = ['x']; | ||
var duration = 500; // in milliseconds | ||
var myTween = new TINA.Tween(myObject, propertiesToTween) | ||
.to({ x: 1 }, duration) | ||
.start(); | ||
var myObject = { x: 0 }; | ||
var properties = ['x']; | ||
var duration = 500; // in milliseconds | ||
var myTween = new TINA.Tween(myObject, properties) | ||
.to({ x: 1 }, duration) | ||
.start(); | ||
``` | ||
@@ -54,5 +54,5 @@ | ||
``` javascript | ||
TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration) | ||
.start(); | ||
TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration) | ||
.start(); | ||
``` | ||
@@ -62,6 +62,6 @@ | ||
``` javascript | ||
var myArray = [0, 1, 0]; | ||
var myTween = new TINA.Tween(myArray) | ||
.to([0, 2, 1], duration) | ||
.start(); | ||
var myArray = [0, 1, 0]; | ||
var myTween = new TINA.Tween(myArray) | ||
.to([0, 2, 1], duration) | ||
.start(); | ||
``` | ||
@@ -71,5 +71,5 @@ | ||
``` javascript | ||
var myTween = new TINA.Tween(myObject, ['x', 'y']) | ||
.to({ x: 1, y: 0 }, duration) | ||
.start(); | ||
var myTween = new TINA.Tween(myObject, ['x', 'y']) | ||
.to({ x: 1, y: 0 }, duration) | ||
.start(); | ||
``` | ||
@@ -79,6 +79,6 @@ | ||
``` javascript | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration1) | ||
.to({ x: 2 }, duration2) | ||
.start(); | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration1) | ||
.to({ x: 2 }, duration2) | ||
.start(); | ||
``` | ||
@@ -88,12 +88,12 @@ | ||
``` javascript | ||
var myObject = { x: 0 }; | ||
var easingParameter = 2; | ||
var myObject = { x: 0 }; | ||
var easingParameter = 2; | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration, 'elasticInOut', easingParameter) | ||
.start(); | ||
// or | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration, TINA.easing.elasticInOut, easingParameter) | ||
.start(); | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration, 'elasticInOut', easingParameter) | ||
.start(); | ||
// or | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration, TINA.easing.elasticInOut, easingParameter) | ||
.start(); | ||
``` | ||
@@ -103,13 +103,13 @@ | ||
``` javascript | ||
var myObject = { abc: 'Hello' }; | ||
var myObject = { abc: 'Hello' }; | ||
var myTween = new TINA.Tween(myObject, ['abc']) | ||
.to({ abc: 'World' }, duration) | ||
.interpolations({ abc: 'string' }) | ||
.start(); | ||
// or | ||
var myTween = new TINA.Tween(myObject, ['abc']) | ||
.to({ abc: 'World' }, duration) | ||
.interpolations({ abc: TINA.interpolation.string }) | ||
.start(); | ||
var myTween = new TINA.Tween(myObject, ['abc']) | ||
.to({ abc: 'World' }, duration) | ||
.interpolations({ abc: 'string' }) | ||
.start(); | ||
// or | ||
var myTween = new TINA.Tween(myObject, ['abc']) | ||
.to({ abc: 'World' }, duration) | ||
.interpolations({ abc: TINA.interpolation.string }) | ||
.start(); | ||
``` | ||
@@ -119,5 +119,5 @@ | ||
``` javascript | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration) | ||
.delay(1000); | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration) | ||
.delay(1000); | ||
``` | ||
@@ -127,14 +127,14 @@ | ||
``` javascript | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration) | ||
.onStart(function () { | ||
console.log('Tweening will now start'); | ||
}) | ||
.onUpdate(function (time, dt) { | ||
console.log('My object at time', time, 'is', myObject); | ||
}) | ||
.onComplete(function () { | ||
console.log('Tweening is complete'); | ||
}) | ||
.delay(1000); | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 1 }, duration) | ||
.onStart(function () { | ||
console.log('Tweening will now start'); | ||
}) | ||
.onUpdate(function (time, dt) { | ||
console.log('My object at time', time, 'is', myObject); | ||
}) | ||
.onComplete(function () { | ||
console.log('Tweening is complete'); | ||
}) | ||
.delay(1000); | ||
``` | ||
@@ -147,13 +147,13 @@ | ||
``` javascript | ||
var nestedObject = { | ||
position: { x: 0, y: 0 }, | ||
alpha: 0 | ||
} | ||
var nestedObject = { | ||
position: { x: 0, y: 0 }, | ||
alpha: 0 | ||
} | ||
var myNestedTween = new TINA.NestedTween(nestedObject, ['position.x', 'position.y', 'alpha']) | ||
.to({ | ||
position: { x: 10, y: 20 }, | ||
alpha: 1 | ||
}, 500) | ||
.start(); | ||
var myNestedTween = new TINA.NestedTween(nestedObject, ['position.x', 'position.y', 'alpha']) | ||
.to({ | ||
position: { x: 10, y: 20 }, | ||
alpha: 1 | ||
}, 500) | ||
.start(); | ||
``` | ||
@@ -166,8 +166,8 @@ Note: the NestedTween API remains identical to Tween and all the functionalities of Tween are available to a NestedTween object. | ||
``` javascript | ||
var timePosTweenA = 0; | ||
var timePosTweenB = 2000; | ||
var myTimeline = new TINA.Timeline() | ||
.add(timePosTweenA, myTweenA) | ||
.add(timePosTweenB, myTweenB) | ||
.start(); | ||
var timePosTweenA = 0; | ||
var timePosTweenB = 2000; | ||
var myTimeline = new TINA.Timeline() | ||
.add(timePosTweenA, myTweenA) | ||
.add(timePosTweenB, myTweenB) | ||
.start(); | ||
``` | ||
@@ -179,9 +179,9 @@ | ||
``` javascript | ||
// 1 second delay between the end of myTweenB and the start of myTweenC | ||
var mySequence = new TINA.Sequence() | ||
.add(myTweenA) | ||
.add(myTweenB) | ||
.addDelay(1000) | ||
.add(myTweenC) | ||
.start(); | ||
// 1 second delay between the end of myTweenB and the start of myTweenC | ||
var mySequence = new TINA.Sequence() | ||
.add(myTweenA) | ||
.add(myTweenB) | ||
.addDelay(1000) | ||
.add(myTweenC) | ||
.start(); | ||
``` | ||
@@ -192,3 +192,3 @@ | ||
``` javascript | ||
var myDelay = new TINA.Delay(duration); | ||
var myDelay = new TINA.Delay(duration); | ||
``` | ||
@@ -199,17 +199,17 @@ Delays can be used as a ```setTimeout``` that would be synchronised with all the other tweens. | ||
``` javascript | ||
var particleSpeedX = 5; | ||
var particleSpeedY = 0; | ||
var myParticle = new Particle(); | ||
Delay(duration) | ||
.onUpdate(function (time, dt) { | ||
myParticle.x += particleSpeedX * dt; | ||
myParticle.y += particleSpeedY * dt; | ||
var particleSpeedX = 5; | ||
var particleSpeedY = 0; | ||
var myParticle = new Particle(); | ||
Delay(duration) | ||
.onUpdate(function (time, dt) { | ||
myParticle.x += particleSpeedX * dt; | ||
myParticle.y += particleSpeedY * dt; | ||
particleSpeedX *= Math.pow(0.95, dt); | ||
particleSpeedY += gravity * dt; | ||
}) | ||
.onComplete(function () { | ||
myParticle.destroy() | ||
}) | ||
.start(); | ||
particleSpeedX *= Math.pow(0.95, dt); | ||
particleSpeedY += gravity * dt; | ||
}) | ||
.onComplete(function () { | ||
myParticle.destroy() | ||
}) | ||
.start(); | ||
``` | ||
@@ -224,6 +224,6 @@ | ||
``` javascript | ||
// myTween will be tweened by the default tweener | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 5 }, 1000) | ||
.start(); | ||
// myTween will be tweened by the default tweener | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 5 }, 1000) | ||
.start(); | ||
``` | ||
@@ -233,7 +233,7 @@ | ||
``` javascript | ||
// myTween will be tweened by myTweener | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 5 }, 1000) | ||
.tweener(myTweener) | ||
.start(); | ||
// myTween will be tweened by myTweener | ||
var myTween = new TINA.Tween(myObject, ['x']) | ||
.to({ x: 5 }, 1000) | ||
.tweener(myTweener) | ||
.start(); | ||
``` | ||
@@ -243,6 +243,6 @@ | ||
``` javascript | ||
// I choose a timer as my default tweener | ||
var myTimer = new TINA.Timer().useAsDefault(); | ||
// myTween will be attached to myTimer and will take 500 milliseconds to tween | ||
var myTween = new TINA.Tween(myObject, ['x']).to({ x: 5 }, 500).start(); | ||
// I choose a timer as my default tweener | ||
var myTimer = new TINA.Timer().useAsDefault(); | ||
// myTween will be attached to myTimer and will take 500 milliseconds to tween | ||
var myTween = new TINA.Tween(myObject, ['x']).to({ x: 5 }, 500).start(); | ||
``` | ||
@@ -254,3 +254,3 @@ | ||
``` javascript | ||
var myTimer = new TINA.Timer().useAsDefault().start(); | ||
var myTimer = new TINA.Timer().useAsDefault().start(); | ||
``` | ||
@@ -260,11 +260,11 @@ | ||
``` javascript | ||
var myTimer = new TINA.Timer().useAsDefault(); | ||
TINA.add(myTimer); | ||
var myTimer = new TINA.Timer().useAsDefault(); | ||
TINA.add(myTimer); | ||
function update() { | ||
TINA.update(); | ||
requestAnimationFrame(update); | ||
} | ||
function update() { | ||
TINA.update(); | ||
requestAnimationFrame(update); | ||
} | ||
requestAnimationFrame(update); | ||
requestAnimationFrame(update); | ||
``` | ||
@@ -279,4 +279,4 @@ | ||
``` javascript | ||
var tups = 60; // Time units per second | ||
var myTimer = new TINA.Timer(tups); | ||
var tups = 60; // Time units per second | ||
var myTimer = new TINA.Timer(tups); | ||
``` | ||
@@ -286,14 +286,14 @@ | ||
``` javascript | ||
var myTimer1 = new TINA.Timer(1); | ||
var myTimer60 = new TINA.Timer(60); | ||
var myTimer1000 = new TINA.Timer(1000); | ||
var myTimer1 = new TINA.Timer(1); | ||
var myTimer60 = new TINA.Timer(60); | ||
var myTimer1000 = new TINA.Timer(1000); | ||
// The following will tween myObject in 100 seconds | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTimer1); | ||
// The following will tween myObject in 100 seconds | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTimer1); | ||
// The following will tween myObject in 1.667 seconds | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTimer60); | ||
// The following will tween myObject in 1.667 seconds | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTimer60); | ||
// The following will tween myObject in 0.1 seconds | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTimer1000); | ||
// The following will tween myObject in 0.1 seconds | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTimer1000); | ||
``` | ||
@@ -306,3 +306,3 @@ | ||
``` javascript | ||
var myTicker = new TINA.Ticker().useAsDefault().start(); | ||
var myTicker = new TINA.Ticker().useAsDefault().start(); | ||
``` | ||
@@ -312,11 +312,11 @@ | ||
``` javascript | ||
var myTicker = new TINA.Ticker().useAsDefault(); | ||
TINA.add(new TINA.Ticker()); | ||
var myTicker = new TINA.Ticker().useAsDefault(); | ||
TINA.add(new TINA.Ticker()); | ||
function update() { | ||
TINA.update(); | ||
requestAnimationFrame(update); | ||
} | ||
function update() { | ||
TINA.update(); | ||
requestAnimationFrame(update); | ||
} | ||
requestAnimationFrame(update); | ||
requestAnimationFrame(update); | ||
``` | ||
@@ -327,4 +327,4 @@ | ||
``` javascript | ||
var tupt = 2; // Time units per tick/update | ||
var myTicker = new TINA.Ticker(tupt); | ||
var tupt = 2; // Time units per tick/update | ||
var myTicker = new TINA.Ticker(tupt); | ||
``` | ||
@@ -334,14 +334,14 @@ | ||
``` javascript | ||
var myTicker1 = new TINA.Ticker(1); | ||
var myTicker10 = new TINA.Ticker(10); | ||
var myTicker20 = new TINA.Ticker(20); | ||
var myTicker1 = new TINA.Ticker(1); | ||
var myTicker10 = new TINA.Ticker(10); | ||
var myTicker20 = new TINA.Ticker(20); | ||
// The following will tween myObject in 100 updates | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTicker1); | ||
// The following will tween myObject in 100 updates | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTicker1); | ||
// The following will tween myObject in 10 updates | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTicker10); | ||
// The following will tween myObject in 10 updates | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTicker10); | ||
// The following will tween myObject in 5 updates | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTicker20); | ||
// The following will tween myObject in 5 updates | ||
TINA.Tween(myObject, ['x']).to({ x: 1 }, 100).tweener(myTicker20); | ||
``` | ||
@@ -352,29 +352,16 @@ | ||
``` javascript | ||
// t is the total time elapsed since TINA started | ||
// dt is the time elapsed since the TINA's previous update | ||
// both durations are in milliseconds | ||
TINA.onUpdate(function (t, dt) { | ||
// At this point, | ||
// all my tweens are up to date | ||
// for the current iteration | ||
myGameLogic.update(t, dt); | ||
myPhysics.update(dt); | ||
myRenderer.update(); | ||
... | ||
}); | ||
// t is the total time elapsed since TINA started | ||
// dt is the time elapsed since TINA's previous update | ||
// both durations are in milliseconds | ||
TINA.onUpdate(function (t, dt) { | ||
// At this point, | ||
// all my tweens are up to date | ||
// for the current iteration | ||
myGameLogic.update(t, dt); | ||
myPhysics.update(dt); | ||
myRenderer.update(); | ||
... | ||
}); | ||
``` | ||
## How to build | ||
You would need to have component and uglify installed: | ||
``` | ||
npm install -g component | ||
npm install -g uglifyjs | ||
``` | ||
If component and uglify are already install, use the following command to build: | ||
``` | ||
component build; mv build/build.js build/tina.js; uglifyjs build/tina.js -o build/tina.min.js | ||
``` | ||
Made in [Wizcorp](http://www.wizcorp.jp). |
@@ -143,6 +143,6 @@ var Transition = require('./Transition'); | ||
AbstractTween.prototype.to = function (toObject, duration, easing, easingParam, interpolationParams) { | ||
// The API allows to pass interpolation names that will be replaced | ||
// by the corresponding interpolation functions | ||
// The API allows to pass easing names that will be replaced | ||
// by the corresponding easing functions | ||
if (typeof(easing) === 'string') { | ||
// Replacing interpolation name by interpolation function | ||
// Replacing easing name by easing function | ||
if (easingFunctions[easing] === undefined) { | ||
@@ -149,0 +149,0 @@ console.warn('[AbstractTween.to] Given easing does not exist'); |
@@ -16,3 +16,4 @@ var Playable = require('./Playable'); | ||
this._onComplete = null; | ||
}; | ||
} | ||
BoundedPlayable.prototype = Object.create(Playable.prototype); | ||
@@ -81,3 +82,18 @@ BoundedPlayable.prototype.constructor = BoundedPlayable; | ||
BoundedPlayable.prototype._start = function (timeOffset) { | ||
this._startTime = -timeOffset; | ||
if (this._onStart !== null) { | ||
this._onStart(); | ||
} | ||
// Making sure the playable is not over yet | ||
if (timeOffset >= this.getDuration()) { | ||
// Playable is over | ||
// Moving it to given time offset | ||
// This will have the effect of completing it | ||
this._moveTo(this._startTime + timeOffset, timeOffset); | ||
} | ||
}; | ||
BoundedPlayable.prototype._moveTo = function (time, dt) { | ||
@@ -90,3 +106,3 @@ dt *= this._speed; | ||
if (this._iterations === 1) { | ||
// Converting into time relative to when the playable was started | ||
// Converting into local time (relative to speed and when the playable started) | ||
this._time = (time - this._startTime) * this._speed; | ||
@@ -93,0 +109,0 @@ if (dt > 0) { |
@@ -51,3 +51,3 @@ var BoundedPlayable = require('./BoundedPlayable'); | ||
if (this._iterations === 1) { | ||
// Converting into time relative to when the playable was started | ||
// Converting into local time (relative to speed and when the playable started) | ||
this._time = (time - this._startTime) * this._speed; | ||
@@ -54,0 +54,0 @@ if (dt > 0) { |
@@ -18,6 +18,7 @@ var Tween = require('./Tween'); | ||
var object = (typeof object === 'string') ? document.querySelector(object) : object; | ||
var tweenedObject = (typeof object === 'string') ? document.querySelector(object) : object; | ||
// TODO: change inheritance to NestedTween for support of css transform properties | ||
Tween.call(this, object.style, properties); | ||
// and add an internal method for replacing unprefixed properties by prefixed properties when necessary | ||
Tween.call(this, tweenedObject.style, properties); | ||
} | ||
@@ -24,0 +25,0 @@ CSSTween.prototype = Object.create(Tween.prototype); |
@@ -8,10 +8,10 @@ /** | ||
* | ||
* Method Time Complexity | ||
* ___________________________________ | ||
* Method Time Complexity | ||
* ___________________________________ | ||
* | ||
* add O(1) | ||
* remove O(1) | ||
* clear O(n) | ||
* add O(1) | ||
* remove O(1) | ||
* clear O(n) | ||
* | ||
* Memory Complexity in O(n) | ||
* Memory Complexity in O(n) | ||
*/ | ||
@@ -64,3 +64,3 @@ | ||
var object = this.first.object; | ||
this.remove(this.first); | ||
this.removeByReference(this.first); | ||
return object; | ||
@@ -72,9 +72,9 @@ }; | ||
var object = this.last.object; | ||
this.remove(this.last); | ||
this.removeByReference(this.last); | ||
return object; | ||
}; | ||
DoublyList.prototype.remove = function (node) { | ||
DoublyList.prototype.removeByReference = function (node) { | ||
if (node.container !== this) { | ||
console.warn('[DoublyList.remove] Trying to remove a node that does not belong to the list'); | ||
console.warn('[DoublyList.removeByReference] Trying to remove a node that does not belong to the list'); | ||
return node; | ||
@@ -87,2 +87,3 @@ } | ||
node.next.prev = node.prev; | ||
// node.next = null; | ||
} | ||
@@ -94,2 +95,3 @@ | ||
node.prev.next = node.next; | ||
// node.prev = null; | ||
} | ||
@@ -103,2 +105,13 @@ | ||
DoublyList.prototype.remove = function (object) { | ||
for (var node = this.first; node !== null; node = node.next) { | ||
if (node.object === object) { | ||
this.removeByReference(node); | ||
return true; | ||
} | ||
} | ||
return false; | ||
}; | ||
DoublyList.prototype.clear = function () { | ||
@@ -113,2 +126,17 @@ // Making sure that nodes containers are being resetted | ||
this.length = 0; | ||
}; | ||
DoublyList.prototype.forEach = function (processingFunc, params) { | ||
for (var node = this.first; node; node = node.next) { | ||
processingFunc(node.object, params); | ||
} | ||
}; | ||
DoublyList.prototype.toArray = function () { | ||
var objects = []; | ||
for (var node = this.first; node !== null; node = node.next) { | ||
objects.push(node.object); | ||
} | ||
return objects; | ||
}; |
@@ -37,2 +37,17 @@ /** | ||
exports.vectorXY = function(t, a, b) { | ||
return { | ||
x: a.x * (1 - t) + b.x * t, | ||
y: a.y * (1 - t) + b.y * t | ||
}; | ||
}; | ||
exports.vectorXYZ = function(t, a, b) { | ||
return { | ||
x: a.x * (1 - t) + b.x * t, | ||
y: a.y * (1 - t) + b.y * t, | ||
z: a.z * (1 - t) + b.z * t | ||
}; | ||
}; | ||
// a, b = vectors | ||
@@ -179,3 +194,3 @@ exports.vector = function(t, a, b) { | ||
y * t + a[1] * p | ||
] | ||
]; | ||
}; | ||
@@ -207,3 +222,3 @@ | ||
z * t + a[2] * p | ||
] | ||
]; | ||
}; | ||
@@ -336,3 +351,3 @@ | ||
return a * (1 - t) + b * t; | ||
} | ||
}; | ||
})(); | ||
@@ -409,6 +424,6 @@ | ||
var g2 = (3.0 - Math.sqrt(3.0)) / 6.0; | ||
var t = (i + j) * g2; | ||
var r = (i + j) * g2; | ||
var x0 = i - t; // Unskew the cell origin back to (x, y) space | ||
var y0 = j - t; | ||
var x0 = i - r; // Unskew the cell origin back to (x, y) space | ||
var y0 = j - r; | ||
x0 = x - x0; // The x, y distances from the cell origin | ||
@@ -480,3 +495,3 @@ y0 = y - y0; | ||
return a * (1 - t) + b * t; | ||
} | ||
}; | ||
})(); |
@@ -33,8 +33,9 @@ var BoundedPlayable = require('./BoundedPlayable'); | ||
var objects = {}; | ||
var propertiesPerObject = {}; | ||
var objects = {}; | ||
var property, propertyChainString; | ||
for (var p = 0; p < properties.length; p += 1) { | ||
var propertyString = properties[p]; | ||
var propertyChainString = propertyString.substring(0, propertyString.lastIndexOf('.')); | ||
propertyChainString = propertyString.substring(0, propertyString.lastIndexOf('.')); | ||
@@ -52,3 +53,3 @@ if (propertiesPerObject[propertyChainString] === undefined) { | ||
var property = propertyChain[propertyIndex]; | ||
property = propertyChain[propertyIndex]; | ||
if (propertyObject[property] instanceof Array) { | ||
@@ -58,3 +59,3 @@ propertiesPerObject[propertyString] = null; | ||
this._propertyChainStrings.push(propertyString); | ||
this._propertyChains[propertyChain] = propertyChain; | ||
this._propertyChains[propertyString] = propertyChain; | ||
} else { | ||
@@ -73,3 +74,3 @@ propertiesPerObject[propertyChainString] = [property]; | ||
// Object was already fetched | ||
var property = propertyString.substring(propertyString.lastIndexOf('.') + 1); | ||
property = propertyString.substring(propertyString.lastIndexOf('.') + 1); | ||
propertiesPerObject[propertyChainString].push(property); | ||
@@ -80,3 +81,3 @@ } | ||
// Creating the tweens | ||
for (var propertyChainString in objects) { | ||
for (propertyChainString in objects) { | ||
var tweenObject = objects[propertyChainString]; | ||
@@ -104,3 +105,3 @@ var tweenProperties = propertiesPerObject[propertyChainString]; | ||
for (var t = 0; t < this._tweens.length; t += 1) { | ||
this._tweens[t].reset; | ||
this._tweens[t].reset(); | ||
} | ||
@@ -165,3 +166,3 @@ | ||
var objectInterpolationParams = interpolationParams; | ||
for (var c = 0; c < chainLength && objectInterpolationParams !== undefined; c += 1) { | ||
for (c = 0; c < chainLength && objectInterpolationParams !== undefined; c += 1) { | ||
objectInterpolationParams = objectInterpolationParams[propertyChain[c]]; | ||
@@ -168,0 +169,0 @@ } |
@@ -9,6 +9,6 @@ /** @class */ | ||
// Starting time relative to its player time | ||
// Starting time, is global (relative to its player time) | ||
this._startTime = 0; | ||
// Current time relative to the start time | ||
// Current time, is local (relative to starting time) | ||
// i.e this._time === 0 implies this._player._time === this._startTime | ||
@@ -26,3 +26,4 @@ this._time = 0; | ||
this._onStop = null; | ||
}; | ||
} | ||
module.exports = Playable; | ||
@@ -150,3 +151,3 @@ | ||
this._onStart(); | ||
}; | ||
} | ||
}; | ||
@@ -153,0 +154,0 @@ |
@@ -50,3 +50,3 @@ var DoublyList = require('./DoublyList'); | ||
// Playable was being removed, removing from playables to remove | ||
playable._handle = this._playablesToRemove.remove(playable._handle); | ||
playable._handle = this._playablesToRemove.removeByReference(playable._handle); | ||
return true; | ||
@@ -85,3 +85,3 @@ } | ||
// Playable was being started, removing from starting playables | ||
playable._handle = this._inactivePlayables.remove(playable._handle); | ||
playable._handle = this._inactivePlayables.removeByReference(playable._handle); | ||
return true; | ||
@@ -131,3 +131,3 @@ } | ||
PlayableHandler.prototype._inactivate = function (playable) { | ||
this._activePlayables.remove(playable._handle); | ||
this._activePlayables.removeByReference(playable._handle); | ||
@@ -147,3 +147,3 @@ // Playable is moved to the list of inactive playables | ||
var playable = handle.object; | ||
playable._handle = this._activePlayables.remove(handle); | ||
playable._handle = this._activePlayables.removeByReference(handle); | ||
playable._player = null; | ||
@@ -162,2 +162,3 @@ } | ||
PlayableHandler.prototype._warn = function (warning) { | ||
// jshint debug: true | ||
if (this._silent === false) { | ||
@@ -164,0 +165,0 @@ console.warn(warning); |
@@ -56,2 +56,3 @@ var BoundedPlayable = require('./BoundedPlayable'); | ||
var p; | ||
if (smooth) { | ||
@@ -68,3 +69,3 @@ var t0 = this.timestamps[playingHead - 1]; | ||
for (var p = 0; p < nbProperties; p += 1) { | ||
for (p = 0; p < nbProperties; p += 1) { | ||
this.object[this.properties[p]] = this.records[recordIdx0 + p] * delta0 + this.records[recordIdx1 + p] * delta1; | ||
@@ -74,3 +75,3 @@ } | ||
var recordIdx = nbProperties * playingHead; | ||
for (var p = 0; p < nbProperties; p += 1) { | ||
for (p = 0; p < nbProperties; p += 1) { | ||
this.object[this.properties[p]] = this.records[recordIdx + p]; | ||
@@ -247,5 +248,7 @@ } | ||
Recorder.prototype.update = function () { | ||
var r; | ||
if (this._recording) { | ||
var nbRecordingObjects = this._recordingObjectLabels.length; | ||
for (var r = 0; r < nbRecordingObjects; r += 1) { | ||
for (r = 0; r < nbRecordingObjects; r += 1) { | ||
var label = this._recordingObjectLabels[r]; | ||
@@ -258,3 +261,3 @@ this._recordingObjects[label].record(this._time); | ||
var nbObjectRecorded = this._recordedObjects.length; | ||
for (var r = 0; r < nbObjectRecorded; r += 1) { | ||
for (r = 0; r < nbObjectRecorded; r += 1) { | ||
this._recordedObjects[r].play(this._time, this._smooth); | ||
@@ -261,0 +264,0 @@ } |
@@ -16,3 +16,2 @@ var Tweener = require('./Tweener'); | ||
Tweener.call(this); | ||
SOmethingElse.call(this); | ||
@@ -37,17 +36,2 @@ // Time units per tick (tupt) | ||
var dt = this._nbTicks; | ||
if (tupt === 0) { | ||
// Setting start as if new tupt was 1 | ||
this._nbTicks = this._time - dt * this._tupt; | ||
} else { | ||
if (this._tupt === 0) { | ||
// If current tupt is 0, | ||
// it corresponds to a virtual tupt of 1 | ||
// when it comes to determing how many ticks have passed | ||
this._nbTicks = this._time - dt / tupt; | ||
} else { | ||
this._nbTicks = this._time - dt * this._tupt / tupt; | ||
} | ||
} | ||
this._tupt = tupt; | ||
@@ -54,0 +38,0 @@ } |
@@ -34,5 +34,6 @@ var BoundedPlayer = require('./BoundedPlayer'); | ||
Timeline.prototype._computeDuration = function () { | ||
var playable; | ||
var duration = 0; | ||
for (var handle = this._inactivePlayables.first; handle !== null; handle = handle.next) { | ||
var playable = handle.object; | ||
playable = handle.object; | ||
duration = Math.max(duration, playable._startTime + playable.getDuration()); | ||
@@ -73,3 +74,3 @@ } | ||
// O(1) | ||
this._inactivePlayables.remove(playable._handle); | ||
this._inactivePlayables.removeByReference(playable._handle); | ||
playable._handle = this._activePlayables.addBack(playable); | ||
@@ -76,0 +77,0 @@ |
@@ -39,3 +39,3 @@ var Tweener = require('./Tweener'); | ||
// Setting start as if new tups was 1 | ||
this._startTime = this._time - dt * this._tups; | ||
this._startTime += this._time / this._tups - this._time; | ||
} else { | ||
@@ -46,5 +46,5 @@ if (this._tups === 0) { | ||
// when it comes to determing where the start is | ||
this._startTime = this._time - dt / tups; | ||
this._startTime = this._time - this._time / tups; | ||
} else { | ||
this._startTime = this._time - dt * this._tups / tups; | ||
this._startTime = this._time / this._tups - this._time / tups; | ||
} | ||
@@ -51,0 +51,0 @@ } |
@@ -25,8 +25,13 @@ | ||
window.oRequestAnimationFrame || | ||
window.msRequestAnimationFrame || | ||
function(callback){ | ||
window.setTimeout(callback, 1000 / 60); | ||
}; | ||
window.msRequestAnimationFrame | ||
})(); | ||
var cancelAnimFrame = (function(){ | ||
return window.cancelAnimationFrame || | ||
window.webkitCancelAnimationFrame || | ||
window.mozCancelAnimationFrame || | ||
window.oCancelAnimationFrame || | ||
window.msCancelAnimationFrame | ||
})(); | ||
// Performance.now gives better precision than Date.now | ||
@@ -38,3 +43,3 @@ var clock = window.performance || Date; | ||
_defaultTweener: null, | ||
_running: false, | ||
_requestAnimFrameId: null, | ||
@@ -74,3 +79,3 @@ _startTime: 0, | ||
isRunning: function () { | ||
return this._running; | ||
return (this._requestAnimFrameId !== null); | ||
}, | ||
@@ -113,3 +118,3 @@ | ||
start: function () { | ||
if (this._running === true) { | ||
if (this._requestAnimFrameId !== null) { | ||
console.warn('[TINA.start] TINA is already running'); | ||
@@ -119,9 +124,2 @@ return this; | ||
function updateTINA() { | ||
if (TINA._running === true) { | ||
TINA.update(); | ||
requestAnimFrame(updateTINA); | ||
} | ||
} | ||
if (this._onStart !== null) { | ||
@@ -139,11 +137,47 @@ this._onStart(); | ||
this._running = true; | ||
this._startAutomaticUpdate(); | ||
return this; | ||
}, | ||
// internal start method, called by start and resume | ||
_startAutomaticUpdate: function () { | ||
function updateTINA() { | ||
if (TINA._requestAnimFrameId !== null) { | ||
TINA.update(); | ||
requestAnimFrame(updateTINA); | ||
} | ||
} | ||
// Starting the animation loop | ||
requestAnimFrame(updateTINA); | ||
this._requestAnimFrameId = requestAnimFrame(updateTINA); | ||
}, | ||
stop: function () { | ||
this._running = false; | ||
var runningTweeners = this._tweeners.slice(0); | ||
for (var t = 0; t < runningTweeners.length; t += 1) { | ||
runningTweeners[t]._stop(); | ||
} | ||
// Stopping the tweeners have the effect of automatically removing them from TINA | ||
// In this case we want to keep them attached to TINA | ||
this._tweeners = runningTweeners; | ||
if (this._onStop !== null) { | ||
this._onStop(); | ||
} | ||
this._stopAutomaticUpdate(); | ||
return this; | ||
}, | ||
// Internal stop method, called by stop and pause | ||
_stopAutomaticUpdate: function () { | ||
// Starting the animation loop | ||
cancelAnimFrame(this._requestAnimFrameId); | ||
this._requestAnimFrameId = null; | ||
}, | ||
pause: function () { | ||
if (this._running === false) { | ||
if (this._requestAnimFrameId === null) { | ||
console.warn('[TINA.pause] TINA is not running'); | ||
@@ -161,2 +195,4 @@ return this; | ||
} | ||
this._stopAutomaticUpdate(); | ||
return this; | ||
@@ -176,6 +212,2 @@ }, | ||
for (var t = 0; t < this._tweeners.length; t += 1) { | ||
this._tweeners[t]._resume(); | ||
} | ||
// Resetting the clock | ||
@@ -190,19 +222,7 @@ // Getting time difference between last update and now | ||
return this; | ||
}, | ||
stop: function () { | ||
this._running = false; | ||
var runningTweeners = this._tweeners.slice(0); | ||
for (var t = 0; t < runningTweeners.length; t += 1) { | ||
runningTweeners[t]._stop(); | ||
for (var t = 0; t < this._tweeners.length; t += 1) { | ||
this._tweeners[t]._resume(); | ||
} | ||
// Stopping the tweeners have the effect of automatically removing them from TINA | ||
// In this case we want to keep them attached to TINA | ||
this._tweeners = runningTweeners; | ||
if (this._onStop !== null) { | ||
this._onStop(); | ||
} | ||
this._startAutomaticUpdate(); | ||
return this; | ||
@@ -209,0 +229,0 @@ }, |
@@ -12,3 +12,3 @@ // The file is a good representation of the constant fight between maintainability and performance | ||
object[p] = this.from[p] * (1 - t) + this.to[p] * t; | ||
}; | ||
} | ||
@@ -22,3 +22,3 @@ // Several Properties | ||
} | ||
}; | ||
} | ||
@@ -29,3 +29,3 @@ // Interpolation | ||
object[p] = this.interps[p](t, this.from[p], this.to[p], this.interpParams[p]); | ||
}; | ||
} | ||
@@ -40,3 +40,3 @@ // Interpolation | ||
} | ||
}; | ||
} | ||
@@ -48,3 +48,3 @@ // Easing | ||
object[p] = this.from[p] * (1 - t) + this.to[p] * t; | ||
}; | ||
} | ||
@@ -60,3 +60,3 @@ // Easing | ||
} | ||
}; | ||
} | ||
@@ -68,3 +68,3 @@ // Easing | ||
object[p] = this.interps[p](this.easing(t, this.easingParam), this.from[p], this.to[p], this.interpParams[p]); | ||
}; | ||
} | ||
@@ -81,3 +81,3 @@ // Easing | ||
} | ||
}; | ||
} | ||
@@ -84,0 +84,0 @@ var updateMethods = [ |
@@ -8,3 +8,3 @@ | ||
this.prev = now; | ||
}; | ||
} | ||
@@ -20,3 +20,3 @@ // Several Properties | ||
} | ||
}; | ||
} | ||
@@ -29,3 +29,3 @@ // Interpolation | ||
this.prev = now; | ||
}; | ||
} | ||
@@ -42,3 +42,3 @@ // Interpolation | ||
} | ||
}; | ||
} | ||
@@ -52,3 +52,3 @@ // Easing | ||
this.prev = now; | ||
}; | ||
} | ||
@@ -66,3 +66,3 @@ // Easing | ||
} | ||
}; | ||
} | ||
@@ -76,3 +76,3 @@ // Easing | ||
this.prev = now; | ||
}; | ||
} | ||
@@ -91,3 +91,3 @@ // Easing | ||
} | ||
}; | ||
} | ||
@@ -156,39 +156,2 @@ var updateMethods = [ | ||
module.exports = Transition; | ||
// exports.number = function (a, b) { | ||
// return a + b; | ||
// } | ||
// exports.vector = function (a, b) { | ||
// var n = a.length; | ||
// var addition = []; | ||
// for (var i = 0; i < n; a += 1) { | ||
// addition[i] = a[i] + b[i]; | ||
// } | ||
// return addition; | ||
// } | ||
// exports.number = function (a, b) { | ||
// return a - b; | ||
// } | ||
// exports.vector = function (a, b) { | ||
// var n = a.length; | ||
// var difference = []; | ||
// for (var i = 0; i < n; a += 1) { | ||
// difference[i] = a[i] - b[i]; | ||
// } | ||
// return difference; | ||
// } | ||
// function update(object, t) { | ||
// var prop = this.prop; | ||
// var now = this.from[p] * (1 - t) + this.to[p] * t; | ||
// object[p] = this.addition[p](object[p], this.difference[p](now, this.prev)); | ||
// this.prev = now; | ||
// }; | ||
module.exports = Transition; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
706694
36
7144
3
340
11