theme: show progress bar before navigating to another page

This commit is contained in:
Peter Cai 2020-04-11 09:12:01 +08:00
parent caa6775d65
commit 269d2ad9a9
No known key found for this signature in database
GPG Key ID: 71F5FB4E4F3FD54F
2 changed files with 9 additions and 0 deletions

View File

@ -6,4 +6,9 @@ avatar.onmouseover = (ev) => {
};
avatar.onanimationend = (ev) => {
ev.target.className = "";
};
// Trigger progress bar when loading new page
window.onbeforeunload = (ev) => {
document.getElementsByClassName("loading-progress")[0].className = "loading-progress force-visible";
};

View File

@ -24,6 +24,10 @@ html {
display: none !important;
}
.loading-progress.force-visible {
display: block !important;
}
.hidden {
display: none;
}