Minimalist 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>Minimalist Friend Request Card</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f0f0f0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .card { width: 310px; border-radius: 15px; background: #ffffff; box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); overflow: hidden; position: relative; transition: transform 0.3s ease-in-out; } .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: 85px; height: 85px; border-radius: 50%; border: 3px solid #ffffff; position: absolute; bottom: -42.5px; left: 15px; background: #ffffff; } .card-body { padding: 25px; text-align: center; } .card-body h3 { margin: 50px 0 10px; font-size: 22px; color: #333333; } .card-body p { margin: 0; color: #777777; } .card-footer { display: flex; justify-content: space-between; padding: 15px 25px; border-top: 1px solid #eeeeee; } .card-footer button { border: none; padding: 12px 20px; border-radius: 25px; cursor: pointer; transition: background-color 0.3s, color 0.3s; } .card-footer .accept { background-color: #4caf50; color: #ffffff; } .card-footer .accept:hover { background-color: #388e3c; } .card-footer .decline { background-color: #f44336; color: #ffffff; } .card-footer .decline:hover { background-color: #d32f2f; } .card-footer .accept, .card-footer .decline { display: flex; align-items: center; justify-content: center; } .card-footer .accept i, .card-footer .decline i { margin-right: 8px; } @keyframes swing { 0% { transform: rotate(0deg); } 25% { transform: rotate(10deg); } 50% { transform: rotate(0deg); } 75% { transform: rotate(-10deg); } 100% { transform: rotate(0deg); } } .emoji { position: absolute; top: 10px; right: 10px; font-size: 35px; animation: swing 1s infinite; } </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>Sophia Lee</h3> <p>6 Mutual Friends</p> </div> <div class="card-footer"> <button class="accept"><i class="fas fa-check-circle"></i>Accept</button> <button class="decline"><i class="fas fa-times-circle"></i>Decline</button> </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 = '#4caf50'; }); document.querySelector('.decline').addEventListener('click', function() { let emoji = document.querySelector('.emoji'); emoji.textContent = '😢'; emoji.style.color = '#f44336'; }); </script> </body> </html>