Interesting... Mind telling me which browser and OS you are using? I have tested it everyday on Firefox, Chrome, and Edge on Windows on different laptops, even with a gamepad as the controller, without such a weird problem.
Oh, btw, the character is designed to constantly running to the right, and the camera follows the player. It's a side-scrolling "runner" game; there is NOT a movement control using WASD. But the CAMERA should NOT be spinning like crazy.