various fixes

This commit is contained in:
ntr
2019-09-19 15:26:06 +10:00
parent f04d179023
commit 22ad1781d8
5 changed files with 38 additions and 9 deletions
+4 -2
View File
@@ -3,8 +3,10 @@ const anime = require('animejs').default;
function wiggle(id, idle) {
const duration = 300;
const target = document.getElementById(id);
const x = (window.screen.width / anime.random(-100, 100)) * 0.1;
const y = (window.screen.height / anime.random(-20, 100)) * 0.1;
const x = window.screen.width * 0.01 * (Math.round(Math.random()) ? Math.random() : -Math.random());
const y = window.screen.height * 0.01 * (Math.round(Math.random()) ? Math.random() : -Math.random());
console.log(x, y);
return anime({
targets: target,
rotate: 0,