From 64f733a95ff441cfbd5fa28bbca1b25a0591770d Mon Sep 17 00:00:00 2001 From: starlitskies Date: Fri, 3 Nov 2023 09:35:14 +0500 Subject: [PATCH] feat(overlay): remove "loading" --- overlay/index.html | 1 - src/js/components/overlay.js | 23 +++++++++++++++++++++++ src/js/overlay.js | 31 +++---------------------------- 3 files changed, 26 insertions(+), 29 deletions(-) create mode 100644 src/js/components/overlay.js diff --git a/overlay/index.html b/overlay/index.html index 2982f9e..712a56b 100644 --- a/overlay/index.html +++ b/overlay/index.html @@ -8,7 +8,6 @@ -
Loading
diff --git a/src/js/components/overlay.js b/src/js/components/overlay.js new file mode 100644 index 0000000..9256773 --- /dev/null +++ b/src/js/components/overlay.js @@ -0,0 +1,23 @@ +export const overlayHTML = ` +
+
+ rank +
+
+

+ Rating +

+

+
+

Win: Lose:

+
+
+
+ Last Match: + + +
+
+
+` + diff --git a/src/js/overlay.js b/src/js/overlay.js index ff039b9..3e665ce 100644 --- a/src/js/overlay.js +++ b/src/js/overlay.js @@ -1,4 +1,5 @@ import '../scss/overlay.scss' +import { overlayHTML } from "./components/overlay.js" import { setIntervalAsync } from 'set-interval-async'; // Urls and Alpine Data @@ -31,33 +32,9 @@ const { NICKNAME, TAG} = { let lastMatchId = ''; let win = 0; let lose = 0; - -const loading = document.querySelector('#loading'); const overlay = document.querySelector('#overlay'); -overlay.innerHTML = ` -
-
- rank -
-
-

- Rating -

-

-
-

Win: Lose:

-
-
-
- Last Match: - - -
-
-
-` -overlay.style.display = "none"; +overlay.innerHTML = overlayHTML // Elements const imgRank = document.getElementById('imgRank'); @@ -82,8 +59,6 @@ async function main(nickname, tag) { await decorateCard() await checkData(region, puuid) - loading.remove() - overlay.style.display = 'block'; setIntervalAsync(checkData, 30000, region, puuid); } @@ -211,7 +186,7 @@ async function checkData(region, puuid) { await updatePlayerCard(region, puuid); } } catch (error) { - // pass + console.log(error); } await winlose(region, puuid) }