diff --git a/blocks/accordion/accordion.css b/blocks/accordion/accordion.css index 3553b75c..afa2c8ec 100644 --- a/blocks/accordion/accordion.css +++ b/blocks/accordion/accordion.css @@ -1,9 +1,10 @@ -main .accordion.faq-accordion { - padding: 10px 20px 46px; +main .accordion { + max-width: 980px; + margin: 0 auto; + padding: 10px 0; } main .accordion.faq-accordion>div { - font-family: var(--ff-myradpro-regular); border: 1px solid #dbdbdb; border-radius: 5px; } @@ -15,11 +16,18 @@ main .accordion.spacer.faq-accordion>div { main .accordion.faq-accordion .faq-question { cursor: pointer; - padding: 20px 0 11px 6px; - font-size: var(--body-font-size-l); + padding: 12px 20px; + font-size: 16px; + color: #0d233e; + font-weight: 700; + line-height: 1.1; text-align: left; } +main .accordion.faq-accordion .faq-question:hover { + color: #ec8f2d; +} + main .accordion.faq-accordion .faq-question.active { color: #ec8f2d; } @@ -32,9 +40,7 @@ main .accordion.faq-accordion .faq-question::before { font-variant: normal; font-weight: 400; line-height: 1; - padding-left: 0.5em; text-transform: none; - margin-right: 10px; } main .accordion.faq-accordion .faq-question.active::before { @@ -45,9 +51,7 @@ main .accordion.faq-accordion .faq-question.active::before { font-variant: normal; font-weight: 400; line-height: 1; - padding-left: 0.5em; text-transform: none; - margin-right: 10px; } @@ -65,45 +69,59 @@ main .section.green .accordion.faq-accordion a { } main .accordion.faq-accordion .faq-answer { - padding: 0 18px; - margin: 8px 20px; + padding: 0 20px; display: none; overflow: hidden; - font-size: var(--body-font-size-s); + font-size: 16px; max-height: 0; - transition: max-height 0.2s ease-out; + transition: all 0.2s ease-in-out; text-align: left; - } main .accordion.faq-accordion .faq-answer p { - font-size: var(--body-font-size-s); + font-size: 16px; } main .accordion.faq-accordion .faq-answer ul { - list-style-type: square; + list-style-type: none; +} + +main .accordion.faq-accordion .faq-answer ul li::before { + color: #ec8f2d; + content: "\25A0"; + font-family: Arial; + font-size: 1em; + left: 0; + line-height: 100%; + position: absolute; + top: 0.45em; } main .accordion.faq-accordion .faq-answer.active { display: block; } - - - /* Tablet */ @media only screen and (min-width: 768px) { + main .accordion { + padding: 20px 0; + } + main .accordion.faq-accordion .faq-question { cursor: pointer; - padding: 20px 0 11px 6px; - font-size: var(--body-font-size-xxl); + padding: 12px 20px; + font-size: 16px; } } /* Desktop */ @media only screen and (min-width: 1030) { + main .accordion { + padding: 50px 0; + } + main .accordion.faq-accordion .faq-question { - font-size: var(--body-font-size-xl); + font-size: 16px; } } \ No newline at end of file diff --git a/blocks/accordion/accordion.js b/blocks/accordion/accordion.js index 03ac859a..435a685c 100644 --- a/blocks/accordion/accordion.js +++ b/blocks/accordion/accordion.js @@ -1,29 +1,33 @@ export default function decorate(block) { const faqRows = [...block.children]; block.classList.add('faq-accordion'); + faqRows.forEach((row) => { const faqQuestion = [...row.children][0]; + const faqAnswer = [...row.children][1]; + faqQuestion.classList.add('faq-question'); - faqQuestion.addEventListener('click', (e) => { - const openfaq = block.querySelector('.faq-question.active'); - openfaq.classList.remove('active'); - openfaq.nextElementSibling.classList.remove('active'); - openfaq.nextElementSibling.style.removeProperty('max-height'); - e.currentTarget.classList.toggle('active'); - e.currentTarget.nextElementSibling.classList.toggle('active'); - const faqAnswer = e.currentTarget.nextElementSibling; - if (faqAnswer.style.maxHeight) { - faqAnswer.style.removeProperty('max-height'); + faqAnswer.classList.add('faq-answer'); + + faqQuestion.addEventListener('click', () => { + const isActive = faqQuestion.classList.contains('active'); + + if (isActive) { + faqQuestion.classList.remove('active'); + faqAnswer.classList.remove('active'); + // Set max-height to 0 for smooth closing + faqAnswer.style.maxHeight = '0'; } else { + faqQuestion.classList.add('active'); + faqAnswer.classList.add('active'); + // Set max-height to scrollHeight for smooth opening faqAnswer.style.maxHeight = `${faqAnswer.scrollHeight}px`; } }); - const faqAnswer = [...row.children][1]; - faqAnswer.classList.add('faq-answer'); + + // Close all accordions initially + faqQuestion.classList.remove('active'); + faqAnswer.classList.remove('active'); + faqAnswer.style.maxHeight = '0'; }); - const fq = block.querySelector('.faq-question'); - const fa = block.querySelector('.faq-answer'); - fq.classList.toggle('active'); - fa.classList.toggle('active'); - fa.style.maxHeight = 'unset'; } diff --git a/fonts/proxima/italic/09a1d106-4ddc-4781-bbaa-ca99d410f96c.woff2 b/fonts/proxima/italic/09a1d106-4ddc-4781-bbaa-ca99d410f96c.woff2 new file mode 100644 index 00000000..dff908f8 Binary files /dev/null and b/fonts/proxima/italic/09a1d106-4ddc-4781-bbaa-ca99d410f96c.woff2 differ diff --git a/fonts/proxima/italic/155079dd-36cb-4995-8ced-3fc104e75028.ttf b/fonts/proxima/italic/155079dd-36cb-4995-8ced-3fc104e75028.ttf new file mode 100644 index 00000000..2e2ce433 Binary files /dev/null and b/fonts/proxima/italic/155079dd-36cb-4995-8ced-3fc104e75028.ttf differ diff --git a/fonts/proxima/italic/cf7ea09d-4129-4178-be10-46690a910bc6.woff b/fonts/proxima/italic/cf7ea09d-4129-4178-be10-46690a910bc6.woff new file mode 100644 index 00000000..03368029 Binary files /dev/null and b/fonts/proxima/italic/cf7ea09d-4129-4178-be10-46690a910bc6.woff differ diff --git a/styles/Typo.css b/styles/Typo.css index 251cc9a4..1f8e54bb 100644 --- a/styles/Typo.css +++ b/styles/Typo.css @@ -50,9 +50,9 @@ font-weight: 400; src: url("//1769030.fs1.hubspotusercontent-na1.net/hubfs/1769030/aldevron_template/fonts/proxima/italic/926e8ba2-1161-42b7-a850-c56765e872fd.eot#iefix"); src: url("//1769030.fs1.hubspotusercontent-na1.net/hubfs/1769030/aldevron_template/fonts/proxima/italic/926e8ba2-1161-42b7-a850-c56765e872fd.eot#iefix") format("eot"), - url("//1769030.fs1.hubspotusercontent-na1.net/hubfs/1769030/aldevron_template/fonts/proxima/italic/09a1d106-4ddc-4781-bbaa-ca99d410f96c.woff2") format("woff2"), - url("//1769030.fs1.hubspotusercontent-na1.net/hubfs/1769030/aldevron_template/fonts/proxima/italic/cf7ea09d-4129-4178-be10-46690a910bc6.woff") format("woff"), - url("//1769030.fs1.hubspotusercontent-na1.net/hubfs/1769030/aldevron_template/fonts/proxima/italic/155079dd-36cb-4995-8ced-3fc104e75028.ttf") format("truetype") + url("../fonts/proxima/italic/09a1d106-4ddc-4781-bbaa-ca99d410f96c.woff2") format("woff2"), + url("../fonts/proxima/italic/cf7ea09d-4129-4178-be10-46690a910bc6.woff") format("woff"), + url("../fonts/proxima/italic/155079dd-36cb-4995-8ced-3fc104e75028.ttf") format("truetype") } @font-face {