forked from carbon-app/carbon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Spinner.js
49 lines (45 loc) · 1.1 KB
/
Spinner.js
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
import React from 'react'
export function Spinner({ size = 24 }) {
return (
<div className="bounce">
<div className="bounce-dot"></div>
<div className="bounce-dot"></div>
<style jsx>
{`
.bounce {
width: ${size}px;
height: ${size}px;
position: relative;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.bounce-dot {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.7);
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
animation: bounce 2s infinite cubic-bezier(0.455, 0.03, 0.515, 0.955);
}
.bounce-dot:nth-child(2) {
animation-delay: -1s;
}
@keyframes bounce {
0%,
100% {
transform: scale(0);
}
45%,
55% {
transform: scale(1);
}
}
`}
</style>
</div>
)
}