Skip to content

Commit e803424

Browse files
committed
20240608_InicioPruebas
1 parent 62bca8c commit e803424

File tree

8 files changed

+407
-59
lines changed

8 files changed

+407
-59
lines changed

Entregas/Entrega2/index.html

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,33 @@
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
66
<link rel="stylesheet" href="./estilos.css" type="text/css">
7-
8-
<title>ENTREGA 2 </title>
7+
<script async src="./index.js"></script>
8+
<title>ENTREGA 01</title>
99
</head>
10-
<body>
11-
<div class="div1">
12-
<p>2ª ENTREGA </p>
13-
<ul class="lista">
14-
<li> CLASES</li>
15-
<li> ARRAYS</li>
16-
<li> CONDICIONALES, ETC.</li>
17-
</ul></div>
1810

19-
<script async src="./index.js"></script>
11+
<body>
12+
13+
<div id="contenedor">
14+
<div id="central">
15+
<div id="login">
16+
<div class="titulo">
17+
Acceso Usuario
18+
</div>
19+
<form id="loginform">
20+
<input type="text" name="usuario" placeholder="Usuario" required>
21+
22+
<input type="password" placeholder="Contrasena" name="password" required>
23+
24+
<button type="submit" title="Ingresar" name="Ingresar">Login</button>
25+
</form>
26+
<div class="pie-form">
27+
No tienes usuario?<a href="#">Registrate</a>
28+
</div>
29+
</div>
30+
<div class="inferior">
31+
<a href="#">Inicio</a>
32+
</div>
33+
</div>
34+
</div>
2035
</body>
2136
</html>

