After researching, I discovered a method to detect if the user has scrolled by using:
@HostListener("window:scroll", [])
onWindowScroll() {
this.scrolled = window.scrollY > 0;
}
This implementation works effectively for triggering an animation on the first paragraph when the user scrolls "below-the-fold" (by adding a CSS class to a text division).
Now, my challenge is figuring out how to replicate this behavior for when a user scrolls past the "second" fold and enters the third. I aim to dynamically add the CSS class to display the text whenever it becomes visible to the user (once they have scrolled beyond a certain pixel threshold) and remove it when the text goes out of view as the user scrolls back up.
Can anyone provide guidance on achieving this functionality in TypeScript/Angular?