Retro Menu - 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>Retro Menu</title> <style> body { font-family: 'Courier New', monospace; background-color: #ffe4c4; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .retro-dropdown { position: relative; display: inline-block; } .retro-dropdown-toggle { background-color: #ff7f50; color: white; padding: 12px 24px; font-size: 16px; border: none; border-radius: 8px; cursor: pointer; display: flex; align-items: center; transition: background-color 0.3s ease; box-shadow: 0 0 10px #ff4500, 0 0 20px #ff4500, 0 0 30px #ff4500; } .retro-dropdown-toggle:hover { background-color: #ff6347; } .retro-dropdown-toggle .icon { margin-left: 10px; transition: transform 0.3s ease; } .retro-dropdown-toggle .icon.rotate { transform: rotate(180deg); } .retro-dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background-color: #fffaf0; border: 1px solid #ff7f50; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); border-radius: 8px; overflow: hidden; transition: max-height 0.3s ease, opacity 0.3s ease; max-height: 0; opacity: 0; z-index: 1000; } .retro-dropdown-menu.show { display: block; max-height: 400px; opacity: 1; } .retro-dropdown-menu-item { padding: 12px 24px; display: flex; align-items: center; transition: background-color 0.3s ease; cursor: pointer; } .retro-dropdown-menu-item:hover { background-color: #ffe4c4; } .retro-dropdown-menu-item .icon { margin-right: 10px; font-size: 18px; } .retro-dropdown-menu-item .text { font-size: 16px; } .retro-dropdown-menu-item .emoji { margin-left: auto; font-size: 20px; } </style> </head> <body> <div class="retro-dropdown"> <button class="retro-dropdown-toggle"> Retro Menu <span class="icon">âŧ</span> </button> <div class="retro-dropdown-menu"> <div class="retro-dropdown-menu-item"> <span class="icon">đ </span> <span class="text">Home</span> <span class="emoji">đļ</span> </div> <div class="retro-dropdown-menu-item"> <span class="icon">đ</span> <span class="text">Search</span> <span class="emoji">đ¸</span> </div> <div class="retro-dropdown-menu-item"> <span class="icon">đ§</span> <span class="text">Contact</span> <span class="emoji">đŦ</span> </div> <div class="retro-dropdown-menu-item"> <span class="icon">âī¸</span> <span class="text">Settings</span> <span class="emoji">đšī¸</span> </div> </div> </div> <script> document.querySelector('.retro-dropdown-toggle').addEventListener('click', function() { const dropdownMenu = document.querySelector('.retro-dropdown-menu'); const dropdownIcon = document.querySelector('.retro-dropdown-toggle .icon'); dropdownMenu.classList.toggle('show'); dropdownIcon.classList.toggle('rotate'); }); document.addEventListener('click', function(event) { const dropdown = document.querySelector('.retro-dropdown'); const dropdownMenu = document.querySelector('.retro-dropdown-menu'); const dropdownIcon = document.querySelector('.retro-dropdown-toggle .icon'); if (!dropdown.contains(event.target)) { dropdownMenu.classList.remove('show'); dropdownIcon.classList.remove('rotate'); } }); </script> </body> </html>