]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/video-js-custom.scss
Fix player progress bar
[github/Chocobozzz/PeerTube.git] / client / src / sass / video-js-custom.scss
CommitLineData
3ec8dc09
C
1@import '_variables';
2@import '_mixins';
3
864e782b
C
4@mixin big-play-button-triangle-size($triangle-size) {
5 width: $triangle-size;
6 height: $triangle-size;
7 top: calc(50% - #{$triangle-size / 2});
8 left: calc(53% - #{($triangle-size / 2)});
9}
10
c6352f2c 11$primary-foreground-color: #fff;
e993ecb3
C
12$primary-foreground-opacity: 0.9;
13$primary-foreground-opacity-hover: 1;
be6a4802 14$primary-background-color: #000;
e993ecb3 15
be6a4802
C
16$font-size: 13px;
17$control-bar-height: 34px;
aa8b6df4 18
e993ecb3
C
19$slider-bg-color: lighten($primary-background-color, 33%);
20
c6352f2c
C
21$setting-transition-duration: 0.15s;
22$setting-transition-easing: ease-out;
23
960a11e8
C
24$context-menu-width: 350px;
25
be6a4802
C
26.video-js.vjs-peertube-skin {
27 font-size: $font-size;
c6352f2c 28 color: $primary-foreground-color;
aa8b6df4 29
22b59e80
C
30 .vjs-dock-text {
31 padding-right: 10px;
32 }
33
34 .vjs-dock-description {
35 font-size: 11px;
36
c6352f2c 37 &::before, &::after {
22b59e80
C
38 display: inline-block;
39 content: '\1F308';
40 }
41
c6352f2c 42 &::before {
22b59e80
C
43 margin-right: 4px;
44 }
45
c6352f2c 46 &::after {
22b59e80
C
47 margin-left: 4px;
48 transform: scale(-1, 1);
49 }
50 }
51
be6a4802
C
52 .vjs-button > .vjs-icon-placeholder::before {
53 line-height: $control-bar-height;
aa8b6df4 54 }
e14852b4 55
c6352f2c 56 .vjs-volume-level::before {
be6a4802
C
57 content: ''; /* Remove Circle From Progress Bar */
58 }
e14852b4 59
be6a4802
C
60 .vjs-audio-button {
61 display: none;
62 }
e14852b4 63
be6a4802 64 .vjs-big-play-button {
9e6b41cc 65 outline: 0;
07fa4c97 66 font-size: 6em;
e14852b4 67
33d78552
C
68 $big-play-width: 1.2em;
69 $big-play-height: 1.2em;
e14852b4 70
864e782b 71 border: 6px solid #fff;
33d78552 72 border-radius: 100%;
e14852b4 73
e14852b4
C
74 left: 50%;
75 top: 50%;
8cac1b64
C
76 width: $big-play-width;
77 height: $big-play-height;
78 line-height: $big-play-height;
e14852b4
C
79 margin-left: -($big-play-width / 2);
80 margin-top: -($big-play-height / 2);
864e782b 81 transition: 0.4s opacity;
adcaf1a8
C
82
83 &::-moz-focus-inner {
84 border: 0;
85 padding: 0
86 }
80d1057b
C
87
88 .vjs-icon-placeholder::before {
864e782b
C
89 @include big-play-button-triangle-size(45px);
90
91 content: '';
92 background-image: url('../assets/player/images/big-play-button.svg');
80d1057b
C
93 }
94
8cac1b64 95 &:hover {
33d78552 96 opacity: 0.8;
80d1057b 97 }
be6a4802 98 }
e14852b4 99
864e782b
C
100 // Small effect when we click on the play button
101 &.vjs-has-big-play-button-clicked {
33d78552 102
864e782b
C
103 .vjs-big-play-button, .vjs-poster {
104 display: block;
105 visibility: hidden;
33d78552 106
864e782b 107 &.vjs-big-play-button, &.vjs-big-play-button::before {
33d78552 108 opacity: 0;
864e782b 109 transition: visibility 0.2s, opacity 0.2s;
33d78552 110 }
864e782b
C
111
112 &.vjs-poster, &.vjs-poster::before {
113 opacity: 0;
114 transition: visibility 0.3s, opacity 0.3s;
115 transition-delay: 0.05s;
33d78552
C
116 }
117 }
8fa5653a
C
118 }
119
e6f62797
C
120 // Hide the big play button on autoplay
121 &.vjs-has-autoplay {
122 .vjs-big-play-button {
123 display: none !important;
124 }
125 }
126
be6a4802
C
127 .vjs-control-bar,
128 .vjs-big-play-button,
c6352f2c 129 .vjs-settings-dialog {
be6a4802
C
130 background-color: rgba($primary-background-color, 0.5);
131 }
e14852b4 132
be6a4802
C
133 .vjs-poster {
134 outline: none; /* Remove Blue Outline on Click*/
135 outline: 0;
136 }
e14852b4 137
be6a4802
C
138 .vjs-control-bar {
139 height: $control-bar-height;
e14852b4 140
6b9af129
C
141 .vjs-progress-control,
142 .vjs-play-control,
143 .vjs-playback-rate,
144 .vjs-mute-control,
145 .vjs-volume-control,
146 .vjs-resolution-control,
c6352f2c
C
147 .vjs-fullscreen-control,
148 .vjs-peertube-link,
149 .vjs-settings
6b9af129 150 {
c6352f2c 151 color: $primary-foreground-color !important;
6b9af129
C
152 opacity: $primary-foreground-opacity;
153 transition: opacity .1s;
154
155 &:hover {
156 opacity: $primary-foreground-opacity-hover;
157 }
158 }
159
160 .vjs-current-time,
161 .vjs-duration,
162 .vjs-peertube {
163 color: $primary-foreground-color;
c6352f2c 164 opacity: $primary-foreground-opacity;
6b9af129
C
165 }
166
77728efa
C
167 .vjs-slider {
168 background-color: rgba(255, 255, 255, .2);
169 border-radius: 2px;
170 height: 5px;
171
172 .vjs-slider-bar {
173 background: $primary-foreground-color;
174 }
175 }
176
177 .vjs-play-progress {
178
179 &::before {
180 top: -0.3em;
181
182 &:hover {
183 top: -0.372em;
184 }
185 }
186
187 .vjs-time-tooltip {
188 display: none;
189 }
190 }
191
192 .vjs-load-progress {
193 &, & div {
194 background: rgba(255, 255, 255, .2);
195 }
196 }
197
be6a4802
C
198 .vjs-progress-control {
199 bottom: 34px;
200 width: 100%;
201 position: absolute;
202 height: 5px;
e14852b4 203
be6a4802
C
204 .vjs-progress-holder {
205 margin: 0;
206 border-radius: 0;
207 }
208 }
e14852b4 209
be6a4802 210 .vjs-play-control {
3ec8dc09
C
211 @include disable-outline;
212
c6352f2c 213 cursor: pointer;
be6a4802
C
214 font-size: $font-size;
215 padding: 0 17px;
216 margin-right: 5px;
217 }
e14852b4 218
be6a4802
C
219 .vjs-time-control {
220 &.vjs-current-time {
221 font-size: $font-size;
222 display: inline-block;
223 padding: 0;
224
225 .vjs-current-time-display {
86f278cb 226 line-height: calc(#{$control-bar-height} + 1px);
be6a4802
C
227
228 &::after {
229 content: "/";
230 margin: 0 1px 0 2px;
231 }
232 }
233 }
234
235 &.vjs-duration {
236 font-size: $font-size;
237 display: inline-block;
238 padding: 0;
be6a4802 239 .vjs-duration-display {
86f278cb 240 line-height: calc(#{$control-bar-height} + 1px);
be6a4802
C
241 }
242 }
243
244 &.vjs-remaining-time {
245 display: none;
246 }
247 }
e14852b4 248
bf5685f0 249 .vjs-peertube {
be6a4802
C
250 width: 100%;
251 line-height: $control-bar-height;
252 text-align: right;
be6a4802 253
bf5685f0 254 .vjs-peertube-displayed {
a86309b4
C
255 display: block;
256 }
257
bf5685f0 258 .vjs-peertube-hidden {
a86309b4
C
259 display: none;
260 }
261
be6a4802
C
262 .download-speed-number, .upload-speed-number, .peers-number {
263 font-weight: $font-semibold;
264 }
265
266 .download-speed-text, .upload-speed-text, .peers-text {
267 margin-right: 15px;
268 }
269
270 .icon {
271 display: inline-block;
272 width: 15px;
273 height: 15px;
274 background-size: contain;
275 vertical-align: middle;
276 background-repeat: no-repeat;
277 margin-right: 6px;
278 position: relative;
279 top: -1px;
280
281 &.icon-download {
282 background-image: url('../assets/player/images/arrow-down.svg');
283 }
284
285 &.icon-upload {
286 background-image: url('../assets/player/images/arrow-up.svg');
287 }
288 }
289 }
e14852b4 290
57886d66 291 .vjs-playback-rate {
292 font-size: 10px;
3ec8dc09 293 width: 37px !important;
a73c582e
C
294
295 .vjs-playback-rate-value {
296 font-size: 13px;
297 line-height: $control-bar-height;
298 }
3ec8dc09
C
299
300 .vjs-menu .vjs-menu-content {
301 width: 37px !important;
302 }
57886d66 303 }
304
be6a4802 305 .vjs-mute-control {
3ec8dc09
C
306 @include disable-outline;
307
308 line-height: $control-bar-height;
309 padding: 0;
310 width: 30px;
d7701449 311
be6a4802
C
312 .vjs-icon-placeholder {
313 display: inline-block;
314 width: 22px;
315 height: 22px;
316 vertical-align: middle;
317 background: url('../assets/player/images/volume.svg') no-repeat;
318 background-size: contain;
319
320 &::before {
321 content: '';
322 }
323 }
324
325 &.vjs-vol-0 .vjs-icon-placeholder {
326 background: url('../assets/player/images/volume-mute.svg') no-repeat;
327 background-size: contain;
328 }
329 }
e14852b4 330
3ec8dc09
C
331 .vjs-volume-control {
332 width: 30px;
c6352f2c 333 margin: 0 5px 0 0;
be6a4802 334 }
e14852b4 335
be6a4802
C
336 .vjs-volume-bar {
337 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcCAQAAACw95UnAAAAMElEQVRIx2NgoBL4n4YKGUYNHkEG4zJg1OCRYDCpBowaPJwMppbLRg0eNXjUYBLEAXWNUA6QNm1lAAAAAElFTkSuQmCC) no-repeat;
338 background-size: 22px 14px;
339 height: 100%;
340 width: 100%;
341 max-width: 22px;
342 max-height: 14px;
343 margin: 7px 4px;
344 border-radius: 0;
345 top: 3px;
346
347 .vjs-volume-level {
348 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcAQAAAAAyhWABAAAAAnRSTlMAAHaTzTgAAAAZSURBVHgBYwAB/g9EUv+JokCqiaT+U4MCAPKPS7WUUOc1AAAAAElFTkSuQmCC) no-repeat;
349 background-size: 22px 14px;
350 max-width: 22px;
351 max-height: 14px;
352 height: 100%;
353 }
354 }
e14852b4 355
be6a4802
C
356 .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
357 .vjs-volume-panel.vjs-volume-panel-horizontal:active,
358 .vjs-volume-panel.vjs-volume-panel-horizontal:focus,
359 .vjs-volume-panel.vjs-volume-panel-horizontal:hover {
360 width: 6em;
361 transition-property: none;
362 }
e14852b4 363
be6a4802
C
364 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal {
365 width: 3em;
366 height: auto;
367 }
e14852b4 368
be6a4802
C
369 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control {
370 transition-property: none;
371 }
e14852b4 372
be6a4802
C
373 .vjs-volume-panel {
374 .vjs-mute-control {
375 width: 2em;
376 z-index: 1;
377 padding: 0;
378 }
379
380 .vjs-volume-control {
381 display: inline-block;
382 position: relative;
383 left: 5px;
384 opacity: 1;
385 width: 3em;
386 height: auto;
387 }
388 }
e14852b4 389
c6352f2c
C
390 .vjs-peertube-link {
391 @include disable-outline;
392 @include disable-default-a-behaviour;
393
394 text-decoration: none;
395 line-height: $control-bar-height;
396 font-weight: $font-semibold;
397 padding: 0 5px;
398 }
399
be6a4802 400 .vjs-fullscreen-control {
3ec8dc09
C
401 @include disable-outline;
402
be6a4802
C
403 width: 37px;
404
405 .vjs-icon-placeholder {
406 display: inline-block;
407 width: 22px;
408 height: 22px;
409 vertical-align: middle;
410 background: url('../assets/player/images/fullscreen.svg') no-repeat;
411 background-size: contain;
412
413 &::before {
414 content: '';
415 }
416 }
417 }
e14852b4 418
be6a4802 419 .vjs-menu-button-popup {
be6a4802 420 font-weight: $font-semibold;
86f278cb 421 width: 50px;
be6a4802 422
be6a4802 423 .vjs-resolution-button {
3ec8dc09 424 @include disable-outline;
be6a4802
C
425 }
426
427 .vjs-menu {
428 top: 20px;
3ec8dc09 429 left: 0;
be6a4802
C
430
431 .vjs-menu-content {
86f278cb 432 width: 50px;
3ec8dc09 433 bottom: 20px;
be6a4802
C
434 }
435
436 li {
437 text-transform: none;
438 font-size: 13px;
439 }
440 }
441 }
442 }
a86309b4 443
6cf57b44
C
444 @media screen and (max-width: 750px) {
445 .vjs-dock-text {
446 font-size: 16px;
447 }
448
449 .vjs-dock-description {
3c40590d 450 font-size: 9px;
6cf57b44
C
451 }
452
453 .vjs-big-play-button {
454 font-size: 5em;
455 border-width: 5px;
456
457 .vjs-icon-placeholder::before {
458 @include big-play-button-triangle-size(32px);
459 }
460 }
461 }
462
e700d33b 463 @media screen and (max-width: 570px) {
869968d7
C
464 .vjs-dock-text {
465 font-size: 14px;
466 }
467
8fa5653a 468 .vjs-big-play-button {
869968d7 469 font-size: 4.5em;
864e782b
C
470 border-width: 4.5px;
471
472 .vjs-icon-placeholder::before {
473 @include big-play-button-triangle-size(27px);
474 }
8fa5653a
C
475 }
476
a73c582e
C
477 .vjs-playback-rate {
478 display: none;
479 }
480
7ccfb37f 481 .vjs-peertube {
86f278cb
C
482 padding: 0 !important;
483
7ccfb37f 484 .vjs-peertube-displayed {
86f278cb
C
485 display: none !important;
486 }
487 }
488 }
489
490 @media screen and (max-width: 300px) {
8fa5653a 491 .vjs-dock-text {
22b59e80
C
492 font-size: 13px;
493 }
494
8fa5653a 495 .vjs-big-play-button {
586f7c1b 496 font-size: 3em;
864e782b
C
497 border-width: 3px;
498
499 .vjs-icon-placeholder::before {
500 @include big-play-button-triangle-size(20px);
501 }
8fa5653a
C
502 }
503
86f278cb 504 .vjs-volume-control {
a86309b4
C
505 display: none !important;
506 }
86f278cb 507
ea20306f
C
508 .vjs-peertube-link {
509 padding: 0 !important;
510 }
511
512 .vjs-settings {
513 width: 33px;
86f278cb 514 }
a86309b4 515 }
e14852b4 516}
b7a48512 517
c6352f2c
C
518// Play/pause animations
519.vjs-has-started .vjs-play-control {
520 &.vjs-playing {
521 animation: remove-pause-button 0.25s ease;
522 }
523
524 &.vjs-paused {
525 animation: add-play-button 0.25s ease;
526 }
527
528 @keyframes remove-pause-button {
529 0% {
530 transform: rotate(90deg);
531 }
532 100% {
533 transform: rotate(0deg);
534 }
535 }
536
537 @keyframes add-play-button {
538 0% {
539 transform: rotate(-90deg);
540 }
541 100% {
542 transform: rotate(0deg);
543 }
544 }
545}
546
b7a48512
C
547// Thanks: https://projects.lukehaas.me/css-loaders/
548.vjs-loading-spinner {
fd45e8f4 549 left: 50%;
b7a48512 550 font-size: 10px;
fd45e8f4
C
551 text-indent: -9999em;
552 border: 0.7em solid rgba(255, 255, 255, 0.2);
553 border-left-color: #ffffff;
b7a48512 554 transform: translateZ(0);
9581cabc 555 animation: 0.3s ease-out 1.1s forwards vjs-spinner-show, spinner 1.4s infinite linear !important;
b2731bff 556 overflow: hidden;
dfbd250d 557 visibility: hidden;
b7a48512 558
c6352f2c 559 &::before {
b7a48512 560 animation: none !important;
b7a48512
C
561 }
562
c6352f2c 563 &::after {
b7a48512 564 border-radius: 50%;
fd45e8f4
C
565 width: 6em;
566 height: 6em;
b7a48512
C
567 animation: none !important;
568 }
569
fd45e8f4 570 @keyframes spinner {
b7a48512 571 0% {
b7a48512
C
572 transform: rotate(0deg);
573 }
574 100% {
b7a48512
C
575 transform: rotate(360deg);
576 }
577 }
dfbd250d
C
578
579 @keyframes vjs-spinner-show {
580 0% {
581 display: none;
582 opacity: 0;
583 }
584
585 1% {
586 display: block;
587 visibility: visible;
588 opacity: 0;
589 }
590
591 100% {
592 display: block;
593 visibility: visible;
594 opacity: 1;
595 }
596 }
b7a48512 597}
a86309b4 598
bf5685f0
C
599// Error display disabled
600.vjs-error:not(.vjs-error-display-enabled) {
601 .vjs-error-display {
602 display: none;
603 }
604
605 .vjs-loading-spinner {
606 display: block;
607 }
608}
609
610// Error display enabled
611.vjs-error.vjs-error-display-enabled {
612 .vjs-error-display {
613 display: block;
614 }
615}
c6352f2c
C
616
617
618/* Sass for videojs-settings-menu */
619
620.video-js {
621
622 .vjs-settings {
623 @include disable-outline;
624
625 cursor: pointer;
626 width: 37px;
627
628 .vjs-icon-placeholder {
629 display: inline-block;
630 width: 17px;
631 height: 17px;
632 vertical-align: middle;
633 background: url('../assets/player/images/settings.svg') no-repeat;
634 background-size: contain;
635
636 &::before {
637 content: '';
638 }
639 }
640 }
641
642 .vjs-settings-sub-menu-title {
643 width: 4em;
644 text-transform: initial;
645 }
646
647 .vjs-settings-dialog {
648 position: absolute;
649 right: .5em;
650 bottom: 3.5em;
651 color: $primary-foreground-color;
652 opacity: $primary-foreground-opacity;
653 margin: 0 auto;
654 font-size: $font-size !important;
655
656 width: auto;
657 overflow: hidden;
658
659 transition: width $setting-transition-duration $setting-transition-easing, height $setting-transition-duration $setting-transition-easing;
660
661 .vjs-settings-sub-menu-value,
662 .vjs-settings-sub-menu-title {
663 display: table-cell;
664 padding: 0 5px;
665 }
666
667 .vjs-settings-sub-menu-title {
668 text-align: left;
669 font-weight: $font-semibold;
670 }
671
672 .vjs-settings-sub-menu-value {
673 width: 100%;
674 text-align: right;
a8462c8e
C
675
676 small {
677 font-size: 0.85em;
678 opacity: 0.8;
679 }
c6352f2c
C
680 }
681
682 .vjs-settings-panel {
683 position: absolute;
684 bottom: 0;
685 right: 0;
686 overflow-y: auto;
687 overflow-x: hidden;
688 border-radius: 1px;
689 }
690
691 .vjs-settings-panel-child {
692 display: flex;
693
694 align-items: flex-end;
695 white-space: nowrap;
696
697 &:focus,
698 &:active {
699 outline: none;
700 }
701
702 > .vjs-menu {
703 flex: 1;
704 min-width: 200px;
705 }
706
707 > .vjs-menu,
708 > .vjs-settings-sub-menu {
709 transition: all $setting-transition-duration $setting-transition-easing;
710
711 .vjs-menu-item {
712
33d78552
C
713 &:hover {
714 background-color: rgba(255, 255, 255, 0.2);
715 }
716
c6352f2c
C
717 &:first-child {
718 margin-top: 5px;
719 }
720
721 &:last-child {
722 margin-bottom: 5px;
723 }
724 }
725
726 li {
727 font-size: 1em;
728 text-transform: initial;
729
730 &:hover {
731 cursor: pointer;
732 }
733 }
734 }
735
736 > .vjs-menu {
737 .vjs-menu-item {
738 padding: 8px 16px;
739 }
740
741 .vjs-settings-sub-menu-value::after {
742 @include chevron-right(9px, 2px);
743
744 margin-left: 5px;
745 }
746 }
747
748 > .vjs-settings-sub-menu {
749 width: 80px;
750
751 .vjs-menu-item {
752 outline: 0;
753 font-weight: $font-semibold;
754
755 padding: 5px 8px;
756 text-align: right;
757
758 &.vjs-back-button {
759 background-color: inherit;
760 padding: 8px 8px 13px 8px;
761 margin-bottom: 5px;
762 border-bottom: 1px solid grey;
763
764 &::before {
765 @include chevron-left(9px, 2px);
766
767 margin-right: 5px;
768 }
769 }
770
771 &.vjs-selected {
772 background-color: inherit;
773 color: inherit;
774 position: relative;
775
776 &::before {
777 @include icon(15px);
778
779 position: absolute;
780 left: 8px;
781 content: ' ';
782 margin-top: 1px;
783 background-image: url('../assets/player/images/tick.svg');
784 }
785 }
786 }
787 }
788 }
789 }
960a11e8
C
790}
791
792/* Sass for videojs-contextmenu-ui */
793
794.video-js .vjs-contextmenu-ui-menu {
795 position: absolute;
796 background-color: rgba(0, 0, 0, 0.5);
797 padding: 5px 0;
798 width: $context-menu-width;
799
800 .vjs-menu-content {
801 opacity: $primary-foreground-opacity;
802 color: $primary-foreground-color;
803 font-size: $font-size !important;
804 font-weight: $font-semibold;
805 }
806
807 .vjs-menu-item {
808 cursor: pointer;
809 font-size: 1em;
810 padding: 8px 16px;
811 text-align: left;
812 text-transform: none;
813
814 &:hover {
815 background-color: rgba(255, 255, 255, 0.2);
816 }
817 }
c6352f2c 818}