Spaces:
Running
Running
File size: 5,895 Bytes
0672088 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | <!DOCTYPE html>
<html lang="en" class="dark">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login | CodeForge-AI</title>
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
primary: '#ef4444',
secondary: '#6b7280'
}
}
}
}
</script>
</head>
<body class="bg-gray-900 text-white min-h-screen flex items-center justify-center">
<div class="max-w-md w-full mx-4">
<div class="bg-gray-800 rounded-2xl p-8 border border-purple-500/20 shadow-2xl">
<!-- Logo -->
<div class="text-center mb-8">
<div class="flex items-center justify-center space-x-3 mb-4">
<div class="w-12 h-12 bg-purple-500 rounded-xl flex items-center justify-center">
<i data-feather="shield" class="w-6 h-6"></i>
</div>
<span class="text-2xl font-bold text-white">CodeForge-AI</span>
</div>
<h1 class="text-3xl font-bold text-white">Admin Login</h1>
<p class="text-gray-400 mt-2">Enter your credentials to access the admin panel</p>
</div>
<!-- Login Form -->
<form id="loginForm" class="space-y-6">
<div>
<label for="username" class="block text-sm font-medium text-gray-300 mb-2">Username</label>
<input
type="text"
id="username"
name="username"
required
class="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-colors"
placeholder="Enter your username"
>
</div>
<div>
<label for="password" class="block text-sm font-medium text-gray-300 mb-2">Password</label>
<input
type="password"
id="password"
name="password"
required
class="w-full px-4 py-3 bg-gray-700 border border-gray-600 rounded-xl text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent transition-colors"
placeholder="Enter your password"
>
</div>
<div id="errorMessage" class="hidden bg-red-500/20 border border-red-500/50 rounded-xl p-4">
<div class="flex items-center space-x-2 text-red-400">
<i data-feather="alert-circle" class="w-5 h-5"></i>
<span class="text-sm font-medium" id="errorText">Invalid username or password</span>
</div>
</div>
<button
type="submit"
class="w-full bg-purple-500 hover:bg-purple-600 text-white py-3 rounded-xl font-semibold transition-colors flex items-center justify-center"
>
<i data-feather="log-in" class="w-5 h-5 mr-2"></i>
Sign In
</button>
</form>
<div class="mt-6 text-center">
<a href="index.html" class="text-purple-400 hover:text-purple-300 transition-colors text-sm">
<i data-feather="arrow-left" class="w-4 h-4 inline mr-1"></i>
Back to Home
</a>
</div>
</div>
</div>
<script>
// Initialize Feather Icons
feather.replace();
// Handle form submission
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const errorMessage = document.getElementById('errorMessage');
const errorText = document.getElementById('errorText');
// Check credentials
if (username === 'urbanzulu19' && password === 'Urbanzulu25$') {
// Store credentials in localStorage
localStorage.setItem('adminUsername', username);
localStorage.setItem('adminPassword', password);
// Redirect to admin panel
window.location.href = 'admin.html';
} else {
// Show error message
errorText.textContent = 'Invalid username or password';
errorMessage.classList.remove('hidden');
// Clear password field
document.getElementById('password').value = '';
}
});
// Check if already logged in
document.addEventListener('DOMContentLoaded', function() {
const adminUsername = localStorage.getItem('adminUsername');
const adminPassword = localStorage.getItem('adminPassword');
if (adminUsername === 'urbanzulu19' && adminPassword === 'Urbanzulu25$') {
window.location.href = 'admin.html';
}
});
</script>
</body>
</html> |