Bootrap 项目实战(微金所前端首页)第三部分(CSS,js源码)

CSS源码

common.css

/**
*Created by xxc on 2019/2/26
*/
body, html, div, img, a, p, ul, ol, dl, dd, dt, li, h1, h2, h3, h4, h5, em, i, form, input, span, button {
    *zoom: 1;
    margin: 0;
    padding: 0;
    font-style: normal;
    outline: none;
    list-style: none
}

img {
    outline: none;
    border: none
}

label {
    font-weight: normal
}

@font-face {
    font-family: 'MicrosoftYaHeiUILight';
    src: url('../fonts/MicrosoftYaHeiUILight.eot?7kyxez');
    src: url('../fonts/MicrosoftYaHeiUILight.eot?7kyxez#iefix') format('embedded-opentype'), url('../fonts/MicrosoftYaHeiUILight.ttf?7kyxez') format('truetype'), url('../fonts/MicrosoftYaHeiUILight.woff?7kyxez') format('woff'), url('../fonts/MicrosoftYaHeiUILight.svg?7kyxez#MicrosoftYaHeiUILight') format('svg')
}

body, html {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", Tahoma, Helvetica
}
body{
    height: 1000px;
}
.left{
    float: left;
}
.right{
    float: right;
}
a {
    color: inherit;
    text-decoration: none
}

@font-face {
    font-family: 'MiFie-Website-Font';
    src: url('../fonts/MiFie-Website-Font.eot?7kyxez');
    src: url('../fonts/MiFie-Website-Font.eot?7kyxez#iefix') format('embedded-opentype'), url('../fonts/MiFie-Website-Font.ttf?7kyxez') format('truetype'), url('../fonts/MiFie-Website-Font.woff?7kyxez') format('woff'), url('../fonts/MiFie-Website-Font.svg?7kyxez#MiFie-Website-Font') format('svg');
    font-weight: normal;
    font-style: normal
}

[class^="icon-"], [class*=" icon-"] {
    font-family: 'MiFie-Website-Font' !important;
    speak: none;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale
}

.icon-home:before {
    content: "\e900"
}

.icon-bank-card:before {
    content: "\e901"
}

.icon-envelope:before {
    content: "\e902"
}

.icon-mobile:before {
    content: "\e903"
}

.icon-borrow:before {
    content: "\e904"
}

.icon-investment:before {
    content: "\e905"
}

.icon-money:before {
    content: "\e906"
}

.icon-gift:before {
    content: "\e907"
}

.icon-settings:before {
    content: "\e908"
}

.icon-user:before {
    content: "\e909"
}

.icon-key:before {
    content: "\e90a"
}

.icon-user-o:before {
    content: "\e90b"
}

.icon-image:before {
    content: "\e90c"
}

.icon-lock:before {
    content: "\e90d"
}

.icon-mobile-o:before {
    content: "\e90e"
}

.icon-message:before {
    content: "\e90f"
}

.icon-phone:before {
    content: "\e910"
}

.icon-management:before {
    content: "\e911"
}

.icon-user-money:before {
    content: "\e912"
}

.icon-coin:before {
    content: "\e913"
}

.icon-pie:before {
    content: "\e914"
}

.icon-ie:before {
    content: "\e915"
}

.icon-router:before {
    content: "\e916"
}

.icon-security:before {
    content: "\e917"
}

.icon-team:before {
    content: "\e918"
}

.icon-files:before {
    content: "\e919"
}

.icon-pencil-square:before {
    content: "\e91a"
}

.icon-list:before {
    content: "\e91b"
}

.icon-user-phone:before {
    content: "\e91c"
}

.icon-text-ok:before {
    content: "\e91d"
}

.icon-protect:before {
    content: "\e91e"
}

.icon-folder:before {
    content: "\e91f"
}

.icon-check:before {
    content: "\e920"
}

.icon-information:before {
    content: "\e921"
}

.icon-calculator:before {
    content: "\e922"
}

.icon-ordered:before {
    content: "\e923"
}

