純CSS3單頁切換導航菜單界面設計

来源:http://www.cnblogs.com/w2bc/archive/2016/08/16/5776331.html
-Advertisement-
Play Games

這是一款使用純CSS3製作的單頁切換導航菜單界面設計效果。該頁面效果中,在頁面的左側垂直排放一組導航按鈕,當點擊導航按鈕時,相應的頁面會從屏幕右側滑動出來,效果非常炫酷。 線上預覽 源碼下載 使用方法 該單頁切換導航菜單界面的HTML結構如下: 1 2 3 4 5 6 7 8 9 10 11 12 ...


這是一款使用純CSS3製作的單頁切換導航菜單界面設計效果。該頁面效果中,在頁面的左側垂直排放一組導航按鈕,當點擊導航按鈕時,相應的頁面會從屏幕右側滑動出來,效果非常炫酷。

線上預覽    源碼下載

 使用方法

 HTML結構

該單頁切換導航菜單界面的HTML結構如下:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 <div class="ct" id="t1">   <div class="ct" id="t2">     <div class="ct" id="t3">       <div class="ct" id="t4">          <div class="ct" id="t5">           <ul id="menu">             <a href="#t1"><li class="icon fa fa-bolt" id="uno"></li></a>             <a href="#t2"><li class="icon fa fa-keyboard-o" id="dos"></li></a>             <a href="#t3"><li class="icon fa fa-rocket" id="tres"></li></a>             <a href="#t4"><li class="icon fa fa-dribbble" id="cuatro"></li></a>             <a href="#t5"><li class="icon fa fa-plus-circle" id="cinco"></li></a>           </ul>           <div class="page" id="p1">              <section class="icon fa fa-bolt"><span class="title">Bolt</span><span class="hint">...</section           </div>           <div class="page" id="p2">             <section class="icon fa fa-keyboard-o"><span class="title">Type</span></section>           </div           <div class="page" id="p3">             <section class="icon fa fa-rocket"><span class="title">Rocket</span></section>           </div>           <div class="page" id="p4">             <section class="icon fa fa-dribbble">               <span class="title">Dribbble</span>               <p class="hint">                 Im ready to play, <span class="hint line-trough">invite me </span> find me               </p>               <p class="hint">...</p>             </section>           </div>           <div class="page" id="p5">             <section class="icon fa fa-plus-circle">               <span class="title">More</span>               <p class="hint">                 ...               </p>             </section>           </div>         </div>       </div>     </div>   </div> </div>       
 CSS樣式

