Social Media Posts Section - 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"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" /> <script src="https://kit.fontawesome.com/f2c67a1c6b.js" crossorigin="anonymous"></script> <title>Social Media Posts Section</title> <style> body { font-family: 'Arial', sans-serif; background: linear-gradient(135deg, #f6d365 0%, #fda085 100%); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .post-container { display: flex; flex-direction: column; gap: 20px; width: 80%; max-width: 600px; } .post { background: white; border-radius: 15px; box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1); padding: 20px; transition: transform 0.3s, box-shadow 0.3s; } .post:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2); } .post-header { display: flex; align-items: center; gap: 15px; } .post-header img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; } .post-header h2 { margin: 0; font-size: 1.5em; } .post-body { margin-top: 15px; font-size: 1em; line-height: 1.6; } .post-body p { margin: 0; } .post-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; } .post-footer .icons { display: flex; gap: 10px; } .post-footer .icons i { font-size: 1.2em; cursor: pointer; transition: color 0.3s; } .post-footer .icons i:hover { color: #fda085; } .post-footer .time { font-size: 0.8em; color: #888; } @keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } } .post { animation: fadeIn 0.5s ease-in-out; } </style> <script> document.addEventListener("DOMContentLoaded", function() { const likeButtons = document.querySelectorAll(".like-btn"); likeButtons.forEach(button => { button.addEventListener("click", () => { button.classList.toggle("liked"); }); }); }); </script> </head> <body> <div class="post-container"> <div class="post"> <div class="post-header"> <img src="https://via.placeholder.com/50" alt="User"> <h2>User Name</h2> </div> <div class="post-body"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac venenatis quam, non hendrerit lacus. 🥳✨</p> </div> <div class="post-footer"> <div class="icons"> <i class="like-btn fas fa-heart"></i> <i class="fas fa-comment"></i> <i class="fas fa-share"></i> </div> <div class="time">5 minutes ago</div> </div> </div> <div class="post"> <div class="post-header"> <img src="https://via.placeholder.com/50" alt="User"> <h2>User Name</h2> </div> <div class="post-body"> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac venenatis quam, non hendrerit lacus. 🎉🌟</p> </div> <div class="post-footer"> <div class="icons"> <i class="like-btn fas fa-heart"></i> <i class="fas fa-comment"></i> <i class="fas fa-share"></i> </div> <div class="time">10 minutes ago</div> </div> </div> <!-- Add more posts as needed --> </div> <script src="https://kit.fontawesome.com/a076d05399.js"></script> </body> </html>