Stylish Messenger - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Stylish Messenger</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { margin: 0; padding: 0; font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #ff7e5f, #feb47b); display: flex; justify-content: center; align-items: center; height: 100vh; overflow: hidden; } .messenger { width: 90%; max-width: 400px; height: 600px; background: rgba(255, 255, 255, 0.1); border-radius: 20px; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.37); border: 1px solid rgba(255, 255, 255, 0.18); display: flex; flex-direction: column; overflow: hidden; animation: fadeIn 1.5s ease-in-out; } @keyframes fadeIn { from { opacity: 0; transform: translateY(50px); } to { opacity: 1; transform: translateY(0); } } .messenger-header { display: flex; align-items: center; justify-content: space-between; padding: 20px; background: rgba(255, 255, 255, 0.2); border-bottom: 1px solid rgba(255, 255, 255, 0.2); } .messenger-header h1 { margin: 0; font-size: 1.5rem; color: #fff; } .messenger-header .icon { font-size: 1.5rem; color: #fff; cursor: pointer; transition: transform 0.3s; } .messenger-header .icon:hover { transform: scale(1.1); } .messenger-body { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; } .message { background: rgba(255, 255, 255, 0.2); border-radius: 20px; padding: 10px 20px; margin-bottom: 20px; color: #fff; width: fit-content; max-width: 70%; animation: slideIn 0.5s ease-in-out; } .message.sent { align-self: flex-end; background: rgba(0, 123, 255, 0.2); } @keyframes slideIn { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } } .messenger-footer { display: flex; align-items: center; padding: 20px; background: rgba(255, 255, 255, 0.2); border-top: 1px solid rgba(255, 255, 255, 0.2); } .messenger-footer input { flex: 1; padding: 10px 20px; border: none; border-radius: 20px; margin-right: 10px; outline: none; background: rgba(255, 255, 255, 0.5); color: #202020; } .messenger-footer .send-button { background: #ff7e5f; border: none; padding: 10px 20px; border-radius: 20px; cursor: pointer; color: #fff; transition: background 0.3s; } .messenger-footer .send-button:hover { background: #feb47b; } </style> </head> <body> <div class="messenger"> <div class="messenger-header"> <h1>Stylish Messenger</h1> <i class="fas fa-cog icon"></i> </div> <div class="messenger-body"> <div class="message received">Hello! How are you?</div> <div class="message sent">I'm good, thanks! How about you?</div> </div> <div class="messenger-footer"> <input type="text" placeholder="Type a message..." id="messageInput"> <button class="send-button" onclick="sendMessage()">Send</button> </div> </div> <script> function sendMessage() { const input = document.getElementById('messageInput'); const messageText = input.value.trim(); if (messageText !== '') { const messageContainer = document.createElement('div'); messageContainer.classList.add('message', 'sent'); messageContainer.innerText = messageText; const messengerBody = document.querySelector('.messenger-body'); messengerBody.appendChild(messageContainer); messengerBody.scrollTop = messengerBody.scrollHeight; input.value = ''; } } </script> </body> </html>