move oneko.gif

This commit is contained in:
Jacob Janzen 2024-12-31 13:28:17 -06:00
parent 8ea04db701
commit 2151f5693a
2 changed files with 216 additions and 216 deletions

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

@ -96,10 +96,10 @@
nekoEl.style.top = `${nekoPosY - 16}px`; nekoEl.style.top = `${nekoPosY - 16}px`;
nekoEl.style.zIndex = 2147483647; nekoEl.style.zIndex = 2147483647;
let nekoFile = "./oneko.gif" let nekoFile = "/images/oneko.gif";
const curScript = document.currentScript const curScript = document.currentScript;
if (curScript && curScript.dataset.cat) { if (curScript && curScript.dataset.cat) {
nekoFile = curScript.dataset.cat nekoFile = curScript.dataset.cat;
} }
nekoEl.style.backgroundImage = `url(${nekoFile})`; nekoEl.style.backgroundImage = `url(${nekoFile})`;
@ -124,8 +124,8 @@
lastFrameTimestamp = timestamp; lastFrameTimestamp = timestamp;
} }
if (timestamp - lastFrameTimestamp > 100) { if (timestamp - lastFrameTimestamp > 100) {
lastFrameTimestamp = timestamp lastFrameTimestamp = timestamp;
frame() frame();
} }
window.requestAnimationFrame(onAnimationFrame); window.requestAnimationFrame(onAnimationFrame);
} }