css实现多米诺骨牌动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现多米诺骨牌动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap");
*, *::before, *::after {
padding: 0;
margin: 0 auto;
box-sizing: border-box;
}
body {
font-family: "Indie Flower", cursive;
background-color: #333;
color: #fff;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container {
position: relative;
width: 900px;
height: 600px;
border: 2px solid #fff;
background-image: linear-gradient(#456, #333 75%, #444 75%, #222);
perspective: 400px;
overflow: hidden;
}
.container h1 {
font-size: 60px;
font-weight: normal;
text-align: center;
padding: 2em 0.5em;
line-height: 0.75;
}
.floor {
position: absolute;
bottom: 0px;
width: 200px;
height: 400px;
background-color: #0003;
transform: rotateX(90deg);
transform-origin: bottom;
-webkit-animation: floors 16s infinite linear;
animation: floors 16s infinite linear;
}
.floor:nth-child(1) {
-webkit-animation-delay: -2.31s;
animation-delay: -2.31s;
}
.floor:nth-child(2) {
-webkit-animation-delay: -4.31s;
animation-delay: -4.31s;
}
.floor:nth-child(3) {
-webkit-animation-delay: -6.31s;
animation-delay: -6.31s;
}
.floor:nth-child(4) {
-webkit-animation-delay: -8.31s;
animation-delay: -8.31s;
}
.floor:nth-child(5) {
-webkit-animation-delay: -10.31s;
animation-delay: -10.31s;
}
.floor:nth-child(6) {
-webkit-animation-delay: -12.31s;
animation-delay: -12.31s;
}
.floor:nth-child(7) {
-webkit-animation-delay: -14.31s;
animation-delay: -14.31s;
}
.floor:nth-child(8) {
-webkit-animation-delay: -16.31s;
animation-delay: -16.31s;
}
@-webkit-keyframes floors {
from {
left: calc(50% - 1500px);
}
to {
left: calc(50% + 1700px);
}
}
@keyframes floors {
from {
left: calc(50% - 1500px);
}
to {
left: calc(50% + 1700px);
}
}
.shadow {
position: absolute;
bottom: 0px;
width: 60px;
height: 400px;
background-image: radial-gradient(#222, transparent 60%);
transform: rotateX(90deg) translateX(40px) scaleX(-1);
transform-origin: bottom left;
-webkit-animation: .........完整代码请登录后点击上方下载按钮下载查看
















网友评论0