該單頁切換導航菜單界面使用transform和transition來製作頁面的切換動畫效果。並通過:target偽元素來完成按鈕點擊時的頁面切換。完整的CSS代碼如下,代碼中沒有添加瀏覽器廠商的首碼。

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 html, body, .page {   width: 100%;   height: 100%;   margin: 0;   padding: 0;   transition: all .6s cubic-bezier(.5, .2, .2, 1.1);   color: #fff;   overflow: hidden; }   * {   font-family: 'open sans', 'lato', 'helvetica', sans-serif; }   .page {   position: absolute; }   #p1 {   left: 0; }   #p2, #p3, #p4, #p5 {   left: 200%; }   #p1 { background: darkslateblue; } #p2 { background: tomato; } #p3 { background: gold; } #p4 { background: deeppink; } #p5 { background: #9b59b6; }   #t2:target #p2, #t3:target #p3, #t4:target #p4, #t5:target #p5 {   transform: translateX(-190%);   transition-delay: .4s !important; }   #t2:target #p1, #t3:target #p1, #t4:target #p1, #t5:target #p1{   background: black; }   #t2:target #p1 .icon, #t3:target #p1 .icon, #t4:target #p1 .icon, #t5:target #p1 .icon {   -webkit-filter: blur(3px);   filter: blur(3px); }   .icon {   color: #fff;   font-size: 32px;   display: block; }   ul .icon:hover {   opacity: 0.5; }   .page .icon .title {   line-height: 2; }   #t2:target ul .icon, #t3:target ul .icon, #t4:target ul .icon, #t5:target ul .icon{   transform: scale(.6);   transition-delay: .25s; }   #t2:target #dos, #t3:target #tres, #t4:target #cuatro, #t4:target #cinco {   transform: scale(1.2) !important; }   ul {   position: fixed;   z-index: 1;   top: 0;   bottom: 0;   left: 0;   margin: auto;   height: 280px;   width: 10%;   padding: 0;   text-align: center;  }   #menu .icon {   margin: 30px 0;   transition: all .5s ease-out !important; }   a {   text-decoration: none; }   .title, .hint {   display: block; }   .title {   font-size: 38px; }   .hint {   font-size: 13px; }   #p4 .hint {   display: inherit !important; }   .hint a {   color: yellow;   transition: all 250ms ease-out; }   .hint a:hover {   color: #FFF; }   .line-trough {   text-decoration: line-through; }   .page .icon {   position: absolute;   top: 0;   bottom: 0;   right: 10%;   left: 0;   width: 270px;   height: 170px;   margin: auto;   text-align: center;   font-size: 80px;   line-height: 1.3;   transform: translateX(360%);   transition: all .5s cubic-bezier(.25, 1, .5, 1.25); }   .page#p1 .icon {   height: 220px; }   .page#p1 .icon {   transform: translateX(10%) !important; }   #t2:target .page#p2 .icon, #t3:target .page#p3 .icon, #t4:target .page#p4 .icon, #t5:target .page#p5 .icon {   transform: translateX(0) !important;   transition-delay: 1s; }                 
 

線上預覽    源碼下載


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 自己對canvas,但又有一顆做游戲的心TT。然後記錄一下對canvas的學習吧,用一個按方向鍵控制的小圓點來做練習。(編程時用了一些es6的語法) 示例的html很簡單,只有一個canvas元素: 這裡可以看到我在canvas標簽里直接定義了寬和高,這和在css裡面定義是不同的,canvas元素其 ...
  • Array類型是ECMAScript中最常用的引用類型。ECMAScript中的數據與其它大多數語言中的數組有著相當大的區別。雖然ECMAScript中的數據與其它語言中的數組一樣都是數據的有序列表,但不同的是,ECMAScript數組中的每一項可以保存任何類型的數據,無論是數值、字元串或者是對象。 ...
  • 這次的分享,主要還是想跟大家聊聊Javascript語言中很重要的概念之一,對象。為什麼說之一呢?因為Javascript其他重要概念還包括:作用域 作用域鏈 繼承 閉包 函數 繼承 數組 ...... 有機會會跟大家分享這些概念的。以下的介紹會分為如下:1:前言2:概述 2.1:對象創建 2.2: ...
  • 今天我又碼了兩個特效:一個是用原生input[type=range]的,另一個完全自定義的;下麵是完整代碼和演示: <!DOCTYPE html tip{ position: absolute; top: 30px; left: 0; right: 0; width: 200px; height: ...
  • DOM技術實現競賽題頁面 這一段時間學習了DOM操作和JS開發,我就自己開發一個競賽題的頁面。 一、業務需求 1、目標:做一個一百道選擇題的頁面 2、功能: 顯示題目和選項。 下一題上一題的按鈕,到第一題和第一百題時停止。 答對了顯示笑臉和笑話,答錯了顯示苦臉和正確答案。 二、開發思路 採用自頂向下 ...
  • 雖然我們的js將來會被很多的礦街(jQuery)取代,但js,我們現在依然不得不學,因為用途很廣泛 ...
  • 使用: 圖片: ...
  • canvas元素 可被用來通過腳本(通常是JavaScript)繪製圖形。比如,它可以被用來繪製圖形,製作圖片集合,甚至用來實現動畫效果。你可以(也應該)在元素標簽內寫入可提供替代的的代碼內容,這些內…容將會在在舊的、不支持canvas元素的瀏覽器或是禁用了JavaScript的瀏覽器內渲染並展現。 ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...