This AI is dumb af
let stickman = document.createElement('img');
stickman.src='emozi_hamuster.png';
stickman.style.position = 'absolute';
stickman.style.left = '0px';
stickman.style.top = '50%';
document.body.appendChild(stickman);
window.addEventListener('mousemove', function(event) {
let x = event.movementY // get gamma value for left and right tilt
let y = event.movementX // get beta value for front and back tilt
if(x > 10) {
stickman.style.left = parseInt(stickman.style.left) + 5 + 'px';
} else if(x < -10) {
stickman.style.left = parseInt(stickman.style.left) - 5 + 'px';
}
if(y > 10) {
stickman.style.top = parseInt(stickman.style.top) - 5 + 'px';
} else if(y < -10) {
stickman.style.top = parseInt(stickman.style.top) + 5 + 'px';
}
});