diff --git a/blocks/accordion/accordion.js b/blocks/accordion/accordion.js index 202e2c7..46d154e 100644 --- a/blocks/accordion/accordion.js +++ b/blocks/accordion/accordion.js @@ -53,9 +53,10 @@ export default function decorate(block) { ele.remove(); } }); - faqRows.forEach((row) => { + faqRows.forEach((row, index) => { const faqQuestion = [...row.children][0]; faqQuestion.classList.add('faq-question'); + faqQuestion.id = `faq-question-${index}`; faqQuestion.addEventListener('click', (e) => { const currentFaq = e.currentTarget.classList.contains('active'); const openfaq = block.querySelector('.faq-question.active'); @@ -64,6 +65,7 @@ export default function decorate(block) { openfaq.nextElementSibling.style.maxHeight = 0; setTimeout(() => { openfaq.nextElementSibling.classList.toggle('active'); + faqQuestion.scrollIntoView({ behavior: 'smooth' }); }, 300); } setTimeout(() => { diff --git a/blocks/recent-posts/recent-posts.css b/blocks/recent-posts/recent-posts.css index 7c52be8..086fff9 100644 --- a/blocks/recent-posts/recent-posts.css +++ b/blocks/recent-posts/recent-posts.css @@ -21,6 +21,10 @@ height: auto; } +.full-post .text { + padding-left: 0!important; +} + @media (max-width: 1024px) { .grey-article-outer { padding-left: 20px; diff --git a/blocks/recent-posts/recent-posts.js b/blocks/recent-posts/recent-posts.js index af514fb..ebba724 100644 --- a/blocks/recent-posts/recent-posts.js +++ b/blocks/recent-posts/recent-posts.js @@ -33,7 +33,11 @@ function createRecentPosts(results) { const articleDescription = p({ class: 'intro' }, truncateText(post.description, 180)); articleCardBody.appendChild(articleHeading); articleCardBody.appendChild(articleDescription); - showcaseBanner.appendChild(articleCardImage); + if (post.image) { + showcaseBanner.appendChild(articleCardImage); + } else { + showcaseBanner.classList.add('full-post'); + } showcaseBanner.appendChild(articleCardBody); lists.append(showcaseBanner); }); diff --git a/scripts/aem.js b/scripts/aem.js index e524664..2882768 100644 --- a/scripts/aem.js +++ b/scripts/aem.js @@ -357,6 +357,15 @@ function buildForm(hbspt) { config.redirectUrl = formData.redirecturl; } hbspt.forms.create(config); + const TargetElement = document.querySelector(config.target); + if (TargetElement) { + setTimeout(() => { + const submitButtons = TargetElement.querySelector('input[type="submit"]'); + submitButtons.addEventListener('click', () => { + TargetElement.scrollIntoView({ behavior: 'smooth' }); + }); + }, 1000); + } }); } @@ -544,6 +553,17 @@ function decorateButtons(element) { a.classList.add('style-normal'); a.classList.add('button'); } + if ( + a && a.href.includes('tel:') + && up.tagName === 'P' + && up.childNodes.length === 1 + ) { + while (a.classList.length > 0) { + a.classList.remove(a.classList.item(0)); + } + a.removeAttribute('href'); + a.classList.add('normal-text'); + } } } }); diff --git a/styles/Typo.css b/styles/Typo.css index 40d1787..da46328 100644 --- a/styles/Typo.css +++ b/styles/Typo.css @@ -6,7 +6,7 @@ html { scroll-behavior: smooth; - scroll-padding-top: 120px; + scroll-padding-top: 150px; } .img-colorbox-popup::after, @@ -2081,3 +2081,17 @@ form.hs-form .hs-input[type="checkbox"] { } } +.normal-text { + font-size: inherit; + color: inherit; + text-decoration: none; + cursor: inherit; +} + +.normal-text:hover { + font-size: inherit; + color: inherit; + text-decoration: none; + cursor: inherit; +} +