]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/player/peertube-skin.scss
Cleanup tokens logic 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');
311 background-color: white;
312 mask-size: cover;
313 transform: scale(2.2);
314 }
315 }
316 }
317
318 .vjs-peertube,
319 .vjs-next-video {
be6a4802
C
320 .icon {
321 display: inline-block;
322 width: 15px;
323 height: 15px;
324 background-size: contain;
325 vertical-align: middle;
326 background-repeat: no-repeat;
be6a4802
C
327 position: relative;
328 top: -1px;
be6a4802
C
329 }
330 }
e14852b4 331
57886d66 332 .vjs-playback-rate {
333 font-size: 10px;
3ec8dc09 334 width: 37px !important;
a73c582e
C
335
336 .vjs-playback-rate-value {
337 font-size: 13px;
338 line-height: $control-bar-height;
339 }
3ec8dc09
C
340
341 .vjs-menu .vjs-menu-content {
342 width: 37px !important;
343 }
57886d66 344 }
345
be6a4802 346 .vjs-mute-control {
3ec8dc09
C
347 @include disable-outline;
348
349 line-height: $control-bar-height;
350 padding: 0;
351 width: 30px;
d7701449 352
be6a4802
C
353 .vjs-icon-placeholder {
354 display: inline-block;
355 width: 22px;
356 height: 22px;
357 vertical-align: middle;
2a19a1e4 358 background: url('#{$assets-path}/player/images/volume.svg') no-repeat;
be6a4802
C
359 background-size: contain;
360
361 &::before {
362 content: '';
363 }
364 }
365
366 &.vjs-vol-0 .vjs-icon-placeholder {
2a19a1e4 367 background: url('#{$assets-path}/player/images/volume-mute.svg') no-repeat;
be6a4802
C
368 background-size: contain;
369 }
370 }
e14852b4 371
3ec8dc09
C
372 .vjs-volume-control {
373 width: 30px;
c6352f2c 374 margin: 0 5px 0 0;
be6a4802 375 }
e14852b4 376
be6a4802
C
377 .vjs-volume-bar {
378 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcCAQAAACw95UnAAAAMElEQVRIx2NgoBL4n4YKGUYNHkEG4zJg1OCRYDCpBowaPJwMppbLRg0eNXjUYBLEAXWNUA6QNm1lAAAAAElFTkSuQmCC) no-repeat;
379 background-size: 22px 14px;
380 height: 100%;
381 width: 100%;
382 max-width: 22px;
383 max-height: 14px;
384 margin: 7px 4px;
385 border-radius: 0;
386 top: 3px;
387
388 .vjs-volume-level {
389 background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcAQAAAAAyhWABAAAAAnRSTlMAAHaTzTgAAAAZSURBVHgBYwAB/g9EUv+JokCqiaT+U4MCAPKPS7WUUOc1AAAAAElFTkSuQmCC) no-repeat;
390 background-size: 22px 14px;
391 max-width: 22px;
392 max-height: 14px;
393 height: 100%;
394 }
3d5de919
C
395
396 &:focus {
397 text-shadow: none;
398 box-shadow: none;
399 }
be6a4802 400 }
e14852b4 401
be6a4802
C
402 .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
403 .vjs-volume-panel.vjs-volume-panel-horizontal:active,
404 .vjs-volume-panel.vjs-volume-panel-horizontal:focus,
405 .vjs-volume-panel.vjs-volume-panel-horizontal:hover {
406 width: 6em;
407 transition-property: none;
408 }
e14852b4 409
be6a4802
C
410 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal {
411 width: 3em;
412 height: auto;
413 }
e14852b4 414
be6a4802
C
415 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control {
416 transition-property: none;
417 }
e14852b4 418
be6a4802
C
419 .vjs-volume-panel {
420 .vjs-mute-control {
421 width: 2em;
422 z-index: 1;
423 padding: 0;
424 }
425
426 .vjs-volume-control {
427 display: inline-block;
428 position: relative;
429 left: 5px;
430 opacity: 1;
431 width: 3em;
432 height: auto;
433 }
434 }
e14852b4 435
c6352f2c
C
436 .vjs-peertube-link {
437 @include disable-outline;
438 @include disable-default-a-behaviour;
439
440 text-decoration: none;
441 line-height: $control-bar-height;
442 font-weight: $font-semibold;
443 padding: 0 5px;
444 }
445
054a103b
C
446 .vjs-theater-control {
447 @include disable-outline;
448
449 width: 37px;
450 margin-right: 1px;
b335ccec 451 cursor: pointer;
054a103b
C
452
453 .vjs-icon-placeholder {
4555697f 454 transition: transform 0.2s ease;
054a103b
C
455 display: inline-block;
456 width: 22px;
457 height: 22px;
458 vertical-align: middle;
459 background: url('#{$assets-path}/player/images/theater.svg') no-repeat;
460 background-size: contain;
461
462 &::before {
463 content: '';
464 }
465 }
466 }
467
be6a4802 468 .vjs-fullscreen-control {
3ec8dc09
C
469 @include disable-outline;
470
be6a4802 471 width: 37px;
2ce2fd7f 472 margin-right: 11px;
be6a4802
C
473
474 .vjs-icon-placeholder {
475 display: inline-block;
476 width: 22px;
477 height: 22px;
478 vertical-align: middle;
2a19a1e4 479 background: url('#{$assets-path}/player/images/fullscreen.svg') no-repeat;
be6a4802
C
480 background-size: contain;
481
482 &::before {
483 content: '';
484 }
485 }
486 }
e14852b4 487
be6a4802 488 .vjs-menu-button-popup {
be6a4802 489 font-weight: $font-semibold;
86f278cb 490 width: 50px;
be6a4802 491
be6a4802 492 .vjs-resolution-button {
3ec8dc09 493 @include disable-outline;
be6a4802
C
494 }
495
496 .vjs-menu {
497 top: 20px;
3ec8dc09 498 left: 0;
be6a4802
C
499
500 .vjs-menu-content {
86f278cb 501 width: 50px;
3ec8dc09 502 bottom: 20px;
be6a4802
C
503 }
504
505 li {
506 text-transform: none;
507 font-size: 13px;
508 }
509 }
510 }
511 }
a86309b4 512
6cf57b44 513 @media screen and (max-width: 750px) {
054a103b
C
514 .vjs-theater-control {
515 display: none;
516 }
517
6cf57b44
C
518 .vjs-dock-text {
519 font-size: 16px;
520 }
521
522 .vjs-dock-description {
3c40590d 523 font-size: 9px;
6cf57b44
C
524 }
525
526 .vjs-big-play-button {
527 font-size: 5em;
e0812403 528 border-width: 3px;
6cf57b44
C
529
530 .vjs-icon-placeholder::before {
531 @include big-play-button-triangle-size(32px);
532 }
533 }
534 }
535
e700d33b 536 @media screen and (max-width: 570px) {
869968d7
C
537 .vjs-dock-text {
538 font-size: 14px;
539 }
540
8fa5653a 541 .vjs-big-play-button {
869968d7 542 font-size: 4.5em;
e0812403 543 border-width: 2.5px;
864e782b
C
544
545 .vjs-icon-placeholder::before {
546 @include big-play-button-triangle-size(27px);
547 }
8fa5653a
C
548 }
549
7ccfb37f 550 .vjs-peertube {
86f278cb
C
551 padding: 0 !important;
552
7ccfb37f 553 .vjs-peertube-displayed {
86f278cb
C
554 display: none !important;
555 }
556 }
557 }
558
559 @media screen and (max-width: 300px) {
8fa5653a 560 .vjs-dock-text {
22b59e80
C
561 font-size: 13px;
562 }
563
8fa5653a 564 .vjs-big-play-button {
586f7c1b 565 font-size: 3em;
e0812403 566 border-width: 2px;
864e782b
C
567
568 .vjs-icon-placeholder::before {
569 @include big-play-button-triangle-size(20px);
570 }
8fa5653a
C
571 }
572
86f278cb 573 .vjs-volume-control {
a86309b4
C
574 display: none !important;
575 }
86f278cb 576
ea20306f
C
577 .vjs-peertube-link {
578 padding: 0 !important;
579 }
580
581 .vjs-settings {
582 width: 33px;
86f278cb 583 }
a86309b4 584 }
4555697f
C
585
586 // Theater mode is enabled
587 &.vjs-theater-enabled {
588 .vjs-theater-control {
589 width: 30px;
590
591 .vjs-icon-placeholder {
592 transform: scale(0.8);
593 }
594 }
595 }
596
597 // On fullscreen, hide theater control
598 &.vjs-fullscreen {
599 .vjs-theater-control {
600 display: none;
601 }
602 }
e14852b4 603}
b7a48512 604
c6352f2c
C
605// Play/pause animations
606.vjs-has-started .vjs-play-control {
607 &.vjs-playing {
608 animation: remove-pause-button 0.25s ease;
609 }
610
611 &.vjs-paused {
612 animation: add-play-button 0.25s ease;
613 }
614
615 @keyframes remove-pause-button {
616 0% {
617 transform: rotate(90deg);
618 }
619 100% {
620 transform: rotate(0deg);
621 }
622 }
623
624 @keyframes add-play-button {
625 0% {
626 transform: rotate(-90deg);
627 }
628 100% {
629 transform: rotate(0deg);
630 }
631 }
632}
633
bf5685f0
C
634// Error display disabled
635.vjs-error:not(.vjs-error-display-enabled) {
636 .vjs-error-display {
637 display: none;
638 }
639
640 .vjs-loading-spinner {
641 display: block;
642 }
643}
644
645// Error display enabled
646.vjs-error.vjs-error-display-enabled {
647 .vjs-error-display {
648 display: block;
649 }
e0812403 650}