svg+css实现芯片集成电路loading加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:svg+css实现芯片集成电路loading加载动画效果代码

代码标签: svg cs 芯片 集成 电路 loading 加载 动画

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

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

<head>
  <meta charset="UTF-8">
  
  
  
  
<style>
* {
  border: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --hue: 153;
  --primary1: hsl(var(--hue),90%,90%);
  --primary3: hsl(var(--hue),90%,70%);
  --primary7: hsl(var(--hue),90%,30%);
  --primary9: hsl(var(--hue),90%,10%);
  --trans-dur: 0.3s;
  font-size: clamp(1rem,0.8rem + 1vw,2rem);
}

body {
  background-color: var(--primary9);
  color: var(--primary1);
  display: flex;
  font: 1em/1.5 sans-serif;
  height: 100vh;
  transition: background-color var(--trans-dur), color var(--trans-dur);
}

.microchip {
  display: block;
  margin: auto;
  width: 8em;
  height: auto;
}
.microchip__center, .microchip__dot, .microchip__line, .microchip__lines, .microchip__spark, .microchip__wave {
  animation-duration: 5s;
  animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
  animation-iteration-count: infinite;
}
.microchip__core, .microchip__dot {
  fill: var(--primary7);
  transition: fill var(--trans-dur);
}
.microchip__center, .microchip__wave {
  transform-origin: 25px 25px;
}
.microchip__center {
  animation-name: center-scale;
}
.microchip__dot--1 {
  animation-name: dot-scale1;
  transform-origin: 3px 38px;
}
.microchip__dot--2 {
  animation-name: dot-scale2;
  transform-origin: 3px 54px;
}
.microchip__dot--3 {
  animation-name: dot-scale3;
  transform-origin: 3px 70px;
}
.microchip__dot--4 {
  animation-name: dot-scale4;
  transform-origin: 3px 3px;
}
.microchip__dot--5 {
  animation-name: dot-scale5;
  transform-origin: 20px 3px;
}
.microchip__dot--6 {
  animation-name: dot-scale6;
  transform-origin: 3px 30px;
}
.microchip__dot--7 {
  animation-name: dot-scale7;
  transform-origin: 37px 3px;
}
.microchip__dot--8 {
  animation-name: dot-scale8;
  transform-origin: 54px 3px;
}
.microchip__dot--9 {
  animation-name: dot-scale9;
  transform-origin: 71px 3px;
}
.microchip__line, .microchip__spark, .microchip__wave {
  transition: stroke var(--trans-dur);
}
.microchip__line {
  stroke: var(--primary7);
}
.microchip__line--1 {
  animation-name: line-draw1;
}
.microchip__line--2 {
  animation-name: line-draw2;
}
.microchip__line--3 {
  animation-name: line-draw3;
}
.microchip__line--4 {
  animation-name: line-draw4;
}
.microchip__line--5 {
  animation-name: line-draw5;
}
.microchip__line--6 {
  animation-name: line-draw6;
}
.microchip__line--7 {
  animation-name: line-draw7;
}
.microchip__line--8 {
  animation-name: line-draw8;
}
.microchip__line--9 {
  animation-name: line-draw9;
}
.microchip__lines {
  animation-name: lines-scale;
  transform-origin: 54px 54px;
}
.microchip__spark, .microchip__wave {
  animation-timing-function: linear;
  stroke: var(--primary3);
}
.microchip__spark--1 {
  animation-name: spark1;
}
.microchip__spark--2 {
  animation-name: spark2;
}
.microchip__spark--3 {
  animation-name: spark3;
}
.microchip__spark--4 {
  animation-name: spark4;
}
.microchip__spark--5 {
  animation-name: spark5;
}
.microchip__spark--6 {
  animation-name: spark6;
}
.microchip__spark--7 {
  animation-name: spark7;
}
.microchip__spark--8 {
  animation-name: spark8;
}
.microchip__spark--9 {
  animation-name: spark9;
}
.microchip__wave--1 {
  animation-name: wave-scale1;
}
.microchip__wave--2 {
  animation-name: wave-scale2;
}

