Sure, here's a simple racing game implemented as a single HTML file using JavaScript:
This simple racing game features a road represented by a rectangle and a car represented by another rectangle. The player controls the car using left and right arrow keys to move horizontally within the road. The game runs in a loop, updating the game state and redrawing the canvas every 20 milliseconds. The game ends when the player closes the browser tab or navigates away from the page.