From 23e5f9f432850b1800d81f30df55b5f3b5a0cfe9 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Thu, 1 Aug 2024 17:31:09 +0200 Subject: [PATCH] Chore : components cleanup --- .vscode/launch.json | 34 ++ .vscode/settings.json | 3 +- app.vue | 7 +- assets/workers/ShaderWorker.ts | 1 - components/CardComponent.vue | 23 - components/CardOverlay.disabled | 51 --- components/CardPreview.vue | 410 ------------------ components/GlobalOverlay.vue | 33 -- components/PlayerList.vue | 0 components/SelfView.vue | 114 ----- components/game/Card.vue | 31 ++ .../{MarketCards.vue => game/Market.vue} | 28 +- .../TokenComponent.vue => game/Token.vue} | 0 .../card/Grouped.vue} | 9 +- components/game/card/Preview.vue | 260 +++++++++++ .../overlay/Discard.vue} | 5 +- .../{ => game/overlay}/LoadingScreen.vue | 0 .../{ => game/overlay}/ResultDialog.vue | 4 +- .../overlay/options/Dialog.vue} | 0 .../{PlayerIcon.vue => game/player/Icon.vue} | 0 .../player/ListElement.vue} | 5 +- components/game/player/Self.vue | 108 +++++ .../{PlayerSlot.vue => game/player/Slot.vue} | 6 +- .../player/Stats.vue} | 0 middleware/auth.global.ts | 6 +- pages/game.vue | 146 ++++--- pages/lobby.vue | 3 +- pages/rules.vue | 69 +-- pages/test.vue | 1 + public/webgl-utils.js | 175 +++++--- services/loadCards.ts | 4 +- 31 files changed, 720 insertions(+), 816 deletions(-) create mode 100644 .vscode/launch.json delete mode 100644 components/CardComponent.vue delete mode 100644 components/CardOverlay.disabled delete mode 100644 components/CardPreview.vue delete mode 100644 components/GlobalOverlay.vue delete mode 100644 components/PlayerList.vue delete mode 100644 components/SelfView.vue create mode 100644 components/game/Card.vue rename components/{MarketCards.vue => game/Market.vue} (80%) rename components/{tokens/TokenComponent.vue => game/Token.vue} (100%) rename components/{CardsGrouped.vue => game/card/Grouped.vue} (97%) create mode 100644 components/game/card/Preview.vue rename components/{DiscardOverlay.vue => game/overlay/Discard.vue} (95%) rename components/{ => game/overlay}/LoadingScreen.vue (100%) rename components/{ => game/overlay}/ResultDialog.vue (95%) rename components/{OptionsDialog.vue => game/overlay/options/Dialog.vue} (100%) rename components/{PlayerIcon.vue => game/player/Icon.vue} (100%) rename components/{PlayerListElement.vue => game/player/ListElement.vue} (95%) create mode 100644 components/game/player/Self.vue rename components/{PlayerSlot.vue => game/player/Slot.vue} (99%) rename components/{PlayerStats.vue => game/player/Stats.vue} (100%) diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..35dcc6d --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,34 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + "version": "0.2.0", + "configurations": [ + { + "type": "chrome", + "request": "launch", + "name": "client: chrome", + "url": "http://localhost:3000", + "webRoot": "${workspaceFolder}" + }, + { + "type": "node", + "request": "launch", + "name": "server: nuxt", + "outputCapture": "std", + "program": "${workspaceFolder}/node_modules/nuxi/bin/nuxi.mjs", + "args": [ + "dev" + ], + } + ], + "compounds": [ + { + "name": "fullstack: nuxt", + "configurations": [ + "server: nuxt", + "client: chrome" + ] + } + ] + } + \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index bfc886b..47a53a9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,5 +4,6 @@ "**/node_modules": true }, "vue.server.hybridMode": true, - "editor.formatOnSave": true + "editor.formatOnSave": true, + "javascript.updateImportsOnFileMove.enabled": "never" } \ No newline at end of file diff --git a/app.vue b/app.vue index 15080ed..e20f6e9 100644 --- a/app.vue +++ b/app.vue @@ -5,7 +5,6 @@ import { getCurrentInstance } from "vue"; const nuxtApp = useNuxtApp(); -const router = useRouter(); const authStore = useAuthStore(); console.log("compiling cards..."); @@ -14,16 +13,14 @@ if (!app) { throw new Error("Couldn't bake cards: instance is null"); } await compileCards(app); - -const _cards = cards; console.log("compiling done"); useHead({ title: "Héron Realms", }); -onMounted(()=>{ +onMounted(() => { authStore.whoami(); -}) +}); diff --git a/components/LoadingScreen.vue b/components/game/overlay/LoadingScreen.vue similarity index 100% rename from components/LoadingScreen.vue rename to components/game/overlay/LoadingScreen.vue diff --git a/components/ResultDialog.vue b/components/game/overlay/ResultDialog.vue similarity index 95% rename from components/ResultDialog.vue rename to components/game/overlay/ResultDialog.vue index 18a569a..98c18ef 100644 --- a/components/ResultDialog.vue +++ b/components/game/overlay/ResultDialog.vue @@ -1,5 +1,5 @@ + + + + + + diff --git a/components/PlayerSlot.vue b/components/game/player/Slot.vue similarity index 99% rename from components/PlayerSlot.vue rename to components/game/player/Slot.vue index fe873f4..b89d5db 100644 --- a/components/PlayerSlot.vue +++ b/components/game/player/Slot.vue @@ -198,7 +198,7 @@ function discardCardClick(card: Card) { --> - - -
+ +
diff --git a/pages/lobby.vue b/pages/lobby.vue index 6c6e687..67499f4 100644 --- a/pages/lobby.vue +++ b/pages/lobby.vue @@ -20,7 +20,6 @@ function killErika() { onBeforeMount(async () => { games.value = (await getLobby()).value; - console.log(games.value); eventSource = subscribe("/games/subscribe"); eventSource.addEventListener("message", (message) => { const data = JSON.parse(message.data); @@ -61,7 +60,7 @@ onUnmounted(() => {