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