宣傳頁項目開發(三)

来源:https://www.cnblogs.com/chenyingying0/archive/2020/02/10/12291722.html
-Advertisement-
Play Games

網頁交互效果的實現 滾動條高度的獲取以及設置:document.body.scrollTop || document.documentElement.scrollTop .split() 把字元串分割成數組 .join() 把數組轉為字元串 .replace( /\s+/g, " ") 正則全局替換 ...


網頁交互效果的實現

滾動條高度的獲取以及設置:document.body.scrollTop || document.documentElement.scrollTop

.split()  把字元串分割成數組

.join()  把數組轉為字元串

.replace( /\s+/g, " ")  正則全局替換,把多個空格符替換為一個空格符

  綜合效果

index.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="base.css">
    <link rel="stylesheet" href="style.css">
    <link rel="stylesheet" href="animate.css">
</head>
<body>
    <!-- 頭部 -->
    <header>
        <div class="header-wrap">
            <div class="header-logo">微課手機</div>
            <nav class="header-nav">
                <a href="javascript:void(0);" class="header-nav-item">外觀</a>
                <a href="javascript:void(0);" class="header-nav-item">配置</a>
                <a href="javascript:void(0);" class="header-nav-item">型號</a>
                <a href="javascript:void(0);" class="header-nav-item">說明</a>
                <a href="javascript:void(0);" class="header-nav-item">其他</a>
                <a href="javascript:void(0);" class="header-nav-item header-nav-item-button">立即購買</a>
                <div class="header-nav-tip"></div>
            </nav>
    </header>
    <!-- 第一屏 -->
    <div class="screen-1">
        <h2 class="screen-1-heading screen-1-heading-init"><span>微課手機</span> 讓你的生活更精彩</h2>
        <div class="screen-1-phone screen-1-phone-init"></div>
        <div class="screen-1-shadow screen-1-shadow-init"></div>
    </div>
    <!-- 第二屏 -->
    <div class="screen-2">
        <div class="screen-2-wrap">
            <h2 class="screen-2-heading">優美的設計,更令人著迷</h2>
            <h4 class="screen-2-subheading">採用受歡迎的設計,讓它更加出色。<br>款式小巧、輕便手感更舒適。絢麗高清的顯示屏,整個外觀顯得格外精緻。</h4>
            <div class="screen-2-phone">
                <div class="screen-2-point screen-2-point-i1">高清攝像</div>
                <div class="screen-2-point screen-2-point-right screen-2-point-i2">超薄機身</div>
                <div class="screen-2-point screen-2-point-right screen-2-point-i3">大屏顯示</div>
            </div>
        </div>
    </div>
    <!-- 第三屏 -->
    <div class="screen-3">
        <div class="screen-3-wrap">
            <h2 class="screen-3-heading">優美的設計,更令人著迷</h2>
            <h4 class="screen-3-subheading">採用受歡迎的設計,讓它更加出色。<br>款式小巧、輕便手感更舒適。絢麗高清的顯示屏,整個外觀顯得格外精緻。</h4>
            <div class="screen-3-phone"></div>
            <div class="screen-3-detail">
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">5.7</div>
                    <div class="screen-3-detail-desc">英寸大屏</div>
                </div>
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">1200</div>
                    <div class="screen-3-detail-desc">萬像素</div>
                </div>
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">3D</div>
                    <div class="screen-3-detail-desc">Touch</div>
                </div>
                <div class="screen-3-detail-item">
                    <div class="screen-3-detail-num">A9</div>
                    <div class="screen-3-detail-desc">處理器</div>
                </div>
            </div>
        </div>
    </div>
    <!-- 第四屏 -->
    <div class="screen-4">
        <div class="screen-4-wrap">
            <h2 class="screen-4-heading">豐富的手機型號</h2>
            <h4 class="screen-4-subheading">找到適合你的手機</h4>
            <div class="screen-4-phone">
                <div class="screen-4-phone-item screen-4-phone-i1">
                    <div class="screen-4-phone-color">微課紅</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
                <div class="screen-4-phone-item screen-4-phone-i2">
                    <div class="screen-4-phone-color">土豪金</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
                <div class="screen-4-phone-item screen-4-phone-i3">
                    <div class="screen-4-phone-color">太空灰</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
                <div class="screen-4-phone-item screen-4-phone-i4">
                    <div class="screen-4-phone-color">紳士黑</div>
                    <div class="screen-4-phone-model">32G/64G/138G</div>
                </div>
            </div>
        </div>
    </div>
    <!-- 第五屏 -->
    <div class="screen-5">
        <h2 class="screen-5-heading">游戲、學習、拍照,有這一部就夠了</h2>
        <h4 class="screen-5-subheading">    看視頻、拍攝高清視頻與照片、視頻聊天、通話相結合,一機多功能,讓您生活更豐富精彩。
        </h4>
        <div class="screen-5-bg"></div>
    </div>
    <!-- 第六屏 -->
    <div class="screen-6">
        <button class="screen-6-btn">立即購買</button>
    </div>
    <!-- 底部 -->
    <footer>© 2020&nbsp;&nbsp;test.com&nbsp;&nbsp;浙ICP備00000000號</footer>
    <!-- 側導航 -->
    <div class="outline">
        <a href="javascript:void(0)" class="outline-item">外觀</a>
        <a href="javascript:void(0)" class="outline-item">配置</a>
        <a href="javascript:void(0)" class="outline-item">型號</a>
        <a href="javascript:void(0)" class="outline-item">說明</a>
        <a href="javascript:void(0)" class="outline-item">其它</a>
    </div>
    <script src="index.js"></script>
