hummingbird-me/kitsu-web

View on GitHub
app/styles/pages/_media-browse.scss

Summary

Maintainability
Test Coverage
.browse-page {
  padding-top: 0;
  .global-container {
    max-width: 100%;
    min-height: 100vh;
    padding-top: 42px;
    background: linear-gradient(90deg, $secondary-background-color 50%, $background-color 50%);
    @media (max-width: 768px) {
      background: $background-color;
      padding-left: 5px;
      padding-right: 15px;
    }
  }
}

.media-browse {
  margin: 0 auto;
  margin-bottom: -42px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  .row {
    position: relative;
  }
  .filter-options {
    background-color: $secondary-background-color;
    border-right: 1px solid darken($secondary-background-color, 10);
    border-left: 1px solid darken($secondary-background-color, 10);
    width: 240px;
    padding: 0;
    bottom: 0;
    user-select: none;
    cursor: default;
    height: calc(100vh - 42px);
    position: fixed;
    top: 42px;
    @media (max-width: 768px) {
      position: unset;
      width: 100%;
      height: unset;
    }
  }
  .filter-wrapper {
    height: 100%;
    padding-top: 20px;
    overflow: auto;
  }

  .media-grid {
    position: relative;
    background: $background-color;
    .media-posters {
      min-width: 100%;
      min-height: calc(100vh - 42px);
      padding: 75px 0 75px 280px;
      padding-right: 0;
      overflow: hidden;
      @media (max-width: 768px) {
        padding: 0 15px;
        margin-left: unset;
      }
      .row {
        @media (max-width: 768px) {
          margin-left: 0;
        }
        .media-posters-list {
          display: flex;
          flex-wrap: wrap;
          width: 100%;
        }
      }
    }
    .poster-wrapper {
      padding-right: 15px;
      margin-bottom: 15px;
      position: relative;
      img {
        border-radius: 3px;
      }
      @media (min-width: 1421px) {
        width: 20%;
      }
      @media (max-width: 1420px) {
        width: 20%;
      }
      @media (max-width: 1220px) {
        width: 25%;
      }
      @media (max-width: 990px) {
        width: 50%;
      }
      .media-title {
        color: $body-text-color;
        font-size: 12px;
        font-weight: 600;
      }
    }
    .grid-poster {
      position: relative;
      cursor: pointer;
      .poster-overlay {
        opacity: 0;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 3px;
        > a {
          display: block;
          width: 100%;
          height: 100%;
        }
        .library-state {
          position: absolute;
          bottom: 0px;
          padding: 10px;
          width: 100%;
          button {
            padding: 8px;
            font-size: 12px;
            width: 100%;
          }
        }
      }
      &:hover {
        .poster-overlay {
          opacity: 1;
          background-image: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.8) 100%);
          background-size: auto 200%;
        }
      }
    }
    @media (max-width: 768px) {
      max-width: 100%;
      padding-left: 0px;
      padding-right: 0px;
      > .row {
        margin-left: -5px;
      }
      .filter-wrapper {
        display: flex;
        flex-wrap: wrap;
      }
      .filter-widget {
        flex: 1;
        // flex-shrink: 0;
        min-width: 50%;
        &:last-child {
          border-bottom: 0;
          margin-bottom: 0;
        }
      }
      .category-select {
        padding: 0 10px;
        margin-top: unset;
      }
      .media-category-filter {
        padding: unset;
        border-bottom: 0;
        .category-item-span {
          display: inline-block;
          height: 29px;
        }
      }
    }
    @media (max-width: 768px) and (min-width: 433px) {
      .filter-widget:nth-child(7) {
        border-bottom: 0;
        margin-bottom: 0;
      }
    }
    @media (max-width: 432px) {
      .filter-widget {
        min-width: 100%;
      }
    }
  }

  .media-poster-header {
    // TODO: @wopian search width spans remainder of page
    z-index: 11;
    color: $input-text-color;
    background: $foreground-background-color;
    position: fixed;
    top: 42px;
    width: 100%;
    margin-left: 240px;
    @media (min-width: 1200px) {
      max-width: 100%;
    }
    @media (max-width: 1199px) {
      max-width: 940px - 240px - 25px;
    }
    @media (max-width: 990px) {
      max-width: 720px - 240px - 25px;
    }
    @media (max-width: 768px) {
      padding: 0 0 0 10px;
      margin-left: unset;
      max-width: unset;
      position: unset;
    }
    .search-media {
      @extend .col-xs;
      position: relative;
      padding-right: 0;
      .filter-icon {
        left: 0;
        top: 6px;
      }
    }
    input {
      width: 40px;
      border: none;
      font-size: 16px;
      width: 100%;
      background: transparent;
      padding-right: 0;
    }

    .filter-container {
      display: flex;
      flex-flow: row wrap;
      width: 100%;
      overflow: hidden;
      word-wrap: break-word;
      padding: 15px 0;
      padding-left: 20px;
      border-bottom: 1px solid $divider-color;
    }

    .active-filter {
      position: relative;
      margin-right: 10px;
      color: $body-text-color;
      padding: 5px 10px;
      padding-right: 35px;
      border-radius: 3px;
      border: 1px solid $divider-color;
    }
    .tag-remove {
      position: absolute;
      right: 10px;
      top: 7px;
      svg {
        width: 16px;
        fill: #a5a5a5;
      }
      &:hover {
        svg {
          fill: #e74c3c;
        }
      }
    }
  }
  .sort-container {
    margin-bottom: 10px;
    .button {
      margin-top: 0;
      border: none;
      padding: 10px 0;
      color: $body-text-color;
      background: none;
      &:hover {
        color: $body-link-color;
        background: none;
      }
    }
  }
  // Filter widgets
  .filter-widget {
    border-bottom: 1px solid darken($secondary-background-color, 10);
    margin-bottom: 15px;
    padding: 10px;
    padding-bottom: 15px;
    padding-top: 0;
    &:last-child {
      margin-bottom: 0;
      border-bottom: none;
    }
    ul {
      list-style-type: none;
      padding: 0;
      margin: 0;
    }
  }
  .filter-slider--wrapper {
    padding: 0 11px 0 3px;
    margin-left: 7px;
    margin-right: -7px;
  }
  .filter-header {
    @extend .clearfix;
    .filter-title {
      float: left;
      color: #a3a9b7;
      font-size: 12px;
      line-height: 30px;
      font-weight: 600;
    }
    .filter-values {
      float: right;
      color: #a3a9b7;
      background: lighten($secondary-background-color,4);
      font-size: 12px;
      padding: 2px 10px;
      border-radius: 999em;
      position: relative;
      top: 3px;
    }
  }

  .category-filter {
    padding: 0;
    padding-bottom: 15px;
    .filter-header {
      padding: 0 10px;
    }
  }

  .filter-legend {
    @extend .clearfix;
    text-align: center;
    font-size: 12px;
    color: #a3a9b7;
    font-weight: 900;
    svg {
      width: 10px;
      fill: #a3a9b7;
    }
    .low-value {
      float: left;
    }
    .high-value {
      float: right;
    }
  }

