246

Expanding Search

Normally a round magnifier button; tap to expand it left into a search box

Form & controlSwitchUI interactionApp UICSSCSS transition

Hannah's Motion Library
Web motion effects × AI prompts

AI prompt

Search in a nav bar: normally just a round magnifier button; when tapped it smoothly expands to the left into a long search box (about 0.5 s), the input text fades in only after it's half open, and the magnifier rotates 90° with a ring lighting up around it; when the input loses focus and is empty, it collapses back into the round button. (CSS: container overflow:hidden, width transitions from the button's width to the expanded width with cubic-bezier(.6,0,.2,1); input opacity with transition-delay; JS toggles a class and focuses the input)

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

  1. Tap “Copy AI prompt”.
  2. 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).
  3. The AI writes code that matches your site’s colors. Paste it into your project, then fine-tune the timing and distances.

More form & control effects

346 more motion effectsText, buttons, cards, backgrounds, cursors… preview them all and copy AI prompts

Browse all effects →