Refactored animation timings to be one javascript method
instead of five