--- url: "https://web.dev/articles/animations-examples" titulek: "Examples of high-performance CSS animations | Articles | web.dev" h1: "Examples of high-performance CSS animations Stay organized with collections Save and categorize content based on your preferences." popis: "Demonstrating how high performance techniques can create complex and beautiful animations." jazyk: "en" kanonicka: "https://web.dev/articles/animations-examples" drobecky: ["Articles", "Examples of high-performance CSS animations"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-14 03:31:06" znaku: 8738 slov: 1343 kodovani: "iso-8859-2" sha256: "7e1962f055859c7015dea06eda77722121e883c5c2b3de4e65bd17e072c9def4" --- Examples of high-performance CSS animations Stay organized with collections Save and categorize content based on your preferences. Rachel Andrew In this post find out how some popular animations found on CodePen have been created. These animations all use the performant techniques discussed in other articles in this section. See [Why are some animations slow?](/articles/animations-overview) to learn the theory behind these recommendations, and the [Animations Guide](/articles/animations-guide) for practical tips. Wizard loading animation [View Wizard loading animation on CodePen](https://codepen.io/Craaftx/full/ExyYRMK) This loading animation is built entirely with CSS. The image plus all of the animation has been created in CSS and HTML, no images or JavaScript. To understand how it was created and how well it performs you can use Chrome DevTools. Inspect the animation with Chrome DevTools With the animation running, open the Performance tab in Chrome DevTools and record a few seconds of the animation. You should see in the Summary that the browser is not doing any Layout or Paint operations when running this animation. The summary after profiling the wizard animation. To find out how this animation was achieved without causing layout and paint, inspect any of the moving elements in Chrome DevTools. You can use the **Animations Panel** to locate the various animated elements, clicking on any element will highlight it in the DOM. Viewing and selecting items in the Chrome DevTools Animation Panel. For example select the triangle, and watch how the box of the element transforms during its journey into the air, as it spins, and then returns to the start position. Video showing how we can track the path of the triangle in Chrome DevTools. With the element still selected look at the Styles Panel. There you can see the CSS which draws the shape of the triangle, and the animation being used. How it works The triangle is created by using the `::after` pseudo-element to add generated content, using borders to create the shape. `.triangle { position: absolute; bottom: -62px; left: -10px; width: 110px; height: 110px; border-radius: 50%; } .triangle::after { content: ""; position: absolute; top: 0; right: -10px; width: 0; height: 0; border-style: solid; border-width: 0 28px 48px 28px; border-color: transparent transparent #89beb3 transparent; }` The animation is added with the following line of CSS, `animation: path_triangle 10s ease-in-out infinite;` Staying in Chrome DevTools you can find the keyframes by scrolling down the Style Panel. There you will find that the animation is created by using `transform` to change the position of the element and rotate it. The `transform` property is one of the properties described in the [Animations Guide](/articles/animations-guide), which does not cause the browser to do layout or paint operations (which are the main causes of slow animations). `@keyframes path_triangle { 0% { transform: translateY(0); } 10% { transform: translateY(-172px) translatex(10px) rotate(-10deg); } 55% { transform: translateY(-172px) translatex(10px) rotate(-365deg); } 58% { transform: translateY(-172px) translatex(10px) rotate(-365deg); } 63% { transform: rotate(-360deg); } }` Each of the different moving parts of this animation uses similar techniques. The result is a complex animation which runs smoothly. Pulsating Circle [View Pulsating Circle on CodePen](https://codepen.io/peeke/full/BjxXZa) This type of animation is sometimes used to draw attention to something on a page. To understand the animation you can use Firefox DevTools. Inspect the animation with Firefox DevTools With the animation running, open the Performance tab in Firefox DevTools and record a few seconds of the animation. Stop the recording, in the waterfall you should see that there are no entries for **Recalculate Style**. You now know that this animation does not cause style recalculation, and therefore layout and paint operations. The Firefox DevTools Waterfall. Staying in Firefox DevTools inspect the circle to see how this animation works. The `