From 8592b8d3419503370c1754b872034f2f7cc37859 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 8 Dec 2025 07:27:54 +0000 Subject: [PATCH] Fix FAQ expanders and quote form JavaScript MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix FAQ accordion: change from display:none to max-height animation - Add .active class selectors alongside [aria-expanded="true"] - Fix quote.php: add missing closing brackets for event listeners - Fix Promise chain indentation in quote form submission 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- assets/css/main.css | 19 ++++++++++++++----- quote.php | 16 +++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/assets/css/main.css b/assets/css/main.css index a635b56..c7f3d0b 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -2543,7 +2543,8 @@ a:focus-visible { transform: translateX(5px); } -.faq-question[aria-expanded="true"] { +.faq-question[aria-expanded="true"], +.faq-question.active { background: #179e83; color: white; } @@ -2554,19 +2555,27 @@ a:focus-visible { transition: transform 0.3s ease; } -.faq-question[aria-expanded="true"] .faq-icon { - transform: rotate(45deg); +.faq-question[aria-expanded="true"] .faq-icon, +.faq-question.active .faq-icon { + transform: rotate(180deg); } .faq-answer { - display: none; background: white; - padding: 20px; + padding: 0 20px; + max-height: 0; + overflow: hidden; + transition: max-height 0.3s ease, padding 0.3s ease; border-radius: 0 0 8px 8px; border-top: 1px solid #e1e5e9; margin-bottom: 20px; } +.faq-answer.active { + padding: 20px; + max-height: 1000px; +} + .faq-answer p { margin-bottom: 15px; color: #666; diff --git a/quote.php b/quote.php index c3a8e2b..42077dd 100644 --- a/quote.php +++ b/quote.php @@ -966,13 +966,15 @@ $breadcrumbs = [ showMessage('error', 'There was a problem with your submission:', errorMessages); } }) - .catch(error => { - console.error('Error:', error); - showMessage('error', 'Connection Error', 'There was an error sending your quote request. Please check your internet connection and try again, or contact us directly at info@ukdataservices.co.uk'); - }) - .finally(() => { - submitButton.textContent = originalText; - submitButton.disabled = false; + .catch(error => { + console.error('Error:', error); + showMessage('error', 'Connection Error', 'There was an error sending your quote request. Please check your internet connection and try again, or contact us directly at info@ukdataservices.co.uk'); + }) + .finally(() => { + submitButton.textContent = originalText; + submitButton.disabled = false; + }); + }); }); }); });