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