css oxygen animation

CSS Oxygen Animation Tutorial: Breathe Life into Your Designs

By Jessica Clark
AD

Animation in CSS can significantly enhance user experience and interactivity on websites. One lesser-known yet powerful approach to CSS animation is utilizing keyframes and the animation-delay property, often referred to as the 'oxygen' animation due to its breathing-like effect. Today, we explore this technique and its applications in web design.

Before diving into the 'oxygen' animation, let's briefly recap CSS animations' basic setup. CSS animations are created by applying the animation-name and animation-duration properties to a selected element, coupled with definition of keyframes in an "@keyframes" rule.

Understanding the Oxygen Animation

The 'oxygen' animation is essentially a cyclic slow-in and slow-out effect, giving an impression of something gradually changing pace, much like breathing in and out. It's achieved by transforming the animation's delay over time, creating a pulsating movement.

AD
160 CSS Animation Examples
160 CSS Animation Examples
25+ CSS Animation Libraries 2024
25+ CSS Animation Libraries 2024
Cool CSS Animation Libraries
Cool CSS Animation Libraries

To create this effect, you'll use the animation-delay property within your keyframes, progressively increasing and decreasing the delay to manipulate the animation speed.

Implementing the Oxygen Animation

Here's a simple example of implementing an 'oxygen' animation with CSS:

CSS Radio Hopping Effect - No Javascript - Coding - Fribly
CSS Radio Hopping Effect - No Javascript - Coding - Fribly
four different colored squares with circles and dots
four different colored squares with circles and dots
CSS Bounce-in Animation | CSS tutorial
CSS Bounce-in Animation | CSS tutorial
  1. First, create a class for the animated element:
    .animated { animation: spin 2s linear infinite; }
  2. Next, define the keyframes and introduce the 'oxygen' effect:
    @keyframes spin {
      0% { animation-delay: 0s; }
      50% { animation-delay: 1s; }
      100% { animation-delay: 0s; }
    }

The animated element will now appear to slow down and speed up, mimicking an 'oxygen' effect.

Customizing the Oxygen Animation

The 'oxygen' animation relies on adjusting the animation-delay property. You can fine-tune the animation by modifying the keyframes. For instance, to create a longer inhale/exhale cycle, change the percentage values of the keyframes:

AD
@keyframes spin {
  0% { animation-delay: 0s; }
  70% { animation-delay: 2s; }
  100% { animation-delay: 0s; }
}

This will create a longer 'in-breath', giving a more relaxed, slower-paced animation.

an image of a blue object with the word re in it's middle corner
an image of a blue object with the word re in it's middle corner
How to Create Animated Number Counters in Oxygen - PIT Designs
How to Create Animated Number Counters in Oxygen - PIT Designs
CSS bouncing timing function | css tutorial
CSS bouncing timing function | css tutorial
the loading animation in css
the loading animation in css
an animated electric border for the source code - borderer, with text below it
an animated electric border for the source code - borderer, with text below it
Easy CSS Animated Gradient Box | HTML and CSS Tutorial
Easy CSS Animated Gradient Box | HTML and CSS Tutorial

Using the Oxygen Animation in Web Design

The 'oxygen' animation can enhance various web design elements. Here are a few practical applications:

respiration-like Motion for Buttons

Adding an 'oxygen' animation to buttons can subtly draw attention to them and encourage interaction.

AD

Breathe Life into Logos and Icons

Applying this animation to logos or icons can make them feel more dynamic and engaging, particularly when the design is otherwise static.

an image of a computer screen with the text effect luvia mattrix
an image of a computer screen with the text effect luvia mattrix
CSS Animations Tutorial: Bring Your Website to Life
CSS Animations Tutorial: Bring Your Website to Life
Creative CSS Loading Animations Effects | CSS Animation Tutorial for Beginners
Creative CSS Loading Animations Effects | CSS Animation Tutorial for Beginners
Hold on animation using html and css.mp4
Hold on animation using html and css.mp4
Water Wave Animation using HTML CSS only
Water Wave Animation using HTML CSS only
an animation effects logo is shown in this dark background with green and white dots on it
an animation effects logo is shown in this dark background with green and white dots on it
Color Drop Loading Animating using HTML CSS only
Color Drop Loading Animating using HTML CSS only
an image of some type of webpage with the words html and css on it
an image of some type of webpage with the words html and css on it
Qclay
Qclay
This CSS Animation Will Instantly Upgrade Your Website 🚀 (Pure HTML & CSS)
This CSS Animation Will Instantly Upgrade Your Website 🚀 (Pure HTML & CSS)
a glassy button with the words glassy button on it's left side
a glassy button with the words glassy button on it's left side
CSS Loading Spinners You Can Copy & Paste: 31 Best Tools for 2025
CSS Loading Spinners You Can Copy & Paste: 31 Best Tools for 2025
How to Create a Stunning Fire Animation Using HTML & CSS
How to Create a Stunning Fire Animation Using HTML & CSS
30 Cool CSS Animation Examples to Create Amazing Animation Websites
30 Cool CSS Animation Examples to Create Amazing Animation Websites

The 'oxygen' animation is a versatile and engaging technique to add a touch of dynamic interactivity to your website. Whether you're designing for user interface, user experience, or both, this subtle yet powerful effect can enhance visitor engagement and encourage exploration.

As with any animation technique, remember that 'oxygen' animations should be used judiciously and sparingly. Their subtle nature can make them easily overlooked when overused or misapplied. Always test your animations on various devices and in different user scenarios to ensure they enhance, rather than distract from, your website's user experience.

AD
AD