你的位置:首页 > 网页设计

[网页设计]css3使用transform属性制作js弹性运动


<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>用css3仿制js的弹力效果</title>
</head>
<body>
<style type="text/css">
*{margin:0;padding:0px;}
body{background:#b1b1b1;font-family:Arial;font-size:125%;color:#202020;}
.tips{width:600px;margin:0 auto;line-height:24px;padding-top:10px;font-size:14px;}
.bredcolor{color:#fff;}
.envelope{
font:120px bold 'Arial Rounded MT Bold';color:#fff;
position:absolute;top:50%;left:50%;margin-left:-422px;margin-top:-69px;
}
.envelope_site{
-webkit-transform-style: preserve-3d;/* 去除文字的闪动 */
-webkit-transform:translateY(0px);
-webkit-animation:envelope .2s ease-in,envelope_top .7s linear .2s;
}
.envelope_site h1{
text-shadow: 4px 3px 4px #818181;font-family:'Arial Rounded MT Bold';
letter-spacing:2px;
-webkit-transform:translateY(-30px);
-webkit-transition:-webkit-transform .9s linear 1s;
}
@-webkit-keyframes envelope{
0%{top:0;left:100%;margin-left:0px;margin-top:-69px;-webkit-transform:translateY(0px);}
100%{top:50%;left:50%;margin-left:-276px;margin-top:-69px;-webkit-transform:translateY(0px);}
}
@-webkit-keyframes envelope_top{
0%{-webkit-transform:translateY(0px);}
20%{-webkit-transform:translateY(-80px);}
40%{-webkit-transform:translateY(0px);}
60%{-webkit-transform:translateY(-30px);}
80%{-webkit-transform:translateY(0px);}
90%{-webkit-transform:translateY(-10px);}
100%{-webkit-transform:translateY(0px);}
}
</style>
<div>http://www.999jiujiu.com/</div>
<section id="envelope">
<h1>css3tra<span >i</span>n</h1>
</section>
</body>
</html>