mirror of
https://github.com/driftywinds/driftywinds.github.io.git
synced 2025-12-20 11:23:56 +00:00
Initial commit
This commit is contained in:
16
js/news.js
Normal file
16
js/news.js
Normal file
@@ -0,0 +1,16 @@
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user