From 7160dd4a4026cbd3f30498418549604ca8c9ad60 Mon Sep 17 00:00:00 2001 From: J-onasJones Date: Sat, 15 Jun 2024 15:34:15 +0200 Subject: [PATCH] Blog Header UI changes --- index.html | 1 + src/global.css | 5 ++++ src/routes/Post.svelte | 67 ++++++++++++++++++++++++++++++++++++------ 3 files changed, 64 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 5bd934d..88a8a20 100644 --- a/index.html +++ b/index.html @@ -4,6 +4,7 @@ + Jonas_Jones Blog diff --git a/src/global.css b/src/global.css index de09bdf..aa55674 100644 --- a/src/global.css +++ b/src/global.css @@ -24,6 +24,11 @@ html, body { padding: 0; background-color: #303030; color: #e2b714; + font-family: 'JetBrains Mono'; +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Pixelify Sans'; } .content { diff --git a/src/routes/Post.svelte b/src/routes/Post.svelte index 1fdba6c..5eba89f 100644 --- a/src/routes/Post.svelte +++ b/src/routes/Post.svelte @@ -11,12 +11,15 @@ let post: {id: String, date: String, title: String, author: String, description: String} = {}; let postTitle = ""; - let postDescription = ""; + let postAuthor = ""; + let postDate = ""; let loading = true; let error404 = false; let thisHref = location.href; + let clickText = "Copy Link"; + if (params.year && params.month && params.day && params.title) { const searchdate = new Date(`${params.year}-${params.month}-${params.day}`); } else { @@ -53,7 +56,8 @@ document.getElementById('markdowncontent').innerHTML = await markdowncontent; loading = false; postTitle = post.title; - postDescription = post.description; + postAuthor = post.author; + postDate = post.date; } else { loading = false error404 = true @@ -101,6 +105,17 @@ }); } +function copyLink() { + navigator.clipboard.writeText(location.href).then(() => { + clickText = "Copied!"; + setTimeout(() => { + clickText = "Copy Link"; + }, 2000); + }).catch(err => { + console.error('Failed to copy: ', err); + }); + } + {#if loading} @@ -111,18 +126,52 @@ {/if}
-

{postTitle}

-

{postDescription}

-
+

by

+

{postAuthor}

+

{postDate}

+ +

{postTitle}

+