دوران الصندوق

دوران الصندوق

html

<div class="box">
    <div class="top"></div>
    <div class="box-inner">
        <span style="--i:0;">سبحان الله</span>
        <span style="--i:1;">الحمد لله</span>
        <span style="--i:2;">لا اله الا الله</span>
        <span style="--i:3;">الله أكبر</span>
    </div>
    <div class="bottom"></div>
</div>

css

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body{
    background-color: #2980b9; 
    font-family: Tahoma;
    height: 100vh; 
    display: grid;
    place-items: center;
}

.box {
    position: relative;
    width: 300px;
    height: 300px;
    transform-style: preserve-3d;
    animation: rotation 4s linear infinite;
}
@keyframes rotation {
    0% {
        transform: rotateX(-30deg) rotateY(0);
    }
    100% {
        transform: rotateX(-30deg) rotateY(-360deg);
    }
}

.top {
    position: absolute;
    top: 0;
    left: 0;
    width: 300px;
    height: 300px;
    background-color: black;
    transform: rotateX(90deg) translateZ(150px);
}
.box-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}
.box-inner span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    color: #fff;
    background-image: linear-gradient(black 5%, #d35400 100%);
    transform: rotateY(calc(90deg * var(--i))) translateZ(150px);
}
.bottom {
    border-radius: 20px;
    position: absolute;
    bottom: 0;
    left: 0;
    opacity: 0.7;
    filter: blur(50px);
    width: 300px;
    height: 300px;
    background-color: #d35400;
    transform: rotateX(90deg) translateZ(-350px);
}