svg+js+css实现加载进度条完整动画效果代码

代码语言:html

所属分类:进度条

代码描述:svg+js+css实现加载进度条完整动画效果代码

代码标签: svg js css 加载 进度条 完整 动画

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

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

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

  
  
<style>
:root {
  --font-base: "Space Mono", monospace;
  --color-dark: #1f1a38;
  --color-dark-glare: #989ea9;
  --color-success: #76f7bf;
}

body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background-image: repeating-linear-gradient(60deg, #fff 0, #eee, #fff 4px);
}

.credit {
  position: fixed;
  bottom: 1em;
}

.progressIndicator {
  width: 150px;
  aspect-ratio: 1;
  fill: none;
  stroke-width: 10;
}
.progressIndicator .base {
  stroke: var(--color-dark-glare);
  fill: transparent;
  transition: fill 1s;
}
.progressIndicator .progress {
  stroke: var(--color-dark);
  stroke-dasharray: calc(var(--progress, 0) * 4.15) 1000;
  rotate: -90deg;
  transform-origin: center;
  transition: stroke-dasharray 0.5s;
}
.progressIndicator text {
  font-family: var(--font-base);
  font-size: 32px;
  fill: #000;
  text-anchor: middle;
  alignment-baseline: middle;
}
.progressIndicator foreignObject {
  position: relative;
  width: 100%;
  height: 100%;
}
.progressIndicator foreignObject noscript {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 10px solid transparent;
  border-top-color: var(--color-dark);
  -webkit-animation: noscript 1s infinite linear;
          animation: noscript 1s infinite linear;
}
@-webkit-keyframes noscript {
  to {
    rotate: 1turn;
  }
}
@keyframes noscript {
  to {
    rotate: 1turn;
  }
}
.progressIndicator .checkmark {
  stroke: var(--color-dark);
  stroke-dasharray: 85;
  stroke.........完整代码请登录后点击上方下载按钮下载查看

网友评论0