1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Cleanup and initial submission changes

This commit is contained in:
Michael Hollister 2025-02-20 00:09:24 -06:00
parent 113e5707cd
commit a0349c6edf
8 changed files with 1438 additions and 2039 deletions

View file

@ -8,20 +8,25 @@ const loadingScreen = document.getElementById('loading-screen');
var backgroundVideoLoaded: boolean;
// eslint-disable-next-line no-var
var qrCodeRendered: boolean;
// eslint-disable-next-line no-var
var loadPollCount = 0;
// eslint-disable-next-line no-var
var loadScreenDone = setInterval(() => {
// Show main screen regardless if resources not loaded within 10s
if ((backgroundVideoLoaded && qrCodeRendered) || loadPollCount > 10) {
clearInterval(loadScreenDone);
loadingScreen.style.display = 'none';
}
loadPollCount++;
}, 1000);
backgroundVideo.onplaying = () => {
backgroundVideoLoaded = true;
if (backgroundVideoLoaded && qrCodeRendered) {
loadingScreen.style.display = 'none';
backgroundVideo.onplaying = null;
}
backgroundVideo.onplaying = null;
};
export function onQRCodeRendered() {
qrCodeRendered = true;
if (backgroundVideoLoaded && qrCodeRendered) {
loadingScreen.style.display = 'none';
}
}