From e25671eed27e4d50fae8417953dd6e11246ff336 Mon Sep 17 00:00:00 2001 From: shinya Date: Sun, 22 Jun 2025 23:48:02 +0800 Subject: [PATCH] feat: mobile style --- src/app/detail/page.tsx | 2 +- src/app/douban/page.tsx | 6 +- src/app/globals.css | 14 ++++ src/app/page.tsx | 29 ++++++-- src/app/search/page.tsx | 4 +- src/components/CapsuleSwitch.tsx | 2 +- src/components/CollectionCard.tsx | 2 +- src/components/ContinueWatching.tsx | 10 ++- src/components/DoubanCardSkeleton.tsx | 2 +- src/components/MobileBottomNav.tsx | 99 +++++++++++++++++++++++++++ src/components/MobileHeader.tsx | 18 +++++ src/components/PageLayout.tsx | 37 +++++++--- src/components/Sidebar.tsx | 3 +- 13 files changed, 200 insertions(+), 28 deletions(-) create mode 100644 src/components/MobileBottomNav.tsx create mode 100644 src/components/MobileHeader.tsx diff --git a/src/app/detail/page.tsx b/src/app/detail/page.tsx index 0288e46..4682ad3 100644 --- a/src/app/detail/page.tsx +++ b/src/app/detail/page.tsx @@ -111,7 +111,7 @@ function DetailPageClient() { return ( -
+
{/* 顶部返回按钮已移入右侧信息容器 */} {loading ? (
diff --git a/src/app/douban/page.tsx b/src/app/douban/page.tsx index 7b71806..731ad4d 100644 --- a/src/app/douban/page.tsx +++ b/src/app/douban/page.tsx @@ -179,7 +179,7 @@ function DoubanPageClient() { return ( -
+
{/* 页面标题 */}

@@ -200,7 +200,7 @@ function DoubanPageClient() { ) : ( <> {/* 内容网格 */} -
+
{loading ? // 显示骨架屏 skeletonData.map((index) => ( @@ -208,7 +208,7 @@ function DoubanPageClient() { )) : // 显示实际数据 doubanData.map((item, index) => ( -
+
))} diff --git a/src/app/globals.css b/src/app/globals.css index 60d9647..2ec4018 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -73,3 +73,17 @@ body { rgba(0, 0, 0, 0.8) 100% ); } + +/* 隐藏移动端(<768px)垂直滚动条 */ +@media (max-width: 767px) { + html, + body { + -ms-overflow-style: none; /* IE & Edge */ + scrollbar-width: none; /* Firefox */ + } + + html::-webkit-scrollbar, + body::-webkit-scrollbar { + display: none; /* Chrome Safari */ + } +} diff --git a/src/app/page.tsx b/src/app/page.tsx index dff76cd..957e200 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -130,7 +130,7 @@ function HomeClient() { return ( -
+
{/* 顶部 Tab 切换 */}
我的收藏

-
+
{favoriteItems.map((item) => (
@@ -173,7 +173,10 @@ function HomeClient() { {collections.map((collection) => ( -
+
( -
+
@@ -205,7 +211,10 @@ function HomeClient() { )) : // 显示真实数据 hotMovies.map((movie, index) => ( -
+
))} @@ -221,7 +230,10 @@ function HomeClient() { {loading ? // 加载状态显示灰色占位数据 Array.from({ length: 8 }).map((_, index) => ( -
+
@@ -230,7 +242,10 @@ function HomeClient() { )) : // 显示真实数据 hotTvShows.map((show, index) => ( -
+
))} diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index db96280..e07e6e3 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -99,7 +99,7 @@ function SearchPageClient() { return ( -
+
{/* 搜索框 */}
@@ -125,7 +125,7 @@ function SearchPageClient() {
) : showResults ? ( // 搜索结果 -
+
{searchResults.map((item) => (
diff --git a/src/components/CapsuleSwitch.tsx b/src/components/CapsuleSwitch.tsx index 29ff384..9cd0d2e 100644 --- a/src/components/CapsuleSwitch.tsx +++ b/src/components/CapsuleSwitch.tsx @@ -23,7 +23,7 @@ const CapsuleSwitch: React.FC = ({