Skip to content

Commit 549137a

Browse files
committed
20240624_005
1 parent d0b5fd2 commit 549137a

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

Entregas/Entrega3/css/estilosMain.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ body {
2020
background-position: center center;
2121
background-attachment: fixed;
2222
}
23-
#mensajeLogin {
23+
#mensajeLogin, #mensajeRegistro {
2424

2525
font-family: sans-serif;
2626
color:burlywood;

Entregas/Entrega3/js/main.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
/**
2525
* PRUEBAS JSON
2626
*/
27-
/* if (nom!=null && ape!=null && mai!=null && usu!=null && pas!= null){ */
27+
if (!nom || !ape || !mai || !usu || !pas) {
28+
29+
//Envia mensaje a <DIV> con ID "mensajeLogin" en el documento
30+
document.querySelector('#mensajeRegistro').innerText = "Falta ingresar algun dato.";
31+
32+
}else{
2833
// Obtener los datos existentes en localStorage (si existen)
2934
let usuarios = JSON.parse(localStorage.getItem('usuarios')) || [];
3035

@@ -43,10 +48,7 @@
4348

4449
//Envia mensaje a DIV con ID "mensajeRegistro" en el documento
4550
document.querySelector('#SetPassword').innerText = "Usuario y password REGISTRADO";
46-
/* } else {
47-
return NaN;
48-
} */
49-
51+
}
5052

5153
return registroUsuarios;
5254
}
@@ -58,7 +60,7 @@
5860
function mostrarLogin() {
5961
let docuLogin = document.getElementById('contenido');
6062
document.getElementById('contenido').innerHTML =`
61-
<div id="formlogin"><img src="./img/logo.jpg" alt="Logo">
63+
<div id="formlogin"><img src="/img/logo.jpg" alt="Logo">
6264
<BR><h2>Iniciar Sesión</h2>
6365
<form class="formSubmit" action="#">
6466
<input type="text" id="GetUsuario" placeholder="Usuario" required>
@@ -86,17 +88,18 @@
8688
let docuRegister= document.getElementById('contenido');
8789
event.preventDefault()
8890
document.getElementById('contenido').innerHTML = `
89-
<div id="formlogin"><img src="./img/logo.jpg" alt="Logo">
91+
<div id="formlogin"><img src="/img/logo.jpg" alt="Logo">
9092
<h2>Crea tu cuenta</h2>
9193
<form class="formSubmit" action="#">
9294
<input type="text" id="SetNombre" placeholder="Nombre" required>
9395
<input type="text" id="SetApellido" placeholder="Apellido" required>
9496
<input type="email" id="SetMail" placeholder="Correo Electronico" required>
9597
<input type="text" id="SetUsuario" placeholder="Usuario" required>
9698
<input type="password" id="SetPassword" placeholder="Contraseña" required>
97-
<input type="submit" id="register" value="Registrarse" onclick="registro()" ><BR>
99+
<input type="submit" id="register" value="Registrarse" onclick="registro()" >
100+
<div id="mensajeRegistro"><BR></div>
98101
</form>
99-
Ya tienes usuario? <button id="login" class="btnLogin" onclick="mostrarLogin()">Login</button>
102+
<BR>Ya tienes usuario? <button id="login" class="btnLogin" onclick="mostrarLogin()">Login</button>
100103
</div>
101104
`;
102105

0 commit comments

Comments
 (0)