Added loading animation

This commit is contained in:
2024-04-04 22:02:42 +02:00
parent e5eac063ed
commit 149dd04abd
4 changed files with 24 additions and 1 deletions

21
src/loading.js Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
// Small script used for the loading screen
import $ from 'jquery';
async function loadingOneCycle(){
$("#loading").fadeOut(600, ()=>{
$("#loading").fadeIn(600);
})
};
let timeoutID;
function startLoadingAnimation(){
timeoutID = setInterval(loadingOneCycle, 200);
}
function stopLoadingAnimation(){
clearInterval(timeoutID);
}
document.startLoadingAnimation = startLoadingAnimation;//So that's accessible from everywhere
document.stopLoadingAnimation = stopLoadingAnimation;