div+css实现圈圈转动loading加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:div+css实现圈圈转动loading加载动画效果代码

代码标签: div css 圈圈 转动 loading 加载 动画

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

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

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

  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  
  
  
<style>
* {
  border: 0;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --hue: 223;
  --bg: hsl(var(--hue),10%,90%);
  --fg: hsl(var(--hue),10%,10%);
  --trans-dur: 0.3s;
  --ease-in: cubic-bezier(0.12,0,0.39,0);
  --ease-out: cubic-bezier(0.61,1,0.88,1);
  font-size: calc(14px + (30 - 14) * (100vw - 280px) / (3840 - 280));
}

body {
  background-color: var(--bg);
  color: var(--fg);
  display: grid;
  place-items: center;
  font: 1em/1.5 sans-serif;
  height: 100vh;
  transition: background-color var(--trans-dur), color var(--trans-dur);
}

.pl {
  filter: drop-shadow(0 0.1875em 0.0625em hsla(var(--hue), 10%, 10%, 0.5));
  position: relative;
  width: 12em;
  height: 12em;
}
.pl__eye {
  top: 50%;
  left: 50%;
  width: 2em;
  height: 2em;
}
.pl__eye, .pl__eye:before, .pl__eye:after {
  position: absolute;
}
.pl__eye:before, .pl__eye:after {
  animation-duration: 0.72s;
  animation-iteration-count: infinite;
  border-radius: 50%;
  box-shadow: 0 0 0 1em var(--fg) inset;
  content: "";
  display: block;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.pl__eye:before {
  animation-name: ring-out;
  animation-timing-function: var(--ease-in);
}
.pl__eye:after {
  animation-name: circle-in;
  animation-timing-function: var(--ease-out);
  transform-origin: 50% 25%;
}
.pl__eye:nth-child(1) {
  transform: translate3d(-50%, -50%, 0) rotate(0deg) translate3d(0, 5em, 0);
}
.pl__eye:nth-child(1):before, .pl__eye:nth-child(1):after {
  animation-delay: 0s;
}
.pl__eye:nth-child(2) {
  transform: translate3d(-50%, -50%, 0) rotate(-30deg) translate3d(0, 5em, 0);
}
.pl__eye:nth-child(2):before, .pl__eye:nth-child(2):after {
  animation-delay: -0.12s;
}
.pl__eye:nth-child(3) {
  transform: translate3d(-50%, -50%, 0) rotate(-60deg) translate3d(0, 5em, 0);
}
.pl__eye:nth-child(3):before, .pl__eye:nth-child(3):after {
  animation-delay: -0.24s;
}
.pl__eye:nth-child(4) {
  transform: translate3d(-50%, -50%, 0) rotate(-90deg) translate3d(0, 5em, 0);
}
.pl__eye:nth-child(4):before, .pl__eye:nth-child(4):after {
  animation-delay: -0.36s;
}
.pl__eye:nth-child(5) {
  transform: translate3d(-50%, -50%, 0) rotate(-120deg) translate3d(0, 5em, 0);
}
.pl__eye:nth-child(5):before, .pl__eye:nth-child(5):after {
  animation-delay: -0.48s;
}
.pl__eye:nth-child(6) {
  transform: translate3d(-50%, -50%, 0) rotate(-150deg) translate3d(0, 5em, 0);
}
.pl__eye:nth-child(6):before, ..........完整代码请登录后点击上方下载按钮下载查看

网友评论0