Minimalist Alert - 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 Alert</title> <style> body { font-family: 'Helvetica Neue', sans-serif; background-color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; } .alert-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 9999; opacity: 0; visibility: hidden; transition: opacity 0.5s, visibility 0.5s; } .alert { background-color: #ffffff; border-radius: 5px; padding: 20px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); text-align: center; animation: popIn 0.5s ease-out; } @keyframes popIn { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } } .alert-header { display: flex; justify-content: center; align-items: center; font-size: 24px; font-weight: bold; margin-bottom: 15px; color: #333333; } .alert-header .icon { margin-right: 10px; } .alert-body { font-size: 18px; margin-bottom: 20px; color: #333333; } .alert-footer { display: flex; justify-content: center; } .alert-footer button { background-color: #333333; color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; font-size: 16px; transition: background-color 0.3s; } .alert-footer button:hover { background-color: #555555; } .show-alert { opacity: 1; visibility: visible; } .show-alert2 { width: auto; height: 50px; background: #333333; border: none; outline: none; color: #fff; border-radius: 5px; padding-left: 3%; padding-right: 3%; opacity: 1; visibility: visible; cursor: pointer; font-size: 1.2em; } </style> </head> <body> <div class="alert-container" id="alertContainer"> <div class="alert"> <div class="alert-header"> <span class="icon">⚡</span> <span>Minimalist Alert</span> </div> <div class="alert-body"> This is a minimalist alert with pop-in animation. </div> <div class="alert-footer"> <button type="button" onclick="closeAlert()">Close</button> </div> </div> </div> <button type="button" onclick="showAlert()" class="show-alert2">Show Minimalist Alert</button> <script> function showAlert() { document.getElementById('alertContainer').classList.add('show-alert'); } function closeAlert() { document.getElementById('alertContainer').classList.remove('show-alert'); } </script> </body> </html>