<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CSS3 愤怒的小鸟</title>
<style>
/* Scale Me ! */
html,
body {
height: 100%;
}
body {
background: #e3f0f8;
overflow: hidden;
}
.bird-body {
-webkit-animation: bounce 0.8s linear infinite;
animation: bounce 0.8s linear infinite;
width: 100px;
height: 100px;
background-image: -webkit-linear-gradient(270deg, #ed4a62 50%, #ed484a 50%);
background-image: linear-gradient(180deg, #ed4a62 50%, #ed484a 50%);
border-radius: 15%;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
z-index: 9999;
}
.bird-body .beak {
width: 0;
height: 0;
border-left: 25px solid #fac532;
border-top: 25px solid transparent;
position: absolute;
right: -25px;
top: 25px;
}
.bird-body .beak:after {
content: '';
display: block;
position: absolute;
left: -25px;
top: 0;
width: 0;
height: 0;
border-left: 25px solid #eaab2f;
border-bottom: 25px solid transparent;
}
.bird-body .eye {
width: 25px;
height: 25px;
background: #fff;
border-radius: 100%;
position: absolute;
top: 16.66667px;
right: 12.5px;
box-shadow: 0 0 0 5px #731f2e;
}
.bird-body .eye:before {
content: '';
display: block;
position: absolute;
top: 50%;
left: 50%;
-ms-transform: translate(-30%, -30%) rotate(-135deg);
transform: translate(-30%, -30%) rotate(-135deg);
-webkit-transform: translate(-30%, -30%) rotate(-145deg);
border-radius: 50%;
border-right-color: transparent;
border-top-color: #1b131e;
border-bottom-color: #1b131e;
border-left-color: #1b131e;
border-width: 6.25px;
border-style: solid;
}
.bird-body .eye:after {
content: '';
display: block;
width: 12.5px;
height: 2.5px;
background: #731f2e;
position: absolute;
bottom: 50%;
-webkit-transform: translateY(-50%);
-ms-transform: translateY(-50%);
transform: translateY(-50%);
right: -12.5px;
}
.bird-body .tail {
width: 0;
height: 0;
border-right: 25px solid #ed4a62;
border-bottom: 25px solid transparent;
position: absolute;
left: -25px;
top: 25px;
}
.bird-body .wing {
width: 0;
height: 0;
margin: 0;
padding: 0;
border-left: 45.45455px solid #b8333a;
border-bottom: 41.66667px solid transparent;
position: absolute;
bottom: 8.33333px;
left: 16.66667px;
-webkit-transform-origin: top center;
-ms-transform-origin: top center;
transform-origin: top center;
-webkit-animation: wing 0.25s linear infinite;
animation: wing 0.25s linear infinite;
}
.bird-body .nevus {
width: 7.5px;
height: 7.5px;
background: #f089a6;
border-radius: 50%;
position: absolute;
top: 12.5px;
left: 15px;
}
.bird-body .nevus:after,
.bird-body .nevus:before {
content: '';
display: block;
background: inherit;
border-radius: 50%;
position: absolute;
}
.bird-body .nevus:before {
width: 2.5px;
height: 2.5px;
left: 12.5px;
}
.bird-body .nevus:after {
width: 5px;
height: 5px;
top: 10px;
left: 7.5px;
}
@-webkit-keyframes wing {
0% {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
50% {
-webkit-transform: rotateX(180deg);
transform: rotateX(180deg);
}
100% {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
}
@keyframes wing {
0% {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
50% {
-webkit-transform: rotateX(180deg);
transform: rotateX(180deg);
}
100% {
-webkit-transform: rotateX(0deg);
transform: rotateX(0deg);
}
}
@-webkit-keyframes bounce {
0% {
top: 50%;
}
25% {
top: 52%;
}
50% {
top: 50%;
}
75% {
top: 48%;
}
100% {
top: 50%;
}
}
@keyframes bounce {
0% {
top: 50%;
}
25% {
top: 52%;
}
50% {
top: 50%;
}
75% {
top: 48%;
}
100% {
top: 50%;
}
}
</style>
</head>
<body>
<div class="bird-body" id="birdy">
<div class="beak"></div>
<div class="eye"></div>
<div class="tail"></div>
<div class="wing"></div>
<div class="nevus"></div>
</div>
</body>
</html>