]>
git.wh0rd.org - tt-rss.git/blob - lib/dojo/fx/easing.js
2 Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3 Available via Academic Free License >= 2.1 OR the modified BSD license.
4 see: http://dojotoolkit.org/license for details
8 if(!dojo
._hasResource
["dojo.fx.easing"]){
9 dojo
._hasResource
["dojo.fx.easing"]=true;
10 dojo
.provide("dojo.fx.easing");
11 dojo
.fx
.easing
={linear:function(n
){
15 },quadOut:function(n
){
17 },quadInOut:function(n
){
20 return Math
.pow(n
,2)/2;
22 return -1*((--n
)*(n
-2)-1)/2;
23 },cubicIn:function(n
){
25 },cubicOut:function(n
){
26 return Math
.pow(n
-1,3)+1;
27 },cubicInOut:function(n
){
30 return Math
.pow(n
,3)/2;
33 return (Math
.pow(n
,3)+2)/2;
34 },quartIn:function(n
){
36 },quartOut:function(n
){
37 return -1*(Math
.pow(n
-1,4)-1);
38 },quartInOut:function(n
){
41 return Math
.pow(n
,4)/2;
44 return -1/2*(Math
.pow(n
,4)-2);
45 },quintIn:function(n
){
47 },quintOut:function(n
){
48 return Math
.pow(n
-1,5)+1;
49 },quintInOut:function(n
){
52 return Math
.pow(n
,5)/2;
55 return (Math
.pow(n
,5)+2)/2;
57 return -1*Math
.cos(n
*(Math
.PI
/2))+1;
58 },sineOut:function(n
){
59 return Math
.sin(n
*(Math
.PI
/2));
60 },sineInOut:function(n
){
61 return -1*(Math
.cos(Math
.PI
*n
)-1)/2;
63 return (n
==0)?0:Math
.pow(2,10*(n
-1));
64 },expoOut:function(n
){
65 return (n
==1)?1:(-1*Math
.pow(2,-10*n
)+1);
66 },expoInOut:function(n
){
75 return Math
.pow(2,10*(n
-1))/2;
78 return (-1*Math
.pow(2,-10*n
)+2)/2;
80 return -1*(Math
.sqrt(1-Math
.pow(n
,2))-1);
81 },circOut:function(n
){
83 return Math
.sqrt(1-Math
.pow(n
,2));
84 },circInOut:function(n
){
87 return -1/2*(Math
.sqrt(1-Math
.pow(n
,2))-1);
90 return 1/2*(Math
.sqrt(1-Math
.pow(n
,2))+1);
93 return Math
.pow(n
,2)*((s
+1)*n
-s
);
94 },backOut:function(n
){
97 return Math
.pow(n
,2)*((s
+1)*n
+s
)+1;
98 },backInOut:function(n
){
102 return (Math
.pow(n
,2)*((s
+1)*n
-s
))/2;
105 return (Math
.pow(n
,2)*((s
+1)*n
+s
)+2)/2;
106 },elasticIn:function(n
){
113 return -1*Math
.pow(2,10*n
)*Math
.sin((n
-s
)*(2*Math
.PI
)/p
);
114 },elasticOut:function(n
){
120 return Math
.pow(2,-10*n
)*Math
.sin((n
-s
)*(2*Math
.PI
)/p
)+1;
121 },elasticInOut:function(n
){
133 return -0.5*(Math
.pow(2,10*n
)*Math
.sin((n
-s
)*(2*Math
.PI
)/p
));
136 return 0.5*(Math
.pow(2,-10*n
)*Math
.sin((n
-s
)*(2*Math
.PI
)/p
))+1;
137 },bounceIn:function(n
){
138 return (1-dojo
.fx
.easing
.bounceOut(1-n
));
139 },bounceOut:function(n
){
148 l
=s
*Math
.pow(n
,2)+0.75;
152 l
=s
*Math
.pow(n
,2)+0.9375;
155 l
=s
*Math
.pow(n
,2)+0.984375;
160 },bounceInOut:function(n
){
162 return dojo
.fx
.easing
.bounceIn(n
*2)/2;
164 return (dojo
.fx
.easing
.bounceOut(n
*2-1)/2)+0.5;