效果图
直接上代码(复制可用)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<style>
body{
perspective: 800px;
background-color: #eee;
}
section{
position:absolute;
width: 200px;
height: 100px;
transform-style: preserve-3d;
top:50%;
left:45%;
margin: 220px auto;
animation: totate 10s linear infinite,move 0.3s steps(8) infinite;
transition: all 1s;
background: url(./bpdx.png) no-repeat;
}
div{
position:absolute;
width: 100%;
height: 100%;
background: url(./bpdx.png) no-repeat;
animation: move 1s steps(8) infinite;
transition: all 1s;
}
div:nth-child(1){
transform:rotateY(0) translateZ(300px)
}
div:nth-child(2){
transform:rotateY(60deg) translateZ(300px)
}
div:nth-child(3){
transform:rotateY(120deg) translateZ(300px)
}
div:nth-child(4){
transform:rotateY(180deg) translateZ(300px)
}
div:nth-child(5){
transform:rotateY(240deg) translateZ(300px)
}
div:nth-child(6){
transform:rotateY(300deg) translateZ(300px)
}
@keyframes totate {
0%{
transform: rotateY(0deg);
}
100%{
transform: rotateY(360deg);
}
}
@keyframes move {
0%{
background-position: 0;
}
100%{
background-position: -1600px;
}
}
</style>
<body>
<section>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</section>
</body>
</html>
素材图(透明背景图,加底色才看的明显)
