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

body {
  width: 100%;
  height: 100vh;
  margin: 0;
}

.loader {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  background-color: #03a9f4;
  border-radius: 50%;
  
  &:after {
    content: '';
    position: absolute;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    border: 0px solid white;
    transform: translate(-50%, -50%);
    animation: loading 1000ms ease-out forwards infinite;
  }
  
}

@keyframes loading {
  0% {
    border: 0px solid white;
  }
  
  20% {
    border: 8px solid white;
    width: 0%;
    height: 0%;
  }
  
  100% {
    border: 8px solid white;
    width: 100%;
    height: 100%;
  }
}

  

posted on 2018-10-30 16:23  FreeSpider  阅读(138)  评论(0编辑  收藏  举报