Futuristic Hologram Dropdown - 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>Futuristic Hologram Dropdown</title> <style> body { margin: 0; font-family: Arial, sans-serif; background: linear-gradient(to bottom right, #3a1c71, #d76d77); display: flex; justify-content: center; align-items: center; height: 100vh; } .dropdown { position: relative; display: inline-block; } .dropdown-button { background: linear-gradient(to right, #00c6ff, #0072ff); border: none; padding: 12px 24px; width: 270px; font-size: 18px; color: #fff; cursor: pointer; text-shadow: 0 0 5px rgba(0, 198, 255, 0.8); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3); transition: background 0.3s ease, transform 0.3s ease; } .dropdown-button:hover { background: linear-gradient(to right, #0072ff, #00c6ff); transform: scale(1.1); } .dropdown-content { display: none; position: absolute; background: rgba(0, 0, 0, 0.6); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4); margin-top: 10px; padding: 15px; width: 240px; transition: opacity 0.3s ease, transform 0.3s ease; } .dropdown-content.show { display: block; opacity: 1; transform: translateY(0); } .dropdown-content.hide { opacity: 0; transform: translateY(-10px); } .dropdown-content a { text-decoration: none; color: #fff; display: flex; align-items: center; padding: 12px; transition: background 0.3s ease; } .dropdown-content a:hover { background: rgba(255, 255, 255, 0.2); } .dropdown-content a i { margin-right: 12px; } </style> </head> <body> <div class="dropdown"> <button class="dropdown-button">Hologram Dropdown</button> <div class="dropdown-content"> <a href="#"><i class="fa fa-home"></i> Home</a> <a href="#"><i class="fa fa-user"></i> Profile</a> <a href="#"><i class="fa fa-cog"></i> Settings</a> <a href="#"><i class="fa fa-sign-out-alt"></i> Logout</a> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/js/all.min.js"></script> <script> document.querySelector('.dropdown-button').addEventListener('click', function() { const dropdownContent = document.querySelector('.dropdown-content'); const isVisible = dropdownContent.classList.contains('show'); if (isVisible) { dropdownContent.classList.remove('show'); dropdownContent.classList.add('hide'); } else { dropdownContent.classList.remove('hide'); dropdownContent.classList.add('show'); dropdownContent.style.animation = 'fadeInUp 0.3s forwards'; } }); window.addEventListener('click', function(event) { if (!event.target.matches('.dropdown-button')) { const dropdowns = document.querySelectorAll('.dropdown-content'); dropdowns.forEach(function(dropdown) { if (dropdown.classList.contains('show')) { dropdown.classList.remove('show'); dropdown.classList.add('hide'); dropdown.style.animation = 'fadeOutDown 0.3s forwards'; } }); } }); </script> </body> </html>