hummingbird-me/kitsu-web

View on GitHub
app/styles/pages/_library.scss

Summary

Maintainability
Test Coverage
.library-sidebar {
  max-width: 300px;
  padding: 0;
  .is-sticky {
    @media screen and (max-height: 780px) {
      position: relative;
      top: 0;
    }
  }
  .card {
    padding: 20px;
    padding-bottom: 1px;
  }
  hr {
    margin-bottom: 5px;
  }
  .library-manage-text {
    color: $body-secondary-text-color;
    font-size: 14px;
    text-align: center;
    margin-bottom: 10px;
    &:hover {
      color: $body-link-color;
    }
  }
  .library-issues {
    border: 1px solid $divider-color;
    padding: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-radius: 3px;
    .library-issues--title {
      position: relative;
      display: flex;
      justify-content: center;
      top: -21px;
      margin-bottom: -15px;
      > span {
        background-color: $background-color;
        font-weight: bold;
        font-size: 14px;
        color: $body-secondary-text-color;
        padding: 0 10px;
      }
    }
    .library-issues--action {
      font-size: 12px;
      border-bottom: 1px solid #ddd;
      margin-bottom: 8px;
      padding-bottom: 8px;
      &:last-child {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
      }
      button {
        float: right;
        padding: 2px 10px;
        position: relative;
        top: -2px;
      }
    }
  }
  @media (max-width: 543px) {
    order: -1;
    max-width: 100%;
    width: 100%;
    margin-top: -30px;
  }
}

.library-sections {
  list-style-type: none;
  padding: 0;
  margin-bottom: 20px;
  li {
    margin-bottom: 3px;
    &:first-child {
      border-top-left-radius: 3px;
      border-top-right-radius: 3px;
    }
    &:last-child {
      border-bottom-left-radius: 3px;
      border-bottom-right-radius: 3px;
    }
    a {
      font-family: $base-font-family;
      font-weight: 600;
      font-size: 14px;
      padding: 10px;
      display: block;
      .library-section--count {
        float: right;
        opacity: 0.6;
      }
      &:active,
      &:focus {
        text-decoration: none;
      }
      &:hover {
        @if $theme == "kitsu-dark" {
          color: $white !important;
        }
      }
      &.library-all {
        background: $library-all-background-color-inactive;
        color: $library-all-text-color;
        &:hover {
          background: $library-all-background-color-hover;
        }
      }
      &.status-current {
        background: $status-current-background-color-inactive;
        color: $status-current-text-color;
        &:hover {
          background: $status-current-background-color-hover;
        }
      }
      &.status-completed {
        background: $status-completed-background-color-inactive;
        color: $status-completed-text-color;
        &:hover {
          background: $status-completed-background-color-hover;
        }
      }
      &.status-hold {
        background: $status-hold-background-color-inactive;
        color: $status-hold-text-color;
        &:hover {
          background: $status-hold-background-color-hover;
        }
      }
      &.status-dropped {
        background: $status-dropped-background-color-inactive;
        color: $status-dropped-text-color;
        &:hover {
          background: $status-dropped-background-color-hover;
        }
      }
      &.status-planned {
        background: $status-planned-background-color-inactive;
        color: $status-planned-text-color;
        &:hover {
          background: $status-planned-background-color-hover;
        }
      }
    }
    &.active {
      a {
        box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
        position: relative;
        &.library-all {
          background: $library-all-background-color;
          color: $library-current-text-color;
        }
        &.status-current {
          background: $status-current-background-color;
          color: $library-current-text-color;
        }
        &.status-completed {
          background: $status-completed-background-color;
          color: $library-current-text-color;
        }
        &.status-hold {
          background: $status-hold-background-color;
          color: $library-current-text-color;
        }
        &.status-dropped {
          background: $status-dropped-background-color;
          color: $library-current-text-color;
        }
        &.status-planned {
          background: $status-planned-background-color;
          color: $library-current-text-color;
        }
      }
    }
  }
}

.library-tools {
  list-style-type: none;
  padding: 0;
  margin-bottom: 20px;
  font-size: 14px;
  li {
    border-bottom: 1px solid #eee;
    margin-bottom: 5px;
    &:last-child {
      border-bottom: none;
      margin-right: 0;
    }
  }
  a {
    color: $secondary-background-color;
    padding-bottom: 5px;
    display: block;
    width: 100%;
    &:hover {
      color: $body-link-color;
    }
  }
}

