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