Files
SAE_riot/components/login.riot

61 lines
1.6 KiB
Plaintext
Raw Normal View History

2025-03-28 13:53:35 +01:00
<login>
<h2>Connexion</h2>
<form onsubmit={loginUser}>
<input type="email" name="email" placeholder="Email" required>
<input type="password" name="password" placeholder="Mot de passe" required>
<button>Se connecter</button>
</form>
<p><a href="#/register">Pas encore de compte ?</a></p>
<script>
async function loginUser(e) {
e.preventDefault();
const email = e.target.email.value;
const password = e.target.password.value;
2025-03-28 16:27:07 +01:00
await login(email, password);
2025-03-28 13:53:35 +01:00
window.location.href = '#';
}
export default {
loginUser
}
</script>
<style>
form {
display: flex;
flex-direction: column;
2025-03-31 13:15:47 +02:00
gap: 1rem;
max-width: 400px;
2025-03-28 13:53:35 +01:00
margin: auto;
2025-03-31 13:15:47 +02:00
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
2025-03-28 13:53:35 +01:00
}
2025-03-31 13:15:47 +02:00
input {
padding: 0.75rem;
2025-03-28 13:53:35 +01:00
border: 1px solid #ccc;
2025-03-31 13:15:47 +02:00
border-radius: 6px;
font-size: 1rem;
2025-03-28 13:53:35 +01:00
}
2025-03-31 13:15:47 +02:00
2025-03-28 13:53:35 +01:00
button {
background-color: #1976d2;
color: white;
2025-03-31 13:15:47 +02:00
padding: 0.75rem;
2025-03-28 13:53:35 +01:00
border: none;
2025-03-31 13:15:47 +02:00
border-radius: 6px;
font-weight: bold;
2025-03-28 13:53:35 +01:00
cursor: pointer;
2025-03-31 13:15:47 +02:00
transition: background-color 0.3s ease;
2025-03-28 13:53:35 +01:00
}
2025-03-31 13:15:47 +02:00
2025-03-28 13:53:35 +01:00
button:hover {
2025-03-31 13:15:47 +02:00
background-color: #125aa3;
}
p {
text-align: center;
margin-top: 1rem;
2025-03-28 13:53:35 +01:00
}
</style>
</login>