Advertisement
Freshbloodb

Untitled

Oct 18th, 2024
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Login</title>
  7. <style>
  8. body {
  9. font-family: 'Arial', sans-serif;
  10. display: flex;
  11. justify-content: center;
  12. align-items: center;
  13. height: 100vh;
  14. margin: 0;
  15. background-color: #f0f0f0;
  16. }
  17. .login-container {
  18. background-color: #fff;
  19. padding: 20px;
  20. border-radius: 10px;
  21. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  22. width: 300px;
  23. }
  24. .login-container h2 {
  25. text-align: center;
  26. margin-bottom: 20px;
  27. color: #333;
  28. }
  29. .login-container input[type="text"],
  30. .login-container input[type="password"] {
  31. width: 100%;
  32. padding: 10px;
  33. margin: 10px 0;
  34. border: 1px solid #ccc;
  35. border-radius: 5px;
  36. }
  37. .login-container button {
  38. width: 100%;
  39. padding: 10px;
  40. background-color: #28a745;
  41. border: none;
  42. border-radius: 5px;
  43. color: white;
  44. font-size: 16px;
  45. cursor: pointer;
  46. }
  47. .login-container button:hover {
  48. background-color: #218838;
  49. }
  50. .error {
  51. color: red;
  52. text-align: center;
  53. margin-top: 10px;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <div class="login-container">
  59. <h2>Login</h2>
  60. <form id="loginForm">
  61. <input type="text" id="username" placeholder="Usuario" required>
  62. <input type="password" id="password" placeholder="Contraseña" required>
  63. <button type="submit">Iniciar sesión</button>
  64. <p class="error" id="errorMsg"></p>
  65. </form>
  66. </div>
  67.  
  68. <script>
  69. // Credenciales predefinidas (puedes modificarlas según necesites)
  70. const logins = {
  71. 'kapada.net': 'loginvip',
  72. 'user2': 'password123',
  73. 'admin': 'adminpass'
  74. };
  75.  
  76. document.getElementById('loginForm').addEventListener('submit', function (e) {
  77. e.preventDefault();
  78. const username = document.getElementById('username').value;
  79. const password = document.getElementById('password').value;
  80.  
  81. // Verificar credenciales
  82. if (logins[username] && logins[username] === password) {
  83. alert('¡Login exitoso!');
  84. // Redirigir o realizar acciones tras el login
  85. } else {
  86. document.getElementById('errorMsg').innerText = 'Usuario o contraseña incorrectos';
  87. }
  88. });
  89. </script>
  90. </body>
  91. </html>
  92.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement