_side-nav.css 4.83 KB
.side-nav {
    display: none;
    background: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 100px;
    width: 540px;
    background: #f0f0f0;
    z-index: 4;
    overflow: hidden;
    overflow-y: auto;
    transition: all .3s;

    > ul {
        margin-bottom: 20px;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
    }

    li {
        position: relative;
        height: 76px;
        line-height: 76px;
        background: #fff;

        &:after {
            content: '';
            position: absolute;
            right: 0;
            bottom: 0;
            width: 430px;
            height: 0;
            border-top: 1px solid #e0e0e0;
        }

        &:last-child {
            &:after {
                content: none;
            }
        }

        a {
            display: block;
            height: 100%;
            padding-left: 110px;
            color: #444;
        }

        em {
            font-weight: bold;
            font-size: 26px;
        }

        .title {
            display: inline-block;
            font-size: 36px;
            vertical-align: bottom;
            padding-left: 20px;
            /*此处字体小于 12px, 先扩大,再scale缩小*/
            transform: scale(0.5);
            transform-origin: 0 50% 0;
        }

        .nav-icon, .nav-img {
            position: absolute;
            width: 38px;
            height: 38px;
            top: 50%;
            margin-top: -19px;
            left: 35px;
            background: no-repeat left center;
            background-size: 100% 100%;
        }

        .enter-subnav {
            position: absolute;
            right: 30px;
            top: 0;
            bottom: 0;
            font-size: 36px;
            color: #b0b0b0;
            font-weight: lighter;
        }

        &.highlight {
            background: #eee;
        }

    }

    .first {

        li {
            height: 88px;
            line-height: 88px;
            border-bottom: 1px solid #e0e0e0;

            &:last-child {
                border-bottom: none;
            }

            &:after {
                content: none;
            }

            em {
                font-size: 36px;
            }

            .nav-img, .nav-icon {
                width: 48px;
                height: 48px;
                margin-top: -24px;
                left: 30px;
            }

        }

        .sub-nav {
            li {
                border-bottom: 1px solid #e0e0e0;
            }
        }
    }

    li.boys {
        i {
            background: resolve("side-nav/boys.png") no-repeat left center;
            background-size: 100% 100%;
        }
    }

    li.girls {
        i {
            background: resolve("side-nav/girls.png") no-repeat left center;
            background-size: 100% 100%;
        }
    }

    li.kids {
        i {
            background: resolve("side-nav/kids.png") no-repeat left center;
            background-size: 100% 100%;
        }
    }

    li.life {
        i {
            background: resolve("side-nav/life.png") no-repeat left center;
            background-size: 100% 100%;
        }
    }

    li.guang, li.trendfinder {
        .nav-icon {
            background: resolve("side-nav/guang.png") no-repeat left center;
            background-size: 100% 100%;
        }
    }
}

.side-nav.on {
    display: block;
}

.sub-nav {
    display: none;
    position: fixed;
    bottom: 0;
    top: 0;
    left: 0;
    width: 540px;
    background: #fff !important;
    overflow: hidden;

    transform: translateX(540px);
    transition: transform 0.3s;

    li {
        height: 80px !important;
        line-height: 80px !important;
        border: none;
        border-bottom: 1px solid #e0e0e0;

        &:after {
            content: none;
        }

        a {
            position: relative;
            display: block;
            margin: 0 0 0 30px;
            padding-left: 10px;
            font-size: 36px;
            z-index: 2;
        }

        .nav-point {
            position: absolute;
            left: 0px;
            font-size: 16px;
            color: #f0f0f0;
        }

        &.highlight {
            background: #eee;
        }

        em {
            font-weight: normal;
            font-size: 30px !important;
        }
    }

    li:hover, li.current {
        .nav-point {
            color: #3e3e3e;
        }
    }

    li:first-child {
        height: 90px !important;
        line-height: 90px !important;
        background: #3e3e3e;

        a {
            color: #fff;
            border-bottom: none;
            padding-left: 70px;
        }

        .nav-back {
            position: absolute;
            left: 0;
        }
    }
}

.sub-nav.show {
    display: block;
    z-index: 1;
    transform: translateX(0);
    transition: transform 0.3s;
}