@keyframes flash {
0%{ transform: rotateY(0) rotateX(0); }
100%{ transform: rotateY(360deg) rotateX(360deg); }
}
.box {
width: 100px;
height: 100px;
position: relative;
margin: 100px auto 0;
transform-style: preserve-3d;
animation: flash 3s linear infinite;
}
.box > div {
position: absolute;
width: 100px;
height: 100px;
transition: all 1s;
}
.box>div:nth-of-type(1){ background: lightblue; }
.box>div:nth-of-type(2){ background: lime; }
.box>div:nth-of-type(3){ background: lightseagreen; }
.box>div:nth-of-type(4){ background: orange; }
.box>div:nth-of-type(5){ background: darkorchid; }
.box>div:nth-of-type(6){ background: pink; }
.box>div:nth-of-type(1){ transform: translateZ(-50px); }
.box>div:nth-of-type(2){ transform: rotateX(90deg) translateZ(50px); }
.box>div:nth-of-type(3){ transform: rotateX(90deg) translateZ(-50px); }
.box>div:nth-of-type(4){ transform: rotateY(90deg) translateZ(50px);}
.box>div:nth-of-type(5){ transform: rotateY(90deg) translateZ(-50px);}
.box>div:nth-of-type(6){ transform: translateZ(50px); }
效果