cs实现动画无延迟效果

代码语言:html

所属分类:动画

代码描述:cs实现动画无延迟效果

代码标签: 延迟 效果

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


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<style>
* {
  box-sizing: border-box;
}
:root {
  --delay: 0;
  --duration: 2;
  --stagger-step: 0;
  --coefficient: 1;
  --offset: 0;
}
body {
  background: linear-gradient(-45deg, #111, #444);
  min-height: 100vh;
  display: -webkit-box;
  display: flex;
  color: #fff;
  -webkit-box-align: center;
          align-items: center;
  font-family: sans-serif;
  -webkit-box-pack: center;
          justify-content: center;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
          flex-direction: column;
  text-align: center;
}
pre {
  background: #000;
  font-weight: bold;
  padding: 1rem;
  border-radius: 6px;
}
.block {
  -webkit-animation: party calc(var(--duration, 1) * 1s) linear infinite;
          animation: party calc(var(--duration, 1) * 1s) linear infinite;
  -webkit-animation-delay: calc((((var(--delay, 0) + (var(--index) * var(--stagger-step))) + var(--offset)) * var(--coefficient)) * 1s);
          animation-delay: calc((((var(--delay, 0) + (var(--index) * var(--stagger-step))) + var(--offset)) * var(--coefficient)) * 1s);
  background: #000;
  padding-top: 100%;
}
.container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-gap: 1vmin;
  width: 25vmin;
  margin: 4rem 0;
}
h1,
p,
pre {
  display: none;
  text-align: left;
  max-width: 550px;
}
code {
  line-height: 1.75;
  display: block;
}
[hidden] * {
  -webkit-animation: none;
          animation: none;
}
@-webkit-keyframes party {
  0% {
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0