先上效果(只截了图,懒得录屏了):
直接上代码:
图片路径需要替换成自己的
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style type="text/css">
* {
padding: 0;
margin: 0;
}
.box {
width: 400px;
height: 400px;
/* border: 5px solid gray;
box-shadow: 0 0 10px rgb(59, 57, 57); */
margin: 200px auto;
position: relative;
transform-style: preserve-3d;
animation: box-run 8s linear 1s infinite;
}
.box:hover {
animation-play-state: paused;
}
.box div {
width: 200px;
height: 200px;
line-height: 200px;
text-align: center;
position: absolute;
left: 50%;
top: 50%;
margin-left: -100px;
margin-top: -100px;
/* box-shadow: 0 0 5px rgb(111, 108, 108); */
}
.box div:nth-child(1) {
background-image: url(./picture/lifangti/3D绘画+女仆+美腿+黑丝+高跟鞋+两位女仆进门后的一幕+4k动漫壁纸_彼岸图网.jpg);
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: -80px;
transform: translateZ(100px);
}
.box div:nth-child(2) {
background-image: url(./picture/lifangti/93123c38ba684d9b80d090ac7dc85235.jpg);
background-position: -50px;
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
box-shadow: 0 0 5px rgb(0, 0, 0);
transform: translateX(-100px) rotateY(-90deg);
}
.box div:nth-child(3) {
background-image: url(./picture/lifangti/cf手游穿越火线+秋天+落叶+粉色百褶裙美女晴雅4k游戏壁纸3840x2160_彼岸图网.jpg);
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: -100px;
box-shadow: 0 0 5px rgb(0, 0, 0);
transform: translateY(-100px) rotateX(90deg);
}
.box div:nth-child(4) {
background-image: url(./picture/lifangti/Vivo\ X\ Fold内置蝴蝶高清4k电脑壁纸_彼岸图网.jpg);
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: -80px;
box-shadow: 0 0 150px rgb(45, 45, 45),
0 0 90px rgb(29, 27, 27),
0 0 40px rgb(0,0,0);
transform: translateY(100px) rotateX(-90deg);
}
.box div:nth-child(5) {
background-image: url(./picture/lifangti/两个女仆\ 女仆装\ 黑裤袜\ 黑色高跟鞋\ 油灯\ 楼梯4k动漫壁纸_彼岸图网.jpg);
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: -50px;
box-shadow: 0 0 5px rgb(0, 0, 0);
transform: translateX(100px) rotateY(90deg);
}
.box div:nth-child(6) {
background-image: url(./picture/lifangti/睡在沙发上的美女+白色睡衣+好看身材4k美女壁纸_彼岸图网.jpg);
background-attachment: fixed;
background-repeat: no-repeat;
background-size: cover;
background-position: -50px;
box-shadow: 0 0 5px rgb(0, 0, 0);
transform: translateZ(-100px);
}
@keyframes box-run {
0%{
transform: rotateY(0deg) rotateX(-30deg);
}
12.5%{
transform: rotateY(90deg) rotateX(-30deg);
}
25%{
transform: rotateY(90deg) rotateX(-30deg);
}
37.5%{
transform: rotateY(180deg) rotateX(30deg);
}
50%{
transform: rotateY(180deg) rotateX(30deg);
}
62.5%{
transform: rotateY(270deg) rotateX(-30deg);
}
75%{
transform: rotateY(270deg) rotateX(-30deg);
}
87.5%{
transform: rotateY(360deg) rotateX(30deg);
}
100%{
transform: rotateY(360deg) rotateX(30deg);
}
}
</style>
</head>
<body>
<div class="box">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</body>
</html>