Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ // Mobile menu toggle
+ const mobileMenu = document.querySelector('.mobile-menu');
+ const navLinks = document.querySelector('.nav-links');
+
+ mobileMenu.addEventListener('click', () => {
+ navLinks.classList.toggle('active');
+ });
+
+ // Chat functionality
+ const chatMessages = document.querySelector('.chat-messages');
+ const chatInput = document.querySelector('.chat-input textarea');
+ const sendButton = document.querySelector('.send-btn');
+
+ const agents = {
+ 'Assistant Alpha': { color: '#6366f1' },
+ 'Code Beta': { color: '#4f46e5' },
+ 'Data Delta': { color: '#818cf8' }
+ };
+
+ let currentAgent = 'Assistant Alpha';
+
+ function addMessage(content, isUser = true) {
+ const messageDiv = document.createElement('div');
+ messageDiv.style.marginBottom = '1rem';
+ messageDiv.style.padding = '0.5rem 1rem';
+ messageDiv.style.borderRadius = '10px';
+ messageDiv.style.maxWidth = '80%';
+ messageDiv.style.wordWrap = 'break-word';
+
+ if (isUser) {
+ messageDiv.style.marginLeft = 'auto';
+ messageDiv.style.background = '#e2e8f0';
+ } else {
+ messageDiv.style.marginRight = 'auto';
+ messageDiv.style.background = agents[currentAgent].color;
+ messageDiv.style.color = 'white';
+ }
+
+ messageDiv.textContent = content;
+ chatMessages.appendChild(messageDiv);
+ chatMessages.scrollTop = chatMessages.scrollHeight;
+ }
+
+ sendButton.addEventListener('click', () => {
+ const message = chatInput.value.trim();
+ if (message) {
+ addMessage(message, true);
+ chatInput.value = '';
+
+ // Simulate agent response
+ setTimeout(() => {
+ addMessage(`${currentAgent}: I received your message: "${message}"`, false);
+ }, 1000);
+ }
+ });
+
+ // Agent card click handlers
+ const chatButtons = document.querySelectorAll('.chat-btn');
+ chatButtons.forEach(button => {
+ button.addEventListener('click', (e) => {
+ currentAgent = e.target.parentElement.querySelector('h3').textContent;
+ document.querySelector('#chat').scrollIntoView({ behavior: 'smooth' });
+ });
+ });
+
+ // Enter key to send message
+ chatInput.addEventListener('keypress', (e) => {
+ if (e.key === 'Enter' && !e.shiftKey) {
+ e.preventDefault();
+ sendButton.click();
+ }
+ });
+ });