Create Google Animation Loader by using HTML and CSS

simple card design

Creating a Google loading animation using HTML and CSS can be a fun and educational project. Google has used various loading animations over the years, so I'll provide a basic example of a spinner animation that you can customize to your liking. Here are the steps to create a simple Google-style loading animation:

1. Create the HTML Structure: Start by setting up the HTML structure for your loading animation. You'll need an outer container and an inner element for the spinner animation.


<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Create Google Animation Loader by using HTML and CSS | Assignment Hippo</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
  <div class="container">
    <span class="circle"></span>
    <span class="circle"></span>
    <span class="circle"></span>
    <span class="circle"></span>
  </div>
</body>
</html>
    

2. Create the CSS Styles: In a separate CSS file (styles.css in this case), you can define the styles for your loading animation. You can customize the colors and sizes as needed.


       * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      body {
        display: flex;
        height: 100vh;
        align-items: center;
        justify-content: center;
        background: #fff;
      }
      .container {
        display: flex;
        column-gap: 10px;
      }
      .container .circle {
        height: 20px;
        width: 20px;
        border-radius: 50%;
        background: #008ae6;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        animation: animate 1s ease-in-out infinite alternate;
      }
      .circle:nth-child(1) {
        animation-delay: -0.25s;
      }
      .circle:nth-child(2) {
        background: #e60000;
        animation-delay: -0.5s;
      }
      .circle:nth-child(3) {
        background: #ffcc00;
        animation-delay: -0.75s;
      }
      .circle:nth-child(4) {
        background: #008800;
        animation-delay: -1s;
      }
      
      @keyframes animate {
        0% {
          transform: translateY(-10px);
        }
        100% {
          transform: translateY(5px);
        }
      }
         

In this example, we have a blue spinner on a white background, and it spins while pulsating in size.

3. Link CSS File: Make sure to link the CSS file you created in the <head> section of your HTML file.

4. Preview Your Loading Animation: Open your HTML file in a web browser to see the Google-style loading animation in action. You can further customize the colors, sizes, and animation durations to match your preferences.