1
0
Fork 0
hsarch/modules/home.js
2020-11-02 17:42:51 +01:00

23 lines
603 B
JavaScript

export default async function Home() {
const ret = document.createElement("div");
ret.classList.add("grid");
let html = "";
const response = await fetch("data.json");
const json = await response.json();
json.hertzschlag.forEach((i) => {
html += `
<a class="module" href="#ausgabe/${i.Ausgabe}">
<img src="${json.baseUrl}hertzschlag/images/${i.Ausgabe}.jpg" class="moduleImg"></img>
<div class="moduleLabel">
<h3>HS ${i.Ausgabe}</h3>
<h2>${i.Thema}</h2>
</div>
</a>`;
});
ret.innerHTML = html;
return ret;
}