a simple JS animation exercise