From c4690e269d0b43a8d66bf86b57005bfc62507a11 Mon Sep 17 00:00:00 2001 From: starlitskies Date: Tue, 7 Nov 2023 04:11:12 +0500 Subject: [PATCH] feat: add live preview --- src/js/components/overlay.js | 34 ++++--- src/js/main.js | 182 ++++++++++++++++++++++++++++++++--- src/scss/overlay.scss | 52 +++++----- 3 files changed, 213 insertions(+), 55 deletions(-) diff --git a/src/js/components/overlay.js b/src/js/components/overlay.js index 9256773..1b58aa3 100644 --- a/src/js/components/overlay.js +++ b/src/js/components/overlay.js @@ -1,21 +1,23 @@ export const overlayHTML = ` -
-
- rank -
-
-

- Rating -

-

-
-

Win: Lose:

+
+
+
+ rank
-
-
- Last Match: - - +
+

+ Rating +

+

+
+

Win: Lose:

+
+
+
+ Last Match: + + +
diff --git a/src/js/main.js b/src/js/main.js index cafd0bc..67fc412 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -1,5 +1,11 @@ -import '../scss/main.scss' -import Alpine from 'alpinejs' +import "../scss/overlay.scss"; +import "../scss/main.scss"; +import Alpine from "alpinejs"; + +import { overlayHTML } from "./components/overlay.js"; + +const apiUrl = 'https://api.henrikdev.xyz/valorant' +let playerData; async function checkNickname(name) { const regex = /^[a-zA-Zа-яА-Я0-9\s]{1,16}#[a-zA-Zа-яА-Я0-9]{1,5}$/ @@ -119,14 +125,14 @@ document.querySelector('#app').innerHTML = ` -
-