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,10 +29,15 @@
</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>
</div> <a href="https://altstore.io/">AltStore</a> is required in order to install apps on iOS</p>
<script src="static/js/main.js"></script> </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>
<script src="static/js/main.js"></script>
</body> </body>

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,34 +8,52 @@ async function getStore(link) {
return data return data
} }
getStore("repo/store.json").then((data) => { // check if on iOS or iPadOS
console.log(data["title"]) if (navigator.userAgent.includes("iPhone") || navigator.userAgent.includes("iPad")) {
console.log(data["apps"])
for (index in data["apps"]) {
let application = data["apps"][index]
// UI stuff // get iOS version
let appDiv = document.createElement("div") if (navigator.userAgent.split(" ")[5] == "like") {
appDiv.classList.add("app") let iOSVersion = navigator.userAgent.split(" ")[4].replaceAll("_", ".")
appGrid.append(appDiv) } else {
let iOSVersion = navigator.userAgent.split(" ")[5].replaceAll("_", ".")
let appImage = document.createElement("img")
appImage.src = application["iconURL"]
appDiv.append(appImage)
let appTitle = document.createElement("p")
appTitle.classList.add("title")
appTitle.innerText = application["name"]
appDiv.append(appTitle)
let appInfo = document.createElement("p")
appInfo.classList.add("w300")
appInfo.innerText = application["developerName"] + " | " + application["subtitle"]
appDiv.append(appInfo)
let appButton = document.createElement("button")
appButton.innerText = "Get"
appDiv.append(appButton)
} }
//console.log(data)
}); // show iOS app info
iOSAppInfo.classList.remove("hidden")
// Load AltStore repository
getStore("repo/store.json").then((data) => {
console.log(data["title"])
console.log(data["apps"])
for (index in data["apps"]) {
let application = data["apps"][index]
// UI stuff
let appDiv = document.createElement("div")
appDiv.classList.add("app")
appGrid.append(appDiv)
let appImage = document.createElement("img")
appImage.src = application["iconURL"]
appDiv.append(appImage)
let appTitle = document.createElement("p")
appTitle.classList.add("title")
appTitle.innerText = application["name"]
appDiv.append(appTitle)
let appInfo = document.createElement("p")
appInfo.classList.add("w300")
appInfo.innerText = application["developerName"] + " | " + application["subtitle"]
appDiv.append(appInfo)
let appButton = document.createElement("button")
appButton.innerText = "Get"
appDiv.append(appButton)
}
});
}
// Unknown device
else {
unknownAppInfo.classList.remove("hidden")
}