So I have a website that I've been working on for a while, and I just had what I think is a good idea for the improvement of the site, but don't know how to implement it. If you help me, I will put a thank you in the code. Here's what I want done:

1. User clicks on a link on the topbar.
2. An animation plays as it goes from one link to another. I want the animation to look like a rotating cube. But I want it to randomly choose whether the cube rotates left, right, up, or down.
3. The page displays normally

I will be thankful for any level of help you can provide. I am fine with just being told what coding language I'd need for this (java maybe?) and a few basic tips on how to get there, or being given the whole code. Thank you in advance for all your help!