website/js/loader.js
2021-04-18 22:36:31 +02:00

17 lines
No EOL
470 B
JavaScript

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);
document.addEventListener('readystatechange', event => {
if (event.target.readyState === "complete") {
document.querySelector(".loader").style.display = "none";
}
});