nukeop/nuclear

View on GitHub
packages/ui/lib/components/QueueItem/styles.scss

Summary

Maintainability
Test Coverage
@import "../../common.scss";

.queue_item {
  @include roundCorners;

  display: flex;
  position: relative;
  flex-flow: row;
  flex: 0 0 auto;
  height: 4em;
  margin: 0.5em;
  margin-top: 0;
  overflow: hidden;
  background-color: rgba($background2, 0.5);

  .thumbnail {
    @include center;

    position: relative;
    display: flex;
    width: 3em;
    min-width: 3em;
    height: 3em;
    margin: 0.5em;
    z-index: 10;

    img {
      @include circle;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .thumbnail_overlay {
    @include center;
    @include circle;
    @include transition;

    position: absolute;
    display: flex;
    width: 100%;
    height: 100%;
    background: $black;
    color: $white;
    opacity: 0;
    cursor: pointer;

    &:hover {
      opacity: 0.85;
    }

    .icon {
      display: inline-flex;
      justify-content: center;
      align-items: center;
      margin: 0;
    }
  }

  &.current_song {
    background: rgba($green, 0.3);
  }

  &.error {
    background: rgba($red, 0.8);
  }

  &.compact {
    width: auto;
    height: auto;
    margin: 0.25em;
    padding: 0.25em;
    margin-top: 0.5px;

    .item_info_container,
    .item_duration_container {
      display: none;
    }

    .thumbnail {
      margin: 0;
      height: auto;
      width: 100%;
      min-width: auto;
      aspect-ratio: 1 / 1;
    }

    .thumbnail_overlay {
      height: 100%;
      width: 100%;
    }

    .compact_loader {
      width: 100%;
      height: 100%;

      span {
        border-width: 4px;
      }
    }
  }

  .error_overlay {
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    text-align: center;
    font-size: 12px;
    pointer-events: none;
    margin: 0.5em;

    .error_message {
      font-weight: bold;
    }
  }
}

.item_info_container {
  @include ellipsis;

  display: flex;
  margin: 0.25em;
  flex: 1 1 auto;
  flex-flow: column;
  justify-content: center;

  .name_container {
    @include ellipsis;
    margin-bottom: 0.25 em;
  }

  .artist_container {
    @include ellipsis;
    color: rgba($white, 0.5);
  }
}

.item_duration_container {
  display: flex;
  overflow: hidden;
  flex: 0 0 auto;
  flex-flow: column;
  justify-content: center;

  margin: 0 0.5em;

  .item_duration {
    color: rgba($white, 0.5);
  }
}