From 7ac87e7497d9a5110f4d1754618fda446445be64 Mon Sep 17 00:00:00 2001 From: Dauren777 Date: Tue, 2 Jun 2026 06:13:51 +0000 Subject: [PATCH] =?UTF-8?q?v27=20=E2=80=94=20=D0=BC=D0=BE=D1=82=D0=B8?= =?UTF-8?q?=D0=B2=D0=B0=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=B9=20=D0=BE?= =?UTF-8?q?=D1=82=D1=87=D1=91=D1=82=20=D1=81=20=D1=80=D0=B5=D0=BA=D0=BE?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B4=D0=B0=D1=86=D0=B8=D1=8F=D0=BC=D0=B8=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=BA=D0=B0=D0=B6=D0=B4=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=20=D1=81=D0=BF=D0=BE=D1=80=D1=82=D1=81=D0=BC=D0=B5=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/index.html b/index.html index 0fe5666..ee052cd 100644 --- a/index.html +++ b/index.html @@ -752,6 +752,7 @@ function renderProfile(){ + `;return h; } @@ -772,6 +773,68 @@ function saveAchievement(){ renderPage();toast('Достижение добавлено!'); } +// === MOTIVATION REPORT === +function openMotivationReport(){ + const u = currentUser; + const diary = getMyArr('diary'); + const badges = computeBadges(u.id).filter(b => b.cond); + const totalKm = diary.reduce((s,e) => s + (+e.km || 0), 0); + const totalWorkouts = diary.length; + const avgFeel = diary.length ? (diary.reduce((s,e)=>s+(+e.feel||0),0)/diary.length).toFixed(1) : '—'; + + // Generate personalized recommendations + let recs = []; + if (totalWorkouts < 5) recs.push('🔥 Ты только начинаешь! Самое сложное позади — первый шаг сделан. Теперь главное — регулярность. 3 тренировки в неделю = привычка.'); + else if (totalWorkouts < 20) recs.push('📈 Отличный старт! Ты уже в ритме. Добавь одну дополнительную тренировку в неделю — прогресс ускорится.'); + else recs.push('🔥 Ты настоящий боец! ' + totalWorkouts + ' тренировок — это серьёзная работа. Гордись собой.'); + + if (totalKm > 50) recs.push('🌊 ' + totalKm.toFixed(0) + ' км в воде! Ты пересёк Ла-Манш ' + (totalKm/34).toFixed(1) + ' раз. Впечатляет!'); + + if (avgFeel !== '—' && +avgFeel >= 4) recs.push('💪 Твоё самочувствие на высоте — ' + avgFeel + '/5. Организм справляется с нагрузкой отлично.'); + else if (avgFeel !== '—' && +avgFeel < 3.5) recs.push('💤 Самочувствие ' + avgFeel + '/5. Попробуй спать на час больше — восстановление улучшится.'); + + if (badges.length >= 5) recs.push('🏅 ' + badges.length + ' значков! Ты собираешь их как чемпион. Продолжай!'); + else recs.push('🎯 У тебя ' + badges.length + ' значков. Следующая цель — получить ещё один. Попробуй викторину!'); + + recs.push('🎯 Каждая тренировка приближает тебя к цели. Помни: чемпионами не рождаются — ими становятся каждый день.'); + recs.push('📚 Смотри обучающие видео в разделе Инструменты. Техника — это скорость.'); + + if (u.sport === 'Плавание' || !u.sport) { + recs.push('🏊 Работай над стартом и поворотом — на 50 м они дают до 30% времени. 10 стартов каждую тренировку.'); + recs.push('⏱ Засекай время каждую неделю. Прогресс в 0.1 секунды — это шаг к мечте.'); + } + + const w = window.open('', '_blank', 'width=800,height=700'); + w.document.write('Мотивационный отчёт — ' + u.name + ''); + w.document.write('

🏊 Мотивационный отчёт
' + u.name + '

'); + w.document.write('

' + u.sport + (u.club ? ' · ' + u.club : '') + (u.rank ? ' · ' + u.rank : '') + '

'); + + w.document.write('
'); + w.document.write('
' + totalWorkouts + '
Тренировок
'); + w.document.write('
' + totalKm.toFixed(1) + '
Км в воде
'); + w.document.write('
' + avgFeel + '
Самочувствие /5
'); + w.document.write('
' + badges.length + '
Значков
'); + w.document.write('
'); + + if (badges.length) { + w.document.write('

Значки: ' + badges.map(b => '' + b.icon + ' ' + b.name + '').join(' ') + '

'); + } + + if (u.goal) { + w.document.write('
🎯 Твоя цель: ' + u.goal + '
'); + } + + w.document.write('

📝 Персональные рекомендации

'); + recs.forEach(r => w.document.write('
' + r + '
')); + + w.document.write('
Помни: ты уже на ' + (totalWorkouts || 1) + ' тренировок впереди тех, кто остался на диване. Не останавливайся. Твой главный соперник — ты вчерашний.
'); + + w.document.write('

Отчёт сгенерирован в Галиконе · ' + new Date().toLocaleDateString('ru-RU') + '

'); + w.document.write(''); + w.document.close(); +} + + // === PDF REPORT === function openPdfReport(){ const u=currentUser;