update js animation step by step