This commit is contained in:
maaa 2024-03-09 15:19:52 +01:00
parent b3af057ae0
commit bd3a41b6ae
2 changed files with 62 additions and 34 deletions

View File

@ -18,7 +18,10 @@
<a href="about.html">About</a> <a href="about.html">About</a>
</div> </div>
</div>--> </div>-->
<noscript><p style="width: 100%; background-color: #fffaa0; margin: 0; height: 30px;">This page might require JavaScript to work properly</h1></noscript> <noscript>
<p style="width: 100%; background-color: #fffaa0; margin: 0; height: 30px;">This page might require JavaScript
to work properly</h1>
</noscript>
<br> <br>
<div class="introductionDiv"> <div class="introductionDiv">
<h1 class="w700">burgerstore</h1> <h1 class="w700">burgerstore</h1>
@ -26,8 +29,13 @@
</div> </div>
<div id="appGrid" class="appGrid"> <div id="appGrid" class="appGrid">
<a class="featuredApp" src="/"><img></a> <a class="featuredApp" src="/"><img></a>
<h3>iOS apps</h3> <div id="iOSAppInfo" class="hidden">
<a href="https://altstore.io/">AltStore</a> is required in order to install apps</p> <h3>Featured apps for your device</h3>
<a href="https://altstore.io/">AltStore</a> is required in order to install apps on iOS</p>
</div>
<div id="unknownAppInfo" class="hidden">
<h3>No apps are available for your device</h3>
<p>Supported operating systems include: Linux and iOS</p>
</div> </div>
<script src="static/js/main.js"></script> <script src="static/js/main.js"></script>

View File

@ -1,4 +1,6 @@
let appGrid = document.getElementById("appGrid") let appGrid = document.getElementById("appGrid")
let iOSAppInfo = document.getElementById("iOSAppInfo")
let unknownAppInfo = document.getElementById("unknownAppInfo")
async function getStore(link) { async function getStore(link) {
const response = await fetch(link); const response = await fetch(link);
@ -6,7 +8,21 @@ async function getStore(link) {
return data return data
} }
getStore("repo/store.json").then((data) => { // check if on iOS or iPadOS
if (navigator.userAgent.includes("iPhone") || navigator.userAgent.includes("iPad")) {
// get iOS version
if (navigator.userAgent.split(" ")[5] == "like") {
let iOSVersion = navigator.userAgent.split(" ")[4].replaceAll("_", ".")
} else {
let iOSVersion = navigator.userAgent.split(" ")[5].replaceAll("_", ".")
}
// show iOS app info
iOSAppInfo.classList.remove("hidden")
// Load AltStore repository
getStore("repo/store.json").then((data) => {
console.log(data["title"]) console.log(data["title"])
console.log(data["apps"]) console.log(data["apps"])
for (index in data["apps"]) { for (index in data["apps"]) {
@ -35,5 +51,9 @@ getStore("repo/store.json").then((data) => {
appButton.innerText = "Get" appButton.innerText = "Get"
appDiv.append(appButton) appDiv.append(appButton)
} }
//console.log(data) });
}); }
// Unknown device
else {
unknownAppInfo.classList.remove("hidden")
}