.icon-pencil-text-o:before {
    content: "\e924"
}

.icon-security-o:before {
    content: "\e925"
}

.icon-telephone:before {
    content: "\e926"
}

.icon-hna:before {
    content: "\e927"
}

.icon-usd:before {
    content: "\e928"
}

.icon-cis:before {
    content: "\e929"
}

.icon-china-life:before {
    content: "\e92a"
}

.icon-safe360:before {
    content: "\e92b"
}

.icon-baidu:before {
    content: "\e92c"
}

.icon-insurance:before {
    content: "\e92d"
}

.icon-reuters:before {
    content: "\e92e"
}

.icon-picc:before {
    content: "\e92f"
}

.icon-union-pay:before {
    content: "\e930"
}

.icon-cfca:before {
    content: "\e931"
}

.icon-wechat:before {
    content: "\e932"
}

.icon-wechat-o:before {
    content: "\e933"
}

.icon-usd-barchart:before {
    content: "\e934"
}

.icon-left-arrow:before {
    content: "\e935"
}

.icon-money-bag:before {
    content: "\e936"
}

.icon-pay-square:before {
    content: "\e937"
}

.icon-footer-360:before {
    content: "\e938"
}

.icon-footer-chinanet:before {
    content: "\e939"
}

.icon-footer-icann:before {
    content: "\e93a"
}

.icon-footer-cfca:before {
    content: "\e93b"
}

.icon-footer-zx110:before {
    content: "\e93c"
}

.icon-footer-trade:before {
    content: "\e93d"
}

.icon-voice:before {
    content: "\e93e"
}

.icon-weibo:before {
    content: "\e93f"
}

.icon-book:before {
    content: "\e940"
}

.icon-service-o:before {
    content: "\e941"
}

.icon-service:before {
    content: "\e942"
}

.icon-mobile-2:before {
    content: "\e943"
}

.icon-right-arrow:before {
    content: "\e944"
}

.icon-logo:before {
    content: "\e945"
}

.icon-weijinsuo:before {
    content: "\e946"
}

.icon-footer-trust:before {
    content: "\e948"
}

.icon-icann:before {
    content: "\e94a"
}

.icon-industry:before {
    content: "\e94b"
}

.icon-cfca2:before {
    content: "\e949"
}

.icon-360:before {
    content: "\e947"
}

.icon-inquiry:before {
    content: "\e94d"
}

.icon-netChina:before {
    content: "\e94c"
}

.icon-trusted:before {
    content: "\e94e"
}

.icon-unionpay:before {
    content: "\e94f"
}

.icon-hand:before {
    content: "\e950"
}

.icon-lock2:before {
    content: "\e951"
}

.icon-capital:before {
    content: "\e952"
}

.icon-dollar:before, .icon-dollar1:before, .icon-dollar2:before {
    content: "\e953"
}

.icon-unionpaySquare:before {
    content: "\e954"
}

.icon-uniE955:before {
    content: "\e955"
}

.icon-uniE956:before {
    content: "\e956"
}

.icon-uniE957:before {
    content: "\e957"
}

.icon-borrower:before {
    content: "\e958"
}

.icon-security2:before {
    content: "\e959"
}

.icon-appointment:before {
    content: "\e95a"
}

.icon-purpose:before {
    content: "\e95b"
}

.icon-calculator2:before {
    content: "\e95c"
}

.icon-search:before {
    content: "\e95d"
}

.icon-downArrow:before {
    content: "\e95e"
}

.icon-entry:before {
    content: "\e95f"
}

.icon-approach:before {
    content: "\e960"
}

.icon-scope:before {
    content: "\e961"
}

.icon-institution:before {
    content: "\e962"
}

.icon-pencil:before {
    content: "\e963"
}

.icon-ok-o:before {
    content: "\e964"
}

.icon-warn:before {
    content: "\e965"
}

.icon-triangle:before {
    content: "\e966"
}

.icon-check:before {
    content: "\e967"
}

