css制做收拢圆环转动实际效果案例编码

日期:2021-03-01 类型:科技新闻 

关键词:自助建站,专业建站,建站网站,建站平台,网站在线制作app

实际效果以下所示:

 

收拢转动圆环

css编码:

<style>
body {
  background: #372940;
}
.demo {
  position: relative;
  margin: 120px auto;
  width: 150px;
}
.loader {
  position: absolute;
  opacity: .7;
}
.loader circle {
  -webkit-animation: draw 4s infinite ease-in-out;
          animation: draw 4s infinite ease-in-out;
  -webkit-transform-origin: center;
          transform-origin: center;
  -webkit-transform: rotate(⑼0deg);
          transform: rotate(⑼0deg);
}
.loader⑵ circle,
.loader⑹ circle {
  -webkit-animation-delay: 1s;
          animation-delay: 1s;
}
.loader⑺ circle {
  -webkit-animation-delay: 2s;
          animation-delay: 2s;
}
.loader⑷ circle,
.loader⑻ circle {
  -webkit-animation-delay: 3s;
          animation-delay: 3s;
}
.loader⑶ {
  left: ⑴50px;
  -webkit-transform: rotateY(180deg);
          transform: rotateY(180deg);
}
.loader⑹,
.loader⑺,
.loader⑻ {
  left: ⑴50px;
  -webkit-transform: rotateX(180deg) rotateY(180deg);
          transform: rotateX(180deg) rotateY(180deg);
}
.loader⑸ circle {
  opacity: .2;
}
@-webkit-keyframes draw {
  50% {
    stroke-dashoffset: 0;
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
  }
}
@keyframes draw {
  50% {
    stroke-dashoffset: 0;
    -webkit-transform: scale(0.5);
            transform: scale(0.5);
  }
}
  </style>

编码:

<div class="demo">
  <svg class="loader">
    <filter id="blur">
      <fegaussianblur in="SourceGraphic" stddeviation="2"></fegaussianblur>
    </filter>
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="#F4F519" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑵">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="#DE2FFF" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑶">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="#FF5932" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑷">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="#E97E42" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑸">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="white" stroke-width="6" stroke-linecap="round" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑹">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="#00DCA3" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑺">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="purple" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
  <svg class="loader loader⑻">
    <circle cx="75" cy="75" r="60" fill="transparent" stroke="#AAEA33" stroke-width="6" stroke-linecap="round" stroke-dasharray="385" stroke-dashoffset="385" filter="url(#blur)"></circle>
  </svg>
</div>

总结

以上所述是网编给大伙儿详细介绍的css制做收拢圆环转动实际效果案例编码,期待对大伙儿有一定的协助,假如大伙儿有任何疑惑请给我留言,网编会立即回应大伙儿的。在此也十分谢谢大伙儿对脚本制作之家网站的适用!