v21 — ИИ-помощник возвращён в регистрацию и приложение
This commit is contained in:
parent
921e0c7774
commit
b9850923c0
99
index.html
99
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}
|
||||
<button class="btn" onclick="finishReg()">✅ Завершить!</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- AI Assistant Registration -->
|
||||
<div class="ai-helper show" id="aiRegHelper">
|
||||
<div class="ai-hdr" onclick="toggleAI('aiRegHelper','aiRegToggle')">
|
||||
🤖 Твой помощник
|
||||
<button onclick="event.stopPropagation();toggleAI('aiRegHelper','aiRegToggle')" id="aiRegToggle">▼</button>
|
||||
</div>
|
||||
<div class="ai-body" id="aiRegBody">
|
||||
<div class="ai-msg">👋 Привет! Я помогу заполнить профиль.</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MAIN APP SCREEN -->
|
||||
@ -309,6 +330,17 @@ input[type=file]{display:none}
|
||||
<div class="bottom-nav" id="bottomNav"></div>
|
||||
</div>
|
||||
|
||||
<!-- AI Assistant App -->
|
||||
<div class="ai-helper" id="aiAppHelper">
|
||||
<div class="ai-hdr" onclick="toggleAI('aiAppHelper','aiAppToggle')">
|
||||
🤖 Помощник
|
||||
<button onclick="event.stopPropagation();toggleAI('aiAppHelper','aiAppToggle')" id="aiAppToggle">▼</button>
|
||||
</div>
|
||||
<div class="ai-body" id="aiAppBody">
|
||||
<div class="ai-msg">👋 Я здесь! Нажми на раздел — подскажу.</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="toast" id="toast"></div>
|
||||
<div class="lightbox" id="lightbox" style="display:none" onclick="this.style.display='none'"></div>
|
||||
|
||||
@ -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 ===
|
||||
|
||||
Loading…
Reference in New Issue
Block a user