Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* Cpyright (c) 2012 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 -webkit-box-align: center; | |
| 8 -webkit-box-orient: vertical; | |
| 9 -webkit-box-pack: center; | |
| 10 background-color: #FFF; | |
|
mtomasz
2014/01/23 08:05:09
nit: #FFF -> #fff
yoshiki
2014/01/24 15:34:19
Done.
| |
| 11 display: -webkit-box; | |
| 12 height: 64px; | |
| 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 { | |
|
mtomasz
2014/01/23 08:05:09
The left margin is larger than the right in the co
yoshiki
2014/01/24 15:34:19
Done.
| |
| 27 -webkit-box-align: center; | |
| 28 -webkit-box-orient: horizontal; | |
| 29 -webkit-box-pack: center; | |
| 30 display: -webkit-box; | |
| 31 padding: 0; | |
| 32 } | |
| 33 | |
| 34 /* Customized scrollbar for the playlist. */ | |
| 35 | |
| 36 .media-button { | |
|
mtomasz
2014/01/23 08:05:09
The hover state is missing comparing to mocks.
yoshiki
2014/01/24 15:34:19
Mocks don't have the hover state. (but I've just n
| |
| 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 -webkit-box-align: center; | |
| 74 -webkit-box-flex: 1; | |
| 75 -webkit-box-orient: horizontal; | |
| 76 -webkit-box-pack: center; | |
| 77 display: -webkit-box; | |
| 78 height: 100%; | |
| 79 } | |
| 80 | |
| 81 .custom-slider.progress { | |
| 82 -webkit-box-flex: 1; | |
| 83 display: -webkit-box; | |
| 84 height: 100%; | |
| 85 position: relative; | |
| 86 z-index: 0; /* Make a layer which includes the thumb on slider. */ | |
| 87 } | |
| 88 | |
| 89 .custom-slider.progress > input[type='range']::-webkit-slider-thumb { | |
| 90 background-image: -webkit-image-set( | |
| 91 url('../assets/100/player_timeline_handler.png') 1x, | |
| 92 url('../assets/100/player_timeline_handler.png') 2x); | |
| 93 width: 28px; | |
| 94 } | |
| 95 | |
| 96 .custom-slider.progress > input[type='range']::-webkit-slider-thumb:hover { | |
| 97 background-image: -webkit-image-set( | |
| 98 url('../assets/100/player_timeline_handler.png') 1x, | |
| 99 url('../assets/100/player_timeline_handler.png') 2x); | |
| 100 } | |
| 101 | |
| 102 .custom-slider.progress > input[type='range']::-webkit-slider-thumb:active { | |
| 103 background-image: -webkit-image-set( | |
| 104 url('../assets/100/player_timeline_handler_pressed.png') 1x, | |
| 105 url('../assets/100/player_timeline_handler_pressed.png') 2x); | |
| 106 } | |
|
mtomasz
2014/01/23 08:05:09
nit: \n missing
yoshiki
2014/01/24 15:34:19
Done.
| |
| 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 -webkit-box-align: center; | |
| 226 -webkit-box-orient: horizontal; | |
| 227 -webkit-box-pack: center; | |
| 228 background: #202020; | |
| 229 border-top-left-radius: 2px; | |
| 230 border-top-right-radius: 2px; | |
| 231 bottom: 19px; | |
| 232 color: white; | |
| 233 display: -webkit-box; | |
| 234 font-size: 12px; | |
| 235 height: 15px; | |
| 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 -webkit-box-align: center; | |
| 251 -webkit-box-flex: 1; | |
| 252 -webkit-box-orient: horizontal; | |
| 253 -webkit-box-pack: center; | |
| 254 display: -webkit-box; | |
| 255 height: 100%; | |
| 256 } | |
| 257 | |
| 258 /* Play/pause button. */ | |
| 259 | |
| 260 .media-button.toggle input { | |
| 261 position: absolute; | |
| 262 visibility: hidden; | |
| 263 } | |
| 264 | |
| 265 .media-button.shuffle-mode { | |
| 266 margin-left: 10px; | |
| 267 margin-right: 0; | |
| 268 } | |
| 269 | |
| 270 .media-button.shuffle-mode > label > .icon { | |
| 271 background-image: -webkit-image-set( | |
| 272 url('../assets/100/player_button_shuffle.png') 1x, | |
| 273 url('../assets/200/player_button_shuffle.png') 2x); | |
| 274 pointer-events: auto; | |
| 275 } | |
| 276 | |
| 277 .media-button.shuffle-mode > label > input:checked + .icon { | |
| 278 background-image: -webkit-image-set( | |
| 279 url('../assets/100/player_button_shuffle_active.png') 1x, | |
| 280 url('../assets/200/player_button_shuffle_active.png') 2x); | |
| 281 } | |
| 282 | |
| 283 .media-button.repeat { | |
| 284 margin-left: 10px; | |
|
mtomasz
2014/01/27 01:09:24
Does it work in RTL? Please use -webkit-margin-sta
| |
| 285 margin-right: 0; | |
| 286 } | |
| 287 | |
| 288 .media-button.repeat > label > .icon { | |
| 289 background-image: -webkit-image-set( | |
| 290 url('../assets/100/player_button_repeat.png') 1x, | |
| 291 url('../assets/200/player_button_repeat.png') 2x); | |
| 292 pointer-events: auto; | |
| 293 } | |
| 294 | |
| 295 .media-button.repeat > label > input:checked + .icon { | |
| 296 background-image: -webkit-image-set( | |
| 297 url('../assets/100/player_button_repeat_active.png') 1x, | |
| 298 url('../assets/200/player_button_repeat_active.png') 2x); | |
| 299 } | |
| 300 | |
| 301 .media-button.play { | |
| 302 margin-left: -7px; | |
| 303 margin-right: -7px; | |
| 304 } | |
| 305 | |
| 306 .media-button.play > .ended { | |
| 307 background-image: -webkit-image-set( | |
| 308 url('../assets/100/player_button_play.png') 1x, | |
| 309 url('../assets/200/player_button_play.png') 2x); | |
| 310 } | |
| 311 | |
| 312 .media-button.play > .playing { | |
| 313 background-image: -webkit-image-set( | |
| 314 url('../assets/100/player_button_pause.png') 1x, | |
| 315 url('../assets/200/player_button_pause.png') 2x); | |
| 316 } | |
| 317 | |
| 318 .media-button.previous { | |
| 319 margin-left: 10px; | |
|
mtomasz
2014/01/27 01:09:24
We can put -webkit-margin-start on .media-button,
| |
| 320 margin-right: 0; | |
| 321 } | |
| 322 | |
| 323 .media-button.previous > .normal { | |
| 324 background-image: -webkit-image-set( | |
| 325 url('../assets/100/player_button_previous.png') 1x, | |
| 326 url('../assets/200/player_button_previous.png') 2x); | |
| 327 } | |
| 328 | |
| 329 .media-button.next { | |
| 330 margin-left: 0; | |
| 331 margin-right: 10px; | |
| 332 } | |
| 333 | |
| 334 .media-button.next > .normal { | |
| 335 background-image: -webkit-image-set( | |
| 336 url('../assets/100/player_button_next.png') 1x, | |
| 337 url('../assets/200/player_button_next.png') 2x); | |
| 338 } | |
| 339 | |
| 340 .media-button.volume { | |
| 341 margin-left: 0; | |
| 342 margin-right: 10px; | |
| 343 } | |
| 344 | |
| 345 .media-button.volume > .normal { | |
| 346 background-image: -webkit-image-set( | |
| 347 url('../assets/100/player_button_volume.png') 1x, | |
| 348 url('../assets/200/player_button_volume.png') 2x); | |
| 349 } | |
| 350 | |
| 351 .media-button.volume > label > .icon { | |
| 352 background-image: -webkit-image-set( | |
| 353 url('../assets/100/player_button_volume.png') 1x, | |
| 354 url('../assets/200/player_button_volume.png') 2x); | |
| 355 pointer-events: auto; | |
| 356 } | |
| 357 | |
| 358 .media-button.volume > label > input:checked + .icon { | |
| 359 background-image: -webkit-image-set( | |
| 360 url('../assets/100/player_button_volume_active.png') 1x, | |
| 361 url('../assets/200/player_button_volume_active.png') 2x); | |
| 362 } | |
| 363 | |
| 364 .media-button.playlist { | |
| 365 margin-left: 0; | |
| 366 margin-right: 0; | |
| 367 } | |
| 368 | |
| 369 .media-button.playlist > label > .icon { | |
| 370 background-image: -webkit-image-set( | |
| 371 url('../assets/100/player_button_playlist.png') 1x, | |
| 372 url('../assets/200/player_button_playlist.png') 2x); | |
| 373 pointer-events: auto; | |
| 374 } | |
| 375 | |
| 376 .media-button.playlist > label > input:checked + .icon { | |
| 377 background-image: -webkit-image-set( | |
| 378 url('../assets/100/player_button_playlist_active.png') 1x, | |
| 379 url('../assets/200/player_button_playlist_active.png') 2x); | |
| 380 } | |
| 381 | |
| 382 | |
| 383 /* Invisible div used to compute the width required for the elapsed time. */ | |
| 384 .time-controls > .time > .duration, | |
| 385 .time-controls > .time > .current { | |
| 386 -webkit-box-align: center; | |
| 387 -webkit-box-orient: horizontal; | |
| 388 -webkit-box-pack: end; | |
| 389 color: #3d3d3d; | |
| 390 display: -webkit-box; | |
| 391 font-size: 12px; | |
| 392 height: 100%; | |
| 393 position: absolute; | |
| 394 top: -1px; | |
| 395 } | |
| 396 | |
| 397 .time-controls > .time > .duration { | |
| 398 left: 0; | |
| 399 } | |
| 400 | |
| 401 .time-controls > .time > .current { | |
| 402 right: 0; | |
| 403 } | |
| 404 | |
| 405 /* Volume controls: sound button and volume slider */ | |
| 406 | |
| 407 #volumeContainer { | |
| 408 border: 1px solid #ddd; | |
| 409 border-radius: 2px; | |
| 410 box-shadow: 0 2px 4px #777; | |
| 411 height: 110px; | |
| 412 position: fixed; | |
| 413 width: 32px; | |
| 414 } | |
| 415 | |
| 416 #volumeContainer.default-hidden { | |
| 417 visibility: hidden; | |
| 418 } | |
| OLD | NEW |