version 1.0.0 commit

This commit is contained in:
Soulful Sailer
2026-03-04 21:00:14 -06:00
parent 13061a389f
commit eb0916d90a
17 changed files with 1941 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/**
* Retrieves the list of events from the server and adds them respective to their section
*/
function loadEvents() {
fetchFile("events.json", "json").then((events) => {
//if server replies with requested data
if (events) {
for (let header in events) {
events[header].forEach((eventData) => {
addEvent(eventData, header);
});
}
}
else console.log("Could not retrieve event data");
});
}
/**
* Adds event to specified header via creating a new instance of EventItem
* @param {Object} eventData - contains required information about the event
* @param {string} header - specifies under which section to add the new event item
*/
function addEvent(eventData, header) {
let item = new EventItem(eventData);
document.getElementById(header).append(item.elem);
}
document.addEventListener("DOMContentLoaded", loadEvents);