From 6856d3b9af32cc9771c354ba6ff7f66ef5a1519c Mon Sep 17 00:00:00 2001 From: Peaceultime Date: Wed, 11 Sep 2024 17:47:04 +0200 Subject: [PATCH] Progressing on profile edition and thumbnail cropping --- components/canvas/CanvasRenderer.vue | 7 --- components/explorer/PreviewContent.vue | 35 ++++++----- components/prose/ProseTag.vue | 31 +++++----- components/standard/Dialog.vue | 41 +++++++++++++ components/standard/HoverPopup.vue | 6 +- components/standard/InputField.vue | 8 +-- components/standard/NavBar.vue | 7 +-- components/standard/Picture.vue | 31 ++++++++++ components/standard/Upload.vue | 27 +++++++++ db.sqlite | Bin 864256 -> 860160 bytes modules/database.sync/module.ts | 18 +++--- nuxt.config.ts | 7 ++- pages/user/login.vue | 6 +- pages/user/profile.vue | 81 +++++++++++++++++++++++-- pages/user/register.vue | 19 +++--- pages/users/[id].vue | 4 +- public/icons/close.svg | 3 + public/{users => icons}/unknown.svg | 0 server/api/auth/login.post.ts | 4 +- server/api/users/[id]/comments.get.ts | 4 +- server/api/users/[id]/projects.get.ts | 4 +- server/plugins/session.ts | 10 +-- server/utils/user.ts | 6 +- template.sqlite | Bin 839680 -> 839680 bytes utils/utils.ts | 7 +++ 25 files changed, 278 insertions(+), 88 deletions(-) create mode 100644 components/standard/Dialog.vue create mode 100644 components/standard/Picture.vue create mode 100644 components/standard/Upload.vue create mode 100644 public/icons/close.svg rename public/{users => icons}/unknown.svg (100%) diff --git a/components/canvas/CanvasRenderer.vue b/components/canvas/CanvasRenderer.vue index 26e9d24..9bb7b58 100644 --- a/components/canvas/CanvasRenderer.vue +++ b/components/canvas/CanvasRenderer.vue @@ -15,13 +15,6 @@ const reset = (_: MouseEvent) => { dispX.value = 0; dispY.value = 0; } -function clamp(x: number, min: number, max: number): number { - if (x > max) - return max; - if (x < min) - return min; - return x; -} function edgePos(side: 'bottom' | 'top' | 'left' | 'right', pos: { x: number, y: number }, offset: number): { x: number, y: number } { switch (side) { case "left": diff --git a/components/explorer/PreviewContent.vue b/components/explorer/PreviewContent.vue index 74b9f1a..d57be5d 100644 --- a/components/explorer/PreviewContent.vue +++ b/components/explorer/PreviewContent.vue @@ -1,25 +1,28 @@