Added dyslexia mode support.

This commit is contained in:
Benjamin A. Shelton 2026-11-25 23:01:08 -07:00
commit 6cdb7d4c0b
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01

View file

@ -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 = () => { export const bindMenu = () => {