mirror of
https://github.com/driftywinds/driftywinds.github.io.git
synced 2025-12-20 03:13:57 +00:00
Refactor
This commit is contained in:
25
js/components/AltStoreBanner.js
Normal file
25
js/components/AltStoreBanner.js
Normal 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>`;
|
||||
28
js/components/AppHeader.js
Normal file
28
js/components/AppHeader.js
Normal 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;
|
||||
22
js/components/NavigationBar.js
Normal file
22
js/components/NavigationBar.js
Normal 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
25
js/components/NewsItem.js
Normal 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>`;
|
||||
Reference in New Issue
Block a user