-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
67 lines (66 loc) · 1.73 KB
/
index.html
File metadata and controls
67 lines (66 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="en">
<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;
align-items: center; /* Center vertically */
justify-content: center; /* Center horizontally */
height: 100vh; /* Full viewport height */
margin: 0;
background-color: #f4f4f4;
}
.login-container {
background: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
width: 300px;
text-align: center;
}
.login-container input {
margin-bottom: 10px;
padding: 10px;
width: 80%;
}
.login-container button {
padding: 10px 20px;
border: none;
background-color: #007bff;
color: #fff;
cursor: pointer;
}
.login-container button:hover {
background-color: #0056b3;
}
.error-message {
color: red;
margin-top: 10px;
}
</style>
</head>
<body>
<div class="login-container">
<h2>Login</h2>
<input type="text" id="username" placeholder="Username" />
<input type="password" id="password" placeholder="Password" />
<button onclick="login()">Login</button>
<div id="error" class="error-message"></div>
</div>
<script>
function login() {
const username = document.getElementById('username').value;
const password = document.getElementById('password').value;
if (username === 'admin' && password === 'admin') {
window.location.href = 'home.html';
} else {
document.getElementById('error').textContent = 'Invalid username or password';
}
}
</script>
</body>
</html>