</body>
</html>

base.css

*{
    margin:0;
    padding:0;
}

a{
    text-decoration: none;
    color:#44484d;
}

ul{
    list-style:none;
}

body{
    color:#44484d;
}

h2{
    font-size:48px;
    font-weight:lighter;
    padding-top:81px;
    padding-bottom:15px;
}

h4{
    font-size:16px;
    line-height:30px;
    font-weight:normal;
    padding-bottom:15px;
}

/*# sourceMappingURL=base.css.map */

style.css

/*頭部*/
header{
    background:#f7f7f7;
    width:100%;
    height:80px;
    transition:all 1s;
}
.header-black{
    background-color: rgba(0,0,0,.5);
    position: fixed;
    top:0;
    z-index:5;
    color:#fff;
}
.header-black a{
    color:#fff;
}
.header-wrap{
    width:1200px;
    height:100%;
    margin:0 auto;
    position: relative;
}
.header-logo{
    width:140px;
    height:39px;
    margin-left:24px;
    background:url(img/logo.png) left center no-repeat;
    background-size:39px 39px;
    text-indent:51px;
    line-height:39px;
    position: absolute;
    top:50%;
    margin-top:-20px;
    font-size:20px;
}
.header-nav{
    position: absolute;
    right:24px;
    height:39px;
    line-height:39px;
    top:50%;
    margin-top:-20px;
    font-size:14px;
}
/*滑動門特效*/
.header-nav-tip{
    position: absolute;
    bottom:-3px;
    left:0;
    width:30px;
    height:2px;
    background-color: #f04747;
    margin-left:45px;
    transition:all .5s;
}
.header-nav-item{
    display: block;
    float:left;
    padding-left:45px;
    width:30px;
}
.header-nav-item:hover{
    color:#f04747;
}
.header-nav-item-active{
    color:#f04747 !important;
    position: relative;
}
.header-nav-item-button{
    width:90px;
    height:39px;
    background-color:#07111b;
    color:#f4f4f5;
    text-align: center;
    border-radius:3px;
    padding-left:0;
    margin-left:45px;
}

/*第一屏*/
.screen-1{
    width:100%;
    height:795px;
    background:url(img/screen-1-bg.png) no-repeat;
    background-size:cover;
    text-align: center;
    position: relative;
}
.screen-1-heading{
    padding-top:138px;
    padding-bottom:94px;
    color:#4d555d;
}
.screen-1-heading span{
    color:#f04747;
}
.screen-1-phone{
    background:url(img/screen-1-phone.png) center no-repeat;
    width:1375px;
    height:305px;
    left:50%;
    margin-left:-687px;
    position: absolute;
    bottom:180px;
    z-index:2;
}
.screen-1-shadow{
    background:url(img/screen-1-shadow.png) center no-repeat;
    width:1183px;
    height:367px;
    left:50%;
    margin-left:-591px;
    position: absolute;
    bottom:30px;
    z-index:1;
}

