run npm run format

This commit is contained in:
cohenerickson 2023-12-14 08:45:54 -06:00
parent 99b08aff08
commit 2fe742f3f0
17 changed files with 259 additions and 238 deletions

View file

@ -1,17 +1,17 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<title>Nebula</title>
<script src="/ultra/ultra.config.js"></script>
<script src="/ultra/ultra.bundle.js"></script>
<script src="/sw.js"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="color-scheme" content="light dark" />
<title>Nebula</title>
<script src="/ultra/ultra.config.js"></script>
<script src="/ultra/ultra.bundle.js"></script>
<script src="/sw.js"></script>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/index.tsx"></script>
</body>
</html>

View file

@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
autoprefixer: {}
}
};

View file

@ -1,8 +1,8 @@
// @ts-nocheck
importScripts('/ultra/ultra.bundle.js');
importScripts('/ultra/ultra.config.js');
importScripts(__uv$config.sw || '/ultra/ultra.sw.js');
importScripts("/ultra/ultra.bundle.js");
importScripts("/ultra/ultra.config.js");
importScripts(__uv$config.sw || "/ultra/ultra.sw.js");
const sw = new UVServiceWorker();
self.addEventListener('fetch', (event) => event.respondWith(sw.fetch(event)));
self.addEventListener("fetch", (event) => event.respondWith(sw.fetch(event)));

View file

@ -1,5 +1,5 @@
import { HeaderButton } from "./HeaderButton";
import { useTranslation } from 'react-i18next';
import { useTranslation } from "react-i18next";
// Header icons
import { HiOutlineCube } from "react-icons/hi";
@ -10,20 +10,40 @@ export function Header() {
const { t } = useTranslation();
return (
<div id="navbar" className="h-16 px-4 bg-navbar-color flex flex-row items-center justify-between">
<a href="/" class="w-1/2">
<div className="flex flex-row items-center">
<img src="/logo.png" className="h-16 w-16 hover:rotate-[360deg] transition-all duration-1000"></img>
<h1 className="font-roboto text-navbar-text-color text-4xl font-bold">{t('header.title')}</h1>
</div>
</a>
<div className="w-1/2">
<div className="flex flex-row justify-end items-center">
<HeaderButton href="/games" Icon={HiOutlineCube} translationKey="header.games" />
<HeaderButton href="/settings" Icon={RxMixerVertical} translationKey="header.settings" />
<HeaderButton href="/discord" Icon={RiLinksFill} translationKey="header.discord" />
</div>
</div>
<div
id="navbar"
className="flex h-16 flex-row items-center justify-between bg-navbar-color px-4"
>
<a href="/" class="w-1/2">
<div className="flex flex-row items-center">
<img
src="/logo.png"
className="h-16 w-16 transition-all duration-1000 hover:rotate-[360deg]"
></img>
<h1 className="font-roboto text-4xl font-bold text-navbar-text-color">
{t("header.title")}
</h1>
</div>
</a>
<div className="w-1/2">
<div className="flex flex-row items-center justify-end">
<HeaderButton
href="/games"
Icon={HiOutlineCube}
translationKey="header.games"
/>
<HeaderButton
href="/settings"
Icon={RxMixerVertical}
translationKey="header.settings"
/>
<HeaderButton
href="/discord"
Icon={RiLinksFill}
translationKey="header.discord"
/>
</div>
</div>
</div>
);
}

View file

@ -2,23 +2,23 @@ import { useTranslation } from "react-i18next";
import { Link } from "preact-router";
interface HeaderButtonProps {
href: string;
Icon: any;
translationKey: string;
href: string;
Icon: any;
translationKey: string;
}
export function HeaderButton(props: HeaderButtonProps) {
const { href, Icon, translationKey } = props;
const { t } = useTranslation();
const { href, Icon, translationKey } = props;
const { t } = useTranslation();
return (
<Link href={href}>
<div className="group p-4 flex flex-row items-center">
<Icon className="group-hover:text-text-hover-color transition duration-500 w-6 h-6" />
<span className="group-hover:text-text-hover-color transition duration-500 text-text-color text-lg pl-1 font-roboto font-bold">
{t(translationKey)}
</span>
</div>
</Link>
);
return (
<Link href={href}>
<div className="group flex flex-row items-center p-4">
<Icon className="h-6 w-6 transition duration-500 group-hover:text-text-hover-color" />
<span className="font-roboto pl-1 text-lg font-bold text-text-color transition duration-500 group-hover:text-text-hover-color">
{t(translationKey)}
</span>
</div>
</Link>
);
}

