C_Tween.js 4.9 KB

123456
  1. // Licensed Materials - Property of IBM
  2. // IBM Cognos Products: hal
  3. // (C) Copyright IBM Corp. 2003, 2017.
  4. // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  5. function C_Tween(el, _hBJ1, _hYV1, _h931, _hSN1, _h5U1){C_Tween.baseConstructor.call(this, _h931, _hSN1);this._h0F2=el;this._h0K1=_hBJ1;this._hRX1=_hYV1;this._h432=(this._hRX1-this._h0K1);this._hSV1=_h5U1||(G_HAL.M_oLibraries["hal"]["useExponentialEasing"]?U_Easing.Exponential.F_EaseOut:U_Easing.Sine.F_EaseInOut);};C_Tween.F_Extends(C_TickableAnimation);C_Tween.prototype._hZV1=function(){return this.F_IsComplete()?this._hRX1:Math.round(this._hSV1(this._h7L1, this._h0K1, this._h432, this._hLD1));};C_Tween.prototype.F_GenerateArray=function(_hEE1){_hEE1=_hEE1||this._hLD1;var a=[];for(var _h2B2=0;_h2B2<(_hEE1-1);_h2B2++){a.push(Math.round(this._hSV1(_h2B2, this._h0K1, this._h432, _hEE1)));}a.push(this._hRX1);return a;};var U_Easing={Linear:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return((_h532*_h2B2)/ _hEE1)+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){return((_h532*_h2B2)/ _hEE1)+_hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){return((_h532*_h2B2)/ _hEE1)+_hOL1;}},Quadratic:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return(_h532*(_h2B2 /= _hEE1)*_h2B2)+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){return(-_h532*(_h2B2 /= _hEE1)*(_h2B2-2))+_hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){if((_h2B2 /=(_hEE1 / 2))<1){return((_h532 / 2)*_h2B2*_h2B2)+_hOL1;}return((-_h532 / 2)*(((--_h2B2)*(_h2B2 - 2))-1))+_hOL1;}},Cubic:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return(_h532*(_h2B2 /= _hEE1)* _h2B2*_h2B2)+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /= _hEE1;_h2B2--;return(_h532*(Math.pow(_h2B2, 3)+1))+ _hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){if((_h2B2 /=(_hEE1 / 2))<1){return(_h532 / 2*Math.pow(_h2B2, 3))+_hOL1;}return((_h532 / 2)*(((_h2B2-= 2)* _h2B2*_h2B2)+2))+ _hOL1;}},Quartic:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return(_h532*(_h2B2 /= _hEE1)*Math.pow(_h2B2, 3))+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /= _hEE1;_h2B2--;return(-_h532*(Math.pow(_h2B2, 4)-1))+_hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /=(_hEE1 / 2);if(_h2B2<1){return((_h532 / 2)*Math.pow(_h2B2, 4))+_hOL1;}_h2B2-= 2;return((-_h532 / 2)*(Math.pow(_h2B2, 4)-2))+_hOL1;}},Exponential:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return(_h2B2==0)?_hOL1:(_h532*Math.pow(2, 10*((_h2B2 / _hEE1)-1)))+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){return(_h2B2==_hEE1)?(_hOL1+_h532):_h532*(-Math.pow(2,(-10*_h2B2)/ _hEE1)+1)+ _hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /=(_hEE1 / 2);if(_h2B2<1){return(_h532 / 2*Math.pow(2, 10*(_h2B2-1)))+_hOL1;}return(_h532 / 2*(-Math.pow(2, -10*--_h2B2)+2))+ _hOL1;}},Circular:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /= _hEE1;return(-_h532*(Math.sqrt(1 -(_h2B2*_h2B2))-1))+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /= _hEE1;_h2B2--;return(_h532*Math.sqrt(1-(_h2B2*_h2B2)))+_hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){_h2B2 /=(_hEE1 / 2);if(_h2B2<1){return((-_h532 / 2)*(Math.sqrt(1 -(_h2B2*_h2B2))-1))+_hOL1;}_h2B2-= 2;return((_h532 / 2)*(Math.sqrt(1-(_h2B2*_h2B2))+1))+ _hOL1;}},Sine:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return(-_h532*Math.cos((_h2B2 / _hEE1)*(Math.PI / 2)))+_h532+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){return(_h532*Math.sin((_h2B2 / _hEE1)*(Math.PI / 2)))+_hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){return((-_h532 / 2)*(Math.cos((Math.PI*_h2B2)/ _hEE1)-1))+_hOL1;}},Back:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1,_hPL1){_hPL1=_hPL1||1.70158;return(_h532*(_h2B2 /= _hEE1)* _h2B2 *(((_hPL1+1)*_h2B2)-_hPL1))+ _hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1,_hPL1){_hPL1=_hPL1||1.70158;return(_h532*((_h2B2=(_h2B2 / _hEE1)-1)* _h2B2 *(((_hPL1+1)*_h2B2)+ _hPL1)+1))+ _hOL1;},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1,_hPL1){_hPL1=_hPL1||1.70158;if((_h2B2 /=(_hEE1 / 2))<1){return((_h532 / 2)*(_h2B2 * _h2B2 *((((_hPL1 *= 1.525)+1)*_h2B2)-_hPL1)))+ _hOL1;}return((_h532 / 2)*((_h2B2-= 2)* _h2B2 *((((_hPL1 *= 1.525)+1)*_h2B2)+ _hPL1)+2))+ _hOL1;}},Bounce:{F_EaseIn:function(_h2B2,_hOL1,_h532,_hEE1){return _h532-U_Easing.Bounce.F_EaseOut(_hEE1-_h2B2, 0, _h532, _hEE1)+_hOL1;},F_EaseOut:function(_h2B2,_hOL1,_h532,_hEE1){if((_h2B2 /= _hEE1)<(1 / 2.75)){return(_h532*(7.5625 * _h2B2*_h2B2))+_hOL1;}else if(_h2B2<(2 / 2.75)){return(_h532*((7.5625 *(_h2B2-=(1.5 / 2.75))*_h2B2)+0.75))+ _hOL1;}else if(_h2B2<(2.5 / 2.75)){return(_h532*((7.5625 *(_h2B2-=(2.25 / 2.75))*_h2B2)+0.9375))+ _hOL1;}else{return(_h532*((7.5625 *(_h2B2-=(2.625 / 2.75))*_h2B2)+0.984375))+ _hOL1;}},F_EaseInOut:function(_h2B2,_hOL1,_h532,_hEE1){if(_h2B2<(_hEE1 / 2)){return(U_Easing.Bounce.F_EaseIn(_h2B2*2, 0, _h532, _hEE1)*0.5)+_hOL1;}return(U_Easing.Bounce.F_EaseOut((_h2B2*2)-_hEE1, 0, _h532, _hEE1)* 0.5)+(_h532*0.5)+ _hOL1;}}};