Skip to content

Commit

Permalink
NA - Fix accessories focus pages
Browse files Browse the repository at this point in the history
  • Loading branch information
alexiscoelho committed Mar 7, 2024
1 parent 3093bb0 commit 82e4d2e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
23 changes: 17 additions & 6 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -645,19 +645,30 @@ function decorateFocusPage(pageType) {
const groupElement = document.createElement('div');
const subGroupElement = document.createElement('div');
const focusH2 = parentElement.querySelector('h2');
const description = parentElement.querySelector('h2 + p');
const description = parentElement.querySelector('p:last-child');

if (focusH1) {
focusH1.innerHTML = `Selected Spaceship: ${focusH1.textContent}`;
}

groupElement.classList.add('group');
subGroupElement.classList.add('sub-group');
groupElement.appendChild(focusH1);
subGroupElement.appendChild(focusH2);
subGroupElement.appendChild(description);
groupElement.appendChild(subGroupElement);
parentElement.appendChild(groupElement);

if (focusH1) {
groupElement.appendChild(focusH1);
}
if (focusH2) {
subGroupElement.appendChild(focusH2);
}
if (description) {
subGroupElement.appendChild(description);
}
if (subGroupElement) {
groupElement.appendChild(subGroupElement);
}
if (groupElement) {
parentElement.appendChild(groupElement);
}
}

function decorateGroups() {
Expand Down
6 changes: 3 additions & 3 deletions styles/accessories.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ body.accessory-focus .default-content-wrapper .sub-group h2 {
font-size: var(--paragraph-font-size);
}

body.engine-focus .default-content-wrapper p:first-child,
body.interior-focus .default-content-wrapper p:first-child,
body.accessory-focus .default-content-wrapper p:first-child {
body.engine-focus .default-content-wrapper > p:first-child,
body.interior-focus .default-content-wrapper > p:first-child,
body.accessory-focus .default-content-wrapper > p:first-child {
margin: 0;
height: 100vh;
width: 50%;
Expand Down

0 comments on commit 82e4d2e

Please sign in to comment.