From 577b48285be585169b00207bd977e21d27a6f984 Mon Sep 17 00:00:00 2001 From: xiamuceer Date: Mon, 16 Mar 2026 16:50:15 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E4=B9=A6=E6=9C=AC?= =?UTF-8?q?=E5=B0=81=E9=9D=A2=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/BookshelfPage.tsx | 651 ++++++++++++++++++--------- 1 file changed, 450 insertions(+), 201 deletions(-) diff --git a/frontend/src/pages/BookshelfPage.tsx b/frontend/src/pages/BookshelfPage.tsx index 0bdc9dd..5ef4925 100644 --- a/frontend/src/pages/BookshelfPage.tsx +++ b/frontend/src/pages/BookshelfPage.tsx @@ -60,8 +60,8 @@ export default function BookshelfPage({ const alphaColor = (color: string, alpha: number) => `color-mix(in srgb, ${color} ${(alpha * 100).toFixed(0)}%, transparent)`; const [flippedProjectIds, setFlippedProjectIds] = useState>({}); const [coverGeneratingIds, setCoverGeneratingIds] = useState>({}); - const mobileBookHeight = 460; - const desktopBookHeight = 430; + const mobileBookHeight = 520; + const desktopBookHeight = 520; const mobileSpineWidth = 32; const serialBookPalettes = [ @@ -365,13 +365,14 @@ export default function BookshelfPage({ const coverReady = project.cover_status === 'ready' && !!project.cover_image_url; const coverGenerating = project.cover_status === 'generating' || coverActionLoading; const coverFailed = project.cover_status === 'failed' && !coverActionLoading; + const showCoverFace = coverReady && !isFlipped; return ( -
+
!isFlipped && onEnterProject(project)} data-card-style="bookshelf-book" @@ -414,110 +415,89 @@ export default function BookshelfPage({ zIndex: 2, display: 'flex', flexDirection: 'column', - minHeight: isMobile ? mobileBookHeight : desktopBookHeight, - padding: isMobile ? '18px 16px 14px 38px' : '26px 24px 18px 42px', + flex: 1, + height: '100%', + padding: isMobile ? '16px 16px 14px 38px' : '20px 20px 18px 42px', + overflow: 'hidden', + width: '100%', + boxSizing: 'border-box', }}> -
+ {showCoverFace && ( + <> +
+
+ + )} + +
- {isFlipped ? ( -
- {coverReady ? ( - <> -
- {`${project.title} -
- - - - - - ) : coverGenerating ? ( -
- -
封面生成中,请稍候...
-
- ) : ( -
- - {coverFailed ? ( - <> -
封面生成失败
-
{project.cover_error || '请稍后重试'}
- - - ) : ( - - )} -
- )} -
- ) : ( - <> -
-
- -
- {project.title} -
-
+ {showCoverFace ? ( +
+
+
+ {project.title} +
@@ -525,13 +505,14 @@ export default function BookshelfPage({ {tag} @@ -539,13 +520,14 @@ export default function BookshelfPage({ 未分类 @@ -553,130 +535,397 @@ export default function BookshelfPage({
- - {project.description || '暂无描述...'} - +
+ +
+
+
+ 完成进度 + {progress}% +
+
+
+
+
+
+
+ {formatWordCount(project.current_words || 0)} +
+
+ 已写字数 +
+
+
+
+
= 100 ? '#7CFFB2' : token.colorWhite, + lineHeight: 1.1, + fontFamily: 'Georgia, "Times New Roman", serif', + }}> + {formatWordCount(project.target_words || 0)} +
+
+ 目标字数 +
+
+
+
-
- 完成进度 - {progress}% -
-
-
+ + + {formatDate(project.updated_at)} + + + + + +
- -
-
-
+
+ ) : ( +
+ {isFlipped && coverGenerating ? ( +
+ +
封面生成中,请稍候...
+
+ ) : isFlipped && coverFailed ? ( +
+ +
封面生成失败
+
{project.cover_error || '请稍后重试'}
+ +
+ ) : isFlipped && !coverReady ? ( +
+ +
当前暂无可用封面
+ +
+ ) : ( + <> +
- {formatWordCount(project.current_words || 0)} + +
+ {project.title} +
+
- 已写字数 + {tags.length > 0 ? tags.slice(0, 3).map((tag: string, idx: number) => ( + + {tag} + + )) : ( + + 未分类 + + )}
-
-
+ + + {project.description || '暂无描述...'} + + +
= 100 ? token.colorSuccess : progressColor, - lineHeight: 1.1, - fontFamily: 'Georgia, "Times New Roman", serif', + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + marginBottom: 6, + fontSize: isMobile ? 11 : 12, }}> - {formatWordCount(project.target_words || 0)} + 完成进度 + {progress}%
- 目标字数 +
-
-
-
- - - {formatDate(project.updated_at)} - +
+
+
+
+ {formatWordCount(project.current_words || 0)} +
+
+ 已写字数 +
+
+
+
+
= 100 ? token.colorSuccess : progressColor, + lineHeight: 1.1, + fontFamily: 'Georgia, "Times New Roman", serif', + }}> + {formatWordCount(project.target_words || 0)} +
+
+ 目标字数 +
+
+
+
-
- +
+ + + {formatDate(project.updated_at)} + + +
+ {!coverReady && ( + + )} +
+ +
+
+
+ + )} +
)}