const accessibility = JSON.parse(localStorage.getItem("accessibility")) || {};
function toggle_accessibility_setting(name) {
if (accessibility[name]) {
delete accessibility[name];
update_accessibility();
return true;
}
accessibility[name] = true;
function set_accessibility_setting(name, value) {
accessibility[name] = value;
function clear_accessibility_setting(name) {
if (!accessibility[name]) return false;
function update_accessibility() {
localStorage.setItem("accessibility", JSON.stringify(accessibility));
if (accessibility) {
if (accessibility.disable_crt) {
document.querySelector('div#overlay').setAttribute("hidden", true);
document.body.style.textShadow = "none";
document.getElementById('toggle-crt').classList.add("disabled");
document.getElementById("toggle-crt").addEventListener("click", () => {
toggle_accessibility_setting("disable_crt");
document.querySelector('div#overlay').toggleAttribute("hidden");
if (accessibility.disable_crt) document.getElementById('toggle-crt').classList.add("disabled");
else document.getElementById('toggle-crt').classList.remove("disabled");
});