From d12d4f67ff989e7c953a1c519519bd4985004724 Mon Sep 17 00:00:00 2001 From: legonzaur Date: Sun, 5 May 2024 18:53:16 +0200 Subject: [PATCH] Front rewrite --- .vscode/settings.json | 6 + app.vue | 54 +++- components/CardPreview.vue | 76 +++--- components/{CardSlot.vue => CardsGrouped.vue} | 18 +- components/GameBoard.vue | 109 ++++---- components/MarketCards.vue | 63 +++++ components/PlayerList.vue | 11 - components/PlayerListElement.vue | 137 ++++++++++ components/PlayerSlot.vue | 252 ++++++++++-------- components/PlayerStats.vue | 21 +- components/SelfView.vue | 87 +----- netcode/Effect.ts | 9 +- netcode/Turn.ts | 1 - public/images/bg-darkgrass.png | 3 + public/images/bg-grass.png | 3 + public/images/bg-sand.png | 3 + 16 files changed, 508 insertions(+), 345 deletions(-) create mode 100644 .vscode/settings.json rename components/{CardSlot.vue => CardsGrouped.vue} (67%) create mode 100644 components/MarketCards.vue delete mode 100644 components/PlayerList.vue create mode 100644 components/PlayerListElement.vue create mode 100644 public/images/bg-darkgrass.png create mode 100644 public/images/bg-grass.png create mode 100644 public/images/bg-sand.png diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..51e1ebb --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "files.exclude": { + "**/.nuxt/": true, + "**/node_modules": true + } +} \ No newline at end of file diff --git a/app.vue b/app.vue index 7aba6ec..e2fb1f9 100644 --- a/app.vue +++ b/app.vue @@ -1,22 +1,33 @@ \ No newline at end of file + +#__nuxt { + height: 100%; + user-select: none; +} + +#game_status { + position: fixed; + z-index: 1; + top: 0; + left: 50%; + transform: translateX(-50%); + background-color: rgba(255, 255, 255, .75); +} + diff --git a/components/CardPreview.vue b/components/CardPreview.vue index 866cf39..a9be10b 100644 --- a/components/CardPreview.vue +++ b/components/CardPreview.vue @@ -15,20 +15,13 @@ const props = withDefaults(defineProps(), { const emit = defineEmits(["click"]) -const buttonsElement = ref(null) -const rightClicked = ref(false) +const childCount = ref(0) function cardClick() { if (!props.data) return emit("click") } -function contextmenu(e: MouseEvent) { - if (buttonsElement.value?.childElementCount === 0) { return } - buttonsElement.value?.setAttribute("style", `top:${e.clientY + 10}px;left:${e.clientX + 10}px`) - rightClicked.value = true -} - const rotation = ref(0) // onBeforeUpdate(() => { @@ -45,40 +38,45 @@ watch( + \ No newline at end of file diff --git a/components/CardSlot.vue b/components/CardsGrouped.vue similarity index 67% rename from components/CardSlot.vue rename to components/CardsGrouped.vue index ba3b025..ae14fb3 100644 --- a/components/CardSlot.vue +++ b/components/CardsGrouped.vue @@ -9,16 +9,13 @@ const props = withDefaults(defineProps(), { stack: () => [], }) -const unwrapped = ref(false) - \ No newline at end of file diff --git a/components/GameBoard.vue b/components/GameBoard.vue index 30a7db8..c4d44a4 100644 --- a/components/GameBoard.vue +++ b/components/GameBoard.vue @@ -1,72 +1,65 @@ - + + \ No newline at end of file diff --git a/components/MarketCards.vue b/components/MarketCards.vue new file mode 100644 index 0000000..2cddb46 --- /dev/null +++ b/components/MarketCards.vue @@ -0,0 +1,63 @@ + + + + + \ No newline at end of file diff --git a/components/PlayerList.vue b/components/PlayerList.vue deleted file mode 100644 index 630c519..0000000 --- a/components/PlayerList.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - \ No newline at end of file diff --git a/components/PlayerListElement.vue b/components/PlayerListElement.vue new file mode 100644 index 0000000..be699a8 --- /dev/null +++ b/components/PlayerListElement.vue @@ -0,0 +1,137 @@ + + + + + + + \ No newline at end of file diff --git a/components/PlayerSlot.vue b/components/PlayerSlot.vue index 392d52b..b798db8 100644 --- a/components/PlayerSlot.vue +++ b/components/PlayerSlot.vue @@ -1,156 +1,172 @@ \ No newline at end of file + diff --git a/components/PlayerStats.vue b/components/PlayerStats.vue index 658356c..031ab4d 100644 --- a/components/PlayerStats.vue +++ b/components/PlayerStats.vue @@ -11,32 +11,30 @@ const props = defineProps()