So in order to check if the user has scrolled at all I found that I can use:
@HostListener("window:scroll", [])
onWindowScroll() {
this.scrolled = window.scrollY > 0;
}
This works well for the first paragraph after the user scrolls "below-the-fold" (I trigger an animation by adding a css class to a text div).
However how can I repeat the same thing for when a user scrolls past the "second" fold and goes into the third? I want to add the css class to make the text appear every time the user can see it (i.e. he has scrolled enough as in >= some threshold in pixels I need to find) and remove it when the user can't see the div (i.e. he scrolled back up).
How can I do that in Typescript / Angular?