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