added a flipping animation and moved the JS and CSS into separate files