refactoring css and javascript, adding animations