<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Secure Login Form</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background: #f0f2f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background: #ffffff;
padding: 40px;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0,0,0,0.1);
width: 100%;
max-width: 400px;
}
h2 {
text-align: center;
margin-bottom: 24px;
color: #333;
}
.input-group {
margin-bottom: 20px;
}
.input-group label {
display: block;
margin-bottom: 8px;
color: #666;
font-size: 14px;
}
.input-group input {
width: 100%;
padding: 12px;
border: 1px solid #ccc;
border-radius: 6px;
font-size: 16px;
outline: none;
transition: border-color 0.3s;
}
.input-group input:focus {
border-color: #228B22;
}
.btn-login {
width: 100%;
padding: 12px;
background-color: #228B22;
border: none;
border-radius: 6px;
color: white;
font-size: 16px;
font-weight: bold;
cursor: pointer;
transition: background 0.3s;
}
.btn-login:hover {
background-color: #1e7b1e;
}
.error-msg {
color: #d9534f;
background-color: #f2dede;
padding: 10px;
border-radius: 4px;
margin-bottom: 20px;
font-size: 14px;
text-align: center;
display: none;
}
</style>
</head>
<body>
<div class="login-container">
<h2>Secure Login</h2>
<div class="error-msg" id="errorBox"></div>
<form id="loginForm" onsubmit="validateLogin(event)">
<div class="input-group">
<label for="username">Username</label>
<input type="text" id="username" required autocomplete="off">
</div>
<div class="input-group">
<label for="password">Password</label>
<input type="password" id="password" required>
</div>
<button type="submit" class="btn-login">Sign In</button>
</form>
</div>
<script>
function validateLogin(event) {
event.preventDefault(); // Page reload rokne ke liye
const userInp = document.getElementById('username').value.trim();
const passInp = document.getElementById('password').value.trim();
const errorBox = document.getElementById('errorBox');
const sU = "bWFuaXNo"; // manish
const sP = "MTIzNA=="; // 1234
const sM = "TG9naW4gU3VjY2Vzc2Z1bCEgV2VsY29tZS4="; //
const sL = "aHR0cHM6Ly93d3cubWFuaWVib29rLm9ubGluZS8="; //
// Verification check
if (btoa(userInp) === sU && btoa(passInp) === sP) {
errorBox.style.display = "none";
alert(atob(sM));
window.location.href = atob(sL);
} else {
errorBox.textContent = "Galat Username ya Password!";
errorBox.style.display = "block";
}
}
</script>
</body>
</html>