-
-
Notifications
You must be signed in to change notification settings - Fork 238
/
AnimatedShapes.tsx
304 lines (293 loc) 路 9.18 KB
/
AnimatedShapes.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
import { animated } from "react-spring";
import { useFloatAnimation } from "./useFloatAnimation";
const Box = () => {
const style = useFloatAnimation("float-mid");
return (
<animated.svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="top-left"
style={style}
>
<g stroke="var(--theme-blue)" className="three-d-box">
<line
x1="101.834"
y1="297.925"
x2="192.834"
y2="202.925"
strokeWidth="6"
/>
<line
x1="299.834"
y1="298.925"
x2="390.834"
y2="203.925"
strokeWidth="6"
/>
<line
x1="301.834"
y1="494.925"
x2="392.834"
y2="399.925"
strokeWidth="6"
/>
<line
x1="104.834"
y1="491.925"
x2="195.834"
y2="396.925"
strokeWidth="6"
/>
<rect
x="103"
y="297"
width="200"
height="197"
fill="none"
strokeWidth="6"
/>
<rect
x="192"
y="204"
width="200"
height="197"
fill="none"
strokeWidth="6"
/>
</g>
</animated.svg>
);
};
const Donut = () => {
const style = useFloatAnimation("float-hi", -2500);
return (
<animated.svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="top-left"
style={style}
>
<circle
className="donut"
cx="474.5"
cy="350.5"
r="12"
strokeWidth="40"
stroke="var(--theme-blue)"
/>
</animated.svg>
);
};
const CenterText = () => {
const style = useFloatAnimation("float-mid", 1000);
return (
<svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="center valtio"
>
<animated.path
d="M773.98 485.864H732.964L695.251 607.419H693.547L655.94 485.864H614.818L673.092 649.5H715.706L773.98 485.864ZM825.067 652.803C850.742 652.803 866.083 640.764 873.114 627.021H874.393V649.5H911.467V539.983C911.467 496.73 876.204 483.733 844.989 483.733C810.579 483.733 784.158 499.074 775.636 528.903L811.644 534.017C815.479 522.831 826.346 513.243 845.202 513.243C863.1 513.243 872.901 522.405 872.901 538.491V539.131C872.901 550.21 861.289 550.743 832.418 553.832C800.671 557.241 770.309 566.723 770.309 603.584C770.309 635.757 793.853 652.803 825.067 652.803ZM835.082 624.464C818.995 624.464 807.489 617.114 807.489 602.945C807.489 588.136 820.38 581.957 837.638 579.507C847.759 578.122 868.001 575.565 873.008 571.517V590.8C873.008 609.017 858.306 624.464 835.082 624.464ZM970.81 431.318H932.245V649.5H970.81V431.318ZM1074.18 485.864H1041.9V446.659H1003.33V485.864H980.11V515.693H1003.33V606.673C1003.12 637.462 1025.49 652.589 1054.47 651.737C1065.44 651.418 1073.01 649.287 1077.16 647.902L1070.66 617.753C1068.53 618.286 1064.17 619.244 1059.37 619.244C1049.68 619.244 1041.9 615.835 1041.9 600.281V515.693H1074.18V485.864ZM1088.43 649.5H1127V485.864H1088.43V649.5ZM1107.82 462.639C1120.07 462.639 1130.09 453.264 1130.09 441.759C1130.09 430.146 1120.07 420.771 1107.82 420.771C1095.46 420.771 1085.45 430.146 1085.45 441.759C1085.45 453.264 1095.46 462.639 1107.82 462.639ZM1220.03 652.696C1267.97 652.696 1298.44 618.925 1298.44 568.321C1298.44 517.611 1267.97 483.733 1220.03 483.733C1172.09 483.733 1141.62 517.611 1141.62 568.321C1141.62 618.925 1172.09 652.696 1220.03 652.696ZM1220.25 621.801C1193.72 621.801 1180.72 598.151 1180.72 568.214C1180.72 538.278 1193.72 514.308 1220.25 514.308C1246.35 514.308 1259.34 538.278 1259.34 568.214C1259.34 598.151 1246.35 621.801 1220.25 621.801Z"
fill="var(--theme-blue)"
style={style}
/>
</svg>
);
};
const Circle = () => {
const style = useFloatAnimation("float-hi", -2000);
return (
<svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="top-right"
>
<animated.circle
className="fast-circle"
cx="1338"
cy="209"
r="84"
strokeWidth="6"
stroke="var(--theme-blue)"
style={style}
/>
</svg>
);
};
const DotGrid = () => {
const style = useFloatAnimation("float-hi", -1000);
return (
<animated.svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="top-right"
style={style}
>
<g stroke="var(--theme-blue)">
<g className="dot-grid">
<circle cx="907.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="907.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="907.5" cy="315.5" r="3" strokeWidth="15" />
<circle cx="1025.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="1025.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="1025.5" cy="315.5" r="3" strokeWidth="15" />
<circle cx="1143.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="1143.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="1143.5" cy="315.5" r="3" strokeWidth="15" />
<circle cx="1261.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="1261.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="1261.5" cy="315.5" r="3" strokeWidth="15" />
<circle cx="1379.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="1379.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="1379.5" cy="315.5" r="3" strokeWidth="15" />
<circle cx="1497.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="1497.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="1497.5" cy="315.5" r="3" strokeWidth="15" />
<circle cx="1615.5" cy="145.5" r="3" strokeWidth="15" />
<circle cx="1615.5" cy="230.5" r="3" strokeWidth="15" />
<circle cx="1615.5" cy="315.5" r="3" strokeWidth="15" />
</g>
</g>
</animated.svg>
);
};
const ConcentricCircles = () => {
const style = useFloatAnimation("float-hi", -1000);
return (
<svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="bottom-left"
>
<animated.g
stroke="var(--theme-blue)"
className="concentric-circles"
style={style}
>
<circle cx="-43" cy="1272" r="619" strokeWidth="6" />
<circle cx="-43" cy="1272" r="593" strokeWidth="6" />
<circle cx="-43" cy="1272" r="568" strokeWidth="6" />
<circle cx="-43" cy="1272" r="540" strokeWidth="6" />
<circle cx="-43" cy="1272" r="514" strokeWidth="6" />
<circle cx="-43" cy="1272" r="487" strokeWidth="6" />
<circle cx="-43" cy="1272" r="461" strokeWidth="6" />
<circle cx="-43" cy="1272" r="435" strokeWidth="6" />
<circle cx="-43" cy="1272" r="409" strokeWidth="6" />
<circle cx="-43" cy="1272" r="382" strokeWidth="6" />
<circle cx="-43" cy="1272" r="355" strokeWidth="6" />
<circle cx="-43" cy="1272" r="329" strokeWidth="6" />
<circle cx="-43" cy="1272" r="303" strokeWidth="6" />
</animated.g>
</svg>
);
};
const Square = () => {
const style = useFloatAnimation("float-rotate-mid", -1000);
return (
<svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="bottom-right"
>
<animated.rect
className="spinning-square"
x="650"
y="750"
width="100"
height="100"
strokeWidth="6"
stroke="var(--theme-blue)"
style={style}
/>
</svg>
);
};
const Line1 = () => {
const style = useFloatAnimation("float-mid", 250);
return (
<animated.svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="bottom-right"
style={style}
>
<line
className="line-1"
x1="1275"
y1="780"
x2="1393"
y2="780"
strokeWidth="6"
stroke="var(--theme-blue)"
/>
</animated.svg>
);
};
const Line2 = () => {
const style = useFloatAnimation("float-mid", 500);
return (
<animated.svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="bottom-right"
style={style}
>
<line
className="line-2"
x1="1095"
y1="839"
x2="1685"
y2="839"
strokeWidth="6"
stroke="var(--theme-blue)"
/>
</animated.svg>
);
};
const Line3 = () => {
const style = useFloatAnimation("float-mid", 750);
return (
<animated.svg
viewBox="0 0 1920 1080"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className="bottom-right"
style={style}
>
<line
className="line-3"
x1="1275"
y1="898"
x2="1518"
y2="898"
strokeWidth="6"
stroke="var(--theme-blue)"
/>
</animated.svg>
);
};
export const AnimatedShapes = () => {
return (
<>
<Box />
<Donut />
<DotGrid />
<Circle />
<CenterText />
<ConcentricCircles />
<Square />
<Line1 />
<Line2 />
<Line3 />
</>
);
};