]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/player/peertube-skin.scss
Add logic to handle playlist in embed
[github/Chocobozzz/PeerTube.git] / client / src / sass / player / peertube-skin.scss
CommitLineData
3ec8dc09
C
1@import '_variables';
2@import '_mixins';
2a19a1e4 3@import './_player-variables';
3ec8dc09 4
122dbb57
C
5body {
6 --embedForegroundColor: #{$primary-foreground-color};
7
8 --embedBigPlayBackgroundColor: #{$primary-background-color};
9}
10
864e782b
C
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
be6a4802
C
18.video-js.vjs-peertube-skin {
19 font-size: $font-size;
e66883b3 20 color: pvar(--embedForegroundColor);
aa8b6df4 21
22b59e80
C
22 .vjs-dock-text {
23 padding-right: 10px;
abb3097e
C
24 background: linear-gradient(to bottom, rgba(0, 0, 0, .6) 0, rgba(0, 0, 0, 0.2) 70%, rgba(0, 0, 0, 0) 100%);
25 }
26
27 .vjs-dock-title,
28 .vjs-dock-description {
29 text-shadow: 0 0 2px rgba(0, 0, 0, .5);
22b59e80
C
30 }
31
32 .vjs-dock-description {
33 font-size: 11px;
34
31b6ddf8 35 .text::before {
22b59e80
C
36 margin-right: 4px;
37 }
38
31b6ddf8 39 .text::after {
22b59e80
C
40 margin-left: 4px;
41 transform: scale(-1, 1);
42 }
43 }
44
be6a4802
C
45 .vjs-button > .vjs-icon-placeholder::before {
46 line-height: $control-bar-height;
aa8b6df4 47 }
e14852b4 48
c6352f2c 49 .vjs-volume-level::before {
be6a4802
C
50 content: ''; /* Remove Circle From Progress Bar */
51 }
e14852b4 52
be6a4802
C
53 .vjs-audio-button {
54 display: none;
55 }
e14852b4 56
be6a4802 57 .vjs-big-play-button {
9e6b41cc 58 outline: 0;
07fa4c97 59 font-size: 6em;
e14852b4 60
33d78552
C
61 $big-play-width: 1.2em;
62 $big-play-height: 1.2em;
e14852b4 63
abb3097e 64 border: 2px solid #fff;
33d78552 65 border-radius: 100%;
e14852b4 66
e14852b4
C
67 left: 50%;
68 top: 50%;
8cac1b64
C
69 width: $big-play-width;
70 height: $big-play-height;
71 line-height: $big-play-height;
e14852b4
C
72 margin-left: -($big-play-width / 2);
73 margin-top: -($big-play-height / 2);
864e782b 74 transition: 0.4s opacity;
adcaf1a8
C
75
76 &::-moz-focus-inner {
77 border: 0;
78 padding: 0
79 }
80d1057b
C
80
81 .vjs-icon-placeholder::before {
864e782b
C
82 @include big-play-button-triangle-size(45px);
83
84 content: '';
2a19a1e4 85 background-image: url('#{$assets-path}/player/images/big-play-button.svg');
80d1057b
C
86 }
87
d8d8de7f 88 &.focus-visible, &:hover {
1ebddadd 89 background-color: var(--mainColor, dimgray);
80d1057b 90 }
d8d8de7f 91
be6a4802 92 }
e14852b4 93
864e782b
C
94 // Small effect when we click on the play button
95 &.vjs-has-big-play-button-clicked {
33d78552 96
864e782b
C
97 .vjs-big-play-button, .vjs-poster {
98 display: block;
99 visibility: hidden;
33d78552 100
864e782b 101 &.vjs-big-play-button, &.vjs-big-play-button::before {
33d78552 102 opacity: 0;
864e782b 103 transition: visibility 0.2s, opacity 0.2s;
33d78552 104 }
864e782b
C
105
106 &.vjs-poster, &.vjs-poster::before {
107 opacity: 0;
108 transition: visibility 0.3s, opacity 0.3s;
109 transition-delay: 0.05s;
33d78552
C
110 }
111 }
8fa5653a
C
112 }
113
597ca6de 114 // Show poster and controls when playing audio-only content
115 &.vjs-playing-audio-only-content {
116 .vjs-poster {
117 display: block;
118 visibility: visible;
119 }
120
121 .vjs-control-bar {
122 opacity: $primary-foreground-opacity-hover;
123 }
124 }
125
e6f62797
C
126 // Hide the big play button on autoplay
127 &.vjs-has-autoplay {
128 .vjs-big-play-button {
129 display: none !important;
130 }
131 }
132
be6a4802
C
133 .vjs-control-bar,
134 .vjs-big-play-button,
c6352f2c 135 .vjs-settings-dialog {
e66883b3 136 background-color: pvar(--embedBigPlayBackgroundColor);
be6a4802 137 }
e14852b4 138
be6a4802
C
139 .vjs-poster {
140 outline: none; /* Remove Blue Outline on Click*/
141 outline: 0;
142 }
e14852b4 143
be6a4802
C
144 .vjs-control-bar {
145 height: $control-bar-height;
fc16f981
C
146 background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
147 box-shadow: 0 -15px 40px 10px rgba(0, 0, 0, 0.2);
0aabe3f6 148 text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
e14852b4 149
6b9af129
C
150 .vjs-progress-control,
151 .vjs-play-control,
152 .vjs-playback-rate,
153 .vjs-mute-control,
154 .vjs-volume-control,
155 .vjs-resolution-control,
c6352f2c
C
156 .vjs-fullscreen-control,
157 .vjs-peertube-link,
054a103b 158 .vjs-theater-control,
c6352f2c 159 .vjs-settings
6b9af129 160 {
e66883b3 161 color: pvar(--embedForegroundColor) !important;
5efab546 162
6b9af129
C
163 opacity: $primary-foreground-opacity;
164 transition: opacity .1s;
165
166 &:hover {
167 opacity: $primary-foreground-opacity-hover;
168 }
169 }
170
171 .vjs-current-time,
172 .vjs-duration,
173 .vjs-peertube {
e66883b3 174 color: pvar(--embedForegroundColor);
c6352f2c 175 opacity: $primary-foreground-opacity;
6b9af129
C
176 }
177
2ce2fd7f
C
178 .vjs-progress-control {
179 position: absolute;
180 z-index: 100; // On top of the progress bar
181 bottom: 29px;
182 width: calc(100% - (2 * #{$progress-margin}));
183 margin-left: $progress-margin;
184 height: 14px;
77728efa 185
2ce2fd7f
C
186 .vjs-slider {
187 margin: 0;
188 border-radius: 0;
189 background-color: rgba(255, 255, 255, .2);
190 height: 3px;
191 transition: none;
77728efa 192
2ce2fd7f 193 .vjs-play-progress {
e66883b3 194 background: pvar(--embedForegroundColor);
77728efa 195
2ce2fd7f
C
196 // Not display the circle if the progress is not hovered
197 &::before {
198 opacity: 0;
199 transition: opacity 0.1s ease;
200 font-size: 14px;
77728efa 201
2ce2fd7f
C
202 top: -0.3em;
203 }
77728efa 204
2ce2fd7f
C
205 .vjs-time-tooltip {
206 display: none;
207 }
208 }
77728efa 209
2ce2fd7f
C
210 .vjs-load-progress {
211 &, & div {
212 background: rgba(255, 255, 255, .2);
213 }
214 }
77728efa
C
215 }
216 }
217
2ce2fd7f 218 .vjs-progress-control:hover .vjs-slider,
3d5de919 219 .vjs-progress-control .vjs-slider.vjs-sliding {
be6a4802 220 height: 5px;
e14852b4 221
2ce2fd7f
C
222 .vjs-play-progress::before {
223 opacity: 1;
be6a4802
C
224 }
225 }
e14852b4 226
2ce2fd7f 227
be6a4802 228 .vjs-play-control {
3ec8dc09
C
229 @include disable-outline;
230
c6352f2c 231 cursor: pointer;
be6a4802 232 font-size: $font-size;
1dc240a9
RK
233 margin-left: 1em;
234 width: 3em;
be6a4802 235 }
e14852b4 236
be6a4802 237 .vjs-time-control {
8e53163f
C
238 line-height: inherit;
239
be6a4802
C
240 &.vjs-current-time {
241 font-size: $font-size;
242 display: inline-block;
243 padding: 0;
1dc240a9 244 margin-left: .5em;
be6a4802
C
245
246 .vjs-current-time-display {
86f278cb 247 line-height: calc(#{$control-bar-height} + 1px);
be6a4802
C
248
249 &::after {
250 content: "/";
251 margin: 0 1px 0 2px;
252 }
253 }
254 }
255
256 &.vjs-duration {
257 font-size: $font-size;
258 display: inline-block;
259 padding: 0;
be6a4802 260 .vjs-duration-display {
86f278cb 261 line-height: calc(#{$control-bar-height} + 1px);
be6a4802
C
262 }
263 }
264
265 &.vjs-remaining-time {
266 display: none;
267 }
268 }
e14852b4 269
bf5685f0 270 .vjs-peertube {
be6a4802
C
271 width: 100%;
272 line-height: $control-bar-height;
273 text-align: right;
1dc240a9 274 margin-right: 6px;
de64dfbb 275 overflow: hidden;
be6a4802 276
bf5685f0 277 .vjs-peertube-displayed {
a86309b4
C
278 display: block;
279 }
280
bf5685f0 281 .vjs-peertube-hidden {
a86309b4
C
282 display: none;
283 }
284
1ee156b2 285 .download-speed-number, .upload-speed-number, .peers-number, .http-fallback {
be6a4802
C
286 font-weight: $font-semibold;
287 }
288
1ee156b2 289 .download-speed-text, .upload-speed-text, .peers-text, .http-fallback {
be6a4802
C
290 margin-right: 15px;
291 }
292
1dc240a9
RK
293 .icon {
294 &.icon-download {
295 background-image: url('#{$assets-path}/player/images/arrow-down.svg');
296 }
297
298 &.icon-upload {
299 background-image: url('#{$assets-path}/player/images/arrow-up.svg');
300 }
301 }
302 }
303
304 .vjs-next-video {
305 line-height: $control-bar-height;
306 text-align: right;
307
308 .icon {
309 &.icon-next {
310 mask-image: url('#{$assets-path}/player/images/next.svg');
5abc96fc 311 -webkit-mask-image: url('#{$assets-path}/player/images/next.svg');
1dc240a9
RK
312 background-color: white;
313 mask-size: cover;
5abc96fc 314 -webkit-mask-size: cover;
1dc240a9
RK
315 transform: scale(2.2);
316 }
317 }
318 }
319
320 .vjs-peertube,
321 .vjs-next-video {
be6a4802
C
322 .icon {
323 display: inline-block;
324 width: 15px;
325 height: 15px;
326 background-size: contain;
327 vertical-align: middle;
328 background-repeat: no-repeat;
be6a4802
C
329 position: relative;
330 top: -1px;
be6a4802
C
331 }
332 }
e14852b4 333
57886d66 334 .vjs-playback-rate {
335 font-size: 10px;
3ec8dc09 336 width: 37px !important;
a73c582e
C
337
338 .vjs-playback-rate-value {
339 font-size: 13px;
340 line-height: $control-bar-height;
341 }
3ec8dc09
C
342
343 .vjs-menu .vjs-menu-content {
344 width: 37px !important;
345 }
57886d66 346 }
347
be6a4802 348 .vjs-mute-control {
3ec8dc09
C
349 @include disable-outline;
350
351 line-height: $control-bar-height;
352 padding: 0;
353 width: 30px;
d7701449 354
be6a4802
C
355 .vjs-icon-placeholder {
356 display: inline-block;
357 width: 22px;
358 height: 22px;
359 vertical-align: middle;
2a19a1e4 360 background: url('#{$assets-path}/player/images/volume.svg') no-repeat;
be6a4802
C
361 background-size: contain;
362
363 &::before {
364 content: '';
365 }
366 }
367
368 &.vjs-vol-0 .vjs-icon-placeholder {
2a19a1e4 369 background: url('#{$assets-path}/player/images/volume-mute.svg') no-repeat;
be6a4802
C
370 background-size: contain;
371 }
372 }
e14852b4 373
3ec8dc09
C
374 .vjs-volume-control {
375 width: 30px;
c6352f2c 376 margin: 0 5px 0 0;
be6a4802 377 }
e14852b4 378
be6a4802
C
379 .vjs-volume-bar {
380 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcCAQAAACw95UnAAAAMElEQVRIx2NgoBL4n4YKGUYNHkEG4zJg1OCRYDCpBowaPJwMppbLRg0eNXjUYBLEAXWNUA6QNm1lAAAAAElFTkSuQmCC) no-repeat;
381 background-size: 22px 14px;
382 height: 100%;
383 width: 100%;
384 max-width: 22px;
385 max-height: 14px;
386 margin: 7px 4px;
387 border-radius: 0;
388 top: 3px;
389
390 .vjs-volume-level {
391 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcAQAAAAAyhWABAAAAAnRSTlMAAHaTzTgAAAAZSURBVHgBYwAB/g9EUv+JokCqiaT+U4MCAPKPS7WUUOc1AAAAAElFTkSuQmCC) no-repeat;
392 background-size: 22px 14px;
393 max-width: 22px;
394 max-height: 14px;
395 height: 100%;
396 }
3d5de919
C
397
398 &:focus {
399 text-shadow: none;
400 box-shadow: none;
401 }
be6a4802 402 }
e14852b4 403
be6a4802
C
404 .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
405 .vjs-volume-panel.vjs-volume-panel-horizontal:active,
406 .vjs-volume-panel.vjs-volume-panel-horizontal:focus,
407 .vjs-volume-panel.vjs-volume-panel-horizontal:hover {
408 width: 6em;
409 transition-property: none;
410 }
e14852b4 411
be6a4802
C
412 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal {
413 width: 3em;
414 height: auto;
415 }
e14852b4 416
be6a4802
C
417 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control {
418 transition-property: none;
419 }
e14852b4 420
be6a4802
C
421 .vjs-volume-panel {
422 .vjs-mute-control {
423 width: 2em;
424 z-index: 1;
425 padding: 0;
426 }
427
428 .vjs-volume-control {
429 display: inline-block;
430 position: relative;
431 left: 5px;
432 opacity: 1;
433 width: 3em;
434 height: auto;
435 }
436 }
e14852b4 437
c6352f2c
C
438 .vjs-peertube-link {
439 @include disable-outline;
440 @include disable-default-a-behaviour;
441
442 text-decoration: none;
443 line-height: $control-bar-height;
444 font-weight: $font-semibold;
445 padding: 0 5px;
446 }
447
054a103b
C
448 .vjs-theater-control {
449 @include disable-outline;
450
451 width: 37px;
452 margin-right: 1px;
b335ccec 453 cursor: pointer;
054a103b
C
454
455 .vjs-icon-placeholder {
4555697f 456 transition: transform 0.2s ease;
054a103b
C
457 display: inline-block;
458 width: 22px;
459 height: 22px;
460 vertical-align: middle;
461 background: url('#{$assets-path}/player/images/theater.svg') no-repeat;
462 background-size: contain;
463
464 &::before {
465 content: '';
466 }
467 }
468 }
469
be6a4802 470 .vjs-fullscreen-control {
3ec8dc09
C
471 @include disable-outline;
472
be6a4802 473 width: 37px;
2ce2fd7f 474 margin-right: 11px;
be6a4802
C
475
476 .vjs-icon-placeholder {
477 display: inline-block;
478 width: 22px;
479 height: 22px;
480 vertical-align: middle;
2a19a1e4 481 background: url('#{$assets-path}/player/images/fullscreen.svg') no-repeat;
be6a4802
C
482 background-size: contain;
483
484 &::before {
485 content: '';
486 }
487 }
488 }
e14852b4 489
be6a4802 490 .vjs-menu-button-popup {
be6a4802 491 font-weight: $font-semibold;
86f278cb 492 width: 50px;
be6a4802 493
be6a4802 494 .vjs-resolution-button {
3ec8dc09 495 @include disable-outline;
be6a4802
C
496 }
497
498 .vjs-menu {
499 top: 20px;
3ec8dc09 500 left: 0;
be6a4802
C
501
502 .vjs-menu-content {
86f278cb 503 width: 50px;
3ec8dc09 504 bottom: 20px;
be6a4802
C
505 }
506
507 li {
508 text-transform: none;
509 font-size: 13px;
510 }
511 }
512 }
513 }
a86309b4 514
6cf57b44 515 @media screen and (max-width: 750px) {
054a103b
C
516 .vjs-theater-control {
517 display: none;
518 }
519
6cf57b44
C
520 .vjs-dock-text {
521 font-size: 16px;
522 }
523
524 .vjs-dock-description {
3c40590d 525 font-size: 9px;
6cf57b44
C
526 }
527
528 .vjs-big-play-button {
529 font-size: 5em;
e0812403 530 border-width: 3px;
6cf57b44
C
531
532 .vjs-icon-placeholder::before {
533 @include big-play-button-triangle-size(32px);
534 }
535 }
536 }
537
e700d33b 538 @media screen and (max-width: 570px) {
869968d7
C
539 .vjs-dock-text {
540 font-size: 14px;
541 }
542
8fa5653a 543 .vjs-big-play-button {
869968d7 544 font-size: 4.5em;
e0812403 545 border-width: 2.5px;
864e782b
C
546
547 .vjs-icon-placeholder::before {
548 @include big-play-button-triangle-size(27px);
549 }
8fa5653a
C
550 }
551
7ccfb37f 552 .vjs-peertube {
86f278cb
C
553 padding: 0 !important;
554
7ccfb37f 555 .vjs-peertube-displayed {
86f278cb
C
556 display: none !important;
557 }
558 }
559 }
560
561 @media screen and (max-width: 300px) {
8fa5653a 562 .vjs-dock-text {
22b59e80
C
563 font-size: 13px;
564 }
565
8fa5653a 566 .vjs-big-play-button {
586f7c1b 567 font-size: 3em;
e0812403 568 border-width: 2px;
864e782b
C
569
570 .vjs-icon-placeholder::before {
571 @include big-play-button-triangle-size(20px);
572 }
8fa5653a
C
573 }
574
86f278cb 575 .vjs-volume-control {
a86309b4
C
576 display: none !important;
577 }
86f278cb 578
ea20306f
C
579 .vjs-peertube-link {
580 padding: 0 !important;
581 }
582
583 .vjs-settings {
584 width: 33px;
86f278cb 585 }
a86309b4 586 }
4555697f
C
587
588 // Theater mode is enabled
589 &.vjs-theater-enabled {
590 .vjs-theater-control {
591 width: 30px;
592
593 .vjs-icon-placeholder {
594 transform: scale(0.8);
595 }
596 }
597 }
598
599 // On fullscreen, hide theater control
600 &.vjs-fullscreen {
601 .vjs-theater-control {
602 display: none;
603 }
604 }
e14852b4 605}
b7a48512 606
c6352f2c
C
607// Play/pause animations
608.vjs-has-started .vjs-play-control {
609 &.vjs-playing {
610 animation: remove-pause-button 0.25s ease;
611 }
612
613 &.vjs-paused {
614 animation: add-play-button 0.25s ease;
615 }
616
617 @keyframes remove-pause-button {
618 0% {
619 transform: rotate(90deg);
620 }
621 100% {
622 transform: rotate(0deg);
623 }
624 }
625
626 @keyframes add-play-button {
627 0% {
628 transform: rotate(-90deg);
629 }
630 100% {
631 transform: rotate(0deg);
632 }
633 }
634}
635
bf5685f0
C
636// Error display disabled
637.vjs-error:not(.vjs-error-display-enabled) {
638 .vjs-error-display {
639 display: none;
640 }
641
642 .vjs-loading-spinner {
643 display: block;
644 }
645}
646
647// Error display enabled
648.vjs-error.vjs-error-display-enabled {
649 .vjs-error-display {
650 display: block;
651 }
e0812403 652}