<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
@keyframes move {
100% {
transform: rotateY(360deg);
}
}
body {
perspective: 600px;
}
.box {
position: relative;
width: 200px;
height: 200px;
margin: 1000px auto;
transform-style: preserve-3d;
animation: move 1s linear infinite;
animation-play-state:running;
}
.box:hover {
animation-play-state: paused;
}
.box div {
position: absolute;
transform: translate(-50%, -50%);
width: 200px;
height: 200px;
background-color: pink;
}
.box .one {
transform: translateZ(300px);
}
.box .two {
transform: rotateY(60deg) translateZ(300px);
}
.box .three {
transform: rotateY(120deg) translateZ(300px);
}
.box .six {
transform: translateZ(-300px);
}
.box .four {
transform: rotateY(60deg) translateZ(-300px);
}
.box .five {
transform: rotateY(120deg) translateZ(-300px);
}
</style>
</head>
<body>
<div class="box">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
<div class="five"></div>
<div class="six"></div>
</div>
</body>
</html>