Neon Glow Toast Notification - 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>Neon Glow Toast Notification</title> <style> body { font-family: Arial, sans-serif; background: linear-gradient(135deg, #ff6e7f 0%, #bfe9ff 100%); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; overflow: hidden; } .toast-container { position: fixed; top: 20px; right: 20px; display: flex; flex-direction: column; gap: 10px; } .toast { display: flex; align-items: center; padding: 15px; min-width: 300px; background: rgba(255, 255, 255, 0.2); border-radius: 15px; } .toast-icon { font-size: 24px; margin-right: 15px; color: #fff; } .toast-content { flex-grow: 1; } .toast-content h4 { margin: 0; font-size: 18px; color: #fff; } .toast-content p { margin: 5px 0 0; color: #fff; } @keyframes slideInTop { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } } </style> </head> <body> <div class="toast-container" id="toast-container"></div> <script> function showToast(title, message, icon) { const toastContainer = document.getElementById('toast-container'); const toast = document.createElement('div'); toast.className = 'toast'; const toastIcon = document.createElement('div'); toastIcon.className = 'toast-icon'; toastIcon.innerHTML = icon; const toastContent = document.createElement('div'); toastContent.className = 'toast-content'; const toastTitle = document.createElement('h4'); toastTitle.innerText = title; const toastMessage = document.createElement('p'); toastMessage.innerText = message; toastContent.appendChild(toastTitle); toastContent.appendChild(toastMessage); toast.appendChild(toastIcon); toast.appendChild(toastContent); toastContainer.appendChild(toast); setTimeout(() => { toast.remove(); }, 4000); } // Example usage showToast('Welcome', 'You have successfully logged in!', '👋'); showToast('Update', 'Your profile has been updated.', '🔄'); </script> </body> </html>