2022-02-14 13:13:36 -06:00
|
|
|
// ┌┐ ┬ ┬┌┬┐┌┬┐┌─┐┌┐┌┌─┐
|
|
|
|
// ├┴┐│ │ │ │ │ ││││└─┐
|
|
|
|
// └─┘└─┘ ┴ ┴ └─┘┘└┘└─┘
|
2022-02-07 19:36:51 -06:00
|
|
|
// Function to print Button Cards.
|
|
|
|
|
2022-02-09 16:18:29 -06:00
|
|
|
const generateFirstButtonsContainer = () => {
|
|
|
|
for (const button of CONFIG.firstButtonsContainer) {
|
|
|
|
let item = `
|
|
|
|
<a
|
|
|
|
href="${button.link}"
|
|
|
|
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
|
|
|
class="card button button__${button.id}"
|
|
|
|
>
|
2022-02-19 00:04:12 +03:00
|
|
|
<img class="buttonIcon" src="assets/icons/arcticons/png/${button.icon}.png" />
|
2022-02-09 16:18:29 -06:00
|
|
|
</a>
|
|
|
|
`;
|
|
|
|
|
|
|
|
const position = 'beforeend';
|
|
|
|
|
|
|
|
buttons_1.insertAdjacentHTML(position, item);
|
|
|
|
}
|
2022-02-14 13:13:36 -06:00
|
|
|
};
|
2022-02-07 19:36:51 -06:00
|
|
|
|
2022-02-09 16:18:29 -06:00
|
|
|
const generateSecondButtonsContainer = () => {
|
|
|
|
for (const button of CONFIG.secondButtonsContainer) {
|
2022-02-07 19:36:51 -06:00
|
|
|
let item = `
|
|
|
|
<a
|
|
|
|
href="${button.link}"
|
|
|
|
target="${CONFIG.openInNewTab ? '_blank' : ''}"
|
|
|
|
class="card button button__${button.id}"
|
|
|
|
>
|
2022-02-19 00:04:12 +03:00
|
|
|
<img class="buttonIcon" src="assets/icons/arcticons/png/${button.icon}.png" />
|
2022-02-07 19:36:51 -06:00
|
|
|
</a>
|
|
|
|
`;
|
|
|
|
|
|
|
|
const position = 'beforeend';
|
|
|
|
|
2022-02-09 16:18:29 -06:00
|
|
|
buttons_2.insertAdjacentHTML(position, item);
|
|
|
|
}
|
2022-02-14 13:13:36 -06:00
|
|
|
};
|
2022-02-09 16:18:29 -06:00
|
|
|
|
|
|
|
const generateButtons = () => {
|
|
|
|
switch (CONFIG.bentoLayout) {
|
|
|
|
case 'bento':
|
|
|
|
generateFirstButtonsContainer();
|
|
|
|
break;
|
|
|
|
case 'buttons':
|
|
|
|
generateFirstButtonsContainer();
|
|
|
|
generateSecondButtonsContainer();
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
2022-02-07 19:36:51 -06:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
generateButtons();
|