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