diff --git a/web/src/components/QuestionProgress.tsx b/web/src/components/QuestionProgress.tsx index 2ea9232..86699c0 100644 --- a/web/src/components/QuestionProgress.tsx +++ b/web/src/components/QuestionProgress.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { Progress, Card } from 'antd' +import { Progress } from 'antd' interface QuestionProgressProps { currentIndex: number @@ -17,34 +17,21 @@ const QuestionProgress: React.FC = ({ const percent = Math.round(((currentIndex + 1) / totalQuestions) * 100) return ( - - `${currentIndex + 1} / ${totalQuestions}`} - style={{ - fontSize: '14px', - fontWeight: 600, - }} - /> - + trailColor="rgba(0, 0, 0, 0.06)" + strokeWidth={12} + format={() => `${currentIndex + 1} / ${totalQuestions}`} + style={{ + fontSize: '14px', + fontWeight: 600, + }} + /> ) } diff --git a/web/src/pages/Login.tsx b/web/src/pages/Login.tsx index e965a66..d6b58e4 100644 --- a/web/src/pages/Login.tsx +++ b/web/src/pages/Login.tsx @@ -194,11 +194,14 @@ const Login: React.FC = () => { } - placeholder="请输入昵称(可选)" + placeholder="请输入姓名" /> diff --git a/web/src/pages/Question.module.less b/web/src/pages/Question.module.less index 2a51c58..6fb50e8 100644 --- a/web/src/pages/Question.module.less +++ b/web/src/pages/Question.module.less @@ -1,20 +1,31 @@ .container { min-height: 100vh; background: #fafafa; - padding: 20px; + padding: 0; padding-bottom: 80px; } -.content { - max-width: 900px; - margin: 0 auto; +// 固定顶栏 +.fixedTopBar { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 1000; + background: rgba(250, 250, 250, 0.85); + backdrop-filter: blur(40px) saturate(180%); + -webkit-backdrop-filter: blur(40px) saturate(180%); + box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); + border-bottom: 0.5px solid rgba(0, 0, 0, 0.04); } -.header { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 20px; +.topBarContent { + max-width: 900px; + margin: 0 auto; + padding: 16px 20px; +} + +.topBarCard { background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); @@ -25,6 +36,20 @@ 0 1px 4px rgba(0, 0, 0, 0.03), 0 0 0 1px rgba(0, 0, 0, 0.03); border: 0.5px solid rgba(0, 0, 0, 0.04); +} + +.content { + max-width: 900px; + margin: 0 auto; + padding: 0 20px; + padding-top: 200px; // 为固定顶栏留出空间 +} + +.header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; .backButton { color: #007aff; @@ -74,6 +99,10 @@ } } +.progressWrapper { + // 进度条容器 +} + .questionCard { border-radius: 20px; background: rgba(255, 255, 255, 0.95); @@ -121,19 +150,33 @@ // 响应式设计 - 移动端 @media (max-width: 768px) { .container { - padding: 12px; padding-bottom: 70px; } + .topBarContent { + padding: 12px; + } + + .topBarCard { + padding: 12px 16px; + border-radius: 12px; + } + + .content { + padding: 0 12px; + padding-top: 240px; // 移动端顶栏更高 + } + .header { flex-wrap: wrap; - gap: 12px; - padding: 12px 16px; - border-radius: 12px; + gap: 10px; + margin-bottom: 12px; .backButton { order: 1; flex: 0 0 auto; + font-size: 14px; + padding: 4px 8px; } .title { @@ -141,18 +184,21 @@ flex: 1 1 100%; text-align: center; font-size: 16px !important; + margin-top: 4px !important; } .statsGroup { order: 3; flex: 1 1 100%; justify-content: center; - gap: 24px; + gap: 32px; + margin-top: 4px; } .statItem { flex-direction: row; gap: 6px; + align-items: center; } .statLabel { @@ -183,8 +229,13 @@ // 响应式设计 - 平板 @media (min-width: 769px) and (max-width: 1024px) { - .container { - padding: 24px; + .topBarContent { + padding: 14px 24px; + } + + .content { + padding: 0 24px; + padding-top: 190px; } .header { @@ -196,14 +247,16 @@ // 响应式设计 - PC端 @media (min-width: 1025px) { - .container { - padding: 32px; + .topBarContent { + padding: 18px 32px; + } + + .content { + padding: 0 32px; + padding-top: 190px; } .header { - margin-bottom: 24px; - padding: 18px 24px; - .title { font-size: 22px !important; } diff --git a/web/src/pages/Question.tsx b/web/src/pages/Question.tsx index ff99473..003c05f 100644 --- a/web/src/pages/Question.tsx +++ b/web/src/pages/Question.tsx @@ -250,40 +250,50 @@ const QuestionPage: React.FC = () => { return (
-
- {/* 头部 */} -
- - - AnKao 刷题 - -
-
- 正确 - {correctCount} + {/* 固定顶栏:包含导航和进度 */} +
+
+
+ {/* 头部导航 */} +
+ + + AnKao 刷题 + +
+
+ 正确 + {correctCount} +
+
+ 错误 + {wrongCount} +
+
-
- 错误 - {wrongCount} + + {/* 进度条 */} +
+
+
- {/* 进度条 */} - - + {/* 主内容区 */} +
{/* 题目卡片 */} {currentQuestion && (