Elegant Fade 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>Elegant Fade Notification</title> <style> body { margin: 0; font-family: 'Georgia', serif; } .notification-bar { position: fixed; top: 0; left: 0; width: 100%; background: #34495e; color: white; text-align: center; padding: 15px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 1000; display: flex; justify-content: center; align-items: center; animation: fadeInDown 1s ease-out; } .notification-bar .icon { margin-right: 10px; font-size: 1.5em; animation: swing 2s infinite; } .notification-bar .message { flex: 1; font-size: 1.2em; animation: fadeIn 1.5s ease-in-out; } .notification-bar .close-btn { background: none; border: none; color: white; font-size: 1.2em; cursor: pointer; animation: fadeIn 1.5s ease-in-out; margin-right: 30px; } @keyframes fadeInDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } } @keyframes swing { 20% { transform: rotate3d(0, 0, 1, 15deg); } 40% { transform: rotate3d(0, 0, 1, -10deg); } 60% { transform: rotate3d(0, 0, 1, 5deg); } 80% { transform: rotate3d(0, 0, 1, -5deg); } 100% { transform: rotate3d(0, 0, 1, 0deg); } } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes fadeOutUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-100%); opacity: 0; } } </style> </head> <body> <div class="notification-bar" id="notificationBar"> <div class="icon">🌟</div> <div class="message">Experience the Elegance with this Notification Bar!</div> <button class="close-btn" onclick="closeNotification()">✖</button> </div> <script> function closeNotification() { const bar = document.getElementById('notificationBar'); bar.style.animation = 'fadeOutUp 1s ease-in'; setTimeout(() => bar.style.display = 'none', 1000); } </script> </body> </html>