css3 html5 3D动画练习
2015-01-10 10:46
633 查看
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
div{
margin-bottom:10px;
width:200px;
height:100px;
}
@keyframes myfirst
{
from {background: red;}
to {background: yellow;}
}
@-moz-keyframes myfirst /* Firefox */
{
from {background: red;}
to {background: yellow;}
}
@-webkit-keyframes myfirst /* Safari 和 Chrome */
{
from {background: red;}
to {background: yellow;}
}
@-o-keyframes myfirst /* Opera */
{
from {background: red;}
to {background: yellow;}
}
.div1
{
animation: myfirst 5s;
-moz-animation: myfirst 5s; /* Firefox */
-webkit-animation: myfirst 5s; /* Safari 和 Chrome */
-o-animation: myfirst 5s; /* Opera */
}
@keyframs div2{
0% {background:red;}
25%{background:yellow;}
50%{background:blue;}
100%{background:green;}
}
@-moz-keyframes div2{
0% {background:red;}
25%{background:yellow;}
50%{background:blue;}
100%{background:green;}
}
.div2{
animation:div2 5s;
}
@keyframes div3{
0% {background: red; left:0px; top:0px;text-shadow:0 0 20px #000;}
25% {background: yellow; left:200px; top:0px;text-shadow:0 0 40px #000;}
50% {background: blue; left:200px; top:200px; text-shadow:0 0 60px #000;}
75% {background: green; left:0px; top:200px;text-shadow:0 0 80px #000}
100% {background: red; left:0px; top:0px; text-shadow:0 0 100px #000}
}
.div3{
animation:div3 5s infinite ease-in;
position:relative;
}
@keyframes div4{
from {
transform: rotate(3deg);
}
20% {
transform: rotate(7deg);
}
60% {
transform: rotate(10deg);
}
80% {
transform: rotate(7deg);
}
to {
transform: rotate(3deg);
}
}
@-webkit-keyframes div4 {
from {
transform: rotate(3deg);
}
20% {
transform: rotate(7deg);
}
60% {
transform: rotate(10deg);
}
80% {
transform: rotate(7deg);
}
to {
transform: rotate(3deg);
}
}
@-moz-keyframes div4 {
from {
transform: rotate(3deg);
}
20% {
transform: rotate(7deg);
}
60% {
transform: rotate(10deg);
}
80% {
transform: rotate(7deg);
}
to {
transform: rotate(3deg);
}
}
.div4{
transform: rotate(3deg);
animation: div4 0.1s 5 ease-in;
}
</style>
<script type="text/javascript"></script>
</HEAD>
<BODY>
<div class="div1">123</div>
<div class="div2">345</div>
<div class="div3">345</div>
<div class="div4">345</div>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
div{
margin-bottom:10px;
width:200px;
height:100px;
}
@keyframes myfirst
{
from {background: red;}
to {background: yellow;}
}
@-moz-keyframes myfirst /* Firefox */
{
from {background: red;}
to {background: yellow;}
}
@-webkit-keyframes myfirst /* Safari 和 Chrome */
{
from {background: red;}
to {background: yellow;}
}
@-o-keyframes myfirst /* Opera */
{
from {background: red;}
to {background: yellow;}
}
.div1
{
animation: myfirst 5s;
-moz-animation: myfirst 5s; /* Firefox */
-webkit-animation: myfirst 5s; /* Safari 和 Chrome */
-o-animation: myfirst 5s; /* Opera */
}
@keyframs div2{
0% {background:red;}
25%{background:yellow;}
50%{background:blue;}
100%{background:green;}
}
@-moz-keyframes div2{
0% {background:red;}
25%{background:yellow;}
50%{background:blue;}
100%{background:green;}
}
.div2{
animation:div2 5s;
}
@keyframes div3{
0% {background: red; left:0px; top:0px;text-shadow:0 0 20px #000;}
25% {background: yellow; left:200px; top:0px;text-shadow:0 0 40px #000;}
50% {background: blue; left:200px; top:200px; text-shadow:0 0 60px #000;}
75% {background: green; left:0px; top:200px;text-shadow:0 0 80px #000}
100% {background: red; left:0px; top:0px; text-shadow:0 0 100px #000}
}
.div3{
animation:div3 5s infinite ease-in;
position:relative;
}
@keyframes div4{
from {
transform: rotate(3deg);
}
20% {
transform: rotate(7deg);
}
60% {
transform: rotate(10deg);
}
80% {
transform: rotate(7deg);
}
to {
transform: rotate(3deg);
}
}
@-webkit-keyframes div4 {
from {
transform: rotate(3deg);
}
20% {
transform: rotate(7deg);
}
60% {
transform: rotate(10deg);
}
80% {
transform: rotate(7deg);
}
to {
transform: rotate(3deg);
}
}
@-moz-keyframes div4 {
from {
transform: rotate(3deg);
}
20% {
transform: rotate(7deg);
}
60% {
transform: rotate(10deg);
}
80% {
transform: rotate(7deg);
}
to {
transform: rotate(3deg);
}
}
.div4{
transform: rotate(3deg);
animation: div4 0.1s 5 ease-in;
}
</style>
<script type="text/javascript"></script>
</HEAD>
<BODY>
<div class="div1">123</div>
<div class="div2">345</div>
<div class="div3">345</div>
<div class="div4">345</div>
</BODY>
</HTML>
相关文章推荐
- CSS3 实现导航菜单的 3D 翻转动画效果
- css3学习--css3动画详解二(3d效果)
- html5 学习-3d动画
- html5网站常用动画样式,css3实现
- HTML5 CSS3 专题 :诱人的实例 3D展示商品信息
- Canvas 3D engine_HTML5动画引擎
- 纯CSS3制作骰子3D旋转动画效果
- HTML5之CSS3 3D transform 剖析式学习之一
- html5 canvas酷炫3D背景打开动画特效
- CSS3(背景样式,文本立体效果,2d3d转换及动画)第八天
- HTML5 CSS3 诱人的实例: 3D立方体旋转动画
- Html5的CSS3的transition实现简单动画效果
- css3 transition属性实现3d动画效果
- 2014 HTML5/CSS3热门动画特效TOP10
- 基于HTML5的WebGL经典3D虚拟机房漫游动画
- HTML5 CSS3 专题 :诱人的实例 3D展示商品信息
- CSS3和js炫酷点击按钮3D翻转动画特效
- 使用HTML5 SVG和CSS3制作边框运动的动画效果
- 基于HTML5/CSS3图片网格动画特效
- CSS3 HTML5动画