Fix playlist block with theater player
[oweals/peertube.git] / client / src / app / videos / +video-watch / video-watch.component.scss
1 @import '_variables';
2 @import '_mixins';
3 @import '_bootstrap-variables';
4 @import '_miniature';
5
6 $other-videos-width: 260px;
7 $player-factor: 1.7; // 16/9
8
9 @function getPlayerHeight($width){
10   @return calc(#{$width} / #{$player-factor})
11 }
12
13 @function getPlayerWidth($height){
14   @return calc(#{$height} * #{$player-factor})
15 }
16
17 @mixin playlist-below-player {
18   width: 100% !important;
19   height: auto !important;
20   max-height: 300px !important;
21   max-width: initial;
22   border-bottom: 1px solid $separator-border-color !important;
23 }
24
25 .root {
26   &.theater-enabled #video-wrapper {
27     flex-direction: column;
28     justify-content: center;
29
30     #videojs-wrapper {
31       width: 100%;
32     }
33
34     /deep/ .video-js {
35       $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
36
37       height: $height;
38       width: 100%;
39     }
40
41     my-video-watch-playlist /deep/ .playlist {
42       @include playlist-below-player;
43     }
44   }
45 }
46
47 .blacklisted-label {
48   font-weight: $font-semibold;
49 }
50
51 #video-wrapper {
52   background-color: #000;
53   display: flex;
54   justify-content: center;
55   margin: 0 -15px;
56
57   #videojs-wrapper {
58     display: flex;
59     justify-content: center;
60     flex-grow: 1;
61   }
62
63   .remote-server-down {
64     color: #fff;
65     display: flex;
66     flex-direction: column;
67     align-items: center;
68     text-align: center;
69     justify-content: center;
70     background-color: #141313;
71     width: 100%;
72     font-size: 24px;
73     height: 500px;
74
75     @media screen and (max-width: 1000px) {
76       font-size: 20px;
77     }
78
79     @media screen and (max-width: 600px) {
80       font-size: 16px;
81     }
82   }
83
84   /deep/ .video-js {
85     width: getPlayerWidth(66vh);
86     height: 66vh;
87
88     // VideoJS create an inner video player
89     video {
90       outline: 0;
91       position: relative !important;
92     }
93   }
94
95   @media screen and (max-width: 600px) {
96     .remote-server-down,
97     /deep/ .video-js {
98       width: 100vw;
99       height: getPlayerHeight(100vw)
100     }
101   }
102 }
103
104 .alert {
105   text-align: center;
106   border-radius: 0;
107 }
108
109 #video-not-found {
110   height: 300px;
111   line-height: 300px;
112   margin-top: 50px;
113   text-align: center;
114   font-weight: $font-semibold;
115   font-size: 15px;
116 }
117
118 .video-bottom {
119   display: flex;
120   margin-top: 40px;
121
122   .video-info {
123     flex-grow: 1;
124     // Set min width for flex item
125     min-width: 1px;
126     max-width: 100%;
127
128     .video-info-first-row {
129       display: flex;
130
131       & > div:first-child {
132         flex-grow: 1;
133       }
134
135       .video-info-name {
136         margin-right: 30px;
137         min-height: 40px; // Align with the action buttons
138         font-size: 27px;
139         font-weight: $font-semibold;
140         flex-grow: 1;
141       }
142
143       .video-info-date-views {
144         flex-grow: 1;
145         margin-bottom: 10px;
146         margin-right: 10px;
147         font-size: 16px;
148       }
149
150       .video-info-channel {
151         font-weight: $font-semibold;
152         font-size: 15px;
153
154         a {
155           @include disable-default-a-behaviour;
156
157           color: var(--mainForegroundColor);
158
159           &:hover {
160             opacity: 0.8;
161           }
162
163           img {
164             @include avatar(18px);
165
166             margin: -2px 2px 0 5px;
167           }
168         }
169
170         my-subscribe-button {
171           margin-left: 5px;
172         }
173       }
174
175       .video-info-by {
176
177         a {
178           @include disable-default-a-behaviour;
179
180           display: inline;
181           align-items: center;
182           font-size: 13px;
183           color: var(--mainForegroundColor);
184
185           span:hover {
186             opacity: 0.8;
187           }
188
189           img {
190             @include avatar(18px);
191
192             margin-top: -2px;
193             margin-left: 7px;
194           }
195         }
196
197         my-help {
198           position: relative;
199           top: 1px;
200           margin-left: 2px;
201         }
202       }
203
204       my-feed {
205         margin-left: 5px;
206         margin-top: 1px;
207       }
208
209       .video-actions-rates {
210         margin: 20px 0 10px 0;
211         align-items: start;
212
213         .video-actions {
214           height: 40px; // Align with the title
215           display: flex;
216           align-items: center;
217
218           .action-button:not(:first-child),
219           .action-dropdown,
220           my-video-actions-dropdown {
221             margin-left: 10px;
222           }
223
224           .action-button {
225             @include peertube-button;
226             @include grey-button;
227             @include button-with-icon(21px, 0, -1px);
228             @include apply-svg-color($grey-foreground-color);
229
230             font-size: 15px;
231             font-weight: $font-semibold;
232             display: inline-block;
233             padding: 0 10px 0 10px;
234             white-space: nowrap;
235
236             &::after {
237               display: none;
238             }
239
240             &.action-button-like.activated {
241               background-color: $green;
242
243               my-global-icon {
244                 @include apply-svg-color(#fff);
245               }
246             }
247
248             &.action-button-dislike.activated {
249               background-color: $red;
250
251               my-global-icon {
252                 @include apply-svg-color(#fff);
253               }
254             }
255
256             &.action-button-save {
257               my-global-icon {
258                 top: 0 !important;
259                 right: -1px;
260               }
261             }
262
263             .icon-text {
264               margin-left: 3px;
265             }
266           }
267         }
268
269         .video-info-likes-dislikes-bar {
270           $likes-bar-height: 2px;
271           height: $likes-bar-height;
272           margin-top: -$likes-bar-height;
273           width: 186px;
274           background-color: $red;
275           position: relative;
276           top: 10px;
277
278           .likes-bar {
279             height: 100%;
280             background-color: $green;
281           }
282         }
283       }
284     }
285
286     .video-info-description {
287       margin: 20px 0;
288       font-size: 15px;
289
290       .video-info-description-html {
291         @include peertube-word-wrap;
292       }
293
294       .glyphicon, .description-loading {
295         margin-left: 3px;
296       }
297
298       .description-loading {
299         display: inline-block;
300       }
301
302       .video-info-description-more {
303         cursor: pointer;
304         font-weight: $font-semibold;
305         color: $grey-foreground-color;
306         font-size: 14px;
307
308         .glyphicon {
309           position: relative;
310           top: 2px;
311         }
312       }
313     }
314
315     .video-attributes .video-attribute {
316       font-size: 13px;
317       display: block;
318       margin-bottom: 12px;
319
320       .video-attribute-label {
321         min-width: 142px;
322         padding-right: 5px;
323         display: inline-block;
324         color: $grey-foreground-color;
325         font-weight: $font-bold;
326       }
327
328       a.video-attribute-value {
329         @include disable-default-a-behaviour;
330         color: var(--mainForegroundColor);
331
332         &:hover {
333           opacity: 0.9;
334         }
335       }
336
337       &.video-attribute-tags {
338         .video-attribute-value:not(:nth-child(2)) {
339           &::before {
340             content: ', '
341           }
342         }
343       }
344     }
345   }
346
347   /deep/ .other-videos {
348     padding-left: 15px;
349     flex-basis: $other-videos-width;
350
351     .title-page {
352       margin-top: 0 !important;
353     }
354
355     .video-miniature {
356       display: flex;
357       width: $other-videos-width;
358       height: 100%;
359       margin-bottom: 20px;
360       flex-wrap: wrap;
361
362       .video-thumbnail {
363         margin-right: 10px
364       }
365     }
366   }
367 }
368
369 my-video-comments {
370   display: inline-block;
371   width: 100%;
372   margin-bottom: 20px;
373 }
374
375 // If the view is not expanded, take into account the menu
376 .privacy-concerns {
377   width: calc(100% - #{$menu-width});
378 }
379
380 @media screen and (max-width: $small-view) {
381   .privacy-concerns {
382     margin-left: $menu-width - 15px; // Menu is absolute
383   }
384 }
385
386 :host-context(.expanded) {
387   .privacy-concerns {
388     width: 100%;
389     margin-left: -15px;
390   }
391 }
392
393 .privacy-concerns {
394   position: fixed;
395   bottom: 0;
396
397   padding: 5px 15px;
398
399   display: flex;
400   flex-wrap: nowrap;
401   align-items: center;
402   justify-content: flex-start;
403   background-color: rgba(0, 0, 0, 0.9);
404   color: #fff;
405
406   .privacy-concerns-text {
407     margin: 0 5px;
408   }
409
410   a {
411     @include disable-default-a-behaviour;
412
413     color: var(--mainColor);
414     transition: color 0.3s;
415
416     &:hover {
417       color: #fff;
418     }
419   }
420
421   .privacy-concerns-okay {
422     background-color: var(--mainColor);
423     padding: 5px 8px 5px 7px;
424     margin-left: auto;
425     border-radius: 3px;
426     cursor: pointer;
427     transition: background-color 0.3s;
428     font-weight: $font-semibold;
429
430     &:hover {
431       background-color: #000;
432     }
433   }
434 }
435
436 @media screen and (max-width: 1600px) {
437   .video-bottom .video-info .video-attributes .video-attribute {
438     margin-bottom: 5px;
439   }
440 }
441
442 @media screen and (max-width: 1300px) {
443   .privacy-concerns {
444     font-size: 12px;
445     padding: 2px 5px;
446
447     .privacy-concerns-text {
448       margin: 0;
449     }
450   }
451 }
452
453 @media screen and (max-width: 1100px) {
454   #video-wrapper {
455     flex-direction: column;
456     justify-content: center;
457
458     my-video-watch-playlist /deep/ .playlist {
459       @include playlist-below-player;
460     }
461   }
462
463   .video-bottom {
464     flex-direction: column;
465
466     /deep/ .other-videos {
467       padding-left: 0 !important;
468
469       /deep/ .video-miniature  {
470         flex-direction: row;
471         width: auto;
472       }
473     }
474   }
475 }
476
477 @media screen and (max-width: 600px) {
478   .video-bottom {
479     margin: 20px 0 0 0 !important;
480
481     .video-info {
482       padding: 0;
483
484       .video-info-first-row {
485
486         .video-info-name {
487           font-size: 20px;
488           height: auto;
489         }
490       }
491     }
492   }
493
494   /deep/ .other-videos .video-miniature  {
495     flex-direction: column;
496   }
497
498   .privacy-concerns {
499     width: 100%;
500
501     strong {
502       display: none;
503     }
504   }
505 }
506
507 @media screen and (max-width: 450px) {
508   .video-bottom {
509     .action-button .icon-text {
510       display: none !important;
511     }
512
513     .video-info .video-info-first-row {
514       .video-info-name {
515         font-size: 18px;
516       }
517
518       .video-info-date-views {
519         font-size: 14px;
520       }
521
522       .video-actions-rates {
523         margin-top: 10px;
524       }
525     }
526
527     .video-info-description {
528       font-size: 14px !important;
529     }
530   }
531 }