HTML5中动画实现的效果
2016-05-18 15:21
330 查看
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
</head>
<style>
body{
background-color:black;
}
.point{
width:10px;
height: 10px;
background-color: white;
/*圆角半径*/
border-radius: 5px;
/*位置有关的移动要有定位*/
position: absolute;
top:200px;
/*动画关联 动画名称 执行时间 线性执行 无限执行*/
animation:run 10s linear infinite;
}
/*定义关键帧动画 translateX,translateX*/
@keyframes run{
0%{}
/*平移x轴y轴 放大倍数 背景颜色 透明的*/
10%{transform:translate(150px,-50px) scale(3);background-color: blue;opacity: 0.5;}
20%{transform:translate(300px,50px) scale(1);background-color: orange;opacity: 1;}
30%{transform:translate(450px,-50px) scale(3);background-color: green;opacity: 0.5;}
40%{transform:translate(600px,50px) scale(1);background-color: yellow;opacity: 1;}
50%{transform:translate(750px,-50px) scale(3);background-color: red;opacity: 0.5;}
60%{transform:translate(600px,50px) scale(1);background-color: plum;opacity: 1;}
70%{transform:translate(450px,-50px) scale(3);background-color: gold;opacity: 0.5;}
80%{transform:translate(300px,50px) scale(1);background-color: hotpink;opacity: 1;}
90%{transform:translate(150px,-50px) scale(3);background-color: goldenrod;opacity: 0.5;}
100%{transform:translate(0px,50px) scale(1);background-color: brown;opacity: 1;}
}
</style>
<body>
<!--
作者:offline
时间:2016-05-10
描述:关键帧动画
-->
<div class='point'></div>
</body>
</html>
相关文章推荐
- html5如何获取手机陀螺仪角度信息
- html5实现拖放图片
- html5对各浏览器的支持情况
- html5的video标签 属性及方法汇总
- html5 如何实现客户端验证上传文件的大小
- html5 如何实现客户端验证上传文件的大小
- 为什么没安装支付宝客户端时没有跳H5网页?
- HTML5中的离线应用程序
- h5获取经纬度,当前位置,并计算与另一个经纬度的距离 千米为单位
- HTML5线性图表iGrapher 功能非常强大
- 初学h5 一些小常识
- HTML5学习笔记1
- html5-创建web wroker计时器
- 【Egret】里使用iframe标签达到内嵌多个web界面
- html5线程嵌套-子进程中的数据交互
- html5线程嵌套-单线程嵌套
- 使用Flexible实现手淘H5页面的终端适配
- 基于html5websocket java实现简单通讯(虽然通了但是...你懂得)
- html5-web workers-前后台线程交互
- H5响应式方案