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