View file

@ -1,17 +1,17 @@
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import LanguageDetector from 'i18next-browser-languagedetector';
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import translationEN from './locales/en.json';
import translationJA from './locales/ja.json';
import translationEN from "./locales/en.json";
import translationJA from "./locales/ja.json";
const resources = {
en: {
translation: translationEN,
translation: translationEN
},
ja: {
translation: translationJA,
},
translation: translationJA
}
};
i18n
@ -19,10 +19,10 @@ i18n
.use(LanguageDetector)
.init({
resources,
fallbackLng: 'en',
fallbackLng: "en",
interpolation: {
escapeValue: false,
},
escapeValue: false
}
});
export default i18n;

View file

@ -1,31 +1,31 @@
import { render } from 'preact';
import { LocationProvider, Router, Route } from 'preact-iso';
import { render } from "preact";
import { LocationProvider, Router, Route } from "preact-iso";
import { Header } from './components/Header.jsx';
import { Home } from './pages/Home';
import { NotFound } from './pages/_404.jsx';
import './style.css';
import './themes/main.css';
import './i18n';
import { discordPag } from './pages/discord.js';
import { Header } from "./components/Header.jsx";
import { Home } from "./pages/Home";
import { NotFound } from "./pages/_404.jsx";
import "./style.css";
import "./themes/main.css";
import "./i18n";
import { discordPag } from "./pages/discord.js";
export function App() {
return (
<LocationProvider>
<div class="flex flex-col h-screen">
<Header />
<div class="flex-1 bg-primary">
<main class="h-full">
<Router>
<Route path="/" component={Home} />
<Route path="/discord" component={discordPag} />
<Route default component={NotFound} />
</Router>
</main>
</div>
</div>
</LocationProvider>
);
return (
<LocationProvider>
<div class="flex h-screen flex-col">
<Header />
<div class="flex-1 bg-primary">
<main class="h-full">
<Router>
<Route path="/" component={Home} />
<Route path="/discord" component={discordPag} />
<Route default component={NotFound} />
</Router>
</main>
</div>
</div>
</LocationProvider>
);
}
render(<App />, document.getElementById('app'));
render(<App />, document.getElementById("app"));

View file

@ -1,21 +1,21 @@
{
"header": {
"title": "nebula.",
"games": "Games",
"settings": "Settings",
"discord": "Want more links?"
},
"404": {
"text": "This Nebula Service has been disabled.",
"return": "Back to home"
},
"home": {
"placeholder": "Search the web freely"
},
"discord": {
"title": "Nebula's Discord Server",
"sub": "Would you like to open this via proxy?",
"button1": "Open Normally",
"button2": "Use Proxy"
}
"header": {
"title": "nebula.",
"games": "Games",
"settings": "Settings",
"discord": "Want more links?"
},
"404": {
"text": "This Nebula Service has been disabled.",
"return": "Back to home"
},
"home": {
"placeholder": "Search the web freely"
},
"discord": {
"title": "Nebula's Discord Server",
"sub": "Would you like to open this via proxy?",
"button1": "Open Normally",
"button2": "Use Proxy"
}
}

View file

@ -1,21 +1,21 @@
{
"header": {
"title": "ネブラ。",
"games": "ゲーム",
"settings": "セッティング",
"discord": "もっとリンクが欲しいですか?"
},
"404": {
"text": "このネビュラサービスは無効になっています",
"return": "帰宅"
},
"home": {
"placeholder": "由にウェブを検索"
},
"discord": {
"title": "ネブラDiscordサーバー",
"sub": "プロキシ経由で開きますか?",
"button1": "通常通り開く",
"button2": "プロキシを使用する"
}
"header": {
"title": "ネブラ。",
"games": "ゲーム",
"settings": "セッティング",
"discord": "もっとリンクが欲しいですか?"
},
"404": {
"text": "このネビュラサービスは無効になっています",
"return": "帰宅"
},
"home": {
"placeholder": "由にウェブを検索"
},
"discord": {
"title": "ネブラDiscordサーバー",
"sub": "プロキシ経由で開きますか?",
"button1": "通常通り開く",
"button2": "プロキシを使用する"
}
}

