How to know if an element is visible in viewport

View blog post here

Hello World!

Hello World!

Hello World!

MY ELEMENT

Hello World!

Hello World!

Hello World!

Hello World!