Social Media Friend Request Card - 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 Friend Request Card</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f0f2f5; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .card { width: 300px; border-radius: 10px; background: #ffffff; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); overflow: hidden; position: relative; transition: transform 0.3s; } .card:hover { transform: translateY(-10px); } .card-header { position: relative; overflow: hidden; } .card-header img { width: 100%; height: 150px; object-fit: cover; } .card-header .avatar { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #fff; position: absolute; bottom: -40px; left: 20px; background: #fff; } .card-body { padding: 20px; text-align: center; } .card-body h3 { margin: 30px 0 10px; font-size: 20px; color: #333; } .card-body p { margin: 0; color: #777; } .card-footer { display: flex; justify-content: space-between; padding: 10px 20px; border-top: 1px solid #eee; } .card-footer button { border: none; padding: 10px; border-radius: 5px; cursor: pointer; transition: background-color 0.3s, color 0.3s; } .card-footer .accept { background-color: #28a745; color: #fff; } .card-footer .accept:hover { background-color: #218838; } .card-footer .decline { background-color: #dc3545; color: #fff; } .card-footer .decline:hover { background-color: #c82333; } .card-footer .accept, .card-footer .decline { display: flex; align-items: center; justify-content: center; } .card-footer .accept i, .card-footer .decline i { margin-right: 5px; } @keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } } .emoji { position: absolute; top: -10px; right: -10px; font-size: 40px; animation: pop 0.3s forwards; } </style> </head> <body> <div class="card"> <div class="card-header"> <img src="profile.png" alt="cover photo"> <img src="profile.png" alt="avatar" class="avatar"> </div> <div class="card-body"> <h3>John Doe</h3> <p>2 Mutual Friends</p> </div> <div class="card-footer"> <button class="accept"><i class="fas fa-user-check"></i>Accept</button> <button class="decline"><i class="fas fa-user-times"></i>Decline</button> </div> <!-- <div class="emoji">🎉</div> --> </div> <script src="https://kit.fontawesome.com/a076d05399.js"></script> <script> document.querySelector('.accept').addEventListener('click', function() { let emoji = document.querySelector('.emoji'); emoji.textContent = '😊'; emoji.style.color = '#28a745'; }); document.querySelector('.decline').addEventListener('click', function() { let emoji = document.querySelector('.emoji'); emoji.textContent = '😢'; emoji.style.color = '#dc3545'; }); </script> </body> </html>