forked from codesandbox/codesandbox-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathelements.ts
More file actions
49 lines (42 loc) · 999 Bytes
/
elements.ts
File metadata and controls
49 lines (42 loc) · 999 Bytes
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 styled, { css, keyframes } from 'styled-components';
import { Button } from '../Button';
import theme from '../../theme';
const loaderAnimation = keyframes`
0% { background-color: ${theme.secondary()}; }
50%, 100% { background-color: ${theme.secondary.lighten(0.5)()}; }
`;
export const Wrapper = styled.div`
position: relative;
`;
export const RelativeButton = styled(Button)`
position: relative;
`;
const circle = css`
width: 8px;
height: 8px;
border-radius: 50%;
background: ${theme.secondary()};
opacity: 0.7;
animation: ${loaderAnimation} 1s infinite linear alternate;
`;
export const Loader = styled.div`
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
${circle} animation-delay: 0.5s;
&:before {
content: ' ';
position: absolute;
left: -12px;
${circle};
animation-delay: 0s;
}
&:after {
content: ' ';
position: absolute;
left: 12px;
${circle};
animation-delay: 1s;
}
`;