This commit is contained in:
foxster-mp4
2023-07-17 19:16:44 -07:00
parent 8eef026fa8
commit 8ed7aa4bc1
23 changed files with 546 additions and 357 deletions

View File

@@ -0,0 +1,25 @@
//
// AltStoreBanner.js
// altsource-viewer (https://github.com/therealFoxster/altsource-viewer)
//
// Copyright (c) 2023 Foxster.
// MIT License.
//
import { sourceURL } from "../utilities.js";
export const AltStoreBanner = (sourceName) => `
<div class="uibanner">
<img src="https://user-images.githubusercontent.com/705880/65270980-1eb96f80-dad1-11e9-9367-78ccd25ceb02.png" alt="altstore-icon" class="icon">
<div class="content">
<div class="text-container">
<p class="title-text">AltStore <span class="small beta badge"></span></p>
<p class="detail-text">
Add ${sourceName ? "\"" + sourceName + "\"" : "this source"} to AltStore to receive app updates
</p>
</div>
<a href="altstore://source?url=${sourceURL}">
<button>Add</button>
</a>
</div>
</div>`;

View File

@@ -0,0 +1,28 @@
//
// AppHeader.js
// altsource-viewer (https://github.com/therealFoxster/altsource-viewer)
//
// Copyright (c) 2023 Foxster.
// MIT License.
//
import { sourceURL } from "../utilities.js";
export const AppHeader = app => app ? `
<div class="item">
<div class="app-header">
<div class="content">
<img id="app-icon" src="${app.iconURL}" alt="">
<div class="right">
<div class="text">
<p class="title">${app.name}</p>
<p class="subtitle">${app.developerName}</p>
</div>
<a href="app.html?source=${sourceURL}&id=${app.bundleIdentifier}">
<button class="uibutton" style="background-color: #${app.tintColor.replaceAll("#", "")};">View</button>
</a>
</div>
</div>
<div class="background" style="background-color: #${app.tintColor.replaceAll("#", "")};"></div>
</div>
</div>` : undefined;

View File

@@ -0,0 +1,22 @@
//
// NavigationBar.js
// altsource-viewer (https://github.com/therealFoxster/altsource-viewer)
//
// Copyright (c) 2023 Foxster.
// MIT License.
//
export const NavigationBar = (title) => `
<div id="nav-bar">
<button id="back" type="button">
<i class="bi bi-chevron-left"></i>
Back
</button>
<div id="title">
<p>${title ?? ""}</p>
</div>
<button id="back" class="hidden">
<i class="bi bi-chevron-left"></i>
Back
</button>
</div>`;

25
js/components/NewsItem.js Normal file
View File

@@ -0,0 +1,25 @@
//
// NewsItem.js
// altsource-viewer (https://github.com/therealFoxster/altsource-viewer)
//
// Copyright (c) 2023 Foxster.
// MIT License.
//
import { AppHeader } from "./AppHeader.js";
export const NewsItem = (news, minimal = false) => `
<div class="news-item-wrapper"> ${news.url ?
"<a href='" + news.url + "'>" : ""}
<div class="item" style="background-color: #${news.tintColor.replaceAll("#", "")};">
<div class="text">
<h3>${news.title}</h3>
<p>${news.caption}</p>
</div>${news.imageURL && !minimal ?
"<div class='image-wrapper'>" +
"<img src='" + news.imageURL + "'>" +
"</div>" : ""}
</div> ${news.url ?
"</a>" : ""} ${news.appID && !minimal ?
AppHeader(getAppWithBundleId(news.appID)) ?? "" : ""}
</div>`;