Added dyslexia mode support.
This commit is contained in:
parent
ba53ea0a6d
commit
6cdb7d4c0b
1 changed files with 25 additions and 0 deletions
|
|
@ -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 = () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue