This commit is contained in:
foxster-mp4
2023-04-30 00:33:30 -07:00
parent 09c95032fa
commit 660e88e360
13 changed files with 409 additions and 433 deletions

View File

@@ -1,37 +1,31 @@
addNavigationBar("All Apps");
insertNavigationBar("All Apps");
fetch(sourceURL)
.then(response => response.json())
.then(json => {
if (json.tintColor) setTintColor(json.tintColor)
function main(json) {
// Set tab title
document.title = `Apps - ${json.name}`;
document.title = `Apps - ${json.name}`;
// Sort apps in decending order of version date (newest first)
json.apps.sort((a, b) => (new Date(b.versionDate)).valueOf() - (new Date(a.versionDate)).valueOf());
json.apps.sort((a, b) => (new Date(b.versionDate)).valueOf() - (new Date(a.versionDate)).valueOf());
json.apps.forEach(app => {
if (app.beta) return; // Ignore beta apps
// Create & insert app items
json.apps.forEach(app => {
if (app.beta) return; // Ignore beta apps
const urls = app.screenshotURLs;
let html = `
<div class="app-container">`;
html +=
appHeaderHTML(app);
let html = `
<div class="app-container">
${appHeaderHTML(app) }
<p style="text-align: center; font-size: 0.9em;">${app.subtitle ?? ""}</p>`;
if (app.screenshotURLs) {
html += `
<p style="text-align: center; font-size: 0.9em;">${app.subtitle ?? ""}</p>`;
if (urls) {
html += `
<div class="screenshots">`;
for (let i = 0; i < urls.length, i < 2; i++) html += `
<img src="${urls[i]}" class="screenshot">`;
html += `
</div>`;
}
<div class="screenshots">`;
for (let i = 0; i < app.screenshotURLs.length, i < 2; i++) html += `
<img src="${app.screenshotURLs[i]}" class="screenshot">`;
html += `
</div>`;
}
html += `
</div>`;
document.getElementById("apps").insertAdjacentHTML("beforeend", html);
});
waitForAllImagesToLoad();
});
document.getElementById("apps").insertAdjacentHTML("beforeend", html);
});
}