website/js/loader.js

19 lines
575 B
JavaScript
Raw Normal View History

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.classList.add("stop-scrolling");
2021-04-18 22:36:31 +02:00
document.body.appendChild(div);
document.addEventListener('readystatechange', event => {
if (event.target.readyState === "complete") {
document.querySelector(".loader").style.display = "none";
document.body.classList.remove("stop-scrolling");
2021-04-18 22:36:31 +02:00
}
});