css实现六边形加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:css实现六边形加载动画效果代码

代码标签: 加载 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">


  
  
<style>
* {
  box-sizing: border-box;
}

body {
  background: #222a2c;
}

.wrapper {
  position: relative;
  margin: 50px auto;
  width: 200px;
  height: 200px;
}

.slice {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  border: 100px solid transparent;
  border-left-width: 58px;
  border-right-width: 58px;
  border-top-color: #42d2b0;
  transform: translate(-50%, -50%);
}
.slice:nth-child(1) {
  border-top-color: #42d2b0;
  transform: translate(-50%, -50%) rotate(0deg) scale(0);
  animation: sparkleLoad-1 2s 0.07s infinite;
}
.slice:nth-child(2) {
  border-top-color: #42d2c8;
  transform: translate(-50%, -50%) rotate(60deg) scale(0);
  animation: sparkleLoad-2 2s 0.14s infinite;
}
.slice:nth-child(3) {
  border-top-color: #42c4d2;
  transform: translate(-50%, -50%) rotate(120deg) scale(0);
  animation: sparkleLoad-3 2s 0.21s infinite;
}
.slice:nth-child(4) {
  border-top-color: #42acd2;
  transform: translate(-50%, -50%) rotate(180deg) scale(0);
  animation: sparkleLoad-4 2s 0.28s infinite;
}
.slice:nth-child(5) {
  border-top-color: #4294d2;
  transform: translate(-50%, -50%) rotate(240deg) scale(0);
  animation: sparkleLoad-5 2s 0.35s infinite;
}
.slice:nth-child(6) {
  border-top-color: #427cd2;
  transform: translate(-50%, -50%) rotate(300deg) scale(0);
  animation: sparkleLoad-6 2s 0.42s infinite;
}

@keyframes sparkleLoad-1 {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0);
  }
  25%,
		75% {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(0deg) scale(0);
  }
}
@keyframes sparkleLoad-2 {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) rotate(60d.........完整代码请登录后点击上方下载按钮下载查看

网友评论0