-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create LoadingSpinner component
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const LoadingSpinner = () => ( | ||
<> | ||
<div className="spinner"> | ||
{/* This is to keep compatibility with the progressive rendering */} | ||
<div className="spinnerContent">Loading...</div> | ||
</div> | ||
<style jsx> | ||
{` | ||
div.loaderWrapper { | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
height: 100%; | ||
} | ||
.spinner { | ||
width: 40px; | ||
height: 40px; | ||
margin: 100px auto; | ||
background-color: #333; | ||
border-radius: 100%; | ||
-webkit-animation: sk-scaleout 1s infinite ease-in-out; | ||
animation: sk-scaleout 1s infinite ease-in-out; | ||
} | ||
.spinner > .spinnerContent { | ||
display: none; | ||
} | ||
@-webkit-keyframes sk-scaleout { | ||
0% { | ||
-webkit-transform: scale(0); | ||
} | ||
100% { | ||
-webkit-transform: scale(1); | ||
opacity: 0; | ||
} | ||
} | ||
@keyframes sk-scaleout { | ||
0% { | ||
-webkit-transform: scale(0); | ||
transform: scale(0); | ||
} | ||
100% { | ||
-webkit-transform: scale(1); | ||
transform: scale(1); | ||
opacity: 0; | ||
} | ||
} | ||
`} | ||
</style> | ||
</> | ||
); | ||
export default LoadingSpinner; |