Toggle navigation
☰
HTML
CSS
Scripting
Database
<!doctype html> <title>Example</title> <style> body { display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; font-family: sans-serif; background-color: #f0f0f0; } .staggered-list { list-style: none; padding: 0; margin: 0; width: 200px; background: #fff; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); overflow: hidden; } .staggered-list li { padding: 15px 20px; border-bottom: 1px solid #eee; opacity: 0; transform: translateX(-20px); } .staggered-list li:last-child { border-bottom: none; } /* The .show class will be toggled by JS on the parent <ul> */ .staggered-list.show li { animation: slideIn 0.4s ease forwards; } .staggered-list.show li:nth-child(1) { animation-delay: 0.1s; } .staggered-list.show li:nth-child(2) { animation-delay: 0.2s; } .staggered-list.show li:nth-child(3) { animation-delay: 0.3s; } .staggered-list.show li:nth-child(4) { animation-delay: 0.4s; } @keyframes slideIn { to { opacity: 1; transform: translateX(0); } } @media (prefers-reduced-motion: reduce) { .staggered-list.show li { animation: simpleFade 0.3s ease forwards; } @keyframes simpleFade { to { opacity: 1; transform: translateX(-20px); } } } </style> <div> <button onclick="document.getElementById('demoList').classList.toggle('show');" style="margin-bottom: 15px; padding: 10px;">Toggle Menu Reveal</button> <ul id="demoList" class="staggered-list"> <li>Dashboard</li> <li>Profile</li> <li>Settings</li> <li>Logout</li> </ul> </div>