14 lines
5.9 KiB
JavaScript
14 lines
5.9 KiB
JavaScript
// WEVAL Platform Chatbot v4 — clean, no IIFE, no backticks
|
|
if(!document.getElementById("weval-bot-widget")){
|
|
var _css=document.createElement("style");
|
|
_css.textContent="#weval-bot-btn{position:fixed;bottom:20px;right:20px;z-index:9999;width:56px;height:56px;border-radius:50%;background:linear-gradient(135deg,#6366f1,#8b5cf6);border:none;cursor:pointer;box-shadow:0 4px 24px rgba(99,102,241,.4);display:flex;align-items:center;justify-content:center;transition:transform .2s}#weval-bot-btn:hover{transform:scale(1.08)}#weval-bot-btn svg{width:28px;height:28px;fill:#fff}#weval-bot-badge{position:absolute;top:-2px;right:-2px;width:14px;height:14px;background:#22c55e;border-radius:50%;border:2px solid #fff}#weval-bot-panel{display:none;position:fixed;bottom:90px;right:20px;width:380px;max-height:520px;background:#0f1629;border:1px solid rgba(99,102,241,.2);border-radius:16px;box-shadow:0 12px 48px rgba(0,0,0,.5);overflow:hidden;flex-direction:column;z-index:9999;font-family:Inter,system-ui,sans-serif}#weval-bot-panel.open{display:flex}#weval-bot-head{background:linear-gradient(135deg,#6366f1,#8b5cf6);padding:14px 18px;display:flex;align-items:center;gap:10px}#weval-bot-head .av{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;font-size:18px;color:#fff}#weval-bot-head .info{flex:1;color:#fff}#weval-bot-head .nm{font-weight:600;font-size:14px}#weval-bot-head .st{font-size:11px;opacity:.8}#weval-bot-close{background:none;border:none;color:rgba(255,255,255,.7);cursor:pointer;font-size:20px}#weval-bot-msgs{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;min-height:280px;max-height:360px}.bm{max-width:85%;padding:10px 14px;border-radius:12px;font-size:13px;line-height:1.5;word-wrap:break-word}.bm.bot{background:rgba(99,102,241,.12);color:#e2e8f0;border-bottom-left-radius:4px;align-self:flex-start}.bm.user{background:#6366f1;color:#fff;border-bottom-right-radius:4px;align-self:flex-end}.bm a{color:#818cf8}#weval-bot-input-area{padding:10px 14px;border-top:1px solid rgba(255,255,255,.06);display:flex;gap:8px}#weval-bot-input{flex:1;background:rgba(255,255,255,.06);border:1px solid rgba(255,255,255,.1);border-radius:8px;padding:8px 12px;color:#e2e8f0;font-size:13px;outline:none}#weval-bot-input::placeholder{color:rgba(255,255,255,.3)}#weval-bot-send{background:#6366f1;border:none;border-radius:8px;padding:8px 12px;color:#fff;cursor:pointer;font-size:13px;font-weight:600}@media (max-width:768px){#weval-bot-btn{bottom:110px!important}#weval-bot-panel{bottom:178px!important;width:calc(100vw - 24px)!important;right:12px!important;max-height:60vh!important}}/*doctrine_193_mobile_no_overlap*/";
|
|
document.head.appendChild(_css);
|
|
var _w=document.createElement("div");_w.id="weval-bot-widget";
|
|
_w.innerHTML='<button id="weval-bot-btn" onclick="toggleBot()"><svg viewBox="0 0 24 24"><path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/></svg><div id="weval-bot-badge"></div></button><div id="weval-bot-panel"><div id="weval-bot-head"><div class="av">W</div><div class="info"><div class="nm">WEVAL Assistant</div><div class="st">En ligne - 47 produits</div></div><button id="weval-bot-close" onclick="toggleBot()">×</button></div><div id="weval-bot-msgs"></div><div id="weval-bot-input-area"><input id="weval-bot-input" placeholder="Posez une question..." onkeypress="if(event.key===\'Enter\')sendBot()"><button id="weval-bot-send" onclick="sendBot()">Envoyer</button></div></div>';
|
|
document.body.appendChild(_w);
|
|
}
|
|
function toggleBot(){var p=document.getElementById("weval-bot-panel");p.classList.toggle("open");if(p.classList.contains("open")&&document.getElementById("weval-bot-msgs").children.length===0){addMsg("bot","Bonjour ! Je suis l\u2019assistant WEVAL. <b>47 produits SaaS</b> en production. Que cherchez-vous ?")}document.getElementById("weval-bot-badge").style.display="none"}
|
|
function addMsg(t,h){var m=document.getElementById("weval-bot-msgs");var d=document.createElement("div");d.className="bm "+t;d.innerHTML=h;m.appendChild(d);m.scrollTop=m.scrollHeight}
|
|
function sendBot(){var i=document.getElementById("weval-bot-input");var msg=i.value.trim();if(!msg)return;i.value="";addMsg("user",msg);setTimeout(function(){addMsg("bot",botAnswer(msg))},500)}
|
|
function botAnswer(q){var l=q.toLowerCase();if(/bonjour|salut|hello|hi|hey/.test(l))return"Bienvenue ! Nous proposons <b>47 produits SaaS</b>. Demandez-moi un produit, un prix, ou une demo.";if(/prix|tarif|combien|gratuit|free/.test(l))return"<b>Plans gratuits:</b> DeliverScore, WEVIA Inference, Content Factory, WEVAL CRM. Pro a partir de 19$/mo. <a href='/products/'>Catalogue complet</a>";if(/email|deliver|inbox|reputation/.test(l))return"<b>Email Intelligence:</b> DeliverScore, MailWarm, EmailVerify, BlacklistGuard, InboxTest, ISP Monitor, OutreachAI. <a href='/products/deliverscore.html'>Essayer</a>";if(/ia|intelligence|gpu|wevia|inference/.test(l))return"<b>IA WEVIA:</b> WEVIA Inference (GPU), Content Factory, ProposalAI, BlueprintAI, CopyAI, CanvasAI, DevForge AI. <a href='/products/gpu-inference.html'>Tester</a>";if(/data|medreach|lead|medecin|pharma/.test(l))return"<b>Data:</b> MedReach API (18596 medecins), LeadForge (B2B Intelligence), DataHarvest. <a href='/products/medreach.html'>Explorer</a>";if(/security|cyber|sentinel|audit/.test(l))return"<b>Cybersecurite:</b> Sentinel Monitor, BlacklistGuard, Audit & Compliance. <a href='/products/workspace.html'>Workspace</a>";if(/demo|essai|tester|commencer/.test(l))return"Creez un compte gratuit: <a href='/products/workspace.html'>Ouvrir le Workspace</a>. Acces immediat aux plans gratuits.";if(/mail.*forge|entrepreneur/.test(l))return"<b>MailForge</b> - Suite email tout-en-un: 11 modules (warmup, deliverabilite, verification, outreach IA). $99-$499/mo. <a href='/products/mailforge.html'>Decouvrir</a>";return"Je couvre: <b>Email</b>, <b>IA/GPU</b>, <b>Data</b>, <b>Security</b>, <b>Marketing</b>, <b>Commerce</b>. Precisez votre besoin !"}
|