-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin-log.html
More file actions
226 lines (187 loc) · 5.44 KB
/
admin-log.html
File metadata and controls
226 lines (187 loc) · 5.44 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Login | LUMIEARN</title>
<!-- Fonts & Icons -->
<link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css"/>
<style>
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
background:#050509;
font-family:'Orbitron',sans-serif;
display:flex;
justify-content:center;
align-items:center;
color:#fff;
flex-direction:column;
}
.container{
width:100%;
max-width:440px;
background:#0f0f18;
padding:40px 32px;
border-radius:22px;
border:1px solid rgba(255,59,59,.45);
box-shadow:0 0 35px rgba(255,0,0,.45);
text-align:center;
}
h1{
color:#ff3b3b;
margin-bottom:8px;
}
.note{
font-size:12px;
opacity:.85;
margin-bottom:26px;
}
.group{margin-bottom:18px}
.input{position:relative}
.input i.left{
position:absolute;
left:16px;
top:50%;
transform:translateY(-50%);
color:#ff3b3b;
}
.input i.toggle{
position:absolute;
right:16px;
top:50%;
transform:translateY(-50%);
color:#ff3b3b;
cursor:pointer;
}
.input input{
width:100%;
height:54px;
padding:0 44px;
background:transparent;
border:1px solid rgba(255,59,59,.45);
border-radius:14px;
color:#fff;
font-size:14px;
}
.input input:focus{
outline:none;
border-color:#ff3b3b;
box-shadow:0 0 12px rgba(255,59,59,.5);
}
button{
width:100%;
height:56px;
border:none;
border-radius:16px;
background:#ff3b3b;
color:#050509;
font-weight:700;
font-size:16px;
cursor:pointer;
margin-top:10px;
}
button:hover{
box-shadow:0 0 22px rgba(255,59,59,.9);
}
#alert{
display:none;
margin-bottom:16px;
padding:12px;
border-radius:12px;
font-size:13px;
font-weight:600;
}
footer{
margin-top:20px;
font-size:12px;
opacity:.7;
color:#ff3b3b;
}
</style>
</head>
<body>
<div class="container">
<h1>LUMIEARN ADMIN LOGIN</h1>
<div class="note">🔑 Login with admin username or email</div>
<div id="alert"></div>
<form id="loginForm">
<div class="group">
<div class="input">
<i class="fa-solid fa-user left"></i>
<input type="text" id="userLogin" placeholder="USERNAME OR EMAIL" required>
</div>
</div>
<div class="group">
<div class="input">
<i class="fa-solid fa-lock left"></i>
<input type="password" id="loginPassword" placeholder="PASSWORD" required>
<i class="fa-solid fa-eye toggle"></i>
</div>
</div>
<button type="submit">LOGIN</button>
</form>
</div>
<footer>LUMIEARN © 2026 | Admin Login</footer>
<!-- ================= LOGIN SCRIPT ================= -->
<script>
const alertBox = document.getElementById("alert");
const loginForm = document.getElementById("loginForm");
const userInput = document.getElementById("userLogin");
const passwordInput = document.getElementById("loginPassword");
const toggleIcon = document.querySelector(".toggle");
function showAlert(msg, type="error"){
alertBox.style.display = "block";
alertBox.textContent = msg;
alertBox.style.background = type==="error" ? "#ff4d4d" : "#28ffb0";
alertBox.style.color = "#000";
setTimeout(()=>alertBox.style.display="none",3000);
}
toggleIcon.onclick = () => {
passwordInput.type =
passwordInput.type === "password" ? "text" : "password";
toggleIcon.classList.toggle("fa-eye-slash");
};
userInput.addEventListener("input",()=>{
userInput.value = userInput.value.replace(/[^a-zA-Z0-9@._-]/g,"");
});
passwordInput.addEventListener("input",()=>{
passwordInput.value = passwordInput.value.replace(/\s/g,"");
});
loginForm.onsubmit = e => {
e.preventDefault();
const loginValue = userInput.value.trim();
const password = passwordInput.value;
if(!loginValue || !password){
return showAlert("All fields are required");
}
let adminFound = null;
for(let i=0;i<localStorage.length;i++){
const key = localStorage.key(i);
if(!key.startsWith("LUMIEARN_ADMIN_")) continue;
const admin = JSON.parse(localStorage.getItem(key));
if(
admin.username === loginValue.toUpperCase() ||
admin.email === loginValue.toLowerCase()
){
adminFound = admin;
break;
}
}
if(!adminFound) return showAlert("Admin not found");
if(adminFound.password !== password) return showAlert("Incorrect password");
localStorage.setItem("LUMIEARN_CURRENT_ADMIN", adminFound.username);
localStorage.setItem("LUMIEARN_ADMIN_SESSION", JSON.stringify({
username: adminFound.username,
role: adminFound.role || "admin",
loginTime: Date.now()
}));
showAlert("Login successful","success");
setTimeout(()=>{
window.location.href = "admin-overview.html";
},800);
};
</script>
</body>
</html>