-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved loading states in dashboard
- Loading branch information
1 parent
4f1a6ac
commit a418987
Showing
6 changed files
with
170 additions
and
7 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import styles from '../../../styles/components/FancySpinner.module.css' | ||
|
||
type SpinnerProps = { | ||
size?: number | ||
thickness?: number | ||
} | ||
|
||
export default function FancySpinner({ size = 100 }: SpinnerProps) { | ||
return <div style={{ width: `${size}px`, height: `${size}px` }} className={styles.loader} /> | ||
} |
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,12 @@ | ||
import styles from '../../../styles/components/Spinner.module.css' | ||
|
||
type SpinnerProps = { | ||
size?: number | ||
thickness?: number | ||
} | ||
|
||
export default function Spinner({ size = 80, thickness = 6 }: SpinnerProps) { | ||
return ( | ||
<div style={{ width: `${size}px`, height: `${size}px`, borderWidth: `${thickness}px` }} className={styles.loader} /> | ||
) | ||
} |
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,74 @@ | ||
.loader { | ||
transform: rotateZ(45deg); | ||
perspective: 1000px; | ||
border-radius: 50%; | ||
width: 48px; | ||
height: 48px; | ||
color: #fff; | ||
} | ||
|
||
.loader:before, | ||
.loader:after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: inherit; | ||
height: inherit; | ||
border-radius: 50%; | ||
transform: rotateX(70deg); | ||
animation: 1s spin linear infinite; | ||
} | ||
|
||
.loader:after { | ||
color: #999; | ||
transform: rotateY(70deg); | ||
animation-delay: 0.4s; | ||
} | ||
|
||
@keyframes rotate { | ||
0% { | ||
transform: translate(-50%, -50%) rotateZ(0deg); | ||
} | ||
100% { | ||
transform: translate(-50%, -50%) rotateZ(360deg); | ||
} | ||
} | ||
|
||
@keyframes rotateccw { | ||
0% { | ||
transform: translate(-50%, -50%) rotate(0deg); | ||
} | ||
100% { | ||
transform: translate(-50%, -50%) rotate(-360deg); | ||
} | ||
} | ||
|
||
@keyframes spin { | ||
0%, | ||
100% { | ||
box-shadow: 0.5em 0px 0 0px currentcolor; | ||
} | ||
12% { | ||
box-shadow: 0.5em 0.5em 0 0 currentcolor; | ||
} | ||
25% { | ||
box-shadow: 0 0.5em 0 0px currentcolor; | ||
} | ||
37% { | ||
box-shadow: -0.5em 0.5em 0 0 currentcolor; | ||
} | ||
50% { | ||
box-shadow: -0.5em 0 0 0 currentcolor; | ||
} | ||
62% { | ||
box-shadow: -0.5em -0.5em 0 0 currentcolor; | ||
} | ||
75% { | ||
box-shadow: 0px -0.5em 0 0 currentcolor; | ||
} | ||
87% { | ||
box-shadow: 0.5em -0.5em 0 0 currentcolor; | ||
} | ||
} |
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,19 @@ | ||
.loader { | ||
width: 48px; | ||
height: 48px; | ||
border: 5px solid #fff; | ||
border-bottom-color: transparent; | ||
border-radius: 50%; | ||
display: inline-block; | ||
box-sizing: border-box; | ||
animation: rotation 1s linear infinite; | ||
} | ||
|
||
@keyframes rotation { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} |