Skip to content
Snippets Groups Projects
Commit 2988b4f2 authored by Ferenc Schulcz's avatar Ferenc Schulcz
Browse files

Neko: longer idle time before idle animation, relocate on window resize

parent 02914976
No related branches found
No related tags found
No related merge requests found
......@@ -120,6 +120,16 @@
mousePosX = event.clientX;
mousePosY = event.clientY;
});
window.addEventListener("resize", function () {
if (nekoPosX > window.innerWidth) {
nekoPosX = window.innerWidth - 32;
}
if (nekoPosY > window.innerHeight) {
nekoPosY = window.innerHeight - 32;
}
nekoEl.style.left = `${nekoPosX - 16}px`;
nekoEl.style.top = `${nekoPosY - 16}px`;
});
window.requestAnimationFrame(onAnimationFrame);
}
......@@ -156,7 +166,7 @@
// every ~ 10 seconds
if (
idleTime > 5 &&
idleTime > 10 &&
Math.floor(Math.random() * 100) == 0 &&
idleAnimation == null
) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment