Relax watch CSS

This commit is contained in:
Chocobozzz 2021-06-30 08:50:20 +02:00
parent 8d64a72b4c
commit d4f0b2ecec
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 161 additions and 171 deletions

View File

@ -4,6 +4,8 @@
@use '_bootstrap-variables'; @use '_bootstrap-variables';
@use '_miniature' as *; @use '_miniature' as *;
$video-height: 66vh;
@function getPlayerHeight ($width) { @function getPlayerHeight ($width) {
@return calc(#{$width} / #{$video-watch-player-factor}); @return calc(#{$width} / #{$video-watch-player-factor});
} }
@ -20,6 +22,23 @@
border-bottom: 1px solid $separator-border-color !important; border-bottom: 1px solid $separator-border-color !important;
} }
.blocked-label {
font-weight: $font-semibold;
}
.placeholder-image {
height: 100%;
}
.alert {
text-align: center;
border-radius: 0;
}
.flex-direction-column {
flex-direction: column;
}
.root { .root {
&.theater-enabled #video-wrapper { &.theater-enabled #video-wrapper {
$height: calc(100vh - #{$header-height} - #{$theater-bottom-space}); $height: calc(100vh - #{$header-height} - #{$theater-bottom-space});
@ -44,21 +63,24 @@
} }
} }
.blocked-label {
font-weight: $font-semibold;
}
.placeholder-image {
height: 100%;
}
#video-wrapper { #video-wrapper {
$video-height: 66vh;
background-color: #000; background-color: #000;
display: flex; display: flex;
justify-content: center; justify-content: center;
::ng-deep .video-js {
width: 100%;
max-width: getPlayerWidth($video-height);
height: $video-height;
// VideoJS create an inner video player
video {
outline: 0;
position: relative !important;
}
}
}
#videojs-wrapper { #videojs-wrapper {
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -87,40 +109,6 @@
} }
} }
::ng-deep .video-js {
width: 100%;
max-width: getPlayerWidth(66vh);
height: $video-height;
// VideoJS create an inner video player
video {
outline: 0;
position: relative !important;
}
}
@media screen and (max-width: 600px) {
#videojs-wrapper {
height: getPlayerHeight(100vw) !important;
}
.remote-server-down,
::ng-deep .video-js {
width: 100vw;
height: getPlayerHeight(100vw) !important;
}
}
}
.alert {
text-align: center;
border-radius: 0;
}
.flex-direction-column {
flex-direction: column;
}
#video-not-found { #video-not-found {
height: 300px; height: 300px;
line-height: 300px; line-height: 300px;
@ -133,12 +121,14 @@
.video-bottom { .video-bottom {
display: flex; display: flex;
margin-top: 1.5rem; margin-top: 1.5rem;
}
.video-info { .video-info {
flex-grow: 1; flex-grow: 1;
// Set min width for flex item // Set min width for flex item
min-width: 1px; min-width: 1px;
max-width: 100%; max-width: 100%;
}
.video-info-first-row { .video-info-first-row {
display: flex; display: flex;
@ -146,6 +136,7 @@
> div:first-child { > div:first-child {
flex-grow: 1; flex-grow: 1;
} }
}
.video-info-name { .video-info-name {
@include peertube-word-wrap; @include peertube-word-wrap;
@ -187,6 +178,7 @@
opacity: 0.8; opacity: 0.8;
} }
} }
}
.video-info-channel-left { .video-info-channel-left {
flex-grow: 1; flex-grow: 1;
@ -211,17 +203,16 @@
my-subscribe-button { my-subscribe-button {
@include margin-left(5px); @include margin-left(5px);
} }
}
}
.video-attributes { .video-attributes {
@include margin-left($video-watch-info-margin-left); @include margin-left($video-watch-info-margin-left);
}
.video-attributes .video-attribute { .video-attribute {
font-size: 13px; font-size: 13px;
display: block; display: block;
margin-bottom: 12px; margin-bottom: 12px;
}
}
.video-attribute-label { .video-attribute-label {
@include padding-right(5px); @include padding-right(5px);
@ -241,16 +232,13 @@
} }
} }
&.video-attribute-tags { .video-attribute-tags {
.video-attribute-value:not(:nth-child(2)) { .video-attribute-value:not(:nth-child(2)) {
&::before { &::before {
content: ', '; content: ', ';
} }
} }
} }
}
}
}
my-action-buttons { my-action-buttons {
@include margin-left(auto); @include margin-left(auto);
@ -278,7 +266,7 @@ my-video-comments {
} }
@media screen and (max-width: 1600px) { @media screen and (max-width: 1600px) {
.video-bottom .video-info .video-attributes .video-attribute { .video-attributes .video-attribute {
margin-bottom: 5px; margin-bottom: 5px;
} }
} }
@ -304,27 +292,32 @@ my-video-comments {
} }
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
#videojs-wrapper {
height: getPlayerHeight(100vw) !important;
.remote-server-down,
::ng-deep .video-js {
width: 100vw;
height: getPlayerHeight(100vw) !important;
}
}
.video-bottom { .video-bottom {
margin-top: 20px !important; margin-top: 20px !important;
padding-bottom: 20px !important; padding-bottom: 20px !important;
}
.video-info { .video-info {
padding: 0; padding: 0;
}
.video-info-first-row {
.video-info-name { .video-info-name {
font-size: 20px; font-size: 20px;
height: auto; height: auto;
} }
} }
}
}
}
@media screen and (max-width: 450px) { @media screen and (max-width: 450px) {
.video-bottom {
.video-info .video-info-first-row {
.video-info-name { .video-info-name {
font-size: 18px; font-size: 18px;
} }
@ -332,15 +325,12 @@ my-video-comments {
.video-info-date-views { .video-info-date-views {
font-size: 14px; font-size: 14px;
} }
}
}
my-action-buttons { my-action-buttons {
margin-top: 10px; margin-top: 10px;
} }
} }
// Special case for iOS, that takes into account the width for fullscreens // Special case for iOS, that takes into account the width for fullscreens
#video-wrapper ::ng-deep .video-js.vjs-fullscreen { #video-wrapper ::ng-deep .video-js.vjs-fullscreen {
max-width: unset; max-width: unset;

View File

@ -11,12 +11,12 @@
<div class="video-miniature-information"> <div class="video-miniature-information">
<div class="d-flex video-miniature-meta"> <div class="d-flex video-miniature-meta">
<my-actor-avatar <my-actor-avatar
*ngIf="displayOptions.avatar && displayOwnerVideoChannel()" [title]="channelLinkTitle" *ngIf="displayOptions.avatar && displayOwnerVideoChannel() && !displayAsRow" [title]="channelLinkTitle"
[channel]="video.channel" [size]="actorImageSize" [internalHref]="[ '/c', video.byVideoChannel ]" [channel]="video.channel" [size]="actorImageSize" [internalHref]="[ '/c', video.byVideoChannel ]"
></my-actor-avatar> ></my-actor-avatar>
<my-actor-avatar <my-actor-avatar
*ngIf="displayOptions.avatar && displayOwnerAccount()" [title]="channelLinkTitle" *ngIf="displayOptions.avatar && displayOwnerAccount() && !displayAsRow" [title]="channelLinkTitle"
[account]="video.account" [size]="actorImageSize" [internalHref]="[ '/c', video.byVideoChannel ]" [account]="video.account" [size]="actorImageSize" [internalHref]="[ '/c', video.byVideoChannel ]"
></my-actor-avatar> ></my-actor-avatar>