Fireworks 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>Fireworks Modal</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(to bottom, #ff0, #f00); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); justify-content: center; align-items: center; animation: fadeIn 0.5s; } .modal-content { background: rgba(255, 255, 255, 0.9); border-radius: 20px; width: 450px; padding: 20px; text-align: center; position: relative; box-shadow: 0 0 20px #f00; animation: explode 1s infinite; } .modal-content h2 { font-size: 2em; margin: 0; color: #f00; } .modal-content p { font-size: 1.2em; color: #f00; margin: 20px 0; } .modal-content .close-btn { position: absolute; top: 20px; right: 20px; background: transparent; border: none; font-size: 1.5em; cursor: pointer; color: #f00; } .open-modal-btn { background: #f00; border: none; color: #ff0; padding: 15px 30px; border-radius: 30px; font-size: 1.2em; cursor: pointer; display: flex; align-items: center; box-shadow: 0 0 10px #f00; animation: pulse 2s infinite; } .open-modal-btn i { margin-right: 10px; font-size: 1.5em; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes explode { 0% { transform: scale(1); } 50% { transform: scale(1.1); } 100% { transform: scale(1); } } @keyframes pulse { 0% { box-shadow: 0 0 10px #f00; } 50% { box-shadow: 0 0 20px #f00; } 100% { box-shadow: 0 0 10px #f00; } } </style> </head> <body> <button class="open-modal-btn"><i>🎆</i> Open Modal</button> <div class="modal" id="myModal"> <div class="modal-content"> <button class="close-btn" id="closeBtn">✖️</button> <h2>Fireworks Modal</h2> <p>This is a fireworks themed modal with an exploding animation.</p> </div> </div> <script> const modal = document.getElementById('myModal'); const openModalBtn = document.querySelector('.open-modal-btn'); const closeBtn = document.getElementById('closeBtn'); openModalBtn.addEventListener('click', () => { modal.style.display = 'flex'; }); closeBtn.addEventListener('click', () => { modal.style.display = 'none'; }); window.addEventListener('click', (event) => { if (event.target === modal) { modal.style.display = 'none'; } }); </script> </body> </html>