/*第二屏*/
.screen-2{
    width:100%;
    height:800px;
    background:#fafafa;
}
.screen-2-wrap{
    width:1200px;
    height:100%;
    margin:0 auto;
    text-align: center;
    position: relative;
    overflow:hidden;
}
.screen-2-heading{
    color:#f04747;
}
.screen-2-subheading{
    color:#4d555d;
}
.screen-2-phone{
    background:url(img/screen-2-phone.png) center no-repeat;
    width:928px;
    height:530px;
    left:50%;
    margin-left:-464px;
    position: absolute;
    bottom:0;
}
.screen-2-point{
    font-weight:lighter;
    width:104px;
    padding-right:97px;
    background:url(img/screen-2-point-left.png) center right no-repeat;
    position: absolute;
}
.screen-2-point-right{
    padding-right:0;
    padding-left:97px;
    background:url(img/screen-2-point-right.png) center left no-repeat;
}
.screen-2-point-i1{
    top:160px;
    left:-153px;
}
.screen-2-point-i2{
    top:40px;
    right:150px;
}
.screen-2-point-i3{
    top:340px;
    right:40px;
}

/*第三屏*/
.screen-3{
    width:100%;
    height:800px;
    background:#fafafa;
    background:url(img/screen-3-bg.png) no-repeat;
    background-size:cover;
    position: relative;
}
.screen-3-wrap{
    width:1200px;
    padding:0 50px;
    height:100%;
    margin:0 auto;
    position: relative;
    color:#fff;    
    overflow:hidden;
}
.screen-3-phone{
    background:url(img/screen-3-phone.png) top right no-repeat;
    width:767px;
    height:576px;
    right:0;
    position: absolute;
    bottom:0;
}
.screen-3-detail{
    margin-top:152px;
    width:333px;
}
.screen-3-detail-item{
    width:140px;
    height:127px;
    border:1px solid #cd6d6f;
    float:left;
    border-radius:3px;
    margin-right:24px;
    text-align: center;
    margin-bottom:18px;
}
.screen-3-detail-num{
    font-size:48px;
    line-height:48px;
    padding-top:24px;
}
.screen-3-detail-desc{
    padding-top:5px;
}

/*第四屏*/
.screen-4{
    width:100%;
    height:800px;
}
.screen-4-wrap{
    width:1200px;
    height:100%;
    margin:0 auto;
    position: relative;
    text-align: center;
    z-index:2;
}
.screen-4-heading{
    padding-top:120px;
    padding-bottom:21px;
    color:#f04747;
}
.screen-4-subheading{
    padding-bottom:55px;
}
.screen-4-phone{
    width:1148px;
    height:355px;
}
.screen-4-phone-item{
    width:218px;
    height:355px;
    margin-right:92px;
    float:left;
    background:url(img/screen-4-phone.png) -26px top no-repeat;
}
.screen-4-phone-i1{
    background-position:-25px 0;
}
.screen-4-phone-i2{
    background-position:-301px 0;
}
.screen-4-phone-i3{
    background-position:-574px 0;
}
.screen-4-phone-i4{
    background-position:-846px 0;
    margin-right:0;
}
.screen-4-phone-color{
    padding-top:307px;
    font-size:16px;
}
.screen-4-phone-model{
    padding-top:9px;
    font-size:12px;
    color:#d8dadc;
}

/*第五屏*/
.screen-5{
    width:100%;
    height:800px;    
    background-color: #d9dde1;
    text-align: center;
    position: relative;
    overflow:hidden;
}
.screen-5-heading{
    padding-top:120px;
    padding-bottom:21px;
    color:#f04747;
}
.screen-5-subheading{
    padding-bottom:55px;
}
.screen-5-bg{
    width:1918px;
    height:433px;
    position: absolute;
    bottom:0;
    left:50%;
    margin-left:-959px;
    background:url(img/screen-5-bg.png) center no-repeat;
}

/*第六屏*/
.screen-6{
    width:100%;
    height:202px;
    background-color: #d9ddd1;
    background:url(img/screen-6-bg.png);
    text-align: center;
    padding-top:118px;
}
.screen-6-btn{
    width:243px;
    height:78px;
    line-height:78px;
    text-align: center;
    background:#f01414;
    color:#fff;
    border-radius:3px;
    font-size:24px;
    font-weight:lighter;
    border:none;
    box-shadow:0 0 10px rgba(0,0,0,.5);
    display: inline-block;
    cursor:pointer;
}

