[Open-Source] - How To Clear Page With A Color Using JavaScript?

Hi,

We are working on a new poker game using our HTML5/JavaScript custom 2D Web game engine.

We have a situation that we can’t figure out:
We are trying to clear with “black” color the entire web page that the game runs on.

Please see our code below on Bit Bucket:
https://bitbucket.org/jesseleepalser/poker/src/2aa32933c75d81e4345061443325f5aff0afffa0/screens.js#lines-749

You can play the current build (just game shell - no “game” yet) below on Itch:
https://jesseleepalser.itch.io/poker

Let us know, thanks!

Jesse Lee

1 Like

Just set the body element’s background colour to black and it’s HTMLcontents to “”.
If you want to restore the game then add a click event listener on the body element