.box-select {
    @extend .clearfix;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
    }
    li {
      background: $divider-color;
      height: 45px;
      width: calc(1 / 4 * 100% - (1 - 1 / 4) * 4px); // 4px = margin-right
      border-radius: 2px;
      margin-bottom: 5px;
      margin-right: 4px;
      text-align: center;
      background: lighten($secondary-background-color,4);
      &:nth-child(4n) {
        margin-right: 0;
      }
      &:hover {
        background: darken($secondary-background-color,4);
      }
      &.active {
        background: $white;
      }
      &.active {
        background: $white;
        &:hover {
          opacity: .8;
        }
        path {
          opacity: 1;
        }
      }
      &:not(.active) {
        path {
          fill: #a3a9b7;
          opacity: .5;
        }
        // VRV logo doesn't play nice with opacity
        .hide-inactive {
          display: none;
        }
      }
      svg {
        max-width: 32px;
        height: 26px;
        position: relative;
        top: 50%;
        transform: translateY(-50%);
      }
    }
  }

  .language-select {
    label {
      font-size: 12px;
      color: $background-color;
    }
    input {
      margin-bottom: 0;
    }
  }

  .rating-select {
    @extend .clearfix;
    margin-top: 20px;
    ul {
      list-style-type: none;
      margin: 0;
    }
    li {
      float: left;
      background: lighten($secondary-background-color,4);
      font-size: 12px;
      font-weight: 900;
      text-transform: uppercase;
      color: #a3a9b7;
      padding: 5px 10px;
      margin-right: 5px;
      margin-bottom: 5px;
      border-radius: 2px;
      &.active {
        background: #EDEEEF;
        color: $secondary-background-color;
        &:hover {
          background: #EDEEEF;
        }
      }
      &:hover {
        background: darken($secondary-background-color, 5);
      }
    }
  }

  .category-select {
    @extend .clearfix;
    margin-top: 20px;
    ul {
      list-style-type: none;
      margin: 0;
      padding: 0;
    }
    li {
      position: relative;
      a {
        color: #a3a9b7;
        font-weight: 600;
        display: block;
        padding: 5px 0px;
        padding-left: 10px;
        font-size: 13px;
        font-family: $base-font-family;
      }
      .include-genre, .exclude-genre {
        position: absolute;
        top: 4px;
        right: 10px;
        height: 20px;
        visibility: hidden;
        svg {
          width: 20px;
        }
        &[class*="hint--"]:after {
          box-shadow: none;
        }
      }
      .include-genre svg {
        fill: #2ecc71;
      }
      .exclude-genre svg {
        fill: #ACB4BF;
        &:hover {
          fill: #EF8F79;
        }
      }
      &.active {
        .include-genre {
          @extend .animated;
          @extend .fadeInRight;
          visibility: visible;
        }
        .exclude-genre {
          visibility: hidden;
        }
        a {
          background: darken($secondary-background-color,4);
          &:hover {
            background: darken($secondary-background-color,3);
          }
        }
        &:hover {
          .include-genre { visibility: hidden; }
          .exclude-genre { visibility: visible; }
        }
      }
      &:hover {
        .include-genre {
          visibility: visible;
        }
        a {
          background: lighten($secondary-background-color,4);
          text-decoration: none;
        }
      }
    }
  }

  .slider {
    background: lighten($secondary-background-color,4);
    height: 5px;
    border-radius: 999em;
    margin-bottom: 15px;
  }
  .slider-fill {
    background-color: #2EA291;
    height: 5px;
  }
  .noUi-handle {
    border-radius: 999em;
    background-color: #1ABC9C;
    height: 14px;
    width: 14px;
    top: -5px;
    &:after {
      display: block;
      content: '';
      background: lighten($secondary-background-color,4);
      position: absolute;
      top: 50%;
      left: 50%;
      margin-left: -3px;
      margin-top: -3px;
      width: 6px;
      height: 6px;
      border-radius: 999em;
    }
  }
  .noUi-handle,
  .noUi-target {
    cursor: pointer;
  }
  .noUi-base,
  .noUi-background {
    background: lighten($secondary-background-color,4);
    box-shadow: none;
  }
}

