forked from UKSOURCE/cms.hailearning.edu.vn
first commit
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>
|
||||
<%= title %> | CMS-SIMS
|
||||
</title>
|
||||
<!-- Bootstrap CSS -->
|
||||
<title><%= title %> | ULDP Management</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
<!-- Global CSS Variables -->
|
||||
<link rel="stylesheet" href="/assets/css/variables.css">
|
||||
<!-- Custom CSS -->
|
||||
<style>
|
||||
body {
|
||||
font-family: var(--font-family);
|
||||
@@ -21,203 +14,257 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 55%, var(--primary-light) 100%);
|
||||
position: relative;
|
||||
background-color: var(--primary-color);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.main-content {
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
|
||||
}
|
||||
|
||||
.login-wrapper {
|
||||
width: 100%;
|
||||
max-width: 500px;
|
||||
padding: 20px;
|
||||
max-width: 420px;
|
||||
padding: 1.25rem;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
background-color: var(--bg-card);
|
||||
padding: 30px;
|
||||
.login-card {
|
||||
background: #fff;
|
||||
border-radius: var(--border-radius-lg);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
text-align: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.logo-container img {
|
||||
width: 100px;
|
||||
height: auto;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.img-shine {
|
||||
position: relative;
|
||||
box-shadow: 0 20px 60px rgba(0,0,0,0.25);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.img-shine::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
||||
transition: all 0.5s ease;
|
||||
.login-header {
|
||||
background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
|
||||
padding: 2rem 2rem 1.5rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.img-shine:hover::after {
|
||||
left: 100%;
|
||||
.login-logo {
|
||||
width: 150px;
|
||||
height: 100%;
|
||||
border-radius: 14px;
|
||||
/* background: rgba(255,255,255,0.15); */
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 auto 1rem;
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.login-logo img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
object-fit: contain;
|
||||
filter: brightness(0) invert(1);
|
||||
}
|
||||
|
||||
.login-title {
|
||||
color: #fff;
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 0.25rem;
|
||||
}
|
||||
|
||||
.login-subtitle {
|
||||
color: rgba(255,255,255,0.65);
|
||||
font-size: 0.8125rem;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.login-body { padding: 1.75rem 2rem 2rem; }
|
||||
|
||||
.form-label {
|
||||
font-weight: 600;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-main);
|
||||
margin-bottom: 0.35rem;
|
||||
}
|
||||
|
||||
.form-control {
|
||||
width: 100%;
|
||||
padding: 12px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 8px;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s ease;
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--border-radius-sm);
|
||||
padding: 0.6rem 0.875rem;
|
||||
font-size: 0.9rem;
|
||||
transition: var(--transition-base);
|
||||
height: 42px;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
border-color: var(--primary-color);
|
||||
box-shadow: 0 0 0 3px rgba(10,35,71,0.08);
|
||||
outline: none;
|
||||
border-color: var(--primary-color) !important;
|
||||
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
.password-wrapper { position: relative; }
|
||||
|
||||
.btn-shine {
|
||||
background: var(--primary-color);
|
||||
color: white;
|
||||
.password-toggle {
|
||||
position: absolute;
|
||||
right: 0.75rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
border: none;
|
||||
padding: 12px 30px;
|
||||
border-radius: 8px;
|
||||
font-weight: 600;
|
||||
font-size: 15px;
|
||||
background: none;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
text-transform: uppercase;
|
||||
padding: 0;
|
||||
font-size: 0.9rem;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.password-toggle:hover { color: var(--primary-color); }
|
||||
|
||||
.btn-login {
|
||||
background: var(--primary-color);
|
||||
color: #fff;
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: 44px;
|
||||
border-radius: var(--border-radius-sm);
|
||||
font-weight: 600;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
transition: var(--transition-base);
|
||||
letter-spacing: 0.02em;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
min-width: 150px;
|
||||
}
|
||||
|
||||
.btn-shine:hover {
|
||||
.btn-login:hover {
|
||||
background: var(--primary-light);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 4px 12px rgba(10, 35, 71, 0.2);
|
||||
box-shadow: 0 6px 20px rgba(10,35,71,0.3);
|
||||
}
|
||||
|
||||
.btn-shine::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
||||
transition: all 0.5s ease;
|
||||
.accent-link {
|
||||
color: var(--accent-color);
|
||||
font-weight: 600;
|
||||
text-decoration: none;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.btn-shine:hover::after {
|
||||
left: 100%;
|
||||
.accent-link:hover { color: var(--accent-light); }
|
||||
|
||||
.login-footer {
|
||||
text-align: center;
|
||||
margin-top: 1.25rem;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.main-content {
|
||||
padding: 15px;
|
||||
}
|
||||
.login-footer p {
|
||||
font-size: 0.75rem;
|
||||
color: rgba(255,255,255,0.45);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.login-container {
|
||||
padding: 20px;
|
||||
}
|
||||
.toast-area {
|
||||
position: fixed;
|
||||
top: 1rem;
|
||||
right: 1rem;
|
||||
z-index: 9999;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="main-content">
|
||||
<!-- Flash Messages Data (Hidden) -->
|
||||
<% if(typeof success_msg !=='undefined' || typeof error_msg !=='undefined' || typeof error !=='undefined' ) { %>
|
||||
<div id="flash-messages-data" style="display: none;"><%- JSON.stringify({ success_msg: typeof success_msg
|
||||
!=='undefined' && success_msg ? success_msg : null, error_msg: typeof error_msg !=='undefined' && error_msg ?
|
||||
error_msg : null, error: typeof error !=='undefined' && error ? error : null }) %></div>
|
||||
<% } %>
|
||||
<% if(typeof success_msg !== 'undefined' || typeof error_msg !== 'undefined' || typeof error !== 'undefined') { %>
|
||||
<div id="flash-messages-data" style="display:none;"><%- JSON.stringify({
|
||||
success_msg: typeof success_msg !== 'undefined' && success_msg ? success_msg : null,
|
||||
error_msg: typeof error_msg !== 'undefined' && error_msg ? error_msg : null,
|
||||
error: typeof error !== 'undefined' && error ? error : null
|
||||
}) %></div>
|
||||
<% } %>
|
||||
|
||||
<div class="login-container">
|
||||
<div class="logo-container img-shine">
|
||||
<img src="/img/logo/logo-hai-learning.png" alt="Logo">
|
||||
<div class="login-wrapper">
|
||||
<div class="login-card">
|
||||
<div class="login-header">
|
||||
<div class="login-logo">
|
||||
<img src="/img/logo.png" alt="ULDP Logo" style="width:100%;height:100%;object-fit:contain;filter:none;border-radius:0;">
|
||||
</div>
|
||||
<p class="login-subtitle">Sign in to your account</p>
|
||||
</div>
|
||||
|
||||
<div class="login-body">
|
||||
<form action="/auth/login" method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required autocomplete="username" autofocus>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-bottom: 20px;">
|
||||
<h4 style="color: var(--primary-color); font-weight: 600; margin-bottom: 5px;">CMS Management System</h4>
|
||||
<p style="color: var(--text-color); font-size: 13px;">Welcome to Content Management System</p>
|
||||
</div>
|
||||
|
||||
<form action="/auth/login" method="POST" class="login-form">
|
||||
<div class="form-group" style="margin-bottom: 12px;">
|
||||
<label for="username" class="form-label">Username</label>
|
||||
<input type="text" class="form-control" id="username" name="username" required autocomplete="username"
|
||||
autofocus>
|
||||
<div class="mb-3">
|
||||
<div class="d-flex justify-content-between align-items-center mb-1">
|
||||
<label for="password" class="form-label mb-0">Password</label>
|
||||
<a href="/auth/change-password" class="accent-link">Change Password?</a>
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="margin-bottom: 12px;">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<div style="position: relative;">
|
||||
<input type="password" class="form-control" id="password" name="password" required
|
||||
autocomplete="current-password" style="padding-right: 40px;">
|
||||
<button type="button" class="password-toggle-btn" aria-label="Show password"
|
||||
style="position: absolute; right: 10px; top: 50%; transform: translateY(-50%); border: none; background: none; color: #666; cursor: pointer; padding: 0; z-index: 10;">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<a href="/auth/change-password"
|
||||
style="display: block; text-align: right; margin-top: 8px; color: #2563eb; text-decoration: none; font-size: 13px; font-weight: 600;">
|
||||
Change Password?
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 20px;">
|
||||
<button type="submit" class="btn-shine">
|
||||
Login
|
||||
<div class="password-wrapper">
|
||||
<input type="password" class="form-control" id="password" name="password" required autocomplete="current-password" style="padding-right:2.5rem">
|
||||
<button type="button" class="password-toggle" id="togglePassword" aria-label="Toggle password">
|
||||
<i class="fas fa-eye"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 20px;">
|
||||
<span style="font-size: 14px; color: #666;">Don't have an account?</span>
|
||||
<a href="/auth/register"
|
||||
style="color: var(--primary-color); font-weight: 600; text-decoration: none; margin-left: 5px;">
|
||||
Create Account
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="mt-4">
|
||||
<button type="submit" class="btn-login">
|
||||
<i class="fas fa-sign-in-alt me-2"></i>Sign In
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div style="margin-top: 20px; text-align: center;">
|
||||
<p style="font-size: 12px; color: #fff;">© 2024 Swiss Institute of Management and Sciences. All rights
|
||||
reserved.</p>
|
||||
</div>
|
||||
<div class="text-center mt-3">
|
||||
<span style="font-size:0.8125rem;color:var(--text-muted)">Don't have an account?</span>
|
||||
<a href="/auth/register" class="accent-link ms-1">Create Account</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="login-footer">
|
||||
<p>© <%= new Date().getFullYear() %> ULDP Management System. All rights reserved.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bootstrap JS -->
|
||||
<div class="toast-area" id="toastArea"></div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script>
|
||||
// Password toggle
|
||||
document.getElementById('togglePassword').addEventListener('click', function() {
|
||||
const pwd = document.getElementById('password');
|
||||
const icon = this.querySelector('i');
|
||||
if (pwd.type === 'password') {
|
||||
pwd.type = 'text';
|
||||
icon.className = 'fas fa-eye-slash';
|
||||
} else {
|
||||
pwd.type = 'password';
|
||||
icon.className = 'fas fa-eye';
|
||||
}
|
||||
});
|
||||
|
||||
<!-- Toast JS -->
|
||||
<script src="/js/toast.js"></script>
|
||||
|
||||
<!-- Flash Handler JS -->
|
||||
<script src="/js/flash-handler.js"></script>
|
||||
|
||||
<!-- Password Toggle JS -->
|
||||
<script src="/js/password-toggle.js"></script>
|
||||
// Flash messages
|
||||
const flashData = document.getElementById('flash-messages-data');
|
||||
if (flashData) {
|
||||
try {
|
||||
const msgs = JSON.parse(flashData.textContent);
|
||||
const area = document.getElementById('toastArea');
|
||||
const show = (msg, type) => {
|
||||
if (!msg) return;
|
||||
const t = document.createElement('div');
|
||||
t.className = `toast align-items-center text-bg-${type} border-0 show mb-2`;
|
||||
t.innerHTML = `<div class="d-flex"><div class="toast-body">${msg}</div><button type="button" class="btn-close btn-close-white me-2 m-auto" onclick="this.closest('.toast').remove()"></button></div>`;
|
||||
area.appendChild(t);
|
||||
setTimeout(() => t.remove(), 4500);
|
||||
};
|
||||
show(msgs.success_msg, 'success');
|
||||
show(msgs.error_msg, 'danger');
|
||||
show(msgs.error, 'danger');
|
||||
} catch(e) {}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user