Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* Cpyright 2014 The Chromium Authors. All rights reserved. | |
| 2 * Use of this source code is governed by a BSD-style license that can be | |
| 3 * found in the LICENSE file. */ | |
| 4 | |
| 5 /* Controls bar. */ | |
| 6 .controls { | |
| 7 align-items: center; | |
|
mtomasz
2014/01/27 01:09:24
Thx for the flex!
| |
| 8 background-color: #fff; | |
| 9 display: flex; | |
| 10 flex-direction: column; | |
| 11 height: 64px; | |
| 12 justify-content: center; | |
| 13 padding: 0; | |
| 14 } | |
| 15 | |
| 16 .controls .upper-controls { | |
| 17 height: 32px; | |
| 18 width: 100% | |
| 19 } | |
| 20 | |
| 21 .controls .lower-controls { | |
| 22 height: 32px; | |
| 23 width: 100% | |
| 24 } | |
| 25 | |
| 26 .audio-controls { | |
| 27 align-items: center; | |
| 28 display: flex; | |
| 29 flex-direction: row; | |
| 30 justify-content: center; | |
| 31 padding: 0; | |
| 32 } | |
| 33 | |
| 34 /* Customized scrollbar for the playlist. */ | |
| 35 | |
| 36 .media-button { | |
| 37 height: 32px; | |
| 38 position: relative; | |
| 39 width: 32px; | |
| 40 } | |
| 41 | |
| 42 .media-button > div { | |
| 43 height: 100%; | |
| 44 opacity: 0; | |
| 45 pointer-events: none; | |
| 46 position: absolute; | |
| 47 transition: opacity 100ms linear; | |
| 48 width: 100%; | |
| 49 } | |
| 50 | |
| 51 .media-button.toggle > label > div { | |
| 52 height: 100%; | |
| 53 pointer-events: none; | |
| 54 position: absolute; | |
| 55 transition: opacity 100ms linear; | |
| 56 width: 100%; | |
| 57 } | |
| 58 | |
| 59 .media-button[state='default']:not(.disabled) > .default, | |
| 60 .media-button[state='ended']:not(.disabled) > .ended, | |
| 61 .media-button[state='playing']:not(.disabled) > .playing, | |
| 62 .media-button.disabled > .disabled { | |
| 63 opacity: 1; | |
| 64 } | |
| 65 | |
| 66 /* Custom sliders for progress and volume. */ | |
| 67 | |
| 68 /* Customize the standard input[type='range']. */ | |
| 69 | |
| 70 /* Time controls: a slider and a text time display. */ | |
| 71 | |
| 72 .time-controls { | |
| 73 align-items: center; | |
| 74 display: flex; | |
| 75 flex-direction: row; | |
| 76 height: 100%; | |
| 77 justify-content: center; | |
| 78 } | |
| 79 | |
| 80 .custom-slider.progress { | |
| 81 display: flex; | |
| 82 flex: 1 1 auto; | |
| 83 height: 100%; | |
| 84 position: relative; | |
| 85 z-index: 0; /* Make a layer which includes the thumb on slider. */ | |
| 86 } | |
| 87 | |
| 88 .custom-slider.progress > input[type='range']::-webkit-slider-thumb { | |
| 89 background-image: -webkit-image-set( | |
| 90 url('../assets/100/player_timeline_handler.png') 1x, | |
| 91 url('../assets/100/player_timeline_handler.png') 2x); | |
| 92 width: 28px; | |
| 93 } | |
| 94 | |
| 95 .custom-slider.progress > input[type='range']::-webkit-slider-thumb:hover { | |
| 96 background-image: -webkit-image-set( | |
| 97 url('../assets/100/player_timeline_handler.png') 1x, | |
| 98 url('../assets/100/player_timeline_handler.png') 2x); | |
|
mtomasz
2014/01/27 01:09:24
100 -> 200. Please check other places.
yoshiki
2014/01/27 07:12:08
Thanks, Done.
| |
| 99 } | |
| 100 | |
| 101 .custom-slider.progress > input[type='range']::-webkit-slider-thumb:active { | |
| 102 background-image: -webkit-image-set( | |
| 103 url('../assets/100/player_timeline_handler_pressed.png') 1x, | |
| 104 url('../assets/100/player_timeline_handler_pressed.png') 2x); | |
|
mtomasz
2014/01/27 01:09:24
ditto
yoshiki
2014/01/27 07:12:08
Done.
| |
| 105 } | |
| 106 | |
| 107 .custom-slider.progress.disabled > input[type='range']::-webkit-slider-thumb { | |
| 108 background-image: none; | |
| 109 } | |
| 110 | |
| 111 .time-controls > .time { | |
| 112 cursor: default; | |
| 113 height: 100%; | |
| 114 position: relative; | |
| 115 width: 53px; | |
| 116 } | |
| 117 | |
| 118 .time-controls > .time.disabled { | |
| 119 opacity: 0; | |
| 120 } | |
| 121 | |
| 122 .custom-slider > input[type='range'] { | |
| 123 -webkit-appearance: none !important; /* Hide the default thumb icon. */ | |
| 124 background: transparent; /* Hide the standard slider bar */ | |
| 125 height: 100%; | |
| 126 left: -2px; /* Required to align the input element with the parent. */ | |
| 127 outline: none; | |
| 128 position: absolute; | |
| 129 top: -2px; | |
| 130 width: 100%; | |
| 131 } | |
| 132 | |
| 133 /* Custom thumb icon. */ | |
| 134 .custom-slider > input[type='range']::-webkit-slider-thumb { | |
| 135 -webkit-appearance: none; | |
| 136 background-position: center center; | |
| 137 background-repeat: no-repeat; | |
| 138 height: 24px; | |
| 139 position: relative; | |
| 140 z-index: 2; | |
| 141 } | |
| 142 | |
| 143 /* Custom slider bar (we hide the standard one). */ | |
| 144 .custom-slider > .bar { | |
| 145 background-image: -webkit-image-set( | |
| 146 url('../assets/100/player_timeline_base_center.png') 1x, | |
| 147 url('../assets/200/player_timeline_base_center.png') 2x); | |
| 148 /* In order to match the horizontal position of the standard slider bar | |
| 149 left and right must be equal to 1/2 of the thumb icon width. */ | |
| 150 bottom: 15px; | |
| 151 left: 14px; /* Exactly 1/2 of the thumb width */ | |
| 152 pointer-events: none; /* Mouse events pass through to the standard input. */ | |
| 153 position: absolute; | |
| 154 right: 14px; | |
| 155 top: 15px; | |
| 156 } | |
| 157 | |
| 158 .custom-slider > .bar > .filled, | |
| 159 .custom-slider > .bar > .cap { | |
| 160 bottom: 0; | |
| 161 position: absolute; | |
| 162 top: 0; | |
| 163 } | |
| 164 | |
| 165 /* The filled portion of the slider bar to the left of the thumb. */ | |
| 166 .custom-slider > .bar > .filled { | |
| 167 background-image: -webkit-image-set( | |
| 168 url('../assets/100/player_timeline_played_center.png') 1x, | |
| 169 url('../assets/200/player_timeline_played_center.png') 2x); | |
| 170 border-left-style: none; | |
| 171 border-right-style: none; | |
| 172 left: 0; | |
| 173 width: 0; /* The element style.width is manipulated from the code. */ | |
| 174 } | |
| 175 | |
| 176 /* Rounded caps to the left and right of the slider bar. */ | |
| 177 .custom-slider > .bar > .cap { | |
| 178 width: 1px; | |
| 179 } | |
| 180 | |
| 181 /* Left cap is always filled, should be the same color as .filled. */ | |
| 182 .custom-slider > .bar > .cap.left { | |
| 183 background-image: -webkit-image-set( | |
| 184 url('../assets/100/player_timeline_played_left.png') 1x, | |
| 185 url('../assets/200/player_timeline_played_left.png') 2x); | |
| 186 right: 100%; | |
| 187 } | |
| 188 | |
| 189 /* Right cap is always not filled. */ | |
| 190 .custom-slider > .bar > .cap.right { | |
| 191 background-image: -webkit-image-set( | |
| 192 url('../assets/100/player_timeline_base_right.png') 1x, | |
| 193 url('../assets/200/player_timeline_base_right.png') 2x); | |
| 194 left: 100%; | |
| 195 } | |
| 196 | |
| 197 .media-button.disabled, | |
| 198 .custom-slider.disabled, | |
| 199 .custom-slider.readonly { | |
| 200 pointer-events: none; | |
| 201 } | |
| 202 | |
| 203 /* Progress seek marker (precise time shown on mouse hover. */ | |
| 204 | |
| 205 /* Thin vertical line across the slider bar */ | |
| 206 .custom-slider > .bar > .seek-mark { | |
| 207 background-color: #202020; | |
| 208 bottom: -1px; | |
| 209 left: 0; | |
| 210 position: absolute; | |
| 211 top: -1px; | |
| 212 width: 0; | |
| 213 } | |
| 214 | |
| 215 .custom-slider > .bar > .seek-mark.visible { | |
| 216 width: 1px; | |
| 217 } | |
| 218 | |
| 219 .custom-slider > .bar > .seek-mark.inverted { | |
| 220 background-color: #808080; | |
| 221 } | |
| 222 | |
| 223 /* Text label giving the precise time corresponding to the hover position. */ | |
| 224 .custom-slider > .bar > .seek-mark > .seek-label { | |
| 225 align-items: center; | |
| 226 background: #202020; | |
| 227 border-top-left-radius: 2px; | |
| 228 border-top-right-radius: 2px; | |
| 229 bottom: 19px; | |
| 230 color: white; | |
| 231 display: flex; | |
| 232 flex-direction: row; | |
| 233 font-size: 12px; | |
| 234 height: 15px; | |
| 235 justify-content: center; | |
| 236 left: 0; | |
| 237 opacity: 0; | |
| 238 overflow: hidden; | |
| 239 position: absolute; | |
| 240 transition: opacity 150ms ease; | |
| 241 } | |
| 242 | |
| 243 .custom-slider > .bar > .seek-mark.visible > .seek-label { | |
| 244 opacity: 1; | |
| 245 } | |
| 246 | |
| 247 /* Media controls in order of appearance. */ | |
| 248 | |
| 249 .audio-controls { | |
| 250 align-items: center; | |
| 251 display: flex; | |
| 252 flex-direction: row; | |
| 253 height: 100%; | |
| 254 justify-content: center; | |
| 255 } | |
| 256 | |
| 257 /* Play/pause button. */ | |
| 258 | |
| 259 .media-button.toggle input { | |
| 260 position: absolute; | |
| 261 visibility: hidden; | |
| 262 } | |
| 263 | |
| 264 .media-button.shuffle-mode { | |
| 265 margin-left: 5px; | |
| 266 margin-right: 5px; | |
| 267 } | |
| 268 | |
| 269 .media-button.shuffle-mode > label > .icon { | |
| 270 background-image: -webkit-image-set( | |
| 271 url('../assets/100/player_button_shuffle.png') 1x, | |
| 272 url('../assets/200/player_button_shuffle.png') 2x); | |
| 273 pointer-events: auto; | |
| 274 } | |
| 275 | |
| 276 .media-button.shuffle-mode > label > input:checked + .icon { | |
| 277 background-image: -webkit-image-set( | |
| 278 url('../assets/100/player_button_shuffle_active.png') 1x, | |
| 279 url('../assets/200/player_button_shuffle_active.png') 2x); | |
| 280 } | |
| 281 | |
| 282 .media-button.repeat { | |
| 283 margin-left: 5px; | |
| 284 margin-right: 0; | |
| 285 } | |
| 286 | |
| 287 .media-button.repeat > label > .icon { | |
| 288 background-image: -webkit-image-set( | |
| 289 url('../assets/100/player_button_repeat.png') 1x, | |
| 290 url('../assets/200/player_button_repeat.png') 2x); | |
| 291 pointer-events: auto; | |
| 292 } | |
| 293 | |
| 294 .media-button.repeat > label > input:checked + .icon { | |
| 295 background-image: -webkit-image-set( | |
| 296 url('../assets/100/player_button_repeat_active.png') 1x, | |
| 297 url('../assets/200/player_button_repeat_active.png') 2x); | |
| 298 } | |
| 299 | |
| 300 .media-button.play { | |
| 301 margin-left: 0; | |
| 302 margin-right: 0; | |
| 303 } | |
| 304 | |
| 305 .media-button.play > .ended { | |
| 306 background-image: -webkit-image-set( | |
| 307 url('../assets/100/player_button_play.png') 1x, | |
| 308 url('../assets/200/player_button_play.png') 2x); | |
| 309 } | |
| 310 | |
| 311 .media-button.play > .playing { | |
| 312 background-image: -webkit-image-set( | |
| 313 url('../assets/100/player_button_pause.png') 1x, | |
| 314 url('../assets/200/player_button_pause.png') 2x); | |
| 315 } | |
| 316 | |
| 317 .media-button.previous { | |
| 318 margin-left: 5px; | |
| 319 margin-right: 0; | |
| 320 } | |
| 321 | |
| 322 .media-button.previous > .normal { | |
| 323 background-image: -webkit-image-set( | |
| 324 url('../assets/100/player_button_previous.png') 1x, | |
| 325 url('../assets/200/player_button_previous.png') 2x); | |
| 326 } | |
| 327 | |
| 328 .media-button.next { | |
| 329 margin-left: 0; | |
| 330 margin-right: 5px; | |
| 331 } | |
| 332 | |
| 333 .media-button.next > .normal { | |
| 334 background-image: -webkit-image-set( | |
| 335 url('../assets/100/player_button_next.png') 1x, | |
| 336 url('../assets/200/player_button_next.png') 2x); | |
| 337 } | |
| 338 | |
| 339 .media-button.volume { | |
| 340 margin-left: 5px; | |
| 341 margin-right: 5px; | |
| 342 } | |
| 343 | |
| 344 .media-button.volume > .normal { | |
| 345 background-image: -webkit-image-set( | |
| 346 url('../assets/100/player_button_volume.png') 1x, | |
| 347 url('../assets/200/player_button_volume.png') 2x); | |
| 348 } | |
| 349 | |
| 350 .media-button.volume > label > .icon { | |
| 351 background-image: -webkit-image-set( | |
| 352 url('../assets/100/player_button_volume.png') 1x, | |
| 353 url('../assets/200/player_button_volume.png') 2x); | |
| 354 pointer-events: auto; | |
| 355 } | |
| 356 | |
| 357 .media-button.volume > label > input:checked + .icon { | |
| 358 background-image: -webkit-image-set( | |
| 359 url('../assets/100/player_button_volume_active.png') 1x, | |
| 360 url('../assets/200/player_button_volume_active.png') 2x); | |
| 361 } | |
| 362 | |
| 363 .media-button.playlist { | |
| 364 margin-left: 5px; | |
| 365 margin-right: 5px; | |
| 366 } | |
| 367 | |
| 368 .media-button.playlist > label > .icon { | |
| 369 background-image: -webkit-image-set( | |
| 370 url('../assets/100/player_button_playlist.png') 1x, | |
| 371 url('../assets/200/player_button_playlist.png') 2x); | |
| 372 pointer-events: auto; | |
| 373 } | |
| 374 | |
| 375 .media-button.playlist > label > input:checked + .icon { | |
| 376 background-image: -webkit-image-set( | |
| 377 url('../assets/100/player_button_playlist_active.png') 1x, | |
| 378 url('../assets/200/player_button_playlist_active.png') 2x); | |
| 379 } | |
| 380 | |
| 381 | |
| 382 /* Invisible div used to compute the width required for the elapsed time. */ | |
| 383 .time-controls > .time > .duration, | |
| 384 .time-controls > .time > .current { | |
| 385 align-items: center; | |
| 386 color: #3d3d3d; | |
| 387 display: flex; | |
| 388 flex-direction: row; | |
| 389 font-size: 12px; | |
| 390 height: 100%; | |
| 391 justify-content: flex-end; | |
| 392 position: absolute; | |
| 393 top: -1px; | |
| 394 } | |
| 395 | |
| 396 .time-controls > .time > .duration { | |
| 397 left: 0; | |
|
mtomasz
2014/01/27 01:09:24
Will it work for RTL?
yoshiki
2014/01/27 07:12:08
The audio player must be displayed as LTR even whe
mtomasz
2014/01/27 09:43:39
Any background for this decision? I thought we nee
yoshiki
2014/01/28 05:57:56
Let me rephrase it correctly. Some components (eg.
mtomasz
2014/01/28 06:09:45
I received this guidance about RTL from UX guys: F
| |
| 398 } | |
| 399 | |
| 400 .time-controls > .time > .current { | |
| 401 right: 0; | |
| 402 } | |
| 403 | |
| 404 /* Volume controls: sound button and volume slider */ | |
| 405 | |
| 406 #volumeContainer { | |
| 407 border: 1px solid #ddd; | |
| 408 border-radius: 2px; | |
| 409 box-shadow: 0 2px 4px #777; | |
| 410 height: 110px; | |
| 411 position: fixed; | |
| 412 width: 32px; | |
| 413 } | |
| 414 | |
| 415 #volumeContainer.default-hidden { | |
| 416 visibility: hidden; | |
| 417 } | |
| OLD | NEW |