From b9850923c0841a81b3a7776ca55c72753dc07f0d Mon Sep 17 00:00:00 2001 From: Dauren777 Date: Mon, 1 Jun 2026 12:08:27 +0000 Subject: [PATCH] =?UTF-8?q?v21=20=E2=80=94=20=D0=98=D0=98-=D0=BF=D0=BE?= =?UTF-8?q?=D0=BC=D0=BE=D1=89=D0=BD=D0=B8=D0=BA=20=D0=B2=D0=BE=D0=B7=D0=B2?= =?UTF-8?q?=D1=80=D0=B0=D1=89=D1=91=D0=BD=20=D0=B2=20=D1=80=D0=B5=D0=B3?= =?UTF-8?q?=D0=B8=D1=81=D1=82=D1=80=D0=B0=D1=86=D0=B8=D1=8E=20=D0=B8=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/index.html b/index.html index b8e38c3..026702b 100644 --- a/index.html +++ b/index.html @@ -132,6 +132,16 @@ label.file-btn{display:inline-block;background:#1a2332;padding:12px 20px;border- label.file-btn:active{background:#2a3342} input[type=file]{display:none} +.ai-helper{position:fixed;bottom:16px;right:16px;z-index:350;width:280px;max-width:90vw;background:var(--ink);border:1px solid #2a3342;border-radius:16px;overflow:hidden;box-shadow:0 8px 32px rgba(0,0,0,.5);transition:transform .3s;display:none} +.ai-helper.show{display:block} +.ai-helper.minimized{transform:translateY(calc(100% - 44px))} +.ai-helper .ai-hdr{background:var(--cyan);color:var(--ink);padding:8px 14px;font-weight:700;font-size:13px;display:flex;justify-content:space-between;align-items:center;cursor:pointer} +.ai-helper .ai-hdr button{background:none;border:none;color:var(--ink);font-size:16px;cursor:pointer} +.ai-helper .ai-body{padding:10px;max-height:200px;overflow-y:auto;display:flex;flex-direction:column;gap:6px} +.ai-helper .ai-msg{background:#1a2332;color:var(--cyan);padding:6px 10px;border-radius:10px;font-size:12px;line-height:1.4;animation:fadeIn .4s} +@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:translateY(0)}} + + /* ROLE BUTTONS */ .role-btn{width:100%;padding:16px;background:#1a2332;border:2px solid #2a3342;border-radius:14px;color:var(--white);font-size:18px;font-weight:600;cursor:pointer;text-align:center;transition:all .2s} .role-btn.selected{border-color:var(--cyan);background:rgba(0,229,255,0.08)} @@ -301,6 +311,17 @@ input[type=file]{display:none} + + +
+
+ 🤖 Твой помощник + +
+
+
👋 Привет! Я помогу заполнить профиль.
+
+
@@ -309,6 +330,17 @@ input[type=file]{display:none}
+ +
+
+ 🤖 Помощник + +
+
+
👋 Я здесь! Нажми на раздел — подскажу.
+
+
+
@@ -470,6 +502,73 @@ const LS=(k)=>{try{return JSON.parse(localStorage.getItem('g_'+k))}catch{return const SS=(k,v)=>{try{localStorage.setItem('g_'+k,JSON.stringify(v))}catch{toast('Память полна!')}}; let currentUser=null, currentPage='profile', currentChat=null, chatFilter='all'; +function toggleAI(helperId, btnId) { + const ai = document.getElementById(helperId); + const btn = document.getElementById(btnId); + if (!ai) return; + ai.classList.toggle('minimized'); + btn.textContent = ai.classList.contains('minimized') ? '\u25B2' : '\u25BC'; +} + +function aiSay(msg, target) { + const body = document.getElementById(target || 'aiAppBody') || document.getElementById('aiRegBody'); + if (!body) return; + const div = document.createElement('div'); + div.className = 'ai-msg'; + div.innerHTML = msg; + body.appendChild(div); + body.scrollTop = body.scrollHeight; +} + +function showAIForTab(tab) { + const tips = { + profile: '👤 Это твой профиль. Здесь значки, достижения, данные. Добавь достижение или скачай отчёт для тренера!', + diary: '📖 Дневник тренировок. Записывай каждую! Через месяц увидишь прогресс.', + calendar: '📅 Календарь соревнований. Добавляй турниры и сборы — не пропустишь ни одного старта!', + chat: '💬 Чаты с другими спортсменами, тренерами и родителями. Жми 🎮 чтобы поиграть!', + tools: '⚙ Инструменты: нормативы, сравнение с чемпионами, анализ видео, витамины, рейтинг.', + students: '👥 Твои ученики. Здесь их дневники и прогресс.', + child: '👶 Профиль твоего ребёнка. Смотри тренировки, значки, цели.' + }; + if (tips[tab]) aiSay(tips[tab], 'aiAppBody'); +} + +// Registration AI hints +function aiRegHint(step) { + const hints = { + 1: '✏ Напиши фамилию, имя и отчество полностью. Например: Кайрат Гали Аскарович.', + 2: '🔑 Придумай логин (латиница) и пароль. Пароль — минимум 3 символа. Смотри на индикатор силы!', + 3: '🏊 Выбери свой вид спорта. Все варианты — олимпийские!', + 4: '👤 Кто ты в спорте? Спортсмен, тренер или родитель? Если родитель — введи имя ребёнка.', + 5: '🎂 Дата рождения. Возраст посчитается сам! Выбери аватарку или загрузи фото.', + 6: '🌍 Где ты живёшь? Выбери страну — появятся города.', + 7: '🏫 Твой клуб, тренер, разряд и главная цель. Это важно!', + 8: '📱 Телефон и email ОБЯЗАТЕЛЬНЫ! Телефон в формате +7... Без них нельзя завершить регистрацию.' + }; + if (hints[step]) aiSay(hints[step], 'aiRegBody'); +} + +// Hook into showRegStep to show AI hints +const _origShowRegStep = showRegStep; +showRegStep = function(n) { + _origShowRegStep(n); + aiRegHint(n); +}; + +// Hook into showPage for app AI +const _origShowPage = showPage; +showPage = function(page) { + _origShowPage(page); + setTimeout(() => showAIForTab(page), 400); +}; + +// Show AI assistant on login +setTimeout(() => { + const ai = document.getElementById('aiAppHelper'); + if (ai) ai.classList.add('show'); +}, 1500); + + function toast(m){const t=document.getElementById('toast');t.textContent=m;t.classList.add('show');setTimeout(()=>t.classList.remove('show'),2000)} // === LOGIN ===