Entregas/Entrega2/index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,20 @@ class User {
5858

5959
// Método para obtener la contraseña
6060
darPass() {
61-
return this.pass;
61+
return this.datosU.pass;
6262
}
6363

6464

6565
login (){
6666
let x=true; let y=true;
67-
console.log("DENTRO DEL LOGIN: "+ this.datosU.usuario);
67+
console.log("DENTRO DEL LOGIN: "+ this.darUsuario());
6868

6969
if(this.datosU.usuario===null){
7070
alert("DEBE REGISTRAR USUARIO");
7171
this.ingresoDatos();
7272
}
7373
while (x) {
74-
console.log("USUARIO en WHILE(x): "+this.datosU.pass);
74+
console.log("USUARIO en WHILE(x): "+this.darPass());
7575
let user=prompt("INGRESE USUARIO O X PARA MENU: ");
7676
if(user ==="X" || user==="x"){
7777
x=false;
@@ -83,12 +83,13 @@ class User {
8383
}else {alert("INGRESE USUARIO VALIDO")}
8484
}
8585
while (y) {
86-
console.log("PASS en el WHILE(y): "+this.datosU.pass);
8786
let user=prompt("PASSWORD: ");
8887
if (user===this.datosU.pass){
89-
alert("Validacion correcta!! \n SIGA SIGA")
88+
alert("Validacion correcta!! \n SIGA SIGA");
89+
x=false;
90+
y=false;
9091
break;
91-
}else {alert("Clave INCORRECTA")}
92+
}else {alert("Clave INCORRECTA")}
9293
}
9394
}
9495
}
@@ -107,6 +108,7 @@ let opt=parseInt(prompt ("INGRESE OPCION:\n 0. REGISTRO USUARIO\n 1.LOGIN\n
107108
break;
108109
case 1:
109110
u.login();//Pide Login usando datos ingresados
111+
opcion=false;
110112
break;
111113
case 2:
112114
opcion=false;

Entregas/Proyecto/index.js

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,119 @@
11

2+
/**
3+
* CLASE CON METODOS PARA REGISTRO Y ACCESO
4+
*/
25

6+
class User {
7+
constructor(nombre, apellido, cedula, usuario,pass){
8+
this.nombre= nombre;
9+
this.apellido= apellido;
10+
this.cedula= cedula;
11+
this.usuario= usuario;
12+
this.pass=pass ;
13+
this.datosU={
14+
nombre: this.nombre,
15+
apellido: this.apellido,
16+
cedula:this.cedula,
17+
usuario: this.usuario,
18+
pass: this.pass
19+
}
20+
}
21+
ingresoDatos (){
22+
/**
23+
* USANDO PROMPT PARA INGRESO DE DATOS
24+
*/
25+
// this.nombre=prompt("Ingrese Nombre: ");
26+
// this.apellido=prompt("Ingrese Apellido: ");
27+
// this.cedula=prompt("Ingrese Cedula: ");
28+
// this.usuario=prompt("Ingrese Usuario: ");
29+
// this.pass=prompt("Ingrese Password: ");
30+
// this.datosU=[{
31+
// nombre: this.nombre,
32+
// apellido: this.apellido,
33+
// cedula:this.cedula,
34+
// usuario: this.usuario,
35+
// pass: this.pass
36+
// }]
37+
/**
38+
* USANDO UN FOR..IN PARA INGRESO DE DATOS
39+
*/
40+
const datosU={
41+
nombre: this.nombre,
42+
apellido: this.apellido,
43+
cedula:this.cedula,
44+
usuario: this.usuario,
45+
pass: this.pass
46+
}
47+
for (const property in datosU) {
48+
datosU[property] = prompt('Ingrese '+property+': ');
49+
}
50+
console.log(datosU);
51+
return this.datosU=datosU;
52+
}
53+
54+
// Método para obtener el nombre de usuario
55+
/* darUsuario() {
56+
return this.datosU.usuario;
57+
}
358
59+
// Método para obtener la contraseña
60+
darPass() {
61+
return this.pass;
62+
} */
63+
464

65+
login (){
66+
let x=true; let y=true;
67+
console.log("DENTRO DEL LOGIN: "+ this.datosU.usuario);
68+
69+
if(this.datosU.usuario===null){
70+
alert("DEBE REGISTRAR USUARIO");
71+
this.ingresoDatos();
72+
}
73+
while (x) {
74+
console.log("USUARIO en WHILE(x): "+this.datosU.pass);
75+
let user=prompt("INGRESE USUARIO O X PARA MENU: ");
76+
if(user ==="X" || user==="x"){
77+
x=false;
78+
y=false;
79+
break;
80+
} else if (user===this.datosU.usuario){
81+
//NO HAY ACCIONES AQUI,SI VALIDA user, SALTA A BLOQUE WHILE(y) A VALIDAR PASSWORD
82+
break;
83+
}else {alert("INGRESE USUARIO VALIDO")}
84+
}
85+
while (y) {
86+
console.log("PASS en el WHILE(y): "+this.datosU.pass);
87+
let user=prompt("PASSWORD: ");
88+
if (user===this.datosU.pass){
89+
alert("Validacion correcta!! \n SIGA SIGA")
90+
break;
91+
}else {alert("Clave INCORRECTA")}
92+
}
93+
}
94+
}
595

96+
/**
97+
* CODIGO
98+
*/
99+
let opcion=true;
100+
const u = new User();
101+
102+
while(opcion){
103+
let opt=parseInt(prompt ("INGRESE OPCION:\n 0. REGISTRO USUARIO\n 1.LOGIN\n 2.SALIR\n\n"));
104+
switch (opt) {
105+
case 0:
106+
u.ingresoDatos();//Pide registro de datos usuario
107+
break;
108+
case 1:
109+
u.login();//Pide Login usando datos ingresados
110+
break;
111+
case 2:
112+
opcion=false;
113+
break;
114+
default:
115+
alert("INGRSE VALOR VALIDO");
116+
break;
117+
}
118+
}
119+
alert("USTED SALIO DEL SISTEMA");
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
html{
2+
font-family: Tahoma;
3+
}
4+
5+
body {
6+
font-family: sans-serif;
7+
font-weight: normal;
8+
font-size: 100%;
9+
color: #a6d6ef;
10+
11+
margin: 0;
12+
background-color: #0f4c75;
13+
}
14+
p {
15+
padding: 20px;
16+
width: 30%;
17+
background-color: rgb(19, 188, 231);
18+
text-align: center;
19+
font-size:150%;
20+
font-weight: bold;
21+
color: aliceblue;
22+
border-radius: 35px 0px 35px 0px;
23+
-moz-border-radius: 35px 0px 35px 0px;
24+
-webkit-border-radius: 35px 0px 35px 0px;
25+
border: 2px solid #5878ca;
26+
}
27+
28+
/* #div1 {
29+
align-content: center;
30+
align-self: center;
31+
} */
32+
33+
#contenedor {
34+
display: flex;
35+
align-items: center;
36+
justify-content: center;
37+
38+
margin: 0;
39+
padding: 0;
40+
min-width: 100vw;
41+
min-height: 100vh;
42+
width: 100%;
43+
height: 100%;
44+
}
45+
46+
#central {
47+
max-width: 320px;
48+
width: 100%;
49+
}
50+
51+
.titulo {
52+
font-size: 200%;
53+
color:#bbe1fa;
54+
text-align: center;
55+
margin-bottom: 20px;
56+
}
57+
58+
#login {
59+
width: 100%;
60+
padding: 50px 30px;
61+
background-color: #3282b8;
62+
border-radius: 3px;
63+
-moz-border-radius: 3px;
64+
-webkit-border-radius: 3px ;
65+
66+
box-sizing: border-box;
67+
}
68+
69+
#login input {
70+
font-family: sans-serif;
71+
font-size: 110%;
72+
color: #1b262c;
73+
74+
display: block;
75+
width: 100%;
76+
height: 40px;
77+
78+
margin-bottom: 10px;
79+
padding: 5px 5px 5px 10px;
80+
81+
box-sizing: border-box;
82+
83+
border: none;
84+
border-radius: 3px 3px 3px 3px;
85+
-moz-border-radius: 3px 3px 3px 3px;
86+
-webkit-border-radius: 3px 3px 3px 3px;
87+
}
88+
89+
#login input::placeholder {
90+
font-family: sans-serif;
91+
color: #E4E4E4;
92+
}
93+
94+
#login button {
95+
font-family: sans-serif;
96+
font-size: 110%;
97+
color:#1b262c;
98+
width: 100%;
99+
height: 40px;
100+
border: none;
101+
102+
border-radius: 3px 3px 3px 3px;
103+
-moz-border-radius: 3px 3px 3px 3px;
104+
-webkit-border-radius: 3px 3px 3px 3px;
105+
106+
background-color: #bbe1fa;
107+
108+
margin-top: 10px;
109+
}
110+
111+
#login button:hover {
112+
background-color: #0f4c75;
113+
color:#bbe1fa;
114+
}
115+
116+
.pie-form {
117+
font-size: 90%;
118+
text-align: center;
119+
margin-top: 15px;
120+
}
121+
122+
.pie-form a {
123+
display: block;
124+
text-decoration: none;
125+
color: #bbe1fa;
126+
margin-bottom: 3px;
127+
}
128+
129+
.pie-form a:hover {
130+
color: #0f4c75;
131+
}
132+
133+
.inferior {
134+
margin-top: 10px;
135+
font-size: 90%;
136+
text-align: center;
137+
}
138+
139+
.inferior a {
140+
display: block;
141+
text-decoration: none;
142+
color: #bbe1fa;
143+
margin-bottom: 3px;
144+
}
145+
146+
.inferior a:hover {
147+
color: #3282b8;
148+
}

0 commit comments

Comments
 (0)