42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
|
|
<meta name="theme-color" content="#EF0107" />
|
|
<title>Premier Gunner — Login</title>
|
|
<link rel="manifest" href="/manifest.webmanifest" />
|
|
<link rel="apple-touch-icon" href="/icons/icon-192.png" />
|
|
<link rel="icon" href="/icons/favicon.svg" type="image/svg+xml" />
|
|
<link rel="stylesheet" href="/css/styles.css" />
|
|
</head>
|
|
<body class="login-body">
|
|
<main class="login-card">
|
|
<img src="/icons/logo.svg" alt="Premier Gunner" class="login-logo" width="120" height="120" />
|
|
<h1>Premier Gunner</h1>
|
|
<p class="tagline">Train. Track. Road to London. ✈️</p>
|
|
<form id="login-form">
|
|
<input type="password" id="password" placeholder="Enter your password" autocomplete="current-password" required />
|
|
<button type="submit" class="btn-primary big">Let's go ⚽</button>
|
|
<p id="error" class="error" hidden></p>
|
|
</form>
|
|
</main>
|
|
<script type="module">
|
|
import { api } from '/js/api.js';
|
|
const form = document.getElementById('login-form');
|
|
const err = document.getElementById('error');
|
|
form.addEventListener('submit', async (e) => {
|
|
e.preventDefault();
|
|
err.hidden = true;
|
|
try {
|
|
await api.login(document.getElementById('password').value);
|
|
location.href = '/';
|
|
} catch (ex) {
|
|
err.textContent = ex.message;
|
|
err.hidden = false;
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|