]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/sass/player/peertube-skin.scss
Merge branch 'release/v1.3.0' into develop
[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 font-size: $font-size;
14 color: var(--embedForegroundColor);
15
16 .vjs-dock-text {
17 padding-right: 10px;
18 }
19
20 .vjs-dock-description {
21 font-size: 11px;
22
23 .text::before, .text::after {
24 display: inline-block;
25 content: '\1F308';
26 }
27
28 .text::before {
29 margin-right: 4px;
30 }
31
32 .text::after {
33 margin-left: 4px;
34 transform: scale(-1, 1);
35 }
36 }
37
38 .vjs-button > .vjs-icon-placeholder::before {
39 line-height: $control-bar-height;
40 }
41
42 .vjs-volume-level::before {
43 content: ''; /* Remove Circle From Progress Bar */
44 }
45
46 .vjs-audio-button {
47 display: none;
48 }
49
50 .vjs-big-play-button {
51 outline: 0;
52 font-size: 6em;
53
54 $big-play-width: 1.2em;
55 $big-play-height: 1.2em;
56
57 border: 4px solid #fff;
58 border-radius: 100%;
59
60 left: 50%;
61 top: 50%;
62 width: $big-play-width;
63 height: $big-play-height;
64 line-height: $big-play-height;
65 margin-left: -($big-play-width / 2);
66 margin-top: -($big-play-height / 2);
67 transition: 0.4s opacity;
68
69 &::-moz-focus-inner {
70 border: 0;
71 padding: 0
72 }
73
74 .vjs-icon-placeholder::before {
75 @include big-play-button-triangle-size(45px);
76
77 content: '';
78 background-image: url('#{$assets-path}/player/images/big-play-button.svg');
79 }
80
81 &:hover {
82 opacity: 0.8;
83 }
84 }
85
86 // Small effect when we click on the play button
87 &.vjs-has-big-play-button-clicked {
88
89 .vjs-big-play-button, .vjs-poster {
90 display: block;
91 visibility: hidden;
92
93 &.vjs-big-play-button, &.vjs-big-play-button::before {
94 opacity: 0;
95 transition: visibility 0.2s, opacity 0.2s;
96 }
97
98 &.vjs-poster, &.vjs-poster::before {
99 opacity: 0;
100 transition: visibility 0.3s, opacity 0.3s;
101 transition-delay: 0.05s;
102 }
103 }
104 }
105
106 // Hide the big play button on autoplay
107 &.vjs-has-autoplay {
108 .vjs-big-play-button {
109 display: none !important;
110 }
111 }
112
113 .vjs-control-bar,
114 .vjs-big-play-button,
115 .vjs-settings-dialog {
116 background-color: var(--embedBigPlayBackgroundColor);
117 }
118
119 .vjs-poster {
120 outline: none; /* Remove Blue Outline on Click*/
121 outline: 0;
122 }
123
124 .vjs-control-bar {
125 height: $control-bar-height;
126 background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
127 box-shadow: 0 -15px 40px 10px rgba(0, 0, 0, 0.2);
128 text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
129
130 .vjs-progress-control,
131 .vjs-play-control,
132 .vjs-playback-rate,
133 .vjs-mute-control,
134 .vjs-volume-control,
135 .vjs-resolution-control,
136 .vjs-fullscreen-control,
137 .vjs-peertube-link,
138 .vjs-theater-control,
139 .vjs-settings
140 {
141 color: var(--embedForegroundColor) !important;
142
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: var(--embedForegroundColor);
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: var(--embedForegroundColor);
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: 3px;
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: 2.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: 2px;
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 }