css绘制下雨的云朵

效果:
在这里插入图片描述
具体实现:
html

<div class="wuyun">
        <div class="yun">
            <div class=" yu yu1"></div>
            <div class=" yu yu2"></div>
            <div class=" yu yu3"></div>
            <div class=" yu yu4"></div>
            <div class=" yu yu5"></div>
            <div class=" yu yu6"></div>
            <div class=" yu yu7"></div>
            <div class=" yu yu8"></div>
            <div class=" yu yu9"></div>
            <div class=" yu yu10"></div>
            <div class=" yu yu11"></div>
            <div class=" yu yu12"></div>
        </div>

css代码

 .wuyun {
        margin-bottom: 400px;

    }
    .yun:after {
        content: "";
        width: 100px;
        height: 100px;
        border-radius: 50%;
        background-color: pink;
        position: absolute;
        top: -40px;
        right: 25px;
        animation: color 5s ease-in-out infinite;

    }
    .yun:before {
        content: "";
        width: 70px;
        height: 70px;
        border-radius: 50%;
        background-color: pink;
        position: absolute;
        top: -25px;
        left: 25px;
        animation: color 5s ease-in-out infinite;
    }
    .yun {
        width: 200px;
        height: 60px;
        border-radius: 50px;
        background-color: pink;
        margin: auto;
        margin-top: 300px;
        position: relative;
        animation: color 5s ease-in-out infinite;
    }
    @keyframes yu {
        0% {
            /* border-left: #fff 1px dashed; */
            border-left: #0b2e47 1px dashed;
            transform: scaleY(2);
        }
        40% {
            border-left: #0b2e47 1px dashed;
        }
        60% {
            border-left: #0b2e47 1px dashed;
            transform: translateY(20px);
            transform: scaleY(2);
        }
        80% {
            border-left: #0b2e47 1px dashed;
            transform: scaleY(2);
        }
        100% {
            /* border-left: #fff 1px dashed; */
            border-left: #fff 1px dashed;
            transform: scaleY(2);
        }
    }
@keyframes color {
        0% {
            background-color: rgb(209, 233, 237);
        }
        40% {
            background-color: rgb(119, 181, 232);
        }
        60% {
            background-color: #0a2e88;
        }
        80% {
            background-color: #0b2e47;
        }
        100% {
            background-color: rgb(209, 233, 237);
        }
    }
    @keyframes yunduo {
        100% {
            transform: translateX(200px);
        }
    }
     .yu {
        height: 20px;
        box-sizing: border-box;
        border-left: #0b2e47 1px dashed;
        position: absolute;
        bottom: -20px;
        animation: yu 5s ease-in-out infinite;
    }

    .yu1 {
        left: 20px;
        bottom: -30px;
    }

    .yu2 {
        left: 40px;
        bottom: -40px;
    }

    .yu3 {
        right: 30px;
        bottom: -30px;
    }

    .yu4 {
        right: 60px;
        bottom: -50px;
    }

    .yu5 {
        right: 80px;
        bottom: -30px;
    }

    .yu6 {
        right: 100px;
        bottom: -50px;
    }

    .yu7 {
        right: 110px;
        bottom: -70px;
    }

    .yu8 {
        right: 120px;
        bottom: -30px;
    }

    .yu9 {
        left: 50px;
        bottom: -60px;
    }

    .yu10 {
        right: 50px;
        bottom: -70px;
    }

    .yu11 {
        right: 70px;
        bottom: -80px;
    }

    .yu12 {
        left: 30px;
        bottom: -70px;
    }


这个办法绘制雨滴有点麻烦如果大家有什么其他方法,欢迎评论区讨论呀

  • 3
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值