Here is a simple example of a game coded in HTML using JavaScript and 3-D elements created with triangles to form a Rubik's cube:
This code will display a 3-D cube with different colored faces and will rotate the cube randomly every 2 seconds. You can further enhance it to create a complete Rubik's cube game.