v22 — ИИ-помощник встроен напрямую, без обходных путей
This commit is contained in:
parent
b9850923c0
commit
155c193aae
38
index.html
38
index.html
@ -132,8 +132,7 @@ 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{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}
|
||||
.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}
|
||||
@ -548,19 +547,7 @@ function aiRegHint(step) {
|
||||
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(() => {
|
||||
@ -605,6 +592,13 @@ function startReg(){
|
||||
function backToLogin(){
|
||||
document.getElementById('regScreen').classList.remove('active');
|
||||
document.getElementById('loginScreen').classList.add('active');
|
||||
// Show AI helper on login
|
||||
setTimeout(() => {
|
||||
const ai = document.getElementById('aiAppHelper');
|
||||
if(ai) ai.classList.add('show');
|
||||
const aiReg = document.getElementById('aiRegHelper');
|
||||
if(aiReg) aiReg.classList.add('show');
|
||||
}, 500);
|
||||
}
|
||||
function showRegStep(n){
|
||||
regStep=n;
|
||||
@ -613,6 +607,7 @@ function showRegStep(n){
|
||||
if(step){step.classList.add('active');step.querySelector('input,select')?.focus()}
|
||||
document.getElementById('stepNum').textContent=n;
|
||||
updateStepDots();
|
||||
setTimeout(() => aiRegHint(n), 200);
|
||||
}
|
||||
function buildStepDots(){
|
||||
let h=''; for(let i=1;i<=8;i++)h+=`<div class="step-dot${i<=regStep?' done':''}${i===regStep?' current':''}"></div>`;
|
||||
@ -748,6 +743,7 @@ function showPage(page){
|
||||
currentPage=page;
|
||||
document.querySelectorAll('.nav-item').forEach(n=>n.classList.toggle('active',n.dataset.page===page));
|
||||
renderPage();
|
||||
setTimeout(() => showAIForTab(page), 300);
|
||||
}
|
||||
function renderPage(){
|
||||
if(isAdmin()){
|
||||
@ -1503,6 +1499,13 @@ function doLogout(){
|
||||
currentUser=null;currentChat=null;
|
||||
document.getElementById('appScreen').classList.remove('active');
|
||||
document.getElementById('loginScreen').classList.add('active');
|
||||
// Show AI helper on login
|
||||
setTimeout(() => {
|
||||
const ai = document.getElementById('aiAppHelper');
|
||||
if(ai) ai.classList.add('show');
|
||||
const aiReg = document.getElementById('aiRegHelper');
|
||||
if(aiReg) aiReg.classList.add('show');
|
||||
}, 500);
|
||||
document.getElementById('lUser').value='';document.getElementById('lPass').value='';
|
||||
}
|
||||
|
||||
@ -1525,6 +1528,13 @@ function renderAll(){
|
||||
// === INIT ===
|
||||
if('serviceWorker'in navigator)navigator.serviceWorker.register('sw.js').catch(()=>{});
|
||||
document.getElementById('loginScreen').classList.add('active');
|
||||
// Show AI helper on login
|
||||
setTimeout(() => {
|
||||
const ai = document.getElementById('aiAppHelper');
|
||||
if(ai) ai.classList.add('show');
|
||||
const aiReg = document.getElementById('aiRegHelper');
|
||||
if(aiReg) aiReg.classList.add('show');
|
||||
}, 500);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user