diff --git a/frontend/css/styles.css b/frontend/css/styles.css index fe716b3..3e5be5c 100644 --- a/frontend/css/styles.css +++ b/frontend/css/styles.css @@ -1406,11 +1406,22 @@ body.dark-map .poi-badge { background: #111; border-color: #eee; } } .rec-val { - font-size: 22px; + font-size: 27px; font-weight: 700; color: var(--on-surface); } +/* Top strip (external info): training time (left), temperature (centre), clock (right). */ +.rec-topbar { + display: flex; justify-content: space-between; align-items: center; + padding: 6px 16px; padding-top: calc(6px + var(--safe-area-top)); + background: var(--surface); border-bottom: 1px solid var(--border); + font-size: 15px; font-weight: 600; color: var(--on-surface); +} +.rec-topbar .rec-top-mid { color: var(--muted); font-weight: 500; } +/* Status line now stands alone under the stats (no longer stealing the buttons' width). */ +.rec-panel > .rec-status { font-size: 12px; color: var(--muted); text-align: center; padding: 0 12px 4px; min-height: 14px; } + .rec-lbl { font-size: 10px; color: var(--muted); @@ -1428,23 +1439,19 @@ body.dark-map .poi-badge { background: #111; border-color: #eee; } .rec-bottom { display: flex; - align-items: center; - flex-wrap: wrap; - gap: 12px; + align-items: stretch; + gap: 10px; padding: 8px 12px; padding-bottom: calc(8px + var(--safe-area-bottom)); background: var(--surface); } -.rec-bottom .rec-status { - font-size: 12px; - color: var(--muted); - flex: 1; -} +/* All three controls (HR toggle, pause, stop) share the width equally — no clustering right. */ +.rec-bottom > button { flex: 1 1 0; } .rec-bottom .gps-rec { - padding: 12px 32px; - flex-shrink: 0; + padding: 12px 0; + flex-shrink: 1; } .gps-header { diff --git a/frontend/js/gps.js b/frontend/js/gps.js index e86c11e..41fc6cf 100644 --- a/frontend/js/gps.js +++ b/frontend/js/gps.js @@ -1407,6 +1407,12 @@ GPS.startRecording = async function(activityType, weightKg, profile) { GPS.recording.points = []; GPS.recording.hrSamples = []; GPS.recording.hrProfile = profile || null; + // Clear any HR left over from the PREVIOUS session (else a stale bpm hangs on the display and + // gets written onto this session's points). Only a fresh reading this session re-fills it. + GPS.recording.currentHr = null; + GPS.recording.currentBleData = null; + GPS.recording.currentBattery = null; + try { window.__TAURI__.core.invoke("ble_clear_hr"); } catch {} GPS.recording.startTime = null; GPS.recording.weightKg = parseFloat(weightKg) || 80; diff --git a/frontend/js/main.js b/frontend/js/main.js index 615aa17..618d861 100644 --- a/frontend/js/main.js +++ b/frontend/js/main.js @@ -4581,27 +4581,24 @@ async function renderRecordingInline(container) { container.innerHTML = `
+
+ 0:00 + — + ${new Date().toTimeString().slice(0,5)} +
${GPS.recording.state === "waiting_gps" ? '
Поиск GPS...
' : ''}
-
+
--Пульс
0 мДистанция
0км/ч
-
0:00Время
—Высота
-
${new Date().toTimeString().slice(0,5)}Часы
-
—t°C
+
${GPS.recording.state === "waiting_gps" ? "Поиск GPS..." : GPS.recording.state === "ready" ? "Начните движение..." : ""}
-
${GPS.recording.state === "waiting_gps" ? "Поиск GPS..." : GPS.recording.state === "ready" ? "Начните движение..." : ""}
@@ -5081,20 +5078,10 @@ async function renderRecordingInline(container) { // HR update from BLE GPS.recording.onHrUpdate = (reading) => { - let row = document.querySelector("#rec-hr-row"); - if (!row) return; - row.style.display = "flex"; - let hrEl = document.querySelector("#rec-hr-val"); - if (hrEl) { - hrEl.textContent = reading.hr; - hrEl.className = "rec-hr-val " + hrZoneClass(reading.hr); - } + let hrEl = document.querySelector("#rec-hr-val"); // HR stat in the bottom row + if (hrEl) { hrEl.textContent = reading.hr; hrEl.className = "rec-val " + hrZoneClass(reading.hr); } let hrNum = document.querySelector("#rec-hr-num"); // live HR on the toggle button itself if (hrNum) hrNum.textContent = reading.hr; - let spo2El = document.querySelector("#rec-spo2"); - if (spo2El) spo2El.textContent = reading.spo2 ? `SpO2: ${reading.spo2}%` : ""; - let bpEl = document.querySelector("#rec-bp"); - if (bpEl) bpEl.textContent = (reading.bp_sys && reading.bp_dia) ? `${reading.bp_sys}/${reading.bp_dia}` : ""; }; // Timer — excludes pauses, starts only when recording