From 3c7d81fd36d5b2f32644dbb12965f18e9556a21c Mon Sep 17 00:00:00 2001 From: eggy Date: Tue, 9 Aug 2022 16:25:23 -0400 Subject: [PATCH] feat: add dark mode stats --- components/BlogStatBox.vue | 11 +++-------- components/CommitStatBox.vue | 1 + components/HomeStatBox.vue | 10 ++++++++++ components/StoryStatBox.vue | 15 ++++++++------- components/Tag.vue | 2 +- data/projects.ts | 10 +++++++++- 6 files changed, 32 insertions(+), 17 deletions(-) diff --git a/components/BlogStatBox.vue b/components/BlogStatBox.vue index 27c6cde..688428c 100644 --- a/components/BlogStatBox.vue +++ b/components/BlogStatBox.vue @@ -23,10 +23,11 @@ const prettyDate = latestDate.format("DD MMM YYYY");

{{ latest.title }}

-

+

{{ prettyDate }} · {{ latest.readingTime.text }}

@@ -51,15 +52,9 @@ const prettyDate = latestDate.format("DD MMM YYYY"); --> -

+

{{ latest.description }} …

- - diff --git a/components/CommitStatBox.vue b/components/CommitStatBox.vue index 6746b43..b89f0ef 100644 --- a/components/CommitStatBox.vue +++ b/components/CommitStatBox.vue @@ -24,6 +24,7 @@ const [title, description] = latestCommit.message.split("\n\n"); diff --git a/components/HomeStatBox.vue b/components/HomeStatBox.vue index 8c535e1..34263de 100644 --- a/components/HomeStatBox.vue +++ b/components/HomeStatBox.vue @@ -8,12 +8,14 @@ import { unref as _unref } from "vue"; const { href, color = "pink", + darkcolor = "#c88994", title, clearstyles = false, forceheight, } = defineProps<{ href?: string; color?: Color; + darkcolor?: Color; title?: string; clearstyles?: boolean; forceheight?: ViewportLength<"rem">; @@ -46,6 +48,10 @@ const height = forceheight ?? "auto"; border-radius: 0.5rem; } +html.dark .container { + border: 0.5rem solid v-bind(darkcolor); +} + .main-content { padding: v-bind(padding); padding-top: 0; @@ -56,6 +62,10 @@ const height = forceheight ?? "auto"; background: v-bind(color); } +html.dark .title { + background: v-bind(darkcolor); +} + @media screen and (max-width: 600px) { .container { width: 90vw; diff --git a/components/StoryStatBox.vue b/components/StoryStatBox.vue index 2c92fd3..e7bc6c2 100644 --- a/components/StoryStatBox.vue +++ b/components/StoryStatBox.vue @@ -20,9 +20,14 @@ const prettyDate = latestDate.format("DD MMM YYYY"); --> -

+

{{ latest.description }} …

@@ -55,10 +60,6 @@ const prettyDate = latestDate.format("DD MMM YYYY");