From 37d0b33ea913742bbf1c7a2756ebba40656c6349 Mon Sep 17 00:00:00 2001 From: oltnd Date: Sun, 9 Aug 2026 18:11:36 +0300 Subject: [PATCH] feat:time to end of first shift is hidden --- src/index.css | 4 ++++ src/index.js | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) 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(); }