A web music player written in JS

player.css 4.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. * { margin:0; padding:0; }
  2. div#player {
  3. -webkit-touch-callout: none;
  4. -webkit-user-select: none;
  5. -khtml-user-select: none;
  6. -moz-user-select: none;
  7. -ms-user-select: none;
  8. user-select: none;
  9. background-color: #333;
  10. height: 30px;
  11. position: absolute;
  12. top: 0px;
  13. width: 100%;
  14. color: white;
  15. padding-left: 20px;
  16. line-height: 30px;
  17. letter-spacing: 5px;
  18. cursor: default;
  19. box-sizing: border-box;
  20. }
  21. div#player div#player-control {
  22. float: left;
  23. margin-right: 5px;
  24. }
  25. div#player a#player-menu,
  26. div#player div#player-volume {
  27. float: right;
  28. margin-left: 10px;
  29. }
  30. div#player div {
  31. display: inline-block;
  32. vertical-align: top;
  33. }
  34. div#player div#player-bar {
  35. position: relative;
  36. height: 5px;
  37. width: 500px;
  38. margin-top: 12px;
  39. border: 1px solid #AAA;
  40. cursor: pointer;
  41. }
  42. div#player div#player-cursor {
  43. position: absolute;
  44. height: 15px;
  45. width: 2px;
  46. top: 2px;
  47. transform: translate(0px, -50%);
  48. transition: left 1s;
  49. background-color: #FFF;
  50. }
  51. div#player div#player-played {
  52. position: absolute;
  53. height: 5px;
  54. top: 0px;
  55. left: 0px;
  56. transition: width 1s;
  57. background-color: #DDD;
  58. }
  59. div#player div#player-buffer {
  60. position: absolute;
  61. height: 5px;
  62. top: 0px;
  63. left: 0px;
  64. transition: width 1s;
  65. background-color: #888;
  66. }
  67. div#player span#player-title {
  68. max-width: 300px;
  69. overflow: hidden;
  70. text-overflow: ellipsis;
  71. word-wrap: break-word;
  72. white-space: nowrap;
  73. }
  74. span#player-duration,
  75. span#player-currentTime {
  76. font-size: 0.8em;
  77. }
  78. div#player #player-volume-bar {
  79. position: relative;
  80. height: 5px;
  81. width: 100px;
  82. margin-top: 12px;
  83. border: 1px solid #AAA;
  84. cursor: pointer;
  85. }
  86. div#player div#player-volume-set {
  87. position: absolute;
  88. height: 5px;
  89. width: 100%;
  90. top: 0px;
  91. left: 0px;
  92. background-color: #DDD;
  93. }
  94. div#player a:hover {
  95. text-shadow: 0px 0px 5px #fff;
  96. cursor: pointer;
  97. }
  98. #YTplayer {
  99. position: absolute;
  100. top: 50%;
  101. left: 50%;
  102. transform: translate(-50%, -50%);
  103. }
  104. input[type=range] {
  105. -webkit-appearance: none; /* Hides the slider so that custom slider can be made */
  106. width: 100%; /* Specific width is required for Firefox. */
  107. height: 10px;
  108. }
  109. input[type=range]::-webkit-slider-thumb {
  110. -webkit-appearance: none;
  111. }
  112. input[type=range]:focus {
  113. outline: none; /* Removes the blue border. You should probably do some kind of focus styling for accessibility reasons though. */
  114. }
  115. input[type=range]::-ms-track {
  116. width: 100%;
  117. cursor: pointer;
  118. background: transparent; /* Hides the slider so custom styles can be added */
  119. border-color: transparent;
  120. color: transparent;
  121. }
  122. /* Special styling for WebKit/Blink */
  123. input[type=range]::-webkit-slider-thumb {
  124. -webkit-appearance: none;
  125. border: 1px solid #fff;
  126. height: 10px;
  127. width: 2px;
  128. background: #ffffff;
  129. cursor: pointer;
  130. margin-top: -2px;
  131. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d; /* Add cool effects to your sliders! */
  132. }
  133. /* All the same stuff for Firefox */
  134. input[type=range]::-moz-range-thumb {
  135. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
  136. border: 1px solid #000000;
  137. height: 10px;
  138. width: 2px;
  139. background: #ffffff;
  140. cursor: pointer;
  141. }
  142. /* All the same stuff for IE */
  143. input[type=range]::-ms-thumb {
  144. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
  145. border: 1px solid #fff;
  146. height: 10px;
  147. width: 2px;
  148. background: #fff;
  149. cursor: pointer;
  150. }
  151. input[type=range]::-webkit-slider-runnable-track {
  152. width: 100%;
  153. height: 5px;
  154. cursor: pointer;
  155. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
  156. background: #fff;
  157. border: 0.2px solid #010101;
  158. }
  159. input[type=range]::-moz-range-track {
  160. width: 100%;
  161. height: 5px;
  162. cursor: pointer;
  163. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
  164. background: #fff;
  165. border: 0.2px solid #010101;
  166. }
  167. input[type=range]::-ms-track {
  168. width: 100%;
  169. height: 5px;
  170. cursor: pointer;
  171. background: transparent;
  172. border-color: transparent;
  173. border-width: 16px 0;
  174. color: transparent;
  175. }
  176. input[type=range]::-ms-fill-lower {
  177. background: #2a6495;
  178. border: 0.2px solid #010101;
  179. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
  180. }
  181. input[type=range]::-ms-fill-upper {
  182. background: #3071a9;
  183. border: 0.2px solid #010101;
  184. box-shadow: 1px 1px 1px #000000, 0px 0px 1px #0d0d0d;
  185. }