Build-IT_AI / admin-login.html
Urbanzulu's picture
i want an admin username and password setup. that way only i can access admin settings. set the admin username as urbanzulu19 and the password as Urbanzulu25$
0672088 verified
raw
history blame
5.9 kB
<!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>