Skip to content

Commit

Permalink
actually fixed mobile issue this time
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintSampo committed Feb 15, 2024
1 parent be08044 commit 26e7a70
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
});

Expand Down

0 comments on commit 26e7a70

Please sign in to comment.