Search code examples
csscss-loader

Spinner CSS with Rounded Corners


Am trying develop spinner where it has three rings. I want the edges to be smooth. can someone help?

Look that:

.loader {
            animation: spin 4s infinite linear;
            border: solid 2vmin transparent;
            border-radius: 50%;
            border-right-color: #00ACC6;
            border-top-color: #00ACC6;
            box-sizing: border-box;
            height: 20vmin;
            left: calc(50% - 10vmin);
            position: fixed;
            top: calc(50% - 10vmin);
            width: 20vmin;
            z-index: 1;
        }

        .loader:before {
            animation: spin 5s infinite linear;
            border: solid 2vmin transparent;
            border-radius: 50%;
            border-right-color: #A0C800;
            border-top-color: #A0C800;
            box-sizing: border-box;
            content: "";
            height: 16vmin;
            left: 0;
            position: absolute;
            top: 0;
            width: 16vmin;
        }

        .loader:after {
            animation: spin 4s infinite linear;
            border: solid 2vmin transparent;
            border-radius: 50%;
            border-right-color: #984509;
            border-top-color: #984509;
            box-sizing: border-box;
            content: "";
            height: 12vmin;
            left: 2vmin;
            position: absolute;
            top: 2vmin;
            width: 12vmin;
        }

        @keyframes spin {
            50% {
                transform: rotate(360deg);
            }
        }
<div class="loader">
    </div>


Solution

  • Working sample for the spinner you asked for,

    .spinner {
      margin: 50px auto;
      position: relative;
      width: 150px;
      height: 150px
    }
    
    .spinner .circle {
      border-radius: 50%;
      border: 5px solid transparent;
      border-top-color: #000;
      animation: rotate linear infinite;
      position: absolute
    }
    
    .spinner .circle.one {
      width: 50px;
      height: 50px;
      left: 50px;
      top: 50px;
      animation-duration: .8s
    }
    
    .spinner .circle.two {
      width: 75px;
      height: 75px;
      left: 38px;
      top: 38px;
      animation-duration: .7s
    }
    
    .spinner .circle.three {
      width: 100px;
      height: 100px;
      left: 25px;
      top: 25px;
      animation-duration: 1s
    }
    
    @keyframes rotate {
      form {
        transform: rotate(0deg)
      }
     
      to {
        transform: rotate(360deg)
      }
    }
    <div class="spinner">
      <div class="circle one"></div>
      <div class="circle two"></div>
      <div class="circle three"></div>
    </di

    and here is a page which has wide variety of CSS loaders, kindly have a look at it. It does have a similar spinners as you requested.

    https://raju28.github.io/loaders/