.icon-wrong:before {
    content: "\e968"
}

.icon-account:before {
    content: "\e969"
}

.icon-envelope-o:before {
    content: "\e96a"
}

.icon-invitation:before {
    content: "\e96b"
}

.icon-locked:before {
    content: "\e96c"
}

.icon-growing:before {
    content: "\e96d"
}

.icon-cost:before {
    content: "\e96e"
}

.icon-term:before {
    content: "\e96f"
}

.icon-perLimit:before {
    content: "\e970"
}

.icon-oriBorrower:before {
    content: "\e971"
}

.icon-refresh:before {
    content: "\e972"
}

.icon-product:before {
    content: "\e973"
}

.icon-income:before {
    content: "\e974"
}

.icon-unionPaySmall:before {
    content: "\e975"
}

.icon-calendar:before {
    content: "\e976"
}

.icon-package:before {
    content: "\e977"
}

.icon-leftLimit:before {
    content: "\e978"
}

.icon-great:before {
    content: "\e979"
}

.icon-shield:before {
    content: "\e97a"
}

.icon-legal:before {
    content: "\e97b"
}

.icon-authentication:before {
    content: "\e97c"
}

.icon-stock:before {
    content: "\e97d"
}

.icon-requirement:before {
    content: "\e97e"
}

.icon-validity:before {
    content: "\e97f"
}

.icon-cash:before {
    content: "\e980"
}

.icon-envelope2:before {
    content: "\e981"
}

.icon-rocket:before {
    content: "\e982"
}

.icon-squre-plus:before {
    content: "\e983"
}

.icon-squre-minus:before {
    content: "\e984"
}

.icon-circle-plus:before {
    content: "\e985"
}

.icon-circle-minus:before {
    content: "\e986"
}

.icon-home-m:before {
    content: "\e987"
}

.icon-person-m:before {
    content: "\e988"
}

.icon-loan-m:before {
    content: "\e989"
}

.icon-msg:before {
    content: "\e98a"
}

.icon-asset:before {
    content: "\e98b"
}

.icon-alarm-clock:before {
    content: "\e98c"
}

.icon-huaxing:before {
    content: "\e98d"
}

.icon-cunguan:before {
    content: "\e98e"
}

.icon-borrowRecords:before {
    content: "\e98f"
}

.icon-capitalSecurity:before {
    content: "\e990"
}

.icon-investmentRecord:before {
    content: "\e991"
}

.icon-transactionRecord:before {
    content: "\e992"
}

.icon-Bank-card:before {
    content: "\e98e"
}

.icon-Computer-account:before {
    content: "\e98f"
}

.icon-Investment:before {
    content: "\e990"
}

.icon-Mobile-account:before {
    content: "\e991"
}

.icon-Real-name-authentication:before {
    content: "\e992"
}

.icon-Recharge:before {
    content: "\e993"
}

.icon-Withdrawals:before {
    content: "\e994"
}

.icon-next:before {
    content: "\e995"
}

.icon-last:before {
    content: "\e996"
}

.icon-first:before {
    content: "\e997"
}

.icon-previous:before {
    content: "\e998"
}

.icon-qa:before {
    content: "\e999"
}

.icon-investor:before {
    content: "\e99a"
}

index.css

