css+div实现loading动画状态切换动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:css+div实现loading动画状态切换动画效果代码

代码标签: css div loading 动画 状态 切换 动画

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

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

<head>
  <meta charset="UTF-8">

  
  
  
<style>
.spinner {
  color: official;
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 9999px;
  overflow: hidden;
}
.spinner div {
  transform-origin: 40px 40px;
  animation: spinner 1.2s linear infinite;
}

.spinner svg {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.spinner svg path {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 0.25s cubic-bezier(0.32, 0, 0.67, 0);
  transition-delay: 0s;
}

.spinner.complete div {
  animation: none;
}

.spinner.complete div:after {
  width: 100px;
  height: 100px;

/*  Shrink blades then expand  */
/*   transition: all 0.5s cubic-bezier(0.36, 0, 0.66, -0.56); */
    transition: all 0.5s cubic-bezier(0.12, 0, 0.39, 0);
}

.spinner.complete svg path {
/*   transition-delay: 0.55s; */
    transition-delay: 0.3s;
}

.spinner.complete svg path {
  stroke-dashoffset: 0;
}

.spinner svg path[stroke-dasharray="0px 1px"] {
  stroke-opacity: 0;
}

.spinner div:after {
  content: " ";
  display: block;
  position: absolute;
  top: 3px;
  left: 37px;
  width: 6px;
  height: 18px;
  background: #fff;
  transition: all 0.2s ease-in-out;
}
.spinner div:nth-child(1) {
  transform: rotate(0deg);
  animation-delay: -1.1s;
}
.spinner div:nth-child(2) {
  transform: rotate(30deg);
  animation-delay: -1s;
}
.spinner div:nth-child(3) {
  transform: rotate(60deg);
  animation-delay: -0.9s;
}
.spinner div:nth-child(4) {
  transform: rotate(90deg);
  animation-delay: -0.8s;
}
.spinner div:nth-child(5) {
  transform: rotate(120deg);
  animation-delay: -0.7s;
}
.spinner div:nth-child(6) {
  transform: rotate(150deg);
  animation-delay: -0.6s;
}
.spinner div:nth-child(7) {
  transform: r.........完整代码请登录后点击上方下载按钮下载查看

网友评论0