Merge pull request #430 from dkanada/device

Fix layout issues for device cards on dashboard
This commit is contained in:
Anthony Lavado 2019-09-02 03:17:27 -04:00 committed by GitHub
commit df2ae88a72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 91 deletions

View File

@ -221,6 +221,7 @@ define(['datetime', 'itemHelper', 'css!./indicators.css', 'material-icons'], fun
}); });
return { return {
getProgressHtml: getProgressHtml,
getProgressBarHtml: getProgressBarHtml, getProgressBarHtml: getProgressBarHtml,
getPlayedIndicatorHtml: getPlayedIndicator, getPlayedIndicatorHtml: getPlayedIndicator,
getChildCountIndicatorHtml: getChildCountIndicatorHtml, getChildCountIndicatorHtml: getChildCountIndicatorHtml,

View File

@ -1,4 +1,4 @@
define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globalize", "loading", "connectionManager", "playMethodHelper", "cardBuilder", "imageLoader", "components/activitylog", "scripts/imagehelper", "humanedate", "listViewStyle", "emby-button", "flexStyles", "emby-button", "emby-itemscontainer"], function (datetime, events, itemHelper, serverNotifications, dom, globalize, loading, connectionManager, playMethodHelper, cardBuilder, imageLoader, ActivityLog, imageHelper) { define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globalize", "loading", "connectionManager", "playMethodHelper", "cardBuilder", "imageLoader", "components/activitylog", "scripts/imagehelper", "indicators", "humanedate", "listViewStyle", "emby-button", "flexStyles", "emby-button", "emby-itemscontainer"], function (datetime, events, itemHelper, serverNotifications, dom, globalize, loading, connectionManager, playMethodHelper, cardBuilder, imageLoader, ActivityLog, imageHelper, indicators) {
"use strict"; "use strict";
function buttonEnabled(elem, enabled) { function buttonEnabled(elem, enabled) {
@ -249,20 +249,19 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
html += '<div class="cardScalable visualCardBox-cardScalable">'; html += '<div class="cardScalable visualCardBox-cardScalable">';
html += '<div class="cardPadder cardPadder-backdrop"></div>'; html += '<div class="cardPadder cardPadder-backdrop"></div>';
html += '<div class="cardContent">'; html += '<div class="cardContent">';
var imgUrl = DashboardPage.getNowPlayingImageUrl(nowPlayingItem);
var imgUrl = DashboardPage.getNowPlayingImageUrl(nowPlayingItem);
if (imgUrl) { if (imgUrl) {
html += '<div class="sessionNowPlayingContent sessionNowPlayingContent-withbackground"'; html += '<div class="sessionNowPlayingContent sessionNowPlayingContent-withbackground"';
html += ' data-src="' + imgUrl + '" style="display:inline-block;background-image:url(\'' + imgUrl + "');\""; html += ' data-src="' + imgUrl + '" style="display:inline-block;background-image:url(\'' + imgUrl + "');\"></div>";
} else { } else {
html += '<div class="sessionNowPlayingContent"'; html += '<div class="sessionNowPlayingContent"></div>';
} }
html += "></div>";
html += '<div class="sessionNowPlayingInnerContent">'; html += '<div class="sessionNowPlayingInnerContent">';
html += '<div class="sessionAppInfo">'; html += '<div class="sessionAppInfo">';
var clientImage = DashboardPage.getClientImage(session);
var clientImage = DashboardPage.getClientImage(session);
if (clientImage) { if (clientImage) {
html += clientImage; html += clientImage;
} }
@ -272,7 +271,6 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
html += '<div class="sessionAppSecondaryText">' + DashboardPage.getAppSecondaryText(session) + "</div>"; html += '<div class="sessionAppSecondaryText">' + DashboardPage.getAppSecondaryText(session) + "</div>";
html += "</div>"; html += "</div>";
html += "</div>"; html += "</div>";
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(session) + "</div>";
if (session.TranscodingInfo && session.TranscodingInfo.Framerate) { if (session.TranscodingInfo && session.TranscodingInfo.Framerate) {
html += '<div class="sessionTranscodingFramerate">' + session.TranscodingInfo.Framerate + " fps</div>"; html += '<div class="sessionTranscodingFramerate">' + session.TranscodingInfo.Framerate + " fps</div>";
@ -280,20 +278,22 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa
html += '<div class="sessionTranscodingFramerate"></div>'; html += '<div class="sessionTranscodingFramerate"></div>';
} }
html += '<div class="sessionNowPlayingDetails">'
var nowPlayingName = DashboardPage.getNowPlayingName(session); var nowPlayingName = DashboardPage.getNowPlayingName(session);
html += '<div class="sessionNowPlayingInfo" data-imgsrc="' + nowPlayingName.image + '">'; html += '<div class="sessionNowPlayingInfo" data-imgsrc="' + nowPlayingName.image + '">';
html += nowPlayingName.html; html += nowPlayingName.html;
html += "</div>"; html += "</div>";
html += '<div class="sessionNowPlayingTime">' + DashboardPage.getSessionNowPlayingTime(session) + "</div>";
html += '</div>'
if (nowPlayingItem && nowPlayingItem.RunTimeTicks) { if (nowPlayingItem && nowPlayingItem.RunTimeTicks) {
html += '<progress class="playbackProgress" min="0" max="100" value="' + 100 * (session.PlayState.PositionTicks || 0) / nowPlayingItem.RunTimeTicks + '"></progress>'; var percent = 100 * (session.PlayState.PositionTicks || 0) / nowPlayingItem.RunTimeTicks;
} else { html += indicators.getProgressHtml(percent, { containerClass: "playbackProgress" });
html += '<progress class="playbackProgress hide" min="0" max="100"></progress>';
} }
if (session.TranscodingInfo && session.TranscodingInfo.CompletionPercentage) { if (session.TranscodingInfo && session.TranscodingInfo.CompletionPercentage) {
html += '<progress class="transcodingProgress" min="0" max="100" value="' + session.TranscodingInfo.CompletionPercentage.toFixed(1) + '"></progress>'; var percent = session.TranscodingInfo.CompletionPercentage.toFixed(1);
} else { html += indicators.getProgressHtml(percent, { containerClass: "transcodingProgress" });
html += '<progress class="transcodingProgress hide" min="0" max="100"></progress>';
} }
html += "</div>"; html += "</div>";

View File

@ -272,10 +272,9 @@ div[data-role=controlgroup] a.ui-btn-active {
position: relative position: relative
} }
.sessionAppInfo, .sessionAppInfo {
.sessionNowPlayingInfo { padding: 0.5em;
padding: .5em; overflow: hidden;
overflow: hidden
} }
.sessionCardButtons { .sessionCardButtons {
@ -317,105 +316,60 @@ div[data-role=controlgroup] a.ui-btn-active {
max-width: 200px max-width: 200px
} }
.sessionNowPlayingInfo { .sessionNowPlayingDetails {
display: flex;
position: absolute; position: absolute;
left: 0; bottom: 0px;
bottom: 11px; width: 100%;
max-width: 50%; }
-o-text-overflow: ellipsis;
text-overflow: ellipsis .sessionNowPlayingInfo {
flex-grow: 1;
text-overflow: ellipsis;
padding: 0.8em 0.5em;
} }
.sessionAppInfo img { .sessionAppInfo img {
max-width: 32px; max-width: 40px;
max-height: 32px; max-height: 40px;
margin-right: 5px margin-right: 8px;
}
.activeSession .playbackProgress {
position: absolute;
right: 0;
bottom: 0;
left: 0;
height: 7px;
width: 100%;
opacity: .95
}
.activeSession:not(.playingSession) .sessionNowPlayingInfo {
bottom: 0
} }
.sessionNowPlayingTime { .sessionNowPlayingTime {
position: absolute; flex-shrink: 0;
right: 10px; align-self: flex-end;
bottom: 19px text-overflow: ellipsis;
padding: 0.8em 0.5em;
} }
.sessionNowPlayingStreamInfo { .sessionNowPlayingStreamInfo {
white-space: nowrap white-space: nowrap;
} }
.activeSession .playbackProgress,
.activeSession .transcodingProgress { .activeSession .transcodingProgress {
position: absolute;
right: 0; right: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
height: 5px; height: 6px;
width: 100%; width: 100%;
opacity: .9;
position: absolute
} }
.playbackProgress, .playbackProgress,
.transcodingProgress { .transcodingProgress {
appearance: none; margin: 0px;
-moz-appearance: none; width: 100%;
-webkit-appearance: none; background: transparent !important;
margin: 0 5px 0 0;
height: 14px;
border: 0 solid #222;
-webkit-border-radius: 0;
border-radius: 0;
width: 50px;
background: #000 !important
} }
.playbackProgress::-webkit-progress-bar, .playbackProgress > div {
.transcodingProgress::-webkit-progress-bar { z-index: 1000;
background: #000 background-color: #00a4dc;
} }
.transcodingSession .playbackProgress { .transcodingProgress > div {
bottom: 5px background-color: #dd4919;
}
.transcodingProgress::-moz-progress-bar {
border-radius: .3em;
background-color: #dd4919
}
.transcodingProgress::-webkit-progress-value {
-webkit-border-radius: .3em;
border-radius: .3em;
background-color: #dd4919
}
.transcodingProgress[aria-valuenow]:before {
-webkit-border-radius: .3em;
border-radius: .3em;
background-color: #dd4919
}
.playbackProgress::-moz-progress-bar {
background-color: #00a4dc
}
.playbackProgress::-webkit-progress-value {
background-color: #00a4dc
}
.playbackProgress[aria-valuenow]:before {
background-color: #00a4dc
} }
@media all and (max-width:34.375em) { @media all and (max-width:34.375em) {