
Website animation stays fast when it serves a purpose and uses cheap properties. Animate opacity and transform rather than size or position, start non-essential motion after the main content has loaded, avoid animating the largest element above the fold, respect reduced-motion settings and test on low-end phones. Used this way, motion adds clarity and brand personality without hurting loading speed.
Key takeaways
- Good motion gives feedback, shows where things come from and go, guides attention and adds a little delight. Motion without a job is decoration that costs performance.
- Animate opacity and transform, which browsers can handle smoothly. Avoid animating properties that force layout recalculation.
- Heavy hero animations can delay the Largest Contentful Paint, so load them carefully.
- Respect the reduced-motion setting. For some people, motion causes discomfort or makes a site unusable.
- Profile on real, modest devices, since desktop machines hide problems.
- Agree motion rules between design and development early, in the design system.
What is motion actually for?
Before asking how to animate, ask why. Useful motion generally does one of four jobs:
- Feedback. A button responds to a tap, a form field shakes slightly when invalid, a loader shows work is happening.
- Orientation. A panel slides in from the side it will leave toward, so users understand the structure of the page.
- Attention. A new notification or changed value is brought gently to the eye.
- Delight and brand. Small touches that make a product feel considered.
When does motion hurt?
- It distracts from reading or from the main action.
- It repeats endlessly beside the content someone is trying to read.
- Large parallax or zoom effects cause dizziness or nausea for some users.
- It delays interaction, for example a long intro animation before anything can be clicked.
- It slows loading, drains the battery and makes scrolling janky on lower-end phones.
If you cannot say what an animation helps the visitor do, consider removing it.
What makes an animation cheap or expensive?
Browsers draw pages in stages: working out layout, painting pixels and compositing layers. The earlier the stage an animation triggers, the more work the browser repeats on every frame.
- Cheap: opacity and transform. Fading, moving, scaling and rotating can usually be handled by the graphics processor on a separate layer without recalculating the page.
- Expensive: width, height, top, left, margins. Changing these forces the browser to recompute layout for surrounding elements, frame after frame.
- Moderately expensive: colour, shadows, filters. These repaint pixels. Fine in small doses, costly over big areas.
The practical rule is to animate opacity and transform wherever possible. Instead of animating height to reveal a menu, consider sliding or fading a panel. Instead of animating left, animate a translation.
Using will-change sparingly
There is a browser hint, called will-change, that warns the browser an element is about to animate so it can prepare a layer. Used on a few elements just before they animate, it can help. Applied everywhere, it wastes memory and can make things slower. Add it where profiling shows a benefit and remove it afterwards.
Should I use CSS, JavaScript, video or Lottie?
Each approach has a place.
- CSS transitions and animations. Best for simple state changes such as hover, focus, fading in and sliding. Lightweight, declarative and easy for browsers to optimise.
- JavaScript animation libraries. Needed for sequencing, scroll-linked effects, physics or interactions driven by user input. They add script weight and run on the main thread, so keep the scope small.
- SVG animation. Good for crisp icons, line drawing and illustrations that scale. Very complex SVGs with thousands of points can become heavy.
- Lottie. Designers export animations from design tools as small data files played by a library. Useful for illustrations and icons, yet it needs a player script and can be expensive for complex scenes. Test on cheap phones.
- Video. Looping muted video suits photographic or 3D-style backgrounds, but video files are large. Compress carefully, provide a poster image and avoid autoplay on slow connections where possible.
A good question is what the least expensive tool is that still achieves the effect. Simple things should be CSS, with heavier tools reserved for what truly needs them.
How do hero animations affect Largest Contentful Paint?
The Largest Contentful Paint (LCP) measures how quickly the biggest visible element appears. If your hero is a large animated element that depends on a script, a video or a big animation file, it may delay LCP, so visitors stare at a blank space.
Safer patterns:
- Render the hero heading and image from plain HTML and CSS, and layer animation on top afterwards.
- Do not make the main hero content start invisible and wait for JavaScript to reveal it.
- Provide a static poster image for video or Lottie heroes that loads quickly.
- Keep the animated asset small and avoid blocking the first paint.
Our guide to Core Web Vitals explains LCP, layout shift and responsiveness in more detail. Note too that animation which moves elements after load can cause layout shift, so reserve space for them.
Loading strategy: defer what is not critical
Sort animation into two groups. Critical motion, such as feedback on a button, must be available immediately. Decorative motion, such as a scroll-triggered illustration lower down, can wait.
- Load decorative animation scripts after the main content, or when the user nears the section.
- Initialise animations lazily using the browser's observation features, so off-screen elements do nothing until needed.
- Pause or stop animations that are off screen or in a hidden tab.
- Split code so pages without animation do not download animation libraries.
How do I respect reduced-motion preferences?
Operating systems let people choose to reduce motion, and browsers expose that choice to websites through the prefers-reduced-motion setting. People turn it on for reasons that include vestibular disorders, migraines and simple preference. Respecting it is both kind and part of good accessibility.
In practice:
- Under reduced motion, replace large movement such as slides, zooms and parallax with a simple fade or no animation.
- Stop autoplaying loops, or offer a visible pause control.
- Keep essential feedback, but make it gentle.
Test by turning the system setting on and browsing your own site.
Frame rate, battery and low-end phones
Smooth animation means the browser can finish each frame in time. On a powerful laptop almost anything looks fine. On a budget phone with limited memory and a busy processor, the same animation stutters and warms the device. Many of your customers, especially across India, browse on such phones. Consider:
- Fewer simultaneous animations.
- Smaller animated areas.
- Ending animations rather than looping forever.
- Giving the page a lighter mode when the device signals low power or data saving.
How should I test and profile animation?
- Test on real mid-range and older phones, not just emulators.
- Record a performance profile in browser developer tools while scrolling and animating, then look for long frames, layout recalculation and heavy scripting.
- Run speed tests before and after adding animation to see the effect on loading.
- Throttle CPU and network in developer tools to approximate slower conditions.
- Check with reduced-motion switched on.
Design guidance for duration and easing
Without chasing exact numbers, a few qualitative rules help. Small feedback animations should feel almost instant. Larger transitions can take slightly longer so the eye can follow them, but still feel brisk. Elements entering the screen generally look natural when they decelerate into place, while elements leaving can accelerate away. Avoid bouncy or elastic easing in business interfaces unless it is part of the brand. Keep timings consistent across similar interactions, so the site feels coherent.
Keeping brand feel while optimising
Performance work should not strip personality. Decide which two or three motion moments define your brand, such as a hero reveal or a signature hover effect, and invest in making them smooth. Simplify the rest. A restrained, consistent set of motion rules often feels more premium than constant movement.
Handoff between designers and developers
Motion is easily lost in translation. A clear handoff includes:
- A motion section in your design system listing durations, easing and where each pattern is used.
- Prototypes or short recordings showing intent.
- Agreement on fallbacks for reduced motion and slow devices.
- A performance budget for animation assets.
- Review of the built result on real devices before launch.
A worked example
Imagine a software company whose home page opens with a full-width animated illustration played from a large data file. On a mid-range phone the heading appears late, scrolling stutters and visitors leave. The team renders the heading and a static illustration in plain HTML first, loads the animation after the page is interactive, swaps size-changing effects for fades and slides, stops the loop after one play and shows the static version when reduced motion is on. The brand feel stays, yet the page responds faster.
FAQ
Does animation slow down a website?
It can, mainly when animations rely on heavy scripts or large files, or trigger layout recalculation on every frame. Animations using opacity and transform, loaded after the main content, usually have little effect on speed. Always measure on real devices to be sure.
What is prefers-reduced-motion?
It is a browser and operating system setting that tells websites the visitor wants less movement on screen. Your CSS or scripts can read it and swap large animations for gentle fades or none. Supporting it is an important accessibility practice.
Is Lottie better than CSS animation?
Neither is better in every case. CSS is lighter and ideal for simple interface motion, while Lottie suits detailed illustrations created by designers. Check the file size and the player cost, and test on lower-end phones before deciding.
Should I put an animation in my website hero?
Only if it supports your message and loads without delaying the main content. Show the heading and a static image first, then add motion on top. If the animation does not help the visitor understand or act, a simpler hero is usually better.
Related reading
- Core Web Vitals: What They Are and How to Improve Them
- Website Accessibility Basics Every Business Should Cover
- Image Optimisation for Faster Websites
Next steps
Review your busiest page: list each animation, say what it is for, and test it on an older phone with reduced motion switched on. If you would like help balancing brand-led motion with speed, contact us.