View file

@ -1,24 +1,23 @@
import { useState } from "preact/hooks";
import { useTranslation } from 'react-i18next';
import { useTranslation } from "react-i18next";
export function Home() {
const [isFocused, setIsFocused] = useState(false);
const { t } = useTranslation()
const [isFocused, setIsFocused] = useState(false);
const { t } = useTranslation();
return (
<div class="flex justify-center items-center h-full">
<input
onFocus={(e) => {
setIsFocused(true);
}}
onBlur={(e) => {
setIsFocused(false);
}}
type="text"
class="p-2 border border-input-border-color rounded-2xl h-14 w-80 text-center bg-input text-xl placeholder:text-input-text focus:outline-none font-roboto"
placeholder={isFocused ? '' : t('home.placeholder')}
>
</input>
</div>
);
return (
<div class="flex h-full items-center justify-center">
<input
onFocus={(e) => {
setIsFocused(true);
}}
onBlur={(e) => {
setIsFocused(false);
}}
type="text"
class="font-roboto h-14 w-80 rounded-2xl border border-input-border-color bg-input p-2 text-center text-xl placeholder:text-input-text focus:outline-none"
placeholder={isFocused ? "" : t("home.placeholder")}
></input>
</div>
);
}

View file

@ -1,20 +1,22 @@
import { useTranslation } from 'react-i18next';
import { Link } from 'preact-router';
import { useTranslation } from "react-i18next";
import { Link } from "preact-router";
export function NotFound() {
const { t } = useTranslation()
return (
<section class="h-full">
<div class="flex justify-center items-center h-full flex-col">
<img src="/404.png" class="h-72"></img>
<div class="p-6 flex flex-col items-center">
<p class="text-4xl font-roboto font-bold">{t('404.text')}</p>
<span class="text-3xl font-roboto">404</span>
</div>
<Link href="/">
<button class="p-2 border border-input-border-color rounded-2xl h-14 w-44 text-center bg-input text-xl placeholder:text-input-text focus:outline-none font-roboto">{t('404.return')}</button>
</Link>
</div>
</section>
);
const { t } = useTranslation();
return (
<section class="h-full">
<div class="flex h-full flex-col items-center justify-center">
<img src="/404.png" class="h-72"></img>
<div class="flex flex-col items-center p-6">
<p class="font-roboto text-4xl font-bold">{t("404.text")}</p>
<span class="font-roboto text-3xl">404</span>
</div>
<Link href="/">
<button class="font-roboto h-14 w-44 rounded-2xl border border-input-border-color bg-input p-2 text-center text-xl placeholder:text-input-text focus:outline-none">
{t("404.return")}
</button>
</Link>
</div>
</section>
);
}

View file

@ -1,21 +1,25 @@
import { useTranslation } from 'react-i18next';
import { useTranslation } from "react-i18next";
export function discordPag() {
const { t } = useTranslation()
return (
<section class="h-full">
<div class="flex justify-center items-center h-full flex-col">
<div class="p-6 flex flex-col items-center">
<p class="text-4xl font-roboto font-bold">{t('discord.title')}</p>
<span class="text-3xl font-roboto">{t('discord.sub')}</span>
</div>
<a href="https://discord.gg/unblocker" class="p-6">
<button class="p-2 border border-input-border-color rounded-2xl h-14 w-56 text-center bg-input text-xl placeholder:text-input-text focus:outline-none font-roboto">{t('discord.button1')}</button>
</a>
<a href="/" class="p-6">
<button class="p-2 border border-input-border-color rounded-2xl h-14 w-56 text-center bg-input text-xl placeholder:text-input-text focus:outline-none font-roboto">{t('discord.button2')}</button>
</a>
</div>
</section>
);
const { t } = useTranslation();
return (
<section class="h-full">
<div class="flex h-full flex-col items-center justify-center">
<div class="flex flex-col items-center p-6">
<p class="font-roboto text-4xl font-bold">{t("discord.title")}</p>
<span class="font-roboto text-3xl">{t("discord.sub")}</span>
</div>
<a href="https://discord.gg/unblocker" class="p-6">
<button class="font-roboto h-14 w-56 rounded-2xl border border-input-border-color bg-input p-2 text-center text-xl placeholder:text-input-text focus:outline-none">
{t("discord.button1")}
</button>
</a>
<a href="/" class="p-6">
<button class="font-roboto h-14 w-56 rounded-2xl border border-input-border-color bg-input p-2 text-center text-xl placeholder:text-input-text focus:outline-none">
{t("discord.button2")}
</button>
</a>
</div>
</section>
);
}

