Modern Friends 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>Modern Friends Sidebar</title> <style> body { margin: 0; font-family: 'Arial', sans-serif; background: #fafafa; } .sidebar { position: fixed; left: 0; top: 0; height: 100%; width: 300px; background: linear-gradient(to bottom, #3498db, #8e44ad); color: #fff; transition: transform 0.3s ease-in-out; transform: translateX(-100%); overflow-y: auto; } .sidebar.active { transform: translateX(0); } .sidebar-header { padding: 20px; text-align: center; font-size: 24px; font-weight: bold; } .sidebar-header .toggle-btn { position: absolute; right: 20px; top: 20px; cursor: pointer; } .sidebar-header .toggle-btn span { font-size: 18px; } .friends-list { padding: 20px; } .friend { display: flex; align-items: center; margin-bottom: 15px; padding: 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.2); transition: background 0.3s; } .friend:hover { background: rgba(255, 255, 255, 0.4); } .friend img { width: 50px; height: 50px; border-radius: 50%; margin-right: 15px; } .friend-info { flex: 1; } .friend-info h4 { margin: 0; font-size: 18px; } .friend-info p { margin: 5px 0 0; font-size: 14px; } .open-sidebar { position: absolute; left: 0; top: 50%; transform: translateY(-50%); cursor: pointer; padding: 10px; background: #3498db; color: #fff; border-radius: 0 5px 5px 0; transition: background 0.3s; } .open-sidebar:hover { background: #2980b9; } </style> </head> <body> <div class="open-sidebar" id="open-sidebar"> <span>☰ Friends</span> </div> <div class="sidebar" id="sidebar"> <div class="sidebar-header"> Friends <div class="toggle-btn" id="toggle-btn"> <span>✕</span> </div> </div> <div class="friends-list"> <div class="friend"> <img src="https://via.placeholder.com/50" alt="Friend 1"> <div class="friend-info"> <h4>John Doe</h4> <p>Online</p> </div> </div> <div class="friend"> <img src="https://via.placeholder.com/50" alt="Friend 2"> <div class="friend-info"> <h4>Jane Smith</h4> <p>Offline</p> </div> </div> <!-- Add more friends here --> </div> </div> <script> document.getElementById('open-sidebar').addEventListener('click', function() { document.getElementById('sidebar').classList.add('active'); }); document.getElementById('sidebar').addEventListener('click', function() { document.getElementById('sidebar').classList.remove('active'); }); </script> </body> </html>