/**
*Created by xxc on 2019/2/17
*/
/*头部区域*/
.navbar-xxc {
    background-color: #fff;
    border-bottom: 1px solid #f5f5f5;

}
.navbar-xxc .navbar-brand {
    color: #777;
}
.navbar-xxc .navbar-brand:hover,
.navbar-xxc .navbar-brand:focus {
    color: #5e5e5e;
    background-color: transparent;
}
.navbar-xxc .navbar-text {
    color: #777;
}
.navbar-xxc .navbar-nav > li > a {
    color: #777;
}
.navbar-xxc .navbar-nav > li > a:hover,
.navbar-xxc .navbar-nav > li > a:focus {
    color: #333;
    background-color: transparent;
}
.navbar-xxc .navbar-nav > .active > a,
.navbar-xxc .navbar-nav > .active > a:hover,
.navbar-xxc .navbar-nav > .active > a:focus {
    color: #555;
}
.navbar-xxc .navbar-nav > .disabled > a,
.navbar-xxc .navbar-nav > .disabled > a:hover,
.navbar-xxc .navbar-nav > .disabled > a:focus {
    color: #ccc;
    background-color: transparent;
}
.navbar-xxc .navbar-toggle {
    border-color: #ddd;
}
.navbar-xxc .navbar-toggle:hover,
.navbar-xxc .navbar-toggle:focus {
    background-color: #ddd;
}
.navbar-xxc .navbar-toggle .icon-bar {
    background-color: #888;
}
.navbar-xxc .navbar-collapse,
.navbar-xxc .navbar-form {
    border-color: #e7e7e7;
}
.navbar-xxc .navbar-nav > .open > a,
.navbar-xxc .navbar-nav > .open > a:hover,
.navbar-xxc .navbar-nav > .open > a:focus {
    color: #555;
}

.navbar-xxc .navbar-link {
    color: #777;
}
.navbar-xxc .navbar-link:hover {
    color: #333;
}
.navbar-xxc .btn-link {
    color: #777;
}
.navbar-xxc .btn-link:hover,
.navbar-xxc .btn-link:focus {
    color: #333;
}
.navbar-xxc .btn-link[disabled]:hover,
fieldset[disabled] .navbar-xxc .btn-link:hover,
.navbar-xxc .btn-link[disabled]:focus,
fieldset[disabled] .navbar-xxc .btn-link:focus {
    color: #ccc;
}

.topbar {
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #c0c0c0;
}
.topbar span,.topbar a{
    font-size: 12px;
    color: #414141;
}
.topbar span.line{
    color: #ccc;
    margin: 0 4px;
}
header .navbar-nav{
    font-size: 16px;
}
header .icon-logo{
    color: #dd3137;
    font-size: 38px;
    margin-right: 8px;
}
header .icon-weijinsuo{
    color: #424242;
    font-size: 24px;
}
header .navbar-nav>li>a{
    line-height: 47px;
}
header .navbar-nav>li.active{
    border-bottom: 3px solid crimson;
}
header .navbar-nav>li:hover{
    border-bottom: 3px solid crimson;
}
header .navbar-nav>li:last-of-type:hover{
    border-bottom: 3px solid transparent;
}
header .navbar-nav .icon-account{
    font-size: 20px;
    margin-right: 5px;
    vertical-align: middle;
}
header .navbar{
    margin-bottom: 0;
}
#main_ad .carousel-inner div.item{
    background-position: center center;
    background-size: auto 100%;
}
#main_ad .item img{
    width: 100%;
}
@media (min-width: 768px) {
    #main_ad .carousel-inner div.item{
        height: 410px;
    }
}
header .navbar-xxc{
    top: 0;
    width: 100%;
    z-index: 2;
}

