<div class="loading">
    <div class="clockwise">
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
        <div></div>
    </div>
    <div>In progress</div>
</div>
<style>
    body {
        background-color: antiquewhite;
        margin: 0;
    }

    .loading {
        display: flex;
        width: 1080px;
        height: 1920px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .loading>div:nth-child(2) {
        margin-top: 50px;
        /* margin-left: 5px; */
        font-size: 64px;
    }

    .clockwise {
        width: 512px;
        height: 512px;
    }

    .clockwise,
    .clockwise>div {
        position: relative;

        box-sizing: border-box;
    }

    .clockwise {
        display: block;
        font-size: 0;
        color: #fff;
    }


    .clockwise>div {
        display: inline-block;
        float: none;
        background-color: currentColor;
        border: 0 solid currentColor;
    }



    .clockwise>div {
        position: absolute;
        top: 50%;
        left: 50%;
        width: 128px;
        height: 128px;
        margin-top: -4px;
        margin-left: -4px;
        border-radius: 100%;

        animation: ball-spin-clockwise 10s infinite ease-in-out;
    }

    .clockwise>div:nth-child(1) {
        top: 5%;
        left: 50%;

        animation-delay: -2s;
    }

    .clockwise>div:nth-child(2) {
        top: 18.1801948466%;
        left: 81.8198051534%;

        animation-delay: -5s;
    }

    .clockwise>div:nth-child(3) {
        top: 50%;
        left: 95%;

        animation-delay: -.625s;
    }

    .clockwise>div:nth-child(4) {
        top: 81.8198051534%;
        left: 81.8198051534%;

        animation-delay: -.5s;
    }

    .clockwise>div:nth-child(5) {
        top: 94.9999999966%;
        left: 50.0000000005%;

        animation-delay: -.375s;
    }

    .clockwise>div:nth-child(6) {
        top: 81.8198046966%;
        left: 18.1801949248%;

        animation-delay: -.25s;
    }

    .clockwise>div:nth-child(7) {
        top: 49.9999750815%;
        left: 5.0000051215%;

        animation-delay: -.125s;
    }

    .clockwise>div:nth-child(8) {
        top: 18.179464974%;
        left: 18.1803700518%;

        animation-delay: 0s;
    }


    @keyframes ball-spin-clockwise {

        0%,
        100% {
            opacity: 1;

            transform: scale(1);
        }

        20% {
            opacity: 1;
            border: 3px solid black;
        }

        80% {
            opacity: 0;
            border: 3px solid green;

            transform: scale(0);
        }
        100% {
            border: 3px solid red;
        }
    }
</style>

 

posted on 2023-07-18 18:01  码农-编程小子  阅读(6)  评论(0编辑  收藏  举报