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

147 lines
3.2 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, #84fab0 0%, #8fd3f4 100%);
}
.register-container {
background-color: white;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
padding: 40px;
width: 100%;
max-width: 450px;
transition: all 0.3s ease;
}
.register-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: #2ecc71;
outline: none;
box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.2);
}
button {
width: 100%;
padding: 12px;
background-color: #2ecc71;
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.3s;
margin-top: 10px;
}
button:hover {
background-color: #27ae60;
}
.login-link {
text-align: center;
margin-top: 25px;
color: #555;
}
.login-link a {
color: #2ecc71;
text-decoration: none;
transition: color 0.3s;
}
.login-link a:hover {
color: #27ae60;
text-decoration: underline;
}
.password-hint {
font-size: 12px;
color: #777;
margin-top: 5px;
}
</style>
</head>
<body>
<div class="register-container">
<h2>创建新账户</h2>
<% if (error) { %>
<div class="error-message"><%= error %></div>
<% } %>
<form method="post" action="/register">
<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 class="password-hint">建议使用8位以上包含字母和数字的组合</div>
</div>
<button type="submit">立即注册</button>
</form>
<div class="login-link">
已有账号?<a href="/login">直接登录</a>
</div>
</div>
</body>
</html>