From 52959f230fd4d841d61f4a5c17dba6de89efc4e8 Mon Sep 17 00:00:00 2001 From: saicaca Date: Wed, 4 Oct 2023 18:02:00 +0800 Subject: [PATCH] feat: style improvements (cherry picked from commit e308bedff591263b33155cb222108915bf980e51) --- src/components/GlobalStyles.astro | 21 ++++++++++++++++++--- src/components/Navbar.astro | 5 ++++- src/components/PostMetadata.astro | 4 ++-- src/components/TitleCardNew.astro | 27 ++++++++++++++++++++------- src/components/control/Button.astro | 7 ++----- src/content/posts/example.md | 2 +- src/pages/posts/[slug].astro | 9 +++++++-- 7 files changed, 54 insertions(+), 21 deletions(-) diff --git a/src/components/GlobalStyles.astro b/src/components/GlobalStyles.astro index 553bf90..01c44f0 100644 --- a/src/components/GlobalStyles.astro +++ b/src/components/GlobalStyles.astro @@ -53,12 +53,14 @@ rainbow-dark = linear-gradient(to right, oklch(0.70 0.10 0), oklch(0.70 0.10 30) --banner-height 50vh color_set({ - --primary: oklch(0.70 0.14 var(--hue)) - --card-bg: white oklch(0.25 0.02 var(--hue)) + --primary: oklch(0.70 0.14 var(--hue)) oklch(0.75 0.14 var(--hue)) + --card-bg: white oklch(0.23 0.015 var(--hue)) --btn-content: oklch(0.55 0.12 var(--hue)) oklch(0.75 0.1 var(--hue)) - --btn-regular-bg: oklch(0.95 0.025 var(--hue)) oklch(0.38 0.04 var(--hue)) + --btn-regular-bg: oklch(0.95 0.025 var(--hue)) oklch(0.33 0.035 var(--hue)) + --btn-regular-bg-hover: oklch(0.9 0.05 var(--hue)) oklch(0.38 0.04 var(--hue)) + --btn-regular-bg-active: oklch(0.85 0.08 var(--hue)) oklch(0.43 0.045 var(--hue)) --btn-plain-bg-hover: oklch(0.95 0.025 var(--hue)) oklch(0.2 0.02 var(--hue)) --btn-plain-bg-active: oklch(0.98 0.01 var(--hue)) oklch(0.17 0.017 var(--hue)) @@ -66,6 +68,10 @@ color_set({ --btn-card-bg-hover: oklch(0.96 0.015 var(--hue)) oklch(0.3 0.03 var(--hue)) --btn-card-bg-active: oklch(0.9 0.03 var(--hue)) oklch(0.35 0.035 var(--hue)) + --enter-btn-bg: var(--btn-regular-bg) + --enter-btn-bg-hover: var(--btn-regular-bg-hover) + --enter-btn-bg-active: var(--btn-regular-bg-active) + --deep-text: oklch(0.25 0.02 var(--hue)) --line-divider: black(0.08) white(0.08) @@ -74,7 +80,13 @@ color_set({ --meta-divider: black(0.2) white(0.2) --selection-bg: oklch(0.90 0.05 var(--hue)) oklch(0.40 0.08 var(--hue)) + --link-hover: oklch(0.95 0.025 var(--hue)) oklch(0.40 0.08 var(--hue)) + --link-active: oklch(0.90 0.05 var(--hue)) oklch(0.35 0.07 var(--hue)) + --color-selection-bar: rainbow-light rainbow-dark + + --display-light-icon: 1 0 + --display-dark-icon: 0 1 }) @@ -98,5 +110,8 @@ color_set({ .card-shadow { @apply drop-shadow-[0_2px_4px_rgba(0,0,0,0.005)] } + .link { + @apply transition hover:bg-[var(--link-hover)] active:bg-[var(--link-active)] rounded-md p-[6px] -m-[6px]; + } } \ No newline at end of file diff --git a/src/components/Navbar.astro b/src/components/Navbar.astro index 4e08902..25787a9 100644 --- a/src/components/Navbar.astro +++ b/src/components/Navbar.astro @@ -23,7 +23,10 @@ const className = Astro.props.class;
- +
diff --git a/src/components/PostMetadata.astro b/src/components/PostMetadata.astro index 7367bed..522bc51 100644 --- a/src/components/PostMetadata.astro +++ b/src/components/PostMetadata.astro @@ -33,7 +33,7 @@ const className = Astro.props.class; class="with-divider" > {category} @@ -53,7 +53,7 @@ const className = Astro.props.class; class="with-divider" > {tag} diff --git a/src/components/TitleCardNew.astro b/src/components/TitleCardNew.astro index 3e79c2d..1e58c04 100644 --- a/src/components/TitleCardNew.astro +++ b/src/components/TitleCardNew.astro @@ -18,6 +18,7 @@ const className = Astro.props.class; import ImageBox from "./misc/ImageBox.astro"; import ButtonTag from "./control/ButtonTag.astro"; import { Icon } from 'astro-icon/components'; +import Button from "./control/Button.astro"; // tags = ['Foo', 'Bar', 'Baz', 'Qux', 'Quux']; @@ -30,14 +31,14 @@ const coverWidth = "30%"; const { remarkPluginFrontmatter } = await entry.render(); --- -
-
+
+
{title} @@ -59,18 +60,30 @@ const { remarkPluginFrontmatter } = await entry.render(); {hasCover &&
+ class="transition opacity-0 group-hover:opacity-100 text-white text-5xl"> +
} + + {!hasCover && + + } +