This works without javascript!

Adapted from this page: https://css-tricks.com/css-in-3d-learning-to-think-in-cubes-instead-of-boxes/