teascade-generator/test_page/resources/copied_resources/js/loadbar.js

19 lines
571 B
JavaScript
Raw Permalink Normal View History

2018-04-19 22:56:31 +02:00
_default_js_pageloader.begin = () => {
let loadbar = document.getElementById("loadbar");
loadbar.classList = "loading";
loadbar.style.width = "5%";
}
_default_js_pageloader.progress = (url, current, total) => {
let loadbar = document.getElementById("loadbar");
let percent = (current / total) * 100;
loadbar.style.width = percent + "%";
}
_default_js_pageloader.loaded = (url, after_load) => {
let loadbar = document.getElementById("loadbar");
loadbar.style.width = "100%";
loadbar.classList = "";
setTimeout(after_load, 100);
}