From 025953bca3979196b13161e076a1375be3f10231 Mon Sep 17 00:00:00 2001 From: "saica.go" Date: Mon, 22 Jan 2024 02:06:24 +0800 Subject: [PATCH] feat: much better mobile view design (#11) --- src/components/ArchivePanel.astro | 16 ++++---- src/components/GlobalStyles.astro | 5 ++- src/components/Navbar.astro | 14 +++---- src/components/PostMetadata.astro | 7 ++-- src/components/TitleCardNew.astro | 10 ++--- src/components/control/Button.astro | 2 +- src/components/control/ButtonLink.astro | 2 +- src/components/control/ButtonTag.astro | 2 +- src/components/control/Pagination.astro | 4 +- src/components/widget/DisplaySetting.astro | 44 ++++++---------------- src/components/widget/NavMenuPanel.astro | 15 -------- src/layouts/Layout.astro | 2 +- src/layouts/MainGridLayout.astro | 2 +- src/pages/page/[page].astro | 5 +-- src/pages/posts/[...slug].astro | 2 +- 15 files changed, 50 insertions(+), 82 deletions(-) diff --git a/src/components/ArchivePanel.astro b/src/components/ArchivePanel.astro index 4a1a783..5b040d1 100644 --- a/src/components/ArchivePanel.astro +++ b/src/components/ArchivePanel.astro @@ -1,5 +1,4 @@ --- -import {UNCATEGORIZED} from "@constants/constants"; interface Props { keyword: string; tags: string[]; @@ -12,6 +11,7 @@ import {getSortedPosts} from "../utils/content-utils"; import {getPostUrlBySlug} from "../utils/url-utils"; import {i18n} from "../i18n/translation"; import I18nKey from "../i18n/i18nKey"; +import {UNCATEGORIZED} from "@constants/constants"; let posts = await getSortedPosts() @@ -66,20 +66,20 @@ function formatTag(tag: string[]) { groups.map(group => (
- +
-
- +
diff --git a/src/components/PostMetadata.astro b/src/components/PostMetadata.astro index 7b5919d..7303516 100644 --- a/src/components/PostMetadata.astro +++ b/src/components/PostMetadata.astro @@ -9,8 +9,9 @@ interface Props { published: Date; tags: string[]; category: string; + hideTagsForMobile: boolean; } -const {published, tags, category} = Astro.props; +const {published, tags, category, hideTagsForMobile} = Astro.props; const className = Astro.props.class; --- @@ -24,7 +25,7 @@ const className = Astro.props.class; {formatDateToYYYYMMDD(published)}
- +
@@ -40,7 +41,7 @@ const className = Astro.props.class;
-
+
diff --git a/src/components/TitleCardNew.astro b/src/components/TitleCardNew.astro index 4f2b3d7..95b3aa6 100644 --- a/src/components/TitleCardNew.astro +++ b/src/components/TitleCardNew.astro @@ -33,20 +33,20 @@ const { remarkPluginFrontmatter } = await entry.render(); ---
-
+
- {title} + {title} - +
{ description } @@ -85,8 +85,8 @@ const { remarkPluginFrontmatter } = await entry.render(); } -
+
- - \ No newline at end of file diff --git a/src/components/widget/NavMenuPanel.astro b/src/components/widget/NavMenuPanel.astro index 590d24e..7506a4e 100644 --- a/src/components/widget/NavMenuPanel.astro +++ b/src/components/widget/NavMenuPanel.astro @@ -33,18 +33,3 @@ const enableBanner = siteConfig.banner.enable; ))}
- - \ No newline at end of file diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 91b7e09..dc1d6c3 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -64,7 +64,7 @@ if (title) { --- - + diff --git a/src/layouts/MainGridLayout.astro b/src/layouts/MainGridLayout.astro index 87aef91..2d4b68b 100644 --- a/src/layouts/MainGridLayout.astro +++ b/src/layouts/MainGridLayout.astro @@ -23,7 +23,7 @@ const enableBanner = siteConfig.banner.enable;
-
+
{page.data.map((entry: { data: { draft: boolean; title: string; tags: string[]; category: string; published: Date; image: string; description: string; }; slug: string; }) => { return ( - ); })}
- + \ No newline at end of file diff --git a/src/pages/posts/[...slug].astro b/src/pages/posts/[...slug].astro index fd1b2c2..3d4eed1 100644 --- a/src/pages/posts/[...slug].astro +++ b/src/pages/posts/[...slug].astro @@ -30,7 +30,7 @@ const { remarkPluginFrontmatter } = await entry.render(); ---
-