Files
pdf-writer/frontend/public/login.html
T

82 lines
2.6 KiB
HTML
Raw Normal View History

2025-03-02 20:31:13 +01:00
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login</title>
<link href="https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;500;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Fira Sans', sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f0f0f0;
}
.login-container {
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
.login-container h1 {
margin-bottom: 20px;
}
.login-container input {
width: 100%;
padding: 10px;
margin-bottom: 10px;
border: 1px solid #ccc;
border-radius: 4px;
}
.login-container button {
width: 100%;
padding: 10px;
background-color: #a81411;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.login-container button:hover {
background-color: #8e1210;
}
</style>
</head>
<body>
<div class="login-container">
<h1>Login</h1>
<input type="text" id="username" placeholder="Benutzername">
<input type="password" id="password" placeholder="Passwort">
<button onclick="login()">Login</button>
<p id="error-message" style="color: red; display: none;">Login fehlgeschlagen. Bitte versuchen Sie es erneut.</p>
</div>
<script>
function login() {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
fetch('/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ username, password })
})
.then(response => response.json())
.then(data => {
if (data.success) {
window.location.href = '/edit/menu';
} else {
document.getElementById('error-message').style.display = 'block';
}
})
.catch(error => {
console.error('Error:', error);
document.getElementById('error-message').style.display = 'block';
});
}
</script>
</body>
</html>