169 lines
4.8 KiB
HTML
169 lines
4.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login - Keep My Weight Tracker</title>
|
|
<style>
|
|
:root {
|
|
--primary-color: #4a6fa5;
|
|
--primary-dark: #3a5a8c;
|
|
--background-color: #f8f9fa;
|
|
--card-bg: #ffffff;
|
|
--text-color: #333;
|
|
--border-color: #e0e0e0;
|
|
--error-color: #d9534f;
|
|
--border-radius: 8px;
|
|
--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
--font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
|
|
}
|
|
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: var(--font-family);
|
|
background-color: var(--background-color);
|
|
color: var(--text-color);
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
padding: 20px;
|
|
}
|
|
|
|
.login-container {
|
|
background-color: var(--card-bg);
|
|
border-radius: var(--border-radius);
|
|
box-shadow: var(--shadow);
|
|
width: 100%;
|
|
max-width: 400px;
|
|
padding: 30px;
|
|
}
|
|
|
|
.logo {
|
|
text-align: center;
|
|
margin-bottom: 30px;
|
|
}
|
|
|
|
h1 {
|
|
color: var(--primary-color);
|
|
font-size: 2rem;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.tagline {
|
|
color: #666;
|
|
font-size: 1rem;
|
|
margin-bottom: 30px;
|
|
text-align: center;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
label {
|
|
display: block;
|
|
margin-bottom: 8px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
input[type="password"] {
|
|
width: 100%;
|
|
padding: 12px;
|
|
border-radius: var(--border-radius);
|
|
border: 1px solid var(--border-color);
|
|
font-family: var(--font-family);
|
|
font-size: 1rem;
|
|
}
|
|
|
|
input[type="password"]:focus {
|
|
outline: none;
|
|
border-color: var(--primary-color);
|
|
}
|
|
|
|
.btn {
|
|
width: 100%;
|
|
padding: 12px;
|
|
background-color: var(--primary-color);
|
|
color: white;
|
|
border: none;
|
|
border-radius: var(--border-radius);
|
|
cursor: pointer;
|
|
font-weight: 600;
|
|
font-size: 1rem;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.btn:hover {
|
|
background-color: var(--primary-dark);
|
|
}
|
|
|
|
.error-message {
|
|
color: var(--error-color);
|
|
margin-top: 20px;
|
|
text-align: center;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.privacy-note {
|
|
margin-top: 30px;
|
|
text-align: center;
|
|
font-size: 0.8rem;
|
|
color: #666;
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
.login-container {
|
|
padding: 20px;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="login-container">
|
|
<div class="logo">
|
|
<h1>Keep My Weight</h1>
|
|
</div>
|
|
<p class="tagline">Simple, private weight & meal tracking</p>
|
|
|
|
<form id="login-form" action="/auth/login" method="POST">
|
|
<div class="form-group">
|
|
<label for="password">Password</label>
|
|
<input type="password" id="password" name="password" required>
|
|
</div>
|
|
|
|
<button type="submit" class="btn">Login</button>
|
|
|
|
<div id="error-message" class="error-message">
|
|
<!-- Error messages will be displayed here -->
|
|
<!-- If there was an error in the URL, it will be displayed via JavaScript -->
|
|
</div>
|
|
</form>
|
|
|
|
<p class="privacy-note">Your data stays private, always. This password protects your personal health information.</p>
|
|
</div>
|
|
|
|
<script>
|
|
// Check for error parameter in URL
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const urlParams = new URLSearchParams(window.location.search);
|
|
const error = urlParams.get('error');
|
|
|
|
if (error) {
|
|
const errorElement = document.getElementById('error-message');
|
|
if (error === 'invalid') {
|
|
errorElement.textContent = 'Invalid password. Please try again.';
|
|
} else if (error === 'session') {
|
|
errorElement.textContent = 'Your session has expired. Please login again.';
|
|
}
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|