1. 程式人生 > >純CSS3 太極效果

純CSS3 太極效果

<!DOCTYPE html>
<html>
<head lang="en">
  <meta charset="UTF-8">
  <title>CSS3</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- <link rel="stylesheet" href="./taiji.css"> -->
  <style>
html{
width:100%;
height:100%;
-webkit-text-size-adjust:none;
-moz-text-size-adjust:none;
-ms-text-size-adjust:none;
-o-text-size-adjust:none;
text-size-adjust:none;
}


body{
margin:0;
padding:0;
width: 100%;
height:100%;
    background: -webkit-linear-gradient(black, white) no-repeat; 
    background: -o-linear-gradient(black, white) no-repeat;
    background: -moz-linear-gradient(black, white) no-repeat;
    background: linear-gradient(black, white) no-repeat;
color:#000;
font-size: 1.53em;
font-family: "SimSun";
}
ul{
list-style: none;
margin: 0;
padding:0;
}


a:link,a:hover,a:visited,a:focus{
text-decoration: none;
outline: none;
}
*,*:after,*:before{
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
-ms-box-sizing:border-box;
-o-box-sizing:border-box;
}
*:after,*:before{
display: block;
content:"";
}
*:after{
clear: both;
}
/* taiji */
.box-taiji{
position: relative;
width:400px;
height:400px;
margin:100px auto;
border-radius: 50%;
background-color: #ccc;
-webkit-animation:huan 2.5s infinite linear;
animation:huan 2.5s infinite linear;

}
.box-taiji .b{
position:absolute;
left:0;
top:0;
z-index: 9999;
width:200px;
height:200px;
border-radius: 50%;
background-color: #fff;
-webkit-transform:translateX(50%);
transform:translateX(50%);
/*transform:translateY(-25%);*/
}
.box-taiji .b p{
width:200px;
height:200px;
line-height: 200px;
text-align: center;
}
.box-taiji .w{
position:absolute;
right:75px;
bottom:0;
z-index: 9999;
width:200px;
height:200px;
border-radius: 50%;
background-color: #000;
-webkit-transform:translateX(-12.5%);
transform:translateX(-12.5%);
/*transform:translateY(75%);*/
}
.box-taiji .w p{
width:200px;
height:200px;
line-height: 200px;
text-align: center;
color:#fff;
/*padding-left:50%;*/
}
.box-taiji .mask{
position:absolute;
left:0;
top:0;
z-index: 999;
width:0;
height:0;
border-width:200px;
border-style:solid;
border-top-color:#fff;
border-right-color:#000;
border-bottom-color:#000;
border-left-color:#fff;
border-radius: 50%;
-webkit-transform:rotate(-45deg);
transform:rotate(-45deg);
}
@keyframes huan{
from{transform:rotate(0deg);}
to{transform:rotate(360deg);}
}
@-webkit-frames huan{
from{transform:rotate(0deg);}
to{transform:rotate(360deg);}
}
@-webkit-keyframes huan{
from{transform:rotate(0deg);}
to{transform:rotate(360deg);}
}
@-webkit-frames huan{
from{transform:rotate(0deg);}
to{transform:rotate(360deg);}
}
.text{text-align: center;}
  </style>
</head>
<body>
<div class="box-taiji">
<div class="b"><p>•</p></div>
<div class="w"><p>•</p></div>
<div class="mask"></div>
</div>
<div class="text">
<h1>太極</h1>
<p>萬物相生相剋</p>
<p>兩極變化無窮</p>
</div>
</body>
</html>