css动画的属性以及简写方法

HTML中动画的常用属性

/* 调用动画👇 */
             animation-name: move; 
            /* 完成所需时间👇 */
             animation-duration:5s; 
            /* 运动曲线 默认ease是慢快慢,linear是匀速*/
             animation-timing-function: ease; 
            /* 开始时间 */
           	 animation-delay: 0.1s; 
            /* 播放次数  indinite为无限*/
             animation-iteration-count: 3; 
            /* 结束后是否逆向播放 alternate为是  normal为否*/
             animation-direction: alternate; 
            /*结束状态 backwards为默认  forwards为停住不回去*/
            animation-fill-mode: backwards; 

简写方法

/*  简写   名字   时间   曲线    开始时间   次数    逆向还原    结束状态是否回去*/
animation: move   2s   linear      2s      999   alternate     forwards ;

特殊属性

/* 播放状态,常用于鼠标移入控制 默认running  停下为paused */
 	 animation-play-state: paused; 

学习后自己写的一点简易动画:

.donghua {	
			width: 100px;
            height:100px;
            background-color: #940505;
            animation: move 2s linear 2s 999 alternate forwards;
            position: absolute;
            top: 35%;
            left: 35%;
            animation: move 2s linear 999 alternate forwards;

@keyframes move {
            /* 定义动画0-100% */
            0% {
            }
            25% {transform: translate(500px,0) rotate(-360deg) scale(1.5);

}
            50% {transform: translate(500px,500px) rotate(-720deg) scale(0.5);

            }
            75% {transform: translate(0,500px) rotate(-1080deg) scale(1.5);
}
            100% {
                transform: translate(0) rotate(-1440deg) scale(0.5);
            }
        }
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值