Retro Select Box - 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 Select Box</title> <style> body { font-family: 'Courier New', Courier, monospace; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, #f7b42c, #fc575e); } .retro-select-wrapper { position: relative; display: inline-block; width: 220px; } .retro-select { position: relative; background-color: #fff; border: 2px solid #000; border-radius: 0; padding: 12px 15px; cursor: pointer; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; } .retro-select:hover { transform: scale(1.05); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); } .retro-select span { font-size: 16px; } .retro-select i { font-size: 18px; transition: transform 0.3s ease; } .retro-select.open i { transform: rotate(180deg); } .retro-options { position: absolute; top: 100%; left: 0; width: 100%; background-color: #fff; border-radius: 0; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); overflow: hidden; max-height: 0; opacity: 0; visibility: hidden; transition: all 0.3s ease; z-index: 10; } .retro-select.open + .retro-options { max-height: 250px; opacity: 1; visibility: visible; } .retro-options div { padding: 12px 15px; cursor: pointer; transition: background-color 0.3s ease; display: flex; align-items: center; gap: 8px; } .retro-options div:hover { background-color: #f7b42c; } .retro-options div span { font-size: 16px; } .retro-options div i { font-size: 18px; } .rotate-in { animation: rotateIn 0.5s ease; } @keyframes rotateIn { from { opacity: 0; transform: rotate(-10deg); } to { opacity: 1; transform: rotate(0); } } </style> </head> <body> <div class="retro-select-wrapper"> <div class="retro-select"> <span>Select an option</span> <!-- <i>⬇️</i> --> </div> <div class="retro-options"> <div class="rotate-in" data-value="1"> <i>🕹️</i><span>Option 1</span> </div> <div class="rotate-in" data-value="2"> <i>📼</i><span>Option 2</span> </div> <div class="rotate-in" data-value="3"> <i>💾</i><span>Option 3</span> </div> </div> </div> <script> const retroSelect = document.querySelector('.retro-select'); const retroOptions = document.querySelector('.retro-options'); const optionsRetro = document.querySelectorAll('.retro-options div'); const selectedRetro = document.querySelector('.retro-select span'); retroSelect.addEventListener('click', () => { retroSelect.classList.toggle('open'); retroOptions.classList.toggle('open'); }); optionsRetro.forEach(option => { option.addEventListener('click', () => { selectedRetro.innerHTML = option.innerHTML; retroSelect.classList.remove('open'); retroOptions.classList.remove('open'); }); }); document.addEventListener('click', (e) => { if (!retroSelect.contains(e.target)) { retroSelect.classList.remove('open'); retroOptions.classList.remove('open'); } }); </script> </body> </html>