From: SuperBFG7 Date: Mon, 23 Apr 2018 11:38:58 +0000 (+0200) Subject: layout improvements X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=e1cb953e94d6809748635acda993da073098b081;p=ympd.git layout improvements --- diff --git a/htdocs/css/mpd.css b/htdocs/css/mpd.css index 269902f..ea64fc8 100644 --- a/htdocs/css/mpd.css +++ b/htdocs/css/mpd.css @@ -76,7 +76,7 @@ h1 { white-space: nowrap; } -td:nth-child(2), th:nth-child(2) { +td:nth-child(4), th:nth-child(4) { /* This *has* to be placed before any t[dh]:nth-last-child(2) for the override to work. */ @@ -85,25 +85,36 @@ td:nth-child(2), th:nth-child(2) { td:nth-last-child(2), th:nth-last-child(2) { text-align: right; - width: 6em; + width: 4em; } -#salamisandwich td:nth-child(2) span { +#salamisandwich td:nth-child(4) span { font-style: italic; font-size: 90%; display: block; } -td:nth-child(3), td:nth-last-child(3) { +td:nth-child(2), td:nth-child(3) { min-width: 25%; - max-width: 0; + max-width: 10em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } +@media only screen and (max-width: 600px) { + td:nth-child(2), td:nth-child(3) { + min-width: 0; + max-width: 0; + } + td:nth-child(4), th:nth-child(4) { + min-width: 10%; + white-space: normal; + } +} + tbody { cursor: pointer; } diff --git a/htdocs/index.html b/htdocs/index.html index 69bbd88..ac05928 100644 --- a/htdocs/index.html +++ b/htdocs/index.html @@ -104,8 +104,8 @@

- - + +

  

@@ -127,10 +127,10 @@ # - Title - Album Artist - Duration + Album + Title + Length diff --git a/htdocs/js/mpd.js b/htdocs/js/mpd.js index aa56611..028ad84 100644 --- a/htdocs/js/mpd.js +++ b/htdocs/js/mpd.js @@ -317,9 +317,9 @@ function webSocketConnect() { $('#salamisandwich > tbody').append( "" + (obj.data[song].pos + 1) + "" + - ""+ obj.data[song].title +"" + - ""+ obj.data[song].album +"" + ""+ obj.data[song].artist +"" + + ""+ obj.data[song].album +"" + + ""+ obj.data[song].title +"" + ""+ minutes + ":" + (seconds < 10 ? '0' : '') + seconds + ""); } @@ -445,9 +445,9 @@ function webSocketConnect() { $('#salamisandwich > tbody').append( "" + "" + - "" + obj.data[item].title + "" + - "" + obj.data[item].album + "" + "" + obj.data[item].artist + "" + + "" + obj.data[item].album + "" + + "" + obj.data[item].title + "" + "" + minutes + ":" + (seconds < 10 ? '0' : '') + seconds + "" ); @@ -586,7 +586,7 @@ function webSocketConnect() { break; case 'outputnames': $('#btn-outputs-block button').remove(); - if (obj.data.length > 1) { + if ( Object.keys(obj.data).length ) { $.each(obj.data, function(id, name){ var btn = $(''); btn.appendTo($('#btn-outputs-block')); @@ -630,14 +630,14 @@ function webSocketConnect() { $('#currenttrack').text(" " + obj.data.title); var notification = "

" + obj.data.title + "

"; - if(obj.data.album) { - $('#album').text(obj.data.album); - notification += obj.data.album + "
"; - } if(obj.data.artist) { $('#artist').text(obj.data.artist); notification += obj.data.artist + "
"; } + if(obj.data.album) { + $('#album').text(obj.data.album); + notification += obj.data.album + "
"; + } if ($.cookie("notification") === "true") songNotify(obj.data.title, obj.data.artist, obj.data.album );