hello apk

This commit is contained in:
Sebastian Molenda
2026-05-26 22:16:09 +02:00
parent 7bab05fb24
commit 202562878a
28 changed files with 61 additions and 1 deletions
+14
View File
@@ -0,0 +1,14 @@
// Komponenty HTML loader
function loadComponent(path, replaceMap = {}) {
return fetch(path)
.then(r => r.text())
.then(html => {
Object.entries(replaceMap).forEach(([key, val]) => {
html = html.replaceAll(key, val);
});
return html;
});
}
// Przykład użycia:
// loadComponent('components/header.html', {'{TITLE}': 'Tytuł', '{SUBTITLE}': 'Podtytuł'}).then(html => ...)