欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

使用css3实现的windows8开机加载动画

程序员文章站 2022-03-04 10:13:08
本文给大家推荐一段使用纯CSS实现的win8开机加载的动画特效,非常的逼真,有需要的小伙伴参考下... 14-12-09...

今天给大家分享一款纯css3实现的win8加载动画。在这款实例中动画效果完全由css3实现。一起看下效果图:

使用css3实现的windows8开机加载动画

实现的代码。

html代码:


复制代码
代码如下:

<div class="wrapp">
<div class="text">
<h1>
windows 8</h1>
</div>
<div class="logo">
<span class="top-left"></span><span class="bottom-right"></span>
</div>
</div>

css3代码:


复制代码
代码如下:

body{
margin: 0;
padding: 0;
background-color: #90da15;
}
.wrapp{
position: absolute;
top: 50%;
left: 50%;
width: 600px;
height: 300px;
margin: -150px 0 0 -300px;
-webkit-perspective: 30px;
-webkit-transform: translatex(0px);
-webkit-animation: wrapp 400ms 800ms ease-in forwards;</p> <p> -moz-perspective: 30px;
-moz-transform: translatex(0px);
-moz-animation: wrapp 400ms 800ms ease-in forwards;</p> <p> -ms-perspective: 30px;
-ms-transform: translatex(0px);
-ms-animation: wrapp 400ms 800ms ease-in forwards;</p> <p> perspective: 30px;
transform: translatex(0px);
animation: wrapp 400ms 800ms ease-in forwards;
}
.text{
position: absolute;
top: 50%;
left: 50%;
width: 0px;
height: 60px;
margin: -30px 0 0 -160px;
overflow: hidden;
-webkit-transform: translatex(0px);
-webkit-animation: text 400ms 800ms linear forwards;</p> <p> -moz-transform: translatex(0px);
-moz-animation: text 400ms 800ms linear forwards;</p> <p> -ms-transform: translatex(0px);
-ms-animation: text 400ms 800ms linear forwards;</p> <p> transform: translatex(0px);
animation: text 400ms 800ms linear forwards;
}
h1{
float: right;
font-family: "segoe ui", frutiger, "frutiger linotype", "dejavu sans", "helvetica neue", arial, sans-serif;
font-weight: normal;
color: #fff;
padding: 0;
margin: 0;
width: 320px;
height: 60px;
font-size: 60px;
line-height: 60px;
}
.logo{
position: absolute;
top: 50%;
left: 50%;
width: 90px;
height: 90px;
margin: -45px 0 0 -45px;
background-color: #fff;
-webkit-transform: translatex(0px) rotatey(10deg);
-webkit-animation: logo 500ms 300ms ease-out forwards;</p> <p> -moz-transform: translatex(0px) rotatey(10deg);
-moz-animation: logo 500ms 300ms ease-out forwards;</p> <p> -ms-transform: translatex(0px) rotatey(10deg);
-ms-animation: logo 500ms 300ms ease-out forwards;</p> <p> transform: translatex(0px) rotatey(10deg);
animation: logo 500ms 300ms ease-out forwards;
}
.logo .top-left{
position: absolute;
top: 0;
left: 0;
width: 44px;
height: 44px;
border-right: solid 2px #90da15;
border-bottom: solid 2px #90da15;
}
.logo .bottom-right{
position: absolute;
bottom: 0;
right: 0;
width: 44px;
height: 44px;
border-left: solid 2px #90da15;
border-top: solid 2px #90da15;
}</p> <p>@-webkit-keyframes logo {
from {
-webkit-transform: translatex(0px) rotatey(10deg);
}
to {
-webkit-transform: translatex(0px) rotatey(-10deg);
}
}
@-webkit-keyframes text {
from {
width: 0px;
-webkit-transform: translatex(0px);
}
60%{
width: 0px;
}
to {
width: 320px;
-webkit-transform: translatex(240px);
}
}
@-webkit-keyframes wrapp {
from {
-webkit-transform: translatex(0px);
}
to {
-webkit-transform: translatex(-200px);
}
}
@-moz-keyframes logo {
from {
-moz-transform: translatex(0px) rotatey(10deg);
}
to {
-moz-transform: translatex(0px) rotatey(-10deg);
}
}
@-moz-keyframes text {
from {
width: 0px;
-moz-transform: translatex(0px);
}
60%{
width: 0px;
}
to {
width: 320px;
-moz-transform: translatex(240px);
}
}
@-moz-keyframes wrapp {
from {
-moz-transform: translatex(0px);
}
to {
-moz-transform: translatex(-200px);
}
}</p> <p>@-ms-keyframes logo {
from {
-ms-transform: translatex(0px) rotatey(10deg);
}
to {
-ms-transform: translatex(0px) rotatey(-10deg);
}
}
@-ms-keyframes text {
from {
width: 0px;
-ms-transform: translatex(0px);
}
60%{
width: 0px;
}
to {
width: 320px;
-ms-transform: translatex(240px);
}
}
@-ms-keyframes wrapp {
from {
-ms-transform: translatex(0px);
}
to {
-ms-transform: translatex(-200px);
}
}
@keyframes logo {
from {
transform: translatex(0px) rotatey(10deg);
}
to {
transform: translatex(0px) rotatey(-10deg);
}
}
@keyframes text {
from {
width: 0px;
transform: translatex(0px);
}
60%{
width: 0px;
}
to {
width: 320px;
transform: translatex(240px);
}
}
@keyframes wrapp {
from {
transform: translatex(0px);
}
to {
transform: translatex(-200px);
}
}

是不是很炫酷呢,小伙伴们自己动手制作一个试试手吧。