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