|
@@ -0,0 +1,132 @@
|
|
|
+<template>
|
|
|
+ <div class="min-h-screen bg-gradient-to-br from-blue-50 to-blue-100/50">
|
|
|
+ <div class="container mx-auto px-4">
|
|
|
+ <!-- Header -->
|
|
|
+ <header class="flex justify-between items-center py-6">
|
|
|
+ <div class="text-2xl font-bold text-white">
|
|
|
+ <h1>MyApp</h1>
|
|
|
+ <div class="text-sm">Welcome to MyApp</div>
|
|
|
+ </div>
|
|
|
+ <button class="flex items-center text-blue-600 hover:text-blue-700">
|
|
|
+ <Globe class="w-4 h-4 mr-1" />
|
|
|
+ English
|
|
|
+ </button>
|
|
|
+ </header>
|
|
|
+
|
|
|
+ <!-- Login Form -->
|
|
|
+ <div class="max-w-md mx-auto mt-12 bg-white rounded-lg shadow-lg p-8">
|
|
|
+ <h2 class="text-3xl font-bold text-center mb-2 text-blue-600">
|
|
|
+ Welcome Back
|
|
|
+ </h2>
|
|
|
+ <p class="text-center text-gray-600 mb-8">Please log in to your account</p>
|
|
|
+
|
|
|
+ <form @submit.prevent="handleSubmit">
|
|
|
+ <div class="space-y-6">
|
|
|
+ <div>
|
|
|
+ <label class="block text-sm font-medium text-gray-700 mb-1">Username</label>
|
|
|
+ <input
|
|
|
+ v-model="form.username"
|
|
|
+ type="text"
|
|
|
+ placeholder="Enter your username"
|
|
|
+ class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
+ />
|
|
|
+ <div v-if="errors.username" class="text-red-500 text-sm mt-1">{{ errors.username }}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div>
|
|
|
+ <label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
|
|
|
+ <input
|
|
|
+ v-model="form.password"
|
|
|
+ type="password"
|
|
|
+ placeholder="Enter your password"
|
|
|
+ class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
|
|
|
+ />
|
|
|
+ <div v-if="errors.password" class="text-red-500 text-sm mt-1">{{ errors.password }}</div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="flex items-center justify-between">
|
|
|
+ <label class="flex items-center">
|
|
|
+ <input
|
|
|
+ v-model="form.remember"
|
|
|
+ type="checkbox"
|
|
|
+ class="w-4 h-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500"
|
|
|
+ />
|
|
|
+ <span class="ml-2 text-sm text-gray-600">Remember me</span>
|
|
|
+ </label>
|
|
|
+ <a href="#/forgot-password" class="text-sm text-blue-600 hover:text-blue-700">Forgot password?</a>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button
|
|
|
+ type="submit"
|
|
|
+ class="w-full bg-blue-600 text-white py-2 px-4 rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
|
|
|
+ >
|
|
|
+ Log In
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+
|
|
|
+ <div class="mt-6">
|
|
|
+ <div class="relative">
|
|
|
+ <div class="absolute inset-0 flex items-center">
|
|
|
+ <div class="w-full border-t border-gray-300"></div>
|
|
|
+ </div>
|
|
|
+ <div class="relative flex justify-center text-sm">
|
|
|
+ <span class="px-2 bg-white text-gray-500">Other login options</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <button
|
|
|
+ class="mt-4 w-full border border-blue-600 text-blue-600 py-2 px-4 rounded-md hover:bg-blue-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"
|
|
|
+ >
|
|
|
+ Sign in with AD Domain
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- Footer -->
|
|
|
+ <footer class="text-center mt-8 pb-6 text-gray-600 text-sm">
|
|
|
+ © 2025 MyApp. All Rights Reserved.
|
|
|
+ </footer>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { ref } from 'vue'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import { Globe } from 'lucide-vue-next'
|
|
|
+
|
|
|
+const router = useRouter()
|
|
|
+
|
|
|
+const form = ref({
|
|
|
+ username: '',
|
|
|
+ password: '',
|
|
|
+ remember: false
|
|
|
+})
|
|
|
+
|
|
|
+const errors = ref({})
|
|
|
+
|
|
|
+const handleSubmit = () => {
|
|
|
+ // Basic validation
|
|
|
+ errors.value = {}
|
|
|
+ if (!form.value.username) {
|
|
|
+ errors.value.username = 'Username is required.'
|
|
|
+ }
|
|
|
+ if (!form.value.password) {
|
|
|
+ errors.value.password = 'Password is required.'
|
|
|
+ } else if (form.value.password.length < 6) {
|
|
|
+ errors.value.password = 'Password must be at least 6 characters long.'
|
|
|
+ }
|
|
|
+
|
|
|
+ // If there are no errors, proceed with login logic
|
|
|
+ if (Object.keys(errors.value).length === 0) {
|
|
|
+ // Simulate successful login
|
|
|
+ console.log('Form submitted:', form.value)
|
|
|
+ router.push('/home')
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* Add any additional custom styles here if needed */
|
|
|
+</style>
|