Stylish 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>Stylish Friend Request Card</title> <style> body { font-family: 'Arial', sans-serif; background-color: #e0e0e0; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .card { width: 320px; border-radius: 15px; background: linear-gradient(145deg, #f0f0f0, #cfcfcf); box-shadow: 5px 5px 15px rgba(0, 0, 0, 0.2); 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: 160px; object-fit: cover; border-bottom: 2px solid #fff; } .card-header .avatar { width: 90px; height: 90px; border-radius: 50%; border: 3px solid #fff; position: absolute; bottom: -45px; left: 20px; background: #fff; } .card-body { padding: 30px; text-align: center; background: #fff; } .card-body h3 { margin: 50px 0 10px; font-size: 22px; color: #333; } .card-body p { margin: 0; color: #777; } .card-footer { display: flex; justify-content: space-between; padding: 15px 30px; border-top: 1px solid #ddd; background: #f9f9f9; } .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: #fff; } .card-footer .accept:hover { background-color: #388e3c; } .card-footer .decline { background-color: #f44336; color: #fff; } .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 fadeIn { from { opacity: 0; } to { opacity: 1; } } .emoji { position: absolute; top: 15px; right: 15px; font-size: 35px; animation: fadeIn 0.5s 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>Jane Smith</h3> <p>3 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>