1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Update item details mobile layout

This commit is contained in:
Bill Thornton 2021-08-06 02:09:26 -04:00
parent 0fcb5e7b3e
commit af00a04e76
3 changed files with 95 additions and 174 deletions

View file

@ -52,8 +52,6 @@
z-index: 1; z-index: 1;
margin: 0 !important; margin: 0 !important;
top: 6.9em !important; top: 6.9em !important;
-webkit-transition: -webkit-transform 0.2s ease-out;
-o-transition: transform 0.2s ease-out;
transition: transform 0.2s ease-out; transition: transform 0.2s ease-out;
} }
@ -62,17 +60,14 @@
} }
.headerUserImage { .headerUserImage {
-webkit-background-size: contain;
background-size: contain; background-size: contain;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
-webkit-border-radius: 100em;
border-radius: 100em; border-radius: 100em;
display: inline-block; display: inline-block;
} }
.headerUserButtonRound div { .headerUserButtonRound div {
-webkit-border-radius: 100em;
border-radius: 100em; border-radius: 100em;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
@ -80,7 +75,6 @@
} }
.headerButton { .headerButton {
-webkit-flex-shrink: 0;
flex-shrink: 0; flex-shrink: 0;
} }
@ -90,23 +84,15 @@
.headerLeft { .headerLeft {
display: flex; display: flex;
-webkit-align-items: center;
align-items: center; align-items: center;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1; flex-grow: 1;
overflow: hidden; overflow: hidden;
justify-content: flex-start; justify-content: flex-start;
} }
.headerRight { .headerRight {
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
-webkit-align-items: center;
align-items: center; align-items: center;
-webkit-box-pack: end;
-webkit-justify-content: flex-end;
justify-content: flex-end; justify-content: flex-end;
} }
@ -116,15 +102,10 @@
} }
.pageTitle { .pageTitle {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: inline-flex; display: inline-flex;
margin: 0 0 0 0.5em; margin: 0 0 0 0.5em;
height: 1.7em; height: 1.7em;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
-webkit-flex-shrink: 1;
flex-shrink: 1; flex-shrink: 1;
} }
@ -134,21 +115,16 @@
.headerLeft, .headerLeft,
.skinHeader { .skinHeader {
display: -webkit-box; display: flex;
display: -webkit-flex;
} }
.detailButton, .detailButton,
.skinHeader { .skinHeader {
flex-direction: column; flex-direction: column;
-webkit-flex-direction: column;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
} }
.pageTitleWithLogo { .pageTitleWithLogo {
background-position: left center; background-position: left center;
-webkit-background-size: contain;
background-size: contain; background-size: contain;
background-repeat: no-repeat; background-repeat: no-repeat;
width: 13.2em; width: 13.2em;
@ -194,27 +170,19 @@
} }
.navMenuOption { .navMenuOption {
display: -webkit-box !important;
display: -webkit-flex !important;
display: flex !important; display: flex !important;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
color: inherit; color: inherit;
padding: 0.9em 0 0.9em 2.4em !important; padding: 0.9em 0 0.9em 2.4em !important;
-webkit-box-flex: 1;
-webkit-flex-grow: 1;
flex-grow: 1; flex-grow: 1;
font-weight: 400 !important; font-weight: 400 !important;
margin: 0 !important; margin: 0 !important;
-webkit-border-radius: 0 !important;
border-radius: 0 !important; border-radius: 0 !important;
} }
.navMenuOptionIcon { .navMenuOptionIcon {
margin-right: 1.2em; margin-right: 1.2em;
-webkit-flex-shrink: 0;
flex-shrink: 0; flex-shrink: 0;
} }
@ -229,8 +197,6 @@
} }
.dashboardDocument .skinBody { .dashboardDocument .skinBody {
-webkit-transition: left ease-in-out 0.3s, padding ease-in-out 0.3s;
-o-transition: left ease-in-out 0.3s, padding ease-in-out 0.3s;
transition: left ease-in-out 0.3s, padding ease-in-out 0.3s; transition: left ease-in-out 0.3s, padding ease-in-out 0.3s;
position: absolute; position: absolute;
top: 0; top: 0;
@ -250,26 +216,6 @@
padding-bottom: 10vh; padding-bottom: 10vh;
} }
.primaryImageWrapper {
display: none;
}
.primaryImageWrapper > img {
display: block;
margin: 0 auto;
max-width: 80vw;
max-height: 50vh;
}
.primaryImageWrapper > img.aspect-square {
max-height: 45vh;
}
.layout-mobile .primaryImageWrapper {
display: block;
flex: 1 0 auto;
}
@media all and (min-width: 40em) { @media all and (min-width: 40em) {
.dashboardDocument .adminDrawerLogo, .dashboardDocument .adminDrawerLogo,
.dashboardDocument .mainDrawerButton { .dashboardDocument .mainDrawerButton {
@ -280,9 +226,7 @@
z-index: inherit !important; z-index: inherit !important;
left: 0 !important; left: 0 !important;
top: 0 !important; top: 0 !important;
-webkit-transform: none !important;
transform: none !important; transform: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important; box-shadow: none !important;
width: 20.205em !important; width: 20.205em !important;
font-size: 94%; font-size: 94%;
@ -317,14 +261,9 @@
} }
.headerTabs { .headerTabs {
-webkit-align-self: center;
align-self: center; align-self: center;
width: auto; width: auto;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center; justify-content: center;
position: relative; position: relative;
margin-top: -4.3em; margin-top: -4.3em;
@ -381,8 +320,6 @@
} }
.flexPageTabContent.is-active { .flexPageTabContent.is-active {
display: -webkit-box !important;
display: -webkit-flex !important;
display: flex !important; display: flex !important;
} }
@ -403,13 +340,11 @@
margin: 1.5em 0; margin: 1.5em 0;
background: #222; background: #222;
padding: 0.8em 0.8em 0.8em 3em; padding: 0.8em 0.8em 0.8em 3em;
-webkit-border-radius: 0.3em;
border-radius: 0.3em; border-radius: 0.3em;
position: relative; position: relative;
} }
.detailLogo, .detailLogo {
.itemBackdrop {
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center center; background-position: center center;
} }
@ -462,26 +397,30 @@
} }
.itemBackdrop { .itemBackdrop {
-webkit-background-size: cover;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: center; background-position: center 0;
background-attachment: fixed; background-attachment: fixed;
height: 40vh; height: 40vh;
position: relative; position: relative;
animation: backdrop-fadein 800ms ease-in normal both; animation: backdrop-fadein 800ms ease-in normal both;
}
.layout-mobile .itemBackdrop { .layout-mobile & {
display: none; background-attachment: initial;
} margin-top: 3rem;
.layout-desktop .itemBackdrop::after { @media all and (orientation: portrait) and (max-width: 40em) {
content: ""; height: 30vh;
width: 100%; }
height: 100%; }
background: rgba(0, 0, 0, 0.65);
display: block; .layout-desktop &::after {
content: "";
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.25);
display: block;
}
} }
.layout-tv .itemBackdrop, .layout-tv .itemBackdrop,
@ -494,21 +433,29 @@
flex-direction: column; flex-direction: column;
padding-left: 32.45vw; padding-left: 32.45vw;
padding-right: 2%; padding-right: 2%;
}
.layout-mobile .detailPageContent { @media all and (max-width: 45em) {
padding-left: 5%; & {
padding-right: 5%; padding-left: 5%;
} padding-right: 5%;
}
}
.layout-desktop .detailPageContent .emby-scroller, .layout-mobile & {
.layout-tv .detailPageContent .emby-scroller { padding-left: 5%;
margin-left: 0; padding-right: 5%;
} }
.layout-desktop .noBackdrop .detailPageContent, .layout-desktop &,
.layout-tv .noBackdrop .detailPageContent { .layout-tv & {
margin-top: 2.5em; .emby-scroller {
margin-left: 0;
}
.noBackdrop {
margin-top: 2.5em;
}
}
} }
.layout-desktop .noBackdrop .detailImageContainer img, .layout-desktop .noBackdrop .detailImageContainer img,
@ -559,8 +506,6 @@
.mainDetailButtons { .mainDetailButtons {
display: flex; display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
margin: 1em 0; margin: 1em 0;
} }
@ -568,8 +513,6 @@
.detailButton, .detailButton,
.mainDetailButtons { .mainDetailButtons {
display: flex; display: flex;
display: -webkit-box;
display: -webkit-flex;
} }
.itemName { .itemName {
@ -613,14 +556,19 @@
} }
.itemMiscInfo { .itemMiscInfo {
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
-webkit-flex-wrap: wrap;
flex-wrap: wrap; flex-wrap: wrap;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
.layout-mobile & {
@media all and (orientation: portrait) and (max-width: 40em) {
margin-bottom: 0 !important;
.mediaInfoItem {
margin-bottom: 0.6em;
}
}
}
} }
.layout-mobile .parentName, .layout-mobile .parentName,
@ -633,9 +581,17 @@
} }
.layout-mobile .mainDetailButtons { .layout-mobile .mainDetailButtons {
flex: 2 0 70%; flex: 1 0 0%;
margin-top: 0.5em; margin-top: 0.5em;
margin-bottom: 0.5em; margin-bottom: 0.5em;
@media all and (max-width: 34em) {
& {
margin-left: -32.5vw;
margin-top: 0;
margin-bottom: 0;
}
}
} }
.subtitle { .subtitle {
@ -658,9 +614,14 @@
} }
.layout-mobile .detailPagePrimaryContainer { .layout-mobile .detailPagePrimaryContainer {
flex-wrap: wrap; flex-direction: column;
position: relative; padding: 0.5rem 5% 0.5rem 37.5vw;
padding: 4.5rem 3.3% 0.5rem;
@media all and (min-width: 45em) {
& {
padding-left: 25vw;
}
}
} }
.layout-tv #itemDetailPage:not(.noBackdrop) .detailPagePrimaryContainer, .layout-tv #itemDetailPage:not(.noBackdrop) .detailPagePrimaryContainer,
@ -690,7 +651,7 @@
} }
.layout-mobile .infoWrapper { .layout-mobile .infoWrapper {
flex: 2 0 70%; flex: 1 0 0%;
} }
.infoText { .infoText {
@ -714,17 +675,27 @@
margin: 1em 0; margin: 1em 0;
} }
.layout-mobile .detailImageContainer {
display: none;
}
.detailImageContainer .card { .detailImageContainer .card {
position: absolute; position: absolute;
top: 50%; top: 20%;
float: left; max-width: 25vw;
width: 25vw; max-height: 80vh;
z-index: 3; z-index: 3;
transform: translateY(-50%);
.cardBox {
margin: 0;
}
.layout-mobile & {
top: initial;
transform: translateY(-50%);
max-width: 30vw;
}
.layout-tv & {
top: 50%;
transform: translateY(-50%);
}
} }
.detailImageContainer .card.backdropCard { .detailImageContainer .card.backdropCard {
@ -735,6 +706,10 @@
top: 40%; top: 40%;
} }
.layout-mobile .detailImageContainer {
padding-left: 5%;
}
.layout-desktop .noBackdrop .detailImageContainer, .layout-desktop .noBackdrop .detailImageContainer,
.layout-tv .noBackdrop .detailImageContainer { .layout-tv .noBackdrop .detailImageContainer {
margin-top: 0; margin-top: 0;
@ -766,7 +741,6 @@
.itemDetailImage { .itemDetailImage {
width: 100% !important; width: 100% !important;
-webkit-box-shadow: 0 0.1em 0.5em 0 rgba(0, 0, 0, 0.75);
box-shadow: 0 0.1em 0.5em 0 rgba(0, 0, 0, 0.75); box-shadow: 0 0.1em 0.5em 0 rgba(0, 0, 0, 0.75);
} }
@ -873,7 +847,6 @@ div.itemDetailGalleryLink.defaultCardBackground {
.recordingFields button { .recordingFields button {
margin-left: 0; margin-left: 0;
margin-right: 0.5em; margin-right: 0.5em;
-webkit-flex-shrink: 0;
flex-shrink: 0; flex-shrink: 0;
} }
@ -884,11 +857,7 @@ div.itemDetailGalleryLink.defaultCardBackground {
.detailButton { .detailButton {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center; justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
margin: 0 !important; margin: 0 !important;
padding: 0.7em 0.7em !important; padding: 0.7em 0.7em !important;
@ -916,18 +885,9 @@ div.itemDetailGalleryLink.defaultCardBackground {
} }
.detailButton-content { .detailButton-content {
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column; flex-direction: column;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center; justify-content: center;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
} }
@ -984,8 +944,6 @@ div.itemDetailGalleryLink.defaultCardBackground {
@media all and (max-width: 31.25em) { @media all and (max-width: 31.25em) {
.mobileDetails .itemMiscInfo { .mobileDetails .itemMiscInfo {
text-align: center; text-align: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center; justify-content: center;
} }
@ -1071,14 +1029,9 @@ div.itemDetailGalleryLink.defaultCardBackground {
} }
.mediaInfoIcons { .mediaInfoIcons {
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center; align-items: center;
margin: 1em 0; margin: 1em 0;
-webkit-flex-wrap: wrap;
flex-wrap: wrap; flex-wrap: wrap;
} }
@ -1126,7 +1079,6 @@ div:not(.sectionTitleContainer-cards) > .sectionTitle-cards {
.sectionTitleButton { .sectionTitleButton {
margin-left: 1.5em !important; margin-left: 1.5em !important;
-webkit-flex-shrink: 0;
flex-shrink: 0; flex-shrink: 0;
} }
@ -1136,22 +1088,17 @@ div:not(.sectionTitleContainer-cards) > .sectionTitle-cards {
.sectionTitleIconButton { .sectionTitleIconButton {
margin-left: 1.5em !important; margin-left: 1.5em !important;
-webkit-flex-shrink: 0;
flex-shrink: 0; flex-shrink: 0;
font-size: 84% !important; font-size: 84% !important;
padding: 0.5em !important; padding: 0.5em !important;
} }
.horizontalItemsContainer { .horizontalItemsContainer {
display: -webkit-box;
display: -webkit-flex;
display: flex; display: flex;
} }
.sectionTitleTextButton { .sectionTitleTextButton {
margin: 0 !important; margin: 0 !important;
display: -webkit-inline-box !important;
display: -webkit-inline-flex !important;
display: inline-flex !important; display: inline-flex !important;
color: inherit !important; color: inherit !important;
} }
@ -1219,8 +1166,6 @@ div:not(.sectionTitleContainer-cards) > .sectionTitle-cards {
} }
.itemsViewSettingsContainer { .itemsViewSettingsContainer {
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center; justify-content: center;
} }

View file

@ -1,14 +1,11 @@
<div id="itemDetailPage" data-role="page" class="page libraryPage itemDetailPage noSecondaryNavPage selfBackdropPage" data-backbutton="true"> <div id="itemDetailPage" data-role="page" class="page libraryPage itemDetailPage noSecondaryNavPage selfBackdropPage" data-backbutton="true">
<div id="itemBackdrop" class="itemBackdrop"> <div id="itemBackdrop" class="itemBackdrop"></div>
</div>
<div class="detailImageContainer padded-left"></div>
<div class="detailLogo"></div> <div class="detailLogo"></div>
<div class="detailPageWrapperContainer padded-bottom-page"> <div class="detailPageWrapperContainer padded-bottom-page">
<div class="detailPagePrimaryContainer padded-left padded-right"> <div class="detailPagePrimaryContainer padded-left padded-right">
<div class="primaryImageWrapper hide">
<img id="primaryImage" />
</div>
<div class="infoWrapper infoText"> <div class="infoWrapper infoText">
<div class="nameContainer"></div> <div class="nameContainer"></div>
<div class="itemMiscInfo itemMiscInfo-primary" style="margin-bottom: 0.6em;"></div> <div class="itemMiscInfo itemMiscInfo-primary" style="margin-bottom: 0.6em;"></div>
@ -90,7 +87,6 @@
</div> </div>
</div> </div>
<div class="detailPageSecondaryContainer"> <div class="detailPageSecondaryContainer">
<div class="detailImageContainer padded-left"></div>
<div class="detailPageContent"> <div class="detailPageContent">
<div class="detailPagePrimaryContent padded-right"> <div class="detailPagePrimaryContent padded-right">
<div class="detailSection"> <div class="detailSection">

View file

@ -564,7 +564,7 @@ function renderDetailPageBackdrop(page, item, apiClient) {
let hasbackdrop = false; let hasbackdrop = false;
const itemBackdropElement = page.querySelector('#itemBackdrop'); const itemBackdropElement = page.querySelector('#itemBackdrop');
if (layoutManager.mobile || !userSettings.detailsBanner()) { if (!userSettings.detailsBanner()) {
return false; return false;
} }
@ -601,24 +601,6 @@ function renderDetailPageBackdrop(page, item, apiClient) {
return hasbackdrop; return hasbackdrop;
} }
function renderPrimaryImage(page, item, apiClient) {
if (item?.ImageTags?.Primary) {
const imageUrl = apiClient.getScaledImageUrl(item.Id, {
type: 'Primary',
maxWidth: dom.getScreenWidth(),
tag: item.ImageTags.Primary
});
const imageElem = page.querySelector('#primaryImage');
imageElem.src = imageUrl;
imageElem.alt = item.Name;
if (item.PrimaryImageAspectRatio === 1) {
imageElem.classList.add('aspect-square');
}
page.querySelector('.primaryImageWrapper')?.classList.remove('hide');
}
}
function reloadFromItem(instance, page, params, item, user) { function reloadFromItem(instance, page, params, item, user) {
const apiClient = ServerConnections.getApiClient(item.ServerId); const apiClient = ServerConnections.getApiClient(item.ServerId);
@ -631,9 +613,7 @@ function reloadFromItem(instance, page, params, item, user) {
renderLogo(page, item, apiClient); renderLogo(page, item, apiClient);
renderDetailPageBackdrop(page, item, apiClient); renderDetailPageBackdrop(page, item, apiClient);
} }
if (layoutManager.mobile) {
renderPrimaryImage(page, item, apiClient);
}
renderBackdrop(item); renderBackdrop(item);
// Render the main information for the item // Render the main information for the item
@ -820,8 +800,8 @@ function renderDetailImage(elem, item, imageLoader) {
overlayText: false, overlayText: false,
transition: false, transition: false,
disableIndicators: true, disableIndicators: true,
overlayPlayButton: true, overlayPlayButton: layoutManager.mobile ? false : true,
action: 'play', action: layoutManager.mobile ? 'none' : 'play',
width: dom.getWindowSize().innerWidth * 0.25 width: dom.getWindowSize().innerWidth * 0.25
}); });