Hide Header on Scroll
The nav hides when you scroll down and slides back the moment you scroll up
This effect uses fixed demo content, so custom text isn’t applied.
Hannah's Motion Library
Web motion effects × AI prompts
AI prompt
The header nav is fixed at the top; when the user scrolls down (reading), it slides up out of view to make room, and as soon as they scroll up (looking for the menu) it slides right back in from the top; it's always shown at the very top. About 0.35 s, ease-out. Very common on mobile. (How: compare the current and previous scrollY to get the direction, or use ScrollTrigger's self.direction; toggle a class that sets the header to translateY(-100%), with a transition)
When you copy it, a note to “match the site’s existing theme colors” is added automatically, so you don’t need to specify colors.
How to use it
- Tap “Copy AI prompt”.
- Paste it into an AI such as ChatGPT or Claude, and tell it which element on your site to apply it to (for example, the homepage headline or a buy button).
- The AI writes code that matches your site’s colors. Paste it into your project, then fine-tune the timing and distances.
More layout & page effects
346 more motion effectsText, buttons, cards, backgrounds, cursors… preview them all and copy AI prompts
Browse all effects →