contact / index.html
school44s's picture
Update index.html
a356945 verified
raw
history blame
2.08 kB
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<title>Đăng nhập</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
background: url('2.png') no-repeat center center fixed;
background-size: cover;
}
header {
background: url('1.png') no-repeat center;
background-size: cover;
height: 150px;
text-align: center;
color: white;
font-size: 28px;
line-height: 150px;
font-weight: bold;
text-shadow: 1px 1px 3px #000;
}
.login-box {
width: 300px;
margin: 50px auto;
padding: 20px;
background: rgba(255, 255, 255, 0.9);
border-radius: 8px;
box-shadow: 0 0 10px rgba(0,0,0,0.3);
}
.login-box input {
width: 100%;
padding: 10px;
margin: 8px 0;
border: 1px solid #ccc;
border-radius: 4px;
}
.login-box button {
width: 100%;
padding: 10px;
background: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
}
.login-box button:hover {
background: #45a049;
}
.error {
color: red;
text-align: center;
margin-top: 10px;
}
</style>
</head>
<body>
<header>Trang Giới Thiệu Bản Thân</header>
<div class="login-box">
<form onsubmit="return login()">
<input type="text" id="username" placeholder="Tên đăng nhập" required>
<input type="password" id="password" placeholder="Mật khẩu" required>
<button type="submit">Đăng nhập</button>
<div id="error" class="error"></div>
</form>
</div>
<script>
function login() {
const user = document.getElementById("username").value;
const pass = document.getElementById("password").value;
if (user === "admin" && pass === "admin") {
window.location.href = "contact.html";
} else {
document.getElementById("error").textContent = "Sai tên đăng nhập hoặc mật khẩu!";
}
return false;
}
</script>
</body>
</html>