Social Media 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>Social Media Friends Sidebar</title> <style> body { margin: 0; font-family: 'Arial', sans-serif; background: #f0f2f5; overflow-x: hidden; } .sidebar { position: fixed; left: 0; top: 0; height: 100%; width: 300px; background: #fff; box-shadow: 2px 0 5px rgba(0,0,0,0.1); transition: transform 0.3s ease-in-out; transform: translateX(-100%); z-index: 1000; } .sidebar.active { transform: translateX(0); } .sidebar-header { padding: 20px; background: #0078ff; color: #fff; text-align: center; font-size: 24px; font-weight: bold; position: relative; } .sidebar-header .toggle-btn { position: absolute; right: 20px; top: 20px; cursor: pointer; } .sidebar-header .toggle-btn span { font-size: 18px; } .friends-list { padding: 20px; overflow-y: auto; height: calc(100% - 64px); } .friend { display: flex; align-items: center; margin-bottom: 15px; padding: 10px; border-radius: 10px; background: #f5f5f5; transition: transform 0.3s, background 0.3s; } .friend:hover { transform: scale(1.05); background: #0078ff; color: #fff; } .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; color: #666; } .friend-info .status { font-size: 12px; color: #0078ff; } .emojis { display: flex; margin-left: auto; } .emojis span { font-size: 24px; margin-left: 10px; cursor: pointer; transition: transform 0.3s; } .emojis span:hover { transform: rotate(20deg) scale(1.2); } .open-sidebar { position: absolute; left: 0; top: 50%; transform: translateY(-50%); cursor: pointer; padding: 10px; background: #0078ff; color: #fff; border-radius: 0 5px 5px 0; transition: background 0.3s; } .open-sidebar:hover { background: #005bb5; } </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 class="status">❤️</div> </div> <div class="emojis"> <span>😊</span> <span>👍</span> </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 class="status">💔</div> </div> <div class="emojis"> <span>😢</span> <span>👎</span> </div> </div> <!-- Add more friends here --> </div> </div> <script> document.getElementById('open-sidebar').addEventListener('click', function() { document.getElementById('sidebar').classList.add('active'); }); document.getElementById('toggle-btn').addEventListener('click', function() { document.getElementById('sidebar').classList.remove('active'); }); </script> </body> </html>