mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 12:00:01 -04:00
InstalledTheme is done
This commit is contained in:
parent
833b323267
commit
4fe4efd95a
4 changed files with 9 additions and 20 deletions
|
@ -58,7 +58,7 @@ if (parsedDoc.marketplace.enabled) {
|
|||
|
||||
await app.register(fastifyMiddie);
|
||||
|
||||
app.use(ssrHandler);
|
||||
//app.use(ssrHandler);
|
||||
|
||||
const port: number =
|
||||
parseInt(process.env.PORT as string) || parsedDoc.server.server.port || parseInt("8080");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<div id="parent" class="flex flex-row flex-wrap gap-4 items-center font-roboto justify-center">
|
||||
<div id="main-theme" class="rounded-3xl border border-text-color border-2 bg-navbar-color w-64 flex flex-col cursor-pointer">
|
||||
<div id="main-theme" class="rounded-3xl bg-navbar-color w-64 flex flex-col cursor-pointer">
|
||||
<div class="w-full">
|
||||
<img src="/classic_theme.png" alt="Classic nebula" class="aspect-[16/9] rounded-t-3xl" loading="eager" />
|
||||
</div>
|
||||
|
@ -85,15 +85,12 @@
|
|||
main.appendChild(info);
|
||||
parent.appendChild(main);
|
||||
|
||||
|
||||
Elements.attachEvent(mainTheme, "click", () => {
|
||||
main.classList.remove("border", "border-2");
|
||||
mainTheme.classList.add("border", "border-2");
|
||||
marketplace.theme({ type: 'remove' });
|
||||
});
|
||||
|
||||
Elements.attachEvent(click, "click", async () => {
|
||||
mainTheme.classList.remove("border", "border-2");
|
||||
main.classList.add("border-2", "border");
|
||||
await marketplace.theme(
|
||||
{
|
||||
type: 'normal',
|
||||
|
@ -108,18 +105,10 @@
|
|||
});
|
||||
|
||||
Elements.attachEvent(infoInnerDelete, "click", async () => {
|
||||
main.classList.remove("border", "border-2");
|
||||
mainTheme.classList.add("border-2", "border");
|
||||
await marketplace.uninstallTheme({ name: item.package_name });
|
||||
parent.removeChild(main);
|
||||
await marketplace.theme({ type: 'remove' });
|
||||
});
|
||||
|
||||
const themeName = await marketplace.getValueFromStore(SettingsVals.marketPlace.appearance.theme.name);
|
||||
if (themeName !== null && main.dataset.name === themeName) {
|
||||
mainTheme.classList.remove("border-2", "border");
|
||||
main.classList.add("border-2", "border");
|
||||
}
|
||||
}
|
||||
|
||||
const init = async () => {
|
||||
|
|
|
@ -38,12 +38,12 @@ import { VERSION } from "astro:env/client";
|
|||
class="flex flex-row w-full absolute bottom-4 pr-4 pl-4 text-text-color h-6 justify-between items-center font-roboto"
|
||||
>
|
||||
<p>Version: {VERSION}</p>
|
||||
<p class="hidden md:block">
|
||||
Having problems?
|
||||
<div class="hidden md:flex gap-2 flex-grow ml-16 justify-center items-center">
|
||||
<p> Having problems? </p>
|
||||
<button id="reset" class="underline underline-offset-4 hover:decoration-input-border-color active:decoration-input-text">
|
||||
Click here to reset your instance
|
||||
</button>
|
||||
</p>
|
||||
</div>
|
||||
<p>© Nebula Services 2024</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -71,7 +71,7 @@ class Elements {
|
|||
throw new Error(`Something is WRONG. The element doesn't exist!`);
|
||||
}
|
||||
|
||||
static attachEvent<Element extends HTMLElement, EType extends keyof HTMLElementEventMap>(item: Element, event: EType, fn: () => unknown) {
|
||||
static attachEvent<Element extends HTMLElement, EType extends keyof HTMLElementEventMap>(item: Element, event: EType, fn: (event?: Event) => unknown) {
|
||||
item.addEventListener(event, fn);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue