diff --git a/CHANGELOG.md b/CHANGELOG.md index 83b214a..f2b2bb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### [0.4.0](http://github.com/lvivski/anima/tree/0.4.0) / 2015-04-13 [Diff](https://github.com/lvivski/anima/compare/0.3.0...0.4.0) +### [0.4.0](http://github.com/lvivski/animatic/tree/0.4.0) / 2015-04-13 [Diff](https://github.com/lvivski/animatic/compare/0.3.0...0.4.0) - physics timeline - edge bounce - fix CSS runner @@ -6,7 +6,7 @@ - initial editor bookmarklet - over 60 bugfixes -### [0.3.0](http://github.com/lvivski/anima/tree/0.3.0) / 2013-05-15 [Diff](https://github.com/lvivski/anima/compare/0.2.0...0.3.0) +### [0.3.0](http://github.com/lvivski/animatic/tree/0.3.0) / 2013-05-15 [Diff](https://github.com/lvivski/animatic/compare/0.2.0...0.3.0) - animations with physics - new animations runner with parallel sequences - ability to generate CSS without applying it @@ -14,7 +14,7 @@ - "use strict" - over 70 bugfixes -### [0.2.0](http://github.com/lvivski/anima/tree/0.2.0) / 2013-03-07 [Diff](https://github.com/lvivski/anima/compare/0.1.0...0.2.0) +### [0.2.0](http://github.com/lvivski/animatic/tree/0.2.0) / 2013-03-07 [Diff](https://github.com/lvivski/animatic/compare/0.1.0...0.2.0) - Timeline - MS Internet Explorer 10 support - `Item.center()` and `Item.lookAt(vector)` @@ -26,5 +26,5 @@ - infinite animations - over 50 bugfixes -### [0.1.0](http://github.com/lvivski/anima/tree/0.1.0) / 2013-02-09 +### [0.1.0](http://github.com/lvivski/animatic/tree/0.1.0) / 2013-02-09 - initial public release diff --git a/Makefile b/Makefile index 9951be0..62d0155 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,10 @@ FILES = \ src/physics/particle.js \ all: \ - anima.js \ - anima.min.js + animatic.js \ + animatic.min.js -anima.js: ${FILES} +animatic.js: ${FILES} @rm -f $@ @echo "(function(root){" > $@.tmp @echo "'use strict'" >> $@.tmp @@ -36,7 +36,7 @@ anima.js: ${FILES} @rm $@.tmp @chmod a-w $@ -anima.min.js: anima.js +animatic.min.js: animatic.js @rm -f $@ @$(JS_COMPILER) $< -c -m -o $@ \ --source-map $@.map \ @@ -47,4 +47,4 @@ deps: npm install clean: - rm -f anima*.js* + rm -f animatic*.js* diff --git a/anima.min.js b/anima.min.js deleted file mode 100644 index df44648..0000000 --- a/anima.min.js +++ /dev/null @@ -1,2 +0,0 @@ -!function(t){"use strict";function i(t){return x?x+t:t}function e(t){for(var i=1;in;++n)(this.current.position[n]i[n])&&(e?this.previous.position[n]=2*this.current.position[n]-this.previous.position[n]:this.current.position[n]=Math.max(t[n],Math.min(i[n],this.current.position[n])))}function g(t,i){var e=this.current,n=this.previous;e.acceleration=R.scale(e.acceleration,this.mass),e.velocity=R.sub(e.position,n.position),void 0!==i&&(e.velocity=R.scale(e.velocity,i)),n.position=e.position,e.position=R.add(e.position,R.add(e.velocity,R.scale(e.acceleration,t*t))),e.acceleration=R.zero()}function v(t,i,e,n){m.call(this,t),i===Object(i)&&(e=i.viscosity,n=i.edge,i=i.mass),i/=100,i||(i=.01),e||(e=.1),n||(n=!1),this.mass=1/i,this.viscosity=e,this.edge=n,this.current={position:R.zero(),velocity:R.zero(),acceleration:R.zero()},this.previous={position:R.zero(),velocity:R.zero(),acceleration:R.zero()},this.clock=null}var b={};b.world=function(){return new l},b.timeline=function(){return new f},"object"==typeof module&&"object"==typeof module.exports?module.exports=b:"function"==typeof define&&define.amd?define(b):t.anima=t.a=b;for(var M=t.requestAnimationFrame,z=t.cancelAnimationFrame,w=["moz","webkit","ms"],A=0;A1e12!=q.now()>1e12});var R={set:function(t,i,e){return Array.isArray(t)&&(i=t[1],e=t[2],t=t[0]),void 0===t&&(t=0),void 0===i&&(i=t,e=t),[t,i,e]},length:function(t,i,e){return Array.isArray(t)&&(i=t[1],e=t[2],t=t[0]),Math.sqrt(t*t+i*i+e*e)},add:function(t,i){return[t[0]+i[0],t[1]+i[1],t[2]+i[2]]},sub:function(t,i){return[t[0]-i[0],t[1]-i[1],t[2]-i[2]]},norm:function(t,i,e){Array.isArray(t)&&(i=t[1],e=t[2],t=t[0]);var n=this.length(t,i,e);return 0!==n?(t/=n,i/=n,e/=n):(t=0,i=0,e=0),[t,i,e]},dist:function(t,i){var e=t[0]-i[0],n=t[1]-i[1],r=t[2]-i[2];return Math.sqrt(e*e+n*n+r+r)},cross:function(t,i){var e=t[1]*i[2]-t[2]*i[1],n=t[2]*i[0]-t[0]*i[2],r=t[1]*i[1]-t[1]*i[0];return[e,n,r]},clone:function(t){return t.slice()},scale:function(t,i,e,n){return Array.isArray(t)&&(n=i,i=t[1],e=t[2],t=t[0]),[t*n,i*n,e*n]},zero:function(){return[0,0,0]}},S=Math.PI/180,j={identity:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},multiply:function E(t,i){var e=this.identity();return e[0]=t[0]*i[0]+t[1]*i[4]+t[2]*i[8],e[1]=t[0]*i[1]+t[1]*i[5]+t[2]*i[9],e[2]=t[0]*i[2]+t[1]*i[6]+t[2]*i[10],e[4]=t[4]*i[0]+t[5]*i[4]+t[6]*i[8],e[5]=t[4]*i[1]+t[5]*i[5]+t[6]*i[9],e[6]=t[4]*i[2]+t[5]*i[6]+t[6]*i[10],e[8]=t[8]*i[0]+t[9]*i[4]+t[10]*i[8],e[9]=t[8]*i[1]+t[9]*i[5]+t[10]*i[9],e[10]=t[8]*i[2]+t[9]*i[6]+t[10]*i[10],e[12]=t[12]*i[0]+t[13]*i[4]+t[14]*i[8]+i[12],e[13]=t[12]*i[1]+t[13]*i[5]+t[14]*i[9]+i[13],e[14]=t[12]*i[2]+t[13]*i[6]+t[14]*i[10]+i[14],2>=arguments.length?e:E.apply(this,[e].concat(Array.prototype.slice.call(arguments,2)))},translate:function(t,i,e){return t||i||e?(t||(t=0),i||(i=0),e||(e=0),[1,0,0,0,0,1,0,0,0,0,1,0,t,i,e,1]):this.identity()},scale:function(t,i,e){return t||i||e?(t||(t=1),i||(i=1),e||(e=1),[t,0,0,0,0,i,0,0,0,0,e,0,0,0,0,1]):this.identity()},rotate:function(t,i,e){if(!(t||i||e))return this.identity();t||(t=0),i||(i=0),e||(e=0),t*=S,i*=S,e*=S;var n=Math.sin(t),r=Math.cos(t),s=Math.sin(i),o=Math.cos(i),a=Math.sin(e),u=Math.cos(e);return[o*u,r*a+n*s*u,n*a-r*s*u,0,-o*a,r*u-n*s*a,n*u+r*s*a,0,s,-n*o,r*o,0,0,0,0,1]},rotate3d:function(t,i,e,n){n||(n=0),n*=S;var r=Math.sin(n),s=Math.cos(n),o=R.norm(t,i,e);t=o[0],i=o[1],e=o[2];var a=t*t,u=i*i,h=e*e,c=1-s;return[a+(1-a)*s,t*i*c+e*r,t*e*c-i*r,0,t*i*c-e*r,u+(1-u)*s,i*e*c+t*r,0,t*e*c+i*r,i*e*c-t*r,h+(1-h)*s,0,0,0,0,1]},skew:function(t,i){return t||i?(t||(t=0),i||(i=0),t*=S,i*=S,[1,Math.tan(i),0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1]):this.identity()},perspective:function(t){return t=-1/t,[1,0,0,0,0,1,0,0,0,0,1,t,0,0,0,1]},parse:function(t){var i=t.match(/\((.+)\)/)[1].split(/,\s?/);return 6===i.length&&(i.splice(2,0,0,0),i.splice(6,0,0,0),i.splice(8,0,0,0,1,0),i.push(0,1)),i},inverse:function(t){var i=this.identity(),e=t[5]*t[10]-t[6]*t[9],n=t[1]*t[10]-t[2]*t[9],r=t[1]*t[6]-t[2]*t[5],s=t[4]*t[10]-t[6]*t[8],o=t[0]*t[10]-t[2]*t[8],a=t[0]*t[6]-t[2]*t[4],u=t[4]*t[9]-t[5]*t[8],h=t[0]*t[9]-t[1]*t[8],c=t[0]*t[5]-t[1]*t[4],p=1/(t[0]*e-t[1]*s+t[2]*u);return i[0]=p*e,i[1]=-p*n,i[2]=p*r,i[4]=-p*s,i[5]=p*o,i[6]=-p*a,i[8]=p*u,i[9]=-p*h,i[10]=p*c,i[12]=-t[12]*i[0]-t[13]*i[4]-t[14]*i[8],i[13]=-t[12]*i[1]-t[13]*i[5]-t[14]*i[9],i[14]=-t[12]*i[2]-t[13]*i[6]-t[14]*i[10],i},compose:function(t,i,e){t||(t=[]),i||(i=[]),e||(e=[]);var n=this.rotate(i[0],i[1],i[2]);return e.length&&(n[0]*=e[0],n[1]*=e[0],n[2]*=e[0],n[4]*=e[1],n[5]*=e[1],n[6]*=e[1],n[8]*=e[2],n[9]*=e[2],n[10]*=e[2]),t.length&&(n[12]=t[0],n[13]=t[1],n[14]=t[2]),n},decompose:function(t){var i=R.length(t[0],t[1],t[2]),e=R.length(t[4],t[5],t[6]),n=R.length(t[8],t[9],t[10]),r=Math.atan2(-t[9]/n,t[10]/n)/S,s=Math.asin(t[8]/n)/S,o=Math.atan2(-t[4]/e,t[0]/i)/S;(1===t[4]||-1===t[4])&&(r=0,s=t[4]*-Math.PI/2,o=t[4]*Math.atan2(t[6]/e,t[5]/e)/S);var a=t[12],u=t[13],h=t[14];return{translate:[a,u,h],rotate:[r,s,o],scale:[i,e,n]}},transpose:function(t){var i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,t},lookAt:function(t,i,e){var n=R.sub(t,i);n=R.norm(n),0===R.length(n)&&(n[2]=1);var r=R.cross(e,n);0===R.length(r)&&(n[0]+=1e-4,r=R.norm(R.cross(e,n)));var s=R.cross(n,r),o=this.identity();return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[4]=s[0],o[5]=s[1],o[6]=s[2],o[8]=n[0],o[9]=n[1],o[10]=n[2],o},stringify:function(t){for(var i=0;it?n(2*t)/2:1-n(-2*t+2)/2}}),i.css={linear:"cubic-bezier(0.000, 0.000, 1.000, 1.000)","ease-in-quad":"cubic-bezier(0.550, 0.085, 0.680, 0.530)","ease-in-cubic":"cubic-bezier(0.550, 0.055, 0.675, 0.190)","ease-in-quart":"cubic-bezier(0.895, 0.030, 0.685, 0.220)","ease-in-quint":"cubic-bezier(0.755, 0.050, 0.855, 0.060)","ease-in-sine":"cubic-bezier(0.470, 0.000, 0.745, 0.715)","ease-in-expo":"cubic-bezier(0.950, 0.050, 0.795, 0.035)","ease-in-circ":"cubic-bezier(0.600, 0.040, 0.980, 0.335)","ease-in-back":"cubic-bezier(0.600, -0.280, 0.735, 0.045)","ease-out-quad":"cubic-bezier(0.250, 0.460, 0.450, 0.940)","ease-out-cubic":"cubic-bezier(0.215, 0.610, 0.355, 1.000)","ease-out-quart":"cubic-bezier(0.165, 0.840, 0.440, 1.000)","ease-out-quint":"cubic-bezier(0.230, 1.000, 0.320, 1.000)","ease-out-sine":"cubic-bezier(0.390, 0.575, 0.565, 1.000)","ease-out-expo":"cubic-bezier(0.190, 1.000, 0.220, 1.000)","ease-out-circ":"cubic-bezier(0.075, 0.820, 0.165, 1.000)","ease-out-back":"cubic-bezier(0.175, 0.885, 0.320, 1.275)","ease-in-out-quad":"cubic-bezier(0.455, 0.030, 0.515, 0.955)","ease-in-out-cubic":"cubic-bezier(0.645, 0.045, 0.355, 1.000)","ease-in-out-quart":"cubic-bezier(0.770, 0.000, 0.175, 1.000)","ease-in-out-quint":"cubic-bezier(0.860, 0.000, 0.070, 1.000)","ease-in-out-sine":"cubic-bezier(0.445, 0.050, 0.550, 0.950)","ease-in-out-expo":"cubic-bezier(1.000, 0.000, 0.000, 1.000)","ease-in-out-circ":"cubic-bezier(0.785, 0.135, 0.150, 0.860)","ease-in-out-back":"cubic-bezier(0.680, -0.550, 0.265, 1.550)"},i}();r.NUMERIC="NUMERIC",r.COLOR="COLOR",r.propTypes={color:r.COLOR,backgroundColor:r.COLOR,borderColor:r.COLOR},r.px="margin,marginTop,marginLeft,marginBottom,marginRight,padding,paddingTop,paddingLeft,paddingBottom,paddingRight,top,left,bottom,right,width,height,maxWidth,maxHeight,minWidth,minHeight,borderRadius,borderWidth".split(","),r.parseValue=function(t,i){return i===r.COLOR?r.parseColor(t):r.parseNumeric(t)},r.parseNumeric=function(t){return Array.isArray(t)||(t=String(t).split(/\s+/)),Array.isArray(t)?t.map(parseFloat):Number(t)},r.parseColor=function(t){var i=t.match(/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(i)return{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16),a:1};var e=t.match(/^rgba?\(([0-9.]*), ?([0-9.]*), ?([0-9.]*)(?:, ?([0-9.]*))?\)$/);return e?{r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(null!=e[4]?e[4]:1)}:void 0},r.prototype.interpolate=function(t){if(this.type===r.NUMERIC){if(Array.isArray(this.end))return this.array(t);if(void 0!==this.end)return this.absolute(t)}else if(this.type===r.COLOR)return this.color(t)},r.prototype.array=function(t){for(var i=[],e=0;e=this.start&&(e=(t-this.start)/this.duration,e=this.ease(e)),this.transform(e)}},o.prototype.pause=function(){this.diff=q.now()-this.start},o.prototype.resume=function(){this.start=q.now()-this.diff},o.prototype.interpolate=function(t,i){return this.get(t).interpolate(i)},o.prototype.transform=function(t){for(var i in this.state)this.item.set(i,this.interpolate(i,t))},o.prototype.end=function(t,i){!t&&this.transform(this.ease(1)),!i&&(this.start=null)},a.prototype.init=function(t,i){(null===this.start||i)&&(this.start=t+this.delay,this.item.style(C,this.name+" "+this.duration+"ms "+this.ease+" "+this.delay+"ms"+(this._infinite?" infinite":"")+" forwards"))},a.prototype.run=function(){},a.prototype.pause=function(){this.item.style(C+"-play-state","paused"),this.diff=q.now()-this.start},a.prototype.resume=function(){this.item.style(C+"-play-state","running"),this.start=q.now()-this.diff},a.prototype.end=function(){if(this._generated){var t=getComputedStyle(this.item.dom,null),i=t[O];this.item.style(C,""),this.item.state=j.decompose(j.parse(i)),this.item.style()}this.start=null},u.prototype=Object.create(n.prototype),u.prototype.constructor=u,u.prototype.add=function(t,i,e,n,r){function s(t,r){var s=new c(t);return r.forEach(function(t){s.add(t,i,e,n)}),s}function p(t,r){var o=new h(t);return r.forEach(function(r){Array.isArray(r)?o.add(s(t,r)):o.add(r,i,e,n)}),o}return Array.isArray(t)?t=p(this.item,t):"string"==typeof t||void 0!=t.name?t=new a(this.item,t,i,e,n,r):t instanceof u||(t=new o(this.item,t,i,e,n)),this.animations.push(t),i=this.animations.map(function(t){return t.duration+t.delay}),this.duration=this instanceof h?Math.max.apply(null,i):i.reduce(function(t,i){return t+i},0),this},Object.defineProperty(u.prototype,"length",{get:function(){return this.animations.length}}),u.prototype.get=function(t){return this.animations[t]},u.prototype.empty=function(){this.animations=[]},u.prototype.animate=function(t,i,e,n){return this.add(t,i,e,n)},u.prototype.css=function(){return this.item.css()},h.prototype=Object.create(u.prototype),h.prototype.constructor=h,h.prototype.all=function(t){for(var i=Array.prototype.slice.call(arguments,1),e=0;e=c||l.delay+l.durationi;++i){var n=this.items[i];this.changedn;++n)(this.current.position[n]i[n])&&(e?this.previous.position[n]=2*this.current.position[n]-this.previous.position[n]:this.current.position[n]=Math.max(t[n],Math.min(i[n],this.current.position[n])))}function g(t,i){var e=this.current,n=this.previous;e.acceleration=R.scale(e.acceleration,this.mass),e.velocity=R.sub(e.position,n.position),void 0!==i&&(e.velocity=R.scale(e.velocity,i)),n.position=e.position,e.position=R.add(e.position,R.add(e.velocity,R.scale(e.acceleration,t*t))),e.acceleration=R.zero()}function v(t,i,e,n){m.call(this,t),i===Object(i)&&(e=i.viscosity,n=i.edge,i=i.mass),i/=100,i||(i=.01),e||(e=.1),n||(n=!1),this.mass=1/i,this.viscosity=e,this.edge=n,this.current={position:R.zero(),velocity:R.zero(),acceleration:R.zero()},this.previous={position:R.zero(),velocity:R.zero(),acceleration:R.zero()},this.clock=null}var b={};b.world=function(){return new l},b.timeline=function(){return new f},"object"==typeof module&&"object"==typeof module.exports?module.exports=b:"function"==typeof define&&define.amd?define(b):t.animatic=t.a=b;for(var M=t.requestAnimationFrame,z=t.cancelAnimationFrame,w=["moz","webkit","ms"],A=0;A1e12!=q.now()>1e12});var R={set:function(t,i,e){return Array.isArray(t)&&(i=t[1],e=t[2],t=t[0]),void 0===t&&(t=0),void 0===i&&(i=t,e=t),[t,i,e]},length:function(t,i,e){return Array.isArray(t)&&(i=t[1],e=t[2],t=t[0]),Math.sqrt(t*t+i*i+e*e)},add:function(t,i){return[t[0]+i[0],t[1]+i[1],t[2]+i[2]]},sub:function(t,i){return[t[0]-i[0],t[1]-i[1],t[2]-i[2]]},norm:function(t,i,e){Array.isArray(t)&&(i=t[1],e=t[2],t=t[0]);var n=this.length(t,i,e);return 0!==n?(t/=n,i/=n,e/=n):(t=0,i=0,e=0),[t,i,e]},dist:function(t,i){var e=t[0]-i[0],n=t[1]-i[1],r=t[2]-i[2];return Math.sqrt(e*e+n*n+r+r)},cross:function(t,i){var e=t[1]*i[2]-t[2]*i[1],n=t[2]*i[0]-t[0]*i[2],r=t[1]*i[1]-t[1]*i[0];return[e,n,r]},clone:function(t){return t.slice()},scale:function(t,i,e,n){return Array.isArray(t)&&(n=i,i=t[1],e=t[2],t=t[0]),[t*n,i*n,e*n]},zero:function(){return[0,0,0]}},S=Math.PI/180,j={identity:function(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},multiply:function E(t,i){var e=this.identity();return e[0]=t[0]*i[0]+t[1]*i[4]+t[2]*i[8],e[1]=t[0]*i[1]+t[1]*i[5]+t[2]*i[9],e[2]=t[0]*i[2]+t[1]*i[6]+t[2]*i[10],e[4]=t[4]*i[0]+t[5]*i[4]+t[6]*i[8],e[5]=t[4]*i[1]+t[5]*i[5]+t[6]*i[9],e[6]=t[4]*i[2]+t[5]*i[6]+t[6]*i[10],e[8]=t[8]*i[0]+t[9]*i[4]+t[10]*i[8],e[9]=t[8]*i[1]+t[9]*i[5]+t[10]*i[9],e[10]=t[8]*i[2]+t[9]*i[6]+t[10]*i[10],e[12]=t[12]*i[0]+t[13]*i[4]+t[14]*i[8]+i[12],e[13]=t[12]*i[1]+t[13]*i[5]+t[14]*i[9]+i[13],e[14]=t[12]*i[2]+t[13]*i[6]+t[14]*i[10]+i[14],2>=arguments.length?e:E.apply(this,[e].concat(Array.prototype.slice.call(arguments,2)))},translate:function(t,i,e){return t||i||e?(t||(t=0),i||(i=0),e||(e=0),[1,0,0,0,0,1,0,0,0,0,1,0,t,i,e,1]):this.identity()},scale:function(t,i,e){return t||i||e?(t||(t=1),i||(i=1),e||(e=1),[t,0,0,0,0,i,0,0,0,0,e,0,0,0,0,1]):this.identity()},rotate:function(t,i,e){if(!(t||i||e))return this.identity();t||(t=0),i||(i=0),e||(e=0),t*=S,i*=S,e*=S;var n=Math.sin(t),r=Math.cos(t),s=Math.sin(i),o=Math.cos(i),a=Math.sin(e),u=Math.cos(e);return[o*u,r*a+n*s*u,n*a-r*s*u,0,-o*a,r*u-n*s*a,n*u+r*s*a,0,s,-n*o,r*o,0,0,0,0,1]},rotate3d:function(t,i,e,n){n||(n=0),n*=S;var r=Math.sin(n),s=Math.cos(n),o=R.norm(t,i,e);t=o[0],i=o[1],e=o[2];var a=t*t,u=i*i,h=e*e,c=1-s;return[a+(1-a)*s,t*i*c+e*r,t*e*c-i*r,0,t*i*c-e*r,u+(1-u)*s,i*e*c+t*r,0,t*e*c+i*r,i*e*c-t*r,h+(1-h)*s,0,0,0,0,1]},skew:function(t,i){return t||i?(t||(t=0),i||(i=0),t*=S,i*=S,[1,Math.tan(i),0,0,Math.tan(t),1,0,0,0,0,1,0,0,0,0,1]):this.identity()},perspective:function(t){return t=-1/t,[1,0,0,0,0,1,0,0,0,0,1,t,0,0,0,1]},parse:function(t){var i=t.match(/\((.+)\)/)[1].split(/,\s?/);return 6===i.length&&(i.splice(2,0,0,0),i.splice(6,0,0,0),i.splice(8,0,0,0,1,0),i.push(0,1)),i},inverse:function(t){var i=this.identity(),e=t[5]*t[10]-t[6]*t[9],n=t[1]*t[10]-t[2]*t[9],r=t[1]*t[6]-t[2]*t[5],s=t[4]*t[10]-t[6]*t[8],o=t[0]*t[10]-t[2]*t[8],a=t[0]*t[6]-t[2]*t[4],u=t[4]*t[9]-t[5]*t[8],h=t[0]*t[9]-t[1]*t[8],c=t[0]*t[5]-t[1]*t[4],p=1/(t[0]*e-t[1]*s+t[2]*u);return i[0]=p*e,i[1]=-p*n,i[2]=p*r,i[4]=-p*s,i[5]=p*o,i[6]=-p*a,i[8]=p*u,i[9]=-p*h,i[10]=p*c,i[12]=-t[12]*i[0]-t[13]*i[4]-t[14]*i[8],i[13]=-t[12]*i[1]-t[13]*i[5]-t[14]*i[9],i[14]=-t[12]*i[2]-t[13]*i[6]-t[14]*i[10],i},compose:function(t,i,e){t||(t=[]),i||(i=[]),e||(e=[]);var n=this.rotate(i[0],i[1],i[2]);return e.length&&(n[0]*=e[0],n[1]*=e[0],n[2]*=e[0],n[4]*=e[1],n[5]*=e[1],n[6]*=e[1],n[8]*=e[2],n[9]*=e[2],n[10]*=e[2]),t.length&&(n[12]=t[0],n[13]=t[1],n[14]=t[2]),n},decompose:function(t){var i=R.length(t[0],t[1],t[2]),e=R.length(t[4],t[5],t[6]),n=R.length(t[8],t[9],t[10]),r=Math.atan2(-t[9]/n,t[10]/n)/S,s=Math.asin(t[8]/n)/S,o=Math.atan2(-t[4]/e,t[0]/i)/S;(1===t[4]||-1===t[4])&&(r=0,s=t[4]*-Math.PI/2,o=t[4]*Math.atan2(t[6]/e,t[5]/e)/S);var a=t[12],u=t[13],h=t[14];return{translate:[a,u,h],rotate:[r,s,o],scale:[i,e,n]}},transpose:function(t){var i;return i=t[1],t[1]=t[4],t[4]=i,i=t[2],t[2]=t[8],t[8]=i,i=t[6],t[6]=t[9],t[9]=i,i=t[3],t[3]=t[12],t[12]=i,i=t[7],t[7]=t[13],t[13]=i,i=t[11],t[11]=t[14],t[14]=i,t},lookAt:function(t,i,e){var n=R.sub(t,i);n=R.norm(n),0===R.length(n)&&(n[2]=1);var r=R.cross(e,n);0===R.length(r)&&(n[0]+=1e-4,r=R.norm(R.cross(e,n)));var s=R.cross(n,r),o=this.identity();return o[0]=r[0],o[1]=r[1],o[2]=r[2],o[4]=s[0],o[5]=s[1],o[6]=s[2],o[8]=n[0],o[9]=n[1],o[10]=n[2],o},stringify:function(t){for(var i=0;it?n(2*t)/2:1-n(-2*t+2)/2}}),i.css={linear:"cubic-bezier(0.000, 0.000, 1.000, 1.000)","ease-in-quad":"cubic-bezier(0.550, 0.085, 0.680, 0.530)","ease-in-cubic":"cubic-bezier(0.550, 0.055, 0.675, 0.190)","ease-in-quart":"cubic-bezier(0.895, 0.030, 0.685, 0.220)","ease-in-quint":"cubic-bezier(0.755, 0.050, 0.855, 0.060)","ease-in-sine":"cubic-bezier(0.470, 0.000, 0.745, 0.715)","ease-in-expo":"cubic-bezier(0.950, 0.050, 0.795, 0.035)","ease-in-circ":"cubic-bezier(0.600, 0.040, 0.980, 0.335)","ease-in-back":"cubic-bezier(0.600, -0.280, 0.735, 0.045)","ease-out-quad":"cubic-bezier(0.250, 0.460, 0.450, 0.940)","ease-out-cubic":"cubic-bezier(0.215, 0.610, 0.355, 1.000)","ease-out-quart":"cubic-bezier(0.165, 0.840, 0.440, 1.000)","ease-out-quint":"cubic-bezier(0.230, 1.000, 0.320, 1.000)","ease-out-sine":"cubic-bezier(0.390, 0.575, 0.565, 1.000)","ease-out-expo":"cubic-bezier(0.190, 1.000, 0.220, 1.000)","ease-out-circ":"cubic-bezier(0.075, 0.820, 0.165, 1.000)","ease-out-back":"cubic-bezier(0.175, 0.885, 0.320, 1.275)","ease-in-out-quad":"cubic-bezier(0.455, 0.030, 0.515, 0.955)","ease-in-out-cubic":"cubic-bezier(0.645, 0.045, 0.355, 1.000)","ease-in-out-quart":"cubic-bezier(0.770, 0.000, 0.175, 1.000)","ease-in-out-quint":"cubic-bezier(0.860, 0.000, 0.070, 1.000)","ease-in-out-sine":"cubic-bezier(0.445, 0.050, 0.550, 0.950)","ease-in-out-expo":"cubic-bezier(1.000, 0.000, 0.000, 1.000)","ease-in-out-circ":"cubic-bezier(0.785, 0.135, 0.150, 0.860)","ease-in-out-back":"cubic-bezier(0.680, -0.550, 0.265, 1.550)"},i}();r.NUMERIC="NUMERIC",r.COLOR="COLOR",r.propTypes={color:r.COLOR,backgroundColor:r.COLOR,borderColor:r.COLOR},r.px="margin,marginTop,marginLeft,marginBottom,marginRight,padding,paddingTop,paddingLeft,paddingBottom,paddingRight,top,left,bottom,right,width,height,maxWidth,maxHeight,minWidth,minHeight,borderRadius,borderWidth".split(","),r.parseValue=function(t,i){return i===r.COLOR?r.parseColor(t):r.parseNumeric(t)},r.parseNumeric=function(t){return Array.isArray(t)||(t=String(t).split(/\s+/)),Array.isArray(t)?t.map(parseFloat):Number(t)},r.parseColor=function(t){var i=t.match(/^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);if(i)return{r:parseInt(i[1],16),g:parseInt(i[2],16),b:parseInt(i[3],16),a:1};var e=t.match(/^rgba?\(([0-9.]*), ?([0-9.]*), ?([0-9.]*)(?:, ?([0-9.]*))?\)$/);return e?{r:parseFloat(e[1]),g:parseFloat(e[2]),b:parseFloat(e[3]),a:parseFloat(null!=e[4]?e[4]:1)}:void 0},r.prototype.interpolate=function(t){if(this.type===r.NUMERIC){if(Array.isArray(this.end))return this.array(t);if(void 0!==this.end)return this.absolute(t)}else if(this.type===r.COLOR)return this.color(t)},r.prototype.array=function(t){for(var i=[],e=0;e=this.start&&(e=(t-this.start)/this.duration,e=this.ease(e)),this.transform(e)}},o.prototype.pause=function(){this.diff=q.now()-this.start},o.prototype.resume=function(){this.start=q.now()-this.diff},o.prototype.interpolate=function(t,i){return this.get(t).interpolate(i)},o.prototype.transform=function(t){for(var i in this.state)this.item.set(i,this.interpolate(i,t))},o.prototype.end=function(t,i){!t&&this.transform(this.ease(1)),!i&&(this.start=null)},a.prototype.init=function(t,i){(null===this.start||i)&&(this.start=t+this.delay,this.item.style(C,this.name+" "+this.duration+"ms "+this.ease+" "+this.delay+"ms"+(this._infinite?" infinite":"")+" forwards"))},a.prototype.run=function(){},a.prototype.pause=function(){this.item.style(C+"-play-state","paused"),this.diff=q.now()-this.start},a.prototype.resume=function(){this.item.style(C+"-play-state","running"),this.start=q.now()-this.diff},a.prototype.end=function(){if(this._generated){var t=getComputedStyle(this.item.dom,null),i=t[O];this.item.style(C,""),this.item.state=j.decompose(j.parse(i)),this.item.style()}this.start=null},u.prototype=Object.create(n.prototype),u.prototype.constructor=u,u.prototype.add=function(t,i,e,n,r){function s(t,r){var s=new c(t);return r.forEach(function(t){s.add(t,i,e,n)}),s}function p(t,r){var o=new h(t);return r.forEach(function(r){Array.isArray(r)?o.add(s(t,r)):o.add(r,i,e,n)}),o}return Array.isArray(t)?t=p(this.item,t):"string"==typeof t||void 0!=t.name?t=new a(this.item,t,i,e,n,r):t instanceof u||(t=new o(this.item,t,i,e,n)),this.animations.push(t),i=this.animations.map(function(t){return t.duration+t.delay}),this.duration=this instanceof h?Math.max.apply(null,i):i.reduce(function(t,i){return t+i},0),this},Object.defineProperty(u.prototype,"length",{get:function(){return this.animations.length}}),u.prototype.get=function(t){return this.animations[t]},u.prototype.empty=function(){this.animations=[]},u.prototype.animate=function(t,i,e,n){return this.add(t,i,e,n)},u.prototype.css=function(){return this.item.css()},h.prototype=Object.create(u.prototype),h.prototype.constructor=h,h.prototype.all=function(t){for(var i=Array.prototype.slice.call(arguments,1),e=0;e=c||l.delay+l.durationi;++i){var n=this.items[i];this.changed
- + + + + + + + + + + + + + + + + + +