This commit is contained in:
2026-02-23 23:50:04 +08:00
commit 084d3b0faf
45 changed files with 4090 additions and 0 deletions

View File

@@ -0,0 +1,100 @@
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>发表新帖 - lv8girl</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #f0f7f0;
--surface: #ffffff;
--surface-light: #e8f0e8;
--border: #d0e0d0;
--text: #2c3e2c;
--text-soft: #5f6b5f;
--text-hint: #8f9f8f;
--primary: #3d9e4a;
--accent: #ffb347;
--gradient: linear-gradient(135deg, #3d9e4a, #5a9cff);
}
body.dark-mode {
--bg: #1a1e1a;
--surface: #1e261e;
--surface-light: #2a3a2a;
--border: #2a3a2a;
--text: #e0e8e0;
--text-soft: #b0bcb0;
--text-hint: #8a958a;
--primary: #6b8e6b;
--accent: #ffb347;
}
body { background: var(--bg); color: var(--text); font-family: -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; line-height: 1.6; transition: background 0.3s, color 0.3s; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.post-wrapper { max-width: 800px; width: 100%; }
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.logo { font-size: 2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.logo span { font-size: 0.9rem; background: var(--accent); color: var(--surface); padding: 4px 12px; border-radius: 30px; margin-left: 10px; -webkit-text-fill-color: var(--surface); }
.theme-toggle { background: var(--surface-light); border: none; color: var(--text); font-size: 1.3rem; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; }
.theme-toggle:hover { background: var(--accent); color: var(--surface); }
.post-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 30px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04); }
.post-card h2 { font-size: 1.8rem; font-weight: 600; color: var(--accent); margin-bottom: 25px; text-align: center; }
.error-message { background: var(--surface-light); border-left: 4px solid #ff6b6b; color: var(--text-soft); padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; }
.success-message { background: var(--surface-light); border-left: 4px solid var(--primary); color: var(--text-soft); padding: 12px 15px; border-radius: 8px; margin-bottom: 20px; }
.form-group { margin-bottom: 20px; }
label { display: block; margin-bottom: 8px; color: var(--text-soft); font-weight: 500; }
input[type="text"], textarea { width: 100%; padding: 12px 15px; background: var(--surface-light); border: 1px solid var(--border); border-radius: 30px; color: var(--text); font-size: 1rem; outline: none; transition: border 0.2s; }
textarea { border-radius: 20px; resize: vertical; min-height: 150px; }
input:focus, textarea:focus { border-color: var(--accent); }
input[type="file"] { background: var(--surface-light); border: 1px solid var(--border); border-radius: 30px; padding: 10px 15px; width: 100%; color: var(--text); }
.file-note { color: var(--text-hint); font-size: 0.85rem; margin-top: 5px; }
.btn { background: var(--gradient); border: none; border-radius: 40px; padding: 14px 30px; color: white; font-weight: 600; font-size: 1rem; cursor: pointer; transition: transform 0.2s; width: 100%; margin-top: 10px; }
.btn:hover { transform: scale(1.02); }
.footer-links { margin-top: 20px; text-align: center; }
.footer-links a { color: var(--text-hint); text-decoration: none; margin: 0 10px; }
.footer-links a:hover { color: var(--accent); }
</style>
</head>
<body>
<div class="post-wrapper">
<div class="header">
<div class="logo">lv8girl<span>绿坝娘</span></div>
<button class="theme-toggle" id="themeToggle">🌓</button>
</div>
<div class="post-card">
<h2>发表新帖</h2>
{{if .Error}}<div class="error-message">{{.Error}}</div>{{end}}
{{if .Success}}
<div class="success-message">{{.Success}}</div>
{{else}}
<form method="post" enctype="multipart/form-data">
<div class="form-group">
<label>标题</label>
<input type="text" name="title" placeholder="请输入标题" required>
</div>
<div class="form-group">
<label>内容</label>
<textarea name="content" placeholder="请输入帖子内容..." required></textarea>
</div>
<div class="form-group">
<label>上传图片可选不超过2MB</label>
<input type="file" name="image" accept="image/*">
<div class="file-note">支持 JPEG、PNG、GIF、WEBP 格式</div>
</div>
<button type="submit" class="btn">发 布</button>
</form>
{{end}}
<div class="footer-links">
<a href="/">返回首页</a>
<a href="/profile">个人主页</a>
</div>
</div>
</div>
<script>
const themeToggle = document.getElementById('themeToggle');
themeToggle.addEventListener('click', () => {
document.body.classList.toggle('dark-mode');
themeToggle.textContent = document.body.classList.contains('dark-mode') ? '☀️' : '🌓';
});
</script>
</body>
</html>