/*notice*/
#notice .top{
    border-bottom: 1px solid #c0c0c0;
}
#notice .top .jd{
    margin-right: 10px;
}
#notice .top .row div{
    height: 60px;
    line-height: 60px;
}
#notice .bottom{
    margin-top: 50px;
}
#notice .bottom i{
    font-size: 80px;
    color: #666;
    display: block;
    width: 80px;
    height: 80px;
    transition: all 0.5s ease-in-out;
}
#notice .bottom .left i:hover{
    transform: rotate(360deg);

}
#notice .bottom .left{
    border-right: 1px solid #EFEFEF;
}
#notice .bottom .left h3{
    font-size: 20px;
    color: #475b66;
    margin-top: 10px;
}
#notice .bottom .left p{
    font-size: 14px;
    color: #666;
    line-height: 40px;
}
#notice .bottom .right p{
    font-size: 14px;
    color: #999;
    margin-bottom: 5px;
    width: 160px;
}
#notice .bottom .right h3{
    font-size: 24px;
    color: #dd3137;
    margin-top: 0;
    margin-bottom: 0;
}
#notice .bottom .right>div{
    margin-bottom: 25px;
}
#notice {
    margin-bottom: 40px;
}
@media (max-width: 768px) {
    #notice .top,#notice .bottom{
        padding-left: 20px;
    }

}
/*特别推荐*/
#recommend{
    background-color: #f0f0f0;
    padding-top: 20px;
}
#recommend .nav-tabs>li>a{
    border: none;
    border-bottom: 3px solid transparent;
}
#recommend .nav-tabs>li.active>a,
#recommend .nav-tabs>li>a:hover{
    border-bottom: 3px solid red;
    background-color: #f0f0f0;
}
#recommend .nav-tabs>li:last-child>a:hover{
    border-bottom: 3px solid transparent;
}
#recommend .tab-content{
    padding-top: 10px;
}
#recommend .tab-content li{
    padding: 10px;
    color: #fff;
}
#recommend .tab-content li>div>div{
    background-color: #E9232C;
    height: 140px;
}
#recommend .tab-content li .panel-left{
    border-right: 1px dashed #c0c0c0;
    padding: 20px;
    position: relative;
}
#recommend .tab-content h3{
    font-size: 18px;
    margin-bottom: 10px;
}
#recommend .tab-content li .panel-right{
    text-align: center;
    padding-top: 36px;

}
#recommend .tab-content li .panel-right strong{
    font-size: 36px;
}
#recommend .tab-content .panel-left:before,#recommend .tab-content .panel-left:after{
    content: "";
    width: 16px;
    height: 16px;
    border-radius: 8px;
    position: absolute;
    right: -8px;
    background-color: #f0f0f0;
    z-index: 1;
}
#recommend .tab-content .panel-left:after{
    bottom: -8px;
    box-shadow: 0 2px 1px #ccc inset;
}
#recommend .tab-content .panel-left:before{
    top:-8px;
}

/**
*news
*/
#news {
    background-color: #F0F0F0;
    padding: 20px 36px;
}
@media (max-width: 768px) {
    #news {
        padding: 20px 0px;
    }
    #news .tt{
        border-top: 1px solid #c0c0c0;
    }
}
#news .mtbd img{
    width: 130px;
    height: 90px;
}
#news .mtbd h4{
    font-size: 16px;
}
#news .mtbd .media-body p{
    color: #999;
    line-height: 23px;
    overflow: hidden;
    font-size: 14px;
    word-break: break-all;
}
#news .row>div{
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
}
#news .mtbd{
    margin-right: 30px;
}
#news .tt{
    padding-right: 22px;
    float: left;
}
@media (min-width: 768px) {
    #news .tt{
        height: 278px;
    }
}
#news .tt li a{
    color: #333;
    font-size: 16px;
}
#news .tt li{
    line-height: 38px;
}
#news span{
    font-size: 18px;
}
#news span.right{
    color: #dd3137;
}
/**
*footer
*/
footer {
    background-color: #333;
    padding: 40px 0 20px 0;
    color: #fff;
}

footer a {
    color: #ccc;
}

footer a:hover {
    color: #ccc;
}

footer .footer-wjs {
    color: #fff;
}

footer .footer-fw {
    color: #ccc;
    position: relative;
}

footer .footer-wjs h3 {
    padding: 5px 10px;
    border: 1px solid #fff;
    width: 225px;
    font-size: 25px;
    text-align: center;
    letter-spacing: 2px;
}

footer .icon-logo {
    font-size: 28px;
    margin-right: 5px;
}

footer .icon-weijinsuo {
    font-size: 17px;
}

footer .footer-fw .fwrx {
    display: block;
    height: 26px;
    line-height: 20px;
}

footer .icon-service {
    margin-right: 5px;
}

footer .wj {
    position: absolute;
    left: 160px;
    bottom: 5px;
}
footer .footer-about{
    margin-left: -42px;
    margin-right: 42px;
}
footer .footer-about dl {
    float: left;
    width: 120px;
}

