css3d立方体波动动画效果
代码语言:html
所属分类:三维
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Cube Wave</title>
<style>
@-webkit-keyframes anim-scale {
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@keyframes anim-scale {
to {
-webkit-transform: scale3d(1, 1, 1);
transform: scale3d(1, 1, 1);
}
}
@-webkit-keyframes anim-rotate {
to {
-webkit-transform: rotate3d(0, 0, 1, 360deg);
transform: rotate3d(0, 0, 1, 360deg);
}
}
@keyframes anim-rotate {
to {
-webkit-transform: rotate3d(0, 0, 1, 360deg);
transform: rotate3d(0, 0, 1, 360deg);
}
}
:root {
--ids: direction, delay, mode, view, time, gap;
--length: 100;
}
*,
*::before,
*::after {
margin: 0;
border: 0;
padding: 0;
box-sizing: border-box;
}
#defs {
height: 0;
width: 0;
overflow: hidden;
position: absolute;
}
html,
body,
form,
section,
output,
li,
div,
span {
display: flex;
align-items: center;
flex-direction: column;
justify-content: center;
}
section,
output,
ul,
li,
div,
span {
-webkit-transform-style: preserve-3d;
transform-style: preserve-3d;
}
html {
width: 100vw;
height: 100vh;
background: #1b2a49;
}
body {
height: 100%;
width: 100%;
overflow: hidden;
position: relative;
background: #1b2a49;
-webkit-perspective: 170vmin;
perspective: 170vmin;
}
form.direction li:nth-of-type(n + 1):nth-of-type(-n + 11) {
--delay: 0s;
}
form.direction li:nth-of-type(n + 11):nth-of-type(-n + 21) {
--delay: 0.0555555556s;
}
form.direction li:nth-of-type(n + 21):nth-of-type(-n + 31) {
--delay: 0.1111111111s;
}
form.direction li:nth-of-type(n + 31):nth-of-type(-n + 41) {
--delay: 0.1666666667s;
}
form.direction li:nth-of-type(n + 41):nth-of-type(-n + 51) {
--delay: 0.2222222222s;
}
form.direction li:nth-of-type(n + 51):nth-of-type(-n + 61) {
--delay: 0.2777777778s;
}
form.direction li:nth-of-type(n + 61):nth-of-type(-n + 71) {
--delay: 0.3333333333s;
}
form.direction li:nth-of-type(n + 71):nth-of-type(-n + 81) {
--delay: 0.3888888889s;
}
form.direction li:nth-of-type(n + 81):nth-of-type(-n + 91) {
--delay: 0.4444444444s;
}
form.direction li:nth-of-type(n + 91):nth-of-type(-n + 101) {
--delay: 0.5s;
}
form.direction li:nth-of-type(n + 101):nth-of-type(-n + 111) {
--delay: 0.5555555556s;
}
form:not(.direction) li:nth-of-type(1) {
--delay: 0s;
}
form:not(.direction) li:nth-of-type(10) {
--delay: 0s;
}
form:not(.direction) li:nth-of-type(2) {
--delay: 0.0555555556s;
}
form:not(.direction) li:nth-of-type(11) {
--delay: 0.0555555556s;
}
form:not(.direction) li:nth-of-type(20) {
--delay: 0.0555555556s;
}
form:not(.direction) li:nth-of-type(3) {
--delay: 0.1111111111s;
}
form:not(.direction) li:nth-of-type(12) {
--delay: 0.1111111111s;
}
form:not(.direction) li:nth-of-type(21) {
--delay: 0.1111111111s;
}
form:not(.direction) li:nth-of-type(30) {
--delay: 0.1111111111s;
}
form:not(.direction) li:nth-of-type(4) {
--delay: 0.1666666667s;
}
form:not(.direction) li:nth-of-type(13) {
--delay: 0.1666666667s;
}
form:not(.direction) li:nth-of-type(22) {
--delay: 0.1666666667s;
}
form:not(.direction) li:nth-of-type(31) {
--delay: 0.1666666667s;
}
form:not(.direction) li:nth-of-type(40) {
--delay: 0.1666666667s;
}
form:not(.direction) li:nth-of-type(5) {
--delay: 0.2222222222s;
}
form:not(.direction) li:nth-of-type(14) {
--delay: 0.2222222222s;
}
form:not(.direction) li:nth-of-type(23) {
--delay: 0.222222.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0