Advanced Algorithms HW 8 (Martin Valgur)
HW8 / Graphs_web / students / BGU Social Networks Security Research Group_files / jquery.easing.1.3.js
1654 views/*1* jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/2*3* Uses the built in easing capabilities added In jQuery 1.14* to offer multiple easing options5*6* TERMS OF USE - jQuery Easing7*8* Open source under the BSD License.9*10* Copyright © 2008 George McGinley Smith11* All rights reserved.12*13* Redistribution and use in source and binary forms, with or without modification,14* are permitted provided that the following conditions are met:15*16* Redistributions of source code must retain the above copyright notice, this list of17* conditions and the following disclaimer.18* Redistributions in binary form must reproduce the above copyright notice, this list19* of conditions and the following disclaimer in the documentation and/or other materials20* provided with the distribution.21*22* Neither the name of the author nor the names of contributors may be used to endorse23* or promote products derived from this software without specific prior written permission.24*25* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY26* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF27* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE28* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,29* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE30* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED31* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING32* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED33* OF THE POSSIBILITY OF SUCH DAMAGE.34*35*/3637// t: current time, b: begInnIng value, c: change In value, d: duration38jQuery.easing['jswing'] = jQuery.easing['swing'];3940jQuery.extend( jQuery.easing,41{42def: 'easeOutQuad',43swing: function (x, t, b, c, d) {44//alert(jQuery.easing.default);45return jQuery.easing[jQuery.easing.def](x, t, b, c, d);46},47easeInQuad: function (x, t, b, c, d) {48return c*(t/=d)*t + b;49},50easeOutQuad: function (x, t, b, c, d) {51return -c *(t/=d)*(t-2) + b;52},53easeInOutQuad: function (x, t, b, c, d) {54if ((t/=d/2) < 1) return c/2*t*t + b;55return -c/2 * ((--t)*(t-2) - 1) + b;56},57easeInCubic: function (x, t, b, c, d) {58return c*(t/=d)*t*t + b;59},60easeOutCubic: function (x, t, b, c, d) {61return c*((t=t/d-1)*t*t + 1) + b;62},63easeInOutCubic: function (x, t, b, c, d) {64if ((t/=d/2) < 1) return c/2*t*t*t + b;65return c/2*((t-=2)*t*t + 2) + b;66},67easeInQuart: function (x, t, b, c, d) {68return c*(t/=d)*t*t*t + b;69},70easeOutQuart: function (x, t, b, c, d) {71return -c * ((t=t/d-1)*t*t*t - 1) + b;72},73easeInOutQuart: function (x, t, b, c, d) {74if ((t/=d/2) < 1) return c/2*t*t*t*t + b;75return -c/2 * ((t-=2)*t*t*t - 2) + b;76},77easeInQuint: function (x, t, b, c, d) {78return c*(t/=d)*t*t*t*t + b;79},80easeOutQuint: function (x, t, b, c, d) {81return c*((t=t/d-1)*t*t*t*t + 1) + b;82},83easeInOutQuint: function (x, t, b, c, d) {84if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;85return c/2*((t-=2)*t*t*t*t + 2) + b;86},87easeInSine: function (x, t, b, c, d) {88return -c * Math.cos(t/d * (Math.PI/2)) + c + b;89},90easeOutSine: function (x, t, b, c, d) {91return c * Math.sin(t/d * (Math.PI/2)) + b;92},93easeInOutSine: function (x, t, b, c, d) {94return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;95},96easeInExpo: function (x, t, b, c, d) {97return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;98},99easeOutExpo: function (x, t, b, c, d) {100return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;101},102easeInOutExpo: function (x, t, b, c, d) {103if (t==0) return b;104if (t==d) return b+c;105if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;106return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;107},108easeInCirc: function (x, t, b, c, d) {109return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;110},111easeOutCirc: function (x, t, b, c, d) {112return c * Math.sqrt(1 - (t=t/d-1)*t) + b;113},114easeInOutCirc: function (x, t, b, c, d) {115if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;116return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;117},118easeInElastic: function (x, t, b, c, d) {119var s=1.70158;var p=0;var a=c;120if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;121if (a < Math.abs(c)) { a=c; var s=p/4; }122else var s = p/(2*Math.PI) * Math.asin (c/a);123return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;124},125easeOutElastic: function (x, t, b, c, d) {126var s=1.70158;var p=0;var a=c;127if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;128if (a < Math.abs(c)) { a=c; var s=p/4; }129else var s = p/(2*Math.PI) * Math.asin (c/a);130return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;131},132easeInOutElastic: function (x, t, b, c, d) {133var s=1.70158;var p=0;var a=c;134if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);135if (a < Math.abs(c)) { a=c; var s=p/4; }136else var s = p/(2*Math.PI) * Math.asin (c/a);137if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;138return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;139},140easeInBack: function (x, t, b, c, d, s) {141if (s == undefined) s = 1.70158;142return c*(t/=d)*t*((s+1)*t - s) + b;143},144easeOutBack: function (x, t, b, c, d, s) {145if (s == undefined) s = 1.70158;146return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;147},148easeInOutBack: function (x, t, b, c, d, s) {149if (s == undefined) s = 1.70158;150if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;151return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;152},153easeInBounce: function (x, t, b, c, d) {154return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;155},156easeOutBounce: function (x, t, b, c, d) {157if ((t/=d) < (1/2.75)) {158return c*(7.5625*t*t) + b;159} else if (t < (2/2.75)) {160return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;161} else if (t < (2.5/2.75)) {162return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;163} else {164return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;165}166},167easeInOutBounce: function (x, t, b, c, d) {168if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;169return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;170}171});172173/*174*175* TERMS OF USE - EASING EQUATIONS176*177* Open source under the BSD License.178*179* Copyright © 2001 Robert Penner180* All rights reserved.181*182* Redistribution and use in source and binary forms, with or without modification,183* are permitted provided that the following conditions are met:184*185* Redistributions of source code must retain the above copyright notice, this list of186* conditions and the following disclaimer.187* Redistributions in binary form must reproduce the above copyright notice, this list188* of conditions and the following disclaimer in the documentation and/or other materials189* provided with the distribution.190*191* Neither the name of the author nor the names of contributors may be used to endorse192* or promote products derived from this software without specific prior written permission.193*194* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY195* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF196* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE197* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,198* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE199* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED200* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING201* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED202* OF THE POSSIBILITY OF SUCH DAMAGE.203*204*/205206