Css动画-呼吸点效果

图片地址:https://a.amap.com/Loca/static/loca-v2/demos/images/breath_red.png

图片

 

<!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>
</head>
<body>
    <div id="breathingPoint"></div>
</body>
<style>
    #breathingPoint {
        /* 系列图片每张间隙 图片总宽度÷数量 */
        width: 120px;
        /* 图片宽度 */
        height: 120px;
        /* 图片地址 */
        background: url(https://a.amap.com/Loca/static/loca-v2/demos/images/breath_red.png) no-repeat;
        /* 动画名称 */
        animation: run 1s steps(1) infinite;
        -webkit-animation: run 1s steps(1) infinite;
    }
    /* 动画 */
    @keyframes run {

        0%,
        100% {
            background-position: 0 0;
        }

        5% {
            background-position: -120px 0;
        }

        10% {
            background-position: -240px 0;
        }

        15% {
            background-position: -360px 0;
        }

        20% {
            background-position: -480px 0;
        }

        25% {
            background-position: -600px 0;
        }

        30% {
            background-position: -720px 0;
        }

        35% {
            background-position: -840px 0;
        }

        40% {
            background-position: -960px 0;
        }

        45% {
            background-position: -1080px 0;
        }

        50% {
            background-position: -1200px 0;
        }

        55% {
            background-position: -1320px 0;
        }

        60% {
            background-position: -1440px 0;
        }

        65% {
            background-position: -1560px 0;
        }

        70% {
            background-position: -1680px 0;
        }

        75% {
            background-position: -1800px 0;
        }

        80% {
            background-position: -1920px 0;
        }

        85% {
            background-position: -2040px 0;
        }

        90% {
            background-position: -2160px 0;
        }

        95% {
            background-position: -2280px 0;
        }
    }
</style>

</html>
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值