From 1dfc9c266c315d008fa19ee1b2e789d16c5209ab Mon Sep 17 00:00:00 2001
From: JustTemmie <47639983+JustTemmie@users.noreply.github.com>
Date: Thu, 3 Jul 2025 20:29:15 +0200
Subject: [PATCH 01/10] feat: dynamically load pfp when uploading a new one
---
components/Settings/UserSettings/Profile.vue | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/components/Settings/UserSettings/Profile.vue b/components/Settings/UserSettings/Profile.vue
index ed7da0a..0e648c6 100644
--- a/components/Settings/UserSettings/Profile.vue
+++ b/components/Settings/UserSettings/Profile.vue
@@ -31,6 +31,7 @@ import type { UserResponse } from '~/types/interfaces';
const { fetchUser } = useAuth();
+
const user: UserResponse | undefined = await fetchUser()
if (!user) {
alert("could not fetch user info, aborting :(")
@@ -90,7 +91,7 @@ async function changeAvatar() {
newPfpFile = file
const reader = new FileReader();
- reader.addEventListener("onload", () => {
+ reader.addEventListener("load", () => {
if (reader.result && typeof reader.result === 'string') {
user.avatar = reader.result;
}
--
2.47.2
From 3c5525d294461fe04ef64685f9c5bada10ebcee2 Mon Sep 17 00:00:00 2001
From: JustTemmie <47639983+JustTemmie@users.noreply.github.com>
Date: Thu, 3 Jul 2025 20:33:33 +0200
Subject: [PATCH 02/10] feat: display proper error messages when the client
fails to update profile info
---
components/Settings/UserSettings/Profile.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/Settings/UserSettings/Profile.vue b/components/Settings/UserSettings/Profile.vue
index 0e648c6..13a717a 100644
--- a/components/Settings/UserSettings/Profile.vue
+++ b/components/Settings/UserSettings/Profile.vue
@@ -65,7 +65,7 @@ async function saveChanges() {
alert('success!!')
} catch (error: any) {
if (error?.response?.status !== 200) {
- alert(`error ${error?.response?.status} met whilst trying to update profile info`)
+ alert(`error ${error?.response?.status} met whilst trying to update profile info\n"${error?.response._data?.message}"`)
}
}
};
--
2.47.2
From 873f1c81a91d2aeaa176b286c8f67fd94ab66f6d Mon Sep 17 00:00:00 2001
From: JustTemmie <47639983+JustTemmie@users.noreply.github.com>
Date: Fri, 4 Jul 2025 06:34:15 +0200
Subject: [PATCH 03/10] fix: remove weird spacing due to weird profile popup
inheritance
---
components/MemberEntry.vue | 7 +------
components/Settings/UserSettings/Account.vue | 4 ----
components/Settings/UserSettings/Profile.vue | 4 ++--
3 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/components/MemberEntry.vue b/components/MemberEntry.vue
index 3eed3c5..c77c429 100644
--- a/components/MemberEntry.vue
+++ b/components/MemberEntry.vue
@@ -3,7 +3,7 @@
{{ props.member.user.display_name ?? props.member.user.username }}
-
+
@@ -32,9 +32,4 @@ const hidePopup = () => {
.member-item {
position: relative; /* Set the position to relative for absolute positioning of the popup */
}
-
-.profile-popup {
- position: absolute; /* Use absolute positioning */
- left: -100px; /* Adjust this value to position the popup to the left */
-}
diff --git a/components/Settings/UserSettings/Account.vue b/components/Settings/UserSettings/Account.vue
index 85589e7..ffbb9d7 100644
--- a/components/Settings/UserSettings/Account.vue
+++ b/components/Settings/UserSettings/Account.vue
@@ -93,8 +93,4 @@ async function deleteAccount() {
color: var(--text-color);
background-color: var(--accent-color);
}
-
-.profile-popup {
- margin-left: 2dvw;
-}
\ No newline at end of file
diff --git a/components/Settings/UserSettings/Profile.vue b/components/Settings/UserSettings/Profile.vue
index 13a717a..f1a550b 100644
--- a/components/Settings/UserSettings/Profile.vue
+++ b/components/Settings/UserSettings/Profile.vue
@@ -20,7 +20,7 @@
-
+
@@ -133,7 +133,7 @@ async function changeAvatar() {
background-color: var(--accent-color);
}
-.profile-popup {
+#profile-popup {
margin-left: 2dvw;
}
\ No newline at end of file
--
2.47.2
From 3c4965c06f96ee215834dc2ea1fb14f0037d600d Mon Sep 17 00:00:00 2001
From: JustTemmie <47639983+JustTemmie@users.noreply.github.com>
Date: Fri, 4 Jul 2025 08:04:50 +0200
Subject: [PATCH 04/10] feat: start implementing image cropping when uploading
pfp
still need to fix the selection to within the canvas boundries, and fix theming
---
components/CropPopup.vue | 61 ++++++++++
components/Settings/UserSettings/Profile.vue | 37 ++++++-
package.json | 1 +
pnpm-lock.yaml | 110 +++++++++++++++++++
4 files changed, 208 insertions(+), 1 deletion(-)
create mode 100644 components/CropPopup.vue
diff --git a/components/CropPopup.vue b/components/CropPopup.vue
new file mode 100644
index 0000000..2e1a6b1
--- /dev/null
+++ b/components/CropPopup.vue
@@ -0,0 +1,61 @@
+
+
+
+
+
+
+
diff --git a/components/Settings/UserSettings/Profile.vue b/components/Settings/UserSettings/Profile.vue
index f1a550b..1df8c44 100644
--- a/components/Settings/UserSettings/Profile.vue
+++ b/components/Settings/UserSettings/Profile.vue
@@ -21,12 +21,23 @@
+
+
+
+
+
diff --git a/components/Settings/UserSettings/Profile.vue b/components/Settings/UserSettings/Profile.vue
index 1df8c44..e9542c9 100644
--- a/components/Settings/UserSettings/Profile.vue
+++ b/components/Settings/UserSettings/Profile.vue
@@ -22,16 +22,15 @@
-
-
-
+
@@ -101,8 +100,6 @@ async function changeAvatar() {
const file = input.files[0];
if (!file) return;
- newPfpFile = file
-
const reader = new FileReader();
reader.addEventListener("load", () => {
if (reader.result && typeof reader.result === 'string') {
@@ -171,4 +168,21 @@ function closeCropPopup() {
#profile-popup {
margin-left: 2dvw;
}
+
+#crop-popup-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: 10;
+ background: rgba(0,0,0,0.5);
+}
+
+#crop-popup-preview {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+}
\ No newline at end of file
--
2.47.2
From 181fcd04dbdc1a3bb66557a88c071a908582404b Mon Sep 17 00:00:00 2001
From: JustTemmie <47639983+JustTemmie@users.noreply.github.com>
Date: Fri, 4 Jul 2025 09:27:51 +0200
Subject: [PATCH 06/10] feat: ensure there's a background colour for the user
popup's avatar
---
components/UserPopup.vue | 2 ++
1 file changed, 2 insertions(+)
diff --git a/components/UserPopup.vue b/components/UserPopup.vue
index 3a65cf0..a3a15cb 100644
--- a/components/UserPopup.vue
+++ b/components/UserPopup.vue
@@ -59,12 +59,14 @@ const props = defineProps<{
width: 96px;
height: 96px;
border: 5px solid #4b3018;
+ background-color: var(--secondary-color);
border-radius: 100%;
position: absolute;
left: 16px;
top: 16px;
}
+
#display-name {
margin-top: 60px;
margin-bottom: 0;
--
2.47.2
From d9c6faa6ab4a2aad29189a03e855e0461c9eb969 Mon Sep 17 00:00:00 2001
From: JustTemmie <47639983+JustTemmie@users.noreply.github.com>
Date: Fri, 4 Jul 2025 09:43:05 +0200
Subject: [PATCH 07/10] refactor: move stuff from profile to within the crop
popup itself
---
components/CropPopup.vue | 32 ++++++++++++++------
components/Settings/UserSettings/Profile.vue | 31 ++++---------------
2 files changed, 29 insertions(+), 34 deletions(-)
diff --git a/components/CropPopup.vue b/components/CropPopup.vue
index 7671e4d..8321cb1 100644
--- a/components/CropPopup.vue
+++ b/components/CropPopup.vue
@@ -1,8 +1,10 @@
-
-
+