Commit fcb4012a authored by Adrian's avatar Adrian
Browse files

frontend cambios para validar login

parent c38409a8
Pipeline #2300 canceled with stages
......@@ -6,9 +6,13 @@
<title>.:: Sitio ::.</title>
<link rel="stylesheet" href="./style.css">
<script type="text/javascript">
function login () {
document.getElementById('login').style.display = 'none';
document.getElementById('data').style.display = 'block';
function login () {
if (document.getElementById('user').value === 'admin' && document.getElementById('password').value === '123456') {
document.getElementById('login').style.display = 'none';
document.getElementById('data').style.display = 'block';
} else {
alert('Datos incorrectos');
}
}
async function postData(url = '', data = {}) {
const response = await fetch(url, {
......@@ -31,7 +35,7 @@
text: document.querySelector('#description').value
})
.then((data) => {
console.log(data);
alert('Mensaje enviado');
});
}
</script>
......@@ -40,8 +44,8 @@
<div class="main">
<section id="login">
<form action="#" onsubmit="event.preventDefault(); login();" class="login">
<input type="text" required placeholder="Usuario">
<input type="text" required placeholder="Contraseña">
<input type="text" id="user" required placeholder="Usuario">
<input type="password" id="password" required placeholder="Contraseña">
<button type="submit">ENVIAR</button>
</form>
</section>
......
......@@ -16,6 +16,12 @@ body {
margin: 10px;
width: calc(100% - 40px);
}
.main input[type="password"] {
padding: 10px;
outline: none;
margin: 10px;
width: calc(100% - 40px);
}
.main button[type="submit"] {
padding: 10px 0;
outline: none;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment