美文网首页
关键帧动画

关键帧动画

作者: Amanda妍 | 来源:发表于2020-07-25 20:52 被阅读0次

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>关键帧动画</title>

<style type="text/css">

*{

margin: 0;

padding: 0;

}

.one{

width: 200px;

height: 200px;

background-color: red;

/*1、设置动画名称*/

animation-name: changeColor;

/*2、设置动画时间 秒s,毫秒ms*/

animation-duration: 3s;

/*3、动画次数  iteration重复  infinite无限的 */

animation-iteration-count:3;

/*4、动画方向*/

animation-direction: reverse;

/*5、动画延时*/

animation-delay: 1s;

/*6、动画控制,暂停或继续动画*/

animation-play-state: running;

/*7、动画的运行速率  常用*/

animation-timing-function: linear;

}

.one:hover{

animation-play-state: running;

}

.two{

width: 300px;

height: 400px;

background-color: orange;

animation: changeTwo 1s 0.5s 2 linear ;

/*8、动画完成时的模式

backwards 默认值 动画完成后会回到默认值

forwards  动画完成后  定格在动画完成后最后的属性值*/

animation-fill-mode: forwards;

}

.three{

margin: 0 auto;

width:500px;

height: 600px;

background-color: yellow;

animation-name: changeThree;

animation-timing-function: linear;

animation-delay: 4s;

animation-fill-mode: forwards;

animation-duration: 2s;

animation-play-state: running;

animation-iteration-count:3;

}

@keyframes changeColor{

0%{

background-color: red;

width:200px;

}

20%{

background-color: green;

width: 400px;

}

40%{

background-color: greenyellow;

width: 600px;

}

60%{

background-color: goldenrod;

width: 400px;

}

80%{

background-color: orange;

width: 300px;

}

100%{

background-color: red;

width: 200px;

}

}

@keyframes changeTwo{

from{

width: 300px;

background-color: orange;

}

to{

width: 500px;

background-color: red;

}

}

@keyframes changeThree{

0%{

width: 500px;

}

20%{

width: 400px;

}

40%{

width: 300px;

}

60%{

width: 200px;

}

80%{

width: 400px;

}

100%{

width: 500px;

}

}

</style>

</head>

<body>

<div class="one"></div>

<div class="two"></div>

<div class="three"></div>

</body>

</html>

相关文章

  • HTML5动画

    关键帧动画 实现代码: 关键帧动画 *{ margin: 0; padding: ...

  • 抛物动画

    此动画在于运用 CAKeyframeAnimation 关键帧动画,以及贝塞尔关键帧动画 - (void)thro...

  • 前端——anmiation

    animation:;动画 设定动画方案:设定“关键帧”。 动画关键帧写在其他应用样式之前,当关键帧前用百分比表示...

  • iOS Animation创建及使用

    iOS 实现的基本动画 头尾式动画 2.block动画的方法 iOS显示关键帧动画 关键帧动画 动画的创建和使用 ...

  • CAKeyframeAnimation 关键帧动画

    CAKeyframeAnimation(关键帧动画) 关键帧动画就是在动画控制过程中开发者指定主要的动画状态,至于...

  • iOS 动画十:Layer Keyframe Animation

    Layer 上的 Keyframe 动画与 UIView 上的关键帧动画有些不同。UIView 关键帧动画是将独立...

  • Unity常见面试题(二)

    111. [动画系统]如何将其他类型的动画转换成关键帧动画? 动画->点缓存->关键帧 112. [动画]Unit...

  • iOS缩放动画

    //缩放动画 CAKeyframeAnimation(关键帧动画) //UIView动画方式

  • CAKeyframeAnimation

    关键帧动画

  • Css权威指南(4th,第四版中文翻译)-18.动画

    定义关键帧 Keyframes 主要的语法如下: 下面是几个简单的例子: 设置关键帧动画 动画的命名 关键帧选择器...

网友评论

      本文标题:关键帧动画

      本文链接:https://www.haomeiwen.com/subject/arnmlktx.html