diff options
| author | Mhykol <mchaeldonald62@pm.me> | 2024-06-10 04:38:00 -0400 |
|---|---|---|
| committer | Mhykol <mchaeldonald62@pm.me> | 2024-06-10 04:38:00 -0400 |
| commit | 0e26143bf99a9c7a33aa55ffba7327176c03e74d (patch) | |
| tree | 2bc9c480f89acdd06b3b666d1f64b66f692bf95a /assets/js/main.js | |
| parent | 71bf9554707d096dd367cd0227853106b2a5fad7 (diff) | |
Added loading screen
Diffstat (limited to 'assets/js/main.js')
| -rw-r--r-- | assets/js/main.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/assets/js/main.js b/assets/js/main.js index 5da93ed..936bf37 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -10,7 +10,9 @@ class Main { await this.Get() } - #Loading() {} + #Loading() { + new Loading().Stop() + } async Get(x) { const object = { session: document.cookie, @@ -32,6 +34,7 @@ class Main { const section = document.getElementById('main') this.#LoadCSS(output.css).then(output => { + this.#Loading() section.innerHTML = DOMPurify.sanitize(this.output.html) this.output.js.map(file => { const script = document.createElement('script') @@ -39,11 +42,9 @@ class Main { this.object.body.appendChild(script) }) }) - - //section.innerHTML = DOMPurify.sanitize(output.html) }) } - async #LoadCSS (files) { + async #LoadCSS(files) { const promises = files.map(file => { return new Promise(res => { const link = document.createElement('link') |
