with anything there are a lot of ways to do it. This is sort of a parralax type of animation. There are many librarys that handle this, but one way is to (at a certain place on the site) decouple the scroll from actually moving further down the page, and use it as the keyframe engine for the animation.
This is a basic overview, but if you are interested google keywords like "parralax" and "parralax animation"
This is a basic overview, but if you are interested google keywords like "parralax" and "parralax animation"