Added convertToMins function and time in app-chrome

This commit is contained in:
Core 2021-12-14 17:57:56 +00:00
parent 042229ea90
commit 6143266965
3 changed files with 18 additions and 1 deletions

View file

@ -429,6 +429,11 @@ const app = new Vue({
return this.playerLCD.playbackDuration
}
},
convertToMins(time) {
let mins = Math.floor(time/60)
let seconds = (Math.floor(time%60) / 100).toFixed(2)
return `${mins}:${seconds.replace("0.","")}`
},
hashCode(str) {
var hash = 0, i, chr;
if (str.length === 0) return hash;

View file

@ -684,6 +684,15 @@ input[type=range].web-slider::-webkit-slider-runnable-track {
overflow: hidden;
}
.app-chrome .app-chrome-item>.app-playback-controls .song-duration p {
font-weight: 400;
font-size: 10px;
height: 1.2em;
line-height: 1.3em;
overflow: hidden;
margin: 0 0 0.5em;
}
.app-chrome .app-chrome-item>.app-playback-controls .song-artist {
font-weight: 400;
font-size: 12px;

View file

@ -77,7 +77,10 @@
{{ (mk.nowPlayingItem["attributes"]["albumName"]) ? (" - " + mk.nowPlayingItem["attributes"]["albumName"]) : "" }}
</div>
</div>
<div class="song-duration" style="display: flex; justify-content: space-between;;">
<p style="width: auto">{{ convertToMins(getSongProgress()) }}</p>
<p style="width: auto">{{ convertToMins(mk.currentPlaybackDuration) }}</p>
</div>
<div class="song-progress">
<input type="range" step="0.01" min="0" :style="progressBarStyle()"
@input="playerLCD.desiredDuration = $event.target.value;playerLCD.userInteraction = true"