Add synthwave '84 and atom one dark
This commit is contained in:
parent
88fa88c623
commit
977f723614
6 changed files with 39 additions and 43 deletions
BIN
public/marketplace/atom-one-dark/logo.png
Normal file
BIN
public/marketplace/atom-one-dark/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
9
public/marketplace/atom-one-dark/theme.css
Normal file
9
public/marketplace/atom-one-dark/theme.css
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[data-theme="atom-one-dark"] {
|
||||||
|
--background-color: #1e2127;
|
||||||
|
--background-highlight: #434952;
|
||||||
|
--accent-color: #3a3f4b;
|
||||||
|
--accent-color-brighter: #4b515f;
|
||||||
|
--text-color: #abb2bf;
|
||||||
|
--text-color-accent: #989eaa;
|
||||||
|
--dropdown-background-color: #30353f;
|
||||||
|
}
|
||||||
BIN
public/marketplace/synthwave84/logo.png
Normal file
BIN
public/marketplace/synthwave84/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
9
public/marketplace/synthwave84/theme.css
Normal file
9
public/marketplace/synthwave84/theme.css
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
[data-theme="synthwave84"] {
|
||||||
|
--background-color: #2a203a;
|
||||||
|
--background-highlight: #2e2342;
|
||||||
|
--accent-color: #1e1629;
|
||||||
|
--accent-color-brighter: #3e2e53;
|
||||||
|
--text-color: #c0bdc4;
|
||||||
|
--text-color-accent: #dddddd;
|
||||||
|
--dropdown-background-color: #231a30;
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
import { TransportMgr, initTransport } from "./ts/TransportManager";
|
import { TransportMgr, initTransport } from "./ts/TransportManager";
|
||||||
import "notyf/notyf.min.css";
|
import "notyf/notyf.min.css";
|
||||||
import { Notyf } from "notyf";
|
import { Notyf } from "notyf";
|
||||||
import { loadIDB, GetStore, ValidateStoreExists, CreateStore } from "./ts/IDBManager";
|
|
||||||
|
|
||||||
const form = document.querySelector("form");
|
const form = document.querySelector("form");
|
||||||
let input = document.querySelector("input");
|
let input = document.querySelector("input");
|
||||||
|
|
@ -52,46 +51,8 @@
|
||||||
return window.__uv$config.decodeUrl(frame.contentWindow!.location.href.split("/service/")[1]);
|
return window.__uv$config.decodeUrl(frame.contentWindow!.location.href.split("/service/")[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function loadPageExtensions() {
|
|
||||||
try {
|
|
||||||
const iframe = document.getElementById("proxy-frame") as HTMLIFrameElement;
|
|
||||||
if (!ValidateStoreExists("InstalledExtensions")) {
|
|
||||||
CreateStore("InstalledExtensions", { keyPath: "slug" });
|
|
||||||
}
|
|
||||||
const db = loadIDB("AluDB", 1);
|
|
||||||
db.onsuccess = () => {
|
|
||||||
const store = GetStore("InstalledExtensions", "readonly");
|
|
||||||
const request = store.getAll();
|
|
||||||
request.onsuccess = () => {
|
|
||||||
const extensions = request.result;
|
|
||||||
extensions.forEach((extension: IExtensionMetadata) => {
|
|
||||||
// Eval the extension script inside of the iframe
|
|
||||||
if (!(extension.type == "page")) return;
|
|
||||||
if (extension.pages && extension.pages.length > 0) {
|
|
||||||
// Check if the current URL matches the extension's URL
|
|
||||||
extension.pages.forEach((url) => {
|
|
||||||
console.log(url);
|
|
||||||
console.log(iframe.contentWindow!.__uv$location.host);
|
|
||||||
if (iframe.contentWindow!.__uv$location.host.includes(url)) {
|
|
||||||
const script = extension.script;
|
|
||||||
const scriptElement = document.createElement("script");
|
|
||||||
scriptElement.src = script;
|
|
||||||
scriptElement.type = "module";
|
|
||||||
iframe.contentDocument!.head.appendChild(scriptElement);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Failed load extension scripts: ${err}`);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function loadContent(): Promise<void> {
|
async function loadContent(): Promise<void> {
|
||||||
await initTransport();
|
await initTransport();
|
||||||
await loadPageExtensions();
|
|
||||||
// The setTimeout is because service workers are a little silly and can take a while longer to register despite .then being called, which causes a bug on the first load.
|
// The setTimeout is because service workers are a little silly and can take a while longer to register despite .then being called, which causes a bug on the first load.
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
const openWith = Alu.store.get("openpage");
|
const openWith = Alu.store.get("openpage");
|
||||||
|
|
@ -285,7 +246,6 @@
|
||||||
const UVURL = getUVProxyURL(iframe);
|
const UVURL = getUVProxyURL(iframe);
|
||||||
if (proxiedFavicon.src == `${window.location.origin}/custom-favicon?url=${UVURL}`) return;
|
if (proxiedFavicon.src == `${window.location.origin}/custom-favicon?url=${UVURL}`) return;
|
||||||
proxiedFavicon.src = `/custom-favicon?url=${UVURL}`;
|
proxiedFavicon.src = `/custom-favicon?url=${UVURL}`;
|
||||||
loadPageExtensions();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
"dev.wearr.oled-theme": {
|
"dev.wearr.oled-theme": {
|
||||||
"title": "OLED Theme",
|
"title": "OLED Theme",
|
||||||
"description": "A beautiful OLED theme for Alu.",
|
"description": "A beautiful OLED theme for Alu.",
|
||||||
"version": "0.0.1",
|
"version": "0.1.0",
|
||||||
"image": "/marketplace/oled-theme/theme.png",
|
"image": "/marketplace/oled-theme/theme.png",
|
||||||
"script": "/marketplace/oled-theme/theme.css",
|
"script": "/marketplace/oled-theme/theme.css",
|
||||||
"type": "theme",
|
"type": "theme",
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
"dev.wearr.dracula-theme": {
|
"dev.wearr.dracula-theme": {
|
||||||
"title": "Dracula Theme",
|
"title": "Dracula Theme",
|
||||||
"description": "A port of the Dracula theme for Alu.",
|
"description": "A port of the Dracula theme for Alu.",
|
||||||
"version": "0.0.1",
|
"version": "1.0.0",
|
||||||
"image": "/marketplace/dracula-theme/logo.svg",
|
"image": "/marketplace/dracula-theme/logo.svg",
|
||||||
"script": "/marketplace/dracula-theme/theme.css",
|
"script": "/marketplace/dracula-theme/theme.css",
|
||||||
"type": "theme",
|
"type": "theme",
|
||||||
|
|
@ -30,10 +30,28 @@
|
||||||
"dev.wearr.nord-theme": {
|
"dev.wearr.nord-theme": {
|
||||||
"title": "Nord Theme",
|
"title": "Nord Theme",
|
||||||
"description": "A port of the Nord theme for Alu.",
|
"description": "A port of the Nord theme for Alu.",
|
||||||
"version": "0.0.1",
|
"version": "1.0.0",
|
||||||
"image": "/marketplace/nord-theme/logo.png",
|
"image": "/marketplace/nord-theme/logo.png",
|
||||||
"script": "/marketplace/nord-theme/theme.css",
|
"script": "/marketplace/nord-theme/theme.css",
|
||||||
"type": "theme",
|
"type": "theme",
|
||||||
"themeName": "nord"
|
"themeName": "nord"
|
||||||
|
},
|
||||||
|
"dev.wearr.synthwave84": {
|
||||||
|
"title": "Synthwave '84",
|
||||||
|
"description": "A port of the Synthwave '84 theme for Alu.",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"image": "/marketplace/synthwave84/logo.png",
|
||||||
|
"script": "/marketplace/synthwave84/theme.css",
|
||||||
|
"type": "theme",
|
||||||
|
"themeName": "synthwave84"
|
||||||
|
},
|
||||||
|
"dev.wearr.atom-one-dark": {
|
||||||
|
"title": "Atom One Dark",
|
||||||
|
"description": "A port of the Atom One Dark theme for Alu.",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"image": "/marketplace/atom-one-dark/logo.png",
|
||||||
|
"script": "/marketplace/atom-one-dark/theme.css",
|
||||||
|
"type": "theme",
|
||||||
|
"themeName": "atom-one-dark"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue