Skip to content

Commit 2b4cf66

Browse files
style:优化界面布局
1 parent 22f0a6e commit 2b4cf66

File tree

16 files changed

+637
-227
lines changed

16 files changed

+637
-227
lines changed

src/App.css

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,32 @@
77
line-height: 1.6;
88
font-weight: 400;
99

10-
/* 马卡龙色系调色板 - 和谐柔和的色彩搭配 */
11-
--primary-pink: #FFD6E0; /* 马卡龙粉:主色调 - 更柔和的粉色 */
12-
--secondary-pink: #FFEEE6; /* 马卡龙浅粉:辅助色1 */
13-
--accent-pink: #FFECD2; /* 马卡龙橘粉:辅助色2 */
10+
/* 马卡龙色系调色板 - 优化对比度的和谐色彩搭配 */
11+
--primary-pink: #F8A5C2; /* 马卡龙粉:主色调 - 增强对比度 */
12+
--secondary-pink: #F4CBA4; /* 马卡龙浅粉:辅助色1 - 增强饱和度 */
13+
--accent-pink: #F0B27A; /* 马卡龙橘粉:辅助色2 - 增强可见度 */
1414
--light-pink: #FFF8F5; /* 接近白色:中性色 */
1515
--light-pink-1: #FFF8F5; /* 接近白色:中性色 - 与light-pink一致 */
16-
--light-pink-2: #FFEEE6; /* 浅粉色:与secondary-pink一致 */
17-
--mint-green: #D6F5E2; /* 马卡龙薄荷绿:点缀色1 */
18-
--soft-blue: #DDEBF7; /* 马卡龙蓝:点缀色2 */
19-
--lavender: #E4D9FF; /* 马卡龙薰衣草紫:点缀色3 */
20-
--cream-yellow: #FFF2D8; /* 马卡龙奶油黄:点缀色4 */
21-
--text-primary: #5D5B6A; /* 深灰紫色:主要文字色 - 提高可读性 */
22-
--text-secondary: #8D8A97; /* 中灰紫色:次要文字色 */
23-
--text-light: #B5B0BD; /* 浅灰紫色:提示文字色 */
24-
--text-color: #5D5B6A; /* 文字颜色 - 与text-primary一致 */
16+
--light-pink-2: #F9E6D8; /* 浅粉色:增强对比度 */
17+
--mint-green: #A8E6CF; /* 马卡龙薄荷绿:点缀色1 - 增强饱和度 */
18+
--soft-blue: #AED6F1; /* 马卡龙蓝:点缀色2 - 增强可见度 */
19+
--lavender: #C8A8E9; /* 马卡龙薰衣草紫:点缀色3 - 增强对比度 */
20+
--cream-yellow: #F7DC6F; /* 马卡龙奶油黄:点缀色4 - 增强饱和度 */
21+
--text-primary: #4A4458; /* 深灰紫色:主要文字色 - 进一步增强对比度 */
22+
--text-secondary: #6B5B73; /* 中灰紫色:次要文字色 - 增强可读性 */
23+
--text-light: #8B7E8F; /* 浅灰紫色:提示文字色 - 保持可读性 */
24+
--text-color: #4A4458; /* 文字颜色 - 与text-primary一致 */
2525
--background-main: #FFFDFA; /* 极浅粉色:页面背景 */
2626
--background-secondary: #FFEEE6; /* 浅粉色:次级背景 */
2727
--card-background: #FFFFFF; /* 白色:卡片背景 */
2828
--neutral-color: #FFFFFF; /* 中性色 - 与card-background一致 */
2929
--shadow-pink: rgba(255, 214, 224, 0.2); /* 粉色阴影 */
3030
--border-color: rgba(255, 214, 224, 0.3); /* 边框颜色 */
31-
--accent-green: #D6F5E2; /* 马卡龙薄荷绿:替代原来的绿色 */
32-
--accent-yellow: #FFF2D8; /* 马卡龙奶油黄:替代原来的黄色 */
33-
--rarity-color: #E4D9FF; /* 马卡龙薰衣草紫:用于稀有物品边框 */
31+
--accent-green: #A8E6CF; /* 马卡龙薄荷绿:替代原来的绿色 - 增强饱和度 */
32+
--accent-yellow: #F7DC6F; /* 马卡龙奶油黄:替代原来的黄色 - 增强可见度 */
33+
--rarity-color: #C8A8E9; /* 马卡龙薰衣草紫:用于稀有物品边框 - 增强对比度 */
34+
--button-text: #FFFFFF; /* 按钮文字颜色:纯白色确保可读性 */
35+
--button-text-dark: #4A4458; /* 深色按钮文字:深色背景使用 */
3436

