oneko: honor prefers reduced motion

This commit is contained in:
maia arson crimew 2023-05-11 11:08:40 +02:00
parent 584aa15038
commit 454b6eaaf7

View file

@ -1,6 +1,6 @@
// based on oneko.js from https://github.com/adryd325/oneko.js, licensed under MIT, with art from https://twitter.com/_Anunnery
(function oneko() {
function oneko() {
const nekoEl = document.createElement("div");
let nekoPosX = 32;
let nekoPosY = 32;
@ -196,4 +196,9 @@
}
create();
})();
};
const isReduced = window.matchMedia(`(prefers-reduced-motion: reduce)`) === true || window.matchMedia(`(prefers-reduced-motion: reduce)`).matches === true;
if (!isReduced) {
oneko();
}