<!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: 400px;
height: 400px;
background: chartreuse;
margin: 100px auto;
transform-style: preserve-3d;
transform: rotateX(50deg) rotateY(50deg) rotateZ(50deg);
position: relative;
animation: run 3s linear infinite;
}
.box div:nth-child(1){
width: 400px;
height: 400px;
background: rgb(237, 228, 100);
position: absolute;
}
.box div:nth-child(2){
width: 400px;
height: 400px;
background: rgb(77, 216, 65);
position: absolute;
transform: translateZ(400px);
}
.box div:nth-child(3){
width: 400px;
height: 400px;
background: rgb(82, 211, 228);
transform: translateZ(200px) translateX(200px) rotateY(90deg);
position: absolute;
}
.box div:nth-child(4){
width: 400px;
height: 400px;
background: rgb(61, 77, 228);
transform: rotateY(90deg);
position: absolute;
transform: translateZ(200px) translateX(-200px) rotateY(90deg);
}
.box div:nth-child(5){
width: 400px;
height: 400px;
background: rgb(168, 98, 214);
transform: translateZ(200px) translatey(200px) rotateX(90deg);
position: absolute;
}
.box div:nth-child(6){
width: 400px;
height: 400px;
background: rgb(207, 56, 127);
transform: translateZ(200px) translatey(-200px) rotateX(90deg);
position: absolute;
}
@keyframes run {
0%{}
350%{transform: translate(100px,170px);}
70%{transform: translate(200px,100px)}
100%{transform: translate(500px,370px);}
}
</style>
</head>
<body>
<div class="box">
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</div>
</body>
</html>