TestX / login.html
school44s's picture
Upload 13 files
cee43ad verified
Raw
History Blame Contribute Delete
23.5 kB
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="0">
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' rx='22' fill='%23151515'/><text x='50' y='68' font-size='52' font-family='Arial' font-weight='bold' fill='%23ff5e00' text-anchor='middle'>A</text></svg>">
<title>Đăng nhập - ANIVIETDB</title>
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: 'Roboto', sans-serif;
background: linear-gradient(135deg, #0b0d16 0%, #1a1033 50%, #2d1b4e 100%);
min-height: 100vh;
display: flex; align-items: center; justify-content: center;
padding: 20px; color: #e8e8f0;
}
body::before {
content: "";
position: fixed;
inset: 0;
z-index: -2;
pointer-events: none;
background-color: #151515;
background-image:
url("https://phim.nguonc.com/public/images/Film/76.jpg"),
url("https://phim.nguonc.com/public/images/Film/666.jpg"),
url("https://phim.nguonc.com/public/images/Film/77.jpg"),
url("https://phim.nguonc.com/public/images/Film/667.jpg"),
url("https://phim.nguonc.com/public/images/Film/259.jpg"),
url("https://phim.nguonc.com/public/images/Film/2738.jpg"),
url("https://phim.nguonc.com/public/images/Film/3485.jpg"),
url("https://phim.nguonc.com/public/images/Film/141438.jpg"),
url("https://phim.nguonc.com/public/images/Film/date-a-bullet-thumb.jpg"),
url("https://phim.nguonc.com/public/images/Film/3103.jpg"),
url("https://phim.nguonc.com/public/images/Post/5/aishiteru-game-wo-owarasetai.jpg"),
url("https://phim.nguonc.com/public/images/Film/541.jpg"),
url("https://phim.nguonc.com/public/images/Film/536.jpg"),
url("https://phim.nguonc.com/public/images/Film/56167.jpg"),
url("https://phim.nguonc.com/public/images/Film/56643.jpg"),
url("https://phim.nguonc.com/public/images/Film/538.jpg"),
url("https://phim.nguonc.com/public/images/Film/540.jpg"),
url("https://phim.nguonc.com/public/images/Film/60351.jpg"),
url("https://phim.nguonc.com/public/images/Film/2607.jpg"),
url("https://phim.nguonc.com/public/images/Film/2661.jpg"),
url("https://phim.nguonc.com/public/images/Film/5MgMCnslrxQfOfaq6T5ndkLlcCk.jpg"),
url("https://phim.nguonc.com/public/images/Film/134808.jpg"),
url("https://phim.nguonc.com/public/images/Film/138379.jpg"),
url("https://phim.nguonc.com/public/images/Post/9/seishun-buta-yarou-wa-santa-claus-no-yume-wo-minai-1.jpg");
background-size: 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%, 12.5% 33.333%;
background-position: 0% 0%, 14.2857% 0%, 28.5714% 0%, 42.8571% 0%, 57.1429% 0%, 71.4286% 0%, 85.7143% 0%, 100% 0%, 0% 50%, 14.2857% 50%, 28.5714% 50%, 42.8571% 50%, 57.1429% 50%, 71.4286% 50%, 85.7143% 50%, 100% 50%, 0% 100%, 14.2857% 100%, 28.5714% 100%, 42.8571% 100%, 57.1429% 100%, 71.4286% 100%, 85.7143% 100%, 100% 100%;
background-repeat: no-repeat;
filter: brightness(0.42) saturate(0.65);
}
body::after {
content: "";
position: fixed;
inset: 0;
z-index: -1;
pointer-events: none;
background: linear-gradient(180deg, rgba(21,21,21,0.55), rgba(21,21,21,0.78) 68%, #151515 100%),
radial-gradient(120% 90% at 50% 0%, rgba(21,21,21,0) 42%, rgba(21,21,21,0.5) 100%);
}
.auth-card {
width: 100%; max-width: 400px;
background: rgba(20, 22, 38, 0.92);
border: 1px solid rgba(120, 100, 230, 0.35);
border-radius: 16px;
padding: 32px 28px;
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
}
.auth-logo {
text-align: center; font-size: 22px; font-weight: 700; letter-spacing: 0.5px;
margin-bottom: 6px;
}
.auth-logo span { color: #8b7bff; }
.auth-sub { text-align: center; color: #9a9ab0; font-size: 13px; margin-bottom: 22px; }
.auth-tabs { display: flex; margin-bottom: 22px; border-bottom: 1px solid rgba(120,100,230,0.25); }
.auth-tab {
flex: 1; text-align: center; padding: 10px 0; cursor: pointer;
color: #9a9ab0; font-weight: 500; border-bottom: 2px solid transparent; transition: all .2s;
}
.auth-tab.active { color: #fff; border-bottom-color: #8b7bff; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; color: #a9a9c4; margin-bottom: 6px; }
.field input {
width: 100%; padding: 12px 14px; border-radius: 10px;
border: 1px solid rgba(120,100,230,0.3); background: #10121f;
color: #fff; font-size: 14px; outline: none; transition: border .2s;
}
.field input:focus { border-color: #8b7bff; }
.auth-btn {
width: 100%; padding: 13px; border: none; border-radius: 10px;
background: linear-gradient(135deg, #7c5cff, #5a3bd6);
color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
transition: transform .15s, filter .15s;
}
.auth-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.auth-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-error {
min-height: 20px; color: #ff8a8a; font-size: 13px; margin-top: 12px; text-align: center;
}
.auth-ok {
color: #7ee787; font-size: 13px; text-align: center; margin-top: 12px; min-height: 20px;
}
.logout-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; } .logged-in { text-align: center; padding: 10px 0; }
.logged-in .name { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.logged-in .email { font-size: 13px; color: #9a9ab0; margin-bottom: 18px; }
.logged-title {
text-align: center; font-size: 13px; color: #7ee787; font-weight: 500; margin-bottom: 18px;
}
.btn-ghost {
width: 100%; padding: 12px; border-radius: 10px;
border: 1px solid rgba(255,138,138,0.4); background: transparent;
color: #ff8a8a; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-ghost:hover { background: rgba(255,138,138,0.08); }
.btn-admin {
display: block; width: 100%; padding: 12px; border-radius: 10px;
border: 1px solid rgba(126,231,135,0.45); background: rgba(126,231,135,0.08);
color: #7ee787; font-size: 14px; font-weight: 700; cursor: pointer;
text-align: center; text-decoration: none;
}
.btn-admin:hover { background: rgba(126,231,135,0.18); }
.btn-home {
display: block; width: 100%; padding: 12px; border-radius: 10px;
border: 1px solid rgba(139,123,255,0.45); background: rgba(139,123,255,0.1);
color: #b7abff; font-size: 14px; font-weight: 700; cursor: pointer;
text-align: center; text-decoration: none; margin-bottom: 10px;
}
.btn-home:hover { background: rgba(139,123,255,0.2); }
.btn-shop {
display: block; width: 100%; padding: 12px; border-radius: 10px;
border: 1px solid rgba(255,94,0,0.5); background: rgba(255,94,0,0.1);
color: #ff9a5a; font-size: 14px; font-weight: 700; cursor: pointer;
text-align: center; text-decoration: none; margin-bottom: 10px;
}
.btn-shop:hover { background: rgba(255,94,0,0.2); }
.auth-back {
display: block; text-align: center; margin-top: 18px;
color: #9a9ab0; font-size: 13px; text-decoration: none;
}
.auth-back:hover { color: #fff; text-decoration: underline; }
.auth-copyright {
text-align: center; margin-top: 20px; padding-top: 14px;
border-top: 1px solid rgba(120,100,230,0.15);
color: #6d6d85; font-size: 12px;
}
.terms-row {
display: flex; align-items: flex-start; gap: 8px;
font-size: 12px; color: #a9a9c4; line-height: 1.5; margin-bottom: 16px;
}
.terms-row input { margin-top: 2px; accent-color: #8b7bff; }
.turnstile-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.terms-row a { color: #8b7bff; text-decoration: none; }
.terms-row a:hover { text-decoration: underline; }
.terms-modal {
position: fixed; inset: 0; z-index: 1000;
display: none; align-items: center; justify-content: center;
background: rgba(0,0,0,0.6); padding: 20px;
}
.terms-modal.open { display: flex; }
.terms-modal-card {
width: 100%; max-width: 520px; max-height: 80vh;
background: #141622; border: 1px solid rgba(120,100,230,0.35);
border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
}
.terms-modal-head {
display: flex; align-items: center; justify-content: space-between;
padding: 14px 18px; border-bottom: 1px solid rgba(120,100,230,0.25);
}
.terms-modal-head h3 { font-size: 16px; color: #fff; }
.terms-modal-close {
background: none; border: none; color: #9a9ab0; font-size: 20px;
cursor: pointer; line-height: 1;
}
.terms-modal-close:hover { color: #fff; }
.terms-modal-body { padding: 16px 18px; overflow-y: auto; font-size: 13px; line-height: 1.7; color: #c6c6da; }
.terms-modal-body h4 { color: #fff; font-size: 14px; margin: 14px 0 6px; }
.terms-modal-body h4:first-child { margin-top: 0; }
.terms-modal-foot {
padding: 12px 18px; border-top: 1px solid rgba(120,100,230,0.25); text-align: right;
}
.terms-modal-foot button {
padding: 9px 18px; border: none; border-radius: 8px;
background: linear-gradient(135deg, #7c5cff, #5a3bd6); color: #fff;
font-size: 13px; font-weight: 700; cursor: pointer;
}
</style>
</head>
<body>
<div class="auth-card">
<div class="auth-logo">ANIVIET<span>DB</span></div>
<p class="auth-sub">Đăng nhập hoặc tạo tài khoản</p>
<div class="auth-tabs" id="authTabs">
<div class="auth-tab active" data-mode="login">Đăng nhập</div>
<div class="auth-tab" data-mode="register">Đăng ký</div>
</div>
<div id="authForms">
<div class="field">
<label id="loginLabel">Email hoặc tên đăng nhập</label>
<input type="text" id="email" placeholder="Email hoặc tên đăng nhập" autocomplete="username">
</div>
<div class="field register-only" style="display:none;">
<label>Tên đăng nhập</label>
<input type="text" id="name" placeholder="Tên của bạn" autocomplete="name">
</div>
<div class="field">
<label>Mật khẩu</label>
<input type="password" id="password" placeholder="••••••••" autocomplete="current-password">
</div>
<div class="field register-only" style="display:none;">
<label>Nhập lại mật khẩu</label>
<input type="password" id="password2" placeholder="••••••••" autocomplete="new-password">
</div>
<label class="terms-row register-only" style="display:none;">
<input type="checkbox" id="termsCheck">
<span>Tôi đã đọc và đồng ý với <a href="javascript:void(0)" id="termsLink">Điều khoản sử dụng</a></span>
</label>
<div class="turnstile-wrap">
<div id="turnstile-login" class="cf-turnstile login-only"
data-sitekey="0x4AAAAAAEQz9I-TXTQoVuii"
data-action="login"
data-callback="onTurnstileSuccess"
data-expired-callback="onTurnstileExpired"
data-error-callback="onTurnstileError"></div>
<div id="turnstile-register" class="cf-turnstile register-only" style="display:none;"
data-sitekey="0x4AAAAAAEQz9I-TXTQoVuii"
data-action="register"
data-callback="onTurnstileSuccess"
data-expired-callback="onTurnstileExpired"
data-error-callback="onTurnstileError"></div>
</div>
<button class="auth-btn" id="submitBtn">Đăng nhập</button>
</div>
<div id="loggedIn" style="display:none;">
<div class="logged-in">
<div class="name" id="userName"></div>
<div class="email" id="userEmail"></div>
<div class="logged-title">Bạn đã đăng nhập</div>
</div>
<div style="display:none; margin-bottom:10px;" id="adminPanelWrap">
<a href="control-panel.html" class="btn-admin">Control Panel</a>
</div>
<a href="sfw/index.html" class="btn-home">Trang chủ</a>
<a href="shop/index.html" class="btn-shop">&#128722; Cửa hàng</a>
<button class="btn-ghost" id="logoutBtn">Đăng xuất</button>
</div>
<div class="auth-error" id="error"></div>
<div class="auth-ok" id="ok"></div>
<a href="index.html" class="auth-back" id="authBack">&larr; Về trang chủ</a>
<div class="auth-copyright">© 2026 ANIVIETDB. All rights reserved.</div>
</div>
<div class="terms-modal" id="termsModal">
<div class="terms-modal-card">
<div class="terms-modal-head">
<h3>Điều khoản sử dụng</h3>
<button class="terms-modal-close" id="termsClose" aria-label="Đóng">&times;</button>
</div>
<div class="terms-modal-body">
<h4>1. Chấp nhận điều khoản</h4>
<p>Bằng việc truy cập và sử dụng ANIVIETDB, bạn xác nhận đã đọc, hiểu và đồng ý tuân thủ các điều khoản dưới đây. Nếu không đồng ý, vui lòng ngừng sử dụng dịch vụ.</p>
<h4>2. Mục đích sử dụng</h4>
<p>ANIVIETDB là nền tảng tổng hợp thông tin anime, manga, manhwa, manhua và light novel phục vụ nhu cầu tìm kiếm, theo dõi và giải trí cá nhân của người dùng. Không được dùng thông tin tại đây cho mục đích thương mại hoặc trái pháp luật.</p>
<h4>3. Tài khoản người dùng</h4>
<p>Bạn chịu trách nhiệm bảo mật mật khẩu và mọi hoạt động diễn ra trên tài khoản của mình. Không được tạo tài khoản giả mạo, mạo danh người khác, hoặc lợi dụng tài khoản để gây ảnh hưởng tiêu cực tới cộng đồng.</p>
<h4>4. Nội dung và bản quyền</h4>
<p>Toàn bộ thông tin trên ANIVIETDB chỉ mang tính tham khảo. Quyền sở hữu trí tuệ của các tác phẩm thuộc về tác giả và đơn vị phát hành. Nếu bạn là chủ sở hữu và muốn yêu cầu gỡ nội dung, vui lòng liên hệ ban quản trị.</p>
<h4>5. Hành vi bị cấm</h4>
<p>Cấm spam, phát tán thông tin sai lệch, phần mềm độc hại, hoặc thực hiện hành vi xâm phạm hệ thống và tài khoản người dùng khác trên nền tảng.</p>
<h4>6. Từ chối trách nhiệm</h4>
<p>ANIVIETDB nỗ lực cập nhật thông tin chính xác nhưng không đảm bảo tính đầy đủ, kịp thời của dữ liệu. Website không chịu trách nhiệm về bất kỳ thiệt hại phát sinh từ việc sử dụng dịch vụ.</p>
<h4>7. Thay đổi điều khoản</h4>
<p>ANIVIETDB có quyền cập nhật điều khoản bất cứ lúc nào. Việc tiếp tục sử dụng website sau khi có thay đổi đồng nghĩa với việc bạn chấp nhận điều khoản mới.</p>
</div>
<div class="terms-modal-foot">
<button id="termsAgree">Tôi đồng ý</button>
</div>
</div>
</div>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<script src="signup-loginsystem.js?v=8"></script>
<script>
var mode = 'login';
var emailEl = document.getElementById('email');
var nameEl = document.getElementById('name');
var passEl = document.getElementById('password');
var pass2El = document.getElementById('password2');
var submitBtn = document.getElementById('submitBtn');
var errorEl = document.getElementById('error');
var okEl = document.getElementById('ok');
var authForms = document.getElementById('authForms');
var loggedIn = document.getElementById('loggedIn');
var cooldownTimer = null;
function updateCooldown() {
var wait = window.AuthSystem.cooldownRemaining();
if (wait <= 0) {
if (cooldownTimer) { clearInterval(cooldownTimer); cooldownTimer = null; }
errorEl.textContent = '';
submitBtn.disabled = false;
return;
}
errorEl.textContent = 'Vui lòng đợi ' + Math.ceil(wait / 1000) + ' giây trước khi đăng nhập hoặc tạo tài khoản.';
submitBtn.disabled = true;
}
function startCooldown() {
if (cooldownTimer) { clearInterval(cooldownTimer); }
cooldownTimer = setInterval(updateCooldown, 200);
updateCooldown();
}
function showSession(user) {
authForms.style.display = 'none';
document.getElementById('authTabs').style.display = 'none';
document.querySelector('.auth-sub').style.display = 'none';
document.getElementById('authBack').style.display = 'none';
loggedIn.style.display = 'block';
document.getElementById('userName').textContent = user.username || user.name || '';
document.getElementById('userEmail').textContent = user.email || '';
errorEl.textContent = '';
okEl.textContent = 'Đã đăng nhập.';
var isAdmin = user.role === 'admin';
document.getElementById('adminPanelWrap').style.display = isAdmin ? 'block' : 'none';
}
function resetWidget() {
var el = activeWidget();
if (el && window.turnstile && typeof window.turnstile.reset === 'function') {
try { window.turnstile.reset(el); } catch (e) { /* ignore */ }
}
submitBtn.disabled = true;
}
function showError(msg) {
okEl.textContent = '';
errorEl.textContent = msg;
if (window.turnstile && !turnstileSolved()) submitBtn.disabled = true;
else submitBtn.disabled = false;
}
function setMode(m) {
mode = m;
document.querySelectorAll('.auth-tab').forEach(function (t) {
t.classList.toggle('active', t.getAttribute('data-mode') === m);
});
document.querySelectorAll('.register-only').forEach(function (el) {
el.style.display = (m === 'register') ? '' : 'none';
});
document.querySelectorAll('.login-only').forEach(function (el) {
el.style.display = (m === 'login') ? '' : 'none';
});
submitBtn.textContent = (m === 'register') ? 'Tạo tài khoản' : 'Đăng nhập';
errorEl.textContent = '';
okEl.textContent = '';
if (window.turnstile && !turnstileSolved()) submitBtn.disabled = true;
}
function activeWidget() {
return mode === 'register'
? document.getElementById('turnstile-register')
: document.getElementById('turnstile-login');
}
function turnstileSolved() {
var el = activeWidget();
return !!(window.turnstile && el && window.turnstile.getResponse(el));
}
function onTurnstileSuccess() { submitBtn.disabled = false; }
function onTurnstileExpired() { submitBtn.disabled = true; }
function onTurnstileError() { submitBtn.disabled = true; }
var termsModal = document.getElementById('termsModal');
var termsCheck = document.getElementById('termsCheck');
document.getElementById('termsLink').addEventListener('click', function () {
termsModal.classList.add('open');
});
document.getElementById('termsClose').addEventListener('click', function () {
termsModal.classList.remove('open');
});
document.getElementById('termsAgree').addEventListener('click', function () {
termsCheck.checked = true;
termsModal.classList.remove('open');
});
termsModal.addEventListener('click', function (e) {
if (e.target === termsModal) termsModal.classList.remove('open');
});
document.querySelectorAll('.auth-tab').forEach(function (t) {
t.addEventListener('click', function () { setMode(t.getAttribute('data-mode')); });
});
function doSubmit() {
if (!window.AuthSystem || !window.AuthSystem.isConfigured()) {
showError('Backend chưa được cấu hình. Vui lòng dán URL API.');
return;
}
var wait = window.AuthSystem.cooldownRemaining();
if (wait > 0) {
showError('Vui lòng đợi ' + Math.ceil(wait / 1000) + ' giây trước khi đăng nhập hoặc tạo tài khoản.');
return;
}
var loginId = emailEl.value.trim();
var password = passEl.value;
if (!loginId || !password) { showError('Vui lòng nhập email/tên đăng nhập và mật khẩu.'); return; }
if (window.turnstile && !turnstileSolved()) {
showError('Vui lòng hoàn tất xác minh "Tôi không phải người máy".');
return;
}
if (mode === 'register') {
var name = nameEl.value.trim();
if (!name) { showError('Vui lòng nhập tên đăng nhập.'); return; }
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(loginId)) { showError('Email không hợp lệ.'); return; }
if (password.length < 6) { showError('Mật khẩu phải có ít nhất 6 ký tự.'); return; }
if (password !== pass2El.value) { showError('Mật khẩu nhập lại không khớp.'); return; }
if (!termsCheck.checked) { showError('Vui lòng đồng ý với Điều khoản sử dụng.'); return; }
submitBtn.disabled = true;
AuthSystem.register(loginId, name, password).then(function (data) {
showSession(data.user);
setTimeout(function () { window.location.href = 'sfw/'; }, 1200);
}).catch(function (e) { resetWidget(); showError(e.message); });
} else {
submitBtn.disabled = true;
AuthSystem.login(loginId, password).then(function (data) {
showSession(data.user);
setTimeout(function () {
window.location.href = (data.user && data.user.role === 'admin') ? 'control-panel.html' : 'sfw/';
}, 1200);
}).catch(function (e) { resetWidget(); showError(e.message); });
}
}
submitBtn.addEventListener('click', doSubmit);
document.addEventListener('keydown', function (e) { if (e.key === 'Enter') doSubmit(); });
document.getElementById('logoutBtn').addEventListener('click', function () {
AuthSystem.logout().then(function () {
loggedIn.style.display = 'none';
authForms.style.display = '';
document.getElementById('authTabs').style.display = '';
document.querySelector('.auth-sub').style.display = '';
document.getElementById('authBack').style.display = '';
setMode('login');
startCooldown();
});
});
if (window.AuthSystem.cooldownRemaining() > 0) startCooldown();
window.AuthSystem.me().then(function (user) { if (user) showSession(user); });
</script>
</body>
</html>