-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
93 lines (82 loc) · 1.89 KB
/
index.js
File metadata and controls
93 lines (82 loc) · 1.89 KB
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
import styled from 'styled-components'
const LoaderContainer = styled.div`
display: flex;
align-items: center;
background-color: transparent;
flex-direction: column;
justify-content: center;
`
const StyledLoader = styled.div`
opacity: ${(props) => (props.show ? 1 : 0)};
transition: opacity 0.5s linear;
animation: rotate 1s infinite;
position: fixed;
margin-top: -75px;
height: 75px;
width: 75px;
&:before,
&:after {
border-radius: 50%;
content: '';
display: block;
height: 30px;
width: 30px;
}
&:before {
animation: ball1 1s infinite;
background-color: #ff6ab9;
box-shadow: 45px 0 0 #edc281;
margin-bottom: 15px;
}
&:after {
animation: ball2 1s infinite;
background-color: #54ffff;
box-shadow: 45px 0 0 #ffffff;
}
@keyframes rotate {
0% {
-webkit-transform: rotate(0deg) scale(0.8);
-moz-transform: rotate(0deg) scale(0.8);
}
50% {
-webkit-transform: rotate(360deg) scale(1.2);
-moz-transform: rotate(360deg) scale(1.2);
}
100% {
-webkit-transform: rotate(720deg) scale(0.8);
-moz-transform: rotate(720deg) scale(0.8);
}
}
@keyframes ball1 {
0% {
box-shadow: 45px 0 0 #edc281;
}
50% {
box-shadow: 0 0 0 #edc281;
margin-bottom: 0;
-webkit-transform: translate(22.5px, 22.5px);
-moz-transform: translate(22.5px, 22.5px);
}
100% {
box-shadow: 45px 0 0 #edc281;
margin-bottom: 15px;
}
}
@keyframes ball2 {
0% {
box-shadow: 45px 0 0 #ffffff;
}
50% {
box-shadow: 0 0 0 #ffffff;
margin-top: -30px;
-webkit-transform: translate(22.5px, 22.5px);
-moz-transform: translate(22.5px, 22.5px);
}
100% {
box-shadow: 45px 0 0 #ffffff;
margin-top: 0;
}
}
`
const Loader = (props) => <StyledLoader {...props} />
export { Loader, LoaderContainer }