Guides / Websites

Make Claude build an animated website: 4 steps with Motion (previously Framer Motion) and 4 named motions

Asking Claude to "add animation" gets fade-ins. Install Claude Code, use Motion, describe the brand, then name four motions: entrance, parallax, letters, press.

Watch the reel on InstagramComment #官網 to get this guide

Claude is good at laying out a website, but ask it to "add some animation" and you usually get sections that fade in one by one. This is the full version of the pomelo-tea site from our Reel: Claude Code plus the free, open-source animation library Motion (previously Framer Motion), in 4 steps, for a site where the cup drops in, the fruit drifts as you scroll, the headline pops up letter by letter and the cards slide in and react when you press them.
The demo brand, YUGUANG, is fictional. The cup, pomelo slices and leaves were drawn in code by Claude, with no photos. Every screenshot below is the real site Claude built from these prompts.

01The result: an animated bubble-tea website

YUGUANG home page: dark green background, a big yellow headline and a cup of pomelo tea with pomelo slices around it
The home page after the intro animation (desktop). The cup, slices, ice and leaves are all SVG drawn in code.

The whole site is one React project, with every animation handled by Motion. The main file, App.jsx, is under 300 lines and holds a hero, a ticker, a three-drink menu, a three-step process, one big statement and a store-finder button.

  1. Entrance: the cup springs in from above, then pomelo slices, leaves and ice burst out from behind it and float.
  2. Parallax: as you scroll, the cup sinks, tilts and shrinks, the fruit drifts up at different speeds and the giant word POMELO slides sideways.
  3. Staggered letters: each character of the headline pops up from below in turn.
  4. Slide-in and press: the menu cards slide in when you reach them, lift on hover and shrink a little when pressed.

02Step 1: install Claude Code

Claude Code is Claude in your terminal. It can create folders, install packages, write code and start a preview on its own. The official install is one line:

  1. Mac, Linux, WSL: open Terminal and paste curl -fsSL https://claude.ai/install.sh | bash
  2. Windows PowerShell: paste irm https://claude.ai/install.ps1 | iex
  3. Windows Command Prompt (CMD): paste curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
  4. When it finishes, open a new terminal window, run claude --version to check, then type claude to log in.

Two things to know. First, Claude Code needs a Pro, Max, Ultra, Team, Enterprise or Console account; the free plan does not include it. Second, this project installs packages with npm and previews with Vite, so you need Node.js; Vite asks for version 20.19+ or 22.12+. If you are not sure, ask Claude: "Check whether Node.js is installed."

03Step 2: tell it to use Motion (previously Framer Motion)

Motion is an animation library for React. Its official page says it was previously Framer Motion; it is MIT-licensed, free and open source. You install it with npm install motion and import from motion/react. When we wrote this, the latest version on npm was 14.9.0.

Why name it? If you don't, Claude may write plain CSS or pick another library. Once Motion is in, you can talk to Claude in its words: spring, stagger, useScroll (follows the scroll), whileInView (plays when it scrolls into view), whileHover and whileTap.

Prompt to start the project
Create a React project with Vite, install motion (npm install motion), and import all animation from motion/react.

04Step 3: describe the brand clearly

Animation comes last. Claude first needs to know whose site this is, what it sells and how it should look, so it knows what to animate. Our prompt says just three things (what we sell, which colours, what feel) and then lists the sections.

Brand prompt (replace the [ ] parts)
Build a one-page website for a [type of brand, e.g. Taiwanese bubble-tea brand].
Brand: [brand name], selling [product, e.g. pomelo teas like pomelo green tea].
Colours: [background + main + accent, e.g. deep green background + pomelo yellow + coral red].
Feel: [3 words, e.g. autumn, fresh, full of fruit].
Product images: [e.g. no photos; draw the cup and pomelo slices in code].
Sections: [e.g. hero, ticker, three-drink seasonal menu, three steps, one big statement, store-finder button].

"Draw the cup and pomelo slices in code" is a useful line. Claude draws the products as SVG, so every piece of fruit can be animated on its own, and there are no photo rights to worry about. Swap in real product photos later.

05Why "add some animation" isn't enough

"Add some animation" doesn't say what moves, when it moves or how, so Claude picks the safest option: fade every section in. Nothing breaks, but nobody remembers it.

When you write a motion prompt, make each part answer four questions:

  1. What moves: the cup? the fruit? each letter of the headline?
  2. When: on load, with the scroll, when it scrolls into view, on hover or on press?
  3. From where to where: drops from above, bursts out from behind the cup, slides up from below.
  4. How: a bounce (spring), one after another (stagger), moving while rotating.

