*{
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body{
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #151F28;
}
.box:hover{
    animation-play-state: paused;
}
.box{
    position: relative;
    width: 200px;
    height: 300px;
    transform-style: preserve-3d;
    transform: perspective(1000px);
    animation: animate 30s linear infinite;
}
@keyframes animate {
    0%{
        transform: perspective(1000px) rotateY(0deg);
    }
    100%{
        transform: perspective(1000px) rotateY(360deg);
    }
}
.box span{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(240px);
}
.box span::before{
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.5);
}
.box span img{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}