Minimalist Slide 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>Minimalist Slide Notification</title> <style> body { margin: 0; font-family: 'Helvetica Neue', sans-serif; } .notification-bar { position: fixed; top: 0; left: 0; width: 100%; background: #282828; color: #f0f0f0; text-align: center; padding: 15px; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); z-index: 1000; display: flex; justify-content: center; align-items: center; animation: slideIn 0.5s ease-out; } .notification-bar .icon { margin-right: 10px; font-size: 1.5em; animation: float 3s infinite; } .notification-bar .message { flex: 1; font-size: 1em; animation: fadeIn 1s ease-in-out; } .notification-bar .close-btn { background: none; border: none; color: #f0f0f0; font-size: 1em; cursor: pointer; animation: fadeIn 1s ease-in-out; margin-right: 30px; } @keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } } @keyframes float { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes slideOut { from { transform: translateX(0); } to { transform: translateX(-100%); } } </style> </head> <body> <div class="notification-bar" id="notificationBar"> <div class="icon">🔔</div> <div class="message">This is a Minimalist Slide Notification Bar!</div> <button class="close-btn" onclick="closeNotification()">✖</button> </div> <script> function closeNotification() { const bar = document.getElementById('notificationBar'); bar.style.animation = 'slideOut 0.5s ease-in'; setTimeout(() => bar.style.display = 'none', 500); } </script> </body> </html>