@@ -157,14 +129,10 @@ onUnmounted(() => {
}
.social-info {
- @apply flex justify-center items-center w-full;
+ @apply flex flex-row;
+ @apply py-4 w-full;
+ @apply justify-center ;
@apply max-h-52;
-@apply px-1;
- @apply gap-8;
-
- .name-button {
- @apply flex flex-col gap-y-4;
- }
}
diff --git a/frontend/src/views/creators/BannerEditor.vue b/frontend/src/views/creators/BannerEditor.vue
index d844820..e7ac610 100644
--- a/frontend/src/views/creators/BannerEditor.vue
+++ b/frontend/src/views/creators/BannerEditor.vue
@@ -33,9 +33,9 @@
@@ -55,13 +55,20 @@
@@ -89,9 +96,8 @@ const fallbackUrl = '/images/hutopymedia/banners/hutopyul.png'
const errorMessage = ref('')
const showCropper = ref(false)
const cropper = ref(null)
-
-const TARGET_WIDTH = 960
-const TARGET_HEIGHT = 320
+const isUploading = ref(false)
+const uploadProgress = ref(0)
// Get translations for this component
const { t } = useI18n()
@@ -151,15 +157,22 @@ const applyCrop = () => {
const client = useClient()
const publish = async () => {
- if (!selectedFile.value) return
+ if (!selectedFile.value || isUploading.value) return
try {
+ isUploading.value = true
+ uploadProgress.value = 0
const formData = new FormData()
formData.append('file', selectedFile.value)
const response = await client.post(
`/api/creators/${props.creator.id}/banner`,
- formData
+ formData,
+ {
+ onUploadProgress: (progressEvent) => {
+ uploadProgress.value = Math.round((progressEvent.loaded * 100) / progressEvent.total)
+ }
+ }
)
props.creator.images.banner = `${response.data.blobUrl}?t=${Date.now()}`
@@ -167,6 +180,9 @@ const publish = async () => {
} catch (error) {
console.error(error)
errorMessage.value = t('errors.imageUpload')
+ } finally {
+ isUploading.value = false
+ uploadProgress.value = 0
}
}
@@ -202,8 +218,8 @@ const cancel = () => {
}
.preview-image {
- @apply w-[960px];
- @apply h-[320px];
+ @apply w-full;
+ @apply aspect-[4/1];
@apply object-cover;
}
@@ -275,21 +291,51 @@ const cancel = () => {
:deep(.cropper) {
@apply max-h-full;
}
+
+.loading-spinner {
+ @apply inline-block;
+ @apply w-4;
+ @apply h-4;
+ @apply mr-2;
+ @apply border-2;
+ @apply border-white;
+ @apply border-t-transparent;
+ @apply rounded-full;
+ animation: spin 1s linear infinite;
+}
+
+@keyframes spin {
+ from {
+ transform: rotate(0deg);
+ }
+ to {
+ transform: rotate(360deg);
+ }
+}
{
"en": {
+ "title": "Banner Editor",
+ "description": "Upload or edit your profile banner image. The recommended size is 1024x256 pixels (4:1 ratio).",
"chooseImage": "Choose an image",
- "clickToEdit": "Click to edit"
+ "clickToEdit": "Click to edit",
+ "uploading": "Uploading"
},
"fr": {
+ "title": "Éditeur de bannière",
+ "description": "Téléchargez ou modifiez votre image de bannière de profil. La taille recommandée est de 1024x256 pixels (ratio 4:1).",
"chooseImage": "Choisir une image",
- "clickToEdit": "Cliquez pour modifier"
+ "clickToEdit": "Cliquez pour modifier",
+ "uploading": "Téléchargement"
},
"es": {
+ "title": "Editor de banner",
+ "description": "Sube o edita tu imagen de banner de perfil. El tamaño recomendado es de 1024x256 píxeles (ratio 4:1).",
"chooseImage": "Elegir una imagen",
- "clickToEdit": "Haga clic para editar"
+ "clickToEdit": "Haga clic para editar",
+ "uploading": "Subiendo"
}
}