WT Assignment 2
WT Assignment 2
WT Assignment 2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<h1>Login</h1>
<form id="loginForm">
<label for="username">Username:</label>
<label for="password">Password:</label>
<div class="captcha-container">
<label for="captcha">CAPTCHA:</label>
</div>
<button type="submit">Login</button>
</form>
</div>
<script src="script.js"></script>
</body>
</html>
TASK 2:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="social-login">
</div>
<div class="divider">
<span>or</span>
</div>
<form class="email-login">
<div class="input-group">
</div>
<div class="input-group">
<label for="password">Password</label>
</div>
<button type="submit">Login</button>
</form>
</div>
</body>
</html>
TASK 3:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<h2>Login</h2>
<div class="input-group">
<label for="username">Username</label>
</div>
<div class="input-group">
<label for="password">Password</label>
</div>
<button type="submit">Login</button>
</form>
<div class="input-group">
<label for="code">Verification Code</label>
</div>
<button type="submit">Verify</button>
</form>
</div>
<script>
// Hardcoded credentials
const verificationCode = '123456'; // This would be sent to the user in a real app
loginForm.addEventListener('submit', function(e) {
e.preventDefault();
// Check credentials
loginForm.classList.add('hidden');
twoFAForm.classList.remove('hidden');
alert("A verification code has been sent to your registered email or phone.");
} else {
}
});
twoFAForm.addEventListener('submit', function(e) {
e.preventDefault();
} else {
});
</script>
</body>
</html>
TASK 4:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="login-container">
<h2>Email Login</h2>
<form action="backend_login.php" method="POST">
<label for="email">Email:</label>
<label for="password">Password:</label>
</form>
</div>
</body>
</html>
CSS:
body {
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
.login-container {
background-color: white;
padding: 20px;
border-radius: 8px;
width: 300px;
}
.login-container h2 {
text-align: center;
margin-bottom: 20px;
.input-field {
width: 100%;
padding: 10px;
margin: 10px 0;
border-radius: 4px;
.btn {
width: 100%;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
.btn:hover {
background-color: #45a049;
TASK 5:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<div class="social-login">
</div>
<div class="divider">
<span>or</span>
</div>
<div class="input-group">
<label for="email">Email</label>
</div>
<div class="input-group">
<label for="password">Password</label>
</div>
<button type="submit">Login</button>
</form>
</div>
<script>
// Hardcoded credentials
emailLoginForm.addEventListener('submit', function(e) {
e.preventDefault();
// Check credentials
alert("Logged in successfully!");
} else {
});
</script>
</body>
</html>
TASK 6:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Biometric Login</title>
</head>
<body>
<div class="login-container">
<h2>Biometric Login</h2>
<div class="biometric-options">
</div>
<label for="username">Username:</label>
<label for="password">Password:</label>
</form>
</div>
<script>
setTimeout(function() {
});
</script>
</body>
</html>
TASK 7:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<h1>Login</h1>
<form id="loginForm">
<label for="username">Username:</label>
<label for="password">Password:</label>
<label for="captcha">CAPTCHA:</label>
</div>
<button type="submit">Login</button>
</form>
</div>
<script src="script.js"></script>
</body>
</html>
TASK 8:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="container">
<h2>Login</h2>
<div class="input-group">
<label for="username">Username</label>
</div>
<div class="input-group">
<label for="password">Password</label>
</div>
<button type="submit">Login</button>
</form>
<div class="input-group">
</div>
<button type="submit">Verify</button>
</form>
</div>
<script>
// Hardcoded credentials
const verificationCode = '123456'; // This would be sent to the user in a real app
loginForm.addEventListener('submit', function(e) {
e.preventDefault();
loginForm.classList.add('hidden');
twoFAForm.classList.remove('hidden');
alert("A verification code has been sent to your registered email or phone.");
} else {
});
twoFAForm.addEventListener('submit', function(e) {
e.preventDefault();
} else {
});
</script>
</body>
</html>
*{
box-sizing: border-box;
margin: 0;
padding: 0;
body {
background-color: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
.container {
background-color: white;
padding: 20px;
border-radius: 8px;
width: 300px;
h2 {
margin-bottom: 20px;
text-align: center;
.auth-form {
display: flex;
flex-direction: column;
}
.input-group {
margin-bottom: 15px;
label {
display: block;
margin-bottom: 5px;
input {
width: 100%;
padding: 10px;
border-radius: 4px;
button {
background-color: #5cb85c;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 16px;
padding: 10px;
button:hover {
background-color: #4cae4c;
.hidden {
display: none;