Files
gestion-stock/public/login.html
T
2026-05-28 09:35:43 +00:00

113 lines
2.5 KiB
HTML

<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Connexion — Gestion de Stock</title>
<link rel="icon" type="image/svg+xml" href="/favicon.svg">
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background: #f7fafa;
color: #555454;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
}
.login-box {
background: #fff;
border: 1px solid #e0e6e6;
border-radius: 12px;
padding: 40px 36px;
max-width: 380px;
width: 100%;
box-shadow: 0 4px 16px rgba(0,0,0,0.06);
text-align: center;
}
h1 {
font-size: 22px;
font-weight: 700;
color: #555454;
margin-bottom: 8px;
}
.subtitle {
font-size: 14px;
color: #999;
margin-bottom: 28px;
}
input[type="password"] {
width: 100%;
padding: 14px 16px;
font-size: 18px;
border: 1px solid #d0dcdc;
border-radius: 8px;
background: #fafbfc;
color: #555454;
font-family: inherit;
text-align: center;
letter-spacing: 2px;
transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="password"]:focus {
outline: none;
border-color: #aac5c5;
background: #fff;
box-shadow: 0 0 0 3px rgba(170,197,197,0.2);
}
button {
margin-top: 18px;
width: 100%;
padding: 14px;
font-size: 16px;
font-weight: 700;
color: #fff;
background: #aac5c5;
border: none;
border-radius: 8px;
cursor: pointer;
font-family: inherit;
letter-spacing: 0.5px;
transition: background 0.2s;
}
button:hover { background: #8ab0b0; }
.error {
margin-top: 14px;
color: #c62828;
font-size: 14px;
display: none;
}
</style>
</head>
<body>
<div class="login-box">
<h1>Gestion de Stock</h1>
<p class="subtitle">Delvarre Creations</p>
<form id="login-form">
<input type="password" id="pwd" placeholder="Mot de passe" autofocus>
<button type="submit">Entrer</button>
</form>
<p class="error" id="err">Mot de passe incorrect</p>
</div>
<script>
document.getElementById('login-form').addEventListener('submit', async function(e) {
e.preventDefault();
const pwd = document.getElementById('pwd').value;
const res = await fetch('/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ password: pwd })
});
if (res.ok) {
window.location.href = '/';
} else {
document.getElementById('err').style.display = 'block';
document.getElementById('pwd').select();
}
});
</script>
</body>
</html>