node-blog/views/user/login.ejs
2025-06-24 11:42:12 +08:00

139 lines
3.0 KiB
Plaintext

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>内容管理系统 - 用户登录</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}
body {
background-color: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-image: linear-gradient(120deg, #f6d365 0%, #fda085 100%);
}
.login-container {
background-color: white;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
padding: 40px;
width: 100%;
max-width: 400px;
transition: all 0.3s ease;
}
.login-container:hover {
box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}
h2 {
color: #333;
text-align: center;
margin-bottom: 30px;
font-weight: 600;
}
.error-message {
color: #e74c3c;
background-color: #fadbd8;
padding: 10px 15px;
border-radius: 5px;
margin-bottom: 20px;
font-size: 14px;
text-align: center;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
color: #555;
font-weight: 500;
}
input {
width: 100%;
padding: 12px 15px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 16px;
transition: border 0.3s;
}
input:focus {
border-color: #3498db;
outline: none;
box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}
button {
width: 100%;
padding: 12px;
background-color: #3498db;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #2980b9;
}
.register-link {
text-align: center;
margin-top: 20px;
color: #555;
}
.register-link a {
color: #3498db;
text-decoration: none;
transition: color 0.3s;
}
.register-link a:hover {
color: #2980b9;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="login-container">
<h2>内容管理系统登录</h2>
<% if (error) { %>
<div class="error-message"><%= error %></div>
<% } %>
<form method="post" action="/login">
<div class="form-group">
<label for="username">用户名</label>
<input type="text" id="username" name="username" required placeholder="请输入用户名">
</div>
<div class="form-group">
<label for="password">密码</label>
<input type="password" id="password" name="password" required placeholder="请输入密码">
</div>
<button type="submit">登 录</button>
</form>
<div class="register-link">
没有账号?<a href="/register">立即注册</a>
</div>
</div>
</body>
</html>