File tree 3 files changed +267
-273
lines changed
3 files changed +267
-273
lines changed Original file line number Diff line number Diff line change 1
1
export function currentAnimationTimeMillis ( ) {
2
- return Date . now ( ) ;
2
+ return Date . now ( ) ;
3
3
}
Original file line number Diff line number Diff line change @@ -4,26 +4,26 @@ const VISCOUS_FLUID_SCALE = 8;
4
4
const VISCOUS_FLUID_NORMALIZE = 1 / viscousFluid ( 1 ) ;
5
5
const VISCOUS_FLUID_OFFSET = 1 - VISCOUS_FLUID_NORMALIZE * viscousFluid ( 1 ) ;
6
6
7
- function viscousFluid ( x ) {
8
- x *= VISCOUS_FLUID_SCALE ;
9
- if ( x < 1 ) {
10
- x -= ( 1 - Math . exp ( - x ) ) ;
11
- } else {
12
- var start = 0.36787944117 ; // 1/e == exp(-1)
13
- x = 1 - Math . exp ( 1 - x ) ;
14
- x = start + x * ( 1 - start ) ;
15
- }
16
- return x ;
7
+ function viscousFluid ( x ) {
8
+ x *= VISCOUS_FLUID_SCALE ;
9
+ if ( x < 1 ) {
10
+ x -= ( 1 - Math . exp ( - x ) ) ;
11
+ } else {
12
+ var start = 0.36787944117 ; // 1/e == exp(-1)
13
+ x = 1 - Math . exp ( 1 - x ) ;
14
+ x = start + x * ( 1 - start ) ;
15
+ }
16
+ return x ;
17
17
}
18
18
19
19
const ViscousFluidInterpolator = {
20
- getInterpolation : function ( input ) {
21
- var interpolated = VISCOUS_FLUID_NORMALIZE * viscousFluid ( input ) ;
22
- if ( interpolated > 0 ) {
23
- return interpolated + VISCOUS_FLUID_OFFSET ;
20
+ getInterpolation : function ( input ) {
21
+ var interpolated = VISCOUS_FLUID_NORMALIZE * viscousFluid ( input ) ;
22
+ if ( interpolated > 0 ) {
23
+ return interpolated + VISCOUS_FLUID_OFFSET ;
24
+ }
25
+ return interpolated ;
24
26
}
25
- return interpolated ;
26
- }
27
- }
27
+ } ;
28
28
29
29
export default ViscousFluidInterpolator ;
You can’t perform that action at this time.
0 commit comments