-
-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce new
Spinner
component (#3786)
* Introduce new Spinner component: * Add entry to CHANGELOG.md * Make linter happy * Remove accidentially added file * Remove accidentially added file
- Loading branch information
1 parent
070e40c
commit 1f15286
Showing
4 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react' | ||
|
||
import styles from './styles.module.scss' | ||
|
||
type Props = { | ||
size?: number | ||
} | ||
|
||
export default function Spinner({ size = 50 }: Props) { | ||
return <div style={{ width: `${size}px` }} className={styles.spinner} /> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@keyframes spin { | ||
to { | ||
transform: rotate(1turn); | ||
} | ||
} | ||
|
||
.spinner { | ||
aspect-ratio: 1; | ||
background: var(--colorPrimary); | ||
border-radius: 50%; | ||
padding: 8px; | ||
--_m: conic-gradient(#0000 10%, #000), linear-gradient(#000 0 0) content-box; | ||
-webkit-mask: var(--_m); | ||
mask: var(--_m); | ||
-webkit-mask-composite: source-out; | ||
mask-composite: subtract; | ||
animation: spin 1.5s infinite linear; | ||
} |