2024-09-10 16:00:43 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="en">
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8">
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2024-09-16 11:49:09 +02:00
|
|
|
<title>Login - sxbin</title>
|
2024-09-10 16:00:43 +02:00
|
|
|
<style>
|
|
|
|
body {
|
|
|
|
font-family: Arial, sans-serif;
|
|
|
|
line-height: 1.6;
|
|
|
|
margin: 0;
|
2024-09-10 19:41:49 +02:00
|
|
|
padding: 0;
|
2024-09-10 16:00:43 +02:00
|
|
|
display: flex;
|
2024-09-15 23:03:38 +02:00
|
|
|
flex-direction: column;
|
2024-09-10 19:41:49 +02:00
|
|
|
min-height: 100vh;
|
|
|
|
background-color: #1a1a1a;
|
|
|
|
color: #f0f0f0;
|
2024-09-10 16:00:43 +02:00
|
|
|
}
|
2024-09-15 23:03:38 +02:00
|
|
|
.content {
|
|
|
|
flex: 1;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
}
|
2024-09-10 19:41:49 +02:00
|
|
|
.container {
|
2024-09-10 16:00:43 +02:00
|
|
|
background-color: #2a2a2a;
|
|
|
|
padding: 20px;
|
2024-09-10 19:41:49 +02:00
|
|
|
border-radius: 8px;
|
|
|
|
box-shadow: 0 0 10px rgba(0,0,0,0.1);
|
2024-09-10 16:00:43 +02:00
|
|
|
width: 300px;
|
|
|
|
}
|
|
|
|
h2 {
|
|
|
|
text-align: center;
|
2024-09-10 19:41:49 +02:00
|
|
|
color: #4CAF50;
|
2024-09-10 16:00:43 +02:00
|
|
|
}
|
|
|
|
form {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2024-09-10 19:41:49 +02:00
|
|
|
label {
|
|
|
|
margin-bottom: 5px;
|
|
|
|
}
|
|
|
|
input[type="text"],
|
|
|
|
input[type="password"] {
|
|
|
|
padding: 8px;
|
|
|
|
margin-bottom: 10px;
|
2024-09-10 16:00:43 +02:00
|
|
|
border-radius: 4px;
|
|
|
|
border: 1px solid #4CAF50;
|
|
|
|
background-color: #333;
|
|
|
|
color: #f0f0f0;
|
|
|
|
}
|
2024-09-10 19:41:49 +02:00
|
|
|
button {
|
2024-09-10 16:00:43 +02:00
|
|
|
background-color: #4CAF50;
|
|
|
|
color: white;
|
2024-09-10 19:41:49 +02:00
|
|
|
padding: 10px;
|
|
|
|
border: none;
|
|
|
|
border-radius: 4px;
|
2024-09-10 16:00:43 +02:00
|
|
|
cursor: pointer;
|
2024-09-10 19:41:49 +02:00
|
|
|
font-size: 16px;
|
2024-09-10 16:00:43 +02:00
|
|
|
}
|
2024-09-10 19:41:49 +02:00
|
|
|
button:hover {
|
2024-09-10 16:00:43 +02:00
|
|
|
background-color: #45a049;
|
|
|
|
}
|
2024-09-10 19:41:49 +02:00
|
|
|
.remember-me {
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
}
|
|
|
|
.remember-me input {
|
|
|
|
margin-right: 5px;
|
|
|
|
}
|
|
|
|
p {
|
|
|
|
text-align: center;
|
|
|
|
margin-top: 15px;
|
|
|
|
}
|
|
|
|
a {
|
|
|
|
color: #4CAF50;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
a:hover {
|
|
|
|
text-decoration: underline;
|
2024-09-10 16:00:43 +02:00
|
|
|
}
|
2024-09-15 23:03:38 +02:00
|
|
|
.back-button {
|
|
|
|
position: absolute;
|
|
|
|
top: 20px;
|
|
|
|
left: 20px;
|
|
|
|
font-size: 24px;
|
|
|
|
color: #4CAF50;
|
|
|
|
text-decoration: none;
|
|
|
|
}
|
|
|
|
.back-button:hover {
|
|
|
|
color: #45a049;
|
|
|
|
}
|
|
|
|
.footer {
|
|
|
|
text-align: center;
|
|
|
|
padding: 10px;
|
|
|
|
background-color: #2a2a2a;
|
|
|
|
color: #f0f0f0;
|
|
|
|
}
|
2024-09-16 11:49:09 +02:00
|
|
|
.error-message {
|
|
|
|
background-color: #ff6b6b;
|
|
|
|
color: white;
|
|
|
|
padding: 10px;
|
|
|
|
border-radius: 5px;
|
|
|
|
margin-bottom: 10px;
|
|
|
|
display: none;
|
|
|
|
}
|
2024-09-10 16:00:43 +02:00
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2024-09-15 23:03:38 +02:00
|
|
|
<a href="/" class="back-button">←</a>
|
|
|
|
<div class="content">
|
|
|
|
<div class="container">
|
2024-09-16 11:49:09 +02:00
|
|
|
<h2>Login to sxbin</h2>
|
|
|
|
<div id="error-message" class="error-message"></div>
|
|
|
|
<form id="login-form" method="POST">
|
|
|
|
<label for="username">Username:</label>
|
|
|
|
<input type="text" id="username" name="username" required>
|
|
|
|
<label for="password">Password:</label>
|
|
|
|
<input type="password" id="password" name="password" required>
|
|
|
|
<label>
|
|
|
|
<input type="checkbox" name="remember"> Remember me
|
|
|
|
</label>
|
|
|
|
<input type="submit" value="Login">
|
2024-09-15 23:03:38 +02:00
|
|
|
</form>
|
2024-09-16 11:49:09 +02:00
|
|
|
<p>Don't have an account? <a href="{{ url_for('register') }}">Register</a></p>
|
2024-09-15 23:03:38 +02:00
|
|
|
</div>
|
2024-09-10 16:00:43 +02:00
|
|
|
</div>
|
2024-09-16 11:49:09 +02:00
|
|
|
|
|
|
|
<script>
|
|
|
|
document.getElementById('login-form').addEventListener('submit', function(e) {
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
fetch('/login', {
|
|
|
|
method: 'POST',
|
|
|
|
body: new FormData(this),
|
|
|
|
})
|
|
|
|
.then(response => response.json())
|
|
|
|
.then(data => {
|
|
|
|
if (data.success) {
|
|
|
|
window.location.href = data.redirect;
|
|
|
|
} else {
|
|
|
|
document.getElementById('error-message').textContent = data.error;
|
|
|
|
document.getElementById('error-message').style.display = 'block';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2024-09-10 16:00:43 +02:00
|
|
|
</body>
|
|
|
|
</html>
|