handle prefers-reduced-motion

This commit is contained in:
Neale Pickett 2024-04-08 17:22:35 -06:00
parent cc74318e15
commit 0696e7c61c
2 changed files with 8 additions and 4 deletions

View File

@ -55,6 +55,11 @@ canvas.wallpaper {
opacity: 0.2; opacity: 0.2;
image-rendering: pixelated; image-rendering: pixelated;
} }
@media (prefers-reduced-motion) {
canvas.wallpaper {
display: none;
}
}
main { main {
max-width: 40em; max-width: 40em;
margin: 1em auto; margin: 1em auto;

View File

@ -92,8 +92,7 @@ export class Workspace {
this.runButton.addEventListener("click", () => this.run()) this.runButton.addEventListener("click", () => this.run())
this.revertButton.addEventListener("click", () => this.revert()) this.revertButton.addEventListener("click", () => this.revert())
this.fontButton.addEventListener("click", () => this.font()) this.fontButton.addEventListener("click", () => this.font())
}
}
initLanguage(language) { initLanguage(language) {
let start = performance.now() let start = performance.now()
@ -229,7 +228,7 @@ export class Workspace {
} }
} }
font(force) { font() {
this.element.classList.toggle("fixed", force) this.element.classList.toggle("fixed")
} }
} }