Radar Loading Animation With HTML & CSS

Radar Loading Animation With Pure HTML & CSS

Hey Programmers! Do you want to create eye-catching Radar Loading Animation for your web application? In this blog post, we are going to build a cool radar-loading animation using pure HTML & CSS.

This radar loading animation will clone the sweeping motion of a radar & provide a visually appealing way to indicate loading or processing. At the end of this post, you will be able to use CSS Animation, Pseudo-Elements & Blur Effects more efficiently.

Also Read: How To Make Book Loading Animation With HTML & CSS

We will understand the code step by step & At the end of this post, I will share the entire source code of this project so that you can run this on your local device,

Concepts Used To Make Radar Loading Animation

  1. CSS Blur Effect
  2. CSS Box Shadow & Box Model
  3. CSS Before & After
  4. CSS ANimation & KeyFrames
  5. CSS Border Radius
  6. CSS Inset, Overflow

Understanding HTML To Make Radar Loading Animation

  1. Loader Container:
   <div class="loader">
  1. Span Element:
   <span></span>

Understanding CSS To Make Radar Loading Animation

  1. Loader Container Styles:
   .loader {
     position: relative;
     width: 150px;
     height: 150px;
     background: transparent;
     border-radius: 50%;
     box-shadow: 25px 25px 75px rgba(0,0,0,0.55);
     border: 1px solid #333;
     display: flex;
     align-items: center;
     justify-content: center;
     overflow: hidden;
   }
  1. Loader Pseudo-elements:
   .loader::before {
     content: '';
     position: absolute;
     inset: 20px;
     background: transparent;
     border: 1px dashed#444;
     border-radius: 50%;
     box-shadow: inset -5px -5px 25px rgba(0,0,0,0.25),
                 inset 5px 5px 35px rgba(0,0,0,0.25);
   }

   .loader::after {
     content: '';
     position: absolute;
     width: 50px;
     height: 50px;
     border-radius: 50%;
     border: 1px dashed#444;
     box-shadow: inset -5px -5px 25px rgba(0,0,0,0.25),
                 inset 5px 5px 35px rgba(0,0,0,0.25);
   }
  1. Span Element Styles:
   .loader span {
     position: absolute;
     top: 50%;
     left: 50%;
     width: 50%;
     height: 100%;
     background: transparent;
     transform-origin: top left;
     animation: radar81 2s linear infinite;
     border-top: 1px dashed #fff;
   }
  1. Span Element Before Pseudo-element:
   .loader span::before {
     content: '';
     position: absolute;
     top: 0;
     left: 0;
     width: 100%;
     height: 100%;
     background: seagreen;
     transform-origin: top left;
     transform: rotate(-55deg);
     filter: blur(30px) drop-shadow(20px 20px 20px seagreen);
   }
  1. Keyframe Animation:
   @keyframes radar81 {
     0% {
       transform: rotate(0deg);
     }

     100% {
       transform: rotate(360deg);
     }
   }

Source Code Of Radar Loading Animation

HTML:

 <div class="loader">
        <span></span>
</div>

CSS:

<style>
        .loader {
  position: relative;
  width: 150px;
  height: 150px;
  background: transparent;
  border-radius: 50%;
  box-shadow: 25px 25px 75px rgba(0,0,0,0.55);
  border: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.loader::before {
  content: '';
  position: absolute;
  inset: 20px;
  background: transparent;
  border: 1px dashed#444;
  border-radius: 50%;
  box-shadow: inset -5px -5px 25px rgba(0,0,0,0.25),
  inset 5px 5px 35px rgba(0,0,0,0.25);
}

.loader::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px dashed#444;
  box-shadow: inset -5px -5px 25px rgba(0,0,0,0.25),
  inset 5px 5px 35px rgba(0,0,0,0.25);
}

.loader span {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 50%;
  height: 100%;
  background: transparent;
  transform-origin: top left;
  animation: radar81 2s linear infinite;
  border-top: 1px dashed #fff;
}

.loader span::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: seagreen;
  transform-origin: top left;
  transform: rotate(-55deg);
  filter: blur(30px) drop-shadow(20px 20px 20px seagreen);
}

@keyframes radar81 {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}
    </style>

Last Updated: June 18, 2024

By JSM Hemant

About Author

Hello, Myself Hemant. I Am Web Developer & Likes To Create Awesome Projects By Using MERN, Java, Python, C++. In This Website You Will Get Cool Projects Made With Above Technologies With Full Source Code. You Can Also Follow This Website On Author Social Media:

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

Recent Posts