美文网首页
手写转圈圈效果

手写转圈圈效果

作者: 肥羊猪 | 来源:发表于2021-04-21 15:18 被阅读0次
// html
<div class="loading-content">
    <div class="loading-dot"></div>
    <div class="loading-dot"></div>
    <div class="loading-dot"></div>
</div>
// css
.loading-content {
    display: flex;
    justify-content: center;
    .loading-dot {
        width: 20px;
        height: 20px;
        background: #8385aa;
        border-radius: 50%;
        margin: 150px  10px;
        animation: bouncing-animate 0.6s infinite alternate;
        &:nth-child(2) {
            animation-delay: 0.2s;
        }
        &:nth-child(3) {
            animation-delay: 0.4s;
        }
    }
}

@keyframes bouncing-animate {
    to {
        opacity: 0.1;
        transform: translate3d(0, -50px, 0);
    }
}
// html
<div class="donut"></div>

// css
.donut {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 4px solid rgba(0,0,0,0.1);
    margin: 30px;
    border-left-color: #7983ff;
    animation: donut-spin 1.2s linear infinite;
}

@keyframes donut-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

<!DOCTYPE html>
<html>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">

<head>
    <meta charset="UTF-8">
    <title>loading</title>
    <style type="text/css">
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 8rem;
            height: 8rem;
            position: absolute;
            z-index: 0;
        }

        .box:nth-of-type(2) {
            transform: rotate(45deg);
        }

        .box div {
            width: 1.5rem;
            height: 1.5rem;
            background: #f2f5c4;
            border: 1px solid #333;
            border-radius: 50%;
            position: absolute;
            animation: run 1.5s infinite linear;
        }

        .box div:nth-of-type(1) {
            /*左上*/
            left: 0;
            top: 0;
        }

        .box div:nth-of-type(2) {
            /*右上*/
            right: 0;
            top: 0;
        }

        .box div:nth-of-type(3) {
            /*左下*/
            left: 0;
            bottom: 0;
        }

        .box div:nth-of-type(4) {
            /*右下*/
            right: 0;
            bottom: 0;
        }

        /*动画效果*/
        @keyframes run {
            0% {
                transform: scale(0);
            }

            50% {
                transform: scale(1);
            }

            100% {
                transform: scale(0);
            }
        }

        /*延迟动画效果   负值是解决蹦动的效果*/
        .box:nth-of-type(1) div:nth-of-type(1) {
            animation-delay: -0.1s;
        }

        .box:nth-of-type(2) div:nth-of-type(1) {
            animation-delay: -0.3s;
        }

        .box:nth-of-type(1) div:nth-of-type(2) {
            animation-delay: -0.5s;
        }

        .box:nth-of-type(2) div:nth-of-type(2) {
            animation-delay: -0.7s;
        }

        .box:nth-of-type(1) div:nth-of-type(3) {
            animation-delay: -0.9s;
        }

        .box:nth-of-type(2) div:nth-of-type(3) {
            animation-delay: -1.1s;
        }

        .box:nth-of-type(1) div:nth-of-type(4) {
            animation-delay: -1.3s;
        }

        .box:nth-of-type(2) div:nth-of-type(4) {
            animation-delay: -1.5s;
        }

        .loadding_box {
            height: 22.5rem;
            width: 22.5rem;
            margin: 0 auto;
            position: relative;
        }

        .bg_img {
            position: absolute;
            z-index: 10;
        }

        .bg_img img {
            height: 100%;
        }

        .loading_d {
            position: absolute;
            left: 9rem;
            top: 2rem;
        }
    </style>
</head>

<body>
    <div class="loadding_box">
        <div class="loading_d">
            <div class="box">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
            <div class="box">
                <div></div>
                <div></div>
                <div></div>
                <div></div>
            </div>
        </div>

        <div class="bg_img">
            <img src="./fnloading.png" alt="" srcset="">
        </div>
    </div>

</body>

</html>

相关文章

  • 手写转圈圈效果

  • 转圈圈

    转圈圈,转圈圈,可以走着转、跳着转、跳着转、跑着转,还可以趴着转、躺着转和脚不碰地的转。我转,我转,我转圈圈,开心...

  • 圈圈转啊转

    最近简书总是在转圈圈。 点赞内容打不开,评论内容打不开。 圈圈转啊转,转啊转,想看的总是看不见。 怎么了?为什么总...

  • 大海小鸡还有虫子

    在果园里,轱辘轱辘转,圈圈的是谁呀?是虫子。绕着世界轱辘轱辘转,圈圈的是谁呀?是大海。围着小米,轱辘轱辘转,圈圈的...

  • 诗歌||  年轮在转圈圈

    一年又一年 时光在转圈圈 四季在转圈圈 你在你的世界里转啊转 我在我的世界里转啊转 生活就是一个圈圈接着另一个圈圈...

  • 艾灸数圈圈,效果更好。

    在课堂上老师教艾灸的时候,就是教的一圈一圈的转,从里到外,从外到里,一圈压着一圈;学了之后照做了一段时间,就完全跑...

  • 自定义流势布局

    手写流失布局 直接上代码 布局 效果

  • jQuery+Bootstrap手写树形菜单

    手写树形结构菜单并实现点击的交互效果

  • Android手写开源项目和资料搜集

    引言   Android的手写效率一直是件头疼的事情,比如手写效率、笔锋效果、手掌抑制等等,本文搜集了关于手写的开...

  • 手写RPC框架(4)-重写服务治理,开启1000个线程看看net

    本人微信公众号(jwfy)欢迎关注 手写RPC框架1、手写一个RPC框架,看看100个线程同时调用效果如何2、手写...

网友评论

      本文标题:手写转圈圈效果

      本文链接:https://www.haomeiwen.com/subject/urkzlltx.html