Minimalist Blurred Modal - 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 Blurred Modal</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(to right, #f0f0f0, #d0d0d0); margin: 0; padding: 0; display: flex; justify-content: center; align-items: center; height: 100vh; } .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); display: none; justify-content: center; align-items: center; } .modal { background: rgba(255, 255, 255, 0.5); border-radius: 20px; box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2); width: 65%; max-width: 550px; padding: 20px; position: relative; animation: fadeIn 0.4s ease; } .modal-header { display: flex; justify-content: space-between; align-items: center; } .modal-title { font-size: 1.5rem; color: #333; } .modal-close { background: none; border: none; font-size: 1.5rem; color: #333; cursor: pointer; transition: color 0.3s ease; } .modal-close:hover { color: #64b5f6; } .modal-body { margin-top: 15px; font-size: 1rem; color: #000; } .modal-footer { display: flex; justify-content: flex-end; margin-top: 15px; } .modal-button { background: linear-gradient(to right, #64b5f6, #2196f3); border: none; color: #fff; padding: 12px 20px; border-radius: 5px; font-size: 1rem; cursor: pointer; transition: background 0.3s ease, transform 0.3s ease; } .modal-button:hover { background: linear-gradient(to right, #2196f3, #64b5f6); transform: scale(1.05); } @keyframes fadeIn { from { opacity: 0; transform: translateY(-15px); } to { opacity: 1; transform: translateY(0); } } </style> </head> <body> <button id="openModalBtn" class="modal-button">Open Minimalist Modal</button> <div id="modalOverlay" class="modal-overlay"> <div class="modal"> <div class="modal-header"> <h2 class="modal-title">Minimalist Blurred Modal</h2> <button id="closeModalBtn" class="modal-close"><i class="fas fa-times"></i></button> </div> <div class="modal-body"> <p>Welcome to the Minimalist Blurred Modal. This design is clean and simple, featuring a blurred glass effect with a smooth gradient background.</p> </div> <div class="modal-footer"> <button class="modal-button">Confirm</button> </div> </div> </div> <script> document.getElementById('openModalBtn').addEventListener('click', function() { document.getElementById('modalOverlay').style.display = 'flex'; }); document.getElementById('closeModalBtn').addEventListener('click', function() { document.getElementById('modalOverlay').style.display = 'none'; }); window.addEventListener('click', function(event) { if (event.target === document.getElementById('modalOverlay')) { document.getElementById('modalOverlay').style.display = 'none'; } }); </script> </body> </html>