Implementing a Scroll Based Animation with JavaScript