✨ 首页和登录页支持全局主题
- index.html 添加亮色主题 CSS 变量和样式 - index.html 添加 JS 自动加载全局主题 - app.js 修改 initTheme,未登录时从公开 API 获取全局主题 - 登录页面现在会跟随管理员设置的全局主题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
/* 暗色主题(默认) */
|
||||
:root {
|
||||
--bg-primary: #0a0a0f;
|
||||
--bg-secondary: #12121a;
|
||||
@@ -35,6 +36,43 @@
|
||||
--glow: rgba(102, 126, 234, 0.4);
|
||||
}
|
||||
|
||||
/* 亮色主题 */
|
||||
.light-theme {
|
||||
--bg-primary: #f0f4f8;
|
||||
--bg-secondary: #ffffff;
|
||||
--glass: rgba(102, 126, 234, 0.05);
|
||||
--glass-border: rgba(102, 126, 234, 0.15);
|
||||
--text-primary: #1a1a2e;
|
||||
--text-secondary: rgba(26, 26, 46, 0.7);
|
||||
--accent-1: #5a67d8;
|
||||
--accent-2: #6b46c1;
|
||||
--accent-3: #d53f8c;
|
||||
--glow: rgba(90, 103, 216, 0.3);
|
||||
}
|
||||
|
||||
/* 亮色主题特定样式 */
|
||||
body.light-theme .navbar {
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
}
|
||||
|
||||
body.light-theme .grid-bg {
|
||||
background-image:
|
||||
linear-gradient(rgba(102, 126, 234, 0.05) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(102, 126, 234, 0.05) 1px, transparent 1px);
|
||||
}
|
||||
|
||||
body.light-theme .gradient-orb {
|
||||
opacity: 0.3;
|
||||
}
|
||||
|
||||
body.light-theme .feature-card {
|
||||
background: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
body.light-theme .tech-bar {
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||
background: var(--bg-primary);
|
||||
@@ -610,5 +648,20 @@
|
||||
玩玩云 © 2025
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// 加载全局主题
|
||||
(async function() {
|
||||
try {
|
||||
const response = await fetch('/api/public/theme');
|
||||
const data = await response.json();
|
||||
if (data.success && data.theme === 'light') {
|
||||
document.body.classList.add('light-theme');
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('无法加载主题设置');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user