📨
<!DOCTYPE html>
<html>
<head>
<style>
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
40% {transform: translateY(-30px);}
60% {transform: translateY(-15px);}
}
@keyframes colorChange {
0%, 100% {color: red;}
50% {color: blue;}
}
</style>
</head>
<body>
<div style="width: 400px; height: 400px; border: 2px solid #000; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-end;">
<div id="chatArea" style="padding: 10px;"></div>
<div style="display: flex; align-items: center;">
<input type="text" id="userInput" placeholder="👋 Say something..." style="flex: 1; padding: 10px; border: 2px solid #000; border-radius: 5px; margin: 0 10px;">
<div id="sendBtn" style="cursor: pointer; padding: 10px; background: #333; color: #fff; border-radius: 5px;">📨</div>
</div>
</div>
<script>
const responses = ["🌟 Hi there!", "😂 That's so funny!", "🎉 Let's celebrate!", "🤔 Hmm, interesting..."];
document.getElementById('sendBtn').addEventListener('click', () => {
const userInput = document.getElementById('userInput').value;
if (userInput) {
const userMessage = document.createElement('div');
userMessage.textContent = "👤 " + userInput;
userMessage.style.animation = 'bounce 1s';
document.getElementById('chatArea').appendChild(userMessage);
setTimeout(() => {
const botResponse = document.createElement('div');
botResponse.textContent = responses[Math.floor(Math.random() * responses.length)];
botResponse.style.animation = 'colorChange 2s infinite';
document.getElementById('chatArea').appendChild(botResponse);
document.getElementById('chatArea').scrollTop = document.getElementById('chatArea').scrollHeight;
}, 500);
document.getElementById('userInput').value = '';
}
});
</script>
</body>
</html>