| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>WinDeskOS - Login</title> |
| <link rel="icon" type="image/x-icon" href="/static/favicon.ico"> |
| <script src="https://cdn.tailwindcss.com"></script> |
| <script src="https://unpkg.com/feather-icons"></script> |
| <style> |
| @import url('https://fonts.googleapis.com/css2?family=Segoe+UI:wght@300;400;500;600&display=swap'); |
| * { font-family: 'Segoe UI', sans-serif; } |
| .login-window { |
| box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3); |
| border: 1px solid rgba(255, 255, 255, 0.1); |
| backdrop-filter: blur(10px); |
| } |
| </style> |
| </head> |
| <body class="bg-gray-900 min-h-screen flex items-center justify-center"> |
| <div class="login-window bg-gray-800 bg-opacity-95 rounded-lg w-96 p-8"> |
| <div class="text-center mb-8"> |
| <i data-feather="user" class="w-16 h-16 text-blue-400 mx-auto mb-4"></i> |
| <h1 class="text-2xl font-semibold text-white">WinDeskOS Login</h1> |
| <p class="text-gray-400 mt-2">Please sign in to your account</p> |
| </div> |
| |
| <form id="login-form" class="space-y-4"> |
| <div> |
| <label class="block text-sm font-medium text-gray-300 mb-2">Username</label> |
| <input type="text" id="username" name="username" |
| class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500" |
| placeholder="Enter your username" required> |
| </div> |
| |
| <div> |
| <label class="block text-sm font-medium text-gray-300 mb-2">Password</label> |
| <input type="password" id="password" name="password" |
| class="w-full bg-gray-700 border border-gray-600 rounded-lg px-4 py-2 text-white focus:outline-none focus:ring-2 focus:ring-blue-500" |
| placeholder="Enter your password" required> |
| </div> |
| |
| <div class="flex items-center justify-between"> |
| <label class="flex items-center"> |
| <input type="checkbox" id="remember-me" class="rounded bg-gray-700 border-gray-600 text-blue-500 focus:ring-blue-500"> |
| <span class="ml-2 text-sm text-gray-300">Remember me</span> |
| </label> |
| </div> |
| |
| <button type="submit" class="w-full bg-blue-600 hover:bg-blue-500 text-white font-medium py-2 px-4 rounded-lg transition-colors"> |
| Sign In |
| </button> |
| </form> |
| |
| <div id="error-message" class="mt-4 text-red-400 text-sm hidden"></div> |
| |
| <div class="mt-6 text-center text-sm text-gray-400"> |
| <p>Demo credentials: admin / password123</p> |
| </div> |
| </div> |
|
|
| <script> |
| feather.replace(); |
| |
| document.getElementById('login-form').addEventListener('submit', function(e) { |
| e.preventDefault(); |
| |
| const username = document.getElementById('username').value; |
| const password = document.getElementById('password').value; |
| const rememberMe = document.getElementById('remember-me').checked; |
| const errorMessage = document.getElementById('error-message'); |
| |
| |
| if (username === 'admin' && password === 'password123') { |
| |
| const userData = { |
| username: username, |
| rememberMe: rememberMe, |
| loginTime: new Date().toISOString() |
| }; |
| |
| localStorage.setItem('currentUser', JSON.stringify(userData)); |
| |
| |
| window.location.href = 'index.html'; |
| } else { |
| errorMessage.textContent = 'Invalid username or password'; |
| errorMessage.classList.remove('hidden'); |
| setTimeout(() => { |
| errorMessage.classList.add('hidden'); |
| }, 3000); |
| } |
| }); |
| |
| |
| const currentUser = localStorage.getItem('currentUser'); |
| if (currentUser) { |
| window.location.href = 'index.html'; |
| } |
| </script> |
| </body> |
| </html> |