16.动画案例:①大数据热点图②速度曲线steps()步长③奔跑的小熊

目录

一:大数据热点图

二.速度曲线steps()步长

 打印机效果:逐字打出

三:奔跑的小熊


一:大数据热点图

   <style>
        body {
            background-color: #333;
        }

        .map {
            position: relative;
            width: 747px;
            height: 616px;
            background: url(../media/map.png) no-repeat;
            margin: 0 auto;
        }

        .a {
            position: absolute;
            top: 230px;
            right: 195px;
            color: white;

        }

        .dot {
            position: absolute;
            width: 6px;
            height: 6px;
            background-color: #09f;
            border-radius: 50%;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);

        }

        .a1,
        .a2,
        .a3 {
            position: absolute;
            width: 4px;
            height: 4px;
            border-radius: 50%;
            box-shadow: 0 0 12px #009dfd;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            /* animation: name duration timing-function delay iteration-count direction fill-mode; */
            animation: aa 1.3s linear infinite;

        }



        .a2 {
            animation-delay: 0.4s;
        }

        .a3 {
            animation-delay: 0.8s;
        }

        @keyframes aa {
            0% {}

            70% {

                width: 40px;
                height: 40px;
                opacity: 1;
            }

            100% {
                width: 70px;
                height: 70px;
                opacity: 0;
            }
        }
    </style>
</head>

<body>
    <div class="map">
        <div class="a">
            <div class="dot"></div>
            <div class="a1"> </div>
            <div class="a2"></div>
            <div class="a3"></div>
        </div>
    </div>
</body>

二.速度曲线steps()步长

 打印机效果:逐字打出

 

 <style>
        div {
            overflow: hidden;
            font-size: 20px;
            width: 0;
            height: 30px;
            background-color: pink;
            /* 让我们的文字强制一行内显示 */
            white-space: nowrap;
            /* steps 就是分几步来完成我们的动画 有了steps 就不要在写 ease 或者linear 了 */
            animation: w 4s steps(10) forwards;
        }

        @keyframes w {
            0% {
                width: 0;
            }

            100% {
                width: 200px;
            }
        }
    </style>
</head>

<body>
    <div>世纪佳缘我在这里等你</div>
</body>

三:奔跑的小熊

 

<!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>
        .black {
            position: absolute;
            height: 300px;
            background-image: url(../media/bg2.png);
            opacity: 0.2;
            width: 1520px;
            overflow: hidden;
            animation: ss 10s infinite linear;

        }

        .s {
            position: relative;
            overflow: hidden;
            height: 500px;
            background: url(../media/bg1.png) repeat-x;
            animation: ss 5s infinite linear;
        }


        .box {
            top: 234px;
            position: absolute;
            width: 200px;
            height: 100px;
            background: url(../media/bear.png) no-repeat;
            animation: aa 0.3s steps(8) infinite, bb 3s forwards;
        }

        @keyframes aa {
            0% {
                background-position: 0 0;
            }

            100% {
                background-position: -1600px 0;
            }


        }

        @keyframes bb {
            0% {
                left: 0;
            }

            100% {
                left: 50%;
                /* margin-left: -100px; */
                transform: translateX(-50%);
            }

        }

        @keyframes ss {
            0% {
                background-position: 0 0;
            }

            100% {
                background-position: -3840px 0;
            }
        }
    </style>
</head>

<body>
    <div class="black">
    </div>
    <div class="s">
        <div class="box">
        </div>
    </div>
</body>

</html>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值