.library-search {
  width: 100%;
  margin-bottom: 10px;
  input {
    width: 100%;
    line-height: 50px;
    height: 50px;
    border: none;
    outline: none;
    font-family: $base-font-family;
    font-size: 1em;
    box-shadow: none;
    text-indent: 0;
    padding-left: 50px;
    padding-right: 40px;
    @if $theme == "kitsu-dark" {
      border: none;
    }
    @if $theme == "kitsu-light" {
      border: 1px solid $divider-color;
    }
    border-radius: 5px;
  }
  .library-search--wrapper {
    position: relative;
    width: 100%;
    .icon {
      position: absolute;
      left: 10px;
      top: 10px;
    }
    svg {
      width: 30px;
      height: 30px;
      fill: $body-secondary-text-color;
    }
    &:hover {
      svg {
        fill: $body-text-color;
      }
    }
  }
}

.library-result-header {
  font-size: 14px;
  margin-bottom: 10px;
}

.library-filters {
  font-size: 12px;
  float: right;
  .sorting {
    position: relative;
    top: 8px;
    &.sorting-asc {
      svg {
        transform: rotateX(180deg);
      }
    }
  }
}

.library-content {
  .media-browse {
    padding: 0;
    margin-bottom: 15px;
    .media-grid {
      padding-right: 8px;
      .poster-wrapper {
        padding-right: 10px;
        margin-bottom: 10px;
        img {
          border-bottom-left-radius: 0;
          border-bottom-right-radius: 0;
        }
        .grid-poster {
          background: darken($background-color, 10);
          min-height: 222px;
          border-top-left-radius: 3px;
          border-top-right-radius: 3px;
          .poster-overlay {
            background: rgba(0, 0, 0, 0.8);
          }
        }
      }
      .progress {
        position: absolute;
        bottom: 0px;
        height: 4px;
        margin-bottom: 0px;
        border-radius: 3px;
        .progress-bar {
          display: block;
          position: relative;
          height: 4px;
          background-color: rgba(0, 0, 0, 0.5);
          .progress-completed {
            position: absolute;
            top: 2px;
            left: 0;
            height: 2px;
            background-color: #ab8ea9;
          }
        }
      }
      .entry-stats {
        @if $theme == "kitsu-light" {
          background: $secondary-background-color;
        }
        @if $theme == "kitsu-dark" {
          background: $foreground-background-color;
        }
        border-bottom-left-radius: 3px;
        border-bottom-right-radius: 3px;
        color: $white;
        padding: 5px 10px;
        font-size: 12px;
        position: relative;
        .current-rating {
          color: $white;
          font-weight: normal;
        }
      }
      .entry-rating {
        float: right;
        display: inline-block;
        .no-rating {
          color: lighten($secondary-background-color, 35);
          &.is-owner {
            &:hover {
              color: $body-link-color;
              opacity: 1;
            }
          }
        }
      }
      .entry-rating-simple {
        margin-top: -12px;
        .no-rating {
          margin-top: 12px;
          display: block;
        }
        svg {
          width: 28px;
          height: 28px;
        }
        .is-owner {
          svg {
            &:hover {
              opacity: 0.8;
            }
          }
        }
      }
      .entry-rating-star {
        padding: 0 5px;
        border-radius: 3px;
        margin-right: -4px;
        svg {
          width: 12px;
          height: 12px;
          fill: #ebc83c;
          float: left;
          position: relative;
          top: 2px;
          margin-right: 5px;
        }
      }
    }
  }
}