.media-trailer {
  padding: 0 !important;
  border-radius: 3px !important;
  .trailer-info {
    padding: 15px;
  }
  .info-header {
    border-bottom: 1px solid $divider-color;
  }
  ul {
    list-style-type: none;
    margin: 0;
    li {
      display: inline-block;
    }
  }
}

.media-category-filter {
  padding: { top: 10px; bottom: 10px }
  border: 0px solid darken($secondary-background-color, 10);
  border-bottom-width: 1px;

  .category-title {
    color: #a3a9b7;
    font-weight: bold;
    font-size: 13px;
    text-transform: uppercase;
  }

  .category-expand-btn {
    margin-left: 5px;
    margin-right: 5px;
    vertical-align: middle;
    &.is-active {
      svg {
        fill: #bbb;
      }
    }

    svg {
      width: 14px;
      height: 14px;
      fill: #777;
    }
  }

  .category-item-child {
    background: darken($secondary-background-color, 3);
    padding-top: 5px;
    min-height: 36px;
    cursor: pointer;

    &.no-children {
      padding-left: 28.52px;
    }

    &.has-children {
      .category-item-child {
        background: darken($secondary-background-color, 5);
        .category-item-child {
          background: darken($secondary-background-color, 7);
        }
      }
    }

    .category-item-span {
      display: block;

      .category-title {
        font-weight: normal;
        text-transform: none;
      }

      .include-category, .exclude-category {
        float: right;
        margin-right: 10px;
        display: none;
        svg {
          width: 20px;
          fill: #2ecc71;
          vertical-align: middle;
        }
        &[class*="hint--"]:after {
          box-shadow: none;
        }
      }

      .exclude-category svg {
        fill: #ACB4BF;
        &:hover {
          fill: #EF8F79;
        }
      }

      &:hover {
        .include-category {
          display: inherit;
          opacity: 0.7;
        }
      }

      &.active {
        .include-category {
          display: inherit;
        }
        .exclude-category {
          display: none;
        }
        &:hover {
          .include-category {
            display: none;
          }
          .exclude-category {
            display: inherit;
          }
        }
      }
    }
  }
}

.category-filter-skeleton {
  min-height: 47px;
  width: 100%;
  background: darken($secondary-background-color, 2);
  .category-filter-skeleton-item {
    width: 100%;
    height: 100%;
    border: 0px solid $secondary-background-color;
    border-top-width: 10px;
    border-bottom-width: 5px;
    border-left-width: 5px;
    border-right-width: 5px;
    background-color: transparent;
  }
}

.category-item-skeleton {
  min-height: 36px;
  width: 100%;
  background: darken($secondary-background-color, 5);
  .category-item-skeleton-item {
    width: 100%;
    height: 100%;
    border: 0px solid darken($secondary-background-color, 3);
    border-top-width: 5px;
    border-bottom-width: 5px;
    border-left-width: 5px;
    border-right-width: 5px;
    background-color: transparent;
  }
}