Skip to content

Commit 4253afe

Browse files
committed
refactorize main styling to ThreeDotsLoader snippet
1 parent 936f5fd commit 4253afe

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

components/Snippets/ThreeDotsLoader.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
import { styled, keyframes } from 'stitches.config.js';
22

33
const Component = () => {
4-
return <Wrapper />;
4+
return (
5+
<Wrapper>
6+
<span></span>
7+
<span></span>
8+
<span></span>
9+
</Wrapper>
10+
);
511
};
612

713
const flashing = keyframes({
8-
'0%': { backgroundColor: '$white' },
9-
'50%, 100%': {
10-
backgroundColor: 'rgba(255, 255, 255, 0.3)'
14+
'0%': {
15+
opacity: 0.2
16+
},
17+
'20%': {
18+
opacity: 1
19+
},
20+
'100%': {
21+
opacity: 0.2
1122
}
1223
});
1324

1425
const Wrapper = styled('div', {
15-
position: 'relative',
16-
width: '14px',
17-
height: '14px',
18-
borderRadius: '50%',
19-
backgroundColor: '$white',
20-
color: '$white',
21-
animation: `${flashing} 0.8s infinite linear alternate .4s`,
22-
23-
'&::after, &::before': {
24-
content: '',
25-
display: 'inline-block',
26-
position: 'absolute',
27-
top: 0,
26+
span: {
2827
width: '14px',
2928
height: '14px',
3029
borderRadius: '50%',
3130
backgroundColor: '$white',
32-
color: '$white'
31+
animation: `${flashing} 1.4s infinite linear`,
32+
margin: '0 4px',
33+
display: 'inline-block'
3334
},
34-
'&::before': {
35-
left: '-21px',
36-
animation: `${flashing} 0.8s infinite alternate`
35+
36+
'span:nth-child(2)': {
37+
'animation-delay': '.2s'
3738
},
3839

39-
'&::after': {
40-
left: '21px',
41-
animation: `${flashing} 0.8s infinite alternate .8s`
40+
'span:nth-child(3)': {
41+
'animation-delay': '.4s'
4242
}
4343
});
4444

0 commit comments

Comments
 (0)