// User Library
.library-list {
  @extend .card;
  border: 1px solid $divider-color;
  border-radius: 3px;
  padding: 0;
  margin-bottom: 20px;
  overflow-y: hidden;
  table {
    display: flex;
    flex-flow: column nowrap;
    justify-content: space-between;

  }
  thead,
  tbody {
    flex: 1;
    display: flex;
    flex-flow: column nowrap;
  }
  thead {
    background: $background-color;
    border-top: none;
    th {
      border: none !important;
      font-size: 12px;
      padding: 10px;
      text-align: center;
    }
  }
  td {
    vertical-align: middle;
    border-top: 1px solid $divider-color;
  }
  .td,
  .th {
    flex: 1;
    border: 1px solid $divider-color;
    display: flex;
    flex-flow: row nowrap;
    flex: 1 1 content;
    word-break: break-word;
    white-space: wrap;
    padding: 10px;
  }

  tr {
    display: flex;
    flex-flow: row nowrap;
    &:nth-child(even) {
      background: lighten($background-color, 1);
    }
    &.bulk-selected {
      background: #f5f6f7;
    }
  }
  .status {
    padding: 2px;
    margin-right: 8px;
    &.status-current {
      background: #2c3e50;
    }
    &.status-completed {
      background: #27ae60;
    }
    &.status-on_hold {
      background: #f39c12;
    }
    &.status-dropped {
      background: #a12f31;
    }
    &.status-planned {
      background: #2980b9;
    }
  }
  tbody {
    td {
      font-size: 14px;
    }
    .cell-title {
      font-weight: 500;
    }
  }
  .edit-entry {
    width: 80px;
    text-align: center;
    line-height: 35px;
  }
  .edit-entry-button {
    border: 1px solid $divider-color;
    padding: 5px 10px;
    border-radius: 3px;
    color: darken($divider-color, 20);
  }
  .media-cell {
    text-align: left;
    padding-left: 0;
    flex-grow: 1;
    min-width: 340px;
    .title-wrapper {
      display: block;
      max-width: 470px;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: initial;
      a {
        white-space: nowrap;
      }
    }
  }
  .release-status-cell {
    float: right;
    svg {
      position: relative;
      top: 7px;
      width: 20px;
      height: 20px;
      fill: $body-secondary-text-color;
    }
  }
  .simple-rating-cell {
    display: inline-block;
    height: 30px;
    width: 30px;
    position: relative;
    top: 2px;
    svg {
      width: 30px;
      height: 30px;
    }
  }
  .star-rating-cell {
    font-size: 14px;
    line-height: 35px;
    font-weight: 700;
    .entry-rating-star {
      svg {
        width: 14px;
        height: 14px;
        fill: #f0ad4e;
        float: left;
        position: relative;
        top: 10px;
        margin-right: 5px;
      }
      .current-rating {
        color: $body-text-color;
        font-weight: normal;
      }
    }
  }
  .increment-unit {
    svg {
      width: 15px;
      height: 15px;
      position: relative;
      top: 2px;
      fill: $primary-cta-color;
      &:hover {
        fill: darken($primary-cta-color, 15);
      }
    }
  }
  .rating-cell {
    min-width: 68px;
    text-align: center;
    border-left: 1px solid $divider-color;
    border-right: 1px solid $divider-color;
  }
  td.progress-cell {
    font-size: 14px;
    line-height: 35px;
    border-right: 1px solid $divider-color;
    text-align: right;
  }
  .progress-cell {
    text-align: center;
    min-width: 106px;
    a.link {
      color: $primary-cta-color;
      font-family: $base-font-family;
      font-weight: 700;
      &:hover {
        color: darken($primary-cta-color, 15);
      }
    }
    input {
      display: inline-block;
      max-width: 72px;
      min-width: 72px;
    }
  }
  .edit-entry-button {
    &:hover {
      color: $primary-cta-color;
      border-color: $primary-cta-color;
    }
  }
  .cell-poster {
    display: inline-block;
    width: 40px;
    height: 40px;
    border-radius: 3px;
    background: #ddd;
    float: left;
    margin-right: 15px;
    overflow: hidden;
  }
  .checkbox-cell {
    padding: 0.75rem 8px;
    margin-left: -8px;
    text-align: center;
    line-height: 40px;
  }
  .cell-title {
    a {
      color: $body-text-color;
      &:hover {
        color: $body-link-color;
      }
    }
  }
}

.library-type {
  float: left;
}

.library-status {
  float: right;
  .btn {
    border-color: $background-color;
    font-size: 12px;
    padding: 10px 15px;
    &:hover {
      background: darken($white, 2);
      border-color: $background-color;
    }
    &.active {
      background: lighten($background-color, 3);
      border-color: $background-color;
    }
  }
}

.entry-rating-empty {
  display: inline-block;
  position: relative;
  top: 8px;
  &.empty-rating-simple {
    top: 1px;
  }
  svg {
    fill: $divider-color;
    width: 24px;
    &.is-owner {
      &:hover {
        fill: $primary-cta-color;
      }
    }
  }
}

.star-full,
.star-half,
.star-variable {
  .star-rating-filled {
    stop-color: $rating-star-color;
  }
}

