forked from nyancrimew/maia.crimew.gay
oneko: honor prefers reduced motion
This commit is contained in:
parent
584aa15038
commit
454b6eaaf7
1 changed files with 197 additions and 192 deletions
|
@ -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();
|
||||
}
|
Loading…
Reference in a new issue