generated from adobe/aem-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:hlxsites/aldevron into feature/form…
…s-and-seperator
- Loading branch information
Showing
17 changed files
with
191 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.sidebar-button-image { | ||
padding: 7%; | ||
margin-top: 25px; | ||
background-color: transparent; | ||
border: none; | ||
box-shadow: 0 2px 15px rgba(0 0 0 / 10%); | ||
border-radius: 4px; | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export default function decorate(block) { | ||
const link = block.querySelector('a'); | ||
const image = block.querySelector('picture'); | ||
if (link && image) { // Corrected the logical operator from '&' to '&&' | ||
link.innerText = ''; | ||
link.className = 'cta_button cta_button_img'; | ||
link.appendChild(image.cloneNode(true)); // Use cloneNode to append a copy of the image | ||
} | ||
block.innerText = ''; | ||
block.appendChild(link); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.sidebar-form { | ||
padding: 7%; | ||
margin-top: 25px; | ||
background-color: transparent; | ||
border: none; | ||
box-shadow: 0 2px 15px rgba(0 0 0 / 10%); | ||
border-radius: 4px; | ||
display: block; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
function embedHubSpotForm(formFields) { | ||
const script = document.createElement('script'); | ||
script.type = 'text/javascript'; | ||
script.src = '/scripts/v2.js'; | ||
script.charset = 'utf-8'; | ||
script.setAttribute('async', ''); | ||
script.onload = () => { | ||
window.hbspt.forms.create(formFields); | ||
}; | ||
document.head.appendChild(script); | ||
} | ||
|
||
export default function decorate(block) { | ||
const formDetails = {}; | ||
const tableRows = block.querySelectorAll('tr'); | ||
tableRows.forEach((row) => { | ||
const cells = row.children; | ||
if (cells.length >= 2) { | ||
const key = cells[0].innerText.trim(); | ||
const value = cells[1].innerText.trim(); | ||
formDetails[key] = key === 'target' ? `#${value}` : value; | ||
} | ||
}); | ||
// Add a delay of 4 seconds (4000 milliseconds) before loading the form | ||
setTimeout(() => { | ||
embedHubSpotForm(formDetails); | ||
}, 3000); | ||
|
||
const form = document.createElement('div'); | ||
form.id = formDetails.target.replace('#', ''); | ||
block.textContent = ''; | ||
block.appendChild(form); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.