The short answer
Animate when the motion answers a question the visitor has. Did my click work? Is the page still loading? Where am I in this story? Motion that answers none of these is decoration, and it can go.
Three kinds of UI animation cover most websites: micro-interactions, loading animations and scroll animations. Each has a job, a cost and a way to go wrong. Two rules apply to all of them. Move only the properties a browser can move cheaply. And give visitors who ask for less motion a calmer page.
| Animation | Helps when | Hurts when |
|---|---|---|
| Hover and press states. | It shows that a control reacts. | The next click has to wait for it. |
| Toggles, form and status feedback. | It shows what changed after an action. | It replaces a clear text message. |
| Spinner or skeleton. | Content takes a moment, and the visitor needs to know it is coming. | It loops beside content with no way to stop it. |
| Full-page preloader. | Nothing on the page can work until it loads. | It covers content that could show already. |
| Scroll reveal. | It marks a new section or a new step. | Text starts hidden and shows up late. |
| Parallax and scroll-linked motion. | It ties a story to the scroll. | Layers move at different speeds and make some people feel sick. |
| Lottie loop. | A feature needs a short drawn demo. | It plays beside text with no pause. |
| Rive hero. | The product idea is best shown by trying it. | The message only lands after the visitor plays. |
Every animation should answer a question the visitor already has.
Micro-interactions: small feedback, not decoration
A micro-interaction is a small response to one action. A button sinks on press. A switch slides. A tick appears when a form is sent. A field shakes when the value is wrong.
These help because they confirm cause and effect. The visitor acts, and the page answers at once. Keep them short. Never make the visitor wait for the motion to end before the next click.
Build them from transform and opacity. A button that sinks on press uses transform: scale(). A tick that fades in uses opacity. web.dev warns that moving an element with anything other than transform is likely to be slow. The reason sits in the section on speed below.
Loading animations: when a loader helps and when it hides the page
A loading animation tells the visitor that something is on its way. That is useful for a search result, a form submit or a chart that waits for data. Put the indicator where the wait is: a spinner on the button, a skeleton where the list will appear.
A full-page preloader is a different case. It covers the whole page until it is done, even the parts that could show now. Google measures how fast the main content appears with Largest Contentful Paint. A good score is 2.5 seconds or less, at the 75th percentile of page loads. Chromium browsers, such as Chrome, skip elements with an opacity of 0 when they pick that main element. So a hero that waits behind a loader, or fades in from zero, counts only once it shows.
A real loader is still allowed. The W3C notes on Pause, Stop, Hide treat a preload animation as essential when no one can use the page during that phase. The rule is stricter for motion that plays beside content. If it starts on its own and lasts more than five seconds, the visitor needs a way to pause, stop or hide it.
Scroll animations: reveal, progress and parallax
Scroll animation ties motion to where the visitor is on the page. A section fades in as it enters. A progress bar fills. A product turns as you read about it.
CSS can do much of this on its own. CSS scroll-driven animations move property values along a scroll timeline instead of a clock. You pick what drives the timeline with the scroll() or view() functions. Check browser support on MDN before a key effect depends on it, and keep a plain version for browsers without it.
Scroll motion hurts in two ways. First, text that starts at zero opacity can leave a reader looking at a blank space. Second, parallax. The W3C notes that parallax, where backgrounds move at a different rate to foregrounds, is often not needed. For people with inner ear problems, this kind of motion can cause dizziness, nausea and headaches.
Motion and clear content can live on one page. OrangeOrange built the mediaman PXP page as a scroll story with complex GSAP animation. Clean markup under the motion keeps the story easy to read for search engines and AI tools.
Keep animation fast: transform and opacity
The web.dev guide to fast CSS animations says to keep animations to opacity and transform where you can. That keeps them on the compositing stage, the last step of drawing a page. It also says to avoid any property that triggers layout or paint unless you truly need it.
These two are the compositor-only properties. The compositor can change them alone, with no new layout and no new paint. web.dev says that only two properties work this way today.
The will-change property moves an element to its own layer. Use it rarely, and only to fix a real problem. Each layer needs memory. On devices with little memory, the cost can be bigger than the gain.
- Safe to move:
transformto shift, scale or turn things, andopacityto fade them. - Use with care: any property that makes the browser paint again.
- Avoid unless you must: any property that triggers layout.
Respect the reduced motion setting
Some people get sick from motion on screens. They can switch on a reduce motion option on their phone or laptop. On an iPhone, it sits in Settings, then Accessibility, then Motion. On Android 9 and up, its name is Remove animations. The browser then tells the page, through the prefers-reduced-motion media query.
MDN says the setting asks for an interface that removes, reduces or replaces motion. Reduced does not have to mean none. Keep a fade, but remove the slide, the zoom and the parallax. MDN names scaling or panning large objects as common triggers.
In CSS, put motion inside a media query for no-preference, or turn it off under reduce. Motion in JavaScript needs more care. The web.dev article on reduced motion shows how to listen for the setting. It also shows how to stop animations that are already playing.
The W3C criterion 2.3.3 Animation from Interactions asks that motion started by an action can be turned off, unless it is essential. It sits at Level AAA, the highest level. The W3C lists the prefers-reduced-motion query as one way to meet it.
Lottie and Rive: files for richer motion
Some motion is too rich for CSS: a drawn feature demo, an onboarding screen, a hero the visitor can play with. Two file formats handle most of it.
Lottie: loops that play the same way each time.
Lottie is a JSON-based file format for motion. It plays on the web, iOS, Android and more. Work made in After Effects is exported with Bodymovin and played by a library such as lottie-web. The .lottie format packs one or more animations and their assets into a single file. Lottie is built from vectors, so it scales without blur.
The Lottie examples on the OrangeOrange site are two concept sets, with no client behind them. Fieldnote has four feature loops for an AI meeting notes app, with key states drawn in Figma first. Sprout has four onboarding loops for a plant care app. Each loop runs 10 seconds at 60 fps. Each weighs 9 to 45 KB as a .lottie file. The page shows a still frame first and starts the player after the page loads.
Rive: motion with logic inside.
Rive puts logic into the file. A state machine links timelines with logic, and that is what makes the graphic react. Listeners respond to the pointer and the keyboard. With data binding, the site can change a value, and the state machine responds. The Rive runtimes are open-source libraries. They run on the web, in React, on iOS and Android, in Flutter, Unity and Unreal.
OrangeOrange built three Rive concept heroes, again with no client behind them. Moss is a habit tracker: a 20-second ghost-cursor demo plays until a visitor takes over. Its desktop state machine holds 28 layers. Patchbay turns agent permissions into patch cables, with a 139-line Luau script for drag and snap. Slice splits a $96.40 bill between 2 to 6 people, with a tip from 0 to 25%. A Luau script rounds every share. All three are on the motion work page.
Pick Lottie for a loop that plays the same way each time. Pick Rive when the motion must react to the visitor or to data. See Lottie animation and Rive animation for how OrangeOrange makes each one.
A checklist before motion ships
Run through this list for every animation on a page:
- Name what the animation tells the visitor. If it tells nothing, cut it.
- Move only
transformandopacity, and stay away from properties that force a new layout. - Never hide the main content behind a loader or a start at zero opacity.
- Give loops that play beside content for more than five seconds a pause or stop control.
- Test with reduce motion turned on, and remove each move that is not needed.
- Load Lottie and Rive players after the page content, and show a still frame until they start.
- Check the page on a mid-range phone, not only on a fast laptop.
For motion planned together with the rest of a site, see motion design.





