From 6cdb7d4c0bfc81f11da43da299eb40c1dfebdf93 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Shelton" Date: Wed, 25 Nov 2026 23:01:08 -0700 Subject: [PATCH] Added dyslexia mode support. --- src/utils/config.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/utils/config.js b/src/utils/config.js index 25c448e..0ab3954 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -14,6 +14,31 @@ export const bindConfig = () => { }); }); }); + + document.querySelectorAll('dialog.config').forEach((dialog) => { + dialog.querySelectorAll('input[name=mode]').forEach((input) => { + + if (input.value === 'none' && localStorage.af_enabled === '0') { + input.checked = true; + } else if (input.value === 'dyslexia' && (localStorage.af_enabled === '1' && localStorage.af_mode === 'df')) { + input.checked = true; + } + + input.addEventListener('change', (evt) => { + if (evt.target.value === 'dyslexia') { + document.documentElement.classList.remove('dark'); + document.documentElement.classList.add('df'); + // Set accessibility features. + localStorage.af_enabled = 1; + localStorage.af_mode = 'df'; + } else if (evt.target.value === 'none') { + document.documentElement.classList.remove('df'); + document.documentElement.classList.remove('hc'); + localStorage.af_enabled = 0; + } + }); + }); + }); }; export const bindMenu = () => {