Framework for animation with Javascript