Skip to content
This repository was archived by the owner on Aug 19, 2022. It is now read-only.

Commit bd8f036

Browse files
author
Brandon Dail
committed
Add zoomInUp animation
Also fixes a cubic-bezier value in the other zoom animations
1 parent dff4ab1 commit bd8f036

File tree

5 files changed

+45
-3
lines changed

5 files changed

+45
-3
lines changed

src/components/zoomInDown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const zoomInDown: Animation = {
3131
),
3232
animationTimingFunction: cubicBezier(
3333
0.175,
34-
0.855,
34+
0.885,
3535
0.320,
3636
1
3737
),

src/components/zoomInLeft.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const zoomInLeft: Animation = {
3131
),
3232
animationTimingFunction: cubicBezier(
3333
0.175,
34-
0.855,
34+
0.885,
3535
0.320,
3636
1
3737
),

src/components/zoomInRight.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const zoomInRight: Animation = {
3131
),
3232
animationTimingFunction: cubicBezier(
3333
0.175,
34-
0.855,
34+
0.885,
3535
0.320,
3636
1
3737
),

src/components/zoomInUp.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// @flow
2+
import {
3+
compose,
4+
scale3d,
5+
translate3d,
6+
cubicBezier,
7+
} from '../utils';
8+
import type { Animation } from '../types';
9+
10+
const scaleAndTranslate = compose(scale3d, translate3d);
11+
12+
const zoomInUp: Animation = {
13+
from: {
14+
opacity: 0,
15+
transform: scaleAndTranslate(
16+
[0.1, 0.1, 0.1],
17+
[0, '1000px', 0]
18+
),
19+
animationTimingFunction: cubicBezier(
20+
0.550,
21+
0.055,
22+
0.675,
23+
0.190
24+
),
25+
},
26+
'60%': {
27+
opacity: 1,
28+
transform: scaleAndTranslate(
29+
[0.475, 0.475, 0.475],
30+
[0, '-60px', 0]
31+
),
32+
animationTimingFunction: cubicBezier(
33+
0.175,
34+
0.885,
35+
0.320,
36+
1
37+
),
38+
},
39+
};
40+
41+
export default zoomInUp;

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,3 +96,4 @@ export zoomIn from './components/zoomIn';
9696
export zoomInDown from './components/zoomInDown';
9797
export zoomInLeft from './components/zoomInLeft';
9898
export zoomInRight from './components/zoomInRight';
99+
export zoomInUp from './components/zoomInUp';

0 commit comments

Comments
 (0)