Skip to content

Commit

Permalink
Login Pagina Ventas
Browse files Browse the repository at this point in the history
  • Loading branch information
luka0808 committed Dec 5, 2023
1 parent bc04e4f commit 4c70ccf
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 5 deletions.
7 changes: 3 additions & 4 deletions AdmProducto/main.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
document.getElementById("header").innerHTML=` <nav class="navbar navbar-expand-sm
navbar-light bg-light">
<div class="container">
<a class="navbar-brand" href="productos.html">CRUD</a>
<a class="navbar-brand" href="../Pagina Ventas/index.html">Volver a la Tienda</a>

</div>
</nav>`
</nav>
<h1>Administracion de la tienda</h1>
2 changes: 1 addition & 1 deletion Pagina Ventas/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<div class="header-iconos">
<div class="header-registro">
<button type="button" id="login-abrir-modal">Login in</button>
<button type="button"><a href="../AdmProducto/productos.html">Administrador</a></button>
<button type="button"><a href="/#2/admin.html">Administrador</a></button>
</div>

<dialog id="modal-login">
Expand Down
78 changes: 78 additions & 0 deletions login2/admin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/assets/logo-vt.svg" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login WolfMusic</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous" />
<link rel="stylesheet" href="styleAdm.css">
</head>

<body class="bg-dark d-flex justify-content-center align-items-center vh-100">
<div class="bg-white p-5 rounded-5 text-secondary shadow" style="width: 30rem">
<div class="d-flex justify-content-center logoImg">
<img src="/Pagina WolfMusic/img/wolf music.jpeg" alt="login-icon" style="height: 7rem" />
</div>
<div class="text-center fs-1 fw-bold">Login</div>
<div class="input-group mt-4">
<div class="input-group-text bg-dark">
<img src="/#2/recursos/username-icon.svg" alt="username-icon" style="height: 1rem" />
</div>
<input class="form-control bg-light" type="text" id="username" placeholder="Username" />
</div>
<div class="input-group mt-1">
<div class="input-group-text bg-dark">
<img src="/#2/recursos/password-icon.svg" alt="password-icon" style="height: 1rem" />
</div>
<input class="form-control bg-light" type="password" id="password" placeholder="Password" />
</div>
<div class="d-flex justify-content-around mt-1">
<div class="d-flex align-items-center gap-1">
<input class="form-check-input" type="checkbox" />
<div class="pt-1" style="font-size: 0.9rem">Remember me</div>
</div>
<div class="pt-1">
<a href="#" class="text-decoration-none text-dark fw-semibold fst-italic" style="font-size: 0.9rem">
Forgot your password?
</a>
</div>
</div>
<button class="btn btn-dark text-white w-100 mt-4 fw-semibold shadow-sm" id="loginBtn">
Login
</button>
</div>
<script>
const loginBtn = document.getElementById('loginBtn');
loginBtn.addEventListener('click', (e) => {
e.preventDefault();

const username = document.getElementById('username').value;
const password = document.getElementById('password').value;

// Validate username
if (!username || username.trim() === '') {
alert('Please enter a username.');
return;
}

// Validate password
if (!password || password.trim() === '') {
alert('Please enter a password.');
return;
}

// Check username and password
if (username === 'admin' && password === '12345') {
window.location.href = '/AdmProducto/productos.html';
} else {
alert('Usuario o contraseña incorrectos.');
}
});
</script>
</body>

</html>
1 change: 1 addition & 0 deletions login2/recursos/bx-user-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions login2/recursos/#-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions login2/recursos/password-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4c70ccf

Please # to comment.