Bento/assets/js/cards.js
2021-11-24 07:21:18 -06:00

27 lines
636 B
JavaScript

// ┌─┐┌─┐┬─┐┌┬┐┌─┐
// │ ├─┤├┬┘ ││└─┐
// └─┘┴ ┴┴└──┴┘└─┘
// Print cards
const printCards = () => {
for (const card of CONFIG.cards) {
// Card Item
let item = `
<a
href="${card.link}"
target="${CONFIG.openInNewTab ? '_blank' : ''}"
class="buttons__link card buttonLink__link-${card.id}"
>
<i class="buttonLink__icon" icon-name="${card.icon}"></i>
</a>
`;
const position = 'beforeend';
buttonsContainer.insertAdjacentHTML(position, item);
}
};
printCards();