Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="es">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Login</title>
- <style>
- body {
- font-family: 'Arial', sans-serif;
- display: flex;
- justify-content: center;
- align-items: center;
- height: 100vh;
- margin: 0;
- background-color: #f0f0f0;
- }
- .login-container {
- background-color: #fff;
- padding: 20px;
- border-radius: 10px;
- box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
- width: 300px;
- }
- .login-container h2 {
- text-align: center;
- margin-bottom: 20px;
- color: #333;
- }
- .login-container input[type="text"],
- .login-container input[type="password"] {
- width: 100%;
- padding: 10px;
- margin: 10px 0;
- border: 1px solid #ccc;
- border-radius: 5px;
- }
- .login-container button {
- width: 100%;
- padding: 10px;
- background-color: #28a745;
- border: none;
- border-radius: 5px;
- color: white;
- font-size: 16px;
- cursor: pointer;
- }
- .login-container button:hover {
- background-color: #218838;
- }
- .error {
- color: red;
- text-align: center;
- margin-top: 10px;
- }
- </style>
- </head>
- <body>
- <div class="login-container">
- <h2>Login</h2>
- <form id="loginForm">
- <input type="text" id="username" placeholder="Usuario" required>
- <input type="password" id="password" placeholder="Contraseña" required>
- <button type="submit">Iniciar sesión</button>
- <p class="error" id="errorMsg"></p>
- </form>
- </div>
- <script>
- // Credenciales predefinidas (puedes modificarlas según necesites)
- const logins = {
- 'kapada.net': 'loginvip',
- 'user2': 'password123',
- 'admin': 'adminpass'
- };
- document.getElementById('loginForm').addEventListener('submit', function (e) {
- e.preventDefault();
- const username = document.getElementById('username').value;
- const password = document.getElementById('password').value;
- // Verificar credenciales
- if (logins[username] && logins[username] === password) {
- alert('¡Login exitoso!');
- // Redirigir o realizar acciones tras el login
- } else {
- document.getElementById('errorMsg').innerText = 'Usuario o contraseña incorrectos';
- }
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement