Files
SAE_riot/components/login.riot

61 lines
1.6 KiB
Plaintext

<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;
await login(email, password);
window.location.href = '#';
}
export default {
loginUser
}
</script>
<style>
form {
display: flex;
flex-direction: column;
gap: 1rem;
max-width: 400px;
margin: auto;
background: white;
padding: 2rem;
border-radius: 10px;
box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
input {
padding: 0.75rem;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 1rem;
}
button {
background-color: #1976d2;
color: white;
padding: 0.75rem;
border: none;
border-radius: 6px;
font-weight: bold;
cursor: pointer;
transition: background-color 0.3s ease;
}
button:hover {
background-color: #125aa3;
}
p {
text-align: center;
margin-top: 1rem;
}
</style>
</login>