First, I don’t understand what you are trying to get at here.
If your rubik’s cube is static (which is probably what it is), meaning it doesn’t have animation involved, making it functional is simple.
I can’t explain but I made it work.
Up, Down, Left, Right to change faces
Click around the box to turn the individual collumns/rows
I have never completed a rubik’s cube and this I made in around 1.5 hours, so the code looks like a mess
However it works but keep in mind that you can change the orientation by simplying changing faces (UP, LEFT, DOWN)
It’s possible for me to make a little 3d cube that shows orientation but I think that is too much work. 3d is possible (I have my own little library)
There’s an obvious bug in it, but I don’t have the time to visualize it and solve the orientation problems.