3537
color: var(--text-primary);
3638
background-color: var(--background-main);

src/components/MainMenu/GameActionButtons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const GameActionButtons: React.FC<GameActionButtonsProps> = ({
4646
<div className="grid grid-cols-2 gap-2">
4747
<Button
4848
onClick={onOpenAchievements}
49-
variant="secondary"
49+
variant="primary"
5050
size="medium"
5151
className="w-full py-3 text-sm font-medium"
5252
>
@@ -55,7 +55,7 @@ export const GameActionButtons: React.FC<GameActionButtonsProps> = ({
5555

5656
<Button
5757
onClick={onOpenDailyChallenge}
58-
variant="secondary"
58+
variant="primary"
5959
size="medium"
6060
className="w-full py-3 text-sm font-medium"
6161
>
@@ -64,7 +64,7 @@ export const GameActionButtons: React.FC<GameActionButtonsProps> = ({
6464

6565
<Button
6666
onClick={onOpenLeaderboard}
67-
variant="secondary"
67+
variant="success"
6868
size="medium"
6969
className="w-full py-3 text-sm font-medium col-span-2"
7070
>

src/components/auth/Auth.css

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@
1212
}
1313

1414
.auth-modal {
15-
background: white;
15+
background: var(--card-background);
16+
border: 2px solid var(--primary-pink);
1617
border-radius: 16px;
1718
padding: 2rem;
1819
width: 100%;
1920
max-width: 400px;
20-
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
21+
box-shadow: 0 20px 60px rgba(248, 165, 194, 0.3);
2122
position: relative;
2223
animation: authModalSlideIn 0.3s ease-out;
2324
}
@@ -41,12 +42,13 @@
4142
.auth-title {
4243
font-size: 2rem;
4344
font-weight: bold;
44-
color: #333;
45+
color: var(--text-primary);
4546
margin-bottom: 0.5rem;
47+
text-shadow: 0 1px 3px rgba(248, 165, 194, 0.2);
4648
}
4749

4850
.auth-subtitle {
49-
color: #666;
51+
color: var(--text-secondary);
5052
font-size: 1rem;
5153
}
5254

@@ -63,25 +65,27 @@
6365
}
6466

6567
.form-label {
66-
font-weight: 500;
67-
color: #333;
68+
font-weight: 600;
69+
color: var(--text-primary);
6870
font-size: 0.9rem;
6971
}
7072

7173
.form-input {
7274
padding: 0.75rem;
73-
border: 2px solid #e1e5e9;
75+
border: 2px solid var(--border-color);
7476
border-radius: 8px;
7577
font-size: 1rem;
76-
color: #333;
77-
background-color: #fff;
78-
transition: border-color 0.2s ease;
78+
color: var(--text-primary);
79+
background-color: var(--card-background);
80+
transition: all 0.2s ease;
7981
outline: none;
82+
font-weight: 500;
8083
}
8184

8285
.form-input:focus {
8386
border-color: var(--primary-pink);
84-
box-shadow: 0 0 0 3px rgba(248, 181, 215, 0.1);
87+
box-shadow: 0 0 0 3px rgba(248, 165, 194, 0.2);
88+
background-color: var(--light-pink);
8589
}
8690

8791
.form-input::placeholder {
@@ -133,21 +137,23 @@
133137
}
134138

135139
.auth-button {
136-
background: linear-gradient(135deg, var(--primary-pink) 0%, var(--secondary-pink) 100%);
137-
color: white;
140+
background: linear-gradient(135deg, var(--primary-pink) 0%, var(--accent-pink) 100%);
141+
color: var(--button-text);
138142
border: none;
139143
padding: 0.875rem;
140144
border-radius: 8px;
141145
font-size: 1rem;
142-
font-weight: 500;
146+
font-weight: 700;
143147
cursor: pointer;
144-
transition: transform 0.2s ease, box-shadow 0.2s ease;
148+
transition: all 0.2s ease;
145149
margin-top: 0.5rem;
150+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
146151
}
147152

148153
.auth-button:hover:not(:disabled) {
149154
transform: translateY(-2px);
150-
box-shadow: 0 8px 25px rgba(248, 181, 215, 0.3);
155+
box-shadow: 0 8px 25px rgba(248, 165, 194, 0.4);
156+
background: linear-gradient(135deg, var(--accent-pink) 0%, var(--primary-pink) 100%);
151157
}
152158

153159
.auth-button:disabled {
@@ -181,8 +187,9 @@
181187
}
182188

183189
.auth-switch-text {
184-
color: #666;
190+
color: var(--text-secondary);
185191
margin-bottom: 0.5rem;
192+
font-weight: 500;
186193
}
187194

188195
.auth-switch-button {
@@ -201,8 +208,9 @@
201208

202209
.password-requirements {
203210
font-size: 0.8rem;
204-
color: #666;
211+
color: var(--text-secondary);
205212
margin-top: 0.25rem;
213+
font-weight: 500;
206214
}
207215

208216
.app-logo {

src/components/auth/UserProfile.css

Lines changed: 64 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,24 @@
1313
display: flex;
1414
align-items: center;
1515
gap: 0.5rem;
16-
background: rgba(255, 255, 255, 0.1);
17-
border: 1px solid rgba(255, 255, 255, 0.2);
16+
background: rgba(255, 255, 255, 0.9); /* 增强背景不透明度 */
17+
border: 2px solid var(--primary-pink); /* 使用主题色边框 */
1818
border-radius: 50px;
1919
padding: 0.5rem 1rem;
20-
color: white;
20+
color: var(--text-primary); /* 使用主题文字色 */
2121
cursor: pointer;
22-
transition: background-color 0.2s ease;
22+
transition: all 0.2s ease;
2323
font-size: 0.9rem;
24+
font-weight: 600; /* 增强文字重量 */
25+
box-shadow: 0 4px 12px rgba(248, 165, 194, 0.3); /* 添加主题色阴影 */
26+
backdrop-filter: blur(8px); /* 添加模糊效果 */
2427
}
2528

2629
.user-profile-button:hover {
27-
background: rgba(255, 255, 255, 0.2);
30+
background: var(--light-pink); /* 悬停时使用主题浅色 */
31+
border-color: var(--accent-pink); /* 悬停时边框颜色加深 */
32+
transform: translateY(-1px); /* 轻微上移效果 */
33+
box-shadow: 0 6px 20px rgba(248, 165, 194, 0.4); /* 增强阴影 */
2834
}
2935

3036
.user-avatar {
@@ -33,19 +39,24 @@
3339
height: 32px;
3440
border-radius: 50%;
3541
background: var(--primary-pink);
42+
border: 2px solid var(--accent-pink); /* 添加边框增强对比 */
3643
display: flex;
3744
align-items: center;
3845
justify-content: center;
3946
overflow: hidden;
40-
font-weight: bold;
41-
color: white;
47+
font-weight: 700; /* 增强文字重量 */
48+
color: var(--button-text); /* 使用按钮文字色确保可见 */
4249
cursor: pointer;
4350
transition: all 0.2s ease;
4451
flex-shrink: 0;
52+
box-shadow: 0 2px 8px rgba(248, 165, 194, 0.3); /* 添加阴影 */
53+
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); /* 添加文字阴影 */
4554
}
4655

4756
.user-avatar:hover {
48-
transform: scale(1.05);
57+
transform: scale(1.08); /* 轻微增大缩放效果 */
58+
border-color: var(--secondary-pink);
59+
box-shadow: 0 4px 15px rgba(248, 165, 194, 0.5); /* 增强悬停阴影 */
4960
}
5061

5162
.user-avatar.with-frame {
@@ -75,16 +86,19 @@
7586
}
7687

7788
.user-name {
78-
font-weight: 500;
89+
font-weight: 600; /* 增强文字重量 */
7990
max-width: 120px;
8091
overflow: hidden;
8192
text-overflow: ellipsis;
8293
white-space: nowrap;
94+
color: var(--text-primary); /* 确保使用主题文字色 */
8395
}
8496

8597
.dropdown-arrow {
8698
font-size: 0.7rem;
8799
transition: transform 0.2s ease;
100+
color: var(--text-primary); /* 确保箭头颜色可见 */
101+
font-weight: 700;
88102
}
89103

90104
.user-profile-button[aria-expanded="true"] .dropdown-arrow {
@@ -96,13 +110,14 @@
96110
top: 100%;
97111
right: 0;
98112
margin-top: 0.5rem;
99-
background: white;
113+
background: rgba(255, 255, 255, 0.98); /* 轻微透明的背景 */
100114
border-radius: 12px;
101-
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
115+
box-shadow: 0 20px 60px rgba(248, 165, 194, 0.4); /* 使用主题色阴影 */
102116
min-width: 220px;
103117
z-index: 1000;
104118
animation: dropdownSlideIn 0.2s ease-out;
105-
border: 1px solid rgba(0, 0, 0, 0.1);
119+
border: 2px solid var(--primary-pink); /* 使用主题色边框 */
120+
backdrop-filter: blur(10px); /* 添加模糊效果 */
106121
}
107122

108123
@keyframes dropdownSlideIn {
@@ -132,13 +147,14 @@
132147
}
133148

134149
.user-info .label {
135-
color: #666;
150+
color: var(--text-secondary); /* 使用主题次要文字色 */
136151
font-size: 0.9rem;
152+
font-weight: 500;
137153
}
138154

139155
.user-info .value {
140-
color: #333;
141-
font-weight: 500;
156+
color: var(--text-primary); /* 使用主题主要文字色 */
157+
font-weight: 600; /* 增强文字重量 */
142158
font-size: 0.9rem;
143159
}
144160

@@ -210,12 +226,15 @@
210226
text-align: left;
211227
cursor: pointer;
212228
font-size: 0.9rem;
213-
transition: background-color 0.2s ease;
229+
font-weight: 500;
230+
color: var(--text-primary); /* 使用主题文字色 */
231+
transition: all 0.2s ease;
214232
border-radius: 0 0 12px 12px;
215233
}
216234

217235
.dropdown-item:hover {
218-
background: #f8f9fa;
236+
background: var(--light-pink-2); /* 使用主题浅色背景 */
237+
color: var(--text-primary);
219238
}
220239

221240
.logout-button {
@@ -235,6 +254,30 @@
235254
z-index: 999;
236255
}
237256

257+
/* 针对不同页面背景的额外优化 */
258+
.puzzle-game .user-profile-button,
259+
.main-menu .user-profile-button,
260+
.settings-page .user-profile-button {
261+
background: rgba(255, 255, 255, 0.95); /* 在游戏页面增强背景不透明度 */
262+
border: 2px solid var(--primary-pink);
263+
box-shadow: 0 6px 20px rgba(248, 165, 194, 0.4); /* 增强阴影效果 */
264+
}
265+
266+
.puzzle-game .user-profile-button:hover,
267+
.main-menu .user-profile-button:hover,
268+
.settings-page .user-profile-button:hover {
269+
background: var(--light-pink);
270+
transform: translateY(-2px);
271+
box-shadow: 0 8px 25px rgba(248, 165, 194, 0.5);
272+
}
273+
274+
/* 确保在夜间模式下也清晰可见 */
275+
.night-mode .user-profile-button {
276+
background: rgba(255, 255, 255, 0.98);
277+
border-color: var(--accent-pink);
278+
box-shadow: 0 6px 20px rgba(200, 168, 233, 0.4);
279+
}
280+
238281
@media (max-width: 768px) {
239282
.user-name {
240283
display: none;
@@ -243,6 +286,10 @@
243286
.user-dropdown {
244287
right: -10px;
245288
}
289+
290+
.user-profile-button {
291+
padding: 0.4rem 0.8rem; /* 移动设备上稍微减小内边距 */
292+
}
246293
}
247294

248295
/* 个人资料按钮样式 */

0 commit comments

Comments
 (0)