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