From e10fca7ffe034d508215891be57fec7320d9d38c Mon Sep 17 00:00:00 2001 From: Leni Aniva Date: Sat, 14 Sep 2024 18:37:13 -0700 Subject: [PATCH] feat: Add syntax highlighting fix: Clamp main page progress to between 0,1 --- src/app.css | 1 + src/content/post/placeholder1.md | 1 + src/routes/+page.svelte | 4 +- src/routes/post/+page.svelte | 26 ++-- src/style/code.css | 209 +++++++++++++++++++++++++++++++ 5 files changed, 232 insertions(+), 9 deletions(-) create mode 100644 src/style/code.css diff --git a/src/app.css b/src/app.css index 80cfdf4..61b1606 100644 --- a/src/app.css +++ b/src/app.css @@ -1,4 +1,5 @@ @import url(./style/content.css); +@import url(./style/code.css); @import '@fortawesome/fontawesome-free/css/all.min.css'; @tailwind base; @tailwind components; diff --git a/src/content/post/placeholder1.md b/src/content/post/placeholder1.md index 32dd1fd..03dc7a9 100644 --- a/src/content/post/placeholder1.md +++ b/src/content/post/placeholder1.md @@ -1,6 +1,7 @@ --- title: Placeholder 1 date: '2024-09-01' +description: "This is a placeholder description" --- # Placeholder Post 1 diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 956590c..fa8ea03 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -5,9 +5,9 @@ let scrollHeight: number = 1; let progress: number = 0; - function onScroll(_p) { + function onScroll() { if (scrollHeight > 1) { - progress = Math.min(1, scrollPosition / scrollHeight); + progress = Math.max(0, Math.min(1, scrollPosition / scrollHeight)); } } diff --git a/src/routes/post/+page.svelte b/src/routes/post/+page.svelte index 65324b6..a2b06b8 100644 --- a/src/routes/post/+page.svelte +++ b/src/routes/post/+page.svelte @@ -9,21 +9,33 @@ {metadata.blogName} -