From f65c0829c5d46a5baedc6c3ec5f576ac749f35a0 Mon Sep 17 00:00:00 2001 From: starlitskies Date: Tue, 31 Oct 2023 12:06:42 +0500 Subject: [PATCH] feat: add "loading" when loading the overlay --- overlay/index.html | 1 + src/js/overlay.js | 8 +++++++- src/scss/main.scss | 1 + src/scss/overlay.scss | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/overlay/index.html b/overlay/index.html index 87dca2a..c3bb03c 100644 --- a/overlay/index.html +++ b/overlay/index.html @@ -8,6 +8,7 @@ +
Loading
diff --git a/src/js/overlay.js b/src/js/overlay.js index 897e3cd..9e867f6 100644 --- a/src/js/overlay.js +++ b/src/js/overlay.js @@ -32,7 +32,10 @@ let lastMatchId = ''; let win = 0; let lose = 0; -document.querySelector('#overlay').innerHTML = ` +const loading = document.querySelector("#loading"); +const overlay = document.querySelector("#overlay"); + +overlay.innerHTML = `
rank @@ -54,6 +57,7 @@ document.querySelector('#overlay').innerHTML = `
` +overlay.style.display = "none"; // Elements const imgRank = document.getElementById("imgRank"); @@ -78,6 +82,8 @@ async function main(nickname, tag) { await decorateCard() await checkData(region, puuid) + loading.remove() + overlay.style.display = "block"; setIntervalAsync(checkData, 30000, region, puuid); } diff --git a/src/scss/main.scss b/src/scss/main.scss index 295d7b4..43e361c 100644 --- a/src/scss/main.scss +++ b/src/scss/main.scss @@ -426,6 +426,7 @@ input.nickname { background-repeat: no-repeat; background-size: cover; position: relative; + overflow: hidden; &::after { content: ""; position: absolute; diff --git a/src/scss/overlay.scss b/src/scss/overlay.scss index d420120..4de89cf 100644 --- a/src/scss/overlay.scss +++ b/src/scss/overlay.scss @@ -40,6 +40,7 @@ body { box-sizing: border-box; overflow: hidden; } + #elements { display: flex; flex-direction: row;