generated from the-collab-lab/smart-shopping-list
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from the-collab-lab/18-loading
Implemented Loading component
- Loading branch information
Showing
6 changed files
with
69 additions
and
4 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
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,38 @@ | ||
.loading-block { | ||
padding: 15vh 0 4rem; | ||
display: flex; | ||
justify-content: center; | ||
} | ||
|
||
/** | ||
* Spinner Loading Animation | ||
* Author: Temani Afif | ||
* Source: https://css-tricks.com/single-element-loaders-the-spinner/ | ||
* Notes: | ||
* | ||
* 1. Spinner size. | ||
* 2. Border thickness. | ||
* 3. Spinner color. | ||
*/ | ||
|
||
.spinner { | ||
width: 5rem; /* 1 */ | ||
padding: 0.5rem; /* 2 */ | ||
background: var(--color-accent); /* 3 */ | ||
|
||
aspect-ratio: 1; | ||
border-radius: 50%; | ||
--_m: conic-gradient(#0000, #000), linear-gradient(#000 0 0) content-box; | ||
-webkit-mask: var(--_m); | ||
mask: var(--_m); | ||
-webkit-mask-composite: source-out; | ||
mask-composite: subtract; | ||
box-sizing: border-box; | ||
animation: spinner__load 1s linear infinite; | ||
} | ||
|
||
@keyframes spinner__load { | ||
to { | ||
transform: rotate(1turn); | ||
} | ||
} |
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 './Loading.css'; | ||
|
||
const Loading = () => { | ||
return ( | ||
<div className="loading-block"> | ||
<div className="spinner"></div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Loading; |
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