The buttons 'onclick' to a js function which either adds or removes a CSS class containing the transform. Which in this case is a simple rotate. You may also notice the perspective effect.
Anybody here
There is also a transition effect built in for good measure