Fix ios player playback/subtitles menu
[oweals/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       cursor: pointer;
410
411       .vjs-icon-placeholder {
412         transition: transform 0.2s ease;
413         display: inline-block;
414         width: 22px;
415         height: 22px;
416         vertical-align: middle;
417         background: url('#{$assets-path}/player/images/theater.svg') no-repeat;
418         background-size: contain;
419
420         &::before {
421           content: '';
422         }
423       }
424     }
425
426     .vjs-fullscreen-control {
427       @include disable-outline;
428
429       width: 37px;
430       margin-right: 11px;
431
432       .vjs-icon-placeholder {
433         display: inline-block;
434         width: 22px;
435         height: 22px;
436         vertical-align: middle;
437         background: url('#{$assets-path}/player/images/fullscreen.svg') no-repeat;
438         background-size: contain;
439
440         &::before {
441           content: '';
442         }
443       }
444     }
445
446     .vjs-menu-button-popup {
447       font-weight: $font-semibold;
448       width: 50px;
449
450       .vjs-resolution-button {
451         @include disable-outline;
452       }
453
454       .vjs-menu {
455         top: 20px;
456         left: 0;
457
458         .vjs-menu-content {
459           width: 50px;
460           bottom: 20px;
461         }
462
463         li {
464           text-transform: none;
465           font-size: 13px;
466         }
467       }
468     }
469   }
470
471   @media screen and (max-width: 750px) {
472     .vjs-theater-control {
473       display: none;
474     }
475
476     .vjs-dock-text {
477       font-size: 16px;
478     }
479
480     .vjs-dock-description {
481       font-size: 9px;
482     }
483
484     .vjs-big-play-button {
485       font-size: 5em;
486       border-width: 5px;
487
488       .vjs-icon-placeholder::before {
489         @include big-play-button-triangle-size(32px);
490       }
491     }
492   }
493
494   @media screen and (max-width: 570px) {
495     .vjs-dock-text {
496       font-size: 14px;
497     }
498
499     .vjs-big-play-button {
500       font-size: 4.5em;
501       border-width: 4.5px;
502
503       .vjs-icon-placeholder::before {
504         @include big-play-button-triangle-size(27px);
505       }
506     }
507
508     .vjs-peertube {
509       padding: 0 !important;
510
511       .vjs-peertube-displayed {
512         display: none !important;
513       }
514     }
515   }
516
517   @media screen and (max-width: 300px) {
518     .vjs-dock-text {
519       font-size: 13px;
520     }
521
522     .vjs-big-play-button {
523       font-size: 3em;
524       border-width: 3px;
525
526       .vjs-icon-placeholder::before {
527         @include big-play-button-triangle-size(20px);
528       }
529     }
530
531     .vjs-volume-control {
532       display: none !important;
533     }
534
535     .vjs-peertube-link {
536       padding: 0 !important;
537     }
538
539     .vjs-settings {
540       width: 33px;
541     }
542   }
543
544   // Theater mode is enabled
545   &.vjs-theater-enabled {
546     .vjs-theater-control {
547       width: 30px;
548
549       .vjs-icon-placeholder {
550         transform: scale(0.8);
551       }
552     }
553   }
554
555   // On fullscreen, hide theater control
556   &.vjs-fullscreen {
557     .vjs-theater-control {
558       display: none;
559     }
560   }
561 }
562
563 // Play/pause animations
564 .vjs-has-started .vjs-play-control {
565   &.vjs-playing {
566     animation: remove-pause-button 0.25s ease;
567   }
568
569   &.vjs-paused {
570     animation: add-play-button 0.25s ease;
571   }
572
573   @keyframes remove-pause-button {
574     0% {
575       transform: rotate(90deg);
576     }
577     100% {
578       transform: rotate(0deg);
579     }
580   }
581
582   @keyframes add-play-button {
583     0% {
584       transform: rotate(-90deg);
585     }
586     100% {
587       transform: rotate(0deg);
588     }
589   }
590 }
591
592 // Error display disabled
593 .vjs-error:not(.vjs-error-display-enabled) {
594   .vjs-error-display {
595     display: none;
596   }
597
598   .vjs-loading-spinner {
599     display: block;
600   }
601 }
602
603 // Error display enabled
604 .vjs-error.vjs-error-display-enabled {
605   .vjs-error-display {
606     display: block;
607   }
608 }