From 5293f2f4c298bc33008cfec13e4b8e9d39d3d7c9 Mon Sep 17 00:00:00 2001 From: padreug Date: Thu, 18 Sep 2025 20:51:16 +0200 Subject: [PATCH] Enhance LoginDemo.vue with loading overlay and updated account creation feedback - Added a loading overlay to indicate account creation progress in demo mode. - Removed the display of generated credentials and updated the success message to show the created username. - Adjusted button text and added info text regarding automatic credential generation for improved user experience. These changes improve the clarity and responsiveness of the demo account creation process. --- src/pages/LoginDemo.vue | 69 ++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 46 deletions(-) diff --git a/src/pages/LoginDemo.vue b/src/pages/LoginDemo.vue index 14e574b..f90aaa7 100644 --- a/src/pages/LoginDemo.vue +++ b/src/pages/LoginDemo.vue @@ -42,7 +42,18 @@ -
+
+ +
+
+
+
+

Creating your demo account...

+

This will only take a moment

+
+
+
+

Create Demo Account

@@ -52,41 +63,16 @@

- -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- These credentials will be used to automatically log you in -
-
- + + +

+ Your credentials will be generated automatically +

@@ -164,7 +150,7 @@ import { useDemoAccountGenerator } from '@/composables/useDemoAccountGenerator' import { toast } from 'vue-sonner' const router = useRouter() -const { isLoading, error, generatedCredentials, generateNewCredentials } = useDemoAccountGenerator() +const { isLoading, error, generateNewCredentials } = useDemoAccountGenerator() const successMessage = ref('') const activeMode = ref<'demo' | 'login'>('demo') @@ -178,16 +164,6 @@ const canLogin = computed(() => { return loginForm.value.username.trim() && loginForm.value.password.trim() }) -// Copy text to clipboard -async function copyToClipboard(text: string) { - try { - await navigator.clipboard.writeText(text) - toast.success('Copied to clipboard!') - } catch (err) { - toast.error('Failed to copy to clipboard') - } -} - // Create fake account and automatically log in async function createFakeAccount() { try { @@ -206,13 +182,14 @@ async function createFakeAccount() { password_repeat: credentials.password }) - successMessage.value = 'Account created successfully! Logging you in...' - toast.success('Demo account created and logged in!') + // Show success with username + successMessage.value = `Account created! Username: ${credentials.username}` + toast.success(`Logged in as ${credentials.username}!`) // Redirect to home page after successful registration setTimeout(() => { router.push('/') - }, 1500) + }, 2000) } catch (err) { error.value = err instanceof Error ? err.message : 'Failed to create demo account'