Skip to content

Privacy-first password manager with built-in email aliasing. Fully encrypted and self-hostable.

4.3 KB
Raw Blame
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>E2E Test Form</title>
  <link rel="icon" type="image/x-icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🔐</text></svg>">
  <style>
    body {
      font-family: Arial, sans-serif;
      display: flex;
      justify-content: center;
      align-items: center;
      min-height: 100vh;
      margin: 0;
      background-color: #f0f0f0;
    }
    .login-form {
      background: white;
      padding: 2rem;
      border-radius: 8px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      width: 300px;
    }
    h1 {
      margin-top: 0;
      text-align: center;
      color: #333;
    }
    .form-group {
      margin-bottom: 1rem;
    }
    label {
      display: block;
      margin-bottom: 0.5rem;
      color: #555;
    }
    input[type="text"],
    input[type="email"],
    input[type="password"] {
      width: 100%;
      padding: 0.75rem;
      border: 1px solid #ddd;
      border-radius: 4px;
      font-size: 1rem;
      box-sizing: border-box;
    }
    input:focus {
      outline: none;
      border-color: #007bff;
    }
    button[type="submit"] {
      width: 100%;
      padding: 0.75rem;
      background-color: #007bff;
      color: white;
      border: none;
      border-radius: 4px;
      font-size: 1rem;
      cursor: pointer;
    }
    button[type="submit"]:hover {
      background-color: #0056b3;
    }
    button[type="submit"]:disabled {
      background-color: #ccc;
      cursor: not-allowed;
    }
    .status-message {
      margin-top: 1rem;
      padding: 0.75rem;
      border-radius: 4px;
      text-align: center;
      display: none;
    }
    .status-message.success {
      display: block;
      background-color: #d4edda;
      color: #155724;
      border: 1px solid #c3e6cb;
    }
    .status-message.error {
      display: block;
      background-color: #f8d7da;
      color: #721c24;
      border: 1px solid #f5c6cb;
    }
    .status-message.loading {
      display: block;
      background-color: #cce5ff;
      color: #004085;
      border: 1px solid #b8daff;
    }
  </style>
</head>
<body>
  <form class="login-form" id="loginForm" method="post">
    <h1>Login</h1>
    <div class="form-group">
      <label for="username">Username or Email</label>
      <input type="text" id="username" name="username" autocomplete="username" placeholder="Enter username or email" required>
    </div>
    <div class="form-group">
      <label for="password">Password</label>
      <input type="password" id="password" name="password" autocomplete="current-password" placeholder="Enter password" required>
    </div>
    <button type="submit" id="submitBtn">Sign In</button>
    <div id="statusMessage" class="status-message"></div>
  </form>

  <script>
    /**
     * Simulates a realistic AJAX-based login flow.
     * This mimics how modern web applications handle login submissions.
     */
    document.getElementById('loginForm').addEventListener('submit', function(event) {
      // Prevent the default form submission (like most modern sites do)
      event.preventDefault();

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

      // Basic validation
      if (!username || !password) {
        statusMessage.textContent = 'Please fill in all fields';
        statusMessage.className = 'status-message error';
        return;
      }

      // Show loading state (simulating network request)
      submitBtn.disabled = true;
      submitBtn.textContent = 'Signing in...';
      statusMessage.textContent = 'Authenticating...';
      statusMessage.className = 'status-message loading';

      // Simulate async login request (like a real AJAX call)
      setTimeout(function() {
        // Simulate successful login
        submitBtn.textContent = 'Signed In';
        statusMessage.textContent = 'Login successful! Redirecting...';
        statusMessage.className = 'status-message success';

        // In a real app, this would redirect or update the UI
        // For testing, we just show success state
      }, 500);
    });
  </script>
</body>
</html>