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