Website Chat Script ((free)) [ 2025-2026 ]
@keyframes blink 0%, 60%, 100% opacity: 0.3; transform: translateY(0); 30% opacity: 1; transform: translateY(-4px);
// add a message to UI (type: 'user' or 'bot') function addMessage(text, sender) const messageDiv = document.createElement('div'); messageDiv.classList.add('message'); messageDiv.classList.add(sender === 'user' ? 'user-message' : 'bot-message'); website chat script
.user-message .bubble background: #3b82f6; color: white; border-bottom-right-radius: 4px; @keyframes blink 0%, 60%, 100% opacity: 0
.typing-indicator span:nth-child(2) animation-delay: 0.2s; .typing-indicator span:nth-child(3) animation-delay: 0.4s; @keyframes blink 0%
<div class="chat-input-area"> <input type="text" id="messageInput" placeholder="Write a message..." autocomplete="off"> <button id="sendBtn" aria-label="Send message">➤</button> </div> <div class="info-note"> 💡 Simulated live chat – bot responds contextually (FAQ, greetings, fallback) </div> </div>