diff --git a/src/index.css b/src/index.css index fc301d3..55ac515 100644 --- a/src/index.css +++ b/src/index.css @@ -97,6 +97,10 @@ H1 { color: #b9c8d6; } +.hidden { + display: none; +} + .time-block.break-current { border: 2px solid #d4a017; color: #d4a017; diff --git a/src/index.js b/src/index.js index 29b5800..0dec438 100644 --- a/src/index.js +++ b/src/index.js @@ -281,9 +281,14 @@ function updateNextBreak() { const shift1Ms = getShift1EndMs(now); const timeUntilShift1End = Math.max(0, shift1Ms - now.getTime()); - shift1EndEl.textContent = - "До конца смены 1 (" + getShift1EndForToday(now) + ") · " + - formatDuration(timeUntilShift1End); + if (timeUntilShift1End === 0) { + shift1EndEl.classList.add("hidden"); + } else { + shift1EndEl.classList.remove("hidden"); + shift1EndEl.textContent = + "До конца смены 1 (" + getShift1EndForToday(now) + ") · " + + formatDuration(timeUntilShift1End); + } scheduleNextBreakTick(); }