From c7c5d9f682253a768358640e8cb4a82210d295f6 Mon Sep 17 00:00:00 2001 From: WASRUSGEN Date: Thu, 28 May 2026 15:13:09 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=5FchatTransition=20=E2=80=94=20no=20el-?= =?UTF-8?q?step1=20flash=20when=20routing=20from=20hero=20chat=20to=20Elen?= =?UTF-8?q?a?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mockup.html | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/mockup.html b/mockup.html index e9759d3..a66d7ad 100644 --- a/mockup.html +++ b/mockup.html @@ -3621,9 +3621,30 @@ window.addEventListener('DOMContentLoaded', function(){ _refreshBalanceTab(); }); +/* ── CHAT → ELENA TRANSITION ── */ +function _chatTransition(userText, intent) { + if (intent === 'cabinet') { go('cabinet'); return; } + if (intent === 'create') { go('cabinet'); setTimeout(function(){ tab('create'); }, 200); return; } + + // Скрываем el-step1 ДО переключения экрана — нет вспышки приветствия + var step1 = document.getElementById('el-step1'); + var inp = document.getElementById('intake-custom'); + if (step1) step1.style.display = 'none'; + if (inp) inp.value = userText || ''; + go('elena'); + setTimeout(function(){ + elenaIntent(intent); + // Восстановим el-step1 на будущее (если клиент вернётся) + setTimeout(function(){ + if (step1) { step1.style.display = ''; } + if (inp) { inp.value = ''; } + }, 4000); + }, 80); +} + /* ── HERO CHAT ── */ -var _hchatDone = false; +var _hchatDone =false; var _HC_MESSAGES = [ { text: 'Добрый день! Рады Вас видеть 👋', delay: 600, typing: 900 }, @@ -3730,7 +3751,7 @@ function heroChatReply(key) { _hcRemoveTyping(); _hcAddBubble(r.elena, false); setTimeout(function(){ - elenaIntent(r.intent); + _chatTransition(r.user, r.intent); }, 1200); }, 900); }, 400); @@ -3763,7 +3784,7 @@ function heroChatSend() { setTimeout(function(){ _hcRemoveTyping(); _hcAddBubble(reply.elena, false); - setTimeout(function(){ elenaIntent(intent); }, 1200); + setTimeout(function(){ _chatTransition(txt, intent); }, 1200); }, 900); }, 400); }