footer .footer-about dt {
    font-size: 18px;
}

footer .footer-about dt a {
    color: #fff;
}

footer .footer-about dd {
    margin: 10px 0;
    font-size: 14px;
    line-height: 28px;
}

footer .footer-corp h4 {
    margin-top: 0;
}

footer .footer-corp a {
    display: block;
    width: 75px;
    height: 75px;
    background-color: #ccc;
    border-radius: 10px;
    float: left;
    margin: 6px;
    text-align: center;
}

footer .footer-corp i {
    display: block;
    color: #585453;
    font-size: 58px;
    width: 75px;
    height: 75px;
    padding: 10px 0;
}

footer .footer-corp i:hover {
    color: #df3232;
}

footer .footer-bot {
    height: 120px;
    margin-top: 40px;
    border-top: 1px dashed #c0c0c0;
    padding-left: 20px;
}

footer .footer-bot .first ul {
    margin-right: 100px;
}

footer .footer-bot .first li {
    float: left;
    height: 60px;
    width: 90px;
    line-height: 60px;
}

footer .footer-bot .first span {
    float: left;
    height: 60px;
    line-height: 60px;
    margin-left: 52px;
    color: #c0c0c0;
}

footer .police {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: url("../img/police.png") no-repeat;
}

footer .second {
    clear: both;
}

footer .second li {
    float: left;
    font-size: 34px;
    background: #BCBCBC;
    margin-right: 25px;
    text-align: center;
}

footer .second li.zx a {
    display: block;
    width: 125px;
    height: 50px;
}

footer .second li a {
    color: #333;
}

footer .second li i {
    display: inline-block;
    width: 125px;
    height: 50px;
    padding-top: 5px;
}

footer .second li i:hover {
    color: #fff;
}

footer .second li:nth-child(1) i:hover {
    background-color: #00314B;
}

footer .second li:nth-child(2) i:hover {
    background-color: #B38D39;
}

footer .second li:nth-child(4) i:hover {
    background-color: #58A433;
}

footer .second li:nth-child(5) i:hover {
    background-color: #0C6493;
}

footer .second li:nth-child(6) i:hover {
    background-color: #62B52F;
}

footer .second li:nth-child(7) i:hover {
    background-color: #D01029;
}

footer .second li:nth-child(8) i:hover {
    background-color: #E40000;
}

index.js

/**
 *Created by xxc on 2019/2/17
 */
$(function () {
    /*轮播图*/
    var windowWidth = $(window).width();
    function resize() {
        var isSmallScreen = windowWidth < 768;
        $("#main_ad > .carousel-inner > .item").each(function (i,item) {
            var $item = $(item);
            var img_src = $item.data(isSmallScreen ? "image-xs":"image-lg");
            $item.css("backgroundImage","url("+img_src+")")
            if(isSmallScreen){
                $item.html('<img src="' + img_src + '" alt="" />');
            }else {
                $item.empty();
            }
        })
    }
    $(window).on('resize', resize).trigger('resize');

    /*特别推荐标签页*/
    var width = 0;//标签头的宽度

    $("#recommend .tab-wrapper li").each(function (i,item) {
        var $item = $(item);
        width += $item.width();
    })
    if(width>windowWidth){
        $("#recommend .tab-wrapper ").css("overflow-x","scroll");
        $("#recommend .tab-wrapper>ul").css("width",width);
    }
    var startX,endX;
    var offset = 50;//控制精度
    $(".carousel").on("touchstart",function (e) {
        startX = e.originalEvent.touches[0].clientX;
    })
    $(".carousel").on('touchmove', function(e) {
        endX = e.originalEvent.touches[0].clientX;
    });
    $(".carousel").on('touchend', function(e) {
        var distance = Math.abs(startX - endX);
        if (distance > offset) {
            $(this).carousel(startX > endX ? 'next' : 'prev');
        }
    })
})

 

posted on 2018-10-05 20:48  xxcxxc  阅读(565)  评论(0编辑  收藏  举报