initial commit

This commit is contained in:
2024-03-22 14:51:07 +01:00
commit 348d743af2
26 changed files with 4344 additions and 0 deletions

29
index.js Normal file
View File

@@ -0,0 +1,29 @@
const root = document.getElementById('root');
async function getData() {
const data1 = await fetch('./groups.json').then((res) => res.json());
root.innerHTML = getHtml(data1);
}
function getHtml(data) {
return `<div>${data
.map((group) => {
return `<table><thead>
<tr>
<th>Имя</th>
<th>Время</th>
<th>Telegram</th>
</tr>
</thead>
<tbody>${group
.map((el) => {
return `<tr>
<td >${el.name}</td>
<td style='width: 200px'">${el.availableTime.from} - ${el.availableTime.to}</td>
<td style='width: 200px'>${el.tgUsername}</td>
</tr>`;
})
.join('')}</tbody>
</table>`;
})
.join('')}</div>`;
}
getData();