]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/player/peertube-skin.scss
Migrate to webdriverio
[github/Chocobozzz/PeerTube.git] / client / src / sass / player / peertube-skin.scss
CommitLineData
fa12eacc 1@use 'sass:math';
8cbc40b2
C
2@use '_variables' as *;
3@use '_mixins' as *;
4@use './_player-variables' as *;
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;
62ddc31a
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
8cbc40b2 60 @include margin-left(-(math.div($big-play-width, 2)));
27bc9586 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;
8cbc40b2 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 356 -webkit-mask-image: url('#{$assets-path}/player/images/next.svg');
fa1e07ca
C
357 mask-size: cover;
358 -webkit-mask-size: cover;
bc4c9cc1 359
931d3430 360 background-color: #fff;
a950e4c8
C
361 width: 11px;
362 height: 11px;
363 margin-top: -2px;
364 display: inline-block;
365 }
366
367 &.icon-previous {
368 transform: rotate(180deg);
1dc240a9
RK
369 }
370 }
371 }
372
a950e4c8 373 .vjs-peertube {
be6a4802
C
374 .icon {
375 display: inline-block;
376 width: 15px;
377 height: 15px;
378 background-size: contain;
379 vertical-align: middle;
380 background-repeat: no-repeat;
be6a4802
C
381 position: relative;
382 top: -1px;
be6a4802
C
383 }
384 }
e14852b4 385
57886d66 386 .vjs-playback-rate {
387 font-size: 10px;
3ec8dc09 388 width: 37px !important;
a73c582e
C
389
390 .vjs-playback-rate-value {
391 font-size: 13px;
392 line-height: $control-bar-height;
393 }
3ec8dc09
C
394
395 .vjs-menu .vjs-menu-content {
396 width: 37px !important;
397 }
57886d66 398 }
399
be6a4802 400 .vjs-mute-control {
3ec8dc09
C
401 @include disable-outline;
402
3ec8dc09
C
403 padding: 0;
404 width: 30px;
d7701449 405
be6a4802
C
406 .vjs-icon-placeholder {
407 display: inline-block;
408 width: 22px;
409 height: 22px;
410 vertical-align: middle;
2a19a1e4 411 background: url('#{$assets-path}/player/images/volume.svg') no-repeat;
be6a4802
C
412 background-size: contain;
413
414 &::before {
415 content: '';
416 }
417 }
418
419 &.vjs-vol-0 .vjs-icon-placeholder {
2a19a1e4 420 background: url('#{$assets-path}/player/images/volume-mute.svg') no-repeat;
be6a4802
C
421 background-size: contain;
422 }
423 }
e14852b4 424
3ec8dc09 425 .vjs-volume-control {
27bc9586
C
426 @include margin(0, 5px, 0, 0);
427
3ec8dc09 428 width: 30px;
be6a4802 429 }
e14852b4 430
be6a4802 431 .vjs-volume-bar {
931d3430 432 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcCAQAAACw95UnAAAAMElEQVRIx2NgoBL4n4YKGUYNHkEG4zJg1OCRYDCpBowaPJwMppbLRg0eNXjUYBLEAXWNUA6QNm1lAAAAAElFTkSuQmCC') no-repeat;
be6a4802
C
433 background-size: 22px 14px;
434 height: 100%;
435 width: 100%;
436 max-width: 22px;
437 max-height: 14px;
438 margin: 7px 4px;
439 border-radius: 0;
440 top: 3px;
441
442 .vjs-volume-level {
931d3430 443 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcAQAAAAAyhWABAAAAAnRSTlMAAHaTzTgAAAAZSURBVHgBYwAB/g9EUv+JokCqiaT+U4MCAPKPS7WUUOc1AAAAAElFTkSuQmCC') no-repeat;
be6a4802
C
444 background-size: 22px 14px;
445 max-width: 22px;
446 max-height: 14px;
447 height: 100%;
448 }
3d5de919
C
449
450 &:focus {
451 text-shadow: none;
452 box-shadow: none;
453 }
be6a4802 454 }
e14852b4 455
be6a4802
C
456 .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
457 .vjs-volume-panel.vjs-volume-panel-horizontal:active,
458 .vjs-volume-panel.vjs-volume-panel-horizontal:focus,
459 .vjs-volume-panel.vjs-volume-panel-horizontal:hover {
460 width: 6em;
461 transition-property: none;
462 }
e14852b4 463
be6a4802
C
464 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal {
465 width: 3em;
466 height: auto;
467 }
e14852b4 468
be6a4802
C
469 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control {
470 transition-property: none;
471 }
e14852b4 472
be6a4802
C
473 .vjs-volume-panel {
474 .vjs-mute-control {
475 width: 2em;
476 z-index: 1;
477 padding: 0;
478 }
479
480 .vjs-volume-control {
481 display: inline-block;
482 position: relative;
483 left: 5px;
484 opacity: 1;
485 width: 3em;
486 height: auto;
487 }
488 }
e14852b4 489
c6352f2c
C
490 .vjs-peertube-link {
491 @include disable-outline;
492 @include disable-default-a-behaviour;
493
494 text-decoration: none;
495 line-height: $control-bar-height;
496 font-weight: $font-semibold;
497 padding: 0 5px;
498 }
499
054a103b
C
500 .vjs-theater-control {
501 @include disable-outline;
27bc9586 502 @include margin-right(1px);
054a103b
C
503
504 width: 37px;
b335ccec 505 cursor: pointer;
054a103b
C
506
507 .vjs-icon-placeholder {
4555697f 508 transition: transform 0.2s ease;
054a103b
C
509 display: inline-block;
510 width: 22px;
511 height: 22px;
512 vertical-align: middle;
513 background: url('#{$assets-path}/player/images/theater.svg') no-repeat;
514 background-size: contain;
515
516 &::before {
517 content: '';
518 }
519 }
520 }
521
be6a4802 522 .vjs-fullscreen-control {
3ec8dc09 523 @include disable-outline;
27bc9586 524 @include margin-left($first-control-bar-element-margin-left);
3ec8dc09 525
be6a4802
C
526 width: 37px;
527
528 .vjs-icon-placeholder {
529 display: inline-block;
530 width: 22px;
531 height: 22px;
532 vertical-align: middle;
2a19a1e4 533 background: url('#{$assets-path}/player/images/fullscreen.svg') no-repeat;
be6a4802
C
534 background-size: contain;
535
536 &::before {
537 content: '';
538 }
539 }
540 }
e14852b4 541
be6a4802 542 .vjs-menu-button-popup {
be6a4802 543 font-weight: $font-semibold;
86f278cb 544 width: 50px;
be6a4802 545
be6a4802 546 .vjs-resolution-button {
3ec8dc09 547 @include disable-outline;
be6a4802
C
548 }
549
550 .vjs-menu {
551 top: 20px;
3ec8dc09 552 left: 0;
be6a4802
C
553
554 .vjs-menu-content {
86f278cb 555 width: 50px;
3ec8dc09 556 bottom: 20px;
be6a4802
C
557 }
558
559 li {
560 text-transform: none;
561 font-size: 13px;
562 }
563 }
564 }
565 }
a86309b4 566
6cf57b44 567 @media screen and (max-width: 750px) {
054a103b
C
568 .vjs-theater-control {
569 display: none;
570 }
571
6cf57b44
C
572 .vjs-dock-text {
573 font-size: 16px;
574 }
575
576 .vjs-dock-description {
3c40590d 577 font-size: 9px;
6cf57b44
C
578 }
579
580 .vjs-big-play-button {
581 font-size: 5em;
e0812403 582 border-width: 3px;
6cf57b44
C
583
584 .vjs-icon-placeholder::before {
585 @include big-play-button-triangle-size(32px);
586 }
587 }
588 }
589
e700d33b 590 @media screen and (max-width: 570px) {
869968d7
C
591 .vjs-dock-text {
592 font-size: 14px;
593 }
594
8fa5653a 595 .vjs-big-play-button {
869968d7 596 font-size: 4.5em;
e0812403 597 border-width: 2.5px;
864e782b
C
598
599 .vjs-icon-placeholder::before {
600 @include big-play-button-triangle-size(27px);
601 }
8fa5653a
C
602 }
603
7ccfb37f 604 .vjs-peertube {
86f278cb
C
605 padding: 0 !important;
606
7ccfb37f 607 .vjs-peertube-displayed {
86f278cb
C
608 display: none !important;
609 }
610 }
e43b5a3f
C
611
612 &.vjs-live {
613 .vjs-duration {
614 display: none !important;
615 }
616
617 .vjs-peertube {
618 display: none !important;
619 }
620 }
86f278cb
C
621 }
622
e43b5a3f 623 @media screen and (max-width: 350px) {
8fa5653a 624 .vjs-dock-text {
22b59e80
C
625 font-size: 13px;
626 }
627
8fa5653a 628 .vjs-big-play-button {
586f7c1b 629 font-size: 3em;
e0812403 630 border-width: 2px;
864e782b
C
631
632 .vjs-icon-placeholder::before {
633 @include big-play-button-triangle-size(20px);
634 }
8fa5653a
C
635 }
636
92d54714
C
637 .vjs-volume-control,
638 .vjs-next-video,
639 .vjs-previous-video {
a86309b4
C
640 display: none !important;
641 }
86f278cb 642
ea20306f
C
643 .vjs-peertube-link {
644 padding: 0 !important;
645 }
646
647 .vjs-settings {
648 width: 33px;
86f278cb 649 }
92d54714 650
e43b5a3f
C
651 .vjs-control-bar {
652 > button:first-child {
27bc9586 653 @include margin-left($first-control-bar-element-margin-left-small-width);
e43b5a3f
C
654 }
655 }
656
657 .vjs-fullscreen-control {
27bc9586 658 @include margin-right($first-control-bar-element-margin-left-small-width);
e43b5a3f
C
659 }
660
661 &.vjs-live {
662 .vjs-current-time {
663 display: none !important;
664 }
92d54714 665 }
a86309b4 666 }
4555697f
C
667
668 // Theater mode is enabled
669 &.vjs-theater-enabled {
670 .vjs-theater-control {
671 width: 30px;
672
673 .vjs-icon-placeholder {
674 transform: scale(0.8);
675 }
676 }
677 }
678
679 // On fullscreen, hide theater control
680 &.vjs-fullscreen {
681 .vjs-theater-control {
682 display: none;
683 }
684 }
e14852b4 685}
b7a48512 686
c6352f2c
C
687// Play/pause animations
688.vjs-has-started .vjs-play-control {
689 &.vjs-playing {
690 animation: remove-pause-button 0.25s ease;
691 }
692
693 &.vjs-paused {
694 animation: add-play-button 0.25s ease;
695 }
696
697 @keyframes remove-pause-button {
698 0% {
699 transform: rotate(90deg);
700 }
701 100% {
702 transform: rotate(0deg);
703 }
704 }
705
706 @keyframes add-play-button {
707 0% {
708 transform: rotate(-90deg);
709 }
710 100% {
711 transform: rotate(0deg);
712 }
713 }
714}
715
bf5685f0
C
716// Error display disabled
717.vjs-error:not(.vjs-error-display-enabled) {
718 .vjs-error-display {
719 display: none;
720 }
721
722 .vjs-loading-spinner {
723 display: block;
724 }
725}
726
727// Error display enabled
728.vjs-error.vjs-error-display-enabled {
729 .vjs-error-display {
730 display: block;
731 }
e0812403 732}
a950e4c8
C
733
734.vjs-no-next-in-playlist {
735 .vjs-next-video {
736 cursor: default;
737
738 .icon {
739 background-color: rgba(255, 255, 255, 0.5);
740 }
741 }
742}