.list-type {
  display: inline-block;
  position: relative;
  top: 4px;
  svg {
    width: 25px;
    height: 25px;
    opacity: 0.4;
    fill: $body-text-color;
    cursor: pointer;
    &:hover {
      opacity: 1;
      fill: $body-link-color;
    }
  }
  .active {
    cursor: none;
    svg {
      opacity: 1;
      &:hover {
        fill: $body-text-color;
      }
    }
  }
}

.bulk-edit {
  background: #e6f0f7;
  border: 1px solid #c3d6e2;
  padding: 10px;
  margin-bottom: 10px;
  z-index: 1;
  top: 55px;
  color: #1b5172;
  font-size: 13px;
  .descriptor {
    margin-right: 10px;
  }
  .select-amount {
    color: #1b5172;
    font-weight: 700;
  }
  .media-selected {
    float: left;
    line-height: 31px;
  }
  .bulk-cta {
    float: right;
    position: relative;
    .bulk-btn {
      border: 1px solid #c2d3dc;
      padding: 5px 10px;
      border-radius: 3px;
      background: $white;
      color: #1b5172;
      display: inline-block;
      &.secondary {
        background: transparent;
      }
    }
    .ember-power-select {
      padding: 0;
      left: 30px;
    }
    .ember-power-select-option {
      border-bottom: 1px solid $divider-color;
      font-size: 12px;
      padding: 8px 10px;
      &:last-child {
        border-bottom: none;
      }
    }
  }
}

// Library List
.library-list-skeleton {
  min-height: 60px;
  .library-list-top {
    top: 0px;
    height: 12.5px;
    width: 100%;
  }
  .library-list-bottom {
    @extend .library-list-top;
    top: initial;
    bottom: 0px;
  }
  .library-list-start {
    width: 12px;
    height: 60px;
  }
  .library-list-title {
    width: 15px;
    height: 60px;
    left: 48px;
  }
  .library-list-end {
    @extend .library-list-start;
    right: 0;
  }
}

.library-list-pagination {
  margin-top: -20px;
}

.library-grid-skeleton {
  min-height: 250px;
  width: 100%;
  margin-bottom: 15px;
  .library-grid-first {
    width: 10px;
    height: 250px;
    @for $i from 0 to 5 {
      &:nth-child(#{$i}) {
        left: #{(153 * $i) + (10 * ($i - 1))}px;
      }
    }
  }
}

.library-empty-block {
  img {
    width: 200px;
    height: 200px;
  }
}

.entry-icons {
  margin-top: -2px;
  .reaction-status,
  .reaction-status--add {
    height: 20px;
    position: relative;
    top: 5px;
    svg {
      width: 20px;
      fill: $body-secondary-text-color;
      &:hover {
        fill: $body-link-color;
      }
      &::after {
        text-align: center;
      }
    }
  }
  .reaction-status--add {
    display: none;
    svg {
      fill: $body-secondary-text-color;
    }
  }
}

.media-cell {
  &:hover {
    .reaction-status--add {
      display: inline-block;
    }
  }
}

.grid-edit-wrapper {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 15px;
  text-align: center;
  padding: 0 10px;
  display: flex;
}

.grid-edit,
.grid-poster-link,
.grid-reaction--add,
.grid-reaction--more {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  font-size: 12px;
  padding: 2px;
  display: inline-block;
  width: 70%;
  color: rgba(255, 255, 255, 0.8);
  svg {
    fill: rgba(255, 255, 255, 0.8);
    width: 20px;
    height: 20px;
    position: relative;
    top: -1px;
  }
  &:hover {
    color: $body-link-color;
    border-color: $body-link-color;
    svg {
      fill: $body-link-color;
    }
  }
}

.grid-reaction--add,
.grid-reaction--more {
  width: 100%;
  text-align: center;
}

.grid-reaction--more {
  margin-right: 5px;
}

.grid-edit {
  margin-right: 5px;
  width: 300px;
}

.grid-poster-link {
  height: 24px;
}

.grid-reaction {
  position: absolute;
  bottom: 40px;
  padding: 10px;
  width: 100%;
  p {
    color: white;
    font-size: 12px;
    margin-bottom: 0;
  }
  a {
    color: $white;
    &:hover {
      color: $white;
      text-decoration: underline;
    }
  }
}