Modern Overlay - 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>Modern Overlay</title> <style> body, html { height: 100%; margin: 0; font-family: 'Arial', sans-serif; background: #f0f0f0; display: flex; justify-content: center; align-items: center; } .overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to right, #ff758c, #ff7eb3); display: none; z-index: 1000; animation: fadeIn 0.7s ease-in-out forwards; } @keyframes fadeIn { from {opacity: 0;} to {opacity: 1;} } .overlay-content { position: relative; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; color: #fff; } .overlay-content h1 { font-size: 3em; margin: 0; animation: flipInX 1s ease-in-out forwards; } @keyframes flipInX { from {transform: rotateX(90deg); opacity: 0;} to {transform: rotateX(0); opacity: 1;} } .overlay-content p { font-size: 1.5em; margin: 20px 0; animation: flipInX 1s ease-in-out forwards; animation-delay: 0.3s; } .close-btn { position: absolute; top: 20px; right: 20px; font-size: 2em; cursor: pointer; color: #fff; animation: fadeIn 1.5s ease-in-out forwards; } .close-btn:hover { color: #ff4c4c; } .centered-button { padding: 10px 20px; font-size: 1.2em; background: linear-gradient(to right, #ff758c, #ff7eb3); color: #fff; border: none; cursor: pointer; transition: background 0.3s; } .centered-button:hover { background: linear-gradient(to right, #ff5a6f, #ff6990); } </style> </head> <body> <div class="overlay" id="modernOverlay"> <div class="overlay-content"> <h1>Modern Overlay 🚀</h1> <p>Sleek and contemporary overlay design</p> </div> <span class="close-btn" onclick="closeModernOverlay()">×</span> </div> <button class="centered-button" onclick="openModernOverlay()">Open Modern Overlay</button> <script> function openModernOverlay() { document.getElementById('modernOverlay').style.display = 'block'; } function closeModernOverlay() { document.getElementById('modernOverlay').style.display = 'none'; } </script> </body> </html>