move animation loop outside from web components