直播css小动画

直播css小动画

今天写页面的时候 UI出了一个icon动画需求,我本以为这个是要ui出一个gif图的,结果她让我写个动画,本来向怼她的,但是转念一想我也没做过这样的动画,就试试呗!

大概就是这么个玩意儿:
在这里插入图片描述

上代码:


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .body {
            width: 20px;
            height: 20px;
            background-color: #aaa;
            justify-content: space-between;
            display: flex;
        }

        .box {
            width: 4px;
            height:20px;
            background-color: #eee;
            border-radius: 4px;
        }


        .move1 {
            transform: scaleY(0.2);
            animation: mymove1 0.7s 0.1s infinite linear alternate;
        }

        .move2 {
            transform: scaleY(1);
            animation: mymove2 0.7s 0.4s infinite linear alternate;
        }

        .move3 {
            transform: scaleY(0.1);
            animation: mymove3 0.7s 0.4s infinite linear alternate;
        }

        @keyframes mymove1 {
            0% {
                transform: scaleY(0.2);
            }

            100% {
                transform: scaleY(1);
            }
        }

        @keyframes mymove2 {
            0% {
                transform: scaleY(1);
            }

            100% {
                transform: scaleY(0.3);
            }
        }

        @keyframes mymove3 {
            0% {
                transform: scaleY(0.1);
            }

            100% {
                transform: scaleY(1);
            }
        }
    </style>
</head>

<body>

    <div class="body">
        <div class="box move1"></div>
        <div class="box move2"></div>
        <div class="box move3"></div>
    </div>


</body>

</html>

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

前端酱紫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值