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