JavaScript Timer with CSS transitions