div+css实现无限循环的小球下楼梯loading加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:div+css实现无限循环的小球下楼梯loading加载动画效果代码

代码标签: div css 无限 循环 小球 楼梯 loading 加载 动画

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

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

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

  
  
<style>
:root {
  --size: 4.17vh;
  --main-color: #2B2B2B;
  --border-color: #fff;
  --jump-duration: 1s;
  --stairs-duration: 1s;
}

html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--main-color);
}

.window {
  position: relative;
  width: 35.42vh;
  height: 50vh;
  background-color: #fff;
  border-radius: 17.7vh;
  border: 0.42vh solid var(--main-color);
  box-shadow: 0 0 0 1.25vh var(--border-color);
  overflow: hidden;
}

.window:before {
  content: "";
  position: absolute;
  top: calc(50% - 1.5vh);
  left: calc(50% - 0.5vh);
  border-radius: 50%;
  width: var(--size);
  height: var(--size);
  background-image: linear-gradient(to bottom right, #2E3691, #2E3691);
  box-shadow: 0.21vh -0.21vh 0.42vh 0.42vh rgba(0, 0, 0, 0.35),
  inset -0.31vh 0.31vh 0.21vh 0.1vh rgba(0, 0, 0, 0.75);
  animation: jump var(--jump-duration) ease-in-out infinite,
  gradientChange  12s infinite 0.5s;
}

@keyframes jump {
  0%, 100% {
    transform: translateY(-0.20vh);
  }
  50% {
    transform: translateY(-4vh);
  }
}

@keyframes gradientChange {
  0% {
    background-image: linear-gradient(to bottom right, #2E3691, #485A8B);
  }
  8.33% {
    background-image: linear-gradient(to bottom right, #485A8B, #9B2A89);
  }
  16.66% {
    background-image: linear-gradient(to bottom right, #9B2A89, #E6194D);
  }
  25% {
    background-image: linear-gradient(to bottom right, #E6194D, #F31C26);
  }
  33.33% {
    background-image: linear-gradient(to bottom right, #F31C26, #F27E1E);
  }
  41.66% {
    background-image: linear-gradient(to bottom right, #F27E1E, #FFC80D);
  }
  50% {
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0