Animating off screen elements on screen when user scrolls up or down

Here's a great post by @JimScott with a snippet of code:

The basic function is:

window.onscroll = function() {scrollTimelineSync()};
 
    function scrollTimelineSync() {
 
        whatScroll = (document.body.scrollTop || document.documentElement.scrollTop  )/ 36
         
        hypeDocument.goToTimeInTimelineNamed(whatScroll, 'Main Timeline');
        hypeDocument.triggerCustomBehaviorNamed('arrow-start')
        
    }

The '36' number is sort of a magic number that you should change based on how fast or slow the element should move based on the rate of scroll.