F a Qs Page Component - Copy this Html, Tailwind Component to your project
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>{{ question.question }}</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"> <style> .btn-primary { transition: transform 0.3s ease, box-shadow 0.3s ease; } .btn-primary:hover { transform: scale(1.1); /* Scale up the button slightly */ box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.2); /* Add a subtle shadow */ } </style> </head> <body> <div id="faq-detail-container" class="container mt-5 animate__animated animate__fadeIn"> <h1>{{ question.question }}</h1> <p>{{ question.article.answer|safe }}</p> <!-- Display the answer with CKEditor formatting --> <a href="{% url 'faq_list' %}" class="btn btn-primary">Back to FAQ</a> </div> <script> $(document).ready(function() { $('a').on('click', function(event) { event.preventDefault(); // Prevent immediate page load var targetUrl = $(this).attr('href'); // Get the link URL // Add fadeOut animation $('#faq-detail-container').addClass('animate__fadeOut'); // Wait for the animation to complete before navigating setTimeout(function() { window.location.href = targetUrl; }, 500); // Adjust the timeout based on animation duration }); }); </script> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
