]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/player/peertube-skin.scss
Adapt theather icon depending on the player state
[github/Chocobozzz/PeerTube.git] / client / src / sass / player / peertube-skin.scss
CommitLineData
3ec8dc09
C
1@import '_variables';
2@import '_mixins';
2a19a1e4 3@import './_player-variables';
3ec8dc09 4
864e782b
C
5@mixin big-play-button-triangle-size($triangle-size) {
6 width: $triangle-size;
7 height: $triangle-size;
8 top: calc(50% - #{$triangle-size / 2});
9 left: calc(53% - #{($triangle-size / 2)});
10}
11
be6a4802 12.video-js.vjs-peertube-skin {
4555697f 13
be6a4802 14 font-size: $font-size;
c6352f2c 15 color: $primary-foreground-color;
aa8b6df4 16
22b59e80
C
17 .vjs-dock-text {
18 padding-right: 10px;
19 }
20
21 .vjs-dock-description {
22 font-size: 11px;
23
c6352f2c 24 &::before, &::after {
22b59e80
C
25 display: inline-block;
26 content: '\1F308';
27 }
28
c6352f2c 29 &::before {
22b59e80
C
30 margin-right: 4px;
31 }
32
c6352f2c 33 &::after {
22b59e80
C
34 margin-left: 4px;
35 transform: scale(-1, 1);
36 }
37 }
38
be6a4802
C
39 .vjs-button > .vjs-icon-placeholder::before {
40 line-height: $control-bar-height;
aa8b6df4 41 }
e14852b4 42
c6352f2c 43 .vjs-volume-level::before {
be6a4802
C
44 content: ''; /* Remove Circle From Progress Bar */
45 }
e14852b4 46
be6a4802
C
47 .vjs-audio-button {
48 display: none;
49 }
e14852b4 50
be6a4802 51 .vjs-big-play-button {
9e6b41cc 52 outline: 0;
07fa4c97 53 font-size: 6em;
e14852b4 54
33d78552
C
55 $big-play-width: 1.2em;
56 $big-play-height: 1.2em;
e14852b4 57
864e782b 58 border: 6px solid #fff;
33d78552 59 border-radius: 100%;
e14852b4 60
e14852b4
C
61 left: 50%;
62 top: 50%;
8cac1b64
C
63 width: $big-play-width;
64 height: $big-play-height;
65 line-height: $big-play-height;
e14852b4
C
66 margin-left: -($big-play-width / 2);
67 margin-top: -($big-play-height / 2);
864e782b 68 transition: 0.4s opacity;
adcaf1a8
C
69
70 &::-moz-focus-inner {
71 border: 0;
72 padding: 0
73 }
80d1057b
C
74
75 .vjs-icon-placeholder::before {
864e782b
C
76 @include big-play-button-triangle-size(45px);
77
78 content: '';
2a19a1e4 79 background-image: url('#{$assets-path}/player/images/big-play-button.svg');
80d1057b
C
80 }
81
8cac1b64 82 &:hover {
33d78552 83 opacity: 0.8;
80d1057b 84 }
be6a4802 85 }
e14852b4 86
864e782b
C
87 // Small effect when we click on the play button
88 &.vjs-has-big-play-button-clicked {
33d78552 89
864e782b
C
90 .vjs-big-play-button, .vjs-poster {
91 display: block;
92 visibility: hidden;
33d78552 93
864e782b 94 &.vjs-big-play-button, &.vjs-big-play-button::before {
33d78552 95 opacity: 0;
864e782b 96 transition: visibility 0.2s, opacity 0.2s;
33d78552 97 }
864e782b
C
98
99 &.vjs-poster, &.vjs-poster::before {
100 opacity: 0;
101 transition: visibility 0.3s, opacity 0.3s;
102 transition-delay: 0.05s;
33d78552
C
103 }
104 }
8fa5653a
C
105 }
106
e6f62797
C
107 // Hide the big play button on autoplay
108 &.vjs-has-autoplay {
109 .vjs-big-play-button {
110 display: none !important;
111 }
112 }
113
be6a4802
C
114 .vjs-control-bar,
115 .vjs-big-play-button,
c6352f2c 116 .vjs-settings-dialog {
be6a4802
C
117 background-color: rgba($primary-background-color, 0.5);
118 }
e14852b4 119
be6a4802
C
120 .vjs-poster {
121 outline: none; /* Remove Blue Outline on Click*/
122 outline: 0;
123 }
e14852b4 124
be6a4802
C
125 .vjs-control-bar {
126 height: $control-bar-height;
fc16f981
C
127 background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
128 box-shadow: 0 -15px 40px 10px rgba(0, 0, 0, 0.2);
0aabe3f6 129 text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
e14852b4 130
6b9af129
C
131 .vjs-progress-control,
132 .vjs-play-control,
133 .vjs-playback-rate,
134 .vjs-mute-control,
135 .vjs-volume-control,
136 .vjs-resolution-control,
c6352f2c
C
137 .vjs-fullscreen-control,
138 .vjs-peertube-link,
054a103b 139 .vjs-theater-control,
c6352f2c 140 .vjs-settings
6b9af129 141 {
c6352f2c 142 color: $primary-foreground-color !important;
6b9af129
C
143 opacity: $primary-foreground-opacity;
144 transition: opacity .1s;
145
146 &:hover {
147 opacity: $primary-foreground-opacity-hover;
148 }
149 }
150
151 .vjs-current-time,
152 .vjs-duration,
153 .vjs-peertube {
154 color: $primary-foreground-color;
c6352f2c 155 opacity: $primary-foreground-opacity;
6b9af129
C
156 }
157
2ce2fd7f
C
158 .vjs-progress-control {
159 position: absolute;
160 z-index: 100; // On top of the progress bar
161 bottom: 29px;
162 width: calc(100% - (2 * #{$progress-margin}));
163 margin-left: $progress-margin;
164 height: 14px;
77728efa 165
2ce2fd7f
C
166 .vjs-slider {
167 margin: 0;
168 border-radius: 0;
169 background-color: rgba(255, 255, 255, .2);
170 height: 3px;
171 transition: none;
77728efa 172
2ce2fd7f
C
173 .vjs-play-progress {
174 background: $primary-foreground-color;
77728efa 175
2ce2fd7f
C
176 // Not display the circle if the progress is not hovered
177 &::before {
178 opacity: 0;
179 transition: opacity 0.1s ease;
180 font-size: 14px;
77728efa 181
2ce2fd7f
C
182 top: -0.3em;
183 }
77728efa 184
2ce2fd7f
C
185 .vjs-time-tooltip {
186 display: none;
187 }
188 }
77728efa 189
2ce2fd7f
C
190 .vjs-load-progress {
191 &, & div {
192 background: rgba(255, 255, 255, .2);
193 }
194 }
77728efa
C
195 }
196 }
197
2ce2fd7f
C
198 .vjs-progress-control:hover .vjs-slider,
199 .vjs-slider.vjs-sliding {
be6a4802 200 height: 5px;
e14852b4 201
2ce2fd7f
C
202 .vjs-play-progress::before {
203 opacity: 1;
be6a4802
C
204 }
205 }
e14852b4 206
2ce2fd7f 207
be6a4802 208 .vjs-play-control {
3ec8dc09
C
209 @include disable-outline;
210
c6352f2c 211 cursor: pointer;
be6a4802 212 font-size: $font-size;
be6a4802
C
213 margin-right: 5px;
214 }
e14852b4 215
be6a4802 216 .vjs-time-control {
8e53163f
C
217 line-height: inherit;
218
be6a4802
C
219 &.vjs-current-time {
220 font-size: $font-size;
221 display: inline-block;
222 padding: 0;
223
224 .vjs-current-time-display {
86f278cb 225 line-height: calc(#{$control-bar-height} + 1px);
be6a4802
C
226
227 &::after {
228 content: "/";
229 margin: 0 1px 0 2px;
230 }
231 }
232 }
233
234 &.vjs-duration {
235 font-size: $font-size;
236 display: inline-block;
237 padding: 0;
be6a4802 238 .vjs-duration-display {
86f278cb 239 line-height: calc(#{$control-bar-height} + 1px);
be6a4802
C
240 }
241 }
242
243 &.vjs-remaining-time {
244 display: none;
245 }
246 }
e14852b4 247
bf5685f0 248 .vjs-peertube {
be6a4802
C
249 width: 100%;
250 line-height: $control-bar-height;
251 text-align: right;
be6a4802 252
bf5685f0 253 .vjs-peertube-displayed {
a86309b4
C
254 display: block;
255 }
256
bf5685f0 257 .vjs-peertube-hidden {
a86309b4
C
258 display: none;
259 }
260
be6a4802
C
261 .download-speed-number, .upload-speed-number, .peers-number {
262 font-weight: $font-semibold;
263 }
264
265 .download-speed-text, .upload-speed-text, .peers-text {
266 margin-right: 15px;
267 }
268
269 .icon {
270 display: inline-block;
271 width: 15px;
272 height: 15px;
273 background-size: contain;
274 vertical-align: middle;
275 background-repeat: no-repeat;
276 margin-right: 6px;
277 position: relative;
278 top: -1px;
279
280 &.icon-download {
2a19a1e4 281 background-image: url('#{$assets-path}/player/images/arrow-down.svg');
be6a4802
C
282 }
283
284 &.icon-upload {
2a19a1e4 285 background-image: url('#{$assets-path}/player/images/arrow-up.svg');
be6a4802
C
286 }
287 }
288 }
e14852b4 289
57886d66 290 .vjs-playback-rate {
291 font-size: 10px;
3ec8dc09 292 width: 37px !important;
a73c582e
C
293
294 .vjs-playback-rate-value {
295 font-size: 13px;
296 line-height: $control-bar-height;
297 }
3ec8dc09
C
298
299 .vjs-menu .vjs-menu-content {
300 width: 37px !important;
301 }
57886d66 302 }
303
be6a4802 304 .vjs-mute-control {
3ec8dc09
C
305 @include disable-outline;
306
307 line-height: $control-bar-height;
308 padding: 0;
309 width: 30px;
d7701449 310
be6a4802
C
311 .vjs-icon-placeholder {
312 display: inline-block;
313 width: 22px;
314 height: 22px;
315 vertical-align: middle;
2a19a1e4 316 background: url('#{$assets-path}/player/images/volume.svg') no-repeat;
be6a4802
C
317 background-size: contain;
318
319 &::before {
320 content: '';
321 }
322 }
323
324 &.vjs-vol-0 .vjs-icon-placeholder {
2a19a1e4 325 background: url('#{$assets-path}/player/images/volume-mute.svg') no-repeat;
be6a4802
C
326 background-size: contain;
327 }
328 }
e14852b4 329
3ec8dc09
C
330 .vjs-volume-control {
331 width: 30px;
c6352f2c 332 margin: 0 5px 0 0;
be6a4802 333 }
e14852b4 334
be6a4802
C
335 .vjs-volume-bar {
336 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcCAQAAACw95UnAAAAMElEQVRIx2NgoBL4n4YKGUYNHkEG4zJg1OCRYDCpBowaPJwMppbLRg0eNXjUYBLEAXWNUA6QNm1lAAAAAElFTkSuQmCC) no-repeat;
337 background-size: 22px 14px;
338 height: 100%;
339 width: 100%;
340 max-width: 22px;
341 max-height: 14px;
342 margin: 7px 4px;
343 border-radius: 0;
344 top: 3px;
345
346 .vjs-volume-level {
347 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcAQAAAAAyhWABAAAAAnRSTlMAAHaTzTgAAAAZSURBVHgBYwAB/g9EUv+JokCqiaT+U4MCAPKPS7WUUOc1AAAAAElFTkSuQmCC) no-repeat;
348 background-size: 22px 14px;
349 max-width: 22px;
350 max-height: 14px;
351 height: 100%;
352 }
353 }
e14852b4 354
be6a4802
C
355 .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
356 .vjs-volume-panel.vjs-volume-panel-horizontal:active,
357 .vjs-volume-panel.vjs-volume-panel-horizontal:focus,
358 .vjs-volume-panel.vjs-volume-panel-horizontal:hover {
359 width: 6em;
360 transition-property: none;
361 }
e14852b4 362
be6a4802
C
363 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal {
364 width: 3em;
365 height: auto;
366 }
e14852b4 367
be6a4802
C
368 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control {
369 transition-property: none;
370 }
e14852b4 371
be6a4802
C
372 .vjs-volume-panel {
373 .vjs-mute-control {
374 width: 2em;
375 z-index: 1;
376 padding: 0;
377 }
378
379 .vjs-volume-control {
380 display: inline-block;
381 position: relative;
382 left: 5px;
383 opacity: 1;
384 width: 3em;
385 height: auto;
386 }
387 }
e14852b4 388
c6352f2c
C
389 .vjs-peertube-link {
390 @include disable-outline;
391 @include disable-default-a-behaviour;
392
393 text-decoration: none;
394 line-height: $control-bar-height;
395 font-weight: $font-semibold;
396 padding: 0 5px;
397 }
398
054a103b
C
399 .vjs-theater-control {
400 @include disable-outline;
401
402 width: 37px;
403 margin-right: 1px;
404
405 .vjs-icon-placeholder {
4555697f 406 transition: transform 0.2s ease;
054a103b
C
407 display: inline-block;
408 width: 22px;
409 height: 22px;
410 vertical-align: middle;
411 background: url('#{$assets-path}/player/images/theater.svg') no-repeat;
412 background-size: contain;
413
414 &::before {
415 content: '';
416 }
417 }
418 }
419
be6a4802 420 .vjs-fullscreen-control {
3ec8dc09
C
421 @include disable-outline;
422
be6a4802 423 width: 37px;
2ce2fd7f 424 margin-right: 11px;
be6a4802
C
425
426 .vjs-icon-placeholder {
427 display: inline-block;
428 width: 22px;
429 height: 22px;
430 vertical-align: middle;
2a19a1e4 431 background: url('#{$assets-path}/player/images/fullscreen.svg') no-repeat;
be6a4802
C
432 background-size: contain;
433
434 &::before {
435 content: '';
436 }
437 }
438 }
e14852b4 439
be6a4802 440 .vjs-menu-button-popup {
be6a4802 441 font-weight: $font-semibold;
86f278cb 442 width: 50px;
be6a4802 443
be6a4802 444 .vjs-resolution-button {
3ec8dc09 445 @include disable-outline;
be6a4802
C
446 }
447
448 .vjs-menu {
449 top: 20px;
3ec8dc09 450 left: 0;
be6a4802
C
451
452 .vjs-menu-content {
86f278cb 453 width: 50px;
3ec8dc09 454 bottom: 20px;
be6a4802
C
455 }
456
457 li {
458 text-transform: none;
459 font-size: 13px;
460 }
461 }
462 }
463 }
a86309b4 464
6cf57b44 465 @media screen and (max-width: 750px) {
054a103b
C
466 .vjs-theater-control {
467 display: none;
468 }
469
6cf57b44
C
470 .vjs-dock-text {
471 font-size: 16px;
472 }
473
474 .vjs-dock-description {
3c40590d 475 font-size: 9px;
6cf57b44
C
476 }
477
478 .vjs-big-play-button {
479 font-size: 5em;
480 border-width: 5px;
481
482 .vjs-icon-placeholder::before {
483 @include big-play-button-triangle-size(32px);
484 }
485 }
486 }
487
e700d33b 488 @media screen and (max-width: 570px) {
869968d7
C
489 .vjs-dock-text {
490 font-size: 14px;
491 }
492
8fa5653a 493 .vjs-big-play-button {
869968d7 494 font-size: 4.5em;
864e782b
C
495 border-width: 4.5px;
496
497 .vjs-icon-placeholder::before {
498 @include big-play-button-triangle-size(27px);
499 }
8fa5653a
C
500 }
501
a73c582e
C
502 .vjs-playback-rate {
503 display: none;
504 }
505
7ccfb37f 506 .vjs-peertube {
86f278cb
C
507 padding: 0 !important;
508
7ccfb37f 509 .vjs-peertube-displayed {
86f278cb
C
510 display: none !important;
511 }
512 }
513 }
514
515 @media screen and (max-width: 300px) {
8fa5653a 516 .vjs-dock-text {
22b59e80
C
517 font-size: 13px;
518 }
519
8fa5653a 520 .vjs-big-play-button {
586f7c1b 521 font-size: 3em;
864e782b
C
522 border-width: 3px;
523
524 .vjs-icon-placeholder::before {
525 @include big-play-button-triangle-size(20px);
526 }
8fa5653a
C
527 }
528
86f278cb 529 .vjs-volume-control {
a86309b4
C
530 display: none !important;
531 }
86f278cb 532
ea20306f
C
533 .vjs-peertube-link {
534 padding: 0 !important;
535 }
536
537 .vjs-settings {
538 width: 33px;
86f278cb 539 }
a86309b4 540 }
4555697f
C
541
542 // Theater mode is enabled
543 &.vjs-theater-enabled {
544 .vjs-theater-control {
545 width: 30px;
546
547 .vjs-icon-placeholder {
548 transform: scale(0.8);
549 }
550 }
551 }
552
553 // On fullscreen, hide theater control
554 &.vjs-fullscreen {
555 .vjs-theater-control {
556 display: none;
557 }
558 }
e14852b4 559}
b7a48512 560
c6352f2c
C
561// Play/pause animations
562.vjs-has-started .vjs-play-control {
563 &.vjs-playing {
564 animation: remove-pause-button 0.25s ease;
565 }
566
567 &.vjs-paused {
568 animation: add-play-button 0.25s ease;
569 }
570
571 @keyframes remove-pause-button {
572 0% {
573 transform: rotate(90deg);
574 }
575 100% {
576 transform: rotate(0deg);
577 }
578 }
579
580 @keyframes add-play-button {
581 0% {
582 transform: rotate(-90deg);
583 }
584 100% {
585 transform: rotate(0deg);
586 }
587 }
588}
589
bf5685f0
C
590// Error display disabled
591.vjs-error:not(.vjs-error-display-enabled) {
592 .vjs-error-display {
593 display: none;
594 }
595
596 .vjs-loading-spinner {
597 display: block;
598 }
599}
600
601// Error display enabled
602.vjs-error.vjs-error-display-enabled {
603 .vjs-error-display {
604 display: block;
605 }
c6352f2c 606}