Files
weval-consulting/weval-chat-fix.js.bak-25mar
2026-03-25 02:55:00 +01:00

41 lines
2.3 KiB
Plaintext

/* WEVAL Chat Fix v3 — 2026-03-19 */
(function(){
/* CSS Fix: chat button above CTA bar */
var css=document.createElement('style');
css.id='weval-chat-fix-v3';
css.textContent='.chat-toggle-btn{bottom:80px!important;right:24px!important;z-index:10001!important;pointer-events:auto!important}.wr-floating-cta{pointer-events:none!important;z-index:9000!important}.wr-floating-cta *{pointer-events:auto!important}.chatbot-fab{display:none!important}@media(max-width:768px){.chat-toggle-btn{bottom:72px!important;right:16px!important}body{overflow-x:hidden!important}}@media(max-width:480px){.chat-toggle-btn{bottom:64px!important;right:12px!important}}#wevia-chat-overlay{position:fixed;bottom:100px;right:24px;width:400px;height:560px;z-index:10005;border-radius:16px;overflow:hidden;box-shadow:0 10px 40px rgba(0,0,0,.3);display:none;flex-direction:column;background:#0a0f1a}#wevia-chat-overlay.open{display:flex}@media(max-width:768px){#wevia-chat-overlay{bottom:72px;right:0;width:100%;height:calc(100vh - 140px);border-radius:16px 16px 0 0}}';
document.head.appendChild(css);
/* Chat overlay */
var overlay=document.createElement('div');
overlay.id='wevia-chat-overlay';
var hdr=document.createElement('div');
hdr.style.cssText='background:linear-gradient(135deg,#667eea,#764ba2);padding:12px 16px;display:flex;justify-content:space-between;align-items:center;color:#fff;font-weight:700;font-size:14px;flex-shrink:0';
hdr.innerHTML='<span>\u{1f9e0} WEVIA IA</span>';
var closeBtn=document.createElement('button');
closeBtn.textContent='\u00d7';
closeBtn.style.cssText='background:none;border:none;color:#fff;font-size:24px;cursor:pointer;padding:0 4px';
closeBtn.onclick=function(){overlay.classList.remove('open')};
hdr.appendChild(closeBtn);
var ifr=document.createElement('iframe');
ifr.src='/wevia-widget.html';
ifr.style.cssText='flex:1;border:none;width:100%;background:#0a0f1a';
overlay.appendChild(hdr);
overlay.appendChild(ifr);
document.body.appendChild(overlay);
/* Click handler */
function attach(){
var btn=document.querySelector('.chat-toggle-btn');
if(btn && !btn._wvFix){
btn._wvFix=true;
btn.addEventListener('click',function(e){
e.preventDefault();e.stopPropagation();
overlay.classList.toggle('open');
},true);
}
}
attach();
setInterval(attach,500);
})();