feat(chart): броская легенда-чипы с подсказкой ⓘ; цель «Сила/Выносливость» в настройках — по ней считается прогресс/откат

This commit is contained in:
Иван Овчинников
2026-11-22 01:22:25 +03:00
parent 0968e2a86d
commit e3ec434f03
5 changed files with 90 additions and 9 deletions
+23
View File
@@ -26,12 +26,29 @@ export function showSettings() {
? state.workoutTypes.map(wt => `<option value="${wt.name}">${wt.name}</option>`).join('')
: '<option value="">(нет типов)</option>';
const goal = state.goal === 'endurance' ? 'endurance' : 'strength';
screen.innerHTML = `
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:20px;">
<h2>⚙️ Настройки</h2>
<button class="btn btn-small btn-secondary" onclick="App.backToMain()">← Назад</button>
</div>
<!-- 0. ЦЕЛЬ ТРЕНИРОВОК -->
<div class="card mb-10">
<h3>🎯 Цель тренировок</h3>
<p class="text-muted text-small mb-10">
По цели графики определяют прогресс и откат: «Сила» — по максимальному весу за тренировку,
«Выносливость» — по суммарному объёму (вес × повторы).
</p>
<div style="display:flex; gap:10px;">
<button class="btn big-touch ${goal === 'strength' ? 'btn-primary' : 'btn-secondary'}"
onclick="SettingsLogic.setGoal('strength')">💪 Сила</button>
<button class="btn big-touch ${goal === 'endurance' ? 'btn-primary' : 'btn-secondary'}"
onclick="SettingsLogic.setGoal('endurance')">🏃 Выносливость</button>
</div>
</div>
<!-- КНОПКА ОБНОВЛЕНИЯ СПРАВОЧНИКОВ -->
<div class="card mb-10" style="background: rgba(187, 134, 252, 0.1); border-color: var(--primary);">
<div style="display:flex; justify-content:space-between; align-items:center;">
@@ -750,6 +767,12 @@ window.SettingsLogic = {
show: showSettings,
refreshDicts, // <-- ДОБАВИЛИ В ЭКСПОРТ
setGoal(goal) {
state.goal = goal === 'endurance' ? 'endurance' : 'strength';
saveState();
showSettings();
},
// Metric Types
showAddMetricTypeModal,
submitMetricType,