Skip to content

Commit

Permalink
actually actually fixed mobile switches
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintSampo committed Feb 15, 2024
1 parent 26e7a70 commit 9a9ea68
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,15 @@ document.addEventListener('DOMContentLoaded', function () {
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));
toggleMobile.addEventListener('mousedown', updateMobileSlider.bind(null, toggleMobile, toggleState=true));
toggleKeyboardWASD.addEventListener('mousedown', updateSlider.bind(null, toggleKeyboardWASD, toggleState=true));
toggleLegacyPacket.addEventListener('mousedown', updateSlider.bind(null, toggleLegacyPacket, toggleState=true));
toggleInfo.addEventListener('mousedown', updateInfoSlider.bind(null, toggleInfo, toggleState=true));

toggleMobile.addEventListener('touchstart', updateMobileSlider.bind(null, toggleMobile, toggleState=true));
toggleKeyboardWASD.addEventListener('touchstart', updateSlider.bind(null, toggleKeyboardWASD, toggleState=true));
toggleLegacyPacket.addEventListener('touchstart', updateSlider.bind(null, toggleLegacyPacket, toggleState=true));
toggleInfo.addEventListener('touchstart', updateInfoSlider.bind(null, toggleInfo, toggleState=true));

window.setInterval(renderLoop, 40); // call renderLoop every num milliseconds
});
Expand Down

0 comments on commit 9a9ea68

Please sign in to comment.