Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the footer refactor code #252

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions blocks/footer/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

.footer-wrapper div#footer-orange .outer {
display: grid;
grid-template-columns: 3fr 20%;
width: 85%;
grid-template-columns: 1fr;
}

.footer-wrapper div#footer-orange .hs-menu-wrapper {
Expand Down Expand Up @@ -36,12 +37,14 @@
}

@media (max-width: 1024px){
.footer-wrapper div#footer-black div {
padding: 0 20px;
.footer-wrapper div#footer-orange .outer {
padding-left: 0!important;
padding-right: 0!important;
grid-template-columns: 1fr;
}

.footer-wrapper div#footer-orange .outer{
grid-template-columns: 1fr;
.footer-wrapper div#footer-black div {
padding: 0 20px;
}

.footer-wrapper div#footer-orange .outer .social-icons{
Expand Down
7 changes: 7 additions & 0 deletions blocks/footer/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ export default async function decorate(block) {

footerUl.children[0].children[1].replaceWith(footLogo);
topContainer.append(footerUl);
const links = footerWapper.querySelectorAll('a');
links.forEach((link) => {
if (link.parentElement.tagName === 'STRONG') {
link.setAttribute('target', '_blank');
link.classList.add('text-normal');
}
});
decorateIcons(footerWapper);
block.append(topContainer);
}
Expand Down
3 changes: 3 additions & 0 deletions blocks/imageshyperlink/imageshyperlink.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
export default async function decorate(block) {
const anchorEl = document.createElement('a');
const refAnchorEl = block.querySelector('a');
if (refAnchorEl.parentElement.tagName === 'STRONG') {
anchorEl.setAttribute('target', 'blank');
}
const pic = block.querySelector('picture');
if (refAnchorEl) {
if (refAnchorEl.hasAttribute('href')) {
Expand Down
3 changes: 3 additions & 0 deletions blocks/rte/rte.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default function decorate(block) {
if (nextNextSibling) {
const link = nextNextSibling.querySelector('a');
if (link.href === link.innerText.trim()) {
if (link.parentElement.tagName === 'STRONG') {
link.setAttribute('target', '_blank');
}
link.innerHTML = '';
link.appendChild(image.cloneNode(true));
if (image.parentElement.tagName === 'P') {
Expand Down
3 changes: 3 additions & 0 deletions blocks/sidebar-rte/sidebar-rte.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export default function decorate(block) {
if (nextNextSibling) {
const link = nextNextSibling.querySelector('a');
if (link.href === link.innerText.trim()) {
if (link.parentElement.tagName === 'STRONG') {
link.setAttribute('target', '_blank');
}
link.innerHTML = '';
link.appendChild(image.cloneNode(true));
if (image.parentElement.tagName === 'P') {
Expand Down
1 change: 1 addition & 0 deletions scripts/aem.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ function decorateButtons(element) {
) {
a.setAttribute('target', '_blank');
a.classList.add('style-normal');
a.classList.add('button');
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions styles/Typo.css
Original file line number Diff line number Diff line change
Expand Up @@ -641,15 +641,15 @@ input[type="submit"] {
background-color: transparent;
padding: 0!important;
border: none;
color: #ec8f2d;
color: var(--primary-color);
text-transform: none;
font-style: normal;
transition: all .3s ease-in-out;
}

.button.secondary:hover {
border: none;
color: #ec8f2d;
color: var(--primary-color);
text-decoration: underline;
transition: all .3s ease-in-out;
}
Expand All @@ -658,15 +658,15 @@ input[type="submit"] {
background-color: transparent;
padding: 0;
border: none;
color: #ec8f2d;
color: var(--primary-color);
text-transform: none;
font-style: normal;
transition: all .3s ease-in-out;
}

.button.primary:hover {
border: none;
color: #ec8f2d;
color: var(--primary-color);
text-decoration: underline;
transition: all .3s ease-in-out;
}
Expand Down
29 changes: 14 additions & 15 deletions styles/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -658,28 +658,26 @@ body.sidebar-50 #sidebar {
width: 100%
}

#footer-orange .hs-menu-wrapper {
float: left;
padding: 0;
width: 80%
}

#footer-orange .hs-menu-wrapper ul {
display: flex;
padding: 0
}


#footer-orange li {
padding: 0
}

#footer-orange li.hs-menu-depth-1 {
float: left;
margin-left: 1%;
width: 25%
margin-right: 1%;
margin-bottom: 20px;
width: 100%;
}

#footer-orange li.hs-menu-depth-1.menu-num-3,#footer-orange li.hs-menu-depth-1:nth-child(3) {
width: 21%

#footer-orange li.hs-menu-depth-1 ul{
flex-direction: column;
}

#footer-orange li.hs-menu-depth-1.menu-num-2,#footer-orange li.hs-menu-depth-1:nth-child(2) {
Expand All @@ -689,9 +687,10 @@ body.sidebar-50 #sidebar {
#footer-orange li.hs-menu-depth-1>a {
display: block;
font-family: Brown-Ald,Helvetica,Arial,sans-serif;
font-size: 22px;
font-size: 18px;
font-weight: 700;
line-height: 1.2
line-height: 1.2;
min-height: 44px;
}

#footer-orange li.hs-menu-depth-2>a {
Expand Down Expand Up @@ -1215,12 +1214,12 @@ h2 span.hs_cos_wrapper_widget {
}

.table_order button {
font-size: 12px;
padding: .8em .9em
font-size: 12px!important;
padding: .8em .9em!important;
}

.table_order .button {
font-size: 12px;
font-size: 12px!important;
margin: 1px 0;
padding: .4em .8em
}
Expand Down