From 0b05878666808cd68be589ca1b38d3b49df42853 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Thu, 26 Nov 2026 16:09:58 -0700 Subject: [PATCH] Added high-contrast mode, close button, dyslexia tweaks. --- src/components/Menu.astro | 4 ++-- src/layouts/Layout.astro | 6 +++++ src/styles/global.css | 49 ++++++++++++++++++++++++++++++++++++--- src/utils/config.js | 13 +++++++++++ 4 files changed, 67 insertions(+), 5 deletions(-) diff --git a/src/components/Menu.astro b/src/components/Menu.astro index 9e03774..271eef7 100644 --- a/src/components/Menu.astro +++ b/src/components/Menu.astro @@ -45,9 +45,9 @@ const base = import.meta.env.BASE_URL; - - + +
diff --git a/src/layouts/Layout.astro b/src/layouts/Layout.astro index 8295d1c..f564166 100644 --- a/src/layouts/Layout.astro +++ b/src/layouts/Layout.astro @@ -107,8 +107,14 @@ class ThemeToggler { if (localStorage.af_enabled === '1') { if (localStorage.af_mode === 'df') { ele.classList.remove('dark'); + ele.classList.remove('hc'); ele.classList.add('df'); } + if (localStorage.af_mode === 'hc') { + ele.classList.remove('dark'); + ele.classList.remove('df'); + ele.classList.add('hc'); + } return; } switch (localStorage.theme) { diff --git a/src/styles/global.css b/src/styles/global.css index 3fdc258..2d084bf 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -48,6 +48,11 @@ html.df { --reading-text: #1e1e1e; } +html.hc { + --reading-bg: #fff; + --reading-text: #000; +} + html.df .study-notes :is(em, i, blockquote) { font-style: normal; } @@ -58,11 +63,17 @@ html.df .study-notes :is(em, i) { @apply underline-offset-4; } -html.df body { +html.df body, html.hc body { background-color: var(--reading-bg); } html.df article.content.study-notes { + .header { + @apply bg-transparent rounded-none bg-none border-b-4 border-b-neutral-500; + } + section time, section ul.tags { + color: var(--reading-text); + } a.scripture { text-underline-offset: 10px; } @@ -109,6 +120,33 @@ html.df article.content.study-notes { } } +html.hc article.content.study-notes { + .header { + @apply bg-transparent border-dotted rounded-none bg-none border-4 border-b-black; + } + section time, section ul.tags { + @apply text-black; + } + a, a.scripture { + @apply decoration-neutral-800; + } + + blockquote { + @apply border-l-gray-800 text-black; + } + + blockquote a { + @apply text-black; + } + + a.scripture.quote, a.scripture.christ { + @apply bg-transparent decoration-0; + } + a.scripture.christ { + @apply text-red-900; + } +} + @utility study-notes { font-family: var(--reading-font-family); background-color: var(--reading-bg); @@ -323,7 +361,7 @@ dialog.config { } legend { - @apply text-sm; + @apply text-lg; } input.button[type=radio] { @@ -357,12 +395,17 @@ dialog.config { @apply text-blue-300 bg-blue-800; } + button.close { + @apply border border-gray-800 bg-neutral-200 hover:bg-rose-800 hover:text-white rounded-sm pl-2 pr-2 pt-1 pb-1 m-2 mt-10 text-lg cursor-pointer; + @apply dark:bg-neutral-800 dark:text-neutral-200; + } + .content { @apply p-4; } h1 { - @apply font-bold text-xl mb-2 underline underline-offset-4; + @apply font-bold text-xl mb-4 underline underline-offset-4; } } diff --git a/src/utils/config.js b/src/utils/config.js index 0ab3954..ec2539c 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -27,6 +27,7 @@ export const bindConfig = () => { input.addEventListener('change', (evt) => { if (evt.target.value === 'dyslexia') { document.documentElement.classList.remove('dark'); + document.documentElement.classList.remove('hc'); document.documentElement.classList.add('df'); // Set accessibility features. localStorage.af_enabled = 1; @@ -35,9 +36,21 @@ export const bindConfig = () => { document.documentElement.classList.remove('df'); document.documentElement.classList.remove('hc'); localStorage.af_enabled = 0; + } else if (evt.target.value === 'hc') { + document.documentElement.classList.remove('df'); + document.documentElement.classList.remove('dark'); + document.documentElement.classList.add('hc'); + localStorage.af_enabled = 1; + localStorage.af_mode = 'hc'; } }); }); + dialog.querySelectorAll('button.close').forEach((btn) => { + btn.addEventListener('click', (evt) => { + evt.preventDefault(); + dialog.close(); + }); + }); }); };