Navbar animation connected to amount scrolled


Is there a way to make the navbar animate up/down in relation to how much the user scrolls up? Say I scroll up 20 px I want 20 px of the navbar to be visible.

They way the navbar animates now if you follow Webflow tutorial is that it animates when scrolling is started, not in connection to how much you scroll.

I cant find website that has this function but for example the Facebook app has that function.