Minimal 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>Minimal Messenger</title> <link href="https://fonts.googleapis.com/css2?family=Material+Icons" rel="stylesheet"> <style> body { margin: 0; font-family: 'Helvetica Neue', sans-serif; background: #f8f9fa; display: flex; justify-content: center; align-items: center; height: 100vh; } .minimal-messenger { width: 360px; height: 600px; background: #fff; border-radius: 15px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; overflow: hidden; } .header { background: #343a40; color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; } .header .material-icons { cursor: pointer; } .header .title { font-size: 20px; font-weight: bold; } .messages { flex: 1; padding: 20px; overflow-y: auto; } .message { margin-bottom: 20px; display: flex; align-items: flex-end; } .message.sent { justify-content: flex-end; } .message.received { justify-content: flex-start; } .message .content { max-width: 70%; padding: 10px 20px; border-radius: 15px; background: #e9ecef; position: relative; animation: slideIn 0.3s ease-in-out; } .message.sent .content { background: #343a40; color: white; } .message .avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; margin: 0 10px; } .message img { width: 100%; } @keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .input { display: flex; align-items: center; padding: 10px; background: #f1f3f5; } .input input { flex: 1; border: none; padding: 10px; border-radius: 20px; outline: none; margin: 0 10px; background: #dee2e6; } .input .material-icons { cursor: pointer; color: #007bff; } .quick-replies { display: flex; justify-content: space-around; background: #f8f9fa; padding: 10px; border-top: 1px solid #e9ecef; } .quick-replies button { border: none; background: #007bff; color: white; padding: 10px 20px; border-radius: 20px; cursor: pointer; outline: none; font-size: 14px; } .quick-replies button:hover { background: #0056b3; } </style> </head> <body> <div class="minimal-messenger"> <div class="header"> <span class="material-icons">arrow_back</span> <div class="title">Minimal Messenger</div> <span class="material-icons">more_vert</span> </div> <div class="messages" id="messages"> <div class="message received"> <div class="avatar"><img src="https://via.placeholder.com/40" alt="Avatar"></div> <div class="content">Hi! Check out this image! <br><img src="https://via.placeholder.com/150" alt="Sample Image" style="width:100%; margin-top: 10px;"></div> </div> <div class="message sent"> <div class="content">That's cool! <span class="timestamp">10:46 AM</span></div> <div class="avatar"><img src="https://via.placeholder.com/40" alt="Avatar"></div> </div> </div> <div class="quick-replies"> <button>👍</button> <button>😂</button> <button>😮</button> <button>❤️</button> </div> <div class="input"> <span class="material-icons">insert_emoticon</span> <input type="text" id="message-input" placeholder="Type a message..."> <span class="material-icons" id="send-btn">send</span> </div> </div> <script> document.getElementById('send-btn').addEventListener('click', sendMessage); document.getElementById('message-input').addEventListener('keypress', (e) => { if (e.key === 'Enter') { sendMessage(); } }); function sendMessage() { const messageText = document.getElementById('message-input').value.trim(); if (messageText === '') return; const messages = document.getElementById('messages'); const message = document.createElement('div'); message.classList.add('message', 'sent'); const content = document.createElement('div'); content.classList.add('content'); content.innerHTML = `${messageText} <span class="timestamp">${new Date().toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}</span>`; const avatar = document.createElement('div'); avatar.classList.add('avatar'); avatar.innerHTML = '<img src="https://via.placeholder.com/40" alt="Avatar">'; message.appendChild(content); message.appendChild(avatar); messages.appendChild(message); messages.scrollTop = messages.scrollHeight; document.getElementById('message-input').value = ''; } </script> </body> </html>