Pastel Colors Collapse - 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>Pastel Colors Collapse</title> <style> body { font-family: 'Arial', sans-serif; background-color: #faf3f3; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; color: #333; } .collapsible-container { width: 80%; max-width: 600px; margin: 20px; background: #ffd1dc; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); } .collapsible-header { display: flex; justify-content: space-between; align-items: center; background-color: #ff9aa2; padding: 15px 20px; cursor: pointer; color: #fff; font-size: 1.25rem; font-weight: bold; } .collapsible-header:hover { background-color: #ff6f91; } .collapsible-header:after { content: '➕'; font-size: 1.5rem; transition: transform 0.3s ease; } .collapsible-header.collapsed:after { transform: rotate(45deg); } .collapsible-content { display: none; padding: 20px; background-color: #ffe4e6; color: #333; border-top: 1px solid #ff9aa2; } .collapsible-content p { margin: 0; font-size: 1rem; line-height: 1.5; } .collapsible-content img { width: 100%; border-radius: 10px; margin-top: 10px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); } .animate-slide { animation: slideDown 0.5s forwards; } @keyframes slideDown { 0% { opacity: 0; transform: translateY(-20px); } 100% { opacity: 1; transform: translateY(0); } } </style> </head> <body> <div class="collapsible-container"> <div class="collapsible-header"> <span>Click to Expand <span>✨</span></span> <i class="icon"></i> </div> <div class="collapsible-content"> <p>Welcome to this pastel colors styled collapsible section! 🎨 Enjoy the soft and soothing color palette with smooth animations.</p> <img src="https://via.placeholder.com/400x200" alt="Placeholder Image"> </div> </div> <script> document.addEventListener("DOMContentLoaded", () => { const header = document.querySelector(".collapsible-header"); const content = document.querySelector(".collapsible-content"); header.addEventListener("click", () => { if (content.style.display === "block") { content.style.display = "none"; header.classList.remove("collapsed"); } else { content.style.display = "block"; content.classList.add("animate-slide"); header.classList.add("collapsed"); } }); }); </script> </body> </html>