This user has provided a nice solution (STACKBLITZ) on how to detect an element within the viewport in Angular. original thread
I would like to now adjust it, by adding a