-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathadmin.html
More file actions
113 lines (100 loc) · 3.36 KB
/
admin.html
File metadata and controls
113 lines (100 loc) · 3.36 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css">
<style>
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f5f7fb;
}
.login-container {
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
width: 100%;
max-width: 400px;
}
h1 {
text-align: center;
color: #4a6bff;
margin-bottom: 2rem;
}
input {
width: 100%;
padding: 12px;
margin-bottom: 1rem;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
box-sizing: border-box;
}
button {
width: 100%;
padding: 12px;
background-color: #4a6bff;
color: white;
border: none;
border-radius: 4px;
font-size: 16px;
cursor: pointer;
margin-top: 1rem;
}
button:hover {
background-color: #3a5bef;
}
.error-message {
color: #c62828;
background-color: #ffebee;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
display: none;
}
.spinner {
display: none;
margin-left: 8px;
}
</style>
</head>
<body>
<div class="login-container">
<h1>Admin Login</h1>
<form id="loginForm">
<input type="text" id="username" placeholder="Username" required>
<input type="password" id="password" placeholder="Password" required>
<div class="error-message" id="errorMsg"></div>
<button type="submit" id="loginBtn">
<span class="button-text">Login</span>
<span class="spinner" id="spinner"><i class="fas fa-spinner fa-spin"></i></span>
</button>
</form>
</div>
<script>
document.getElementById('loginForm').addEventListener('submit', function(e) {
e.preventDefault();
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
const spinner = document.getElementById('spinner');
const errorMsg = document.getElementById('errorMsg');
const loginBtn = document.getElementById('loginBtn');
// Show loading state
loginBtn.disabled = true;
spinner.style.display = 'inline-block';
errorMsg.style.display = 'none';
// Simple validation (replace with your actual validation logic)
setTimeout(() => {
window.location.href = 'AdminDashboard.html';
}, 1000); // Simulate network delay
});
</script>
</body>
</html>