Skip to content

Commit

Permalink
Fix loader
Browse files Browse the repository at this point in the history
  • Loading branch information
robertlong committed Jun 1, 2020
1 parent f63f50d commit 8483e1b
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 48 deletions.
6 changes: 5 additions & 1 deletion src/react-components/misc/Loader.js
Expand Up @@ -5,7 +5,11 @@ import styles from "./Loader.scss";
export function Loader({ message }) {
return (
<>
<div className={styles.loader} />
<div className={styles.loader}>
<div />
<div />
<div />
</div>
{message && <div className={styles.loaderText}>{message}</div>}
</>
);
Expand Down
77 changes: 30 additions & 47 deletions src/react-components/misc/Loader.scss
@@ -1,63 +1,46 @@
.loader:before,
.loader:after {
background: var(--loading-spinner-color);
-webkit-animation: loader-animation 1s infinite ease-in-out;
animation: loader-animation 1s infinite ease-in-out;
width: 0.6em;
height: 1em;
border-radius: 5px;
}

.loader {
color: var(--loading-spinner-color);
text-indent: -9999em;
margin-left: 4em;
margin-top: 4em;
font-size: 11px;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}

.loader:before,
.loader:after {
position: absolute;
top: 0;
content: '';
}
:local(.loader) {
display: inline-block;
position: relative;
width: 40px;
height: 80px;

.loader:before {
left: -1.2em;
-webkit-animation-delay: -0.32s;
animation-delay: -0.32s;
}
div {
display: inline-block;
position: absolute;
left: 8px;
width: 0.6em;
background: var(--loading-spinner-color);
animation: loading 1s ease-in-out infinite;
border-radius: 5px;
}

.loader:after {
left: 1.2em;
}
div:nth-child(1) {
left: 0.2em;
animation-delay: -0.32s;
}

@-webkit-keyframes loader-animation {
0%,
80%,
100% {
height: 2em;
top: 0;
div:nth-child(2) {
left: 1em;
animation-delay: -0.16s;
}
40% {
height: 3.5em;
top: -0.75em;

div:nth-child(3) {
left: 1.8em;
animation-delay: 0;
}
}
@keyframes loader-animation {

@keyframes loading {
0%,
80%,
100% {
top: 24px;
height: 2em;
top: 0;
}

40% {
top: 8px;
height: 3.5em;
top: -0.75em;
}
}

Expand Down

0 comments on commit 8483e1b

Please sign in to comment.