Skip to content

Commit

Permalink
feat(added three dots spinner from quopa): added three pulsing dots s…
Browse files Browse the repository at this point in the history
…pinner from quopa into zrc
  • Loading branch information
charlielizzy committed Feb 21, 2023
1 parent 9fa2fb9 commit 75b605c
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/atoms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Atoms are usually made with only one single HTML element.
- [`<Link />`](#/Components/Atoms/Link)
- [`<SidekickCard />`](#/Components/Atoms/SidekickCard)
- [`<Spinner />`](#/Components/Atoms/Spinner)
- [`<ThreeDotsSpinner />`](#/Components/Atoms/ThreeDotsSpinner)
- [`<Text />`](#/Components/Atoms/Text)

### Tips
Expand Down
8 changes: 8 additions & 0 deletions src/components/atoms/Spinner/Spinner.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ import { Spinner } from '@zopauk/react-components';

<Spinner styling="negative" />;
```

ThreeDotsSpinner:

```ts
import { ThreeDotsSpinner } from '@zopauk/react-components';

<ThreeDotsSpinner />;
```
57 changes: 57 additions & 0 deletions src/components/atoms/Spinner/ThreeDotsSpinner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import styled, { keyframes } from 'styled-components';
import { colors } from '../../../constants/colors';

const animateDots = keyframes`
0%,
80%,
100% {
box-shadow: 0 2.5em 0 -1.3em;
}
40% {
box-shadow: 0 2.5em 0 0;qq
}
`;

const ThreeDotsSpinner = styled.div`
color: ${colors.brand};
font-size: 6px;
margin: 36px auto;
position: relative;
text-indent: -9999em;
transform: translateZ(0);
animation-delay: -0.16s;
&,
&:before,
&:after {
border-radius: 50%;
width: 2.5em;
height: 2.5em;
animation-fill-mode: both;
animation: ${animateDots} 1.8s infinite ease-in-out;
}
&:before {
content: '';
position: absolute;
top: 0;
}
&:after {
content: '';
position: absolute;
top: 0;
}
&:before {
left: -3.5em;
animation-delay: -0.32s;
}
&:after {
left: 3.5em;
animation-delay: 0.64s;
}
`;

export default ThreeDotsSpinner;
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export { default as Dropdown } from './components/atoms/Dropdown/Dropdown';
export { Option as DropdownOption } from './components/atoms/Dropdown/Dropdown';
export { default as DropdownFiltered } from './components/molecules/DropdownFiltered/DropdownFiltered';
export { default as Spinner } from './components/atoms/Spinner/Spinner';
export { default as ThreeDotsSpinner } from './components/atoms/Spinner/ThreeDotsSpinner';
export { default as ErrorMessage } from './components/atoms/ErrorMessage/ErrorMessage';
export { default as InputLabel } from './components/atoms/InputLabel/InputLabel';
export { default as InputRange } from './components/atoms/InputRange/InputRange';
Expand Down

0 comments on commit 75b605c

Please sign in to comment.