_index.scss 4.12 KB
@charset "utf-8";
/*
 * @description: index css
 * @author: chenglong.wang@yoho.cn
 * @date: 2015/4/16
 */

//banner
.banner {
    width: 100%;
    height: 220px;
    margin-bottom: 15px;
    position: relative;

    .swiper-container, .swiper-slide, img {
        width: 320px;
        height: 200px;
        display: block;
        overflow: hidden;
    }

    .swiper-slide {
        float: left;
    }

    .pagination-wrap {
        position: relative;
        margin-top: 10px;
        text-align: center;
    }

    .pagination {
        height: auto;
        overflow: hidden;
        display: inline-block;
        margin: 0 auto;
    }

    .swiper-pagination-switch {
        @include retina-sprite($icons, normal-new);
        margin-right: 5px;
        float: left;
        &:nth-last-of-type(1) {
            margin-right: 0;
        }
        &.swiper-active-switch {
            @include retina-sprite($icons, active-new);
        }
    }

    //only one
    .home-banner {
        width: 100%;
        img {
            width: 320px;
        }
    }
}

//content
.home-content {
    margin: 20px 15px 0 15px;

    @each $channel in fashion, lifestyle, video {
        .channel-#{$channel} {
            .img-link {
                position: relative;
                display: block;
                width: 290px;
                height: 185px;

                &:after {
                    content: '';
                    @include retina-sprite($icons, channel-#{$channel});
                    position: absolute;
                    right: -5px;
                    bottom: -5px;
                }

                img {
                    width: 100%;
                    height: auto;
                }
            }
        }
    }

    #pop {
        .img-link {
            width: 290px;
            height: 390px;
            background: #ffe558;
            overflow: hidden;
            padding: 30px 10px 10px 10px;
            @include box-sizing();

            &:before {
                content: '';
                @include retina-sprite($icons, pop, true, false);
                top: 4px;
            }

            &:after {
                display: none;
            }
            img {
                width: 270px;
                height: 350px;
                margin: 0 auto;
                display: block;
                overflow: hidden;
            }
        }
    }

    .content-item {
        width: 100%;
        height: auto;
        margin-bottom: 35px;
        padding-bottom: 35px;
        border-bottom: 1px solid #272727;

        > h2, > h3, > time {
            text-align: center;
            display: block;
            width: 100%;
        }

        > h2, > time {
            margin-top: 15px;
        }

        > h2, > h3 {
            line-height: 24px;
            font-size: 2rem;
            font-weight: bold;
            color: #000;
        }

        > h3 {
            margin-top: 2px;
        }

        > time {
            font-size: 1.4rem;
            font-weight: normal;
            color: #999;
            text-transform: capitalize;

            a {
                color: #999;
            }
        }
        > p {
            line-height: 23px;
            margin-top: 12px;
            text-align: center;
            display: block;
            width: 100%;
            font-size: 1.4rem;

            a {
                color: #000;
                display: block;
            }
        }
    }
}

@each $channelColor, $channelTitle in (fashion, #9b90ff),
    (beauty, #ffcaca),
    (sport, #84e3ca),
    (lifestyle, #ffca72),
    (magazine, #7ecaff),
    (video, #c9caca) {


    ##{$channelColor} {
        //各频道角标颜色
        .img-link {
            &:after {
                @include retina-sprite($icons, channel-#{$channelColor});
            }
        }

        //各频道主副标题颜色
        .content-item {

            > h2, h3 {
                color: $channelTitle;
            }
        }
    }
}