Moved from JQuery to Canvas based animation