From bbcb84ed032b7f9cd7ecf6481cf8d1a860084088 Mon Sep 17 00:00:00 2001 From: Colin Kallemein Date: Sun, 3 Nov 2024 00:47:02 +0100 Subject: [PATCH] Refactored screens & login forms, fixed pw reset modal, WIP new pw form --- src/App.vue | 8 +- src/components/gui/CharacterProfile.vue | 5 +- src/{ => components}/screens/Characters.vue | 318 +++++++++--------- src/{ => components}/screens/Game.vue | 164 ++++----- src/{ => components}/screens/Loading.vue | 50 +-- src/components/screens/Login.vue | 46 +++ src/{ => components}/screens/ZoneEditor.vue | 170 +++++----- src/components/screens/partials/LoginForm.vue | 69 ++++ .../screens/partials/NewPasswordForm.vue | 67 ++++ .../screens/partials/RegisterForm.vue | 97 ++++++ src/components/utilities/Modal.vue | 4 +- src/components/utilities/ResetPassword.vue | 102 +++--- src/screens/Login.vue | 144 -------- 13 files changed, 691 insertions(+), 553 deletions(-) rename src/{ => components}/screens/Characters.vue (97%) rename src/{ => components}/screens/Game.vue (96%) rename src/{ => components}/screens/Loading.vue (97%) create mode 100644 src/components/screens/Login.vue rename src/{ => components}/screens/ZoneEditor.vue (96%) create mode 100644 src/components/screens/partials/LoginForm.vue create mode 100644 src/components/screens/partials/NewPasswordForm.vue create mode 100644 src/components/screens/partials/RegisterForm.vue delete mode 100644 src/screens/Login.vue diff --git a/src/App.vue b/src/App.vue index 28eafaa..db25e50 100644 --- a/src/App.vue +++ b/src/App.vue @@ -11,10 +11,10 @@ import { useZoneEditorStore } from '@/stores/zoneEditorStore' import Notifications from '@/components/utilities/Notifications.vue' import GmTools from '@/components/gameMaster/GmTools.vue' import GmPanel from '@/components/gameMaster/GmPanel.vue' -import Login from '@/screens/Login.vue' -import Characters from '@/screens/Characters.vue' -import Game from '@/screens/Game.vue' -import ZoneEditor from '@/screens/ZoneEditor.vue' +import Login from '@/components/screens/Login.vue' +import Characters from '@/components/screens/Characters.vue' +import Game from '@/components/screens/Game.vue' +import ZoneEditor from '@/components/screens/ZoneEditor.vue' import { computed, watch } from 'vue' const gameStore = useGameStore() diff --git a/src/components/gui/CharacterProfile.vue b/src/components/gui/CharacterProfile.vue index 3704430..14e52a2 100644 --- a/src/components/gui/CharacterProfile.vue +++ b/src/components/gui/CharacterProfile.vue @@ -168,8 +168,8 @@ function stopDrag() { } function adjustPosition() { - x.value = Math.max(0, Math.min(x.value, window.innerWidth - width.value)) - y.value = Math.max(0, Math.min(y.value, window.innerHeight - height.value)) + x.value = Math.min(x.value, window.innerWidth - width.value) + y.value = Math.min(y.value, window.innerHeight - height.value) } function initializePosition() { @@ -236,6 +236,7 @@ onMounted(() => { }) onUnmounted(() => { + removeEventListener('keydown', keyPress) removeEventListener('mousemove', drag) removeEventListener('mouseup', stopDrag) }) diff --git a/src/screens/Characters.vue b/src/components/screens/Characters.vue similarity index 97% rename from src/screens/Characters.vue rename to src/components/screens/Characters.vue index c2ab3e8..36d94f6 100644 --- a/src/screens/Characters.vue +++ b/src/components/screens/Characters.vue @@ -1,159 +1,159 @@ - - - + + + diff --git a/src/screens/Game.vue b/src/components/screens/Game.vue similarity index 96% rename from src/screens/Game.vue rename to src/components/screens/Game.vue index 4bbbad7..ef10b82 100644 --- a/src/screens/Game.vue +++ b/src/components/screens/Game.vue @@ -1,82 +1,82 @@ - - - + + + diff --git a/src/screens/Loading.vue b/src/components/screens/Loading.vue similarity index 97% rename from src/screens/Loading.vue rename to src/components/screens/Loading.vue index 68165e9..0433a87 100644 --- a/src/screens/Loading.vue +++ b/src/components/screens/Loading.vue @@ -1,25 +1,25 @@ - - - + + + diff --git a/src/components/screens/Login.vue b/src/components/screens/Login.vue new file mode 100644 index 0000000..17a6e3a --- /dev/null +++ b/src/components/screens/Login.vue @@ -0,0 +1,46 @@ + + + diff --git a/src/screens/ZoneEditor.vue b/src/components/screens/ZoneEditor.vue similarity index 96% rename from src/screens/ZoneEditor.vue rename to src/components/screens/ZoneEditor.vue index b2f69f9..e682867 100644 --- a/src/screens/ZoneEditor.vue +++ b/src/components/screens/ZoneEditor.vue @@ -1,85 +1,85 @@ - - - + + + diff --git a/src/components/screens/partials/LoginForm.vue b/src/components/screens/partials/LoginForm.vue new file mode 100644 index 0000000..e813d98 --- /dev/null +++ b/src/components/screens/partials/LoginForm.vue @@ -0,0 +1,69 @@ + + + \ No newline at end of file diff --git a/src/components/screens/partials/NewPasswordForm.vue b/src/components/screens/partials/NewPasswordForm.vue new file mode 100644 index 0000000..2d9d05a --- /dev/null +++ b/src/components/screens/partials/NewPasswordForm.vue @@ -0,0 +1,67 @@ + + + \ No newline at end of file diff --git a/src/components/screens/partials/RegisterForm.vue b/src/components/screens/partials/RegisterForm.vue new file mode 100644 index 0000000..5619b80 --- /dev/null +++ b/src/components/screens/partials/RegisterForm.vue @@ -0,0 +1,97 @@ + + + \ No newline at end of file diff --git a/src/components/utilities/Modal.vue b/src/components/utilities/Modal.vue index 81792a7..0cd7b8f 100644 --- a/src/components/utilities/Modal.vue +++ b/src/components/utilities/Modal.vue @@ -146,8 +146,8 @@ function stopDrag() { function adjustPosition() { if (isFullScreen.value) return - x.value = Math.max(0, Math.min(x.value, window.innerWidth - width.value)) - y.value = Math.max(0, Math.min(y.value, window.innerHeight - height.value)) + x.value = Math.min(x.value, window.innerWidth - width.value) + y.value = Math.min(y.value, window.innerHeight - height.value) } function handleResize() { diff --git a/src/components/utilities/ResetPassword.vue b/src/components/utilities/ResetPassword.vue index 3a7f037..68cb084 100644 --- a/src/components/utilities/ResetPassword.vue +++ b/src/components/utilities/ResetPassword.vue @@ -1,51 +1,53 @@ - - - \ No newline at end of file diff --git a/src/screens/Login.vue b/src/screens/Login.vue deleted file mode 100644 index cdfa67d..0000000 --- a/src/screens/Login.vue +++ /dev/null @@ -1,144 +0,0 @@ - - -