show apps on top menu

This commit is contained in:
Simon Vieille 2024-10-27 16:43:23 +01:00
commit 4e62b2e7dc
4 changed files with 107 additions and 58 deletions

View file

@ -1,5 +1,7 @@
<?php
header('Content-type: text/javascript');
$display = 'default';
if ($_['always-displayed']) {
@ -12,6 +14,24 @@ if ($_['always-displayed']) {
?>
const SMcreateElement = (tagName, attributes) => {
const element = document.createElement(tagName)
if (typeof attributes === 'object') {
for (let i in attributes) {
if (i === 'text') {
element.textContent = attributes[i]
} else if (i === 'html') {
element.innerHTML = attributes[i]
} else {
element.setAttribute(i, attributes[i])
}
}
}
return element
}
(function() {
const sideMenuContainer = SMcreateElement('div', {id: 'side-menu-container'})
const sideMenuOpener = SMcreateElement('button', {