diff --git a/blocks/forms/forms.js b/blocks/forms/forms.js index ea6cb32..bbdaa7d 100644 --- a/blocks/forms/forms.js +++ b/blocks/forms/forms.js @@ -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 = ` + + `; + // 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); }