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