PageSourceSearch

https://phdguidancein.com/js/easing.js

js phdguidancein.com collected 2026-09-25 14:07:59 UTC 4,452 bytes, 130 lines download raw bytes

vendor: 4,452 bytes, lines 1-130
1
2// t: current time, b: begInnIng value, c: change In value, d: duration
3
4jQuery.extend( jQuery.easing,
5{
6	easeInQuad: function (x, t, b, c, d) {
7		return c*(t/=d)*t + b;
8	},
9	easeOutQuad: function (x, t, b, c, d) {
10		return -c *(t/=d)*(t-2) + b;
11	},
12	easeInOutQuad: function (x, t, b, c, d) {
13		if ((t/=d/2) < 1) return c/2*t*t + b;
14		return -c/2 * ((--t)*(t-2) - 1) + b;
15	},
16	easeInCubic: function (x, t, b, c, d) {
17		return c*(t/=d)*t*t + b;
18	},
19	easeOutCubic: function (x, t, b, c, d) {
20		return c*((t=t/d-1)*t*t + 1) + b;
21	},
22	easeInOutCubic: function (x, t, b, c, d) {
23		if ((t/=d/2) < 1) return c/2*t*t*t + b;
24		return c/2*((t-=2)*t*t + 2) + b;
25	},
26	easeInQuart: function (x, t, b, c, d) {
27		return c*(t/=d)*t*t*t + b;
28	},
29	easeOutQuart: function (x, t, b, c, d) {
30		return -c * ((t=t/d-1)*t*t*t - 1) + b;
31	},
32	easeInOutQuart: function (x, t, b, c, d) {
33		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
34		return -c/2 * ((t-=2)*t*t*t - 2) + b;
35	},
36	easeInQuint: function (x, t, b, c, d) {
37		return c*(t/=d)*t*t*t*t + b;
38	},
39	easeOutQuint: function (x, t, b, c, d) {
40		return c*((t=t/d-1)*t*t*t*t + 1) + b;
41	},
42	easeInOutQuint: function (x, t, b, c, d) {
43		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
44		return c/2*((t-=2)*t*t*t*t + 2) + b;
45	},
46	easeInSine: function (x, t, b, c, d) {
47		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
48	},
49	easeOutSine: function (x, t, b, c, d) {
50		return c * Math.sin(t/d * (Math.PI/2)) + b;
51	},
52	easeInOutSine: function (x, t, b, c, d) {
53		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
54	},
55	easeInExpo: function (x, t, b, c, d) {
56		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
57	},
58	easeOutExpo: function (x, t, b, c, d) {
59		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
60	},
61	easeInOutExpo: function (x, t, b, c, d) {
62		if (t==0) return b;
63		if (t==d) return b+c;
64		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
65		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
66	},
67	easeInCirc: function (x, t, b, c, d) {
68		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
69	},
70	easeOutCirc: function (x, t, b, c, d) {
71		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
72	},
73	easeInOutCirc: function (x, t, b, c, d) {
74		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
75		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
76	},
77	easeInElastic: function (x, t, b, c, d) {
78		var s=1.70158;var p=0;var a=c;
79		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
80		if (a < Math.abs(c)) { a=c; var s=p/4; }
81		else var s = p/(2*Math.PI) * Math.asin (c/a);
82		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
83	},
84	easeOutElastic: function (x, t, b, c, d) {
85		var s=1.70158;var p=0;var a=c;
86		if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
87		if (a < Math.abs(c)) { a=c; var s=p/4; }
88		else var s = p/(2*Math.PI) * Math.asin (c/a);
89		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
90	},
91	easeInOutElastic: function (x, t, b, c, d) {
92		var s=1.70158;var p=0;var a=c;
93		if (t==0) return b;  if ((t/=d/2)==2) return b+c;  if (!p) p=d*(.3*1.5);
94		if (a < Math.abs(c)) { a=c; var s=p/4; }
95		else var s = p/(2*Math.PI) * Math.asin (c/a);
96		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
97		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
98	},
99	easeInBack: function (x, t, b, c, d, s) {
100		if (s == undefined) s = 1.70158;
101		return c*(t/=d)*t*((s+1)*t - s) + b;
102	},
103	easeOutBack: function (x, t, b, c, d, s) {
104		if (s == undefined) s = 1.70158;
105		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
106	},
107	easeInOutBack: function (x, t, b, c, d, s) {
108		if (s == undefined) s = 1.70158; 
109		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
110		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
111	},
112	easeInBounce: function (x, t, b, c, d) {
113		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
114	},
115	easeOutBounce: function (x, t, b, c, d) {
116		if ((t/=d) < (1/2.75)) {
117			return c*(7.5625*t*t) + b;
118		} else if (t < (2/2.75)) {
119			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
120		} else if (t < (2.5/2.75)) {
121			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
122		} else {
123			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
124		}
125	},
126	easeInOutBounce: function (x, t, b, c, d) {
127		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
128		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
129	}
130});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.