From d3dea874a9458852d7f369225e2b56efd804795d Mon Sep 17 00:00:00 2001 From: Shubidumdu Date: Wed, 31 Jul 2024 19:25:23 +0900 Subject: [PATCH 1/2] [WIP] Apply dark mode on post & postcard --- src/app/components/Comment.tsx | 4 +++- src/app/components/Post.tsx | 4 ++-- src/app/components/PostCard.tsx | 15 +++++++++++---- src/app/components/TopBar.tsx | 6 +++--- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/app/components/Comment.tsx b/src/app/components/Comment.tsx index aaba1cc..1a48b8b 100644 --- a/src/app/components/Comment.tsx +++ b/src/app/components/Comment.tsx @@ -6,7 +6,9 @@ const UTTERANCES_SCRIPT_OPTIONS = { repo: 'Shubidumdu/shubidumdu.github.io', 'issue-term': 'pathname', label: 'comment', - theme: 'github-light', + theme: window.matchMedia('(prefers-color-scheme: dark)').matches + ? 'dark-blue' + : 'github-light', crossorigin: 'anonymous', } as const; diff --git a/src/app/components/Post.tsx b/src/app/components/Post.tsx index 8eb6d24..c40e178 100644 --- a/src/app/components/Post.tsx +++ b/src/app/components/Post.tsx @@ -54,7 +54,7 @@ const Post = ({ post, base }: PostProps) => { if (!parsedMarkDown) return null; return ( -
+

{post.attributes.createdAt}

@@ -62,7 +62,7 @@ const Post = ({ post, base }: PostProps) => {
{ return ( -
  • +
  • -

    {title}

    -

    {desc}

    +

    + {title} +

    +

    + {desc} +

    {tags ? : null} -
    diff --git a/src/app/components/TopBar.tsx b/src/app/components/TopBar.tsx index a06809f..623da1b 100644 --- a/src/app/components/TopBar.tsx +++ b/src/app/components/TopBar.tsx @@ -22,9 +22,9 @@ const TopBar = () => { const pathname = usePathname(); return ( -
    +
    -

    +

    Shubidumdu

    @@ -32,7 +32,7 @@ const TopBar = () => { {PATHS.map(({ path, label }, index) => (

    From 134323d613cab684c070f267e1872994ed0bed99 Mon Sep 17 00:00:00 2001 From: shubidumdu Date: Thu, 1 Aug 2024 21:57:21 +0900 Subject: [PATCH 2/2] Adjust dark theme --- src/app/components/Post.tsx | 4 ++-- src/app/components/ProjectCard.tsx | 10 +++++++--- src/app/globals.css | 4 ++++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/app/components/Post.tsx b/src/app/components/Post.tsx index c40e178..f894a8e 100644 --- a/src/app/components/Post.tsx +++ b/src/app/components/Post.tsx @@ -54,7 +54,7 @@ const Post = ({ post, base }: PostProps) => { if (!parsedMarkDown) return null; return ( -
    +

    {post.attributes.createdAt}

    @@ -62,7 +62,7 @@ const Post = ({ post, base }: PostProps) => {
    { return ( -
  • +
  • -

    {title}

    -

    {desc}

    +

    + {title} +

    +

    + {desc} +

    {tags ? : null}