Skip to content

Commit 7268ae1

Browse files
committed
add ThreeDotsLoader snippet
1 parent eca7796 commit 7268ae1

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { styled, keyframes } from 'stitches.config.js';
2+
3+
const Component = () => {
4+
return <Wrapper />;
5+
};
6+
7+
const flashing = keyframes({
8+
'0%': { backgroundColor: '$white' },
9+
'50%, 100%': {
10+
backgroundColor: 'rgba(255, 255, 255, 0.3)'
11+
}
12+
});
13+
14+
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,
28+
width: '14px',
29+
height: '14px',
30+
borderRadius: '50%',
31+
backgroundColor: '$white',
32+
color: '$white'
33+
},
34+
'&::before': {
35+
left: '-21px',
36+
animation: `${flashing} 0.8s infinite alternate`
37+
},
38+
39+
'&::after': {
40+
left: '21px',
41+
animation: `${flashing} 0.8s infinite alternate .8s`
42+
}
43+
});
44+
45+
export { Component };

components/Snippets/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import * as HorizontalOverlay from './HorizontalOverlay';
1010
import * as BorderFade from './BorderFade';
1111
import * as TextTransformX from './TextTransformX';
1212
import * as CircleScaleButton from './CircleScaleButton';
13+
import * as ThreeDotsLoader from './ThreeDotsLoader';
1314

1415
const allSnippets = [
1516
UnderlineLeftRight,
@@ -23,7 +24,8 @@ const allSnippets = [
2324
HorizontalOverlay,
2425
BorderFade,
2526
TextTransformX,
26-
CircleScaleButton
27+
CircleScaleButton,
28+
ThreeDotsLoader
2729
];
2830

2931
export default allSnippets;

0 commit comments

Comments
 (0)