Skip to content

Commit

Permalink
Added form
Browse files Browse the repository at this point in the history
  • Loading branch information
teshukatepalli1 committed Sep 14, 2023
1 parent 1a79007 commit 0103dc9
Showing 1 changed file with 23 additions and 14 deletions.
37 changes: 23 additions & 14 deletions blocks/forms/forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,27 @@ import { createOptimizedPicture } from '../../scripts/lib-franklin.js';

export default function decorate(block) {
console.log(block);
/* change to ul, li */
// const ul = document.createElement('ul');
// [...block.children].forEach((row) => {
// const li = document.createElement('li');
// while (row.firstElementChild) li.append(row.firstElementChild);
// [...li.children].forEach((div) => {
// if (div.children.length === 1 && div.querySelector('picture')) div.className = 'cards-card-image';
// else div.className = 'cards-card-body';
// });
// ul.append(li);
// });
// ul.querySelectorAll('img').forEach((img) => img.closest('picture').replaceWith(createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }])));
// block.textContent = '';
// block.append(ul);
const element = createElement('div');
element.innerHTML = `
<script charset="utf-8" type="text/javascript" src="//js.hsforms.net/forms/embed/v2.js"></script>
<script>
hbspt.forms.create({
region: "na1",
portalId: "1769030",
formId: "828820d8-9902-4b4e-8ff4-169076195288"
});
</script>`;
// const ul = document.createElement('ul');
// [...block.children].forEach((row) => {
// const li = document.createElement('li');
// while (row.firstElementChild) li.append(row.firstElementChild);
// [...li.children].forEach((div) => {
// if (div.children.length === 1 && div.querySelector('picture')) div.className = 'cards-card-image';
// else div.className = 'cards-card-body';
// });
// ul.append(li);
// });
// ul.querySelectorAll('img').forEach((img) => img.closest('picture').replaceWith(createOptimizedPicture(img.src, img.alt, false, [{ width: '750' }])));
// block.textContent = '';
// block.append(ul);
}

0 comments on commit 0103dc9

Please sign in to comment.