diff --git a/package.json b/package.json index f63a280..b4c1cd5 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "type": "module", "scripts": { - "dev": "concurrently \"vite\" \"bare-server-node --port 8080\"", + "dev": "concurrently \"vite\" \"tsx server.ts\"", "build": "vite build", "bstart": "npm run build && tsx server.ts", "start": "tsx server.ts", diff --git a/src/components/ThemeProvider.tsx b/src/components/ThemeProvider.tsx index c1d09cd..2c21bee 100644 --- a/src/components/ThemeProvider.tsx +++ b/src/components/ThemeProvider.tsx @@ -1,13 +1,13 @@ import { createContext } from "preact"; import { useContext, useEffect, useState } from "preact/hooks"; -export type Theme = +type Theme = | "main" | "hacker" | "catppuccin-mocha" | "catppuccin-macchiato" | "catppuccin-frappe" | "catppuccin-latte"; -export const themes: Theme[] = [ +const themes: Theme[] = [ "main", "hacker", "catppuccin-mocha", diff --git a/src/index.tsx b/src/index.tsx index a4a75c0..1c2b20e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -34,17 +34,19 @@ export default function App() { const particlesLoaded = (container) => { console.log(container); }; - + const bgImage: string | undefined = localStorage.getItem("background"); return ( -
+
{window.location.origin === "https://nebulaproxy.io" && } {/* {window.location.origin === "http://localhost:8080" && } */} }>
-
+
{init && particlesUrl !== "none" && ( (null); const { t } = useTranslation(); const particles = [ @@ -43,6 +45,31 @@ function Customization({ id, active }) {
+
+
+ {t("settings.theme.background")} +
+
+ {t("settings.theme.backgroundDesc")} +
+ + +
); diff --git a/src/routes.tsx b/src/routes.tsx index a2ffe7b..6b2d632 100644 --- a/src/routes.tsx +++ b/src/routes.tsx @@ -7,8 +7,8 @@ import { Radon } from "./pages/Radon"; import { Settings } from "./pages/Settings/"; import { AboutBlank } from "./AboutBlank"; import { Faq } from "./pages/Faq"; -import { registerRemoteListener } from "@mercuryworkshop/bare-mux"; -import { setTransport } from './util/transports'; +// import { registerRemoteListener } from "@mercuryworkshop/bare-mux"; +import { setTransport } from "./util/transports"; import "./style.css"; import "./i18n"; @@ -19,15 +19,13 @@ export default function Routes() { "/wisp/"; // @TODO Japan - US ping if ("serviceWorker" in navigator) { - console.log("am bout to bus"); navigator.serviceWorker.ready.then(async (sw) => { - //await registerRemoteListener(sw.active!) - setTransport(); + //await registerRemoteListener(sw.active!) + setTransport(); + }); + navigator.serviceWorker.register("/sw.js", { + scope: "/~/" }); - navigator.serviceWorker - .register("/sw.js", { - scope: "/~/" - }) } return ( diff --git a/src/style.css b/src/style.css index 05d6a22..f8d13dc 100644 --- a/src/style.css +++ b/src/style.css @@ -120,9 +120,7 @@ --active-color: #8839ef !important; } } -body { - background-color: var(--background-primary) !important; -} + .font-inter { font-family: "Inter", sans-serif; font-weight: 300; diff --git a/vite.config.ts b/vite.config.ts index 8a9bb2c..5f20584 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -59,10 +59,15 @@ export default defineConfig({ rewrite: (path) => path.replace(/^\/bare\//, "") }, "/wisp/": { - target: "http://localhost:3000/", + target: "http://localhost:8080/wisp/", changeOrigin: true, ws: true, rewrite: (path) => path.replace(/^\/wisp\//, "") + }, + "/search": { + target: "http://localhost:8080/search", + changeOrigin: true, + rewrite: (path) => path.replace(/^\/search/, "") } } }