HabitatMap/AirCasting

View on GitHub
app/assets/stylesheets/modules/heatmap.scss

Summary

Maintainability
Test Coverage
.heatmap {
  @include flexbox;
  @include align-items(center);
  @include justify-content(space-between);
  background: white;
  box-shadow: $heatmap-shadow;
  flex: 1 0 $heatmap-height;
  padding: 0 18px;
  position: relative;
  width: calc(100vw - #{$filters-width});
  z-index: $heatmap-z-index;

  @media screen and (max-width: $tablet-max) {
    display: block;
    height: $heatmap-height-mobile;
    padding: 28px 16px 0;
    width: 100vw;
  }

  @media screen and (max-width: $large-mobile-max) {
    padding: 28px 10px 0;
  }
}

.heatmap-slider {
  flex: 1 1 80%;
  height: 3px;
  margin: 0 14px;

  @media screen and (max-width: $tablet-max) {
    margin: 0;
  }
}

.heatmap-input {
  @include flexbox;
  @include align-items(center);
  @include justify-content(space-between);

  input {
    border: 1px solid #e0e0e0;
    box-shadow: $delicate-shadow;
    font-size: $small-font;
    height: 25px;
    margin: 0 4px;
    width: 54px;
    text-align: center;
  }

  @media screen and (max-width: $tablet-max) {
    display: none;
  }
}

// Customised noUiSlider styles, based on version: nouislider - 13.1.4 - 3/20/2019

.noUi-target,
.noUi-target * {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  -ms-touch-action: none;
  touch-action: none;
  -ms-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.noUi-target {
  position: relative;
  direction: ltr;
}
.noUi-base,
.noUi-connects {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}
/* Wrapper for all connect elements.
 */
.noUi-connects {
  overflow: hidden;
  z-index: 0;
}
.noUi-connect,
.noUi-origin {
  will-change: transform;
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  -ms-transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
  -webkit-transform-style: preserve-3d;
  transform-origin: 0 0;
  transform-style: flat;
}
/* Offset direction
 */
html:not([dir="rtl"]) .noUi-horizontal .noUi-origin {
  left: auto;
  right: 0;
}
/* Give origins 0 height/width so they don't interfere with clicking the
 * connect elements.
 */
.noUi-vertical .noUi-origin {
  width: 0;
}

.noUi-horizontal .noUi-origin {
  height: 0;
}

.noUi-handle {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  position: absolute;
}

.noUi-touch-area {
  height: 100%;
  width: 100%;
}
.noUi-state-tap .noUi-connect,
.noUi-state-tap .noUi-origin {
  -webkit-transition: transform 0.3s;
  transition: transform 0.3s;
}
.noUi-state-drag * {
  cursor: inherit !important;
}
/* Slider size and handle placement;
 */
.noUi-horizontal .noUi-handle {
  width: 12px;
  height: 12px;
  left: -6px;
  top: -6px;
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
}

html:not([dir="rtl"]) .noUi-horizontal .noUi-handle {
  right: -17px;
  left: auto;
}
/* Styling;
 * Giving the connect element a border radius causes issues with using transform: scale
 */

.noUi-connects {
  border-radius: 3px;
}

/* Handles and cursors;
 */
.noUi-draggable {
  cursor: ew-resize;
}
.noUi-vertical .noUi-draggable {
  cursor: ns-resize;
}
.noUi-handle {
  border-radius: 12px;
  background: white;
  cursor: default;
  box-shadow: $darker-shadow;
}
.noUi-active {
  box-shadow: $darker-shadow;
}

/* Disabled state;
 */
[disabled] .noUi-connect {
  background: #b8b8b8;
}
[disabled].noUi-target,
[disabled].noUi-handle,
[disabled] .noUi-handle {
  cursor: not-allowed;
}
/* Base;
 *
 */
.noUi-pips,
.noUi-pips * {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}
.noUi-pips {
  position: absolute;
  color: #999;
}
/* Values;
 *
 */
.noUi-value {
  position: absolute;
  white-space: nowrap;
  text-align: center;
}
.noUi-value-sub {
  color: #ccc;
  font-size: 10px;
}
/* Markings;
 *
 */
.noUi-marker {
  position: absolute;
  background: #ccc;
}
.noUi-marker-sub {
  background: #aaa;
}
.noUi-marker-large {
  background: #aaa;
}
/* Horizontal layout;
 *
 */
.noUi-pips-horizontal {
  padding: 10px 0;
  height: 80px;
  top: 100%;
  left: 0;
  width: 100%;
}
.noUi-value-horizontal {
  -webkit-transform: translate(-50%, 50%);
  transform: translate(-50%, 50%);
}
.noUi-rtl .noUi-value-horizontal {
  -webkit-transform: translate(50%, 50%);
  transform: translate(50%, 50%);
}
.noUi-marker-horizontal.noUi-marker {
  margin-left: -1px;
  width: 2px;
  height: 5px;
}
.noUi-marker-horizontal.noUi-marker-sub {
  height: 10px;
}
.noUi-marker-horizontal.noUi-marker-large {
  height: 2px;
}

.noUi-tooltip {
  display: block;
  position: absolute;
  background: #fff;
  color: #000;
  padding: 0;
  text-align: center;
  white-space: nowrap;
}

.noUi-horizontal .noUi-tooltip {
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
  left: 50%;
  bottom: 120%;
}