Elegant 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>Elegant 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; } .elegant-sidebar { width: 250px; height: 100vh; background: #fff; color: #333; display: flex; flex-direction: column; align-items: center; position: relative; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); transition: width 0.5s ease; } .elegant-sidebar:hover { width: 300px; } .elegant-sidebar .logo { font-size: 2em; margin: 20px 0; color: #af4261; } .elegant-sidebar .nav-links { width: 100%; list-style: none; padding: 0; } .elegant-sidebar .nav-links li { width: 100%; } .elegant-sidebar .nav-links li a { text-decoration: none; color: #333; padding: 15px; display: flex; align-items: center; transition: background 0.3s ease; } .elegant-sidebar .nav-links li a:hover { background: #f3f3f3; } .elegant-sidebar .nav-links li a i { font-size: 1.5em; margin-right: 15px; color: #af4261; } .elegant-sidebar .nav-links li a span { opacity: 1; transition: opacity 0.5s ease; } .elegant-sidebar:hover .nav-links li a span { opacity: 1; } @media (max-width: 768px) { .elegant-sidebar { width: 100px; } .elegant-sidebar:hover { width: 100px; } .elegant-sidebar .nav-links li a span { display: none; } } </style> </head> <body> <div class="elegant-sidebar"> <div class="logo">Elegant</div> <ul class="nav-links"> <li><a href="#"><i class="fas fa-home"></i><span>Home</span></a></li> <li><a href="#"><i class="fas fa-user"></i><span>Profile</span></a></li> <li><a href="#"><i class="fas fa-bell"></i><span>Notifications</span></a></li> <li><a href="#"><i class="fas fa-cog"></i><span>Settings</span></a></li> <li><a href="#"><i class="fas fa-sign-out-alt"></i><span>Logout</span></a></li> </ul> </div> <script src="https://kit.fontawesome.com/a076d05399.js" crossorigin="anonymous"></script> </body> </html>