/*底部*/
footer{
    text-align: center;
    color:#fff;
    width:100%;
    height:80px;
    line-height:80px;
    background-color: #07111b;
    font-size:12px;
    font-weight:lighter;
}
/*側導航*/
.outline{
    position: fixed;
    right:0;
    bottom:160px;
    background-color: #fff;
    padding:0 10px;
    transition:all 1s;
    opacity: 0;
    transform:translate(100%,0);
}
.outline-in{
    opacity: 1;
    transform:translate(0,0);
}
.outline-item{
    display: block;
    height:47px;
    line-height:47px;
    width:27px;
    text-align: center;
    font-size:12px;
    border-top:1px solid #edf1f2;
}
.outline-item:first-child{
    border-top:0;
}
.outline-item-active{
    color:red;
}
/*# sourceMappingURL=style.css.map */

animate.css

/*第一屏*/
.screen-1-heading{ transition:all 1s; }
.screen-1-heading-init{ opacity: 0;transform:translate(0,100%); }
.screen-1-heading-done{ opacity: 1;transform:translate(0,0); }

.screen-1-phone{ transition:all 1s; }
.screen-1-phone-init{ opacity: 0;transform:translate(0,-100%); }
.screen-1-phone-done{ opacity: 1;transform:translate(0,0); }

.screen-1-shadow{ transition:all 1s; }
.screen-1-shadow-init{ opacity: 0;transform:translate(0,-100%); }
.screen-1-shadow-done{ opacity: 1;transform:translate(0,0); }

/*第二屏*/
.screen-2-heading{ transition:all 1s; }
.screen-2-heading-init{ opacity: 0;transform:translate(0,-100%); }
.screen-2-heading-done{ opacity: 1;transform:translate(0,0); }

