This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
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.
feat: ✨ implement loading screen and theme storage
- Loading branch information
Showing
11 changed files
with
177 additions
and
18 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
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,25 @@ | ||
import React from 'react'; | ||
|
||
/** | ||
* A lightweight spinner component. | ||
* @returns {JSX.Element} | ||
*/ | ||
export default function Spinner({ message }: {message?: string}): JSX.Element { | ||
return ( | ||
<div className="spinner-wrapper"> | ||
<div className="lds-ring"> | ||
<div /> | ||
<div /> | ||
<div /> | ||
<div /> | ||
</div> | ||
<div className="spinner-message"> | ||
{message} | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
Spinner.defaultProps = { | ||
message: '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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
@import "../themes/dark"; | ||
@import "../themes/light"; | ||
|
||
@mixin themable($theme-name, $theme-map) { | ||
.#{$theme-name} { | ||
.loading-page-wrapper { | ||
background-color: map-get($theme-map, bg); | ||
color: map-get($theme-map, text); | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
|
||
.spinner-wrapper { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.spinner-message { | ||
font-size: 1.4rem; | ||
margin-bottom: 20px; | ||
} | ||
|
||
// credit to loading.io for the spinner | ||
|
||
.lds-ring { | ||
display: inline-block; | ||
position: relative; | ||
width: 80px; | ||
height: 80px; | ||
} | ||
.lds-ring div { | ||
box-sizing: border-box; | ||
display: block; | ||
position: absolute; | ||
width: 47px; | ||
height: 47px; | ||
margin: 6px; | ||
border: 6px solid map-get($theme-map, icons); | ||
border-radius: 50%; | ||
animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite; | ||
border-color: map-get($theme-map, icons) transparent transparent | ||
transparent; | ||
} | ||
.lds-ring div:nth-child(1) { | ||
animation-delay: -0.45s; | ||
} | ||
.lds-ring div:nth-child(2) { | ||
animation-delay: -0.3s; | ||
} | ||
.lds-ring div:nth-child(3) { | ||
animation-delay: -0.15s; | ||
} | ||
@keyframes lds-ring { | ||
0% { | ||
transform: rotate(0deg); | ||
} | ||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
} | ||
} | ||
|
||
@include themable(light, $light); | ||
@include themable(dark, $dark); |
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,29 @@ | ||
@import "../themes/dark"; | ||
@import "../themes/light"; | ||
|
||
@mixin themable($theme-name, $theme-map) { | ||
.#{$theme-name} { | ||
.dashboard-wrapper { | ||
background-color: map-get($theme-map, bg); | ||
color: map-get($theme-map, text); | ||
width: 100vw; | ||
height: 100vh; | ||
} | ||
|
||
.dashboard-header { | ||
box-sizing: border-box; | ||
width: 100%; | ||
height: 80px; | ||
border-bottom: 1px solid map-get($theme-map, card-border); | ||
background-color: map-get($theme-map, card-bg); | ||
} | ||
|
||
.dahsboard-body { | ||
box-sizing: border-box; | ||
width: 100%; | ||
} | ||
} | ||
} | ||
|
||
@include themable(light, $light); | ||
@include themable(dark, $dark); |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
$dark: ( | ||
bg: #0d1117, | ||
icons: #d3d3d3, | ||
text: #d3d3d3, | ||
text-secondary: #a5a5a5, | ||
text-href: #2c80e0, | ||
|
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
$light: ( | ||
bg: #fff, | ||
icons: #000, | ||
text: #000, | ||
text-secondary: #575757, | ||
text-href: #246bbb, | ||
|
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