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