From 8ed0aa071f1f95f99511311b8bc287c03abb049c Mon Sep 17 00:00:00 2001 From: saicaca Date: Fri, 29 Sep 2023 11:58:14 +0800 Subject: [PATCH] feat: back-to-top, footer, about page, responsive design, etc. (cherry picked from commit 21319d339305c77311d42aa18501d425a5a2619c) --- src/components/ArchivePanel.astro | 8 ++-- src/components/Footer.astro | 11 +++++ src/components/GlobalStyles.astro | 5 +++ src/components/Navbar.astro | 2 +- src/components/TitleCardNew.astro | 11 +++-- src/components/control/BackToTop.astro | 59 ++++++++++++++++++++++++++ src/components/control/Button.astro | 4 +- src/components/widget/Profile.astro | 2 +- src/content/spec/about.md | 0 src/layouts/Layout.astro | 2 +- src/layouts/MainGridLayout.astro | 15 +++++-- src/pages/about.astro | 20 +++++++++ src/pages/posts/[slug].astro | 6 +-- vivia.config.yml | 2 +- 14 files changed, 127 insertions(+), 20 deletions(-) create mode 100644 src/components/Footer.astro create mode 100644 src/components/control/BackToTop.astro create mode 100644 src/content/spec/about.md create mode 100644 src/pages/about.astro diff --git a/src/components/ArchivePanel.astro b/src/components/ArchivePanel.astro index a8f833e..5f51643 100644 --- a/src/components/ArchivePanel.astro +++ b/src/components/ArchivePanel.astro @@ -85,11 +85,11 @@ function formatDate(date: Date) { > -
-
+
{post.data.title} -
+
+ © 2023 Author. All Rights Reserved. +
+ Powered by Vivia +
+
\ No newline at end of file diff --git a/src/components/GlobalStyles.astro b/src/components/GlobalStyles.astro index 66060ba..cc196ff 100644 --- a/src/components/GlobalStyles.astro +++ b/src/components/GlobalStyles.astro @@ -65,6 +65,8 @@ color_set({ --deep-text: oklch(0.25 0.02 var(--hue)) + --line-divider: black(0.08) white(0.08) + --line-color: black(0.1) white(0.1) --meta-divider: black(0.2) white(0.2) --selection-bg: oklch(0.90 0.05 var(--hue)) oklch(0.40 0.08 var(--hue)) @@ -88,5 +90,8 @@ color_set({ h1, h2, h3, h4, h5, h6, p, a, span, li, ul, ol, blockquote, code, pre, table, th, td, strong { @apply transition; } + .card-shadow { + @apply drop-shadow-[0_2px_4px_rgba(0,0,0,0.005)] + } } \ No newline at end of file diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 5171f1a..924ebab 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -15,7 +15,7 @@ const className = Astro.props.class;
- +
diff --git a/src/components/TitleCardNew.astro b/src/components/TitleCardNew.astro index fb7875b..83dfb7e 100644 --- a/src/components/TitleCardNew.astro +++ b/src/components/TitleCardNew.astro @@ -30,14 +30,14 @@ const coverWidth = "30%"; const { remarkPluginFrontmatter } = await entry.render(); --- -
-
+
+
{title} @@ -58,7 +58,10 @@ const { remarkPluginFrontmatter } = await entry.render();
{hasCover && + class:list={["group", + "max-h-[20vh] lg:max-h-none mx-4 mt-4 lg:mx-0 lg:mt-0", + "lg:w-[var(--coverWidth)] relative lg:absolute lg:top-3 lg:bottom-3 lg:right-3 rounded-xl overflow-hidden" + ]} >
+
+
+ +
+
+ + + + + + diff --git a/src/components/control/Button.astro b/src/components/control/Button.astro index 7d16500..dd9d84c 100644 --- a/src/components/control/Button.astro +++ b/src/components/control/Button.astro @@ -45,10 +45,10 @@ import { Icon } from 'astro-icon/components'; 'bg-none': light, 'hover:bg-[var(--btn-plain-bg-hover)]': light, 'active:bg-[var(--btn-plain-bg-active)]': light, - 'text-neutral-900': light, + 'text-black/75': light, 'hover:text-[var(--primary)]': light, - 'dark:text-neutral-300': light || regular, + 'dark:text-white/75': light || regular, 'dark:hover:text-[var(--primary)]': light, 'bg-[var(--btn-regular-bg)]': regular, diff --git a/src/components/widget/Profile.astro b/src/components/widget/Profile.astro index fcfa63e..b60df36 100644 --- a/src/components/widget/Profile.astro +++ b/src/components/widget/Profile.astro @@ -11,7 +11,7 @@ const vConf = getConfig(); ---
- +
{vConf.profile.author}
{vConf.profile.subtitle}
diff --git a/src/content/spec/about.md b/src/content/spec/about.md new file mode 100644 index 0000000..e69de29 diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index c40b2dc..73b3c41 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -75,7 +75,7 @@ if (!banner || typeof banner !== 'string' || banner.trim() === '') { {title} - +
-
- + -
+
+
+
+
+
+
+ +