117 lines
4.3 KiB
JavaScript
117 lines
4.3 KiB
JavaScript
// VERTEX AI - Assistente
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
|
|
var aiOrb = document.getElementById('aiOrb');
|
|
console.log('VERTEX AI loaded, aiOrb:', aiOrb);
|
|
var aiChat = document.getElementById('aiChat');
|
|
var aiClose = document.getElementById('aiClose');
|
|
var aiMessages = document.getElementById('aiMessages');
|
|
var aiInput = document.getElementById('aiInput');
|
|
var aiSend = document.getElementById('aiSend');
|
|
var hudOverlay = document.getElementById('hudOverlay');
|
|
|
|
if (!aiOrb || !aiChat) return;
|
|
|
|
function getResponse(text) {
|
|
text = text.toLowerCase();
|
|
|
|
if (text.match(/oi|ola|hey|bom dia|boa tarde|boa noite/)) {
|
|
return 'Ola! Sou o VERTEX, assistente da AI Vertice. Posso ajudar com informacoes sobre nossos produtos, precos ou agendar uma demo.';
|
|
}
|
|
|
|
if (text.match(/produto|solucao|fazem/)) {
|
|
return 'Nossos produtos: LexMind (Juridico), MetisClass (Educacao), ArgusFinance (Financas), Strix (Seguranca). Qual te interessa?';
|
|
}
|
|
|
|
if (text.match(/lexmind|juridico|advogado|contrato/)) {
|
|
return 'LexMind: IA para o setor juridico. Analise de contratos, pesquisa e peticoes automaticas. 85% menos tempo.';
|
|
}
|
|
|
|
if (text.match(/metisclass|metis|educacao|curso/)) {
|
|
return 'MetisClass: Plataforma de educacao com IA. Tutor virtual 24/7 e trilhas adaptativas. 3x mais engajamento.';
|
|
}
|
|
|
|
if (text.match(/argusfinance|argus|financeiro|bloomberg/)) {
|
|
return 'ArgusFinance: Terminal financeiro com IA. Dados em tempo real e analise preditiva. 50K+ ativos.';
|
|
}
|
|
|
|
if (text.match(/strix|seguranca|vigilancia|camera/)) {
|
|
return 'Strix: Sistema de vigilancia com IA. Visao computacional 24/7. 99.9% uptime.';
|
|
}
|
|
|
|
if (text.match(/preco|valor|quanto/)) {
|
|
return 'Planos: Starter a partir de R$2.500/mes. Enterprise sob consulta. Demo gratuita disponivel!';
|
|
}
|
|
|
|
if (text.match(/demo|agendar|testar/)) {
|
|
return 'Agende sua demo gratuita em contato@aivertice.com ou clique em Agendar Demo.';
|
|
}
|
|
|
|
if (text.match(/contato|email/)) {
|
|
return 'Contato: contato@aivertice.com - Brasil - Grupo Kislanski Industries.';
|
|
}
|
|
|
|
if (text.match(/empresa|vertice|kislanski/)) {
|
|
return 'AI Vertice: Empresa de solucoes de IA do grupo Kislanski Industries. Produtos: LexMind, MetisClass, ArgusFinance, Strix.';
|
|
}
|
|
|
|
if (text.match(/obrigad|valeu/)) {
|
|
return 'Por nada! Precisa de mais alguma coisa?';
|
|
}
|
|
|
|
return 'Posso ajudar com: Produtos, Precos, Demo ou Contato. Pergunte sobre LexMind, MetisClass, ArgusFinance ou Strix!';
|
|
}
|
|
|
|
function addMessage(text, isUser) {
|
|
var div = document.createElement('div');
|
|
div.className = isUser ? 'ai-message ai-message-user' : 'ai-message ai-message-bot';
|
|
var avatar = isUser ? '👤' : '◆';
|
|
div.innerHTML = '<div class="ai-avatar">' + avatar + '</div><div class="ai-bubble">' + text + '</div>';
|
|
aiMessages.appendChild(div);
|
|
aiMessages.scrollTop = aiMessages.scrollHeight;
|
|
}
|
|
|
|
function send() {
|
|
var text = aiInput.value.trim();
|
|
if (!text) return;
|
|
|
|
addMessage(text, true);
|
|
aiInput.value = '';
|
|
|
|
setTimeout(function() {
|
|
addMessage(getResponse(text), false);
|
|
}, 400);
|
|
}
|
|
|
|
aiOrb.onclick = function() {
|
|
aiChat.classList.toggle('active');
|
|
if (hudOverlay) hudOverlay.classList.toggle('active');
|
|
};
|
|
|
|
if (aiClose) {
|
|
aiClose.onclick = function() {
|
|
aiChat.classList.remove('active');
|
|
if (hudOverlay) hudOverlay.classList.remove('active');
|
|
};
|
|
}
|
|
|
|
if (aiSend) {
|
|
aiSend.onclick = send;
|
|
}
|
|
|
|
if (aiInput) {
|
|
aiInput.onkeypress = function(e) {
|
|
if (e.key === 'Enter') send();
|
|
};
|
|
}
|
|
|
|
var suggestions = document.querySelectorAll('.ai-suggestion');
|
|
for (var i = 0; i < suggestions.length; i++) {
|
|
suggestions[i].onclick = function() {
|
|
aiInput.value = this.getAttribute('data-question');
|
|
send();
|
|
};
|
|
}
|
|
|
|
});
|