High Contrast Button

This commit is contained in:
ssyyhhrr
2023-01-23 21:13:13 +00:00
parent 63cddf5165
commit 024cf4270b
4 changed files with 89 additions and 14 deletions

View File

@@ -404,10 +404,21 @@ document.getElementsByClassName("closeShare")[0].onmousedown = () => {
close(document.getElementsByClassName("shareScreen")[0])
}
document.getElementsByClassName("info")[0].onmousedown = () => {
document.getElementById("tutorial").onmousedown = () => {
open(document.getElementsByClassName("tutorial")[0])
}
document.getElementById("highContrast-btn").onmousedown = () => {
if (localStorage.getItem("highContrast") === null) {
localStorage.setItem("highContrast", "true")
document.getElementById("highContrast").disabled = false
} else {
localStorage.removeItem("highContrast")
document.getElementById("highContrast").disabled = true
}
}
document.getElementsByClassName("btn")[0].onmousedown = () => {
pulse()
copy()
@@ -467,6 +478,9 @@ function copy() {
}
document.addEventListener('DOMContentLoaded', () => {
if (localStorage.getItem("highContrast") === null) {
document.getElementById("highContrast").disabled = true
}
fetch(`${window.location.href}/drivers.json`).then(res => {
res.json().then(result => {
driversObj = result