Show on Entry, Hide on Scroll Down, Reappear on Scroll Up

Hi everyone,
Is it possible to configure a code for a Home Assistant card that shows up upon entering the view, vanishes during downward scrolling, and reappears upon upward scrolling?