Skrållan is a vanilla javascript library for detecting scroll events. It can detect if you scroll the page up or down.