parallaxis/quartet/js/TimelineLite.min.js

30 lines
9.1 KiB
JavaScript
Executable File

/**
* VERSION: beta 1.641
* DATE: 2012-11-08
* JavaScript (ActionScript 3 and 2 also available)
* UPDATES AND DOCS AT: http://www.greensock.com
*
* Copyright (c) 2008-2013, GreenSock. All rights reserved.
* This work is subject to the terms in http://www.greensock.com/terms_of_use.html or for
* Club GreenSock members, the software agreement that was issued with your membership.
*
* @author: Jack Doyle, jack@greensock.com
**/
(window._gsQueue||(window._gsQueue=[])).push(function(){_gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(m,j,g){var h=function(b){j.call(this,b);this._labels={};this.autoRemoveChildren=!0==this.vars.autoRemoveChildren;this.smoothChildTiming=!0==this.vars.smoothChildTiming;this._sortChildren=!0;this._onUpdate=this.vars.onUpdate;for(var b=n.length,c,a;-1<--b;)if(a=this.vars[n[b]])for(c=a.length;-1<--c;)"{self}"===a[c]&&(a=this.vars[n[b]]=a.concat(),a[c]=this);this.vars.tweens instanceof
Array&&this.insertMultiple(this.vars.tweens,0,this.vars.align||"normal",this.vars.stagger||0)},n=["onStartParams","onUpdateParams","onCompleteParams","onReverseCompleteParams","onRepeatParams"],p=[],q=function(b){var c={},a;for(a in b)c[a]=b[a];return c},d=h.prototype=new j;h.version=1.641;d.constructor=h;d.kill()._gc=!1;d.to=function(b,c,a,f,e){return this.insert(new g(b,c,a),this._parseTimeOrLabel(e,f,!0))};d.from=function(b,c,a,f,e){return this.insert(g.from(b,c,a),this._parseTimeOrLabel(e,f,!0))};
d.fromTo=function(b,c,a,f,e,d){return this.insert(g.fromTo(b,c,a,f),this._parseTimeOrLabel(d,e,!0))};d.staggerTo=function(b,c,a,f,e,d,i,k,r){i=new h({onComplete:i,onCompleteParams:k,onCompleteScope:r});f=f||0;for(k=0;k<b.length;k++)null!=a.startAt&&(a.startAt=q(a.startAt)),i.insert(new g(b[k],c,q(a)),k*f);return this.insert(i,this._parseTimeOrLabel(d,e,!0))};d.staggerFrom=function(b,c,a,f,e,d,i,k,g){null==a.immediateRender&&(a.immediateRender=!0);a.runBackwards=!0;return this.staggerTo(b,c,a,f,e,
d,i,k,g)};d.staggerFromTo=function(b,c,a,f,e,d,i,k,g,h){f.startAt=a;a.immediateRender&&(f.immediateRender=!0);return this.staggerTo(b,c,f,e,d,i,k,g,h)};d.call=function(b,c,a,f,e){return this.insert(g.delayedCall(0,b,c,a),this._parseTimeOrLabel(e,f,!0))};d.set=function(b,c,a,f){c.immediateRender=!1;return this.insert(new g(b,0,c),this._parseTimeOrLabel(f,a,!0))};h.exportRoot=function(b,c){b=b||{};null==b.smoothChildTiming&&(b.smoothChildTiming=!0);var a=new h(b),f=a._timeline;null==c&&(c=!0);f._remove(a,
!0);a._startTime=0;a._rawPrevTime=a._time=a._totalTime=f._time;for(var e=f._first,d;e;)d=e._next,(!c||!(e instanceof g&&e.target===e.vars.onComplete))&&a.insert(e,e._startTime-e._delay),e=d;f.insert(a,0);return a};d.insert=function(b,c){if(!(b instanceof m)){if(b instanceof Array)return this.insertMultiple(b,c);if("string"===typeof b)return this.addLabel(b,this._parseTimeOrLabel(c||0,0,!0));if("function"===typeof b)b=g.delayedCall(0,b);else throw"ERROR: Cannot insert() "+b+" into the TimelineLite/Max because it is neither a tween, timeline, function, nor a String.";
}j.prototype.insert.call(this,b,this._parseTimeOrLabel(c||0,0,!0));if(this._gc&&!this._paused&&this._time===this._duration&&this._time<this.duration())for(var a=this;a._gc&&a._timeline;)a._timeline.smoothChildTiming?a.totalTime(a._totalTime,!0):a._enabled(!0,!1),a=a._timeline;return this};d.remove=function(b){if(b instanceof m)return this._remove(b,!1);if(b instanceof Array){for(var c=b.length;-1<--c;)this.remove(b[c]);return this}return"string"===typeof b?this.removeLabel(b):this.kill(null,b)};d.append=
function(b,c){return this.insert(b,this._parseTimeOrLabel(null,c,!0))};d.insertMultiple=function(b,c,a,f){for(var a=a||"normal",f=f||0,e,d=this._parseTimeOrLabel(c||0,0,!0),i=b.length,c=0;c<i;c++){if((e=b[c])instanceof Array)e=new h({tweens:e});this.insert(e,d);"string"===typeof e||"function"===typeof e||("sequence"===a?d=e._startTime+e.totalDuration()/e._timeScale:"start"===a&&(e._startTime-=e.delay()));d+=f}return this._uncache(!0)};d.appendMultiple=function(b,c,a,f){return this.insertMultiple(b,
this._parseTimeOrLabel(null,c,!0),a,f)};d.addLabel=function(b,c){this._labels[b]=c;return this};d.removeLabel=function(b){delete this._labels[b];return this};d.getLabelTime=function(b){return null!=this._labels[b]?this._labels[b]:-1};d._parseTimeOrLabel=function(b,c,a){if("string"===typeof c)return this._parseTimeOrLabel(c,a&&"number"===typeof b&&null==this._labels[c]?b-this.duration():0,a);c=c||0;return null==b?this.duration()+c:"string"===typeof b&&isNaN(b)?null==this._labels[b]?a?this._labels[b]=
this.duration()+c:c:this._labels[b]+c:Number(b)+c};d.seek=function(b,c){return this.totalTime(this._parseTimeOrLabel(b),!1!=c)};d.stop=function(){return this.paused(!0)};d.gotoAndPlay=function(b,c){return j.prototype.play.call(this,b,c)};d.gotoAndStop=function(b,c){return this.pause(b,c)};d.render=function(b,c,a){this._gc&&this._enabled(!0,!1);this._active=!this._paused;var f=!this._dirty?this._totalDuration:this.totalDuration(),e=this._time,d=this._startTime,i=this._timeScale,g=this._paused,h,j,
l;if(b>=f){this._totalTime=this._time=f;if(!this._reversed&&!this._hasPausedChild()&&(h=!0,l="onComplete",0===this._duration&&(0===b||0>this._rawPrevTime)))this._rawPrevTime!==b&&(a=!0);this._rawPrevTime=b;b=f+1E-6}else if(0>=b){this._totalTime=this._time=0;if(0!==e||0===this._duration&&0<this._rawPrevTime)l="onReverseComplete",h=this._reversed;0>b?(this._active=!1,0===this._duration&&0<=this._rawPrevTime&&(a=!0)):this._initted||(a=!0);this._rawPrevTime=b;b=-1E-6}else this._totalTime=this._time=this._rawPrevTime=
b;if(this._time!==e||a){this._initted||(this._initted=!0);0===e&&this.vars.onStart&&0!==this._time&&(c||this.vars.onStart.apply(this.vars.onStartScope||this,this.vars.onStartParams||p));if(this._time>e)for(a=this._first;a;){j=a._next;if(this._paused&&!g)break;else if(a._active||a._startTime<=this._time&&!a._paused&&!a._gc)a._reversed?a.render((!a._dirty?a._totalDuration:a.totalDuration())-(b-a._startTime)*a._timeScale,c,!1):a.render((b-a._startTime)*a._timeScale,c,!1);a=j}else for(a=this._last;a;){j=
a._prev;if(this._paused&&!g)break;else if(a._active||a._startTime<=e&&!a._paused&&!a._gc)a._reversed?a.render((!a._dirty?a._totalDuration:a.totalDuration())-(b-a._startTime)*a._timeScale,c,!1):a.render((b-a._startTime)*a._timeScale,c,!1);a=j}this._onUpdate&&(c||this._onUpdate.apply(this.vars.onUpdateScope||this,this.vars.onUpdateParams||p));if(l&&!this._gc&&(d===this._startTime||i!=this._timeScale))if(0===this._time||f>=this.totalDuration())h&&(this._timeline.autoRemoveChildren&&this._enabled(!1,
!1),this._active=!1),c||this.vars[l]&&this.vars[l].apply(this.vars[l+"Scope"]||this,this.vars[l+"Params"]||p)}};d._hasPausedChild=function(){for(var b=this._first;b;){if(b._paused||b instanceof h&&b._hasPausedChild())return!0;b=b._next}return!1};d.getChildren=function(b,c,a,f){for(var f=f||-9999999999,e=[],d=this._first,i=0;d;)d._startTime<f||(d instanceof g?!1!=c&&(e[i++]=d):(!1!=a&&(e[i++]=d),!1!=b&&(e=e.concat(d.getChildren(!0,c,a)),i=e.length))),d=d._next;return e};d.getTweensOf=function(b,c){for(var a=
g.getTweensOf(b),d=a.length,e=[],h=0;-1<--d;)if(a[d].timeline===this||c&&this._contains(a[d]))e[h++]=a[d];return e};d._contains=function(b){for(b=b.timeline;b;){if(b===this)return!0;b=b.timeline}return!1};d.shiftChildren=function(b,c,a){for(var a=a||0,d=this._first;d;)d._startTime>=a&&(d._startTime+=b),d=d._next;if(c)for(var e in this._labels)this._labels[e]>=a&&(this._labels[e]+=b);return this._uncache(!0)};d._kill=function(b,c){if(null==b&&null==c)return this._enabled(!1,!1);for(var a=null==c?this.getChildren(!0,
!0,!1):this.getTweensOf(c),d=a.length,e=!1;-1<--d;)a[d]._kill(b,c)&&(e=!0);return e};d.clear=function(b){var c=this.getChildren(!1,!0,!0),a=c.length;for(this._time=this._totalTime=0;-1<--a;)c[a]._enabled(!1,!1);!1!=b&&(this._labels={});return this._uncache(!0)};d.invalidate=function(){for(var b=this._first;b;)b.invalidate(),b=b._next;return this};d._enabled=function(b,c){if(b===this._gc)for(var a=this._first;a;)a._enabled(b,!0),a=a._next;return j.prototype._enabled.call(this,b,c)};d.progress=function(b){return!arguments.length?
this._time/this.duration():this.totalTime(this.duration()*b,!1)};d.duration=function(b){if(!arguments.length)return this._dirty&&this.totalDuration(),this._duration;0!==this.duration()&&0!==b&&this.timeScale(this._duration/b);return this};d.totalDuration=function(b){if(!arguments.length){if(this._dirty){for(var c=0,a=this._first,d=-999999999999,e;a;)e=a._next,a._startTime<d&&this._sortChildren?this.insert(a,a._startTime-a._delay):d=a._startTime,0>a._startTime&&(c-=a._startTime,this.shiftChildren(-a._startTime,
!1,-9999999999)),a=a._startTime+(!a._dirty?a._totalDuration:a.totalDuration())/a._timeScale,a>c&&(c=a),a=e;this._duration=this._totalDuration=c;this._dirty=!1}return this._totalDuration}0!==this.totalDuration()&&0!==b&&this.timeScale(this._totalDuration/b);return this};d.usesFrames=function(){for(var b=this._timeline;b._timeline;)b=b._timeline;return b===m._rootFramesTimeline};d.rawTime=function(){return this._paused||0!==this._totalTime&&this._totalTime!==this._totalDuration?this._totalTime:(this._timeline.rawTime()-
this._startTime)*this._timeScale};return h},!0)});window._gsDefine&&_gsQueue.pop()();