View file

@ -1,4 +1,4 @@
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;700;900&display=swap');
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;700;900&display=swap");
@tailwind base;
@tailwind components;

View file

@ -1,26 +1,26 @@
@import url("https://fonts.googleapis.com/css2?family=Dongle&family=Roboto:wght@100&display=swap");
:root {
--background-primary: #191724;
--navbar-color: #26233a;
--navbar-height: 60px;
--navbar-text-color: #7967dd;
--navbar-link-color: #e0def4;
--navbar-link-hover-color: gray;
--navbar-font: "Roboto";
--input-text-color: #e0def4;
--input-placeholder-color: white;
--input-background-color: #1f1d2e;
--input-border-color: #eb6f92;
--input-border-size: 1.3px;
--navbar-logo-filter: none;
}
--background-primary: #191724;
--navbar-color: #26233a;
--navbar-height: 60px;
--navbar-text-color: #7967dd;
--navbar-link-color: #e0def4;
--navbar-link-hover-color: gray;
--navbar-font: "Roboto";
--input-text-color: #e0def4;
--input-placeholder-color: white;
--input-background-color: #1f1d2e;
--input-border-color: #eb6f92;
--input-border-size: 1.3px;
--navbar-logo-filter: none;
}
.font-inter {
font-family: 'Inter', sans-serif;
font-weight: 300;
font-family: "Inter", sans-serif;
font-weight: 300;
}
.font-roboto {
font-family: 'Roboto';
font-family: "Roboto";
}

View file

@ -1,22 +1,18 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
colors: {
"primary": "var(--background-primary)",
primary: "var(--background-primary)",
"navbar-text-color": "var(--navbar-text-color)",
"navbar-color": "var(--navbar-color)",
"text-color": "var(--navbar-link-color)",
"text-hover-color": "var(--navbar-link-hover-color)",
"input": "var(--input-background-color)",
input: "var(--input-background-color)",
"input-text": "var(--input-text-color)",
"input-border-color": "var(--input-border-color)"
},
extend: {},
extend: {}
},
plugins: [],
}
plugins: []
};

View file

@ -1,20 +1,20 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"noEmit": true,
"allowJs": true,
"checkJs": true,
"compilerOptions": {
"target": "ES2020",
"module": "ESNext",
"moduleResolution": "bundler",
"noEmit": true,
"allowJs": true,
"checkJs": true,
/* Preact Config */
"jsx": "react-jsx",
"jsxImportSource": "preact",
"skipLibCheck": true,
"paths": {
"react": ["./node_modules/preact/compat/"],
"react-dom": ["./node_modules/preact/compat/"]
}
},
"include": ["node_modules/vite/client.d.ts", "**/*"]
/* Preact Config */
"jsx": "react-jsx",
"jsxImportSource": "preact",
"skipLibCheck": true,
"paths": {
"react": ["./node_modules/preact/compat/"],
"react-dom": ["./node_modules/preact/compat/"]
}
},
"include": ["node_modules/vite/client.d.ts", "**/*"]
}

View file

@ -1,8 +1,8 @@
import million from 'million/compiler';
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
import million from "million/compiler";
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [million.vite({ auto: true }), preact()],
plugins: [million.vite({ auto: true }), preact()]
});