From f2da8e16191f4ef7cb596c22afd5b93997d48145 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 30 Apr 2023 00:05:42 +0200 Subject: [PATCH] rename function --- files/assets/js/marseko.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/files/assets/js/marseko.js b/files/assets/js/marseko.js index 25873d9306..b4d29852ee 100644 --- a/files/assets/js/marseko.js +++ b/files/assets/js/marseko.js @@ -1,10 +1,10 @@ const marsekoEl = document.getElementById("marseko"); -function getRandomInt(max) { +function getInitialPosition(max) { return Math.max(32, Math.floor(Math.random() * max) - 16); } -let marsekoPosX = getRandomInt(screen.availWidth); -let marsekoPosY = getRandomInt(screen.availHeight); +let marsekoPosX = getInitialPosition(screen.availWidth); +let marsekoPosY = getInitialPosition(screen.availHeight); marsekoEl.style.left = `${marsekoPosX}px`; marsekoEl.style.top = `${marsekoPosY}px`; let mousePosX = marsekoPosX;