]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/app/+videos/+video-watch/video-watch.component.scss
Create a dedicated component for video rating
[github/Chocobozzz/PeerTube.git] / client / src / app / +videos / +video-watch / video-watch.component.scss
CommitLineData
8cbc40b2
C
1@use 'sass:math';
2@use '_variables' as *;
3@use '_mixins' as *;
fa12eacc 4@use '_bootstrap-variables';
8cbc40b2 5@use '_miniature' as *;
19f22055 6
8cbc40b2 7$player-factor: math.div(16, 9);
dd4f25ee 8$video-info-margin-left: 44px;
63c4db6d 9
931d3430
C
10@function getPlayerHeight ($width) {
11 @return calc(#{$width} / #{$player-factor});
9a18a625
C
12}
13
931d3430
C
14@function getPlayerWidth ($height) {
15 @return calc(#{$height} * #{$player-factor});
9a18a625
C
16}
17
18@mixin playlist-below-player {
72675ebe
C
19 width: 100% !important;
20 height: auto !important;
21 max-height: 300px !important;
67c68723 22 max-width: initial;
72675ebe 23 border-bottom: 1px solid $separator-border-color !important;
9a18a625
C
24}
25
26.root {
9a18a625 27 &.theater-enabled #video-wrapper {
931d3430
C
28 $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
29
9a18a625
C
30 flex-direction: column;
31 justify-content: center;
32
33 #videojs-wrapper {
34 width: 100%;
f8c00564 35 height: $height;
9a18a625
C
36 }
37
03652b31 38 ::ng-deep .video-js {
9a18a625
C
39 height: $height;
40 width: 100%;
466e3f20 41 max-width: initial;
9a18a625
C
42 }
43
03652b31 44 my-video-watch-playlist ::ng-deep .playlist {
9a18a625
C
45 @include playlist-below-player;
46 }
47 }
191764f3
C
48}
49
5baee5fc 50.blocked-label {
191764f3
C
51 font-weight: $font-semibold;
52}
53
0114ee15
C
54.placeholder-image {
55 height: 100%;
56}
57
e2f01c47 58#video-wrapper {
a5cf76af
C
59 $video-height: 66vh;
60
be6a4802
C
61 background-color: #000;
62 display: flex;
63 justify-content: center;
6d88de72 64
3143ae17
C
65 #videojs-wrapper {
66 display: flex;
67 justify-content: center;
68 flex-grow: 1;
a5cf76af 69 height: $video-height;
3143ae17
C
70 }
71
6d88de72
C
72 .remote-server-down {
73 color: #fff;
74 display: flex;
75 flex-direction: column;
76 align-items: center;
77 text-align: center;
78 justify-content: center;
79 background-color: #141313;
80 width: 100%;
6d88de72 81 font-size: 24px;
3b492bff 82 height: 500px;
6d88de72
C
83
84 @media screen and (max-width: 1000px) {
85 font-size: 20px;
86 }
7b272fd7 87
acbffe9c 88 @media screen and (max-width: 600px) {
6d88de72 89 font-size: 16px;
b9828abe 90 }
6d88de72
C
91 }
92
03652b31 93 ::ng-deep .video-js {
58f3c3f1
C
94 width: 100%;
95 max-width: getPlayerWidth(66vh);
a5cf76af 96 height: $video-height;
3b492bff 97
7b272fd7
C
98 // VideoJS create an inner video player
99 video {
100 outline: 0;
b9828abe 101 position: relative !important;
7b272fd7 102 }
be6a4802 103 }
054a103b 104
3b492bff 105 @media screen and (max-width: 600px) {
dc13623b
C
106 #videojs-wrapper {
107 height: getPlayerHeight(100vw) !important;
108 }
109
3b492bff 110 .remote-server-down,
03652b31 111 ::ng-deep .video-js {
3b492bff 112 width: 100vw;
dc13623b 113 height: getPlayerHeight(100vw) !important;
3b492bff 114 }
054a103b 115 }
e56b20f5
C
116}
117
bbe0f064 118.alert {
2186386c 119 text-align: center;
2b3f1919 120 border-radius: 0;
2186386c
C
121}
122
7fc441cc
RK
123.flex-direction-column {
124 flex-direction: column;
125}
126
9c89a45c
C
127#video-not-found {
128 height: 300px;
129 line-height: 300px;
130 margin-top: 50px;
131 text-align: center;
fb4fd623
C
132 font-weight: $font-semibold;
133 font-size: 15px;
9c89a45c
C
134}
135
b1fa3eba 136.video-bottom {
9a18a625 137 display: flex;
46788f21 138 margin-top: 1.5rem;
d1992b93 139
b1fa3eba
C
140 .video-info {
141 flex-grow: 1;
20acba1c
C
142 // Set min width for flex item
143 min-width: 1px;
e452d2e2 144 max-width: 100%;
3eeeb87f 145
1f788f20 146 .video-info-first-row {
b1fa3eba 147 display: flex;
1f788f20 148
931d3430 149 > div:first-child {
1f788f20
C
150 flex-grow: 1;
151 }
d1992b93 152
b1fa3eba 153 .video-info-name {
b45afe12
C
154 @include peertube-word-wrap;
155
27bc9586 156 @include margin-right(30px);
196b7790 157 min-height: 40px; // Align with the action buttons
b1fa3eba
C
158 font-size: 27px;
159 font-weight: $font-semibold;
160 flex-grow: 1;
161 }
09223546 162
7fc441cc 163 .video-info-first-row-bottom {
5def76eb
RK
164 display: flex;
165 flex-wrap: wrap;
7fc441cc
RK
166 align-items: center;
167 width: 100%;
168 }
169
1f788f20 170 .video-info-date-views {
27bc9586
C
171 @include margin-right(10px);
172
8ff3f883 173 margin-bottom: 10px;
27bc9586 174 align-self: start;
a0dedc02 175 font-size: 1em;
1f788f20
C
176 }
177
178 .video-info-channel {
179 font-weight: $font-semibold;
180 font-size: 15px;
95166f9a
C
181
182 a {
183 @include disable-default-a-behaviour;
b45afe12 184 @include peertube-word-wrap;
95166f9a 185
e66883b3 186 color: pvar(--mainForegroundColor);
95166f9a
C
187
188 &:hover {
189 opacity: 0.8;
190 }
191 }
22a16e36 192
dd4f25ee
RK
193 .video-info-channel-left {
194 flex-grow: 1;
1f788f20 195
dd4f25ee
RK
196 .video-info-channel-left-links {
197 display: flex;
198 flex-direction: column;
199 position: relative;
9d45db29 200 line-height: 1.37;
b7f5b524 201
dd4f25ee 202 a:nth-of-type(2) {
26171379 203 font-weight: $font-regular;
dd4f25ee
RK
204 font-size: 90%;
205 }
b40a2193
K
206
207 a.single-link {
208 margin-top: 7px;
209 }
b7f5b524
C
210 }
211 }
6e33bf28 212
dd4f25ee 213 my-subscribe-button {
27bc9586 214 @include margin-left(5px);
6e33bf28 215 }
1f788f20 216 }
b2731bff 217
1f788f20 218 .video-actions-rates {
27bc9586
C
219 @include margin-left(auto);
220 @include margin-right(0);
221
222 margin-top: 0;
223 margin-bottom: 10px;
224
2303a803 225 align-items: start;
7fc441cc 226 width: max-content;
09223546 227
1f788f20
C
228 .video-actions {
229 height: 40px; // Align with the title
1f788f20
C
230 display: flex;
231 align-items: center;
09223546 232
3a0fb65c
C
233 .action-button:not(:first-child),
234 .action-dropdown,
235 my-video-actions-dropdown {
27bc9586 236 @include margin-left(5px);
1f788f20 237 }
0727cab0 238
0240da5c 239 ::ng-deep.action-button {
1f788f20 240 @include peertube-button;
457bb213 241 @include button-with-icon(21px, 0, -1px);
7b272fd7 242
0240da5c 243 font-size: 100%;
1f788f20
C
244 font-weight: $font-semibold;
245 display: inline-block;
931d3430 246 padding: 0 10px;
07fa4c97 247 white-space: nowrap;
0240da5c 248 background-color: transparent !important;
e66883b3 249 color: pvar(--actionButtonColor);
0240da5c 250 text-transform: uppercase;
7b272fd7 251
63347a0f
C
252 &::after {
253 display: none;
254 }
255
0240da5c
RK
256 &:hover {
257 opacity: 0.9;
258 }
259
2fcc2294 260 &.action-button-support {
e66883b3 261 color: pvar(--supportButtonColor);
2fcc2294 262
0240da5c 263 my-global-icon {
e66883b3 264 @include apply-svg-color(pvar(--supportButtonColor));
2fcc2294 265 }
0240da5c 266 }
2fcc2294 267
0240da5c 268 &.action-button-support {
2fcc2294 269 my-global-icon {
0240da5c 270 ::ng-deep path:first-child {
e66883b3 271 fill: pvar(--supportButtonHeartColor) !important;
0240da5c 272 }
2fcc2294
C
273 }
274 }
275
f0a39880
C
276 &.action-button-save {
277 my-global-icon {
278 top: 0 !important;
279 right: -1px;
280 }
281 }
282
457bb213 283 .icon-text {
27bc9586 284 @include margin-left(3px);
457bb213 285 }
b1fa3eba 286 }
4e1b0973 287 }
6a9e1d42 288
223b24e6 289 .video-info-likes-dislikes-bar-outer-container {
2de7f588
RK
290 position: relative;
291 }
292
223b24e6 293 .video-info-likes-dislikes-bar-inner-container {
2de7f588 294 position: absolute;
223b24e6 295 height: 20px;
2de7f588
RK
296 }
297
1f788f20 298 .video-info-likes-dislikes-bar {
2d9fea16
RK
299 $likes-bar-height: 2px;
300 height: $likes-bar-height;
301 margin-top: -$likes-bar-height;
0240da5c
RK
302 width: 120px;
303 background-color: #ccc;
2d9fea16
RK
304 position: relative;
305 top: 10px;
6a9e1d42 306
1f788f20
C
307 .likes-bar {
308 height: 100%;
0240da5c
RK
309 background-color: #909090;
310
311 &.liked {
e66883b3 312 background-color: pvar(--activatedActionButtonColor);
0240da5c 313 }
1f788f20 314 }
6a9e1d42
C
315 }
316 }
d1992b93
C
317 }
318
b1fa3eba 319 .video-info-description {
27bc9586
C
320 @include margin-left($video-info-margin-left);
321 @include margin-right(0);
322
323 margin-top: 20px;
324 margin-bottom: 20px;
b1fa3eba 325 font-size: 15px;
d1992b93 326
54a932e8 327 .video-info-description-html {
7a14004b 328 @include peertube-word-wrap;
b29bf61d 329
c4f7fe09 330 ::ng-deep a {
b29bf61d
RK
331 text-decoration: none;
332 }
54a932e8
C
333 }
334
931d3430
C
335 .glyphicon,
336 .description-loading {
27bc9586 337 @include margin-left(3px);
9e9afa45
C
338 }
339
80958c78
C
340 .description-loading {
341 display: inline-block;
342 }
343
b1fa3eba 344 .video-info-description-more {
2de96f4d 345 cursor: pointer;
b1fa3eba 346 font-weight: $font-semibold;
e66883b3 347 color: pvar(--greyForegroundColor);
b1fa3eba 348 font-size: 14px;
2de96f4d
C
349
350 .glyphicon {
351 position: relative;
352 top: 2px;
353 }
354 }
09223546
C
355 }
356
dd4f25ee 357 .video-attributes {
27bc9586 358 @include margin-left($video-info-margin-left);
dd4f25ee
RK
359 }
360
1f788f20
C
361 .video-attributes .video-attribute {
362 font-size: 13px;
363 display: block;
364 margin-bottom: 12px;
365
366 .video-attribute-label {
27bc9586
C
367 @include padding-right(5px);
368
adb115f5 369 min-width: 142px;
1f788f20 370 display: inline-block;
e66883b3 371 color: pvar(--greyForegroundColor);
1f788f20 372 font-weight: $font-bold;
3eeeb87f 373 }
4278710d
C
374
375 a.video-attribute-value {
376 @include disable-default-a-behaviour;
e66883b3 377 color: pvar(--mainForegroundColor);
4278710d
C
378
379 &:hover {
380 opacity: 0.9;
381 }
382 }
383
384 &.video-attribute-tags {
385 .video-attribute-value:not(:nth-child(2)) {
386 &::before {
931d3430 387 content: ', ';
4278710d
C
388 }
389 }
390 }
3eeeb87f 391 }
41c3dfac 392 }
0f7407d9 393}
41c3dfac 394
0f7407d9 395my-recommended-videos {
27bc9586
C
396 @include padding-left(15px);
397
0f7407d9 398 display: block;
0f7407d9 399 min-width: 250px;
d1992b93 400}
41c3dfac 401
1d6587aa
C
402my-video-comments {
403 display: inline-block;
66467298 404 width: 100%;
1d6587aa
C
405 margin-bottom: 20px;
406}
407
2b3b76ab
C
408// If the view is not expanded, take into account the menu
409.privacy-concerns {
d3217560 410 z-index: z(dropdown) + 1;
2b3b76ab
C
411 width: calc(100% - #{$menu-width});
412}
413
8ff3f883
C
414@media screen and (max-width: $small-view) {
415 .privacy-concerns {
27bc9586 416 @include margin-left($menu-width - 15px); // Menu is absolute
8ff3f883
C
417 }
418}
419
2b3b76ab
C
420:host-context(.expanded) {
421 .privacy-concerns {
27bc9586
C
422 @include margin-left(-15px);
423
2b3b76ab
C
424 width: 100%;
425 }
426}
427
428.privacy-concerns {
429 position: fixed;
430 bottom: 0;
555fdc8c 431 z-index: z(privacymsg);
2b3b76ab
C
432
433 padding: 5px 15px;
434
435 display: flex;
28e0e40d 436 flex-wrap: nowrap;
2b3b76ab 437 align-items: center;
a7d3671d 438 justify-content: space-between;
2b3b76ab
C
439 background-color: rgba(0, 0, 0, 0.9);
440 color: #fff;
441
442 .privacy-concerns-text {
443 margin: 0 5px;
444 }
445
446 a {
447 @include disable-default-a-behaviour;
448
e66883b3 449 color: pvar(--mainColor);
2b3b76ab
C
450 transition: color 0.3s;
451
452 &:hover {
453 color: #fff;
454 }
455 }
456
d3217560 457 .privacy-concerns-button {
27bc9586
C
458 @include margin-left(auto);
459
2b3b76ab 460 padding: 5px 8px 5px 7px;
2b3b76ab 461 border-radius: 3px;
d3217560 462 white-space: nowrap;
2b3b76ab
C
463 cursor: pointer;
464 transition: background-color 0.3s;
465 font-weight: $font-semibold;
466
467 &:hover {
468 background-color: #000;
469 }
470 }
d3217560
RK
471
472 .privacy-concerns-okay {
27bc9586
C
473 @include margin-left(10px);
474
e66883b3 475 background-color: pvar(--mainColor);
d3217560 476 }
2b3b76ab
C
477}
478
07fa4c97 479@media screen and (max-width: 1600px) {
8ff3f883
C
480 .video-bottom .video-info .video-attributes .video-attribute {
481 margin-bottom: 5px;
b9828abe
C
482 }
483}
b2731bff 484
23f4c3d4 485@media screen and (max-width: 1300px) {
2b3b76ab
C
486 .privacy-concerns {
487 font-size: 12px;
488 padding: 2px 5px;
489
490 .privacy-concerns-text {
491 margin: 0;
492 }
493 }
07fa4c97
C
494}
495
0f7407d9 496// Use the same breakpoint than in the typescript component to display the other video miniatures as row
9a18a625 497@media screen and (max-width: 1100px) {
3143ae17
C
498 #video-wrapper {
499 flex-direction: column;
500 justify-content: center;
501
03652b31 502 my-video-watch-playlist ::ng-deep .playlist {
3143ae17
C
503 @include playlist-below-player;
504 }
505 }
506
9a18a625
C
507 .video-bottom {
508 flex-direction: column;
0f7407d9 509 }
9a18a625 510
0f7407d9 511 my-recommended-videos {
27bc9586 512 @include padding-left(0);
9a18a625
C
513 }
514}
515
1f788f20 516@media screen and (max-width: 600px) {
b2731bff 517 .video-bottom {
c2a89b70 518 margin-top: 20px !important;
46788f21 519 padding-bottom: 20px !important;
1f788f20
C
520
521 .video-info {
93ea9c47 522 padding: 0;
1f788f20
C
523
524 .video-info-first-row {
525
526 .video-info-name {
527 font-size: 20px;
528 height: auto;
529 }
530 }
531 }
b2731bff 532 }
2b3b76ab
C
533
534 .privacy-concerns {
535 width: 100%;
2b3b76ab 536 }
b2731bff 537}
07fa4c97
C
538
539@media screen and (max-width: 450px) {
93ea9c47
C
540 .video-bottom {
541 .action-button .icon-text {
542 display: none !important;
543 }
544
545 .video-info .video-info-first-row {
546 .video-info-name {
547 font-size: 18px;
548 }
549
550 .video-info-date-views {
551 font-size: 14px;
552 }
553
554 .video-actions-rates {
555 margin-top: 10px;
556 }
557 }
558
559 .video-info-description {
560 font-size: 14px !important;
561 }
07fa4c97
C
562 }
563}
d45f3641
C
564
565
566// Special case for iOS, that takes into account the width for fullscreens
567#video-wrapper ::ng-deep .video-js.vjs-fullscreen {
568 max-width: unset;
569}