Files
linearvoid/frontend/admin/login/index.html
T
zwitschi fca4286d87 Refactor frontend: Enhance chat UI and player initialization
- Updated main.ts to streamline player and chat initialization, removing Alpine.js dependency.
- Improved message rendering with new CSS classes for better styling and layout.
- Added a function to simulate "now playing" titles at regular intervals.
- Revamped style.css with a new design system using CSS variables for better maintainability.
- Removed tailwind.config.js as Tailwind CSS is no longer used.
2026-08-04 19:36:11 +02:00

67 lines
2.5 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Linear Void Admin Login</title>
<link rel="stylesheet" href="../../src/style.css" />
</head>
<body class="auth-body">
<main class="auth-shell" aria-label="Admin authentication">
<section class="auth-card" aria-labelledby="auth-title">
<p class="auth-kicker">Linear Void</p>
<h1 id="auth-title">Admin Login</h1>
<p class="auth-subtitle">Authenticate to access protected admin controls.</p>
<form id="login-form" class="form-stack" novalidate>
<label for="username">Username</label>
<input id="username" type="text" class="text-input" autocomplete="username" required />
<label for="password">Password</label>
<input id="password" type="password" class="text-input" autocomplete="current-password" required />
<button id="submit" type="submit" class="btn btn-primary btn-block">Sign in</button>
<p id="status" class="status-line" aria-live="polite"></p>
</form>
</section>
</main>
<script>
const form = document.getElementById('login-form');
const username = document.getElementById('username');
const password = document.getElementById('password');
const submit = document.getElementById('submit');
const status = document.getElementById('status');
form.addEventListener('submit', async (event) => {
event.preventDefault();
submit.disabled = true;
status.textContent = 'Signing in...';
status.className = 'status-line';
try {
const response = await fetch('/api/admin/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: username.value, password: password.value })
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
window.location.href = '/admin/';
} catch (error) {
console.error('Failed to sign in', error);
status.textContent = 'Login failed. Check your credentials.';
status.className = 'status-line status-error';
} finally {
submit.disabled = false;
}
});
</script>
</body>
</html>