弹跳的小球动画

创建盒子并链接图片

<body>
    <div id="wrap">
        <div class="tu1"><img src="./images/1.png" alt=""></div>
        <div class="tu2"><img src="./images/2.png" alt=""></div>
        <div class="tu3"><img src="./images/3.png" alt=""></div>
    </div>
</body>

写入css样式修饰

    <style>
        #wrap{
            position: absolute;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            width: 580px;
            height: 143px;
            margin: auto;
        }
        #wrap img{
            width: 160px;
        }
        #wrap div{
            float: left;
            margin-right: 50px;
        }
        #wrap div:last-child{
            margin-right: 0;
        }
        .tu1,.tu2,.tu3{
            position: absolute;
            left: 50%;
            margin-left: -80px;
        }
        .tu1{
            z-index: 1;
            animation:tiantiao1 0.5s ease-in 1 forwards,tiantiao2 0.2s ease-out 0.5s 1 forwards,tiantiao3 0.2s ease-in 0.7s 1 forwards,tiantiao4 0.15s ease-out 0.9s 1 forwards,tiantiao5 0.15s ease-in 1.05s 1 forwards,leftMove 0.4s ease-out 1.2s 1 forwards,rotate 1s linear 1.6s infinite
        }
        .tu2{
            z-index: 2;
            animation:tiantiao1 0.5s ease-in 1 forwards,tiantiao2 0.2s ease-out 0.5s 1 forwards,tiantiao3 0.2s ease-in 0.7s 1 forwards,tiantiao4 0.15s ease-out 0.9s 1 forwards,tiantiao5 0.15s ease-in 1.05s 1 forwards,middle 0.4s ease-out 1.2s 1 forwards
        }
        .tu3{
            z-index: 3;
            animation:tiantiao1 0.5s ease-in 1 forwards,tiantiao2 0.2s ease-out 0.5s 1 forwards,tiantiao3 0.2s ease-in 0.7s 1 forwards,tiantiao4 0.15s ease-out 0.9s 1 forwards,tiantiao5 0.15s ease-in 1.05s 1 forwards,rightMove 0.4s ease-out 1.2s 1 forwards
        }
        @keyframes tiantiao1{
            0%{
                transform: translateY(-500px);
            }
            100%{
                transform: translateY(0);
            }
        }
        @keyframes tiantiao2{
            0%{
                transform: translateY(0);
            }
            100%{
                transform: translateY(-100px);
            } 
        }
        @keyframes tiantiao3{
            0%{
                transform: translateY(-100px);
            }
            100%{
                transform: translateY(0);
            } 
        }
        @keyframes tiantiao4{
            0%{
                transform: translateY(0);
            }
            100%{
                transform: translateY(-50px);
            } 
        }
        @keyframes tiantiao5{
            0%{
                transform: translateY(-50px);
            }
            100%{
                transform: translateY(0);
            } 
        }
        @keyframes leftMove{
            0%{
                transform: translateX(0);
            }
            100%{
                transform: translateX(-300px) scale(1.6);
            }
        }
        @keyframes rightMove{
            0%{
                transform: translateX(0);
            }
            100%{
                transform: translateX(300px) scale(1.6);
            }
        }
        @keyframes middle{
            0%{
                transform: translateX(0);
            }
            100%{
                transform: translateX(0) scale(1.6);
            }
        }
    </style>

最终效果预览

此次制作需要的图如下

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值