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;
image-rendering: pixelated;
}
@media (prefers-reduced-motion) {
canvas.wallpaper {
display: none;
}
}
main {
max-width: 40em;
margin: 1em auto;

View File

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