.screen-2-subheading{ transition:all 1s; }
.screen-2-subheading-init{ opacity:
              
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 重點參考: "MySQL索引原理及慢查詢優化 (美團技術分享網站)" :原理、示例優化都寫的很好。 "索引很難麽?帶你從頭到尾捋一遍MySQL索引結構,不信你學不會!" :原理寫的很好。 "【從入門到入土】令人脫髮的資料庫底層設計" :很詳細的底層原理 一定要仔細看其中講的索引原理!!!本文中都是簡 ...
  • 一、安裝準備 本次安裝的版本是截止2020.1.30最新的版本0.17.0 軟體要求 需要 Java 8(8u92 +) 以上的版本,否則會有問題 Linux,Mac OS X或其他類似Unix的操作系統(不支持Windows) 硬體要求 Druid包括一組參考配置和用於單機部署的啟動腳本: 單服務 ...
  • 1、引入組件 import { BackHandler, } from 'react-native'; 2、添加監聽 componentDidMount(): void { BackHandler.addEventListener('hardwareBackPress', this.onBackBu ...
  • 在前端開發中,JavaScript並沒有想象中那麼簡單,不只是簡單的UI輸入驗證,還有面向對象。對於剛剛JavaScript入門的你來說,可能會稍稍驚訝:哇,雖然前端開發好找對象,但是JavaScript真的可以向對象編程麽!!!是的,你沒有看錯,本文將通過一些小例子,逐步講解JavaScript的... ...
  • 變數命名 變數名:字母 數字 下劃線 美元符$ jquery: $ $.each() $ jQuery underscore( js的一個函數庫) : _ _.each() 關鍵字 : if for 保留字 : class 推薦有意義的命名: buttonCancel button_cancel b ...
  • 在有些情況下,我們可能需要對一個 prop 進行“雙向綁定”。不幸的是,真正的雙向綁定會帶來維護上的問題,因為子組件可以修改父組件,且在父組件和子組件都沒有明顯的改動來源。 所以就推薦以update:myPropName 的模式觸發事件取而代之。舉個例子,在一個包含 title prop 的假設的組 ...
  • 存儲一張圖片,常見兩種思路: 1. 存儲 寬高、每個像素的 RGBA 值——點陣圖 1. 存儲 寬高、每個幾何圖形——矢量圖 一張圖片,如果幾何圖形關係明確,用矢量圖來存儲,不但空間占用少,而且信息比點陣圖全。因為點陣圖沒有表達出幾何圖形的關係,在縮放時點陣圖只好失真。 同理,存儲一系列數據時: 1. 如果 ...
  • Vue實現動態路由及登錄&404頁面跳轉控制&頁面刷新空白解決方案 by:授客 QQ:1033553122 開發環境 Win 10 Vue 2.9.6 node-v10.15.3-x64.msi 下載地址: https://nodejs.org/en/ 代碼片段(router/index.js) 說 ...
一周排行
    -Advertisement-
    Play Games
  • 概述:在C#中,++i和i++都是自增運算符,其中++i先增加值再返回,而i++先返回值再增加。應用場景根據需求選擇,首碼適合先增後用,尾碼適合先用後增。詳細示例提供清晰的代碼演示這兩者的操作時機和實際應用。 在C#中,++i 和 i++ 都是自增運算符,但它們在操作上有細微的差異,主要體現在操作的 ...
  • 上次發佈了:Taurus.MVC 性能壓力測試(ap 壓測 和 linux 下wrk 壓測):.NET Core 版本,今天計劃準備壓測一下 .NET 版本,來測試並記錄一下 Taurus.MVC 框架在 .NET 版本的性能,以便後續持續優化改進。 為了方便對比,本文章的電腦環境和測試思路,儘量和... ...
  • .NET WebAPI作為一種構建RESTful服務的強大工具,為開發者提供了便捷的方式來定義、處理HTTP請求並返迴響應。在設計API介面時,正確地接收和解析客戶端發送的數據至關重要。.NET WebAPI提供了一系列特性,如[FromRoute]、[FromQuery]和[FromBody],用 ...
  • 原因:我之所以想做這個項目,是因為在之前查找關於C#/WPF相關資料時,我發現講解圖像濾鏡的資源非常稀缺。此外,我註意到許多現有的開源庫主要基於CPU進行圖像渲染。這種方式在處理大量圖像時,會導致CPU的渲染負擔過重。因此,我將在下文中介紹如何通過GPU渲染來有效實現圖像的各種濾鏡效果。 生成的效果 ...
  • 引言 上一章我們介紹了在xUnit單元測試中用xUnit.DependencyInject來使用依賴註入,上一章我們的Sample.Repository倉儲層有一個批量註入的介面沒有做單元測試,今天用這個示例來演示一下如何用Bogus創建模擬數據 ,和 EFCore 的種子數據生成 Bogus 的優 ...
  • 一、前言 在自己的項目中,涉及到實時心率曲線的繪製,項目上的曲線繪製,一般很難找到能直接用的第三方庫,而且有些還是定製化的功能,所以還是自己繪製比較方便。很多人一聽到自己畫就害怕,感覺很難,今天就分享一個完整的實時心率數據繪製心率曲線圖的例子;之前的博客也分享給DrawingVisual繪製曲線的方 ...
  • 如果你在自定義的 Main 方法中直接使用 App 類並啟動應用程式,但發現 App.xaml 中定義的資源沒有被正確載入,那麼問題可能在於如何正確配置 App.xaml 與你的 App 類的交互。 確保 App.xaml 文件中的 x:Class 屬性正確指向你的 App 類。這樣,當你創建 Ap ...
  • 一:背景 1. 講故事 上個月有個朋友在微信上找到我,說他們的軟體在客戶那邊隔幾天就要崩潰一次,一直都沒有找到原因,讓我幫忙看下怎麼回事,確實工控類的軟體環境複雜難搞,朋友手上有一個崩潰的dump,剛好丟給我來分析一下。 二:WinDbg分析 1. 程式為什麼會崩潰 windbg 有一個厲害之處在於 ...
  • 前言 .NET生態中有許多依賴註入容器。在大多數情況下,微軟提供的內置容器在易用性和性能方面都非常優秀。外加ASP.NET Core預設使用內置容器,使用很方便。 但是筆者在使用中一直有一個頭疼的問題:服務工廠無法提供請求的服務類型相關的信息。這在一般情況下並沒有影響,但是內置容器支持註冊開放泛型服 ...
  • 一、前言 在項目開發過程中,DataGrid是經常使用到的一個數據展示控制項,而通常表格的最後一列是作為操作列存在,比如會有編輯、刪除等功能按鈕。但WPF的原始DataGrid中,預設只支持固定左側列,這跟大家習慣性操作列放最後不符,今天就來介紹一種簡單的方式實現固定右側列。(這裡的實現方式參考的大佬 ...