Skip to content

ingreso img #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5,224 changes: 5,224 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"gh-pages": "^2.1.1",
"htmlhint": "^0.11.0",
"jest": "^24.9.0",
"jquery": "^3.5.1",
"opener": "^1.5.1",
"serve": "^11.0.0"
}
Expand Down
Binary file added sketch/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sketch/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sketch/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sketch/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/bienvenida.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/fondo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/img2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/img3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/img/perdio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 88 additions & 11 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,91 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tarjeta de crédito válida</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<header></header>
<main></main>
<footer></footer>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Apartamentos Hogar</title>
<link href="https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap" rel="stylesheet">
<link href="style.css" rel="stylesheet" type="text/css">


</head>

<body>

<!-- menu y logo -->

<section class="contenedor">
<header>
<article class="menu">
<img class="logo" src="/src/img/logo.png" alt="Logo apartamentos hogar">
</article>
<nav>
<ul>
<li><a href="#">Hogar</a></li>
<li><a href="#">LLave</a></li>
<li><a href="#">Vecinos</a></li>
<li><a href="#">Ayuda</a></li>
</ul>
</nav>
</header>

<!-- contenido -->

<main>
<article id="bienvenido" class="cuerpo">
<article class="img">
<img class="perdido" src="img/perdio.png" alt="olvido su tarjeta">
</article>
<article class="texto">
<p class="bienvenido">Bienvenido a</p>
<p class="apartamentos">Apartamentos</p>
<p class="home">Hogar</p> <br>
<button id="boton" type="button" class="btn">¿Olvido su tarjeta?</button>
</article>
</article>

<!-- Ingresar numero -->

<article id="numero" class="cuerpo">
<article class="img">
<img class="perdido" src="img/img2.png" alt="olvido su tarjeta">
</article>
<article class="texto">
<p class="parrafo">Por favor digite <br> el número de <br> la tarjeta</p>
<input id="card" type="text" maxlength="16" autocomplete="off"><br>
<button type="button" class="btn" id="ingresar">Ingrese</button>
</article>
</article>

<!-- Validacion -->

<article id="validacion" class="cuerpo">
<article class="img">
<img class="perdido" src="img/img2.png">
</article>
<article class="texto">
<p class="parrafo">No es valido, <br> digite de nuevo <br> el numero</p>
<input id="card" type="text" maxlength="12" autocomplete="off"><br>
<button type="button" class="btn" onclick="mostrarMensaje()">Ingrese</button>
</article>
</article>

<!-- mensaje -->

<article id="mensaje" class="cuerpo">
<article class="img">
<img class="perdido" src="img/img3.png">
</article>
<article class="texto">
<p class="mensaje">No olvide siempre tener <br> su tarjeta de ingreso <br> a las torres,
por su <br> seguridad y la <br> de todos. <br> Gracias!</p>
</article>
</article>
</main>
</section>

<script src="index.js" type="module"></script>
</body>
</body>

</html>
28 changes: 27 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
'use strict'

import validator from './validator.js';

console.log(validator);
let boton = document.getElementById('boton');
var numero = document.getElementById("numero");
var bienvenido = document.getElementById("bienvenido");
var mensaje = document.getElementById("mensaje");
var tarjeta = document.getElementById("card");
var ingresar = document.getElementById("ingresar");


boton.addEventListener('click', () => {
numero.style.display = "block";
bienvenido.style.display = "none";
});

ingresar.addEventListener('click', () => {

let valor = validator.isValid(tarjeta.value)

if (valor) {
alert(validator.maskify(tarjeta.value));
numero.style.display = "none";
mensaje.style.display = "block";
} else {
alert("no valido");
}
});
Loading