Cycling through different states (of text) on scroll within one section

I’m having trouble with how to cycle through text states in a multistate box on scroll. I want to be able to change the text each time a user scrolls while also keeping them within the same section/not moving down the page.

Working in
e.g. Wix Studio Editor and Dev mode

Thanks! I was inspired by this website: https://mischiefusa.com/ . wondering how they did this