|
@@ -7,6 +7,10 @@ type VariantProps = {
|
7
|
7
|
delay: number;
|
8
|
8
|
};
|
9
|
9
|
|
|
10
|
+type NudgedVariantProps = VariantProps & {
|
|
11
|
+ nudge: number;
|
|
12
|
+ };
|
|
13
|
+
|
10
|
14
|
const starVariants: Variants = {
|
11
|
15
|
"1": (props: VariantProps) => ({
|
12
|
16
|
rotate: 360,
|
|
@@ -14,21 +18,21 @@ const starVariants: Variants = {
|
14
|
18
|
transition: {
|
15
|
19
|
duration: 2,
|
16
|
20
|
repeat: 0,
|
17
|
|
- delay: props.delay,
|
|
21
|
+ delay: 1.5 + props.delay,
|
18
|
22
|
},
|
19
|
23
|
}),
|
20
|
24
|
"2": (props: VariantProps) => ({
|
21
|
|
- scale: 3,
|
|
25
|
+ scale: 10,
|
22
|
26
|
x: props.delay,
|
23
|
27
|
rotate: props.delay + 365 * 2,
|
24
|
28
|
transition: {
|
25
|
|
- duration: 1,
|
|
29
|
+ duration: 1.5,
|
26
|
30
|
repeat: 0,
|
27
|
31
|
delay: props.delay,
|
28
|
32
|
},
|
29
|
33
|
}),
|
30
|
34
|
"3": (props: VariantProps) => ({
|
31
|
|
- scale: 3,
|
|
35
|
+ scale: 10,
|
32
|
36
|
rotate: props.delay + 365 * 3,
|
33
|
37
|
transition: {
|
34
|
38
|
duration: 6,
|
|
@@ -39,31 +43,38 @@ const starVariants: Variants = {
|
39
|
43
|
}),
|
40
|
44
|
};
|
41
|
45
|
|
42
|
|
-const textAreaVariants: Variants = {
|
43
|
|
- "1": {
|
44
|
|
- opacity: 1,
|
45
|
|
- width: "80%",
|
46
|
|
- height: "80%",
|
|
46
|
+const letterVariants: Variants = {
|
|
47
|
+ "1": (props: NudgedVariantProps) => ({
|
|
48
|
+ rotate: (360 - 45) * props.nudge,
|
|
49
|
+ scale: 4,
|
47
|
50
|
transition: {
|
48
|
|
- duration: 0.5,
|
|
51
|
+ duration: 2,
|
|
52
|
+ ease: 'easeOut',
|
|
53
|
+ delay: 1.5 + props.delay,
|
49
|
54
|
},
|
50
|
|
- },
|
51
|
|
- "2": {
|
52
|
|
- opacity: 1,
|
53
|
|
- width: "80%",
|
54
|
|
- height: "80%",
|
|
55
|
+ }),
|
|
56
|
+ "2": (props: NudgedVariantProps) => ({
|
|
57
|
+ rotate: 360 * props.nudge,
|
|
58
|
+ x: -props.nudge * 19,
|
|
59
|
+ z:0.1,
|
|
60
|
+ scale: 4,
|
55
|
61
|
transition: {
|
56
|
|
- duration: 1.5,
|
|
62
|
+ duration: 2,
|
|
63
|
+ ease: 'easeInOut',
|
|
64
|
+ delay: props.delay,
|
57
|
65
|
},
|
58
|
|
- },
|
59
|
|
- "3": {
|
60
|
|
- opacity: 1,
|
61
|
|
- width: "80%",
|
62
|
|
- height: "80%",
|
|
66
|
+ }),
|
|
67
|
+ "3": (props: NudgedVariantProps) => ({
|
|
68
|
+ rotate: 361 * props.nudge,
|
|
69
|
+ x: -props.nudge * 20,
|
|
70
|
+ scale: 4,
|
|
71
|
+ z:0.2,
|
63
|
72
|
transition: {
|
64
|
|
- duration: 1,
|
|
73
|
+ duration: 6,
|
|
74
|
+ ease: 'easeInOut',
|
|
75
|
+ delay: props.delay,
|
65
|
76
|
},
|
66
|
|
- },
|
|
77
|
+ }),
|
67
|
78
|
};
|
68
|
79
|
|
69
|
80
|
type RunningAnimations = {
|
|
@@ -113,11 +124,34 @@ function Welcome({ progress }: StepProps) {
|
113
|
124
|
onAnimationComplete={() => animationComplete(starVariant)}
|
114
|
125
|
>
|
115
|
126
|
<div style={{ width: "800px", height: "800px" }}>
|
116
|
|
- <Masked mask="Star" style={starStyle} />
|
|
127
|
+ <Masked mask="Square" style={starStyle} />
|
117
|
128
|
</div>
|
118
|
129
|
</motion.div>
|
119
|
130
|
))}
|
120
|
131
|
|
|
132
|
+ <motion.div
|
|
133
|
+ style={{
|
|
134
|
+ display: "flex",
|
|
135
|
+ position: "absolute",
|
|
136
|
+ }}
|
|
137
|
+ >
|
|
138
|
+ <motion.div
|
|
139
|
+ variants={letterVariants}
|
|
140
|
+ animate={starVariant}
|
|
141
|
+ custom={{ delay: 0, nudge: 1 }}
|
|
142
|
+ style={letterStyle}
|
|
143
|
+ >
|
|
144
|
+ 2
|
|
145
|
+ </motion.div>
|
|
146
|
+ <motion.div
|
|
147
|
+ variants={letterVariants}
|
|
148
|
+ animate={starVariant}
|
|
149
|
+ custom={{ delay: 0.1, nudge: -1 }}
|
|
150
|
+ style={letterStyle}
|
|
151
|
+ >
|
|
152
|
+ 4
|
|
153
|
+ </motion.div>
|
|
154
|
+ </motion.div>
|
121
|
155
|
</div>
|
122
|
156
|
);
|
123
|
157
|
}
|
|
@@ -148,5 +182,9 @@ const starStyle = {
|
148
|
182
|
"radial-gradient(circle at center center,rgb(95, 247, 68),rgb(247, 255, 19)), repeating-radial-gradient(circle at center center,rgb(0, 255, 140),rgb(77, 247, 68), 10px, transparent 90px, transparent 10px)",
|
149
|
183
|
};
|
150
|
184
|
|
|
185
|
+const letterStyle = {
|
|
186
|
+ scale: 0,
|
|
187
|
+ fontSize: "3em"
|
|
188
|
+};
|
151
|
189
|
|
152
|
190
|
export default Welcome;
|