Skip to content
Browse files

Builds v.0.9.9.

  • Loading branch information...
1 parent a0459e1 commit c39ceafbae3ba26e9c9efefd4d845e62cd717db6 @jeremyckahn committed
Showing with 96 additions and 15 deletions.
  1. +3 −3 dist/rekapi.bundle.min.js
  2. +90 −9 dist/rekapi.js
  3. +2 −2 dist/rekapi.min.js
  4. +1 −1 version.txt
View
6 dist/rekapi.bundle.min.js
@@ -1,6 +1,6 @@
/*jslint browser: true, nomen: true, plusplus: true, undef: true, vars: true, white: true */
/**
- * Rekapi - Rewritten Kapi. v0.9.8 (Thu, 21 Jun 2012 03:38:37 GMT)
+ * Rekapi - Rewritten Kapi. v0.9.9 (Fri, 22 Jun 2012 02:21:16 GMT)
* https://github.com/jeremyckahn/rekapi
*
* By Jeremy Kahn (jeremyckahn@gmail.com), with significant contributions from
@@ -51,7 +51,7 @@ this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a
*/
(function(){var a;(function(b){function f(a,b){var c;for(c in a)a.hasOwnProperty(c)&&b(a,c)}function g(a,b){return f(b,function(b,c){a[c]=b[c]}),a}function h(a,b){return f(b,function(b,c){typeof a[c]=="undefined"&&(a[c]=b[c])}),a}function i(a,b,c){var d,f;f=(a-b.timestamp)/b.duration;for(d in c.current)c.current.hasOwnProperty(d)&&b.to.hasOwnProperty(d)&&(c.current[d]=j(b.originalState[d],b.to[d],e[b.easing[d]],f));return c.current}function j(a,b,c,d){return a+(b-a)*c(d)}function k(a,b){return setTimeout(a,1e3/b)}function l(a,b,c,d){var e;for(e=0;e<b[a].length;e++)b[a][e].apply(c,d)}function m(b,c,d){f(a.prototype.filter,function(a,e){a[e][b]&&a[e][b].apply(c,d)})}function n(a,b){var d=a.timestamp+a.duration,e=Math.min(c(),d),f=e>=d;b.isTweening&&(f||(b.loopId=k(function(){n(a,b)},a.owner.fps)),m("beforeTween",a.owner,[b.current,a.originalState,a.to,a.easing]),i(e,a,b),m("afterTween",a.owner,[b.current,a.originalState,a.to,a.easing]),a.hook.step&&l("step",a.hook,a.owner,[b.current]),a.step&&a.step.call(b.current,b.current)),(f||!b.isTweening)&&a.owner.stop(!0)}function o(a,b){var c;return c={},typeof b=="string"?f(a,function(a,d){c[d]=b}):f(a,function(a,e){c[e]||(c[e]=b[e]||d)}),c}var c,d="linear",e;typeof SHIFTY_DEBUG_NOW=="function"?c=SHIFTY_DEBUG_NOW:c=function(){return+(new Date)},typeof SHIFTY_DEBUG_NOW=="function"&&(b.timeoutHandler=n),a=function(a){return a=a||{},this._hook={},this._tweenParams={owner:this,hook:this._hook,data:{}},this._state={},this._state.current=a.initialState||{},this.fps=a.fps||30,this.easing=a.easing||d,this.duration=a.duration||500,this},a.prototype.tween=function(a,b,d,e,f){var i,j,k;if(this._state.isTweening)return;return i=this,j=this._tweenParams,k=this._state,this._state.loopId=0,this._state.pausedAtTime=null,b?(j.to=b||{},j.duration=d||this.duration,j.callback=e,j.easing=f||this.easing,k.current=a||{}):(j.step=a.step,j.callback=a.callback,j.to=a.to||a.target||{},j.duration=a.duration||this.duration,j.easing=a.easing||this.easing,k.current=a.from||{}),j.timestamp=c(),h(k.current,j.to),h(j.to,k.current),j.easing=o(k.current,j.easing),j.originalState=g({},k.current),m("tweenCreated",j.owner,[k.current,j.originalState,j.to,j.easing]),k.isTweening=!0,this.resume(),a.start&&a.start(),this},a.prototype.to=function(b,c,d,e){return arguments.length===1?"to"in b?(b.from=this.get(),this.tween(b)):this.tween(this.get(),b):this.tween(this.get(),b,c,d,e),this},a.prototype.get=function(){return this._state.current},a.prototype.set=function(a){return this._state.current=a||{},this},a.prototype.stop=function(a){return clearTimeout(this._state.loopId),this._state.isTweening=!1,a&&(g(this._state.current,this._tweenParams.to),m("afterTweenEnd",this,[this._state.current,this._tweenParams.originalState,this._tweenParams.to,this._tweenParams.easing]),this._tweenParams.callback&&this._tweenParams.callback.call(this._state.current,this._state.current)),this},a.prototype.pause=function(){return clearTimeout(this._state.loopId),this._state.pausedAtTime=c(),this._state.isPaused=!0,this},a.prototype.resume=function(){var a;return a=this,this._state.isPaused&&(this._tweenParams.timestamp+=c()-this._state.pausedAtTime),n(a._tweenParams,a._state),this},a.prototype.hookAdd=function(a,b){this._hook.hasOwnProperty(a)||(this._hook[a]=[]),this._hook[a].push(b)},a.prototype.hookRemove=function(a,b){var c;if(!this._hook.hasOwnProperty(a))return;if(!b){this._hook[a]=[];return}for(c=this._hook[a].length;c>=0;c++)this._hook[a][c]===b&&this._hook[a].splice(c,1)},a.prototype.filter={},a.util={now:c,each:f,tweenProps:i,tweenProp:j,applyFilter:m,simpleCopy:g,weakCopy:h,composeEasingObject:o},e=a.prototype.formula={linear:function(a){return a}},typeof exports=="object"?module.exports=a:typeof define=="function"&&define.amd?define(function(){return a}):typeof b.Tweenable=="undefined"&&(b.Tweenable=a)})(this),function(){a.util.simpleCopy(a.prototype.formula,{easeInQuad:function(a){return Math.pow(a,2)},easeOutQuad:function(a){return-(Math.pow(a-1,2)-1)},easeInOutQuad:function(a){return(a/=.5)<1?.5*Math.pow(a,2):-0.5*((a-=2)*a-2)},easeInCubic:function(a){return Math.pow(a,3)},easeOutCubic:function(a){return Math.pow(a-1,3)+1},easeInOutCubic:function(a){return(a/=.5)<1?.5*Math.pow(a,3):.5*(Math.pow(a-2,3)+2)},easeInQuart:function(a){return Math.pow(a,4)},easeOutQuart:function(a){return-(Math.pow(a-1,4)-1)},easeInOutQuart:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-0.5*((a-=2)*Math.pow(a,3)-2)},easeInQuint:function(a){return Math.pow(a,5)},easeOutQuint:function(a){return Math.pow(a-1,5)+1},easeInOutQuint:function(a){return(a/=.5)<1?.5*Math.pow(a,5):.5*(Math.pow(a-2,5)+2)},easeInSine:function(a){return-Math.cos(a*(Math.PI/2))+1},easeOutSine:function(a){return Math.sin(a*(Math.PI/2))},easeInOutSine:function(a){return-0.5*(Math.cos(Math.PI*a)-1)},easeInExpo:function(a){return a==0?0:Math.pow(2,10*(a-1))},easeOutExpo:function(a){return a==1?1:-Math.pow(2,-10*a)+1},easeInOutExpo:function(a){return a==0?0:a==1?1:(a/=.5)<1?.5*Math.pow(2,10*(a-1)):.5*(-Math.pow(2,-10*--a)+2)},easeInCirc:function(a){return-(Math.sqrt(1-a*a)-1)},easeOutCirc:function(a){return Math.sqrt(1-Math.pow(a-1,2))},easeInOutCirc:function(a){return(a/=.5)<1?-0.5*(Math.sqrt(1-a*a)-1):.5*(Math.sqrt(1-(a-=2)*a)+1)},easeOutBounce:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},easeInBack:function(a){var b=1.70158;return a*a*((b+1)*a-b)},easeOutBack:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},easeInOutBack:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},elastic:function(a){return-1*Math.pow(4,-8*a)*Math.sin((a*6-1)*2*Math.PI/2)+1},swingFromTo:function(a){var b=1.70158;return(a/=.5)<1?.5*a*a*(((b*=1.525)+1)*a-b):.5*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)},swingFrom:function(a){var b=1.70158;return a*a*((b+1)*a-b)},swingTo:function(a){var b=1.70158;return(a-=1)*a*((b+1)*a+b)+1},bounce:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375},bouncePast:function(a){return a<1/2.75?7.5625*a*a:a<2/2.75?2-(7.5625*(a-=1.5/2.75)*a+.75):a<2.5/2.75?2-(7.5625*(a-=2.25/2.75)*a+.9375):2-(7.5625*(a-=2.625/2.75)*a+.984375)},easeFromTo:function(a){return(a/=.5)<1?.5*Math.pow(a,4):-0.5*((a-=2)*Math.pow(a,3)-2)},easeFrom:function(a){return Math.pow(a,4)},easeTo:function(a){return Math.pow(a,.25)}})}(),function(){function b(b,c,d,e,f){return a.util.tweenProps(e,{originalState:b,to:d,timestamp:0,duration:1,easing:f},{current:c})}function c(b,c){var d=c;return typeof c=="string"&&(d={},a.util.each(b,function(a,b){d[b]=a[b]})),d}a.util.interpolate=function(c,d,e,f){var g,h,i;c&&c.from&&(d=c.to,e=c.position,f=c.easing,c=c.from),i=new a,i._tweenParams.easing=f||"linear",g=a.util.simpleCopy({},c);var j=a.util.composeEasingObject(c,i._tweenParams.easing);return a.util.applyFilter("tweenCreated",i,[g,c,d,j]),a.util.applyFilter("beforeTween",i,[g,c,d,j]),h=b(c,g,d,e,j),a.util.applyFilter("afterTween",i,[h,c,d,j]),h},a.prototype.interpolate=function(b,c,d){var e;return e=a.util.interpolate(this.get(),b,c,d),this.set(e),e}}(),function(a){function i(a,b){var c=a.length,d,e=[];for(d=0;d<c;d++)e.push("_"+b+"_"+d);return e}function j(a){var b=a.match(c);return b.length===1&&b.unshift(""),b.join(h)}function k(b){a.util.each(b,function(a,c){var d=a[c];typeof d=="string"&&d.match(g)&&(b[c]=l(d))})}function l(a){return p(g,a,m)}function m(a){var b=n(a);return"rgb("+b[0]+","+b[1]+","+b[2]+")"}function n(a){return a=a.replace(/#/,""),a.length===3&&(a=a.split(""),a=a[0]+a[0]+a[1]+a[1]+a[2]+a[2]),[o(a.substr(0,2)),o(a.substr(2,2)),o(a.substr(4,2))]}function o(a){return parseInt(a,16)}function p(a,b,c){var d=b.match(a),e=b.replace(a,h);if(d){var f=d.length,g;for(var i=0;i<f;i++)g=d.shift(),e=e.replace(h,c(g))}return e}function q(a){return p(e,a,r)}function r(a){var b=a.match(d),c=b.length,e=a.match(f)[0];for(var g=0;g<c;g++)e+=parseInt(b[g],10)+",";return e=e.slice(0,-1)+")",e}function s(b){var c={};return a.util.each(b,function(a,b){var d=a[b];if(typeof d=="string"){var e=y(d);c[b]={formatString:j(d),chunkNames:i(e,b)}}}),c}function t(b,c){a.util.each(c,function(a,d){var e=b[d],f=y(e),g=f.length;for(var h=0;h<g;h++)b[c[d].chunkNames[h]]=+f[h];delete b[d]})}function u(b,c){a.util.each(c,function(a,d){var e=b[d],f=v(b,c[d].chunkNames),g=w(f,c[d].chunkNames);e=x(c[d].formatString,g),b[d]=q(e)})}function v(a,b){var c={},d,e=b.length;for(var f=0;f<e;f++)d=b[f],c[d]=a[d],delete a[d];return c}function w(a,b){var c=[],d=b.length;for(var e=0;e<d;e++)c.push(a[b[e]]);return c}function x(a,b){var c=a,d=b.length;for(var e=0;e<d;e++)c=c.replace(h,+b[e].toFixed(4));return c}function y(a){return a.match(d)}function z(b,c){a.util.each(c,function(a,c){var d=a[c],e=d.chunkNames,f=e.length,g=b[c].split(" "),h=g[g.length-1];for(var i=0;i<f;i++)b[e[i]]=g[i]||h;delete b[c]})}function A(b,c){a.util.each(c,function(a,c){var d=a[c],e=d.chunkNames,f=e.length,g="";for(var h=0;h<f;h++)g+=" "+b[e[h]],delete b[e[h]];g=g.substr(1),b[c]=g})}var b,c=/([^-0-9\.]+)/g,d=/[0-9.-]+/g,e=new RegExp("rgb\\("+d.source+",s*"+d.source+",s*"+d.source+"\\)","g"),f=/^.*\(/,g=/#([0-9]|[a-f]){3,6}/g,h="VAL";a.prototype.filter.token={tweenCreated:function(a,b,c,d){k(a),k(b),k(c),this._tokenData=s(a)},beforeTween:function(a,b,c,d){z(d,this._tokenData),t(a,this._tokenData),t(b,this._tokenData),t(c,this._tokenData)},afterTween:function(a,b,c,d){u(a,this._tokenData),u(b,this._tokenData),u(c,this._tokenData),A(d,this._tokenData)}}}(a)})();/*jslint browser: true, nomen: true, plusplus: true, undef: true, vars: true, white: true */
/**
- * Rekapi - Rewritten Kapi. v0.9.8 (Thu, 21 Jun 2012 03:38:37 GMT)
+ * Rekapi - Rewritten Kapi. v0.9.9 (Fri, 22 Jun 2012 02:21:16 GMT)
* https://github.com/jeremyckahn/rekapi
*
* By Jeremy Kahn (jeremyckahn@gmail.com), with significant contributions from
@@ -62,4 +62,4 @@ this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a
* Shifty.js (https://github.com/jeremyckahn/shifty).
* MIT Lincense. This code free to use, modify, distribute and enjoy.
*/
-(function(a){function b(a,b,c,d){c.each(a._events[b],function(b){b(a,d)})}function c(a){var b=[];_.each(a._actors,function(a){b.push(a.getEnd())}),a._animationLength=Math.max.apply(Math,b)}function d(){}var e=function(a,d,e){function h(a,b){var c=Math.floor(b/a._animationLength);return c}function i(a){return s()-a._loopTimestamp}function j(a,b){return b>=a._timesToIterate&&a._timesToIterate!==-1}function k(a,c){j(a,c)&&(a.stop(),b(a,"animationComplete",d))}function l(a,b,c){var d;return j(a,c)?d=a._animationLength:d=b%a._animationLength,d}function m(a,b){var c=h(a,b),d=l(a,b,c);a.update(d),k(a,c)}function n(a){m(a,i(a))}function o(a){var b=function(){o(a),n(a)};a._scheduleUpdate.call?a._loopId=a._scheduleUpdate.call(g,b,1e3/a.config.fps):a._loopId=setTimeout(b,1e3/a.config.fps)}function p(a){var b;return a!==60?b=g.setTimeout:b=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||g.mozCancelRequestAnimationFrame&&g.mozRequestAnimationFrame||g.setTimeout,b}function q(a){var b;return a!==60?b=g.clearTimeout:b=g.cancelAnimationFrame||g.webkitCancelAnimationFrame||g.oCancelAnimationFrame||g.msCancelAnimationFrame||g.mozCancelRequestAnimationFrame||g.clearTimeout,b}function r(a){a._cancelUpdate.call?a._cancelUpdate.call(g,a._loopId):clearTimeout(a._loopId)}"use strict";var f=Function,g=f("return this")(),s=e.util.now,t={fps:60},u={STOPPED:"stopped",PAUSED:"paused",PLAYING:"playing"},v=a.Kapi||function(b){return this.config=b||{},this.context=this.config.context||{},this._actors={},this._playState=u.STOPPED,this._events={animationComplete:[],playStateChange:[],play:[],pause:[],stop:[],beforeUpdate:[],afterUpdate:[],addActor:[],removeActor:[]},this._timesToIterate=-1,this._animationLength=0,this._loopId=null,this._loopTimestamp=null,this._pausedAtTime=null,this._lastUpdatedMillisecond=0,d.extend(this.config,b),d.defaults(this.config,t),this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps),d.each(this._contextInitHook,function(a){a.call(this)},this),this};v.prototype._contextInitHook={},v.prototype.addActor=function(a){return d.contains(this._actors,a)||(a.context()||a.context(this.context),a.kapi=this,a.fps=this.framerate(),this._actors[a.id]=a,c(this),a.setup(),b(this,"addActor",d,a)),this},v.prototype.getActor=function(a){return this._actors[a]},v.prototype.getActorIds=function(){return d.pluck(this._actors,"id")},v.prototype.getAllActors=function(){return d.clone(this._actors)},v.prototype.removeActor=function(a){return delete this._actors[a.id],delete a.kapi,a.teardown(),c(this),b(this,"removeActor",d,a),this},v.prototype.play=function(a){return r(this),this._playState===u.PAUSED?this._loopTimestamp+=s()-this._pausedAtTime:this._loopTimestamp=s(),this._timesToIterate=a||-1,this._playState=u.PLAYING,o(this),d.each(this._actors,function(a){a._state.isPaused&&a.resume()}),b(this,"playStateChange",d),b(this,"play",d),this},v.prototype.playFrom=function(a,b){return this.play(b),this._loopTimestamp=s()-a,this},v.prototype.playFromCurrent=function(a){return this.playFrom(this._lastUpdatedMillisecond,a)},v.prototype.pause=function(){return this._playState===u.PAUSED?this:(this._playState=u.PAUSED,r(this),this._pausedAtTime=s(),d.each(this._actors,function(a){a._state.isTweening&&a.pause()}),b(this,"playStateChange",d),b(this,"pause",d),this)},v.prototype.stop=function(){return this._playState=u.STOPPED,r(this),d.each(this._actors,function(a){a.stop()}),b(this,"playStateChange",d),b(this,"stop",d),this},v.prototype.isPlaying=function(){return this._playState===u.PLAYING},v.prototype.animationLength=function(){return this._animationLength},v.prototype.lastPositionUpdated=function(){return this._lastUpdatedMillisecond/this._animationLength},v.prototype.actorCount=function(){return d.size(this._actors)},v.prototype.framerate=function(a){return a&&(this.config.fps=a,this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps)),this.config.fps},v.prototype.update=function(a){return b(this,"beforeUpdate",d),d.each(this._actors,function(b){b.updateState(a),typeof b.update=="function"&&b.update(b.context(),b.get())}),this._lastUpdatedMillisecond=a,b(this,"afterUpdate",d),this},v.prototype.on=function(a,b){if(!this._events[a])return;return this._events[a].push(b),this},v.prototype.off=function(a,b){if(!this._events[a])return;return b?this._events[a]=d.without(this._events[a],b):this._events[a]=[],this},v.prototype.exportTimeline=function(){var a={duration:this._animationLength,actors:{}};return d.each(this._actors,function(b){a.actors[b.id]=b.exportTimeline()},this),a},v.util={},typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(v._private={calculateLoopPosition:l,updateToCurrentMillisecond:n,tick:o,determineCurrentLoopIteration:h,calculateTimeSinceStart:i,isAnimationComplete:j,updatePlayState:k}),a.Kapi=v},f=function(a,b,e){function h(a){return a.sort(function(a,b){return a-b})}function i(a,b){var c=a._timelinePropertyCacheIndex,d=c.length,e;for(e=1;e<d;e++)if(c[e]>=b)return e-1;return-1}function j(a){b.each(a._propertyTracks,function(c,d){a._propertyTracks[d]=b.sortBy(a._propertyTracks[d],function(a){return a.millisecond})})}function k(a){b.each(a._timelinePropertyCaches,function(c,d){var e=l(a,+d);b.defaults(c,e)})}function l(a,c){var d={};return b.each(a._propertyTracks,function(a,e){var f=null;b.find(a,function(a){return a.millisecond>c?d[e]=f:a.millisecond===c&&(d[e]=a),f=a,!!d[e]});if(!d[e]){var g=b.last(a);g&&g.millisecond<=c&&(d[e]=g)}}),d}function m(a){b.each(a._propertyTracks,function(a,c){b.each(a,function(b,c){b.linkToNext(a[c+1])})})}function n(a,c,d){return b.find(a._propertyTracks[c],function(a){return a.millisecond===d})}function o(a){a._timelinePropertyCaches={},b.each(a._keyframeProperties,function(b){a._timelinePropertyCaches[b.millisecond]||(a._timelinePropertyCaches[b.millisecond]={}),a._timelinePropertyCaches[b.millisecond][b.name]=b},a),a._timelinePropertyCacheIndex=b.keys(a._timelinePropertyCaches),b.each(a._timelinePropertyCacheIndex,function(b,c){a._timelinePropertyCacheIndex[c]=+b},a),h(a._timelinePropertyCacheIndex),k(a),m(a)}"use strict";var f="linear",g=a.Kapi,p=g.Actor=function(a){return a=a||{},e.call(this),b.extend(this,{_data:{},_propertyTracks:{},_timelinePropertyCaches:{},_timelinePropertyCacheIndex:[],_keyframeProperties:{},id:b.uniqueId(),setup:a.setup||d,update:a.update||d,teardown:a.teardown||d}),a.context&&this.context(a.context),this},q=function(){};q.prototype=e.prototype,p.prototype=new q,p.prototype.context=function(a){return a&&(this._context=a),this._context},p.prototype.keyframe=function(d,e,h){var i;return h=h||f,typeof h=="string"&&(i=h,h={},b.each(e,function(a,b){h[b]=i})),b.each(e,function(a,b){h[b]=h[b]||f}),b.each(e,function(a,b){var c=new g.KeyframeProperty(this,d,b,a,h[b]);this._keyframeProperties[c.id]=c,this._propertyTracks[b]||(this._propertyTracks[b]=[]),this._propertyTracks[b].push(c),j(this)},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.getKeyframeProperty=function(a,b){if(this._propertyTracks[a]&&this._propertyTracks[a][b])return this._propertyTracks[a][b]},p.prototype.modifyKeyframeProperty=function(a,b,d){return this._propertyTracks[a]&&this._propertyTracks[a][b]&&this._propertyTracks[a][b].modifyWith(d),j(this),o(this),c(this.kapi),this},p.prototype.getTrackNames=function(){return b.keys(this._propertyTracks)},p.prototype.getTrackLength=function(a){if(!this._propertyTracks[a])return;return this._propertyTracks[a].length},p.prototype.copyProperties=function(a,c){var d={},e={};return b.each(this._propertyTracks,function(a,b){var f=n(this,b,c);f&&(d[b]=f.value,e[b]=f.easing)},this),this.keyframe(a,d,e),this},p.prototype.wait=function(a){var c=this.getEnd();if(a<=c)return this;var d=this.getEnd(),e=l(this,this.getEnd()),f={},g={};return b.each(e,function(a,b){f[b]=a.value,g[b]=a.easing}),this.removeKeyframe(d),this.keyframe(d,f,g),this.keyframe(a,f,g),this},p.prototype.getStart=function(){var a=[];return b.each(this._propertyTracks,function(b){b.length&&a.push(b[0].millisecond)}),a.length===0&&(a=[0]),Math.min.apply(Math,a)},p.prototype.getEnd=function(){var a=0;return b.each(this._propertyTracks,function(c){if(c.length){var d=b.last(c).millisecond;d>a&&(a=d)}},this),a},p.prototype.getLength=function(){return this.getEnd()-this.getStart()},p.prototype.hasKeyframeAt=function(a,c){var d=this._propertyTracks;if(c){if(!b.has(d,c))return!1;d=b.pick(d,c)}return b.find(d,function(b,c){return n(this,c,a)!==undefined},this)!==undefined},p.prototype.modifyKeyframe=function(a,c,d){return d=d||{},b.each(this._propertyTracks,function(b,e){var f=n(this,e,a);f&&f.modifyWith({value:c[e],easing:d[e]})},this),this},p.prototype.removeKeyframe=function(a){return b.each(this._propertyTracks,function(c,d){var e=-1,f=!1;b.find(c,function(b){return e++,f=a===b.millisecond,f});if(f){var g=c.splice(e,1)[0];g&&delete this._keyframeProperties[g.id]}},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.removeAllKeyframeProperties=function(){return b.each(this._propertyTracks,function(a,b){a.length=0},this),this._keyframeProperties={},this.removeKeyframe(0)},p.prototype.updateState=function(a){var c=this.getStart(),d=this.getEnd();if(c<=a&&a<=d){var e=i(this,a),f=this._timelinePropertyCaches[this._timelinePropertyCacheIndex[e]],g={};b.each(f,function(b,c){b&&(g[c]=b.getValueAt(a))}),this.set(g)}return this},p.prototype.data=function(a){return a&&(this._data=a),this._data},p.prototype.exportTimeline=function(){var a={start:this.getStart(),end:this.getEnd(),trackNames:this.getTrackNames(),propertyTracks:{}};return b.each(this._propertyTracks,function(c,d){var e=a.propertyTracks[d]=[];b.each(c,function(a){e.push(a.exportPropertyData())})}),a}},g=function(a,b,c){"use strict";var d="linear",e=a.Kapi,f=e.KeyframeProperty=function(a,c,e,f,g){return this.id=b.uniqueId("keyframeProperty_"),this.ownerActor=a,this.millisecond=c,this.name=e,this.value=f,this.easing=g||d,this.nextProperty=null,this};f.prototype.modifyWith=function(a){var c={};b.each(["millisecond","easing","value"],function(b){c[b]=typeof a[b]=="undefined"?this[b]:a[b]},this),b.extend(this,c)},f.prototype.linkToNext=function(a){this.nextProperty=a||null},f.prototype.getValueAt=function(a){var b={},d={},e;if(this.nextProperty){b[this.name]=this.value,d[this.name]=this.nextProperty.value;var f=this.nextProperty.millisecond-this.millisecond,g=(a-this.millisecond)/f;e=c.util.interpolate(b,d,g,this.nextProperty.easing)[this.name]}else e=this.value;return e},f.prototype.exportPropertyData=function(){return{id:this.id,millisecond:this.millisecond,name:this.name,value:this.value,easing:this.easing}}},h=function(a,c){function e(a,b,c){return typeof c!="undefined"&&(a[b]=c,a.style[b]=c+"px"),a[b]}function f(a){a.config.clearOnUpdate&&a.canvasClear()}function g(a){b(a,"beforeDraw",c);var d=a._drawOrder.length,e;if(a._drawOrderSorter){var f=c.sortBy(a._canvasActors,a._drawOrderSorter);e=c.pluck(f,"id")}else e=a._drawOrder;var g,h,i;for(i=0;i<d;i++)g=a._canvasActors[e[i]],h=g.context(),g.draw(h,g.get());return b(a,"afterDraw",c),a}function h(a,b){b instanceof d.CanvasActor&&(a._drawOrder.push(b.id),a._canvasActors[b.id]=b)}function i(a,b){b instanceof d.CanvasActor&&(a._drawOrder=c.without(a._drawOrder,b.id),delete a._canvasActors[b.id])}"use strict";var d=a.Kapi;d.prototype._contextInitHook.canvas=function(){this._drawOrder=[],this._drawOrderSorter=null,this._canvasActors={},this.config.clearOnUpdate=!0,c.extend(this._events,{beforeDraw:[],afterDraw:[]}),c.each(["Height","Width"],function(a){var b=a.toLowerCase();this.config[b]&&(this["canvas"+a](this.config[b]),delete this.config[a])},this),this.on("afterUpdate",g),this.on("addActor",h),this.on("removeActor",i),this.on("beforeDraw",f)},d.prototype.canvasHeight=function(a){return e(this.context,"height",a)},d.prototype.canvasWidth=function(a){return e(this.context,"width",a)},d.prototype.canvasClear=function(){return this.context.getContext&&this.canvasContext().clearRect(0,0,this.canvasWidth(),this.canvasHeight()),this},d.prototype.canvasContext=function(){return this.context.getContext("2d")},d.prototype.redraw=function(){return g(this),this},d.prototype.moveActorToLayer=function(a,b){if(b<this._drawOrder.length)return this._drawOrder=c.without(this._drawOrder,a.id),this._drawOrder.splice(b,0,a.id),a;return},d.prototype.setOrderFunction=function(a){return this._drawOrderSorter=a,this},d.prototype.unsetOrderFunction=function(){return this._drawOrderSorter=null,this},d.prototype.exportTimeline=function(){var a={duration:this._animationLength,actorOrder:this._drawOrder.slice(0),actors:{}};return c.each(this._drawOrder,function(b){a.actors[b]=this._actors[b].exportTimeline()},this),a}},i=function(a,b){function e(){}"use strict";var c=a.Kapi;e.prototype=c.Actor.prototype;var f=c.CanvasActor=function(a){return c.Actor.call(this,a),a=a||{},this.draw=a.draw||d,this};f.prototype=new e,f.prototype.context=function(a){return a&&(this._context=a),this._context&&this._context.getContext("2d")},f.prototype.moveToLayer=function(a){return this.kapi.moveActorToLayer(this,a)}},j=function(a,b){function e(a,b,c){a.style[b]=c}function f(){}"use strict";var c=a.Kapi,d=["transform","webkitTransform","MozTransform","oTransform","msTransform"];c.DOMActor=function(a){c.Actor.call(this),this._context=a;var b=this.getCSSName();return this._context.className.match(b)||(this._context.className+=" "+b),delete this.update,delete this.teardown,this},f.prototype=c.Actor.prototype,c.DOMActor.prototype=new f,f.prototype.update=function(a,c){b.each(c,function(c,f){f==="transform"?b.each(d,function(b){e(a,b,c)},this):e(a,f,c)},this)},f.prototype.teardown=function(a,c){var d=this._context.className.match(/\S+/g),e=b.without(d,this.getCSSName());this._context.className=e},f.prototype.getCSSName=function(){return"actor-"+this.id}},k=function(a,b){function i(a){return/rgb/.test(a)}function j(a){var c=["{"],d;return b.each(a.get(),function(a,b){d=a;var f=b;b==="transform"&&(f=e),c.push(f+":"+d+";")}),c.push("}"),c.join("")}function k(a,b){var c=a.getLength(),d=a.getStart(),e=[],f,g,h,i=c/b,k=Math.floor(i),l=c/100,m=d+i,n=c+d-i;a.updateState(d),e.push(" from "+j(a));var o;for(o=m;o<=n;o+=i)a.updateState(o),f=(o-d)/l,g=+f.toFixed(2),h=g+"% ",e.push(" "+h+j(a));return a.updateState(c+d),e.push(" to "+j(a)),e.join("\n")}function l(a,c,d){d=d||["w3"];var e=[];return b.each(d,function(b){var d=p(g,[f[b],c,a]),h=m(d,b);e.push(h)}),e.join("\n")}function m(a,b){var c=new RegExp(e,"g"),d=f[b]+"transform",g=a.replace(c,d);return g}function n(a,c,d){c=c||["w3"];var e=[],f;b.each(c,function(b){f=o(a,b,d),e.push(f)});var g=p(h,[d,e.join("\n")]);return g}function o(a,b,c){var d=[],e=f[b],g=a.getStart(),h=a.getEnd()-g;h=p(" %sanimation-duration: %sms;",[e,h]),d.push(h);var i=p(" %sanimation-name: %s;",[e,c+"-keyframes"]);d.push(i);var j=p(" %sanimation-delay: %sms;",[e,g]);d.push(j);var k=p(" %sanimation-fill-mode: forwards;",[e]);return d.push(k),d.join("\n")}"use strict";var c=a.Kapi,d=100,e="TRANSFORM",f=c.util.VENDOR_PREFIXES={microsoft:"-ms-",mozilla:"-moz-",opera:"-o-",w3:"",webkit:"-webkit-"},g=["@%skeyframes %s-keyframes {","%s","}"].join("\n"),h=[".%s {"," position: absolute;","%s","}"].join("\n");a.Kapi.prototype.toCSS=function(a){a=a||{};var c=[],d=this.getActorIds();return b.each(d,function(b){c.push(this.getActor(b).toCSS(a))},this),c.join("\n")},a.Kapi.Actor.prototype.toCSS=function(a){a=a||{};var b=[],c=a.name||this.getCSSName(),e=a.granularity||d,f=n(this,a.vendors,c);b.push(f);var g=k(this,e),h=l(g,c,a.vendors);return b.push(h),b.join("\n")};var p=c.util.printf=function(a,c){var d=a;return b.each(c,function(a){d=d.replace("%s",a)}),d}},l=function(a,b){"use strict";var c=b?{}:a,d=b&&b.underscore?b.underscore:c._,l=b&&b.Tweenable?b.Tweenable:c.Tweenable;return e(c,d,l),f(c,d,l),g(c,d,l),typeof j=="function"&&j(c,d,l),typeof k=="function"&&k(c,d,l),typeof h=="function"&&h(c,d,l),typeof i=="function"&&i(c,d,l),c.Kapi};if(typeof define=="function"&&define.amd){var m=typeof _!="undefined";define(["shifty","underscore"],function(b,c){var d=c!==null,e={Tweenable:b,underscore:d?c:_},f=l(a,e);return typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(f.underscore_version=e.underscore.VERSION),!m&&d&&(a._=undefined),f})}else l(typeof a!="undefined"?a:this)})(this)
+(function(a){function b(a,b,c,d){c.each(a._events[b],function(b){b(a,d)})}function c(a){var b=[];_.each(a._actors,function(a){b.push(a.getEnd())}),a._animationLength=Math.max.apply(Math,b)}function d(){}var e=function(a,d,e){function h(a,b){var c=Math.floor(b/a._animationLength);return c}function i(a){return s()-a._loopTimestamp}function j(a,b){return b>=a._timesToIterate&&a._timesToIterate!==-1}function k(a,c){j(a,c)&&(a.stop(),b(a,"animationComplete",d))}function l(a,b,c){var d;return j(a,c)?d=a._animationLength:d=b%a._animationLength,d}function m(a,b){var c=h(a,b),d=l(a,b,c);a.update(d),k(a,c)}function n(a){m(a,i(a))}function o(a){var b=function(){o(a),n(a)};a._scheduleUpdate.call?a._loopId=a._scheduleUpdate.call(g,b,1e3/a.config.fps):a._loopId=setTimeout(b,1e3/a.config.fps)}function p(a){var b;return a!==60?b=g.setTimeout:b=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||g.mozCancelRequestAnimationFrame&&g.mozRequestAnimationFrame||g.setTimeout,b}function q(a){var b;return a!==60?b=g.clearTimeout:b=g.cancelAnimationFrame||g.webkitCancelAnimationFrame||g.oCancelAnimationFrame||g.msCancelAnimationFrame||g.mozCancelRequestAnimationFrame||g.clearTimeout,b}function r(a){a._cancelUpdate.call?a._cancelUpdate.call(g,a._loopId):clearTimeout(a._loopId)}"use strict";var f=Function,g=f("return this")(),s=e.util.now,t={fps:60},u={STOPPED:"stopped",PAUSED:"paused",PLAYING:"playing"},v=a.Kapi||function(b){return this.config=b||{},this.context=this.config.context||{},this._actors={},this._playState=u.STOPPED,this._events={animationComplete:[],playStateChange:[],play:[],pause:[],stop:[],beforeUpdate:[],afterUpdate:[],addActor:[],removeActor:[]},this._timesToIterate=-1,this._animationLength=0,this._loopId=null,this._loopTimestamp=null,this._pausedAtTime=null,this._lastUpdatedMillisecond=0,d.extend(this.config,b),d.defaults(this.config,t),this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps),d.each(this._contextInitHook,function(a){a.call(this)},this),this};v.prototype._contextInitHook={},v.prototype.addActor=function(a){return d.contains(this._actors,a)||(a.context()||a.context(this.context),a.kapi=this,a.fps=this.framerate(),this._actors[a.id]=a,c(this),a.setup(),b(this,"addActor",d,a)),this},v.prototype.getActor=function(a){return this._actors[a]},v.prototype.getActorIds=function(){return d.pluck(this._actors,"id")},v.prototype.getAllActors=function(){return d.clone(this._actors)},v.prototype.removeActor=function(a){return delete this._actors[a.id],delete a.kapi,a.teardown(),c(this),b(this,"removeActor",d,a),this},v.prototype.play=function(a){return r(this),this._playState===u.PAUSED?this._loopTimestamp+=s()-this._pausedAtTime:this._loopTimestamp=s(),this._timesToIterate=a||-1,this._playState=u.PLAYING,o(this),d.each(this._actors,function(a){a._state.isPaused&&a.resume()}),b(this,"playStateChange",d),b(this,"play",d),this},v.prototype.playFrom=function(a,b){return this.play(b),this._loopTimestamp=s()-a,this},v.prototype.playFromCurrent=function(a){return this.playFrom(this._lastUpdatedMillisecond,a)},v.prototype.pause=function(){return this._playState===u.PAUSED?this:(this._playState=u.PAUSED,r(this),this._pausedAtTime=s(),d.each(this._actors,function(a){a._state.isTweening&&a.pause()}),b(this,"playStateChange",d),b(this,"pause",d),this)},v.prototype.stop=function(){return this._playState=u.STOPPED,r(this),d.each(this._actors,function(a){a.stop()}),b(this,"playStateChange",d),b(this,"stop",d),this},v.prototype.isPlaying=function(){return this._playState===u.PLAYING},v.prototype.animationLength=function(){return this._animationLength},v.prototype.lastPositionUpdated=function(){return this._lastUpdatedMillisecond/this._animationLength},v.prototype.actorCount=function(){return d.size(this._actors)},v.prototype.framerate=function(a){return a&&(this.config.fps=a,this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps)),this.config.fps},v.prototype.update=function(a){return b(this,"beforeUpdate",d),d.each(this._actors,function(b){b.updateState(a),typeof b.update=="function"&&b.update(b.context(),b.get())}),this._lastUpdatedMillisecond=a,b(this,"afterUpdate",d),this},v.prototype.on=function(a,b){if(!this._events[a])return;return this._events[a].push(b),this},v.prototype.off=function(a,b){if(!this._events[a])return;return b?this._events[a]=d.without(this._events[a],b):this._events[a]=[],this},v.prototype.exportTimeline=function(){var a={duration:this._animationLength,actors:{}};return d.each(this._actors,function(b){a.actors[b.id]=b.exportTimeline()},this),a},v.util={},typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(v._private={calculateLoopPosition:l,updateToCurrentMillisecond:n,tick:o,determineCurrentLoopIteration:h,calculateTimeSinceStart:i,isAnimationComplete:j,updatePlayState:k}),a.Kapi=v},f=function(a,b,e){function h(a){return a.sort(function(a,b){return a-b})}function i(a,b){var c=a._timelinePropertyCacheIndex,d=c.length,e;for(e=1;e<d;e++)if(c[e]>=b)return e-1;return-1}function j(a){b.each(a._propertyTracks,function(c,d){a._propertyTracks[d]=b.sortBy(a._propertyTracks[d],function(a){return a.millisecond})})}function k(a){b.each(a._timelinePropertyCaches,function(c,d){var e=l(a,+d);b.defaults(c,e)})}function l(a,c){var d={};return b.each(a._propertyTracks,function(a,e){var f=null;b.find(a,function(a){return a.millisecond>c?d[e]=f:a.millisecond===c&&(d[e]=a),f=a,!!d[e]});if(!d[e]){var g=b.last(a);g&&g.millisecond<=c&&(d[e]=g)}}),d}function m(a){b.each(a._propertyTracks,function(a,c){b.each(a,function(b,c){b.linkToNext(a[c+1])})})}function n(a,c,d){return b.find(a._propertyTracks[c],function(a){return a.millisecond===d})}function o(a){a._timelinePropertyCaches={},b.each(a._keyframeProperties,function(b){a._timelinePropertyCaches[b.millisecond]||(a._timelinePropertyCaches[b.millisecond]={}),a._timelinePropertyCaches[b.millisecond][b.name]=b},a),a._timelinePropertyCacheIndex=b.keys(a._timelinePropertyCaches),b.each(a._timelinePropertyCacheIndex,function(b,c){a._timelinePropertyCacheIndex[c]=+b},a),h(a._timelinePropertyCacheIndex),k(a),m(a)}"use strict";var f="linear",g=a.Kapi,p=g.Actor=function(a){return a=a||{},e.call(this),b.extend(this,{_data:{},_propertyTracks:{},_timelinePropertyCaches:{},_timelinePropertyCacheIndex:[],_keyframeProperties:{},id:b.uniqueId(),setup:a.setup||d,update:a.update||d,teardown:a.teardown||d}),a.context&&this.context(a.context),this},q=function(){};q.prototype=e.prototype,p.prototype=new q,p.prototype.context=function(a){return a&&(this._context=a),this._context},p.prototype.keyframe=function(d,e,h){var i;return h=h||f,typeof h=="string"&&(i=h,h={},b.each(e,function(a,b){h[b]=i})),b.each(e,function(a,b){h[b]=h[b]||f}),b.each(e,function(a,b){var c=new g.KeyframeProperty(this,d,b,a,h[b]);this._keyframeProperties[c.id]=c,this._propertyTracks[b]||(this._propertyTracks[b]=[]),this._propertyTracks[b].push(c),j(this)},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.getKeyframeProperty=function(a,b){if(this._propertyTracks[a]&&this._propertyTracks[a][b])return this._propertyTracks[a][b]},p.prototype.modifyKeyframeProperty=function(a,b,d){return this._propertyTracks[a]&&this._propertyTracks[a][b]&&this._propertyTracks[a][b].modifyWith(d),j(this),o(this),c(this.kapi),this},p.prototype.getTrackNames=function(){return b.keys(this._propertyTracks)},p.prototype.getTrackLength=function(a){if(!this._propertyTracks[a])return;return this._propertyTracks[a].length},p.prototype.copyProperties=function(a,c){var d={},e={};return b.each(this._propertyTracks,function(a,b){var f=n(this,b,c);f&&(d[b]=f.value,e[b]=f.easing)},this),this.keyframe(a,d,e),this},p.prototype.wait=function(a){var c=this.getEnd();if(a<=c)return this;var d=this.getEnd(),e=l(this,this.getEnd()),f={},g={};return b.each(e,function(a,b){f[b]=a.value,g[b]=a.easing}),this.removeKeyframe(d),this.keyframe(d,f,g),this.keyframe(a,f,g),this},p.prototype.getStart=function(){var a=[];return b.each(this._propertyTracks,function(b){b.length&&a.push(b[0].millisecond)}),a.length===0&&(a=[0]),Math.min.apply(Math,a)},p.prototype.getEnd=function(){var a=0;return b.each(this._propertyTracks,function(c){if(c.length){var d=b.last(c).millisecond;d>a&&(a=d)}},this),a},p.prototype.getLength=function(){return this.getEnd()-this.getStart()},p.prototype.hasKeyframeAt=function(a,c){var d=this._propertyTracks;if(c){if(!b.has(d,c))return!1;d=b.pick(d,c)}return b.find(d,function(b,c){return n(this,c,a)!==undefined},this)!==undefined},p.prototype.modifyKeyframe=function(a,c,d){return d=d||{},b.each(this._propertyTracks,function(b,e){var f=n(this,e,a);f&&f.modifyWith({value:c[e],easing:d[e]})},this),this},p.prototype.removeKeyframe=function(a){return b.each(this._propertyTracks,function(c,d){var e=-1,f=!1;b.find(c,function(b){return e++,f=a===b.millisecond,f});if(f){var g=c.splice(e,1)[0];g&&delete this._keyframeProperties[g.id]}},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.removeAllKeyframeProperties=function(){return b.each(this._propertyTracks,function(a,b){a.length=0},this),this._keyframeProperties={},this.removeKeyframe(0)},p.prototype.updateState=function(a){var c=this.getStart(),d=this.getEnd();if(c<=a&&a<=d){var e=i(this,a),f=this._timelinePropertyCaches[this._timelinePropertyCacheIndex[e]],g={};b.each(f,function(b,c){b&&(g[c]=b.getValueAt(a))}),this.set(g)}return this},p.prototype.data=function(a){return a&&(this._data=a),this._data},p.prototype.exportTimeline=function(){var a={start:this.getStart(),end:this.getEnd(),trackNames:this.getTrackNames(),propertyTracks:{}};return b.each(this._propertyTracks,function(c,d){var e=a.propertyTracks[d]=[];b.each(c,function(a){e.push(a.exportPropertyData())})}),a}},g=function(a,b,c){"use strict";var d="linear",e=a.Kapi,f=e.KeyframeProperty=function(a,c,e,f,g){return this.id=b.uniqueId("keyframeProperty_"),this.ownerActor=a,this.millisecond=c,this.name=e,this.value=f,this.easing=g||d,this.nextProperty=null,this};f.prototype.modifyWith=function(a){var c={};b.each(["millisecond","easing","value"],function(b){c[b]=typeof a[b]=="undefined"?this[b]:a[b]},this),b.extend(this,c)},f.prototype.linkToNext=function(a){this.nextProperty=a||null},f.prototype.getValueAt=function(a){var b={},d={},e;if(this.nextProperty){b[this.name]=this.value,d[this.name]=this.nextProperty.value;var f=this.nextProperty.millisecond-this.millisecond,g=(a-this.millisecond)/f;e=c.util.interpolate(b,d,g,this.nextProperty.easing)[this.name]}else e=this.value;return e},f.prototype.exportPropertyData=function(){return{id:this.id,millisecond:this.millisecond,name:this.name,value:this.value,easing:this.easing}}},h=function(a,c){function e(a,b,c){return typeof c!="undefined"&&(a[b]=c,a.style[b]=c+"px"),a[b]}function f(a){a.config.clearOnUpdate&&a.canvasClear()}function g(a){b(a,"beforeDraw",c);var d=a._drawOrder.length,e;if(a._drawOrderSorter){var f=c.sortBy(a._canvasActors,a._drawOrderSorter);e=c.pluck(f,"id")}else e=a._drawOrder;var g,h,i;for(i=0;i<d;i++)g=a._canvasActors[e[i]],h=g.context(),g.draw(h,g.get());return b(a,"afterDraw",c),a}function h(a,b){b instanceof d.CanvasActor&&(a._drawOrder.push(b.id),a._canvasActors[b.id]=b)}function i(a,b){b instanceof d.CanvasActor&&(a._drawOrder=c.without(a._drawOrder,b.id),delete a._canvasActors[b.id])}"use strict";var d=a.Kapi;d.prototype._contextInitHook.canvas=function(){this._drawOrder=[],this._drawOrderSorter=null,this._canvasActors={},this.config.clearOnUpdate=!0,c.extend(this._events,{beforeDraw:[],afterDraw:[]}),c.each(["Height","Width"],function(a){var b=a.toLowerCase();this.config[b]&&(this["canvas"+a](this.config[b]),delete this.config[a])},this),this.on("afterUpdate",g),this.on("addActor",h),this.on("removeActor",i),this.on("beforeDraw",f)},d.prototype.canvasHeight=function(a){return e(this.context,"height",a)},d.prototype.canvasWidth=function(a){return e(this.context,"width",a)},d.prototype.canvasClear=function(){return this.context.getContext&&this.canvasContext().clearRect(0,0,this.canvasWidth(),this.canvasHeight()),this},d.prototype.canvasContext=function(){return this.context.getContext("2d")},d.prototype.redraw=function(){return g(this),this},d.prototype.moveActorToLayer=function(a,b){if(b<this._drawOrder.length)return this._drawOrder=c.without(this._drawOrder,a.id),this._drawOrder.splice(b,0,a.id),a;return},d.prototype.setOrderFunction=function(a){return this._drawOrderSorter=a,this},d.prototype.unsetOrderFunction=function(){return this._drawOrderSorter=null,this},d.prototype.exportTimeline=function(){var a={duration:this._animationLength,actorOrder:this._drawOrder.slice(0),actors:{}};return c.each(this._drawOrder,function(b){a.actors[b]=this._actors[b].exportTimeline()},this),a}},i=function(a,b){function e(){}"use strict";var c=a.Kapi;e.prototype=c.Actor.prototype;var f=c.CanvasActor=function(a){return c.Actor.call(this,a),a=a||{},this.draw=a.draw||d,this};f.prototype=new e,f.prototype.context=function(a){return a&&(this._context=a),this._context&&this._context.getContext("2d")},f.prototype.moveToLayer=function(a){return this.kapi.moveActorToLayer(this,a)}},j=function(a,b){function f(a,b,c){a.style[b]=c}function g(a){return b.contains(e,a)}function h(a,c){var d=[];return b.each(a,function(a){c[a]&&d.push(a+"("+c[a]+")")}),d.join(" ")}function i(a,c){b.each(d,function(b){f(a,b,c)})}function j(){}"use strict";var c=a.Kapi,d=["transform","webkitTransform","MozTransform","oTransform","msTransform"],e=["translateX","translateY","scale","scaleX","scaleY","rotate","skewX","skewY"];c.DOMActor=function(a){c.Actor.call(this),this._context=a;var b=this.getCSSName();return this._context.className.match(b)||(this._context.className+=" "+b),this._transformOrder=e.slice(0),delete this.update,delete this.teardown,this},j.prototype=c.Actor.prototype,c.DOMActor.prototype=new j,j.prototype.update=function(a,c){var d=b.keys(c),e=b.filter(d,g),j=b.reject(d,g),k=b.pick(c,j);if(e.length){var l=b.pick(c,e),m=h(this._transformOrder,l);i(a,m)}else c.transform&&i(a,c.transform);b.each(k,function(b,c){f(a,c,b)},this)},j.prototype.teardown=function(a,c){var d=this._context.className.match(/\S+/g),e=b.without(d,this.getCSSName());this._context.className=e},j.prototype.getCSSName=function(){return"actor-"+this.id},j.prototype.setTransformOrder=function(a){var c=b.reject(a,g);if(c.length)throw"Unknown or unsupported transform functions: "+c.join(", ");return this._transformOrder=b.uniq(a),this}},k=function(a,b){function i(a){return/rgb/.test(a)}function j(a){var c=["{"],d;return b.each(a.get(),function(a,b){d=a;var f=b;b==="transform"&&(f=e),c.push(f+":"+d+";")}),c.push("}"),c.join("")}function k(a,b){var c=a.getLength(),d=a.getStart(),e=[],f,g,h,i=c/b,k=Math.floor(i),l=c/100,m=d+i,n=c+d-i;a.updateState(d),e.push(" from "+j(a));var o;for(o=m;o<=n;o+=i)a.updateState(o),f=(o-d)/l,g=+f.toFixed(2),h=g+"% ",e.push(" "+h+j(a));return a.updateState(c+d),e.push(" to "+j(a)),e.join("\n")}function l(a,c,d){d=d||["w3"];var e=[];return b.each(d,function(b){var d=p(g,[f[b],c,a]),h=m(d,b);e.push(h)}),e.join("\n")}function m(a,b){var c=new RegExp(e,"g"),d=f[b]+"transform",g=a.replace(c,d);return g}function n(a,c,d){c=c||["w3"];var e=[],f;b.each(c,function(b){f=o(a,b,d),e.push(f)});var g=p(h,[d,e.join("\n")]);return g}function o(a,b,c){var d=[],e=f[b],g=a.getStart(),h=a.getEnd()-g;h=p(" %sanimation-duration: %sms;",[e,h]),d.push(h);var i=p(" %sanimation-name: %s;",[e,c+"-keyframes"]);d.push(i);var j=p(" %sanimation-delay: %sms;",[e,g]);d.push(j);var k=p(" %sanimation-fill-mode: forwards;",[e]);return d.push(k),d.join("\n")}"use strict";var c=a.Kapi,d=100,e="TRANSFORM",f=c.util.VENDOR_PREFIXES={microsoft:"-ms-",mozilla:"-moz-",opera:"-o-",w3:"",webkit:"-webkit-"},g=["@%skeyframes %s-keyframes {","%s","}"].join("\n"),h=[".%s {"," position: absolute;","%s","}"].join("\n");a.Kapi.prototype.toCSS=function(a){a=a||{};var c=[],d=this.getActorIds();return b.each(d,function(b){c.push(this.getActor(b).toCSS(a))},this),c.join("\n")},a.Kapi.Actor.prototype.toCSS=function(a){a=a||{};var b=[],c=a.name||this.getCSSName(),e=a.granularity||d,f=n(this,a.vendors,c);b.push(f);var g=k(this,e),h=l(g,c,a.vendors);return b.push(h),b.join("\n")};var p=c.util.printf=function(a,c){var d=a;return b.each(c,function(a){d=d.replace("%s",a)}),d}},l=function(a,b){"use strict";var c=b?{}:a,d=b&&b.underscore?b.underscore:c._,l=b&&b.Tweenable?b.Tweenable:c.Tweenable;return e(c,d,l),f(c,d,l),g(c,d,l),typeof j=="function"&&j(c,d,l),typeof k=="function"&&k(c,d,l),typeof h=="function"&&h(c,d,l),typeof i=="function"&&i(c,d,l),c.Kapi};if(typeof define=="function"&&define.amd){var m=typeof _!="undefined";define(["shifty","underscore"],function(b,c){var d=c!==null,e={Tweenable:b,underscore:d?c:_},f=l(a,e);return typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(f.underscore_version=e.underscore.VERSION),!m&&d&&(a._=undefined),f})}else l(typeof a!="undefined"?a:this)})(this)
View
99 dist/rekapi.js
@@ -1,6 +1,6 @@
/*jslint browser: true, nomen: true, plusplus: true, undef: true, vars: true, white: true */
/**
- * Rekapi - Rewritten Kapi. v0.9.8 (Thu, 21 Jun 2012 03:38:37 GMT)
+ * Rekapi - Rewritten Kapi. v0.9.9 (Fri, 22 Jun 2012 02:21:16 GMT)
* https://github.com/jeremyckahn/rekapi
*
* By Jeremy Kahn (jeremyckahn@gmail.com), with significant contributions from
@@ -1546,12 +1546,22 @@ var rekapiDOM = function (context, _) {
'use strict';
var Kapi = context.Kapi;
+ // TODO: Change the name of this array to a clearer name, e.g. `vendorTransforms`
var transforms = [
'transform'
,'webkitTransform'
,'MozTransform'
,'oTransform'
,'msTransform'];
+ var transformFunctions = [
+ 'translateX',
+ 'translateY',
+ 'scale',
+ 'scaleX',
+ 'scaleY',
+ 'rotate',
+ 'skewX',
+ 'skewY'];
function setStyle (forElement, styleName, styleValue) {
@@ -1560,6 +1570,49 @@ var rekapiDOM = function (context, _) {
/**
+ * @param {string} name A transform function name
+ * @return {boolean}
+ */
+ function isTransformFunction (name) {
+ return _.contains(transformFunctions, name);
+ }
+
+
+ /**
+ * Builds a concatenated string of given transform property values in order.
+ *
+ * @param {Array.<string>} orderedFunctions Array of ordered transform function names
+ * @param {Object} transformProperties Transform properties to build together
+ * @return {string}
+ */
+ function buildTransformValue (orderedFunctions, transformProperties) {
+ var transformComponents = [];
+
+ _.each(orderedFunctions, function(functionName) {
+ if (transformProperties[functionName]) {
+ transformComponents.push(functionName + '(' +
+ transformProperties[functionName] + ')');
+ }
+ });
+
+ return transformComponents.join(' ');
+ }
+
+
+ /**
+ * Sets value for all vendor prefixed transform properties on a given context
+ *
+ * @param {Object} context The actor's DOM context
+ * @param {string} transformValue The transform style value
+ */
+ function setTransformStyles (context, transformValue) {
+ _.each(transforms, function(prefixedTransform) {
+ setStyle(context, prefixedTransform, transformValue);
+ });
+ }
+
+
+ /**
* @param {HTMLElement} element
* @constructor
*/
@@ -1574,6 +1627,8 @@ var rekapiDOM = function (context, _) {
this._context.className += ' ' + className;
}
+ this._transformOrder = transformFunctions.slice(0);
+
// Remove the instance's update method to allow the
// ActorMethods.prototype.update method to be accessible.
delete this.update;
@@ -1593,15 +1648,22 @@ var rekapiDOM = function (context, _) {
* @param {Object} state
*/
DOMActorMethods.prototype.update = function (context, state) {
+ var propertyNames = _.keys(state);
+ // TODO: Optimize the following code so that propertyNames is not looped over twice.
+ var transformFunctionNames = _.filter(propertyNames, isTransformFunction);
+ var otherPropertyNames = _.reject(propertyNames, isTransformFunction);
+ var otherProperties = _.pick(state, otherPropertyNames);
+
+ if (transformFunctionNames.length) {
+ var transformProperties = _.pick(state, transformFunctionNames);
+ var builtStyle = buildTransformValue(this._transformOrder, transformProperties);
+ setTransformStyles(context, builtStyle);
+ } else if (state.transform) {
+ setTransformStyles(context, state.transform);
+ }
- _.each(state, function (styleValue, styleName) {
- if (styleName === 'transform') {
- _.each(transforms, function (transform) {
- setStyle(context, transform, styleValue);
- }, this);
- } else {
- setStyle(context, styleName, styleValue);
- }
+ _.each(otherProperties, function (styleValue, styleName) {
+ setStyle(context, styleName, styleValue);
}, this);
};
@@ -1620,6 +1682,25 @@ var rekapiDOM = function (context, _) {
return 'actor-' + this.id;
};
+
+ /**
+ * Overrides the default transform function order.
+ *
+ * @param {Array} orderedFunctions The Array of transform function names
+ * @return {Kapi}
+ */
+ DOMActorMethods.prototype.setTransformOrder = function (orderedFunctions) {
+ var unknownFunctions = _.reject(orderedFunctions, isTransformFunction);
+
+ if (unknownFunctions.length) {
+ throw 'Unknown or unsupported transform functions: ' + unknownFunctions.join(', ');
+ }
+ // Ignore duplicate transform function names in the array
+ this._transformOrder = _.uniq(orderedFunctions);
+
+ return this;
+ };
+
};
var rekapiToCSS = function (context, _) {
View
4 dist/rekapi.min.js
@@ -1,6 +1,6 @@
/*jslint browser: true, nomen: true, plusplus: true, undef: true, vars: true, white: true */
/**
- * Rekapi - Rewritten Kapi. v0.9.8 (Thu, 21 Jun 2012 03:38:37 GMT)
+ * Rekapi - Rewritten Kapi. v0.9.9 (Fri, 22 Jun 2012 02:21:16 GMT)
* https://github.com/jeremyckahn/rekapi
*
* By Jeremy Kahn (jeremyckahn@gmail.com), with significant contributions from
@@ -11,4 +11,4 @@
* Shifty.js (https://github.com/jeremyckahn/shifty).
* MIT Lincense. This code free to use, modify, distribute and enjoy.
*/
-(function(a){function b(a,b,c,d){c.each(a._events[b],function(b){b(a,d)})}function c(a){var b=[];_.each(a._actors,function(a){b.push(a.getEnd())}),a._animationLength=Math.max.apply(Math,b)}function d(){}var e=function(a,d,e){function h(a,b){var c=Math.floor(b/a._animationLength);return c}function i(a){return s()-a._loopTimestamp}function j(a,b){return b>=a._timesToIterate&&a._timesToIterate!==-1}function k(a,c){j(a,c)&&(a.stop(),b(a,"animationComplete",d))}function l(a,b,c){var d;return j(a,c)?d=a._animationLength:d=b%a._animationLength,d}function m(a,b){var c=h(a,b),d=l(a,b,c);a.update(d),k(a,c)}function n(a){m(a,i(a))}function o(a){var b=function(){o(a),n(a)};a._scheduleUpdate.call?a._loopId=a._scheduleUpdate.call(g,b,1e3/a.config.fps):a._loopId=setTimeout(b,1e3/a.config.fps)}function p(a){var b;return a!==60?b=g.setTimeout:b=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||g.mozCancelRequestAnimationFrame&&g.mozRequestAnimationFrame||g.setTimeout,b}function q(a){var b;return a!==60?b=g.clearTimeout:b=g.cancelAnimationFrame||g.webkitCancelAnimationFrame||g.oCancelAnimationFrame||g.msCancelAnimationFrame||g.mozCancelRequestAnimationFrame||g.clearTimeout,b}function r(a){a._cancelUpdate.call?a._cancelUpdate.call(g,a._loopId):clearTimeout(a._loopId)}"use strict";var f=Function,g=f("return this")(),s=e.util.now,t={fps:60},u={STOPPED:"stopped",PAUSED:"paused",PLAYING:"playing"},v=a.Kapi||function(b){return this.config=b||{},this.context=this.config.context||{},this._actors={},this._playState=u.STOPPED,this._events={animationComplete:[],playStateChange:[],play:[],pause:[],stop:[],beforeUpdate:[],afterUpdate:[],addActor:[],removeActor:[]},this._timesToIterate=-1,this._animationLength=0,this._loopId=null,this._loopTimestamp=null,this._pausedAtTime=null,this._lastUpdatedMillisecond=0,d.extend(this.config,b),d.defaults(this.config,t),this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps),d.each(this._contextInitHook,function(a){a.call(this)},this),this};v.prototype._contextInitHook={},v.prototype.addActor=function(a){return d.contains(this._actors,a)||(a.context()||a.context(this.context),a.kapi=this,a.fps=this.framerate(),this._actors[a.id]=a,c(this),a.setup(),b(this,"addActor",d,a)),this},v.prototype.getActor=function(a){return this._actors[a]},v.prototype.getActorIds=function(){return d.pluck(this._actors,"id")},v.prototype.getAllActors=function(){return d.clone(this._actors)},v.prototype.removeActor=function(a){return delete this._actors[a.id],delete a.kapi,a.teardown(),c(this),b(this,"removeActor",d,a),this},v.prototype.play=function(a){return r(this),this._playState===u.PAUSED?this._loopTimestamp+=s()-this._pausedAtTime:this._loopTimestamp=s(),this._timesToIterate=a||-1,this._playState=u.PLAYING,o(this),d.each(this._actors,function(a){a._state.isPaused&&a.resume()}),b(this,"playStateChange",d),b(this,"play",d),this},v.prototype.playFrom=function(a,b){return this.play(b),this._loopTimestamp=s()-a,this},v.prototype.playFromCurrent=function(a){return this.playFrom(this._lastUpdatedMillisecond,a)},v.prototype.pause=function(){return this._playState===u.PAUSED?this:(this._playState=u.PAUSED,r(this),this._pausedAtTime=s(),d.each(this._actors,function(a){a._state.isTweening&&a.pause()}),b(this,"playStateChange",d),b(this,"pause",d),this)},v.prototype.stop=function(){return this._playState=u.STOPPED,r(this),d.each(this._actors,function(a){a.stop()}),b(this,"playStateChange",d),b(this,"stop",d),this},v.prototype.isPlaying=function(){return this._playState===u.PLAYING},v.prototype.animationLength=function(){return this._animationLength},v.prototype.lastPositionUpdated=function(){return this._lastUpdatedMillisecond/this._animationLength},v.prototype.actorCount=function(){return d.size(this._actors)},v.prototype.framerate=function(a){return a&&(this.config.fps=a,this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps)),this.config.fps},v.prototype.update=function(a){return b(this,"beforeUpdate",d),d.each(this._actors,function(b){b.updateState(a),typeof b.update=="function"&&b.update(b.context(),b.get())}),this._lastUpdatedMillisecond=a,b(this,"afterUpdate",d),this},v.prototype.on=function(a,b){if(!this._events[a])return;return this._events[a].push(b),this},v.prototype.off=function(a,b){if(!this._events[a])return;return b?this._events[a]=d.without(this._events[a],b):this._events[a]=[],this},v.prototype.exportTimeline=function(){var a={duration:this._animationLength,actors:{}};return d.each(this._actors,function(b){a.actors[b.id]=b.exportTimeline()},this),a},v.util={},typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(v._private={calculateLoopPosition:l,updateToCurrentMillisecond:n,tick:o,determineCurrentLoopIteration:h,calculateTimeSinceStart:i,isAnimationComplete:j,updatePlayState:k}),a.Kapi=v},f=function(a,b,e){function h(a){return a.sort(function(a,b){return a-b})}function i(a,b){var c=a._timelinePropertyCacheIndex,d=c.length,e;for(e=1;e<d;e++)if(c[e]>=b)return e-1;return-1}function j(a){b.each(a._propertyTracks,function(c,d){a._propertyTracks[d]=b.sortBy(a._propertyTracks[d],function(a){return a.millisecond})})}function k(a){b.each(a._timelinePropertyCaches,function(c,d){var e=l(a,+d);b.defaults(c,e)})}function l(a,c){var d={};return b.each(a._propertyTracks,function(a,e){var f=null;b.find(a,function(a){return a.millisecond>c?d[e]=f:a.millisecond===c&&(d[e]=a),f=a,!!d[e]});if(!d[e]){var g=b.last(a);g&&g.millisecond<=c&&(d[e]=g)}}),d}function m(a){b.each(a._propertyTracks,function(a,c){b.each(a,function(b,c){b.linkToNext(a[c+1])})})}function n(a,c,d){return b.find(a._propertyTracks[c],function(a){return a.millisecond===d})}function o(a){a._timelinePropertyCaches={},b.each(a._keyframeProperties,function(b){a._timelinePropertyCaches[b.millisecond]||(a._timelinePropertyCaches[b.millisecond]={}),a._timelinePropertyCaches[b.millisecond][b.name]=b},a),a._timelinePropertyCacheIndex=b.keys(a._timelinePropertyCaches),b.each(a._timelinePropertyCacheIndex,function(b,c){a._timelinePropertyCacheIndex[c]=+b},a),h(a._timelinePropertyCacheIndex),k(a),m(a)}"use strict";var f="linear",g=a.Kapi,p=g.Actor=function(a){return a=a||{},e.call(this),b.extend(this,{_data:{},_propertyTracks:{},_timelinePropertyCaches:{},_timelinePropertyCacheIndex:[],_keyframeProperties:{},id:b.uniqueId(),setup:a.setup||d,update:a.update||d,teardown:a.teardown||d}),a.context&&this.context(a.context),this},q=function(){};q.prototype=e.prototype,p.prototype=new q,p.prototype.context=function(a){return a&&(this._context=a),this._context},p.prototype.keyframe=function(d,e,h){var i;return h=h||f,typeof h=="string"&&(i=h,h={},b.each(e,function(a,b){h[b]=i})),b.each(e,function(a,b){h[b]=h[b]||f}),b.each(e,function(a,b){var c=new g.KeyframeProperty(this,d,b,a,h[b]);this._keyframeProperties[c.id]=c,this._propertyTracks[b]||(this._propertyTracks[b]=[]),this._propertyTracks[b].push(c),j(this)},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.getKeyframeProperty=function(a,b){if(this._propertyTracks[a]&&this._propertyTracks[a][b])return this._propertyTracks[a][b]},p.prototype.modifyKeyframeProperty=function(a,b,d){return this._propertyTracks[a]&&this._propertyTracks[a][b]&&this._propertyTracks[a][b].modifyWith(d),j(this),o(this),c(this.kapi),this},p.prototype.getTrackNames=function(){return b.keys(this._propertyTracks)},p.prototype.getTrackLength=function(a){if(!this._propertyTracks[a])return;return this._propertyTracks[a].length},p.prototype.copyProperties=function(a,c){var d={},e={};return b.each(this._propertyTracks,function(a,b){var f=n(this,b,c);f&&(d[b]=f.value,e[b]=f.easing)},this),this.keyframe(a,d,e),this},p.prototype.wait=function(a){var c=this.getEnd();if(a<=c)return this;var d=this.getEnd(),e=l(this,this.getEnd()),f={},g={};return b.each(e,function(a,b){f[b]=a.value,g[b]=a.easing}),this.removeKeyframe(d),this.keyframe(d,f,g),this.keyframe(a,f,g),this},p.prototype.getStart=function(){var a=[];return b.each(this._propertyTracks,function(b){b.length&&a.push(b[0].millisecond)}),a.length===0&&(a=[0]),Math.min.apply(Math,a)},p.prototype.getEnd=function(){var a=0;return b.each(this._propertyTracks,function(c){if(c.length){var d=b.last(c).millisecond;d>a&&(a=d)}},this),a},p.prototype.getLength=function(){return this.getEnd()-this.getStart()},p.prototype.hasKeyframeAt=function(a,c){var d=this._propertyTracks;if(c){if(!b.has(d,c))return!1;d=b.pick(d,c)}return b.find(d,function(b,c){return n(this,c,a)!==undefined},this)!==undefined},p.prototype.modifyKeyframe=function(a,c,d){return d=d||{},b.each(this._propertyTracks,function(b,e){var f=n(this,e,a);f&&f.modifyWith({value:c[e],easing:d[e]})},this),this},p.prototype.removeKeyframe=function(a){return b.each(this._propertyTracks,function(c,d){var e=-1,f=!1;b.find(c,function(b){return e++,f=a===b.millisecond,f});if(f){var g=c.splice(e,1)[0];g&&delete this._keyframeProperties[g.id]}},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.removeAllKeyframeProperties=function(){return b.each(this._propertyTracks,function(a,b){a.length=0},this),this._keyframeProperties={},this.removeKeyframe(0)},p.prototype.updateState=function(a){var c=this.getStart(),d=this.getEnd();if(c<=a&&a<=d){var e=i(this,a),f=this._timelinePropertyCaches[this._timelinePropertyCacheIndex[e]],g={};b.each(f,function(b,c){b&&(g[c]=b.getValueAt(a))}),this.set(g)}return this},p.prototype.data=function(a){return a&&(this._data=a),this._data},p.prototype.exportTimeline=function(){var a={start:this.getStart(),end:this.getEnd(),trackNames:this.getTrackNames(),propertyTracks:{}};return b.each(this._propertyTracks,function(c,d){var e=a.propertyTracks[d]=[];b.each(c,function(a){e.push(a.exportPropertyData())})}),a}},g=function(a,b,c){"use strict";var d="linear",e=a.Kapi,f=e.KeyframeProperty=function(a,c,e,f,g){return this.id=b.uniqueId("keyframeProperty_"),this.ownerActor=a,this.millisecond=c,this.name=e,this.value=f,this.easing=g||d,this.nextProperty=null,this};f.prototype.modifyWith=function(a){var c={};b.each(["millisecond","easing","value"],function(b){c[b]=typeof a[b]=="undefined"?this[b]:a[b]},this),b.extend(this,c)},f.prototype.linkToNext=function(a){this.nextProperty=a||null},f.prototype.getValueAt=function(a){var b={},d={},e;if(this.nextProperty){b[this.name]=this.value,d[this.name]=this.nextProperty.value;var f=this.nextProperty.millisecond-this.millisecond,g=(a-this.millisecond)/f;e=c.util.interpolate(b,d,g,this.nextProperty.easing)[this.name]}else e=this.value;return e},f.prototype.exportPropertyData=function(){return{id:this.id,millisecond:this.millisecond,name:this.name,value:this.value,easing:this.easing}}},h=function(a,c){function e(a,b,c){return typeof c!="undefined"&&(a[b]=c,a.style[b]=c+"px"),a[b]}function f(a){a.config.clearOnUpdate&&a.canvasClear()}function g(a){b(a,"beforeDraw",c);var d=a._drawOrder.length,e;if(a._drawOrderSorter){var f=c.sortBy(a._canvasActors,a._drawOrderSorter);e=c.pluck(f,"id")}else e=a._drawOrder;var g,h,i;for(i=0;i<d;i++)g=a._canvasActors[e[i]],h=g.context(),g.draw(h,g.get());return b(a,"afterDraw",c),a}function h(a,b){b instanceof d.CanvasActor&&(a._drawOrder.push(b.id),a._canvasActors[b.id]=b)}function i(a,b){b instanceof d.CanvasActor&&(a._drawOrder=c.without(a._drawOrder,b.id),delete a._canvasActors[b.id])}"use strict";var d=a.Kapi;d.prototype._contextInitHook.canvas=function(){this._drawOrder=[],this._drawOrderSorter=null,this._canvasActors={},this.config.clearOnUpdate=!0,c.extend(this._events,{beforeDraw:[],afterDraw:[]}),c.each(["Height","Width"],function(a){var b=a.toLowerCase();this.config[b]&&(this["canvas"+a](this.config[b]),delete this.config[a])},this),this.on("afterUpdate",g),this.on("addActor",h),this.on("removeActor",i),this.on("beforeDraw",f)},d.prototype.canvasHeight=function(a){return e(this.context,"height",a)},d.prototype.canvasWidth=function(a){return e(this.context,"width",a)},d.prototype.canvasClear=function(){return this.context.getContext&&this.canvasContext().clearRect(0,0,this.canvasWidth(),this.canvasHeight()),this},d.prototype.canvasContext=function(){return this.context.getContext("2d")},d.prototype.redraw=function(){return g(this),this},d.prototype.moveActorToLayer=function(a,b){if(b<this._drawOrder.length)return this._drawOrder=c.without(this._drawOrder,a.id),this._drawOrder.splice(b,0,a.id),a;return},d.prototype.setOrderFunction=function(a){return this._drawOrderSorter=a,this},d.prototype.unsetOrderFunction=function(){return this._drawOrderSorter=null,this},d.prototype.exportTimeline=function(){var a={duration:this._animationLength,actorOrder:this._drawOrder.slice(0),actors:{}};return c.each(this._drawOrder,function(b){a.actors[b]=this._actors[b].exportTimeline()},this),a}},i=function(a,b){function e(){}"use strict";var c=a.Kapi;e.prototype=c.Actor.prototype;var f=c.CanvasActor=function(a){return c.Actor.call(this,a),a=a||{},this.draw=a.draw||d,this};f.prototype=new e,f.prototype.context=function(a){return a&&(this._context=a),this._context&&this._context.getContext("2d")},f.prototype.moveToLayer=function(a){return this.kapi.moveActorToLayer(this,a)}},j=function(a,b){function e(a,b,c){a.style[b]=c}function f(){}"use strict";var c=a.Kapi,d=["transform","webkitTransform","MozTransform","oTransform","msTransform"];c.DOMActor=function(a){c.Actor.call(this),this._context=a;var b=this.getCSSName();return this._context.className.match(b)||(this._context.className+=" "+b),delete this.update,delete this.teardown,this},f.prototype=c.Actor.prototype,c.DOMActor.prototype=new f,f.prototype.update=function(a,c){b.each(c,function(c,f){f==="transform"?b.each(d,function(b){e(a,b,c)},this):e(a,f,c)},this)},f.prototype.teardown=function(a,c){var d=this._context.className.match(/\S+/g),e=b.without(d,this.getCSSName());this._context.className=e},f.prototype.getCSSName=function(){return"actor-"+this.id}},k=function(a,b){function i(a){return/rgb/.test(a)}function j(a){var c=["{"],d;return b.each(a.get(),function(a,b){d=a;var f=b;b==="transform"&&(f=e),c.push(f+":"+d+";")}),c.push("}"),c.join("")}function k(a,b){var c=a.getLength(),d=a.getStart(),e=[],f,g,h,i=c/b,k=Math.floor(i),l=c/100,m=d+i,n=c+d-i;a.updateState(d),e.push(" from "+j(a));var o;for(o=m;o<=n;o+=i)a.updateState(o),f=(o-d)/l,g=+f.toFixed(2),h=g+"% ",e.push(" "+h+j(a));return a.updateState(c+d),e.push(" to "+j(a)),e.join("\n")}function l(a,c,d){d=d||["w3"];var e=[];return b.each(d,function(b){var d=p(g,[f[b],c,a]),h=m(d,b);e.push(h)}),e.join("\n")}function m(a,b){var c=new RegExp(e,"g"),d=f[b]+"transform",g=a.replace(c,d);return g}function n(a,c,d){c=c||["w3"];var e=[],f;b.each(c,function(b){f=o(a,b,d),e.push(f)});var g=p(h,[d,e.join("\n")]);return g}function o(a,b,c){var d=[],e=f[b],g=a.getStart(),h=a.getEnd()-g;h=p(" %sanimation-duration: %sms;",[e,h]),d.push(h);var i=p(" %sanimation-name: %s;",[e,c+"-keyframes"]);d.push(i);var j=p(" %sanimation-delay: %sms;",[e,g]);d.push(j);var k=p(" %sanimation-fill-mode: forwards;",[e]);return d.push(k),d.join("\n")}"use strict";var c=a.Kapi,d=100,e="TRANSFORM",f=c.util.VENDOR_PREFIXES={microsoft:"-ms-",mozilla:"-moz-",opera:"-o-",w3:"",webkit:"-webkit-"},g=["@%skeyframes %s-keyframes {","%s","}"].join("\n"),h=[".%s {"," position: absolute;","%s","}"].join("\n");a.Kapi.prototype.toCSS=function(a){a=a||{};var c=[],d=this.getActorIds();return b.each(d,function(b){c.push(this.getActor(b).toCSS(a))},this),c.join("\n")},a.Kapi.Actor.prototype.toCSS=function(a){a=a||{};var b=[],c=a.name||this.getCSSName(),e=a.granularity||d,f=n(this,a.vendors,c);b.push(f);var g=k(this,e),h=l(g,c,a.vendors);return b.push(h),b.join("\n")};var p=c.util.printf=function(a,c){var d=a;return b.each(c,function(a){d=d.replace("%s",a)}),d}},l=function(a,b){"use strict";var c=b?{}:a,d=b&&b.underscore?b.underscore:c._,l=b&&b.Tweenable?b.Tweenable:c.Tweenable;return e(c,d,l),f(c,d,l),g(c,d,l),typeof j=="function"&&j(c,d,l),typeof k=="function"&&k(c,d,l),typeof h=="function"&&h(c,d,l),typeof i=="function"&&i(c,d,l),c.Kapi};if(typeof define=="function"&&define.amd){var m=typeof _!="undefined";define(["shifty","underscore"],function(b,c){var d=c!==null,e={Tweenable:b,underscore:d?c:_},f=l(a,e);return typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(f.underscore_version=e.underscore.VERSION),!m&&d&&(a._=undefined),f})}else l(typeof a!="undefined"?a:this)})(this)
+(function(a){function b(a,b,c,d){c.each(a._events[b],function(b){b(a,d)})}function c(a){var b=[];_.each(a._actors,function(a){b.push(a.getEnd())}),a._animationLength=Math.max.apply(Math,b)}function d(){}var e=function(a,d,e){function h(a,b){var c=Math.floor(b/a._animationLength);return c}function i(a){return s()-a._loopTimestamp}function j(a,b){return b>=a._timesToIterate&&a._timesToIterate!==-1}function k(a,c){j(a,c)&&(a.stop(),b(a,"animationComplete",d))}function l(a,b,c){var d;return j(a,c)?d=a._animationLength:d=b%a._animationLength,d}function m(a,b){var c=h(a,b),d=l(a,b,c);a.update(d),k(a,c)}function n(a){m(a,i(a))}function o(a){var b=function(){o(a),n(a)};a._scheduleUpdate.call?a._loopId=a._scheduleUpdate.call(g,b,1e3/a.config.fps):a._loopId=setTimeout(b,1e3/a.config.fps)}function p(a){var b;return a!==60?b=g.setTimeout:b=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||g.mozCancelRequestAnimationFrame&&g.mozRequestAnimationFrame||g.setTimeout,b}function q(a){var b;return a!==60?b=g.clearTimeout:b=g.cancelAnimationFrame||g.webkitCancelAnimationFrame||g.oCancelAnimationFrame||g.msCancelAnimationFrame||g.mozCancelRequestAnimationFrame||g.clearTimeout,b}function r(a){a._cancelUpdate.call?a._cancelUpdate.call(g,a._loopId):clearTimeout(a._loopId)}"use strict";var f=Function,g=f("return this")(),s=e.util.now,t={fps:60},u={STOPPED:"stopped",PAUSED:"paused",PLAYING:"playing"},v=a.Kapi||function(b){return this.config=b||{},this.context=this.config.context||{},this._actors={},this._playState=u.STOPPED,this._events={animationComplete:[],playStateChange:[],play:[],pause:[],stop:[],beforeUpdate:[],afterUpdate:[],addActor:[],removeActor:[]},this._timesToIterate=-1,this._animationLength=0,this._loopId=null,this._loopTimestamp=null,this._pausedAtTime=null,this._lastUpdatedMillisecond=0,d.extend(this.config,b),d.defaults(this.config,t),this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps),d.each(this._contextInitHook,function(a){a.call(this)},this),this};v.prototype._contextInitHook={},v.prototype.addActor=function(a){return d.contains(this._actors,a)||(a.context()||a.context(this.context),a.kapi=this,a.fps=this.framerate(),this._actors[a.id]=a,c(this),a.setup(),b(this,"addActor",d,a)),this},v.prototype.getActor=function(a){return this._actors[a]},v.prototype.getActorIds=function(){return d.pluck(this._actors,"id")},v.prototype.getAllActors=function(){return d.clone(this._actors)},v.prototype.removeActor=function(a){return delete this._actors[a.id],delete a.kapi,a.teardown(),c(this),b(this,"removeActor",d,a),this},v.prototype.play=function(a){return r(this),this._playState===u.PAUSED?this._loopTimestamp+=s()-this._pausedAtTime:this._loopTimestamp=s(),this._timesToIterate=a||-1,this._playState=u.PLAYING,o(this),d.each(this._actors,function(a){a._state.isPaused&&a.resume()}),b(this,"playStateChange",d),b(this,"play",d),this},v.prototype.playFrom=function(a,b){return this.play(b),this._loopTimestamp=s()-a,this},v.prototype.playFromCurrent=function(a){return this.playFrom(this._lastUpdatedMillisecond,a)},v.prototype.pause=function(){return this._playState===u.PAUSED?this:(this._playState=u.PAUSED,r(this),this._pausedAtTime=s(),d.each(this._actors,function(a){a._state.isTweening&&a.pause()}),b(this,"playStateChange",d),b(this,"pause",d),this)},v.prototype.stop=function(){return this._playState=u.STOPPED,r(this),d.each(this._actors,function(a){a.stop()}),b(this,"playStateChange",d),b(this,"stop",d),this},v.prototype.isPlaying=function(){return this._playState===u.PLAYING},v.prototype.animationLength=function(){return this._animationLength},v.prototype.lastPositionUpdated=function(){return this._lastUpdatedMillisecond/this._animationLength},v.prototype.actorCount=function(){return d.size(this._actors)},v.prototype.framerate=function(a){return a&&(this.config.fps=a,this._scheduleUpdate=p(this.config.fps),this._cancelUpdate=q(this.config.fps)),this.config.fps},v.prototype.update=function(a){return b(this,"beforeUpdate",d),d.each(this._actors,function(b){b.updateState(a),typeof b.update=="function"&&b.update(b.context(),b.get())}),this._lastUpdatedMillisecond=a,b(this,"afterUpdate",d),this},v.prototype.on=function(a,b){if(!this._events[a])return;return this._events[a].push(b),this},v.prototype.off=function(a,b){if(!this._events[a])return;return b?this._events[a]=d.without(this._events[a],b):this._events[a]=[],this},v.prototype.exportTimeline=function(){var a={duration:this._animationLength,actors:{}};return d.each(this._actors,function(b){a.actors[b.id]=b.exportTimeline()},this),a},v.util={},typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(v._private={calculateLoopPosition:l,updateToCurrentMillisecond:n,tick:o,determineCurrentLoopIteration:h,calculateTimeSinceStart:i,isAnimationComplete:j,updatePlayState:k}),a.Kapi=v},f=function(a,b,e){function h(a){return a.sort(function(a,b){return a-b})}function i(a,b){var c=a._timelinePropertyCacheIndex,d=c.length,e;for(e=1;e<d;e++)if(c[e]>=b)return e-1;return-1}function j(a){b.each(a._propertyTracks,function(c,d){a._propertyTracks[d]=b.sortBy(a._propertyTracks[d],function(a){return a.millisecond})})}function k(a){b.each(a._timelinePropertyCaches,function(c,d){var e=l(a,+d);b.defaults(c,e)})}function l(a,c){var d={};return b.each(a._propertyTracks,function(a,e){var f=null;b.find(a,function(a){return a.millisecond>c?d[e]=f:a.millisecond===c&&(d[e]=a),f=a,!!d[e]});if(!d[e]){var g=b.last(a);g&&g.millisecond<=c&&(d[e]=g)}}),d}function m(a){b.each(a._propertyTracks,function(a,c){b.each(a,function(b,c){b.linkToNext(a[c+1])})})}function n(a,c,d){return b.find(a._propertyTracks[c],function(a){return a.millisecond===d})}function o(a){a._timelinePropertyCaches={},b.each(a._keyframeProperties,function(b){a._timelinePropertyCaches[b.millisecond]||(a._timelinePropertyCaches[b.millisecond]={}),a._timelinePropertyCaches[b.millisecond][b.name]=b},a),a._timelinePropertyCacheIndex=b.keys(a._timelinePropertyCaches),b.each(a._timelinePropertyCacheIndex,function(b,c){a._timelinePropertyCacheIndex[c]=+b},a),h(a._timelinePropertyCacheIndex),k(a),m(a)}"use strict";var f="linear",g=a.Kapi,p=g.Actor=function(a){return a=a||{},e.call(this),b.extend(this,{_data:{},_propertyTracks:{},_timelinePropertyCaches:{},_timelinePropertyCacheIndex:[],_keyframeProperties:{},id:b.uniqueId(),setup:a.setup||d,update:a.update||d,teardown:a.teardown||d}),a.context&&this.context(a.context),this},q=function(){};q.prototype=e.prototype,p.prototype=new q,p.prototype.context=function(a){return a&&(this._context=a),this._context},p.prototype.keyframe=function(d,e,h){var i;return h=h||f,typeof h=="string"&&(i=h,h={},b.each(e,function(a,b){h[b]=i})),b.each(e,function(a,b){h[b]=h[b]||f}),b.each(e,function(a,b){var c=new g.KeyframeProperty(this,d,b,a,h[b]);this._keyframeProperties[c.id]=c,this._propertyTracks[b]||(this._propertyTracks[b]=[]),this._propertyTracks[b].push(c),j(this)},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.getKeyframeProperty=function(a,b){if(this._propertyTracks[a]&&this._propertyTracks[a][b])return this._propertyTracks[a][b]},p.prototype.modifyKeyframeProperty=function(a,b,d){return this._propertyTracks[a]&&this._propertyTracks[a][b]&&this._propertyTracks[a][b].modifyWith(d),j(this),o(this),c(this.kapi),this},p.prototype.getTrackNames=function(){return b.keys(this._propertyTracks)},p.prototype.getTrackLength=function(a){if(!this._propertyTracks[a])return;return this._propertyTracks[a].length},p.prototype.copyProperties=function(a,c){var d={},e={};return b.each(this._propertyTracks,function(a,b){var f=n(this,b,c);f&&(d[b]=f.value,e[b]=f.easing)},this),this.keyframe(a,d,e),this},p.prototype.wait=function(a){var c=this.getEnd();if(a<=c)return this;var d=this.getEnd(),e=l(this,this.getEnd()),f={},g={};return b.each(e,function(a,b){f[b]=a.value,g[b]=a.easing}),this.removeKeyframe(d),this.keyframe(d,f,g),this.keyframe(a,f,g),this},p.prototype.getStart=function(){var a=[];return b.each(this._propertyTracks,function(b){b.length&&a.push(b[0].millisecond)}),a.length===0&&(a=[0]),Math.min.apply(Math,a)},p.prototype.getEnd=function(){var a=0;return b.each(this._propertyTracks,function(c){if(c.length){var d=b.last(c).millisecond;d>a&&(a=d)}},this),a},p.prototype.getLength=function(){return this.getEnd()-this.getStart()},p.prototype.hasKeyframeAt=function(a,c){var d=this._propertyTracks;if(c){if(!b.has(d,c))return!1;d=b.pick(d,c)}return b.find(d,function(b,c){return n(this,c,a)!==undefined},this)!==undefined},p.prototype.modifyKeyframe=function(a,c,d){return d=d||{},b.each(this._propertyTracks,function(b,e){var f=n(this,e,a);f&&f.modifyWith({value:c[e],easing:d[e]})},this),this},p.prototype.removeKeyframe=function(a){return b.each(this._propertyTracks,function(c,d){var e=-1,f=!1;b.find(c,function(b){return e++,f=a===b.millisecond,f});if(f){var g=c.splice(e,1)[0];g&&delete this._keyframeProperties[g.id]}},this),this.kapi&&c(this.kapi),o(this),this},p.prototype.removeAllKeyframeProperties=function(){return b.each(this._propertyTracks,function(a,b){a.length=0},this),this._keyframeProperties={},this.removeKeyframe(0)},p.prototype.updateState=function(a){var c=this.getStart(),d=this.getEnd();if(c<=a&&a<=d){var e=i(this,a),f=this._timelinePropertyCaches[this._timelinePropertyCacheIndex[e]],g={};b.each(f,function(b,c){b&&(g[c]=b.getValueAt(a))}),this.set(g)}return this},p.prototype.data=function(a){return a&&(this._data=a),this._data},p.prototype.exportTimeline=function(){var a={start:this.getStart(),end:this.getEnd(),trackNames:this.getTrackNames(),propertyTracks:{}};return b.each(this._propertyTracks,function(c,d){var e=a.propertyTracks[d]=[];b.each(c,function(a){e.push(a.exportPropertyData())})}),a}},g=function(a,b,c){"use strict";var d="linear",e=a.Kapi,f=e.KeyframeProperty=function(a,c,e,f,g){return this.id=b.uniqueId("keyframeProperty_"),this.ownerActor=a,this.millisecond=c,this.name=e,this.value=f,this.easing=g||d,this.nextProperty=null,this};f.prototype.modifyWith=function(a){var c={};b.each(["millisecond","easing","value"],function(b){c[b]=typeof a[b]=="undefined"?this[b]:a[b]},this),b.extend(this,c)},f.prototype.linkToNext=function(a){this.nextProperty=a||null},f.prototype.getValueAt=function(a){var b={},d={},e;if(this.nextProperty){b[this.name]=this.value,d[this.name]=this.nextProperty.value;var f=this.nextProperty.millisecond-this.millisecond,g=(a-this.millisecond)/f;e=c.util.interpolate(b,d,g,this.nextProperty.easing)[this.name]}else e=this.value;return e},f.prototype.exportPropertyData=function(){return{id:this.id,millisecond:this.millisecond,name:this.name,value:this.value,easing:this.easing}}},h=function(a,c){function e(a,b,c){return typeof c!="undefined"&&(a[b]=c,a.style[b]=c+"px"),a[b]}function f(a){a.config.clearOnUpdate&&a.canvasClear()}function g(a){b(a,"beforeDraw",c);var d=a._drawOrder.length,e;if(a._drawOrderSorter){var f=c.sortBy(a._canvasActors,a._drawOrderSorter);e=c.pluck(f,"id")}else e=a._drawOrder;var g,h,i;for(i=0;i<d;i++)g=a._canvasActors[e[i]],h=g.context(),g.draw(h,g.get());return b(a,"afterDraw",c),a}function h(a,b){b instanceof d.CanvasActor&&(a._drawOrder.push(b.id),a._canvasActors[b.id]=b)}function i(a,b){b instanceof d.CanvasActor&&(a._drawOrder=c.without(a._drawOrder,b.id),delete a._canvasActors[b.id])}"use strict";var d=a.Kapi;d.prototype._contextInitHook.canvas=function(){this._drawOrder=[],this._drawOrderSorter=null,this._canvasActors={},this.config.clearOnUpdate=!0,c.extend(this._events,{beforeDraw:[],afterDraw:[]}),c.each(["Height","Width"],function(a){var b=a.toLowerCase();this.config[b]&&(this["canvas"+a](this.config[b]),delete this.config[a])},this),this.on("afterUpdate",g),this.on("addActor",h),this.on("removeActor",i),this.on("beforeDraw",f)},d.prototype.canvasHeight=function(a){return e(this.context,"height",a)},d.prototype.canvasWidth=function(a){return e(this.context,"width",a)},d.prototype.canvasClear=function(){return this.context.getContext&&this.canvasContext().clearRect(0,0,this.canvasWidth(),this.canvasHeight()),this},d.prototype.canvasContext=function(){return this.context.getContext("2d")},d.prototype.redraw=function(){return g(this),this},d.prototype.moveActorToLayer=function(a,b){if(b<this._drawOrder.length)return this._drawOrder=c.without(this._drawOrder,a.id),this._drawOrder.splice(b,0,a.id),a;return},d.prototype.setOrderFunction=function(a){return this._drawOrderSorter=a,this},d.prototype.unsetOrderFunction=function(){return this._drawOrderSorter=null,this},d.prototype.exportTimeline=function(){var a={duration:this._animationLength,actorOrder:this._drawOrder.slice(0),actors:{}};return c.each(this._drawOrder,function(b){a.actors[b]=this._actors[b].exportTimeline()},this),a}},i=function(a,b){function e(){}"use strict";var c=a.Kapi;e.prototype=c.Actor.prototype;var f=c.CanvasActor=function(a){return c.Actor.call(this,a),a=a||{},this.draw=a.draw||d,this};f.prototype=new e,f.prototype.context=function(a){return a&&(this._context=a),this._context&&this._context.getContext("2d")},f.prototype.moveToLayer=function(a){return this.kapi.moveActorToLayer(this,a)}},j=function(a,b){function f(a,b,c){a.style[b]=c}function g(a){return b.contains(e,a)}function h(a,c){var d=[];return b.each(a,function(a){c[a]&&d.push(a+"("+c[a]+")")}),d.join(" ")}function i(a,c){b.each(d,function(b){f(a,b,c)})}function j(){}"use strict";var c=a.Kapi,d=["transform","webkitTransform","MozTransform","oTransform","msTransform"],e=["translateX","translateY","scale","scaleX","scaleY","rotate","skewX","skewY"];c.DOMActor=function(a){c.Actor.call(this),this._context=a;var b=this.getCSSName();return this._context.className.match(b)||(this._context.className+=" "+b),this._transformOrder=e.slice(0),delete this.update,delete this.teardown,this},j.prototype=c.Actor.prototype,c.DOMActor.prototype=new j,j.prototype.update=function(a,c){var d=b.keys(c),e=b.filter(d,g),j=b.reject(d,g),k=b.pick(c,j);if(e.length){var l=b.pick(c,e),m=h(this._transformOrder,l);i(a,m)}else c.transform&&i(a,c.transform);b.each(k,function(b,c){f(a,c,b)},this)},j.prototype.teardown=function(a,c){var d=this._context.className.match(/\S+/g),e=b.without(d,this.getCSSName());this._context.className=e},j.prototype.getCSSName=function(){return"actor-"+this.id},j.prototype.setTransformOrder=function(a){var c=b.reject(a,g);if(c.length)throw"Unknown or unsupported transform functions: "+c.join(", ");return this._transformOrder=b.uniq(a),this}},k=function(a,b){function i(a){return/rgb/.test(a)}function j(a){var c=["{"],d;return b.each(a.get(),function(a,b){d=a;var f=b;b==="transform"&&(f=e),c.push(f+":"+d+";")}),c.push("}"),c.join("")}function k(a,b){var c=a.getLength(),d=a.getStart(),e=[],f,g,h,i=c/b,k=Math.floor(i),l=c/100,m=d+i,n=c+d-i;a.updateState(d),e.push(" from "+j(a));var o;for(o=m;o<=n;o+=i)a.updateState(o),f=(o-d)/l,g=+f.toFixed(2),h=g+"% ",e.push(" "+h+j(a));return a.updateState(c+d),e.push(" to "+j(a)),e.join("\n")}function l(a,c,d){d=d||["w3"];var e=[];return b.each(d,function(b){var d=p(g,[f[b],c,a]),h=m(d,b);e.push(h)}),e.join("\n")}function m(a,b){var c=new RegExp(e,"g"),d=f[b]+"transform",g=a.replace(c,d);return g}function n(a,c,d){c=c||["w3"];var e=[],f;b.each(c,function(b){f=o(a,b,d),e.push(f)});var g=p(h,[d,e.join("\n")]);return g}function o(a,b,c){var d=[],e=f[b],g=a.getStart(),h=a.getEnd()-g;h=p(" %sanimation-duration: %sms;",[e,h]),d.push(h);var i=p(" %sanimation-name: %s;",[e,c+"-keyframes"]);d.push(i);var j=p(" %sanimation-delay: %sms;",[e,g]);d.push(j);var k=p(" %sanimation-fill-mode: forwards;",[e]);return d.push(k),d.join("\n")}"use strict";var c=a.Kapi,d=100,e="TRANSFORM",f=c.util.VENDOR_PREFIXES={microsoft:"-ms-",mozilla:"-moz-",opera:"-o-",w3:"",webkit:"-webkit-"},g=["@%skeyframes %s-keyframes {","%s","}"].join("\n"),h=[".%s {"," position: absolute;","%s","}"].join("\n");a.Kapi.prototype.toCSS=function(a){a=a||{};var c=[],d=this.getActorIds();return b.each(d,function(b){c.push(this.getActor(b).toCSS(a))},this),c.join("\n")},a.Kapi.Actor.prototype.toCSS=function(a){a=a||{};var b=[],c=a.name||this.getCSSName(),e=a.granularity||d,f=n(this,a.vendors,c);b.push(f);var g=k(this,e),h=l(g,c,a.vendors);return b.push(h),b.join("\n")};var p=c.util.printf=function(a,c){var d=a;return b.each(c,function(a){d=d.replace("%s",a)}),d}},l=function(a,b){"use strict";var c=b?{}:a,d=b&&b.underscore?b.underscore:c._,l=b&&b.Tweenable?b.Tweenable:c.Tweenable;return e(c,d,l),f(c,d,l),g(c,d,l),typeof j=="function"&&j(c,d,l),typeof k=="function"&&k(c,d,l),typeof h=="function"&&h(c,d,l),typeof i=="function"&&i(c,d,l),c.Kapi};if(typeof define=="function"&&define.amd){var m=typeof _!="undefined";define(["shifty","underscore"],function(b,c){var d=c!==null,e={Tweenable:b,underscore:d?c:_},f=l(a,e);return typeof KAPI_DEBUG!="undefined"&&KAPI_DEBUG===!0&&(f.underscore_version=e.underscore.VERSION),!m&&d&&(a._=undefined),f})}else l(typeof a!="undefined"?a:this)})(this)
View
2 version.txt
@@ -1 +1 @@
-0.9.8
+0.9.9

0 comments on commit c39ceaf

Please sign in to comment.
Something went wrong with that request. Please try again.