cms/app-client/app/styles/components/player-sound-control.scss
author ymh <ymh.work@gmail.com>
Mon, 19 Dec 2016 21:58:02 +0100
changeset 477 ce52f0fca330
child 478 b621657bb436
permissions -rw-r--r--
add volume control to the player

.player-sound-control {

  & {
    margin: 0px 19px 0px 0px;
    font-size: 20px;
  }

  #sound-control-speaker {
    width: 2em;
    line-height: 80px;
  }

  #sound-control-speaker i {
    cursor: pointer;
    vertical-align: middle;
  }

  #sound-control-speaker i::before {
    font-size: 20px;
  }

  #sound-control-speaker i.fa-times::before {
    font-size: 16px;
  }

  #sound-control-speaker i.fa-volume-off+i.fa-times {
    display:inline-block;
  }

  #sound-control-speaker i.fa-times {
    display:none;
  }

  #sound-control-scale {
    background-color: $corpus-white;
    width: 1em;
    height: 90px;
    position: fixed;
    z-index: 1;
    display: none;
  }

  #sound-control-scale:hover {
    display: block;
  }

  .sound-control-scale-indicator {
    color: $corpus-black;
    text-align: center;
    display: table;
    margin: 0 auto;
    cursor: pointer;
    -webkit-touch-callout: none; /* iOS Safari */
      -webkit-user-select: none; /* Chrome/Safari/Opera */
       -khtml-user-select: none; /* Konqueror */
         -moz-user-select: none; /* Firefox */
          -ms-user-select: none; /* Internet Explorer/Edge */
              user-select: none;
  }

  .sound-control-scale-indicator[disabled] {
    color: $corpus-grey;
    cursor: default;
    pointer-events: none;
  }

  // taken from http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html

  .volume-slider {
    height: 5px;
    width: 50px;
    position: absolute;

    /*removes default webkit styles*/
    -webkit-appearance: none;

    transform: rotate(270deg) translate(-15px, -20px);
    -ms-transform: rotate(270deg) translate(30px, 20px);
    transform-origin: bottom;

  }
  .volume-slider::-webkit-slider-runnable-track {
    height: 5px;
    width: 50px;
    background: #ddd;
    border: none;
    border-radius: 3px;
    margin-top: 11px;
  }
  .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    border: none;
    height: 11px;
    width: 11px;
    border-radius: 50%;
    background: $corpus-blue;
    margin-top: -3px;
  }

  .volume-slider[disabled]::-webkit-slider-thumb {
    background: $corpus-grey;
  }

  .volume-slider:focus {
    outline: none;
  }
  .volume-slider:focus::-webkit-slider-runnable-track {
    background: #ccc;
  }

  .volume-slider::-moz-range-track {
    width: 50px;
    height: 5px;
    background: #ddd;
    border: none;
    border-radius: 2px;
  }

  .volume-slider::-moz-range-progress {
    background-color: $corpus-light-blue;
  }

  .volume-slider::-moz-range-thumb {
    border: none;
    height: 11px;
    width: 11px;
    border-radius: 50%;
    background: $corpus-blue;
  }

  .volume-slider[disabled]::-moz-range-thumb {
    background: $corpus-grey;
  }


  /*hide the outline behind the border*/
  .volume-slider:-moz-focusring {
    outline: 1px solid $corpus-white;
    outline-offset: -1px;
  }

  // .volume-slider::-ms-track {
  //   display:none;
  //   width: 50px;
  //   height: 5px;

  //   /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */
  //   background-color: transparent;

  //   /*leave room for the larger thumb to overflow with a transparent border */
  //   border-color: transparent;
  //   border-width: 6px 0;

  //   /*remove default tick marks*/
  //   color: transparent;
  // }
  // .volume-slider::-ms-fill-lower {
  //   background-color: $corpus-light-blue;
  //   border-radius: 11px;
  // }
  // .volume-slider::-ms-fill-upper {
  //   background-color: #ddd;
  //   border-radius: 11px;
  // }
  // .volume-slider::-ms-thumb {
  //   border: none;
  //   height: 11px;
  //   width: 11px;
  //   border-radius: 50%;
  //   background: $corpus-blue;
  // }
  // .volume-slider[disabled]::-ms-thumb {
  //   background: $corpus-grey;
  // }

  // .volume-slider:focus::-ms-fill-lower {
  //   background: $corpus-light-blue;
  // }
  // .volume-slider:focus::-ms-fill-upper {
  //   background: #ccc;
  // }

  #sound-control-scale-minus {
    position: absolute;
    top: 67px;
    left: 7px;
  }

}