<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录界面</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
height: 100vh;
background: #c7ecee url('your-background-image.jpg') no-repeat center center/cover;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.brand-text {
color: #007bff;
font-weight: bold;
font-size: 50px;
width: 60%;
margin: auto;
text-align: center;
position: absolute;
top: 10%;
transform: translateY(-50%);
}
#login-box {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
padding: 20px;
width: 300px;
}
#login-box input {
width: 100%;
padding: 10px;
margin: 8px 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 5px;
}
#login-box button {
width: 100%;
padding: 10px;
background-color: #007bff;
border: none;
border-radius: 5px;
color: #fff;
cursor: pointer;
}
#login-box button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="brand-text">海南旅游网</div>
<div id="login-box">
<h2>登录</h2>
<input type="text" id="username" placeholder="您的邮箱/手机号">
<input type="password" id="password" placeholder="密码">
<button οnclick="login()">登录</button>
<div id="register-link">
还没有账号?<a href="registration.html">立即注册</a>
</div>
</div>
<script>
function login() {
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
if (username === "admin" && password === "admin") {
alert("登录成功!");
} else {
alert("用户名或密码错误!");
}
}
</script>
</body>
</html>