From 26e7a705b3d4e29213bca06cd8d13b40d540d91c Mon Sep 17 00:00:00 2001 From: Jacob Williams <47766188+BotSpace@users.noreply.github.com> Date: Thu, 15 Feb 2024 12:07:05 -0500 Subject: [PATCH] actually fixed mobile issue this time --- index.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 82fefc8..da8b352 100644 --- a/index.js +++ b/index.js @@ -30,17 +30,16 @@ if (localStorage.getItem(toggleMobile.id) == null) { } document.addEventListener('DOMContentLoaded', function () { - toggleMobile.addEventListener('click', updateMobileSlider.bind(null, toggleMobile, true)); - toggleKeyboardWASD.addEventListener('click', updateSlider.bind(null, toggleKeyboardWASD, true)); - toggleLegacyPacket.addEventListener('click', updateSlider.bind(null, toggleLegacyPacket, true)); - toggleInfo.addEventListener('click', updateInfoSlider.bind(null, toggleInfo, true)); + updateMobileSlider(toggleMobile, toggleState=false); + updateSlider(toggleKeyboardWASD, toggleState=false); + updateSlider(toggleLegacyPacket, toggleState=false); + updateInfoSlider(toggleInfo, toggleState=false); + + toggleMobile.addEventListener('click', updateMobileSlider.bind(null, toggleMobile, toggleState=true)); + toggleKeyboardWASD.addEventListener('click', updateSlider.bind(null, toggleKeyboardWASD, toggleState=true)); + toggleLegacyPacket.addEventListener('click', updateSlider.bind(null, toggleLegacyPacket, toggleState=true)); + toggleInfo.addEventListener('click', updateInfoSlider.bind(null, toggleInfo, toggleState=true)); - - if (localStorage.getItem(toggleMobile.id) === 'true') updateMobileSlider(toggleMobile, false); - if (localStorage.getItem(toggleKeyboardWASD.id) === 'true') updateSlider(toggleKeyboardWASD, false); - if (localStorage.getItem(toggleLegacyPacket.id) === 'true') updateSlider(toggleLegacyPacket, false); - if (localStorage.getItem(toggleInfo.id) === 'true') updateInfoSlider(toggleInfo, false); - window.setInterval(renderLoop, 40); // call renderLoop every num milliseconds });