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