feat: 增加暗黑主题切换功能 🌙

- CSS 变量实现主题切换
- 右上角切换按钮
- 本地存储记住主题偏好
- 平滑过渡动画
- 所有页面支持暗黑模式
This commit is contained in:
root
2026-03-11 21:44:14 +08:00
parent c337481daa
commit 00a33bc424
6 changed files with 172 additions and 25 deletions

View File

@@ -8,6 +8,7 @@
</head>
<body>
<div class="container">
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="avatar">
<span class="sparkle">👋</span>
</div>
@@ -26,5 +27,6 @@
Powered by <span>Flask</span> & <span>OpenClaw</span>
</div>
</div>
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
</body>
</html>

View File

@@ -8,6 +8,7 @@
</head>
<body>
<div class="container auth-container">
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="avatar">
<span>🔐</span>
</div>
@@ -42,5 +43,6 @@
Powered by <span>Flask</span> & <span>OpenClaw</span>
</div>
</div>
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
</body>
</html>

View File

@@ -8,6 +8,7 @@
</head>
<body>
<div class="container auth-container">
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="avatar">
<span>📝</span>
</div>
@@ -45,5 +46,6 @@
Powered by <span>Flask</span> & <span>OpenClaw</span>
</div>
</div>
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
</body>
</html>

View File

@@ -8,6 +8,7 @@
</head>
<body>
<div class="container">
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="avatar">
<span class="sparkle">🎉</span>
</div>
@@ -35,5 +36,7 @@
</div>
{% endif %}
{% endwith %}
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
</body>
</html>