Add autoplay tooltip, use of flex-wrap in video-info and other-videos
[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.3;
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: 10px;
224           }
225
226           .action-button {
227             @include peertube-button;
228             @include grey-button;
229             @include button-with-icon(21px, 0, -1px);
230             @include apply-svg-color($grey-foreground-color);
231
232             font-size: 15px;
233             font-weight: $font-semibold;
234             display: inline-block;
235             padding: 0 10px 0 10px;
236             white-space: nowrap;
237
238             &::after {
239               display: none;
240             }
241
242             .action-button-like,
243             .action-button-dislike {
244               .count {
245                 margin-right: 5px;
246               }
247             }
248
249             &.action-button-like.activated {
250               background-color: $green;
251
252               .count {
253                 color: #fff;
254               }
255
256               my-global-icon {
257                 @include apply-svg-color(#fff);
258               }
259             }
260
261             &.action-button-dislike.activated {
262               background-color: $red;
263
264               .count {
265                 color: #fff;
266               }
267
268               my-global-icon {
269                 @include apply-svg-color(#fff);
270               }
271             }
272
273             &.action-button-support {
274               color: var(--supportButtonColor);
275               background-color: var(--supportButtonBackgroundColor);
276
277               &:hover {
278                 opacity: 0.9;
279               }
280
281               my-global-icon {
282                 @include apply-svg-color(var(--supportButtonColor));
283               }
284             }
285
286             &.action-button-save {
287               my-global-icon {
288                 top: 0 !important;
289                 right: -1px;
290               }
291             }
292
293             .icon-text {
294               margin-left: 3px;
295             }
296           }
297         }
298
299         .video-info-likes-dislikes-bar-outer-container {
300           position: relative;
301         }
302
303         .video-info-likes-dislikes-bar-inner-container {
304           position: absolute;
305           height: 20px;
306         }
307
308         .video-info-likes-dislikes-bar {
309           $likes-bar-height: 2px;
310           height: $likes-bar-height;
311           margin-top: -$likes-bar-height;
312           width: 186px;
313           background-color: $red;
314           position: relative;
315           top: 10px;
316
317           .likes-bar {
318             height: 100%;
319             background-color: $green;
320           }
321         }
322       }
323     }
324
325     .video-info-description {
326       margin: 20px 0;
327       margin-left: $video-info-margin-left;
328       font-size: 15px;
329
330       .video-info-description-html {
331         @include peertube-word-wrap;
332
333         /deep/ a {
334           text-decoration: none;
335         }
336       }
337
338       .glyphicon, .description-loading {
339         margin-left: 3px;
340       }
341
342       .description-loading {
343         display: inline-block;
344       }
345
346       .video-info-description-more {
347         cursor: pointer;
348         font-weight: $font-semibold;
349         color: $grey-foreground-color;
350         font-size: 14px;
351
352         .glyphicon {
353           position: relative;
354           top: 2px;
355         }
356       }
357     }
358
359     .video-attributes {
360       margin-left: $video-info-margin-left;
361     }
362
363     .video-attributes .video-attribute {
364       font-size: 13px;
365       display: block;
366       margin-bottom: 12px;
367
368       .video-attribute-label {
369         min-width: 142px;
370         padding-right: 5px;
371         display: inline-block;
372         color: $grey-foreground-color;
373         font-weight: $font-bold;
374       }
375
376       a.video-attribute-value {
377         @include disable-default-a-behaviour;
378         color: var(--mainForegroundColor);
379
380         &:hover {
381           opacity: 0.9;
382         }
383       }
384
385       &.video-attribute-tags {
386         .video-attribute-value:not(:nth-child(2)) {
387           &::before {
388             content: ', '
389           }
390         }
391       }
392     }
393   }
394
395   ::ng-deep .other-videos {
396     padding-left: 15px;
397     min-width: $video-miniature-width;
398
399     @media screen and (min-width: 1800px - (3* $video-miniature-width)) {
400       width: min-content;
401     }
402
403     .title-page {
404       margin: 0 !important;
405     }
406
407     .video-miniature {
408       display: flex;
409       width: max-content;
410       height: 100%;
411       margin-bottom: 20px;
412       flex-wrap: wrap;
413     }
414
415     .video-bottom {
416       @media screen and (max-width: 1800px - (3* $video-miniature-width)) {
417         margin-left: 1rem;
418       }
419       @media screen and (max-width: 500px) {
420         margin-left: 0;
421         margin-top: .5rem;
422       }
423     }
424   }
425 }
426
427 my-video-comments {
428   display: inline-block;
429   width: 100%;
430   margin-bottom: 20px;
431 }
432
433 // If the view is not expanded, take into account the menu
434 .privacy-concerns {
435   width: calc(100% - #{$menu-width});
436 }
437
438 @media screen and (max-width: $small-view) {
439   .privacy-concerns {
440     margin-left: $menu-width - 15px; // Menu is absolute
441   }
442 }
443
444 :host-context(.expanded) {
445   .privacy-concerns {
446     width: 100%;
447     margin-left: -15px;
448   }
449 }
450
451 .privacy-concerns {
452   position: fixed;
453   bottom: 0;
454
455   padding: 5px 15px;
456
457   display: flex;
458   flex-wrap: nowrap;
459   align-items: center;
460   justify-content: flex-start;
461   background-color: rgba(0, 0, 0, 0.9);
462   color: #fff;
463
464   .privacy-concerns-text {
465     margin: 0 5px;
466   }
467
468   a {
469     @include disable-default-a-behaviour;
470
471     color: var(--mainColor);
472     transition: color 0.3s;
473
474     &:hover {
475       color: #fff;
476     }
477   }
478
479   .privacy-concerns-okay {
480     background-color: var(--mainColor);
481     padding: 5px 8px 5px 7px;
482     margin-left: auto;
483     border-radius: 3px;
484     cursor: pointer;
485     transition: background-color 0.3s;
486     font-weight: $font-semibold;
487
488     &:hover {
489       background-color: #000;
490     }
491   }
492 }
493
494 @media screen and (max-width: 1600px) {
495   .video-bottom .video-info .video-attributes .video-attribute {
496     margin-bottom: 5px;
497   }
498 }
499
500 @media screen and (max-width: 1300px) {
501   .privacy-concerns {
502     font-size: 12px;
503     padding: 2px 5px;
504
505     .privacy-concerns-text {
506       margin: 0;
507     }
508   }
509 }
510
511 @media screen and (max-width: 1100px) {
512   #video-wrapper {
513     flex-direction: column;
514     justify-content: center;
515
516     my-video-watch-playlist ::ng-deep .playlist {
517       @include playlist-below-player;
518     }
519   }
520
521   .video-bottom {
522     flex-direction: column;
523
524     ::ng-deep .other-videos {
525       padding-left: 0 !important;
526
527       ::ng-deep .video-miniature  {
528         flex-direction: row;
529         width: auto;
530       }
531     }
532   }
533 }
534
535 @media screen and (max-width: 600px) {
536   .video-bottom {
537     margin: 20px 0 0 0 !important;
538
539     .video-info {
540       padding: 0;
541
542       .video-info-first-row {
543
544         .video-info-name {
545           font-size: 20px;
546           height: auto;
547         }
548       }
549     }
550   }
551
552   ::ng-deep .other-videos .video-miniature  {
553     flex-direction: column;
554   }
555
556   .privacy-concerns {
557     width: 100%;
558
559     strong {
560       display: none;
561     }
562   }
563 }
564
565 @media screen and (max-width: 450px) {
566   .video-bottom {
567     .action-button .icon-text {
568       display: none !important;
569     }
570
571     .video-info .video-info-first-row {
572       .video-info-name {
573         font-size: 18px;
574       }
575
576       .video-info-date-views {
577         font-size: 14px;
578       }
579
580       .video-actions-rates {
581         margin-top: 10px;
582       }
583     }
584
585     .video-info-description {
586       font-size: 14px !important;
587     }
588   }
589 }