diff --git a/app.html b/app.html index 520c475..fd51999 100644 --- a/app.html +++ b/app.html @@ -98,6 +98,18 @@ +
+
+

Discover More From

+
+ +
+

Unknown

+

Source

+
+ +
+
diff --git a/css/app.css b/css/app.css index 78d5c72..e3e3bb9 100644 --- a/css/app.css +++ b/css/app.css @@ -101,12 +101,14 @@ a { /* What's new */ #whats-new, -#permissions { +#permissions, +#source { padding: 1em; } #whats-new .header, -#permissions .header { +#permissions .header, +#source .header { margin: 0.35em 0; padding: 0; } @@ -155,4 +157,48 @@ a { #permissions .permission .description { font-size: 0.9em; opacity: 0.5; +} + +/* Source */ +#source { + padding-top: 0; +} + +#source .row { + display: flex; + flex-direction: column; + gap: 0.15em; + /* justify-content: space-between; */ + /* margin: 1em 0; */ +} + +#source .container { + color: unset; + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: center; +} + +#source .row>.row-title { + font-size: 1.05em; + color: var(--app-tint-color); +} + +#source .bi { + -webkit-text-stroke: 0.25px; + color: var(--app-tint-color); +} + +#source .row>.row-subtitle { + color: unset; + font-size: 0.9em; + opacity: 0.5; + -webkit-line-clamp: 3; + line-clamp: 3; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + position: relative; + word-wrap: break-word } \ No newline at end of file diff --git a/js/app.js b/js/app.js index c239438..df83151 100644 --- a/js/app.js +++ b/js/app.js @@ -140,14 +140,13 @@ function main(json) { const permissions = document.getElementById("permissions"); // If permissions specified - if (app.permissions) + if (app.permissions) { // Remove placeholder permission permissions.querySelector(".permission").remove(); - else return; - - app.permissions?.forEach(permission => { - var permissionType, icon; - switch (permission.type) { + + app.permissions?.forEach(permission => { + var permissionType, icon; + switch (permission.type) { // AltStore-supported permissions case "background-audio": permissionType = "Background Audio"; @@ -214,18 +213,27 @@ function main(json) { default: permissionType = permission.type.replaceAll("-", " "); icon = "gear-wide-connected"; - break; - } + break; + } + + permissions.insertAdjacentHTML("beforeend", ` +
+ +
+

${permissionType}

+

${permission.usageDescription ?? "No description provided."}

+
+
`); + }); + } - permissions.insertAdjacentHTML("beforeend", ` -
- -
-

${permissionType}

-

${permission.usageDescription ?? "No description provided."}

-
-
`); - }); + const source = document.getElementById("source"); + const sourceContainer = source.querySelector(".container"); + const sourceTitle = source.querySelector(".row-title"); + const sourceSubtitle = source.querySelector(".row-subtitle"); + sourceTitle.innerText = json.name; + sourceContainer.href = `index.html?source=${sourceURL}`; + sourceSubtitle.innerText = json.description ?? "A cool AltStore source."; } function exit() { diff --git a/js/shared.js b/js/shared.js index d9aa709..df357ee 100644 --- a/js/shared.js +++ b/js/shared.js @@ -1,5 +1,5 @@ const urlSearchParams = new URLSearchParams(window.location.search); -const sourceURL = urlSearchParams.get('source').replaceAll("+", "%2B"); +const sourceURL = urlSearchParams.get('source')?.replaceAll("+", "%2B"); // https://stackoverflow.com/a/8943487 const urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig;