动态小图标

移动的眼睛:

思路:

用一个大盒子将两个眼睛包起来,用flex布局将两个眼睛水平均匀分配,垂直居中,眼睛里包着眼仁,用flex布局控制眼仁在眼球里的位置,之后运用动画让眼球在眼仁里动起来,匀速、一直循环。

充电电池:

思路:

建立两个大盒子,一个是盒子的头,一个是盒子的身子,身子里面再建立两个盒子,利用轮播图的思路,让它溢出隐藏,之后在背景颜色那个盒子里设两个电池身子长度,并在里面建立两个盒子,前面盒子透明背景颜色,后面盒子白色背景颜色,利用动画让它动起来,并一直循环,这样就会产生动态充电电池的动态图片的效果了。

源代码:

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Document</title>

    <style>

        .most{

            width: 300px;

            height: 300px;

            background-color: blue;

            display: flex;

            justify-content: space-around;

            align-items: center;

            margin-bottom: 10px;

        }

        .yan1{

            width: 100px;

            height: 100px;

            background-color: white;

            border-radius: 50%;

            display: flex;

            flex-direction: column-reverse;

        }

        .yan1 div{

            width: 30px;

            height: 30px;

            background-color: blue;

            border-radius: 50%;

            margin-left: 10px;

            margin-bottom: 10px;

            animation: donghua 1s linear infinite;

        }

        .yan2{

            width: 100px;

            height: 100px;

            background-color: white;

            border-radius: 50%;

            display: flex;

            flex-direction: column-reverse;

        }

        .yan2 div{

            width: 30px;

            height: 30px;

            background-color: blue;

            border-radius: 50%;

            margin-left: 10px;

            margin-bottom: 10px;

            animation: donghua 1s linear infinite;

        }

        @keyframes donghua {

            from{

            }

            to{

                margin-left: 60px;

            }

        }




 

        .most1 {

            width: 200px;

            height: 200px;

            background-color: rebeccapurple;

            display: flex;

            justify-content: center;

        }

        .diana {

            width: 100px;

            height: 50px;

            border: white solid 3px;

            border-radius: 10px;

            overflow: hidden;

        }

        .dianb {

            width: 10px;

            height: 20px;

            background-color: white;

            border: white solid 3px;

            margin-bottom: 13px;

        }

        .dianb,

        .diana {

            display: inline-block;

        }

        .dianc {

            margin-top: 60px;

        }

        .diand {

            width: 200px;

            height: 50px;

            display: flex;

            position: relative;

            left: -100px;

            animation: qq 3s linear infinite;

        }

        @keyframes qq {

            0% {}

            100% {

                position: relative;

                left: 3px;

            }

        }

        .dianwu {

            width: 100px;

            height: 50px;

            background-color: white;

        }

        .dianliu {

            width: 100px;

            height: 50px;

            opacity: 100%;

        }

    </style>

</head>

<body>

    <div class="most">

        <div class="yan1">

            <div></div>

        </div>

        <div class="yan2">

            <div></div>

        </div>

    </div>

    

    <div class="most1">

        <div class="dianc">

            <div class="diana">

                <div class="diand">

                    <div class="dianwu"></div>

                </div>

            </div>

            <div class="dianb"></div>

        </div>

    </div>

</body>

</html>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值