div+css实现红色阶梯起伏动画效果代码
代码语言:html
所属分类:动画
代码描述:div+css实现红色阶梯起伏动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> :root { --background-color: black; } @property --bg { syntax: "<percentage>"; inherits: false; initial-value: 0%; } body { padding: 0; margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--background-color); perspective: 30rem; transform-style: preserve-3d; } .scene { max-width: 60rem; width: 100%; display: flex; flex-direction: column; gap: .5rem; transform: rotateX(40deg) translateZ(-2rem) translateY(-40%); div { position: relative; height: 100%; min-height: calc(5rem * var(--Q)); overflow: hidden; perspective: 90rem; transform-style: preserve-3d; } i { display: block; width: 100%; height: 5rem; position: absolute; background: linear-gradient(90deg, red 0%, black var(--bg), rgb(140, 4, 4) 0%); opacity: 0; top: -5rem; animation: move var(--T) linear infinite, bgAnimation var(--T) linear infinite alternate-reverse; animation-delay: calc(var(--T) / var(--Q) * (var(--i) - 1) - 14s), calc(va.........完整代码请登录后点击上方下载按钮下载查看
网友评论0