mirror of
https://github.com/NebulaServices/Nebula.git
synced 2025-05-13 03:50:02 -04:00
fix font
This commit is contained in:
parent
835cb237d7
commit
fc414951d1
6 changed files with 4728 additions and 5425 deletions
|
@ -31,8 +31,6 @@
|
|||
"@mercuryworkshop/epoxy-transport": "2.1.13",
|
||||
"@mercuryworkshop/libcurl-transport": "^1.3.10",
|
||||
"@playform/compress": "^0.1.4",
|
||||
"@rubynetwork/rammerhead": "^1.3.5",
|
||||
"@rubynetwork/rammerhead-browser": "^1.0.9",
|
||||
"@titaniumnetwork-dev/ultraviolet": "^3.2.7",
|
||||
"@svelte-drama/suspense": "0.5.1",
|
||||
"@types/node": "^22.7.5",
|
||||
|
|
9402
pnpm-lock.yaml
generated
9402
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -17,3 +17,9 @@
|
|||
--tab-color: var(--black);
|
||||
--border-color: #16121f;
|
||||
}
|
||||
|
||||
.roboto {
|
||||
font-family: "Roboto", sans-serif;
|
||||
font-weight: 200;
|
||||
font-style: normal;
|
||||
}
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
import { createServer } from "node:http";
|
||||
import rammerhead from "@rubynetwork/rammerhead";
|
||||
import { FastifyServerFactory, FastifyServerFactoryHandler, RawServerDefault } from "fastify";
|
||||
import {
|
||||
FastifyServerFactory,
|
||||
FastifyServerFactoryHandler,
|
||||
RawServerDefault,
|
||||
} from "fastify";
|
||||
import wisp from "wisp-server-node";
|
||||
import { LOG_LEVEL, WispOptions } from "wisp-server-node/dist/Types.js";
|
||||
import { parsedDoc } from "./config.js";
|
||||
|
||||
const rh = rammerhead.createRammerhead({
|
||||
logLevel: parsedDoc.server.server.logging ? "debug" : "disabled",
|
||||
reverseProxy: parsedDoc.server.rammerhead.reverseproxy,
|
||||
disableLocalStorageSync: parsedDoc.server.rammerhead.localstorage_sync ? false : true,
|
||||
disableHttp2: parsedDoc.server.rammerhead.http2 ? false : true
|
||||
});
|
||||
|
||||
const wispOptions: WispOptions = {
|
||||
logLevel: parsedDoc.server.server.logging ? LOG_LEVEL.DEBUG : LOG_LEVEL.NONE,
|
||||
pingInterval: 30
|
||||
pingInterval: 30,
|
||||
};
|
||||
|
||||
const serverFactory: FastifyServerFactory = (
|
||||
|
@ -22,16 +18,10 @@ const serverFactory: FastifyServerFactory = (
|
|||
): RawServerDefault => {
|
||||
const httpServer = createServer();
|
||||
httpServer.on("request", (req, res) => {
|
||||
if (rammerhead.shouldRouteRh(req)) {
|
||||
rammerhead.routeRhRequest(rh, req, res);
|
||||
} else {
|
||||
handler(req, res);
|
||||
}
|
||||
});
|
||||
httpServer.on("upgrade", (req, socket, head) => {
|
||||
if (rammerhead.shouldRouteRh(req)) {
|
||||
rammerhead.routeRhUpgrade(rh, req, socket, head);
|
||||
} else if (parsedDoc.server.server.wisp) {
|
||||
if (parsedDoc.server.server.wisp) {
|
||||
if (req.url?.endsWith("/wisp/")) {
|
||||
wisp.routeRequest(req, socket as any, head, wispOptions);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ const { title, noHeader } = Astro.props;
|
|||
<SettingsLoader transition:persist />
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="description" content="Astro description" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="icon" type="image/svg+xml" href="/favicon.svg" id="favicon" />
|
||||
<link
|
||||
rel="stylesheet"
|
||||
|
@ -31,13 +31,19 @@ const { title, noHeader } = Astro.props;
|
|||
as="style"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<link rel="preload" href="https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2" as="font" type="font/woff2" crossorigin="anonymous" />
|
||||
<link
|
||||
rel="preload"
|
||||
href="https://fonts.gstatic.com/s/roboto/v32/KFOmCnqEu92Fr1Mu4mxK.woff2"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<meta name="generator" content={Astro.generator} />
|
||||
<title>{title}</title>
|
||||
<ViewTransitions />
|
||||
</head>
|
||||
<body class="h-full bg-primary">
|
||||
{!noHeader && <Header /> }
|
||||
{!noHeader && <Header />}
|
||||
<div class="h-full z-10 w-full fixed">
|
||||
<slot />
|
||||
</div>
|
||||
|
@ -90,9 +96,6 @@ const { title, noHeader } = Astro.props;
|
|||
</style>
|
||||
|
||||
<style is:global>
|
||||
.roboto {
|
||||
font-family: var(--font-family), Roboto;
|
||||
}
|
||||
/* Custom scrollbar because the default ones look like ASS */
|
||||
::-webkit-scrollbar {
|
||||
width: 0.5rem;
|
||||
|
|
|
@ -3,7 +3,10 @@ import Logo from "@components/Logo.astro";
|
|||
import Layout from "@layouts/Layout.astro";
|
||||
import { getLangFromUrl, useTranslations } from "../../i18n/utils";
|
||||
export function getStaticPaths() {
|
||||
const STATIC_PATHS = [{ params: { lang: "en_US" } }, { params: { lang: "jp" } }];
|
||||
const STATIC_PATHS = [
|
||||
{ params: { lang: "en_US" } },
|
||||
{ params: { lang: "jp" } },
|
||||
];
|
||||
return STATIC_PATHS;
|
||||
}
|
||||
export const prerender = true;
|
||||
|
@ -13,13 +16,19 @@ import { VERSION } from "astro:env/client";
|
|||
---
|
||||
|
||||
<Layout title="Nebula">
|
||||
<div class="flex flex-wrap mt-16 justify-center content-center w-full bg-primary fixed inset-0 h-[calc(100%-4rem)] z-0 flex-col items-center">
|
||||
<div class="w-full flex flex-col justify-center items-center content-center h-2/4">
|
||||
<div
|
||||
class="flex flex-wrap mt-16 justify-center content-center w-full bg-primary fixed inset-0 h-[calc(100%-4rem)] z-0 flex-col items-center"
|
||||
>
|
||||
<div
|
||||
class="w-full flex flex-col justify-center items-center content-center h-2/4"
|
||||
>
|
||||
<div class="flex flex-row items-center mb-8">
|
||||
<div class="h-32 w-32 fill-navbar-text-color">
|
||||
<Logo />
|
||||
</div>
|
||||
<h1 class="font-roboto whitespace-nowrap font-bold text-navbar-text-color sm:visible text-5xl sm:text-7xl roboto">
|
||||
<h1
|
||||
class="font-roboto whitespace-nowrap text-navbar-text-color sm:visible text-5xl sm:text-7xl roboto"
|
||||
>
|
||||
nebula.
|
||||
</h1>
|
||||
</div>
|
||||
|
@ -37,11 +46,13 @@ import { VERSION } from "astro:env/client";
|
|||
<iframe
|
||||
id="neb-iframe"
|
||||
class="hidden z-100 w-full h-full absolute top-0 bottom-0 bg-primary"
|
||||
src="/loading"
|
||||
></iframe>
|
||||
<div id="version" class="flex flex-row w-full absolute bottom-4 pr-4 pl-4 text-text-color h-6 justify-between font-roboto">
|
||||
<p> Version: { VERSION } </p>
|
||||
<p> © Nebula Services 2024 </p>
|
||||
src="/loading"></iframe>
|
||||
<div
|
||||
id="version"
|
||||
class="flex flex-row w-full absolute bottom-4 pr-4 pl-4 text-text-color h-6 justify-between font-roboto"
|
||||
>
|
||||
<p>Version: {VERSION}</p>
|
||||
<p>© Nebula Services 2024</p>
|
||||
</div>
|
||||
</div>
|
||||
</Layout>
|
||||
|
@ -54,7 +65,7 @@ import { VERSION } from "astro:env/client";
|
|||
SearchEngines,
|
||||
Settings,
|
||||
cloak,
|
||||
settings
|
||||
settings,
|
||||
} from "@utils/settings/index";
|
||||
import { search } from "@utils/search.ts"; //../../utils/search.ts
|
||||
import { client as libcurlClient } from "@utils/libcurl";
|
||||
|
@ -62,25 +73,44 @@ import { VERSION } from "astro:env/client";
|
|||
phrase: string;
|
||||
};
|
||||
async function proxy(term: string, rh: boolean) {
|
||||
const searchEngine = localStorage.getItem(Settings.ProxySettings.searchEngine);
|
||||
const searchEngine = localStorage.getItem(
|
||||
Settings.ProxySettings.searchEngine
|
||||
);
|
||||
const openIn = localStorage.getItem(Settings.ProxySettings.openIn);
|
||||
let proxyUrl: any = __uv$config!.prefix + __uv$config.encodeUrl!(search(term, searchEngine ? SearchEngines[searchEngine] : SearchEngines.ddg));
|
||||
let proxyUrl: any =
|
||||
__uv$config!.prefix +
|
||||
__uv$config.encodeUrl!(
|
||||
search(
|
||||
term,
|
||||
searchEngine ? SearchEngines[searchEngine] : SearchEngines.ddg
|
||||
)
|
||||
);
|
||||
if (rh) {
|
||||
proxyUrl = await RammerheadEncode(search(term, searchEngine ? SearchEngines[searchEngine] : SearchEngines.ddg));
|
||||
proxyUrl = await RammerheadEncode(
|
||||
search(
|
||||
term,
|
||||
searchEngine ? SearchEngines[searchEngine] : SearchEngines.ddg
|
||||
)
|
||||
);
|
||||
}
|
||||
if (openIn === "a:b" || openIn === "blob") {
|
||||
return cloak(openIn as string, "https://google.com", `${window.location.origin}${proxyUrl}`);
|
||||
}
|
||||
else if (openIn === "direct") {
|
||||
return cloak(
|
||||
openIn as string,
|
||||
"https://google.com",
|
||||
`${window.location.origin}${proxyUrl}`
|
||||
);
|
||||
} else if (openIn === "direct") {
|
||||
return (window.location.href = proxyUrl as string);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
return proxyUrl;
|
||||
}
|
||||
}
|
||||
async function uv(iframe: HTMLIFrameElement, term: string) {
|
||||
const conn = await loadProxyScripts();
|
||||
await setTransport(conn, localStorage.getItem(Settings.ProxySettings.transport) as string);
|
||||
await setTransport(
|
||||
conn,
|
||||
localStorage.getItem(Settings.ProxySettings.transport) as string
|
||||
);
|
||||
const sw = await initSw();
|
||||
await settings.marketPlaceSettings.handlePlugins(sw);
|
||||
iframe.classList.remove("hidden");
|
||||
|
@ -93,7 +123,7 @@ import { VERSION } from "astro:env/client";
|
|||
iframe.classList.remove("hidden");
|
||||
const url = await proxy(term, true);
|
||||
if (url) {
|
||||
iframe.src = "/" + url as string;
|
||||
iframe.src = ("/" + url) as string;
|
||||
}
|
||||
}
|
||||
//we need to rerun this on every page load
|
||||
|
@ -105,9 +135,11 @@ import { VERSION } from "astro:env/client";
|
|||
input?.addEventListener("keypress", async function (event: any) {
|
||||
if (event.key === "Enter") {
|
||||
copyright.classList.add("hidden");
|
||||
if (localStorage.getItem(Settings.ProxySettings.proxy) === "automatic") {
|
||||
if (
|
||||
localStorage.getItem(Settings.ProxySettings.proxy) === "automatic"
|
||||
) {
|
||||
const key = SupportedSites[input?.value];
|
||||
switch(key) {
|
||||
switch (key) {
|
||||
case "uv":
|
||||
uv(iframe, input?.value);
|
||||
break;
|
||||
|
@ -118,11 +150,13 @@ import { VERSION } from "astro:env/client";
|
|||
uv(iframe, input?.value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (localStorage.getItem(Settings.ProxySettings.proxy) === "uv") {
|
||||
} else if (
|
||||
localStorage.getItem(Settings.ProxySettings.proxy) === "uv"
|
||||
) {
|
||||
uv(iframe, input?.value);
|
||||
}
|
||||
else if (localStorage.getItem(Settings.ProxySettings.proxy) === "rh") {
|
||||
} else if (
|
||||
localStorage.getItem(Settings.ProxySettings.proxy) === "rh"
|
||||
) {
|
||||
rh(iframe, input?.value);
|
||||
}
|
||||
}
|
||||
|
@ -138,11 +172,11 @@ import { VERSION } from "astro:env/client";
|
|||
}
|
||||
if (value.length >= 3) {
|
||||
await libcurlClient.initLibcurl();
|
||||
const data = await libcurlClient.fetchFromLibcurl(
|
||||
const data = (await libcurlClient.fetchFromLibcurl(
|
||||
`https://api.duckduckgo.com/ac?q=${encodeURIComponent(value)}&format=json`,
|
||||
'json'
|
||||
) as [];
|
||||
const filteredData = data.slice(0,8); //Trim to only about 8 results. Any more and our omnibox dies
|
||||
"json"
|
||||
)) as [];
|
||||
const filteredData = data.slice(0, 8); //Trim to only about 8 results. Any more and our omnibox dies
|
||||
if (filteredData) {
|
||||
omnibox.innerHTML = "";
|
||||
filteredData.map((results: Suggestion) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue