Professional Sidebar - 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>Professional Sidebar</title> <style> body { font-family: 'Arial', sans-serif; margin: 0; padding: 0; background: linear-gradient(135deg, #f3ec78, #af4261); display: flex; height: 100vh; overflow: hidden; } .sidebar { width: 250px; height: 100vh; background: #333; color: #fff; display: flex; flex-direction: column; align-items: center; position: relative; transition: all 0.5s ease; } .sidebar:hover { width: 300px; } .sidebar .logo { font-size: 2em; margin: 20px 0; animation: bounce 1s infinite alternate; } .sidebar .nav-links { width: 100%; list-style: none; padding: 0; } .sidebar .nav-links li { width: 100%; } .sidebar .nav-links li a { text-decoration: none; color: #fff; padding: 15px; display: flex; align-items: center; transition: background 0.3s ease; } .sidebar .nav-links li a:hover { background: #555; } .sidebar .nav-links li a i { font-size: 1.5em; margin-right: 15px; } .sidebar .nav-links li a span { opacity: 1; transition: opacity 0.5s ease; } .sidebar:hover .nav-links li a span { opacity: 1; } .sidebar .nav-links li a .emoji { margin-left: auto; } @keyframes bounce { 0% { transform: translateY(0); } 100% { transform: translateY(-10px); } } @keyframes slideIn { from { transform: translateX(-100%); } to { transform: translateX(0); } } @media (max-width: 768px) { .sidebar { width: 100px; } .sidebar:hover { width: 100px; } .sidebar .nav-links li a span { display: none; } } </style> </head> <body> <div class="sidebar"> <div class="logo">🌟 MyLogo</div> <ul class="nav-links"> <li><a href="#"><i class="fas fa-home"></i><span>Home</span><span class="emoji">🏠</span></a></li> <li><a href="#"><i class="fas fa-user"></i><span>Profile</span><span class="emoji">👤</span></a></li> <li><a href="#"><i class="fas fa-bell"></i><span>Notifications</span><span class="emoji">🔔</span></a></li> <li><a href="#"><i class="fas fa-cog"></i><span>Settings</span><span class="emoji">⚙️</span></a></li> <li><a href="#"><i class="fas fa-sign-out-alt"></i><span>Logout</span><span class="emoji">🚪</span></a></li> </ul> </div> <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script> <script> document.querySelectorAll('.nav-links li a').forEach(link => { link.addEventListener('mouseenter', () => { link.querySelector('.emoji').style.animation = 'slideIn 0.5s forwards'; }); link.addEventListener('mouseleave', () => { link.querySelector('.emoji').style.animation = ''; }); }); </script> </body> </html>