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