mirror of
https://codeberg.org/kirche-im-netz/Startodon-Hub.git
synced 2025-08-18 16:48:18 +02:00
mehr Infos im Popup (WIP --> CSS fehlt noch)
This commit is contained in:
parent
75bebc50a7
commit
2f7c6865cd
4 changed files with 87 additions and 51 deletions
11
src/main.js
11
src/main.js
|
@ -2,7 +2,6 @@ import { createStarterKitElement, enhanceStarterKits } from './utils/starterkit-
|
|||
import { seededShuffleChildren } from './utils/shuffle-utils.js';
|
||||
import { initializeCreateStarterKitPopup } from './utils/create-starterkit.js';
|
||||
|
||||
|
||||
let userConsent = null;
|
||||
export { userConsent };
|
||||
|
||||
|
@ -10,14 +9,13 @@ async function loadTemplates() {
|
|||
const response = await fetch('src/template/template.html');
|
||||
const templateHTML = await response.text();
|
||||
|
||||
// Füge die Templates in das DOM ein
|
||||
const templateContainer = document.createElement('div');
|
||||
templateContainer.innerHTML = templateHTML;
|
||||
document.body.appendChild(templateContainer);
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', async function () {
|
||||
await loadTemplates(); // Templates laden
|
||||
await loadTemplates();
|
||||
|
||||
initializeCreateStarterKitPopup();
|
||||
|
||||
|
@ -25,31 +23,26 @@ document.addEventListener('DOMContentLoaded', async function () {
|
|||
const shuffleContainers = document.querySelectorAll('.shuffle-container');
|
||||
const seed = Date.now();
|
||||
|
||||
// Lade die Haupt-Konfigurationsdatei
|
||||
fetch('config.json')
|
||||
.then(response => response.json())
|
||||
.then(config => {
|
||||
const starterkitFiles = config.starterkits;
|
||||
|
||||
// Lade alle StarterKit-Dateien
|
||||
return Promise.all(
|
||||
starterkitFiles.map(file => fetch(file).then(res => res.json()))
|
||||
);
|
||||
})
|
||||
.then(starterkits => {
|
||||
// Verarbeite die geladenen StarterKits
|
||||
starterkits.forEach(kit => {
|
||||
const kitElement = createStarterKitElement(kit);
|
||||
container.appendChild(kitElement);
|
||||
});
|
||||
|
||||
// Shuffle-Logik anwenden
|
||||
shuffleContainers.forEach(container => {
|
||||
seededShuffleChildren(container, seed);
|
||||
});
|
||||
|
||||
// Zusätzliche Funktionalität für StarterKits hinzufügen
|
||||
enhanceStarterKits();
|
||||
})
|
||||
.catch(error => console.error('Fehler beim Laden der StarterKits:', error));
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue