I'll create the HTML embed code for your website! Let me generate both the embed code and a standalone widget file: Action: file_editor create /app/frontend/public/embed-widget.js --file-text "(function() { // Configuration const BACKEND_URL = window.CHAT_WIDGET_CONFIG?.backendUrl || 'https://pro-converse.preview.emergentagent.com'; // CSS Styles const styles = ` .ai-chat-widget { position: fixed; z-index: 999999; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif; bottom: 20px; right: 20px; } .ai-chat-widget.minimized { bottom: 20px; right: 20px; } .ai-chat-widget.expanded { width: 380px; height: 600px; background: white; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #e2e8f0; } .ai-chat-toggle-btn { background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%); color: white; border: none; border-radius: 50px; padding: 16px 24px; cursor: pointer; display: flex; align-items: center; gap: 12px; font-weight: 600; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.1); transition: all 0.3s ease; animation: automationGlow 3s infinite; position: relative; overflow: hidden; } .ai-chat-toggle-btn::before { content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent); animation: shimmer 2s infinite; } @keyframes automationGlow { 0%, 100% { box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2), 0 0 20px rgba(59, 130, 246, 0.1); } 50% { box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25), 0 0 30px rgba(59, 130, 246, 0.3); } } @keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } } .ai-chat-toggle-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2); } .ai-chat-header { background: linear-gradient(135deg, #1e293b 0%, #334155 50%, #475569 100%); color: white; padding: 20px; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; } .ai-chat-header::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(45deg, transparent 30%, rgba(102, 126, 234, 0.1) 50%, transparent 70%), radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 60%); pointer-events: none; } .ai-chat-header * { position: relative; z-index: 1; } .ai-chat-header-info { display: flex; align-items: center; gap: 12px; } .ai-chat-avatar { width: 40px; height: 40px; background: linear-gradient(135deg, #3b82f6 0%, #667eea 100%); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; border: 2px solid rgba(255, 255, 255, 0.2); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); position: relative; } .ai-chat-avatar::before { content: ''; position: absolute; inset: -2px; border-radius: 50%; padding: 2px; background: linear-gradient(45deg, #3b82f6, #667eea, #8b5cf6); mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; animation: avatarGlow 3s ease-in-out infinite alternate; } @keyframes avatarGlow { from { opacity: 0.5; } to { opacity: 1; } } .ai-chat-header-text h4 { font-size: 1rem; font-weight: 600; margin: 0; background: linear-gradient(90deg, #ffffff 0%, #e2e8f0 100%); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; } .ai-chat-header-text p { font-size: 0.8rem; margin: 0; margin-top: 2px; display: flex; align-items: center; gap: 6px; color: #94a3b8; } .ai-chat-header-text p::before { content: ''; width: 8px; height: 8px; background: #10b981; border-radius: 50%; animation: onlinePulse 2s infinite; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); } @keyframes onlinePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.7; transform: scale(1.1); } } .ai-chat-close-btn { background: rgba(255, 255, 255, 0.2); border: none; color: white; padding: 8px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s; } .ai-chat-close-btn:hover { background: rgba(255, 255, 255, 0.3); } .ai-chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%); position: relative; overflow: hidden; } .ai-chat-messages::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.03) 0%, transparent 50%), radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.03) 0%, transparent 50%), radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.02) 0%, transparent 50%); pointer-events: none; } .ai-chat-messages::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background-image: linear-gradient(rgba(102, 126, 234, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(102, 126, 234, 0.02) 1px, transparent 1px); background-size: 20px 20px; pointer-events: none; opacity: 0.5; } .ai-chat-message { display: flex; align-items: flex-start; position: relative; z-index: 2; } .ai-chat-message.user { justify-content: flex-end; } .ai-chat-message.assistant { justify-content: flex-start; } .ai-chat-message-content { max-width: 85%; background: white; padding: 12px 16px; border-radius: 18px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); position: relative; } .ai-chat-message.user .ai-chat-message-content { background: linear-gradient(135deg, #3b82f6 0%, #667eea 100%); color: white; border-bottom-right-radius: 6px; box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25); } .ai-chat-message.assistant .ai-chat-message-content { background: rgba(255, 255, 255, 0.95); border: 1px solid #e2e8f0; border-bottom-left-radius: 6px; backdrop-filter: blur(10px); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08); } .ai-chat-message-text { font-size: 0.9rem; line-height: 1.5; word-wrap: break-word; margin-bottom: 4px; } .ai-chat-message-time { font-size: 0.75rem; opacity: 0.7; text-align: right; } .ai-chat-message.assistant .ai-chat-message-time { text-align: left; color: #64748b; } .ai-chat-input-container { padding: 20px; background: white; border-top: 1px solid #e2e8f0; } .ai-chat-input-wrapper { display: flex; gap: 12px; align-items: flex-end; } .ai-chat-input { flex: 1; border: 1px solid #d1d5db; border-radius: 12px; padding: 12px 16px; font-size: 0.9rem; resize: none; outline: none; font-family: inherit; line-height: 1.5; min-height: 44px; max-height: 120px; transition: border-color 0.2s, box-shadow 0.2s; } .ai-chat-input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1); } .ai-chat-send-btn { background: linear-gradient(135deg, #3b82f6 0%, #667eea 100%); color: white; border: none; border-radius: 12px; padding: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; min-width: 44px; height: 44px; } .ai-chat-send-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4); } .ai-chat-send-btn:disabled { background: #d1d5db; cursor: not-allowed; transform: none; box-shadow: none; } .ai-typing-indicator { display: flex; gap: 4px; padding: 8px 0; } .ai-typing-indicator span { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; animation: typing 1.4s infinite ease-in-out; } .ai-typing-indicator span:nth-child(1) { animation-delay: -0.32s; } .ai-typing-indicator span:nth-child(2) { animation-delay: -0.16s; } @keyframes typing { 0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); } 40% { opacity: 1; transform: scale(1); } } @media (max-width: 480px) { .ai-chat-widget.expanded { width: calc(100vw - 20px); height: calc(100vh - 40px); bottom: 20px; right: 10px; left: 10px; } } `; // Create and inject styles const styleSheet = document.createElement('style'); styleSheet.textContent = styles; document.head.appendChild(styleSheet); // Chat Widget Class class AIChatWidget { constructor() { this.isMinimized = true; this.messages = []; this.sessionId = 'session_' + Date.now() + '_' + Math.random().toString(36).substr(2, 9); this.isLoading = false; this.createWidget(); this.addWelcomeMessage(); } createWidget() { this.container = document.createElement('div'); this.container.className = 'ai-chat-widget minimized'; this.container.innerHTML = this.getMinimizedHTML(); document.body.appendChild(this.container); this.bindEvents(); } getMinimizedHTML() { return ` `; } getExpandedHTML() { return `
Powered by Automation