projet
This commit is contained in:
49
components/login.riot
Normal file
49
components/login.riot
Normal file
@@ -0,0 +1,49 @@
|
||||
<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;
|
||||
login(email, password);
|
||||
window.location.href = '#';
|
||||
}
|
||||
export default {
|
||||
loginUser
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
form {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-width: 300px;
|
||||
margin: auto;
|
||||
gap: 10px;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
input,
|
||||
button {
|
||||
padding: 0.5rem;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
button {
|
||||
background-color: #1976d2;
|
||||
color: white;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
button:hover {
|
||||
background-color: #135ba1;
|
||||
}
|
||||
</style>
|
||||
</login>
|
||||
Reference in New Issue
Block a user