_side-nav.scss 5.62 KB
.side-nav {
    display: none;
    background: #fff;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 100rem / $pxConvertRem;
    width: 540rem / $pxConvertRem;
    background: #f0f0f0;
    z-index: 4;
    overflow: hidden;
    overflow-y: auto;
    @include transition(all .3s);

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

    li {
        position: relative;
        height: 74rem / $pxConvertRem;
        line-height: 74rem / $pxConvertRem;
        background: #fff;

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

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

        a {
            display: block;
            height: 100%;
            padding-left: 110rem / $pxConvertRem;
            color: #444;
        }

        em {
            font-weight: bold;
            font-size: 26rem / $pxConvertRem;
        }

        .title {
            display: inline-block;
            font-size: 36rem / $pxConvertRem;
            vertical-align: bottom;
            padding-left: 20rem / $pxConvertRem;
            // 此处字体小于 12px, 先扩大,再scale缩小
            @include transform(scale(0.5));

            -webkit-transform-origin: 0 50% 0;
            -moz-transform-origin: 0 50% 0;
            -ms-transform-origin: 0 50% 0;
            transform-origin: 0 50% 0;
        }

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

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

        &.highlight {
            background: #eee;
        }

    }

    .first {

        li {
            height: 86rem / $pxConvertRem;
            line-height: 86rem / $pxConvertRem;
            border-bottom: 1px solid #e0e0e0;

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

            &:after {
                content: none;
            }

            em {
                font-size: 36rem / $pxConvertRem;
            }

            .nav-img, .nav-icon {
                width: 48rem / $pxConvertRem;
                height: 48rem / $pxConvertRem;
                margin-top: -24rem / $pxConvertRem;
                left: 30rem / $pxConvertRem;
            }

        }

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

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

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

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

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

    li.guang, li.trendfinder {
        .nav-icon {
            background: image-url("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: 540rem / $pxConvertRem;
    background: #fff !important;
    overflow: hidden;

    @include transform(translateX(540rem / $pxConvertRem));
    @include transition(transform 0.3s);

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

        &:after {
            content: none;
        }

        a {
            position: relative;
            display: block;
            margin: 0 0 0 (30rem / $pxConvertRem);
            padding-left: 10rem / $pxConvertRem;
            font-size: 36rem / $pxConvertRem;
            z-index: 2;
        }

        .nav-point {
            position: absolute;
            left: 0rem / $pxConvertRem;
            font-size: 16rem / $pxConvertRem;
            color: #f0f0f0;
        }

        &.highlight {
            background: #eee;
        }

        em {
            font-weight: normal;
            font-size: 30rem / $pxConvertRem !important;
        }
    }

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

    li:first-child {
        height: 90rem / $pxConvertRem !important;
        line-height: 90rem / $pxConvertRem !important;
        background: #3e3e3e;

        a {
            color: #fff;
            border-bottom: none;
            padding-left: 70rem / $pxConvertRem;
        }

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

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