創作內容

0 GP

[CSS3動畫]翼世界夢想領域Logo呈現

作者:灆洢騎士│2012-11-10 00:47:54│巴幣:0│人氣:273
可以從此看: http://www.knightzone.org
為了方便撰寫還導入scss XD

html:
<!DOCTYPE html>
<html>
  <head>
    <meta charset = "utf-8"/>
    <title>翼世界夢想領域</title>
    <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
    <link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />
    <!--[if IE]>
        <link href="/stylesheets/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
    <![endif]-->
    <link href="images/icon.ico" rel="shortcut icon"/>
  </head>
  <body>
    <div id = "link">
      <ul>
        <li><a href = "wordpress" id = "wp">Wordpress</a></li>
        <li><a href = "discuz" id = "dz">Discuz</a></li>
      </ul>
    </div>
    <div id = "animate">
      <div id = "star"></div>
      <div id = "manystar"></div>
      <div id = "font"></div>
      <div id = "underfont"></div>
      <div id = "leftknight"></div>
    </div>
  </body>
</html>

scss:
@import "compass/reset";
@import "compass/css3/transition";
@import "compass/css3/transform";

@mixin animation( $value ){
  animation: $value;
  -webkit-animation: $value;
  -moz-animation: $value;
  -o-animation: $value;
}

@mixin keyframes($name) {
  @-webkit-keyframes #{$name} {
    @content;
  }
  @-moz-keyframes #{$name} {
    @content;
  }
  @-ms-keyframes #{$name} {
    @content;
  }
  @keyframes #{$name} {
    @content;
  }
  @-o-keyframes #{$name} {
    @content;
  }
}

body{
  background: inline-image('bgblue3.png') #134e8b repeat-x;
  margin: 0px;
  font-family: "Century Gothic";
}


#animate{
  width: 800px;
  height: 480px;
  margin: 100px auto;
  position: relative;
}

#star{
  width: 800px;
  height: 396px;
  position: absolute;
  background: inline-image( "Logo3star.png" );
  @include animation(starani 2s);
}

#manystar{
  width: 800px;
  height: 396px;
  position: absolute;
  background: inline-image( "Logo3manystar.png" );
  @include animation(manystarani 6s);
}

#font{
  width: 800px;
  height: 396px;
  position: absolute;
  background: inline-image( "Logo3font.png" );
  @include animation(fontani 4s);
}

#underfont{
  width: 800px;
  height: 396px;
  position: absolute;
  background: inline-image( "Logo3underfont.png" );
  @include animation(manystarani 6s);
}

#link{
  width: 100%;
  height: 50px;
  margin-top: 10px;
  text-align: center;
  background: #134e8b;
  @include animation(linkani 8s);
  
  ul{
    padding: 0px;
    margin: 0 auto;
    width: 400px;
    position: relative;
    
    li{
      list-style-type: none;
      float: left;
      
      a{
        text-decoration: none;
        color: white;
        display: block;
        width: 200px;
        height: 40px;
        font-size: 20px;
        padding-top: 10px;
        position: absolute;
        
        &#wp{
          background-image: inline-image('wordpress.png');
          background-position: top center;
          background-repeat: no-repeat;
          @include transition(width 1s, height 1s, background-color 1s, left 1s, color 1s, z-index 0s);
          
          &:hover{
            width: 300px;
            height: 188px;
            background-color: yellow;
            color: black;
            z-index: 99;
            left: -100px;
          }
          
          &:active{
            background-color: red;
          }
        }
        
        &#dz{
          left: 200px;
          background-image: inline-image('discussion.png');
          background-position: top center;
          background-repeat: no-repeat;
          @include transition(width 1s, height 1s, background-color 1s, color 1s, z-index 0s);
          
          &:hover{
            width: 300px;
            height: 188px;
            background-color: yellow;
            color: black;
            z-index: 99;
          }
          
          &:active{
            background-color: red;
          }
        }
      }
    }
  }
}

#leftknight{
  position: absolute;
width: 150px;
height: 500px;
left: -150px;
  top: -50px;
background: inline-image( "knight2-back.PNG" ) no-repeat left center;
  @include animation(knightani 8s);
}

@include keyframes( starani ){
  0%{
    @include transform(rotateY(0deg) scale(0,0));
  }
  100%{
    @include transform(rotateY(360deg) scale(1,1));
  }
}

@include keyframes( fontani ){
  0%{
    @include transform(translate(0px,-700px));
  }
  50%{
    @include transform(translate(0px,-700px));
  }
  100%{
    @include transform(translate(0px,0px));
  }
}

@include keyframes( manystarani ){
  0%{
    opacity: 0;
  }
  66%{
    opacity: 0;
  }
  100%{
    opacity: 1;
  }
}

@include keyframes( linkani ){
  0%{
    @include transform(translate(0px,-200px));
  }
  75%{
    @include transform(translate(0px,-200px));
  }
  85%{
    @include transform(translate(0px,200px));
  }
  100%{
    @include transform(translate(0px,0px));
  }
}

@include keyframes( knightani ){
  0%{
    opacity: 0;
  }
  75%{
    opacity: 0;
  }
  100%{
    opacity: 1;
  }
}

--------------------------------------------------------
下次我想會把html的部分改寫成haml吧XD"""

引用網址:https://home.gamer.com.tw/TrackBack.php?sn=1798073
All rights reserved. 版權所有,保留一切權利

相關創作

留言共 1 篇留言

契言丹
有看沒有懂...

11-10 00:48

灆洢騎士
只要看呈現出來的樣子就可以了XD~11-10 00:50
我要留言提醒:您尚未登入,請先登入再留言

喜歡★gicoco2002 可決定是否刪除您的留言,請勿發表違反站規文字。

前一篇:[圖繪]翼世界夢想領域更... 後一篇:[圖繪]一期一繪第一題(...

追蹤私訊切換新版閱覽

作品資料夾

flys8028大家
遊戲介紹的小部落格,有空可以逛逛歐 https://www.rocksugarcat.com/看更多我要大聲說昨天09:03


face基於日前微軟官方表示 Internet Explorer 不再支援新的網路標準,可能無法使用新的應用程式來呈現網站內容,在瀏覽器支援度及網站安全性的雙重考量下,為了讓巴友們有更好的使用體驗,巴哈姆特即將於 2019年9月2日 停止支援 Internet Explorer 瀏覽器的頁面呈現和功能。
屆時建議您使用下述瀏覽器來瀏覽巴哈姆特:
。Google Chrome(推薦)
。Mozilla Firefox
。Microsoft Edge(Windows10以上的作業系統版本才可使用)

face我們了解您不想看到廣告的心情⋯ 若您願意支持巴哈姆特永續經營,請將 gamer.com.tw 加入廣告阻擋工具的白名單中,謝謝 !【教學】