06Step 4: name four specific motions

These are the four motion prompts we actually gave Claude. Replace the [ ] parts with your own product. Paste one at a time and check the result before the next; it is easier to fix that way.

① Entrance (replace the [ ] parts)
When the home page loads, [hero item, e.g. the cup] springs in from above, then [supporting items, e.g. pomelo slices, leaves and ice] burst out from behind [the hero item] one after another and float gently.
Three moments of the entrance: the cup dropping in, fruit bursting out behind it, everything in place
The entrance: at 0.4 s the cup is still falling, at 1 s the fruit bursts out, at 3.6 s everything floats in place.
② Parallax (replace the [ ] parts)
Use useScroll + useTransform: as the page scrolls down, [hero item] moves down, tilts slightly and shrinks, [supporting items] drift up at different speeds, and the giant background word [your word, e.g. POMELO] slides sideways.
Left: home page before scrolling; right: after 420px, the cup has sunk and tilted and POMELO has moved left
Left: no scroll. Right: 420px down. The cup sinks and tilts, the giant word slides left, the ticker comes up.
③ Staggered letters (replace the [ ] parts)
Each character of the main headline pops up from below in turn (stagger 0.06 s, spring), with the last line in [accent colour, e.g. pomelo yellow].
Three moments of the headline popping up character by character
The headline pops up one character at a time, each 0.06 s after the last. The last line is pomelo yellow.
④ Slide-in and press (replace the [ ] parts)
[Cards, e.g. the menu cards] slide up from below in turn with whileInView and straighten; on hover the card lifts and [the item inside, e.g. the cup] tilts (whileHover); every button shrinks when pressed (whileTap). Each character of [the big statement] brightens as you scroll.
Two moments of the three menu cards sliding up one after another
When you reach the menu, the three cards slide up one after another and straighten.
The same red pomelo card at rest, lifted on hover and shrunk when pressed
The same card at rest, on hover (the card lifts, the cup tilts) and pressed (the whole card shrinks a little).

Here is part of the code Claude wrote. You don't need to read it; just notice that "slide up from below", "lift" and "shrink when pressed" in your prompt became the yellow props: whileInView, whileHover and whileTap.

App.jsx menu-card code with the Motion props whileInView, whileHover and whileTap highlighted
App.jsx lines 181–199 (line 197 wrapped for layout): the hidden, show and hover states and the Motion props.

07Preview it on phone and desktop

Preview prompt
Run it with npm run dev and check it at both phone and desktop widths.

Claude starts a local address (Vite's default is http://localhost:5173). Open it in your browser and scroll from top to bottom. For the phone view, switch to a phone width in the browser's developer tools.

Three phone screens of the YUGUANG site: hero, menu cards, store-finder button
Phone view: hero, menu cards laid out sideways, and the store-finder button. Same code; Claude did the phone layout.
  1. If something feels off, name just that part: "On phone the cup is too big and covers the buttons", "The parallax is too strong; move the cup half as far".
  2. Change one thing at a time, then scroll through again.
  3. To respect people who turn on Reduce Motion, add: "Wrap the whole site in MotionConfig reducedMotion=\"user\"". Motion's docs say this turns off transform animations and keeps changes such as opacity and colour.

08Go live: build it into one folder

  1. Tell Claude: "Build it with npm run build." It creates a dist folder that holds the whole site.
  2. Check the built version locally with npm run preview (default http://localhost:4173).
  3. Upload dist to any static host. Vite's deploy guide covers Vercel, Netlify, GitHub Pages and more, or ask Claude to "deploy this to Vercel" and it will walk you through it; you do the account login yourself.

09Good to know

  1. YUGUANG is a fictional brand; the menu, prices and copy are demo content, and the site footer says so.
  2. Claude Code needs a paid plan (Pro, Max, Ultra, Team, Enterprise or Console); the free plan does not include it.
  3. Commands and versions were checked on 31 Oct 2026: follow the official setup page for the Claude Code install, and Motion was at 14.9.0 then. If things change, the official pages win.
  4. Claude won't write identical code every time; numbers and details will differ. If you don't like something, say in one sentence which part to change.
  5. More animation isn't better. Four motions in the right places (hero, scroll, headline, cards and buttons) are enough; keep the other sections quiet so the key moments stand out.
  6. Before going live, replace the code-drawn products with real photos so customers see the cup they will actually get.

Sources

Related guides