Updating animations from JS to CSS