Shrinking Sticky Header
On scroll, the nav bar shrinks, the logo gets smaller and frosted glass appears
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 (sticky). At the top of the page it is taller with a larger logo and a transparent background; once you scroll down a little, it smoothly gets shorter, the logo shrinks, and a semi-transparent frosted-glass background with a faint shadow appears, restoring when you scroll back to the top. About a 0.35 s transition. (How: listen to scroll and add a .shrink class when scrollY passes a threshold; CSS transitions padding, font-size, background and box-shadow, with backdrop-filter:blur for the background)
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 →