Gradient 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>Gradient 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: linear-gradient(135deg, #ff7e5f, #feb47b); display: flex; justify-content: center; align-items: center; height: 100vh; color: white; } .gradient-messenger { width: 360px; height: 600px; background: rgba(255, 255, 255, 0.1); border-radius: 15px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3); display: flex; flex-direction: column; overflow: hidden; } .header { background: rgba(0, 0, 0, 0.4); padding: 20px; display: flex; justify-content: space-between; align-items: center; } .header .material-icons { cursor: pointer; color: white; } .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; color: white; } .message.sent { justify-content: flex-end; } .message.received { justify-content: flex-start; } .message .content { max-width: 70%; padding: 10px 20px; border-radius: 15px; background: rgba(255, 255, 255, 0.2); position: relative; animation: fadeIn 0.3s ease-in-out; } .message.sent .content { background: rgba(0, 123, 255, 0.7); } .message .avatar { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; margin: 0 10px; } .message img { width: 100%; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .input { display: flex; align-items: center; padding: 10px; background: rgba(0, 0, 0, 0.4); } .input input { flex: 1; border: none; padding: 10px; border-radius: 20px; outline: none; margin: 0 10px; background: rgba(255, 255, 255, 0.3); color: white; } .input .material-icons { cursor: pointer; color: white; } </style> </head> <body> <div class="gradient-messenger"> <div class="header"> <span class="material-icons">arrow_back</span> <div class="title">Gradient 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">Check this link: <a href="https://example.com" target="_blank" style="color: #fff;">example.com</a></div> </div> <div class="message sent"> <div class="content">Nice! <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="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> <span class="material-icons" id="attach-btn">attach_file</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>