Skip to content
Snippets Groups Projects
Commit 78ebe501 authored by Jonas Leder's avatar Jonas Leder
Browse files

show loading animation while page is loading

parent 6008549c
No related branches found
No related tags found
No related merge requests found
Pipeline #787 failed
...@@ -5,5 +5,7 @@ document.onreadystatechange = function () { ...@@ -5,5 +5,7 @@ document.onreadystatechange = function () {
console.log(href); console.log(href);
element.target = "_blank"; element.target = "_blank";
} }
}) });
document.querySelector(".loader").style.display = "none";
} }
\ No newline at end of file
let div = document.createElement("div");
div.className = "loader";
div.innerHTML = `<div class="loader-dots">
<div class="dots"></div>
<div class="dots"></div>
<div class="dots"></div>
<div class="dots"></div>
<div class="dots"></div>
</div>`;
document.body.appendChild(div);
\ No newline at end of file
require("./loader");
require("./browserCheck"); require("./browserCheck");
require("./error"); require("./error");
......
.loader {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
transition: visibility 0s, opacity 0.5s linear;
background-color: $back-color;
.loader-dots {
position: absolute;
top: 50%;
left: 50%;
.dots {
position: absolute;
padding: 10px;
border-radius: 50%;
background: $accent-color;
-webkit-animation: loader 1s ease-in-out 0s infinite;
animation: loader 1s ease-in-out 0s infinite;
&:nth-child(1) {
-webkit-animation-delay: 0s;
animation-delay: 0s;
}
&:nth-child(2) {
-webkit-animation-delay: 0.15s;
animation-delay: 0.15s;
}
&:nth-child(3) {
-webkit-animation-delay: 0.30s;
animation-delay: 0.30s;
}
&:nth-child(4) {
-webkit-animation-delay: 0.45s;
animation-delay: 0.45s;
}
}
}
}
@keyframes loader {
0% {
-webkit-transform: translateX(-100px);
transform: translateX(-100px);
opacity: 0;
}
50% {
opacity: 1;
}
100% {
-webkit-transform: translateX(100px);
transform: translateX(100px);
opacity: 0;
}
}
\ No newline at end of file
@import "var"; @import "var";
@import "colorMixer"; @import "colorMixer";
@import "loader";
@import "general"; @import "general";
@import "menue"; @import "menue";
@import "normalize"; @import "normalize";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment