_side-bar.scss 4.41 KB
/**
 * Created by chenglong.wang@yoho.cn on 2014/1/6.
 */

#side-bar{
  width: 248px;
  height: 580px;
  min-height: 100%;
  background: #272727;
  top: 0;
  left: 0;
  position: absolute;
  padding: 0 15px;
  visibility: hidden;
  .side-bar-header{
    border-bottom: 1px solid #505050;
    height: 45px;
    line-height: 45px;
    color: #d7d7d7;
    font-size: 1.8rem;
    span.user-avatar{
      display: block;
      width: 32px;
      height: 32px;
      float: left;
      margin-right: 15px;
      margin-top: 7px;
      img{
        width: 100%;
        height: 100%;
        overflow: hidden;
        display: block;
        @include border-radius(16px);
      }
    }
  }
  >ul{
    margin-top: -10px;
    border-bottom: 1px solid #505050;
    padding-bottom: 25px;
    li{
      position: relative;
      height: 51px;
      a{
        margin-left: 3px;
      }
      span{
        float: left;
        color: #fff;
        font-size: 1.2rem;
        position: absolute;
        left: 200px;
        bottom: 0;
      }
      @each $i, $side in (1: home, 2: video, 3: fashion, 4: sports, 5: life-style, 6: map, 7: magazine) {
        //normal
        &:nth-of-type(#{$i}){
          &:before{
            content: '';
            @include retina-sprite($side-bar,#{$side}-logo,0,0);
            //float: left;
            background: none;
          }
          a{
            @include retina-sprite($side-bar,#{$side});
            //float: left;
            position: absolute;
            left: 55px;
            bottom: 0;
          }
        }
        &:nth-of-type(#{$i}).nav-active{
          &:before{
            @include retina-sprite($side-bar,#{$side}-logo,0,0);
          }
        }
      }
      &:nth-of-type(1){
        &:before{
          top: 25px;
        }
        &.nav-active{
          &:before{
            top: 25px;
          }
        }
        span{
          left: 135px;
        }
      }
      &:nth-of-type(2){
        &:before{
          top: 27px;
        }
        &.nav-active{
          &:before{
            top: 27px;
          }
        }
        span{
          left: 128px;
        }
      }
      &:nth-of-type(3){
        &:before{
          top: 20px;
        }
        &.nav-active{
          &:before{
            top: 20px;
          }
        }
        span{
          left: 148px;
        }
      }
      &:nth-of-type(4){
        &:before{
          top: 18px;
        }
        &.nav-active{
          &:before{
            top: 18px;
          }
        }
        span{
          left: 162px;
        }
      }
      &:nth-of-type(5){
        &:before{
          top: 18px;
        }
        &.nav-active{
          &:before{
            top: 18px;
          }
        }
        span{
          left: 198px;
        }
      }
      &:nth-of-type(6){
        &:before{
          top: 20px;
        }
        &.nav-active{
          &:before{
            top: 20px;
          }
        }
        span{
          left: 128px;
        }
      }
      &:nth-of-type(7){
        &:before{
          top: 20px;
        }
        &.nav-active{
          &:before{
            top: 20px;
          }
        }
        span{
          left: 185px;
        }
      }
    }
  }
  .side-bar-footer{
    ul{
      height: auto;
      overflow: hidden;
      text-align: center;
      color: #ababab;
      font-weight: bold;
      a{
        color: #ababab;
        @include unstyled-link();
      }
      &:nth-of-type(1){
        width: 180px;
        margin: 30px auto 0 auto;
        li{
          float: left;
          font-size: 1.8rem;
          width: 50%;
          position: relative;
          &:nth-of-type(1){
            &:after{
              content: '';
              display: block;
              width: 1px;
              height: 100%;
              background: #464646;
              position: absolute;
              top: 0;
              right: 0;
            }
          }
          /*&:nth-of-type(2){
            &:after{
              content: '';
              @include retina-sprite($side-bar,language,false,true);
              right: 0;
            }
          }*/
        }
      }
      &:nth-of-type(2){
        margin: 30px auto 0 auto;
        font-size: 1.4rem;
        li{
          width: 25%;
          float: left;
        }
      }
      &:nth-of-type(3){
        margin: 20px auto 0 auto;
        width: 50%;
        font-size: 1.4rem;
        li{
          width: 50%;
          float: left;
        }
      }
    }
  }
}