2025-12-13 22:59:42 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<title>Admin Login - Sky Art Shop</title>
|
|
|
|
|
<link
|
2026-01-01 22:24:30 -06:00
|
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
|
2025-12-13 22:59:42 -06:00
|
|
|
rel="stylesheet"
|
|
|
|
|
/>
|
2026-01-01 22:24:30 -06:00
|
|
|
<link
|
|
|
|
|
rel="stylesheet"
|
|
|
|
|
href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.2/font/bootstrap-icons.css"
|
|
|
|
|
/>
|
2025-12-13 22:59:42 -06:00
|
|
|
<style>
|
|
|
|
|
body {
|
2026-01-01 22:24:30 -06:00
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.login-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
}
|
|
|
|
|
.logo-section {
|
|
|
|
|
flex: 1;
|
|
|
|
|
background-color: #ffffff;
|
2025-12-13 22:59:42 -06:00
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2026-01-01 22:24:30 -06:00
|
|
|
padding: 40px;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2026-01-01 22:24:30 -06:00
|
|
|
.logo-content {
|
|
|
|
|
text-align: center;
|
|
|
|
|
max-width: 1100px;
|
|
|
|
|
}
|
|
|
|
|
.logo-image {
|
|
|
|
|
width: 100%;
|
|
|
|
|
max-width: 1000px;
|
|
|
|
|
height: auto;
|
|
|
|
|
margin-bottom: 20px;
|
|
|
|
|
}
|
|
|
|
|
.form-section {
|
|
|
|
|
flex: 1;
|
|
|
|
|
background-color: #ffd0d0;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
2025-12-13 22:59:42 -06:00
|
|
|
padding: 40px;
|
2026-01-01 22:24:30 -06:00
|
|
|
position: relative;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.login-box {
|
|
|
|
|
background: white;
|
|
|
|
|
border: 2px solid #333;
|
|
|
|
|
padding: 60px 50px;
|
2025-12-13 22:59:42 -06:00
|
|
|
width: 100%;
|
2026-01-01 22:24:30 -06:00
|
|
|
max-width: 500px;
|
|
|
|
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2026-01-01 22:24:30 -06:00
|
|
|
.login-title {
|
|
|
|
|
font-size: 2.5rem;
|
|
|
|
|
font-weight: bold;
|
2025-12-13 22:59:42 -06:00
|
|
|
text-align: center;
|
|
|
|
|
margin-bottom: 10px;
|
2026-01-01 22:24:30 -06:00
|
|
|
color: #333;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2026-01-01 22:24:30 -06:00
|
|
|
.login-subtitle {
|
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
color: #666;
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-bottom: 40px;
|
|
|
|
|
}
|
|
|
|
|
.form-label {
|
|
|
|
|
font-weight: 600;
|
|
|
|
|
color: #333;
|
|
|
|
|
margin-bottom: 5px;
|
|
|
|
|
font-size: 1rem;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
.form-control {
|
2026-01-01 22:24:30 -06:00
|
|
|
border: 2px solid #ddd;
|
|
|
|
|
padding: 12px 15px;
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
border-radius: 4px;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
.form-control:focus {
|
2026-01-01 22:24:30 -06:00
|
|
|
border-color: #333;
|
|
|
|
|
box-shadow: none;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2026-01-01 22:24:30 -06:00
|
|
|
.btn-group-custom {
|
|
|
|
|
display: flex;
|
|
|
|
|
gap: 15px;
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
margin-bottom: 30px;
|
|
|
|
|
}
|
|
|
|
|
.btn-custom {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 12px 20px;
|
|
|
|
|
font-size: 1rem;
|
2025-12-13 22:59:42 -06:00
|
|
|
font-weight: 600;
|
2026-01-01 22:24:30 -06:00
|
|
|
border: 2px solid #333;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
transition: all 0.3s;
|
|
|
|
|
}
|
|
|
|
|
.btn-login {
|
|
|
|
|
background-color: white;
|
|
|
|
|
color: #333;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
.btn-login:hover {
|
2026-01-01 22:24:30 -06:00
|
|
|
background-color: #333;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
.btn-reset {
|
|
|
|
|
background-color: white;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
.btn-reset:hover {
|
|
|
|
|
background-color: #333;
|
|
|
|
|
color: white;
|
|
|
|
|
}
|
|
|
|
|
.back-link {
|
|
|
|
|
text-align: center;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
}
|
|
|
|
|
.back-link a {
|
|
|
|
|
color: #ff6b6b;
|
|
|
|
|
text-decoration: none;
|
|
|
|
|
font-size: 1.1rem;
|
|
|
|
|
font-weight: 500;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
2026-01-01 22:24:30 -06:00
|
|
|
.back-link a:hover {
|
|
|
|
|
color: #ff5252;
|
|
|
|
|
text-decoration: underline;
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
.alert {
|
2026-01-01 22:24:30 -06:00
|
|
|
margin-bottom: 25px;
|
|
|
|
|
border-radius: 4px;
|
|
|
|
|
padding: 12px 15px;
|
2025-12-13 22:59:42 -06:00
|
|
|
display: none;
|
|
|
|
|
}
|
2026-01-01 22:24:30 -06:00
|
|
|
.alert.show {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
|
|
|
|
@media (max-width: 992px) {
|
|
|
|
|
.login-container {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
}
|
|
|
|
|
.logo-section,
|
|
|
|
|
.form-section {
|
|
|
|
|
flex: none;
|
|
|
|
|
height: 50vh;
|
|
|
|
|
}
|
|
|
|
|
.color-code {
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
}
|
|
|
|
|
.login-box {
|
|
|
|
|
padding: 40px 30px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@media (max-width: 576px) {
|
|
|
|
|
.login-box {
|
|
|
|
|
padding: 30px 20px;
|
|
|
|
|
}
|
|
|
|
|
.login-title {
|
|
|
|
|
font-size: 2rem;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-12-13 22:59:42 -06:00
|
|
|
</style>
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
2026-01-01 22:24:30 -06:00
|
|
|
<div class="login-container">
|
|
|
|
|
<!-- Left Section - Logo -->
|
|
|
|
|
<div class="logo-section">
|
|
|
|
|
<div class="logo-content">
|
|
|
|
|
<img
|
|
|
|
|
src="/uploads/cat-logo-template-page-20251224-194356-0000-1766724728795-173839741.png"
|
|
|
|
|
alt="Sky Art Shop Logo"
|
|
|
|
|
class="logo-image"
|
|
|
|
|
onerror="this.style.display='none'; this.nextElementSibling.style.display='block';"
|
|
|
|
|
/>
|
|
|
|
|
<div style="display: none">
|
|
|
|
|
<svg
|
|
|
|
|
width="400"
|
|
|
|
|
height="300"
|
|
|
|
|
viewBox="0 0 400 300"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
>
|
|
|
|
|
<!-- Cat Silhouette -->
|
|
|
|
|
<path
|
|
|
|
|
d="M120 80 Q100 60 90 80 L80 100 Q70 120 80 140 L100 160 Q110 180 140 180 L160 185 Q180 190 200 180 L220 160 Q230 140 220 120 L210 100 Q200 80 180 80 Z"
|
|
|
|
|
fill="#000"
|
|
|
|
|
/>
|
|
|
|
|
<circle cx="110" cy="100" r="8" fill="#000" />
|
|
|
|
|
<circle cx="170" cy="100" r="8" fill="#000" />
|
|
|
|
|
<!-- Text -->
|
|
|
|
|
<text
|
|
|
|
|
x="50"
|
|
|
|
|
y="240"
|
|
|
|
|
font-family="'Brush Script MT', cursive"
|
|
|
|
|
font-size="48"
|
|
|
|
|
fill="#000"
|
|
|
|
|
>
|
|
|
|
|
Sky Art Shop
|
|
|
|
|
</text>
|
|
|
|
|
</svg>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
|
2026-01-01 22:24:30 -06:00
|
|
|
<!-- Right Section - Form -->
|
|
|
|
|
<div class="form-section">
|
|
|
|
|
<div class="login-box">
|
|
|
|
|
<h1 class="login-title">Sky Art Shop</h1>
|
|
|
|
|
<p class="login-subtitle">Admin Panel Login</p>
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2026-01-01 22:24:30 -06:00
|
|
|
<div class="alert alert-danger" role="alert" id="errorAlert"></div>
|
|
|
|
|
|
|
|
|
|
<form id="loginForm">
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label for="email" class="form-label">Username:</label>
|
|
|
|
|
<input
|
|
|
|
|
type="email"
|
|
|
|
|
class="form-control"
|
|
|
|
|
id="email"
|
|
|
|
|
name="email"
|
|
|
|
|
required
|
|
|
|
|
placeholder="Enter your email"
|
|
|
|
|
autocomplete="username"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2026-01-01 22:24:30 -06:00
|
|
|
<div class="mb-3">
|
|
|
|
|
<label for="password" class="form-label">Password:</label>
|
|
|
|
|
<input
|
|
|
|
|
type="password"
|
|
|
|
|
class="form-control"
|
|
|
|
|
id="password"
|
|
|
|
|
name="password"
|
|
|
|
|
required
|
|
|
|
|
placeholder="Enter your password"
|
|
|
|
|
autocomplete="current-password"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="btn-group-custom">
|
|
|
|
|
<button type="submit" class="btn-custom btn-login" id="loginBtn">
|
|
|
|
|
Login
|
|
|
|
|
</button>
|
|
|
|
|
<button type="reset" class="btn-custom btn-reset">Reset</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
<div class="back-link">
|
|
|
|
|
<a href="/">Back to Website</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-01-01 22:24:30 -06:00
|
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
2025-12-13 22:59:42 -06:00
|
|
|
<script>
|
|
|
|
|
document
|
|
|
|
|
.getElementById("loginForm")
|
|
|
|
|
.addEventListener("submit", async function (e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
const email = document.getElementById("email").value;
|
|
|
|
|
const password = document.getElementById("password").value;
|
|
|
|
|
const errorAlert = document.getElementById("errorAlert");
|
|
|
|
|
const loginBtn = document.getElementById("loginBtn");
|
|
|
|
|
|
|
|
|
|
// Disable button during login
|
|
|
|
|
loginBtn.disabled = true;
|
2026-01-01 22:24:30 -06:00
|
|
|
loginBtn.textContent = "Logging in...";
|
|
|
|
|
errorAlert.classList.remove("show");
|
2025-12-13 22:59:42 -06:00
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
const response = await fetch("/api/admin/login", {
|
|
|
|
|
method: "POST",
|
|
|
|
|
headers: {
|
|
|
|
|
"Content-Type": "application/json",
|
|
|
|
|
},
|
|
|
|
|
credentials: "include",
|
|
|
|
|
body: JSON.stringify({ email, password }),
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const data = await response.json();
|
|
|
|
|
|
|
|
|
|
if (response.ok && data.success) {
|
|
|
|
|
// Login successful - redirect to dashboard
|
2026-01-01 22:24:30 -06:00
|
|
|
window.location.href = "/admin/dashboard";
|
2025-12-13 22:59:42 -06:00
|
|
|
} else {
|
|
|
|
|
// Show error
|
2026-01-01 22:24:30 -06:00
|
|
|
errorAlert.innerHTML =
|
|
|
|
|
'<i class="bi bi-exclamation-triangle"></i> ' +
|
|
|
|
|
(data.message || "Invalid credentials");
|
|
|
|
|
errorAlert.classList.add("show");
|
2025-12-13 22:59:42 -06:00
|
|
|
loginBtn.disabled = false;
|
2026-01-01 22:24:30 -06:00
|
|
|
loginBtn.textContent = "Login";
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error("Login error:", error);
|
2026-01-01 22:24:30 -06:00
|
|
|
errorAlert.innerHTML =
|
|
|
|
|
'<i class="bi bi-exclamation-triangle"></i> Login failed. Please try again.';
|
|
|
|
|
errorAlert.classList.add("show");
|
2025-12-13 22:59:42 -06:00
|
|
|
loginBtn.disabled = false;
|
2026-01-01 22:24:30 -06:00
|
|
|
loginBtn.textContent = "Login";
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|