mirror of
https://codeberg.org/armin/noiz.git
synced 2026-09-01 05:50:52 +02:00
omit hours (HH) when 00 and minutes pad only when >=10 in time displays
This commit is contained in:
parent
484ec2abb5
commit
4c46593bc5
1 changed files with 5 additions and 4 deletions
|
|
@ -138,11 +138,11 @@ footer .footer-track { flex: 1; min-width: 0; white-space: nowrap; overflow: hid
|
|||
<div class="canvas-area" id="canvasArea">
|
||||
<canvas id="spectrum" width="480" height="200"></canvas>
|
||||
<div class="progress-row" id="progressRow">
|
||||
<span id="timeCurrent">00:00:00</span>
|
||||
<span id="timeCurrent">0:00</span>
|
||||
<div class="waveform-wrap" id="waveformWrap">
|
||||
<canvas id="waveform"></canvas>
|
||||
</div>
|
||||
<span id="timeRemaining">00:00:00</span>
|
||||
<span id="timeRemaining">0:00</span>
|
||||
</div>
|
||||
<div style="position:relative">
|
||||
<canvas id="vuMeter" width="480" height="20"></canvas>
|
||||
|
|
@ -155,7 +155,7 @@ footer .footer-track { flex: 1; min-width: 0; white-space: nowrap; overflow: hid
|
|||
<div class="title" id="trackTitle">Unknown</div>
|
||||
<div class="artist-name" id="trackArtist">Unknown Artist</div>
|
||||
</div>
|
||||
<div class="big-time" id="bigTime">00:00:00 <span class="sep">/</span> 00:00:00</div>
|
||||
<div class="big-time" id="bigTime">0:00 <span class="sep">/</span> 0:00</div>
|
||||
<div class="controls">
|
||||
<button id="prevBtn" title="Previous">◀◀</button>
|
||||
<button class="play-btn" id="playBtn" title="Play">▶</button>
|
||||
|
|
@ -818,10 +818,11 @@ const GENRES = [
|
|||
'Christian Rock','Merengue','Salsa','Thrash Metal','Anime','JPop','Synthpop'
|
||||
];
|
||||
function fmtTime(s) {
|
||||
if (!isFinite(s) || s < 0) return '00:00:00';
|
||||
if (!isFinite(s) || s < 0) return '0:00';
|
||||
const h = Math.floor(s / 3600);
|
||||
const m = Math.floor((s % 3600) / 60);
|
||||
const sec = Math.floor(s % 60);
|
||||
if (h === 0) return `${m}:${sec.toString().padStart(2, '0')}`;
|
||||
return `${h.toString().padStart(2, '0')}:${m.toString().padStart(2, '0')}:${sec.toString().padStart(2, '0')}`;
|
||||
}
|
||||
function showError(msg) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue