fix: 将主题按钮移到body直接子元素位置

- 按钮从 container 内部移到 body 直接子元素
- 使用 .theme-toggle 选择器替代 .container > .theme-toggle
- 彻底解决按钮闪烁问题
- 更新 CSS 版本号
This commit is contained in:
小白
2026-03-12 11:54:01 +08:00
parent 6ee511a574
commit 58cc9997e3
5 changed files with 11 additions and 11 deletions

View File

@@ -255,8 +255,8 @@ h1 {
}
}
/* 主题切换按钮 - 独立版本(欢迎页面 */
.container > .theme-toggle {
/* 主题切换按钮 - 独立版本(body直接子元素 */
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
@@ -280,12 +280,12 @@ h1 {
user-select: none;
}
.container > .theme-toggle:hover {
.theme-toggle:hover {
transform: rotate(20deg) scale(1.1);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.container > .theme-toggle:active {
.theme-toggle:active {
transform: scale(0.95);
}

View File

@@ -4,11 +4,11 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>欢迎 - 云下飞</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312b">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312c">
</head>
<body>
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="container">
<button class="theme-toggle" style="position:fixed;top:20px;right:20px;" aria-label="切换主题">🌙</button>
<div class="avatar">
<span class="sparkle">👋</span>
</div>

View File

@@ -4,11 +4,11 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录 - 云下飞</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312b">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312c">
</head>
<body>
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="container auth-container">
<button class="theme-toggle" style="position:fixed;top:20px;right:20px;" aria-label="切换主题">🌙</button>
<div class="avatar">
<span>🔐</span>
</div>

View File

@@ -4,11 +4,11 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>注册 - 云下飞</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312b">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312c">
</head>
<body>
<button class="theme-toggle" aria-label="切换主题">🌙</button>
<div class="container auth-container">
<button class="theme-toggle" style="position:fixed;top:20px;right:20px;" aria-label="切换主题">🌙</button>
<div class="avatar">
<span>📝</span>
</div>

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>欢迎回来 - {{ username }}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312b">
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}?v=20260312c">
</head>
<body>
<!-- 快捷导航栏 - 登录后显示 -->