2022-02-07 19:36:51 -06:00
|
|
|
// ┬ ┌─┐┬ ┬┌─┐┬ ┬┌┬┐
|
|
|
|
// │ ├─┤└┬┘│ ││ │ │
|
|
|
|
// ┴─┘┴ ┴ ┴ └─┘└─┘ ┴
|
|
|
|
// Generate Layout.
|
|
|
|
|
|
|
|
const generateLayout = () => {
|
2022-02-09 16:18:29 -06:00
|
|
|
let firstButtonsContainer = `
|
|
|
|
<div class="buttonsContainer" id="buttons_1"></div>
|
|
|
|
`;
|
|
|
|
let secondButtonsContainer = `
|
|
|
|
<div class="buttonsContainer" id="buttons_2"></div>
|
|
|
|
`;
|
|
|
|
let firstListsContainer = `
|
|
|
|
<div class="listsContainer" id="lists_1"></div>
|
|
|
|
`;
|
2022-02-07 19:36:51 -06:00
|
|
|
|
2022-02-09 16:18:29 -06:00
|
|
|
let secondListsContainer = `
|
|
|
|
<div class="listsContainer" id="lists_2"></div>
|
|
|
|
`;
|
2022-02-07 19:36:51 -06:00
|
|
|
|
|
|
|
const position = 'beforeend';
|
2022-02-09 16:18:29 -06:00
|
|
|
|
2022-02-07 19:36:51 -06:00
|
|
|
switch (CONFIG.bentoLayout) {
|
|
|
|
case 'bento':
|
2022-02-09 16:18:29 -06:00
|
|
|
linksBlockLeft.insertAdjacentHTML(position, firstButtonsContainer);
|
|
|
|
linksBlockRight.insertAdjacentHTML(position, firstListsContainer);
|
2022-02-14 13:13:36 -06:00
|
|
|
linksBlock.classList.remove('reduceGap');
|
|
|
|
linksBlock.classList.remove('removeGap');
|
2022-02-07 19:36:51 -06:00
|
|
|
break;
|
|
|
|
case 'lists':
|
2022-02-09 16:18:29 -06:00
|
|
|
linksBlockLeft.insertAdjacentHTML(position, firstListsContainer);
|
|
|
|
linksBlockRight.insertAdjacentHTML(position, secondListsContainer);
|
2022-02-14 13:13:36 -06:00
|
|
|
linksBlock.classList.add('reduceGap');
|
2022-02-07 19:36:51 -06:00
|
|
|
break;
|
|
|
|
case 'buttons':
|
2022-02-09 16:18:29 -06:00
|
|
|
linksBlockLeft.insertAdjacentHTML(position, firstButtonsContainer);
|
|
|
|
linksBlockRight.insertAdjacentHTML(position, secondButtonsContainer);
|
2022-02-14 13:13:36 -06:00
|
|
|
linksBlock.classList.add('removeGap');
|
2022-02-07 19:36:51 -06:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
generateLayout();
|