/* Animations */
@keyframes center-scale {
  from, to {
    transform: scale(0);
  }
  12.5%, 75% {
    transform: scale(1);
  }
}
@keyframes dot-scale1 {
  from, 20%, 81.25%, to {
    transform: scale(0);
  }
  32.5%, 68.75% {
    transform: scale(1);
  }
}
@keyframes dot-scale2 {
  from, 10.5%, 87.5%, to {
    transform: scale(0);
  }
  23%, 75% {
    transform: scale(1);
  }
}
@keyframes dot-scale3 {
  from, 20%, 81.25%, to {
    transform: scale(0);
  }
  32.5%, 68.75% {
    transform: scale(1);
  }
}
@keyframes dot-scale4 {
  from, 20%, 81.25%, to {
    transform: scale(0);
  }
  32.5%, 68.75% {
    transform: scale(1);
  }
}
@keyframes dot-scale5 {
  from, 11.5%, 87.5%, to {
    transform: scale(0);
  }
  24%, 75% {
    transform: scale(1);
  }
}
@keyframes dot-scale6 {
  from, 14.5%, 85%, to {
    transform: scale(0);
  }
  27%, 72.5% {
    transform: scale(1);
  }
}
@keyframes dot-scale7 {
  from, 20%, 81.25%, to {
    transform: scale(0);
  }
  32.5%, 68.75% {
    transform: scale(1);
  }
}
@keyframes dot-scale8 {
  from, 11%, 87.5%, to {
    transform: scale(0);
  }
  23.5%, 75% {
    transform: scale(1);
  }
}
@keyframes dot-scale9 {
  from, 20%, 81.25%, to {
    transform: scale(0);
  }
  32.5%, 68.75% {
    transform: scale(1);
  }
}
@keyframes line-draw1 {
  from, 93.75%, to {
    stroke-dashoffset: 59;
  }
  25%, 68.75% {
    stroke-dashoffset: 17;
  }
}
@keyframes line-draw2 {
  from, 93.75%, to {
    stroke-dashoffset: 42;
  }
  25%, 68.75% {
    stroke-dashoffset: 0;
  }
}
@keyframes line-draw3 {
  from, 93.75%, to {
    stroke-dashoffset: 59;
  }
  25%, 68.75% {
    stroke-dashoffset: 17;
  }
}
@keyframes line-draw4 {
  from, 93.75%, to {
    stroke-dashoffset: 78;
  }
  25%, 68.75% {
    stroke-dashoffset: 18;
  }
}
@keyframes line-draw5 {
  from, 93.75%, to {
    stroke-dashoffset: 60;
  }
  25%, 68.75% {
    stroke-dashoffset: 0;
  }
}
@keyframes line-draw6 {
  from, 93.75%, to {
    stroke-dashoffset: 91;
  }
  25%, 68.75% {
    stroke-dashoffset: 31;
  }
}
@keyframes line-draw7 {
  from, 93.75%, to {
    stroke-dashoffset: 60;
  }
  25%, 68.75% {
    stroke-dashoffset: 17;
  }
}
@keyframes line-draw8 {
  from, 93.75%, to {
    stroke-dashoffset: 43;
  }
  25%, 68.75% {
    stroke-dashoffset: 0;
  }
}
@keyframes line-draw9 {
  from, 93.75%, to {
    stroke-dashoffset: 60;
  }
  25%, 68.75% {
    stroke-dashoffset: 17;
  }
}
@keyframes lines-scale {
  from {
    opacity: 1;
    transform: scale(0);
  }
  12.5%, 75% {
    opacity: 1;
    transform: scale(1);
  }
  93.75%, to {
    opacity: 0;
    transform: scale(0.5);
  }
}
@keyframes spark1 {
  from, 27.5% {
    stroke-dashoffset: 59;
  }
  50%, 52.5% {
    stroke-dashoffset: -25;
  }
  75%, to {
    stroke-dashoffset: -109;
  }
}
@keyframes spark2 {
  from, 27.5% {
    stroke-dashoffset: 42;
  }
  50%, 52.5% {
    stroke-dashoffset: -42;
  }
  75%, to {
    stroke-dashoffset: -126;
  }
}
@keyframes spark3 {
  from, 27.5% {
    stroke-dashoffset: 59;
  }
  50%, 52.5% {
    stroke-dashoffset: -25;
  }
  75%, to {
    stroke-dashoffset: -109;
  }
}
@keyframes spark4 {
  from, 27.5% {
    stroke-dashoffset: 78;
  }
  50%, 52.5% {
    stroke-dashoffset: -42;
  }
  75%, to {
    stroke-dashoffset: -162;
  }
}
@keyframes spark5 {
  from, 27.5% {
    stroke-dashoffset: 60;
  }
  50%, 52.5% {
    stroke-dashoffset: -60;
  }
  75%, to {
    stroke-dashoffset: -180;
  }
}
@keyframes spark6 {
  from, 27.5% {
    stroke-dashoffset: 91;
  }
  50%, 52.5% {
    stroke-dashoffset: -29;
  }
  75%, to {
    stroke-dashoffset: -149;
  }
}
@keyframes spark7 {
  from, 27.5% {
    stroke-dashoffset: 60;
  }
  50%, 52.5% {
    stroke-dashoffse.........完整代码请登录后点击上方下载按钮下载查看

网友评论0