<!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>
.box {
width: 200px;
height: 200px;
margin: 200px auto;
perspective: 2000px;
perspective-origin: 400px 400px;
}
.container {
width: 200px;
height: 200px;
transform-style: preserve-3d;
position: relative;
animation: zhuan 4s linear infinite;
}
.container:hover .item:nth-child(1) {
transform: translateZ(300px);
}
.container:hover .item:nth-child(2) {
transform: rotateY(90deg) translateZ(300px);
}
.container:hover .item:nth-child(3) {
transform: rotateY(-90deg) translateZ(300px);
}
.container:hover .item:nth-child(4) {
transform: rotateY(180deg) translateZ(300px);
}
.container:hover .item:nth-child(5) {
transform: rotateX(90deg) translateZ(300px);
}
.container:hover .item:nth-child(6) {
transform: rotateX(-90deg) translateZ(300px);
}
@keyframes zhuan {
0% {
transform: rotateX(0deg) rotateY(0deg);
}
100% {
transform: rotateX(360deg) rotateY(360deg);
}
}
.item {
width: 200px;
height: 200px;
position: absolute;
transition: 1s;
}
.item:nth-child(1) {
background: url('./权志龙.jpg') 0 0 no-repeat;
background-size: 200px 200px;
transform: translateZ(100px);
}
.item:nth-child(7) {
background: url('./权志龙.jpg') 0 0 no-repeat;
background-size: 200px 200px;
transform: translateZ(100px);
}
.item:nth-child(2) {
background: url('./全智贤.jpg');
background-size: 200px 200px;
transform: rotateY(90deg) translateZ(100px);
}
.item:nth-child(8) {
background: url('./全智贤.jpg');
background-size: 200px 200px;
transform: rotateY(90deg) translateZ(100px);
}
.item:nth-child(3) {
background: url('./朴信惠.jpg');
background-size: 200px 200px;
transform: rotateY(-90deg) translateZ(100px);
}
.item:nth-child(9) {
background: url('./朴信惠.jpg');
background-size: 200px 200px;
transform: rotateY(-90deg) translateZ(100px);
}
.item:nth-child(4) {
background: url('./李易峰.jpg');
background-size: 200px 200px;
transform: rotateY(180deg) translateZ(100px);
}
.item:nth-child(10) {
background: url('./李易峰.jpg');
background-size: 200px 200px;
transform: rotateY(180deg) translateZ(100px);
}
.item:nth-child(5) {
background: url('./梁洁.jpg');
background-size: 200px 200px;
transform: rotateX(90deg) translateZ(100px);
}
.item:nth-child(11) {
background: url('./梁洁.jpg');
background-size: 200px 200px;
transform: rotateX(90deg) translateZ(100px);
}
.item:nth-child(6) {
background: url('./胡歌.jpg');
background-size: 200px 200px;
transform: rotateX(-90deg) translateZ(100px);
}
.item:nth-child(12) {
background: url('./胡歌.jpg');
background-size: 200px 200px;
transform: rotateX(-90deg) translateZ(100px);
}
</style>
</head>
<body>
<div class="box">
<div class="container">
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
<div class="item">
</div>
</div>
</div>
</body>
</html>