Files
driftywinds.github.io/js/news.js
2023-04-27 20:27:37 -07:00

16 lines
449 B
JavaScript

addNavigationBar("All News");
fetch(sourceURL)
.then(response => response.json())
.then(json => {
if (json.tintColor) setTintColor(json.tintColor)
document.title = `News - ${json.name}`;
json.news.sort((a, b) => (new Date(b.date)).valueOf() - (new Date(a.date)).valueOf());
json.news.forEach(news =>
document.getElementById("news").insertAdjacentHTML("beforeend", newsItemHTML(news, json.apps))
);
waitForAllImagesToLoad();
});