Skip to content

Commit

Permalink
fix: remade the load into a spinner-figure
Browse files Browse the repository at this point in the history
  • Loading branch information
malmen237 committed Apr 8, 2024
1 parent 1488e9c commit 4e22e1c
Showing 1 changed file with 14 additions and 88 deletions.
102 changes: 14 additions & 88 deletions src/components/loader/loader.tsx
Original file line number Diff line number Diff line change
@@ -1,102 +1,28 @@
import styled from "@emotion/styled";
import { FC } from "react";

const Wrapper = styled.div`
height: auto;
width: 20vw;
`;

const Loading = styled.div`
background-color: #bdbdbd;
aspect-ratio: 1;
height: 1rem;
border-radius: 10%;
opacity: 0;
animation:
fadeEffect 4s ease-in-out infinite,
slider 4s linear 0s infinite reverse;
-webkit-animation:
fadeEffect 4s ease-in-out infinite,
slider 4s linear 0s infinite reverse;
-moz-animation:
fadeEffect 4s ease-in-out infinite,
slider 4s linear 0s infinite reverse;
@keyframes fadeEffect {
0% {
opacity: 0;
}
25% {
opacity: 1;
}
95% {
opacity: 1;
}
100% {
opacity: 0;
}
}
@-webkit-keyframes fadeEffect {
0% {
opacity: 0;
}
25% {
opacity: 1;
}
95% {
opacity: 1;
}
100% {
opacity: 0;
}
}
position: absolute;
top: 5px;
left: 60px;
border: 4px solid rgba(0, 0, 0, 0.1);
border-top: 4px solid #333;
border-radius: 50%;
width: 30px;
height: 30px;
animation: spin 1s linear infinite;
margin: auto;
@-moz-keyframes fadeEffect {
@keyframes spin {
0% {
opacity: 0;
}
25% {
opacity: 1;
}
95% {
opacity: 1;
transform: rotate(0deg);
}
100% {
opacity: 0;
}
}
@keyframes slider {
from {
transform: translateX(15rem) rotate(359deg);
}
to {
transform: translateX(0) rotate(0deg);
}
}
@-webkit-keyframes slider {
from {
transform: translateX(15rem) rotate(359deg);
}
to {
transform: translateX(0) rotate(0deg);
}
}
@-moz-keyframes slider {
from {
transform: translateX(15rem) rotate(359deg);
}
to {
transform: translateX(0) rotate(0deg);
transform: rotate(360deg);
}
}
`;

export const Loader: FC = () => {
return (
<Wrapper>
<Loading />
</Wrapper>
);
return <Loading />;
};

0 comments on commit 4e22e1c

Please sign in to comment.