- creater loader at the first launch
    - optimize loader
This commit is contained in:
Kum1ta
2024-09-30 01:24:32 +02:00
parent 76cf5d0585
commit 43c293c469
11 changed files with 178 additions and 72 deletions

View File

@ -6,19 +6,22 @@
/* By: edbernar <edbernar@student.42angouleme. +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/07/30 13:50:35 by edbernar #+# #+# */
/* Updated: 2024/09/27 15:22:23 by edbernar ### ########.fr */
/* Updated: 2024/09/29 22:50:23 by edbernar ### ########.fr */
/* */
/* ************************************************************************** */
import { launchSocket } from '/static/javascript/websocket.js';
import { Page } from '/static/javascript/Page.js';
import { loadFiles } from '/static/javascript/filesLoader.js';
let pageRenderer = null;
const isMobile = /mobile|android|iphone|ipad/.test(navigator.userAgent.toLowerCase())
document.addEventListener('DOMContentLoaded', () => {
pageRenderer = new Page();
launchSocket();
loadFiles().then(() => {
pageRenderer = new Page();
launchSocket();
});
});
export { pageRenderer, isMobile };