]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/player/control-bar.scss
Fix lint
[github/Chocobozzz/PeerTube.git] / client / src / sass / player / control-bar.scss
CommitLineData
a5a79d15
C
1@use 'sass:math';
2@use '_variables' as *;
3@use '_mixins' as *;
4@use './_player-variables' as *;
5
6.video-js.vjs-peertube-skin .vjs-control-bar {
7 height: $control-bar-height;
8 background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.6));
9 box-shadow: 0 -15px 40px 10px rgba(0, 0, 0, 0.2);
10 text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
11 transition: visibility 0.3s, opacity 0.3s !important;
12
13 > button:first-child {
14 @include margin-left($first-control-bar-element-margin-left);
15 }
16
17 > button:last-child {
18 @include margin-right($first-control-bar-element-margin-left);
19 }
20
21 .vjs-progress-control,
22 .vjs-play-control,
23 .vjs-playback-rate,
24 .vjs-mute-control,
25 .vjs-volume-control,
26 .vjs-resolution-control,
27 .vjs-fullscreen-control,
28 .vjs-peertube-link,
29 .vjs-theater-control,
30 .vjs-settings {
31 color: pvar(--embedForegroundColor) !important;
32
33 opacity: $primary-foreground-opacity;
34 transition: opacity .1s;
35
36 &:hover {
37 opacity: $primary-foreground-opacity-hover;
38 }
39 }
40
41 .vjs-current-time,
42 .vjs-duration,
43 .vjs-peertube {
44 color: pvar(--embedForegroundColor);
45 opacity: $primary-foreground-opacity;
46 }
47
48 .vjs-progress-control {
49 @include margin-left($progress-margin);
50
51 position: absolute;
52 top: -10px;
53 z-index: 100; // On top of the progress bar
54 width: calc(100% - (2 * #{$progress-margin}));
55 height: 14px;
56
57 .vjs-slider {
58 margin: 0;
59 border-radius: 0;
60 background-color: rgba(255, 255, 255, .2);
61 height: 3px;
62 transition: none;
63
64 .vjs-play-progress {
65 background: pvar(--embedForegroundColor);
66
67 // Not display the circle if the progress is not hovered
68 &::before {
69 opacity: 0;
70 transition: opacity 0.1s ease;
71 font-size: 14px;
72
73 top: -0.3em;
74 }
75
76 .vjs-time-tooltip {
77 display: none;
78 }
79 }
80
81 .vjs-load-progress {
82 &,
83 div {
84 background: rgba(255, 255, 255, .2);
85 }
86 }
87 }
88 }
89
90 .vjs-progress-control:hover .vjs-slider,
91 .vjs-progress-control .vjs-slider.vjs-sliding {
92 height: 5px;
93
94 .vjs-play-progress::before {
95 opacity: 1;
96 }
97 }
98
a5a79d15
C
99 .vjs-play-control {
100 @include disable-outline;
101
102 cursor: pointer;
103 width: $control-bar-button-width;
104
105 .vjs-icon-placeholder::before {
106 font-size: $control-bar-play-font-size;
107 line-height: initial;
108 }
109 }
110
111 .vjs-time-control {
112 line-height: inherit;
113
114 &.vjs-current-time {
115 @include margin-left(.5em);
116
117 font-size: $control-bar-font-size;
118 display: inline-block;
119 padding: 0;
120
121 .vjs-current-time-display {
122 line-height: calc(#{$control-bar-height} - 1px);
123
124 &::after {
125 @include margin(0, 1px, 0, 2px);
126
127 content: '/';
128 }
129 }
130 }
131
132 &.vjs-duration {
133 font-size: $control-bar-font-size;
134 display: inline-block;
135 padding: 0;
136
137 .vjs-duration-display {
138 line-height: calc(#{$control-bar-height} - 1px);
139 }
140 }
141
142 &.vjs-remaining-time {
143 display: none;
144 }
145 }
146
147 .vjs-live-control {
148 line-height: $control-bar-height;
149 min-width: 4em;
150 width: inherit;
151 }
152
153 .vjs-peertube {
154 @include margin-right(6px);
155
156 width: 100%;
157 line-height: $control-bar-height;
158 text-align: end;
159 overflow: hidden;
160 font-size: $control-bar-font-size;
161
162 .vjs-peertube-displayed {
163 display: block;
164 }
165
166 .vjs-peertube-hidden {
167 display: none;
168 }
169
170 .download-speed-number,
171 .upload-speed-number,
172 .peers-number,
173 .http-fallback {
174 font-weight: $font-semibold;
175 }
176
177 .download-speed-text,
178 .upload-speed-text,
179 .peers-text,
180 .http-fallback {
181 @include margin-right(15px);
182 }
183
184 .icon {
185 @include margin-right(2px);
186
187 display: inline-block;
188 width: 15px;
189 height: 15px;
190 background-size: contain;
191 vertical-align: middle;
192 background-repeat: no-repeat;
193 position: relative;
194 top: -1px;
195
196 &.icon-download {
197 background-image: url('#{$assets-path}/player/images/arrow-down.svg');
198 }
199
200 &.icon-upload {
201 background-image: url('#{$assets-path}/player/images/arrow-up.svg');
202 }
203 }
204 }
205
206 .vjs-next-video,
207 .vjs-previous-video {
208 width: $control-bar-button-width - 4px;
209
210 &.vjs-disabled {
211 cursor: default;
212 }
213
214 .icon {
215 &.icon-next,
216 &.icon-previous {
217 mask-image: url('#{$assets-path}/player/images/next.svg');
218 -webkit-mask-image: url('#{$assets-path}/player/images/next.svg');
219 mask-size: cover;
220 -webkit-mask-size: cover;
221
222 background-color: #fff;
223 width: $control-bar-next-previous-play-font-size;
224 height: $control-bar-next-previous-play-font-size;
225 display: inline-block;
226 }
227
228 &.icon-previous {
229 transform: rotate(180deg);
230 }
231 }
232 }
233
234 .vjs-mute-control {
235 @include disable-outline;
236
237 padding: 0;
238 width: $control-bar-icon-size;
239
240 .vjs-icon-placeholder {
241 display: inline-block;
242 width: $control-bar-icon-size;
243 height: $control-bar-icon-size;
244 vertical-align: middle;
245 background: url('#{$assets-path}/player/images/volume.svg') no-repeat;
246 background-size: contain;
247
248 &::before {
249 content: '';
250 }
251 }
252
253 &.vjs-vol-0 .vjs-icon-placeholder {
254 background: url('#{$assets-path}/player/images/volume-mute.svg') no-repeat;
255 background-size: contain;
256 }
257 }
258
259 .vjs-volume-control {
260 @include margin(0, 5px, 0, 5px);
261
262 width: $control-bar-icon-size;
263 display: flex;
264 align-items: center;
265 }
266
267 .vjs-volume-bar {
268 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcCAQAAACw95UnAAAAMElEQVRIx2NgoBL4n4YKGUYNHkEG4zJg1OCRYDCpBowaPJwMppbLRg0eNXjUYBLEAXWNUA6QNm1lAAAAAElFTkSuQmCC') no-repeat;
269 background-size: $control-bar-icon-size $control-bar-volume-slider-height;
270 height: 100%;
271 width: 100%;
272 max-width: $control-bar-icon-size;
273 max-height: $control-bar-volume-slider-height;
274 margin: 0;
275 border-radius: 0;
276
277 .vjs-volume-level {
278 background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAcAQAAAAAyhWABAAAAAnRSTlMAAHaTzTgAAAAZSURBVHgBYwAB/g9EUv+JokCqiaT+U4MCAPKPS7WUUOc1AAAAAElFTkSuQmCC') no-repeat;
279 background-size: $control-bar-icon-size $control-bar-volume-slider-height;
280 max-width: $control-bar-icon-size;
281 height: 100%;
282 max-height: $control-bar-volume-slider-height;
5097cbda
C
283
284 &::before {
285 // Remove circle
286 content: '';
287 }
a5a79d15
C
288 }
289
290 &:focus {
291 text-shadow: none;
292 box-shadow: none;
293 }
294 }
295
296 .vjs-volume-panel.vjs-volume-panel-horizontal.vjs-slider-active,
297 .vjs-volume-panel.vjs-volume-panel-horizontal:active,
298 .vjs-volume-panel.vjs-volume-panel-horizontal:focus,
299 .vjs-volume-panel.vjs-volume-panel-horizontal:hover {
300 width: 6em;
301 transition-property: none;
302 }
303
304 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control.vjs-volume-horizontal {
305 width: 3em;
306 height: auto;
307 }
308
309 .vjs-volume-panel .vjs-mute-control:hover ~ .vjs-volume-control {
310 transition-property: none;
311 }
312
313 .vjs-volume-panel {
314 .vjs-mute-control {
315 width: 2em;
316 z-index: 1;
317 padding: 0;
318 }
319
320 .vjs-volume-control {
321 display: inline-block;
322 position: relative;
323 left: 5px;
324 opacity: 1;
325 width: 3em;
326 height: auto;
327 }
328 }
329
330 .vjs-settings {
331 @include disable-outline;
332
333 cursor: pointer;
334 width: $control-bar-button-width;
335
336 .vjs-icon-placeholder {
337 display: inline-block;
338 height: $control-bar-icon-size - 5px;
339 width: $control-bar-icon-size - 5px;
340 vertical-align: middle;
341 background: url('#{$assets-path}/player/images/settings.svg') no-repeat;
342 background-size: contain;
343
344 &::before {
345 content: '';
346 }
347 }
348 }
349
350 .vjs-peertube-link {
351 @include disable-outline;
352 @include disable-default-a-behaviour;
353
354 text-decoration: none;
355 line-height: $control-bar-height;
356 font-weight: $font-semibold;
357 padding: 0 5px;
358 }
359
360 .vjs-theater-control {
361 @include disable-outline;
362
363 width: $control-bar-button-width;
364 cursor: pointer;
365
366 .vjs-icon-placeholder {
367 transition: transform 0.2s ease;
368 display: inline-block;
369 width: $control-bar-icon-size;
370 height: $control-bar-icon-size;
371 vertical-align: middle;
372 background: url('#{$assets-path}/player/images/theater.svg') no-repeat;
373 background-size: contain;
374
375 &::before {
376 content: '';
377 }
378 }
379 }
380
381 .vjs-fullscreen-control {
382 @include disable-outline;
383
384 width: $control-bar-button-width;
385
386 .vjs-icon-placeholder {
387 display: inline-block;
388 width: $control-bar-icon-size;
389 height: $control-bar-icon-size;
390 vertical-align: middle;
391 background: url('#{$assets-path}/player/images/fullscreen.svg') no-repeat;
392 background-size: contain;
393
394 &::before {
395 content: '';
396 }
397 }
398 }
399
400 @media screen and (max-width: $screen-width-750) {
401 .vjs-theater-control {
402 display: none;
403 }
404 }
405
406 @media screen and (max-width: $screen-width-570) {
407 .vjs-peertube {
408 padding: 0 !important;
409
410 .vjs-peertube-displayed {
411 display: none !important;
412 }
413 }
414
415 &.vjs-live {
416 .vjs-duration {
417 display: none !important;
418 }
419
420 .vjs-peertube {
421 display: none !important;
422 }
423 }
424 }
425
426 @media screen and (max-width: $screen-width-350) {
427 .vjs-volume-control,
428 .vjs-next-video,
429 .vjs-previous-video {
430 display: none !important;
431 }
432
433 .vjs-peertube-link {
434 padding: 0 !important;
435 }
436
437 > button:first-child {
438 @include margin-left($first-control-bar-element-margin-left-small-width);
439 }
440
441 > button:last-child {
442 @include margin-right($first-control-bar-element-margin-left-small-width);
443 }
444
445 &.vjs-live {
446 .vjs-current-time {
447 display: none !important;
448 }
449 }
450 }
451}