JS: show CSS animation once element is visible on page