I have this code. I added mouse events for the left and right buttons but I also need to add touch events. I am stuck at that.
I am stuck at the touch events. I tried a few ways and every time something was wrong because the movement of the circle was either accelerating, meaning that the clearInterval did not work properly or the whole circle stood in the same position, without any rotation. Help me please, I am stuck. I am thinking that in the worst case scenario, this will be a code only for users with mouse. Extra info: when not pressing the buttons, the circle should rotate slowly, and then stop when we press any of the 2 buttons. Pressing any of the 2 buttons will cause a quicker rotation speed and releasing them will stop the quick rotation and set the interval again with the slow rotation. I completely deleted my attempts on touch events, so that I or anyone can start with those from 0. The codepen link to the code. The obe i posted may not work properly https://codepen.io/AlexTAG/pen/qBRpQoL //Ik it the code is full of intervals and it looks like hell.