(function () {
+ if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
+
var K = document.querySelector('canvas'),
{ random: R, PI, cos: C, sin: S, atan2: A } = Math,
id = p => p,
a: R() * 2 * PI, c: r(100)
})),
H = [sqr, crc, hrt, chs, lch], P = [id, spn(5), spn(15)],
- draw = H[r(H.length)], pos = P[r(P.length)]
+ draw = H[r(H.length)], pos = P[r(P.length)],
+ Z = 1
function r(x) {
return ~~(R() * x)
}
function frm(t) {
- requestAnimationFrame(frm)
+ if (Z) requestAnimationFrame(frm)
var dt = t - l
}
}
+ K.addEventListener('click', () => (Z ? Z=0:(Z=1&&frm())))
frm()
}
)()