X-Git-Url: https://git.r.bdr.sh/rbdr/r.bdr.sh/blobdiff_plain/b8bcdb6d9055236cec6271eff61f6bfc4ecc3faa..41fd02f65fa8913a448f4e54474bbd9c68e3cff5:/js/animation.js?ds=sidebyside diff --git a/js/animation.js b/js/animation.js index ee43c54..386e341 100644 --- a/js/animation.js +++ b/js/animation.js @@ -1,6 +1,6 @@ (function () { - if (window.matchMedia(`(prefers-reduced-motion: reduce)`).matches === true) return; + if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return var K = document.querySelector('canvas'), { random: R, PI, cos: C, sin: S, atan2: A } = Math, @@ -86,8 +86,6 @@ i.c = (i.c + 2) % 101 } - canvas.addEventListener('click', () => {Z ? Z=0:(Z=1;frm())}) - function frm(t) { if (Z) requestAnimationFrame(frm) @@ -106,6 +104,7 @@ } } + K.addEventListener('click', () => (Z=0)) frm() } )()