div+css实现方块loading加载动画效果代码

代码语言:html

所属分类:加载滚动

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

代码标签: div css 方块 loading 加载 动画

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


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

<head>

  <meta charset="UTF-8">

  
  
<style>
body,
html {
  width: 100%;
  height: 100%;
  margin: 0;
  background: #000;
}

.center {
  height: 100%;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.squares-container {
  display: inline-block;
  position: relative;
}
.squares-container .squares {
  font-size: 10px;
  display: grid;
  grid-template-columns: 10em 10em;
  grid-row: auto auto;
  grid-gap: 4em;
  animation: rotateSquares 5s infinite ease-in-out;
  transform-origin: center center;
  position: relative;
}
.squares-container .squares .square:not(.reflection) {
  position: relative;
  width: 10em;
  height: 10em;
  border-radius: 2em;
  animation: rotateSquare 5s infinite ease-in-out;
}
.squares-container .squares .square:not(.reflection):after {
  position: absolute;
  content: "";
  border-radius: 50%;
  width: 10px;
  height: 10px;
  display: block;
  animation: ballGravity 5s infinite ease-in-out;
}
.squares-container .squares .square:nth-child(1) {
  background: #111;
}
.squares-container .squares .square:nth-child(1):after {
  background: #e6a254;
}
.squares-container .squares .square:nth-child(2) {
  background: #de7a42;
}
.squares-container .squares .square:nth-child(2):after {
  background: #111;
}
.squares-container .squares .square:nth-child(3) {
  background: #e6a254;
}
.squares-container .squares .square:nth-child(3):after {
  background: #1b8ebb;
}
.squares-container .squares .square:nth-child(4) {
  background: #1b8ebb;
}
.squares-container .squares .square:nth-child(4):after {
  background: #de7a42;
}
@keyframes rotateSquares {
  0% {
    transform: rotate(0deg);
    grid-gap: 4em;
  }
  10% {
    grid-gap: 8em;
  }
  20% {
    transform: rotate(90deg);
    grid-gap: 4em;
  }
  25% {
    transform: rotate(90deg);
    grid-gap: 4em;
  }
  35% {
    grid-gap: 8em;
  }
  45% {
    transform: rotate(180deg);
    grid-gap: 4em;
  }
  50% {
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0