Update "Add to AltStore" banner

This commit is contained in:
foxster-mp4
2023-05-22 13:56:51 -07:00
parent 0d8e89dd2f
commit 0e168eabb6
3 changed files with 6 additions and 3 deletions

View File

@@ -60,6 +60,7 @@
} }
.uibanner>.content a { .uibanner>.content a {
margin-left: 6px;
text-decoration: none; text-decoration: none;
color: unset; color: unset;
font-weight: 600; font-weight: 600;

View File

@@ -6,7 +6,7 @@
else if (!isValidHTTPURL(sourceURL)) { else if (!isValidHTTPURL(sourceURL)) {
alert("Invalid HTTP URL."); alert("Invalid HTTP URL.");
search(); search();
} else insertAddToAltStoreBanner(); }
})(); })();
fetch(sourceURL) fetch(sourceURL)
@@ -16,6 +16,8 @@ fetch(sourceURL)
const tintColor = json.tintColor?.replaceAll("#", ""); const tintColor = json.tintColor?.replaceAll("#", "");
if (tintColor) setTintColor(tintColor); if (tintColor) setTintColor(tintColor);
insertAddToAltStoreBanner(json.name);
setApps(json.apps); setApps(json.apps);
main(json); main(json);
waitForAllImagesToLoad(); waitForAllImagesToLoad();

View File

@@ -48,7 +48,7 @@ const appHeaderHTML = app => app ? `
</div> </div>
</div>` : undefined; </div>` : undefined;
function insertAddToAltStoreBanner() { function insertAddToAltStoreBanner(source) {
document.getElementById("top")?.insertAdjacentHTML("afterbegin", ` document.getElementById("top")?.insertAdjacentHTML("afterbegin", `
<div class="uibanner"> <div class="uibanner">
<img src="https://user-images.githubusercontent.com/705880/65270980-1eb96f80-dad1-11e9-9367-78ccd25ceb02.png" alt="altstore-icon" class="icon"> <img src="https://user-images.githubusercontent.com/705880/65270980-1eb96f80-dad1-11e9-9367-78ccd25ceb02.png" alt="altstore-icon" class="icon">
@@ -56,7 +56,7 @@ function insertAddToAltStoreBanner() {
<div class="text-container"> <div class="text-container">
<p class="title-text">AltStore <span class="small beta badge"></span></p> <p class="title-text">AltStore <span class="small beta badge"></span></p>
<p class="detail-text"> <p class="detail-text">
Add this source to AltStore to receive app updates (requires AltStore beta) Add ${source ? "\"" + source + "\"" : "this source"} to AltStore to receive app updates
</p> </p>
</div> </div>
<a href="altstore://source?url=${sourceURL}"> <a href="altstore://source?url=${sourceURL}">