純CSS 陰陽魚

//動畫生效後,其效果不可該變,只有換其動畫名

鼠標移入前順時針旋轉


鼠標移入後動畫效果改變(逆時針旋轉):




HTML代碼

<!DOCTYPE html>
<html>
  <head lang="en">
  <meta charset="UTF-8">
  <title></title>
  <link rel="stylesheet" href="yu.css"/>
  </head>
  <body>
     <div class="hot">
        <div class="news">
           <div class="trap"></div>
      </div>
      <div class="subnav">
           <div class="eye"></div>
     </div>
   </div>
</body>
</html>css




CSS代碼

 

body{
background-color:lemonchiffon;
}html

.hot{
width: 0;
height: 400px;
border-left:200px solid #fdfdfe;
border-right:200px solid #090a26;
border-radius: 50%;
margin: auto;
margin-top: 100px;
position: relative;
animation:move 3s linear infinite;
}動畫

.news{
width: 200px;
height: 200px;
background-color:#fdfdfe;
border-radius: 50%;
position: absolute;
top: 0;
left:-100px ;
}orm

.trap{
width: 50px;
height: 50px;
border-radius: 50%;
background-color: #090a26;
margin-top: 75px;
margin-left: 75px;
}
.subnav{
width: 200px;
height: 200px;
background-color: #090a26;
border-radius: 50%;
position: absolute;
bottom: 0;
left:-100px ;
}
.eye{
width: 50px;
height: 50px;
border-radius: 50%;
background-color: #eaeaea;
margin-top: 75px;
margin-left: 75px;
}
@keyframes move{
0%{
transform:rotate(0deg);
}100%{
transform:rotate(360deg);
}
}htm

.hot:hover .news{
background-color: #090a26;
}
.hot:hover .trap{
background-color: #fdfdfe;
}
.hot:hover .subnav{
background-color:#fdfdfe;
}
.hot:hover .eye{
background-color: #090a26;
}
.hot:hover{
animation:move01 3s linear infinite;
}
@keyframes move01 {
0% {
transform: rotate(360deg);
}
100% {
transform: rotate(0deg);
}
}blog

相關文章
相關標籤/搜索