Frosted Glass 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>Frosted Glass Alert</title> <style> body { font-family: Arial, sans-serif; background-color: #e0f7fa; 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: rgba(255, 255, 255, 0.8); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-radius: 15px; padding: 25px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3); text-align: center; animation: scaleUp 0.5s ease-out; } @keyframes scaleUp { from { transform: scale(0.8); opacity: 0; } to { transform: scale(1); opacity: 1; } } .alert-header { display: flex; justify-content: center; align-items: center; font-size: 26px; font-weight: bold; margin-bottom: 15px; } .alert-header .icon { margin-right: 10px; } .alert-body { font-size: 20px; margin-bottom: 20px; } .alert-footer { display: flex; justify-content: center; } .alert-footer button { background-color: #ff4081; 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: #d81b60; } .show-alert { opacity: 1; visibility: visible; } .show-alert2 { width: auto; height: 50px; background: #d81b60; 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>Frosted Glass Alert</span> </div> <div class="alert-body"> This is a frosted glass style alert with smooth animations. </div> <div class="alert-footer"> <button type="button" onclick="closeAlert()">Close</button> </div> </div> </div> <button type="button" onclick="showAlert()" class="show-alert2">Show Frosted Glass Alert</button> <script> function showAlert() { document.getElementById('alertContainer').classList.add('show-alert'); } function closeAlert() { document.getElementById('alertContainer').classList.remove('show-alert'); } </script> </body> </html>