This commit is contained in:
rift 2024-07-22 22:58:16 -05:00
parent 781a31d3bb
commit ed919b2f21
14 changed files with 189 additions and 264 deletions

15
package-lock.json generated
View file

@ -13,6 +13,7 @@
"@iconify-json/ph": "^1.1.13",
"astro": "^4.12.2",
"astro-icon": "^1.1.0",
"nanostores": "^0.10.3",
"tailwindcss": "^3.4.6",
"typescript": "^5.5.3"
}
@ -5226,6 +5227,20 @@
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
}
},
"node_modules/nanostores": {
"version": "0.10.3",
"resolved": "https://registry.npmjs.org/nanostores/-/nanostores-0.10.3.tgz",
"integrity": "sha512-Nii8O1XqmawqSCf9o2aWqVxhKRN01+iue9/VEd1TiJCr9VT5XxgPFbF1Edl1XN6pwJcZRsl8Ki+z01yb/T/C2g==",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"engines": {
"node": "^18.0.0 || >=20.0.0"
}
},
"node_modules/nlcst-to-string": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz",

View file

@ -15,6 +15,7 @@
"@iconify-json/ph": "^1.1.13",
"astro": "^4.12.2",
"astro-icon": "^1.1.0",
"nanostores": "^0.10.3",
"tailwindcss": "^3.4.6",
"typescript": "^5.5.3"
}

View file

@ -1,5 +1,6 @@
---
import { getLangFromUrl, useTranslations } from "../i18n/utils";
import { isMobileNavOpen } from "../store.js";
import Logo from "./Logo.astro";
import HeaderButton from "./HeaderButton.astro";
import { Icon } from "astro-icon/components";
@ -11,9 +12,10 @@ const t = useTranslations(lang);
id="navbar"
class="flex h-16 flex-row items-center justify-end border-b-2 border-border-color bg-navbar-color px-4"
>
<a href="/" class="w-1/8">
<div class="relative flex flex-row">
<HeaderButton text="Games">
<div class="w-1/8">
{/* Typical desktop menu */}
<div class="relative flex-row hidden md:flex">
<HeaderButton text={t("header.games")}>
<Icon
name="ph:cube"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
@ -22,18 +24,50 @@ const t = useTranslations(lang);
/* Astro won't let us pass the icon as a prop so it's going into the outlet here. */
}
</HeaderButton>
<HeaderButton text={t("faq.whatIsAProxy")}>
<HeaderButton text={t("header.settings")}>
<Icon
name="ph:wrench-fill"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
/>
</HeaderButton>
<HeaderButton text="Want more links?">
<HeaderButton text={t("header.morelinks")}>
<Icon
name="ph:link-bold"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
/>
</HeaderButton>
</div>
</a>
{/* Mobile hamburger menu */}
<div class="flex md:hidden" id="mobileNavTrigger">
<Icon name="ph:text-align-justify-bold" class="h-9 w-9 text-text-color" />
</div>
</div>
</div>
<script>
import { isMobileNavOpen } from "../store.js";
let isMobileNavOpenLocal = true;
// Create a copy of the nano store so we can make this a toggle
// Set the store to true when the button is clicked
function openDialog() {
if (isMobileNavOpenLocal == false) {
isMobileNavOpen.set(true);
} else {
isMobileNavOpen.set(false);
}
}
isMobileNavOpen.subscribe((open) => {
if (open) {
isMobileNavOpenLocal = true;
} else {
isMobileNavOpenLocal = false;
}
});
// Add an event listener to the button
const mobileNavTrigger = document.getElementById("mobileNavTrigger");
if (mobileNavTrigger) {
mobileNavTrigger.addEventListener("click", openDialog);
}
</script>

View file

@ -3,7 +3,7 @@ const { text, icon } = Astro.props;
---
<div
class="group flex w-full flex-row items-center justify-center border-t-2 border-solid border-navbar-text-color p-4 md:border-none"
class="group flex w-full flex-row items-center justify-center border-t-2 border-solid border-navbar-text-color p-4 md:border-none h-1/3 md:h-fit"
>
<slot />
<span

View file

@ -0,0 +1,30 @@
---
import { getLangFromUrl, useTranslations } from "../i18n/utils";
import HeaderButton from "./HeaderButton.astro";
import { Icon } from "astro-icon/components";
const lang = getLangFromUrl(Astro.url);
const t = useTranslations(lang);
---
<div
class="absolute bottom-0 h-[calc(100%-4rem)] flex w-full flex-col justify-evenly md:flex-row bg-navbar-color m-auto"
>
<HeaderButton text={t("header.games")}>
<Icon
name="ph:cube"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
/>
</HeaderButton>
<HeaderButton text={t("header.settings")}>
<Icon
name="ph:wrench-fill"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
/>
</HeaderButton>
<HeaderButton text={t("header.morelinks")}>
<Icon
name="ph:link-bold"
class="h-6 w-6 text-text-color transition duration-500 group-hover:text-text-hover-color md:h-6 md:w-6"
/>
</HeaderButton>
</div>

View file

@ -1,65 +0,0 @@
{
"ultraviolet": "Ultraviolet",
"pages.home": "Home | Alu",
"pages.games": "Games | Alu",
"pages.settings": "Settings | Alu",
"nav.brand": "Alu",
"nav.games": "Games",
"nav.settings": "Settings",
"menu.welcome": "Welcome to Alu",
"menu.search": "Search the web...",
"faq.title": "Frequently Asked Questions",
"faq.whatIsAProxy": "What is a proxy?",
"faq.whatIsAProxy.answer": "A proxy is a method of making your internet traffic anonymous by sending your request to a server (proxy), having that make the request, and then send it back to you! This allows for a much larger level of security, as well as bypassing website restrictions in public spaces and censorship.",
"faq.noBareClients": "What does \"there are no bare clients\" mean?",
"faq.noBareClients.answer": "There are a couple reasons this particular error happens, but it's most commonly an issue with the proxy failing to load. Please reload the page, and if the problem persists, make a GitHub issue!",
"faq.contributeToAlu": "How can I contribute to Alu?",
"faq.contributeToAlu.answer.segment1": "Spreading the word of Alu is a great start, but if you really enjoy Alu, and want private links, consider supporting me through Patreon!",
"faq.contributeToAlu.answer.patreonLinkText": "You can support me here!",
"faq.contributeToAlu.answer.segment2": "Thank you for helping to make Alu great!",
"footer.brand": "Alu",
"footer.madeWithLove": "Made with ❤️ by wearr",
"footer.poweredBy": "Titanium Network",
"footer.services": "Services",
"footer.socials": "Socials",
"footer.aluProject": "Alu Project",
"games.title": "Games",
"games.search": "Search...",
"settings.title": "Settings",
"settings.proxy": "Proxy",
"settings.proxy.auto": "Auto",
"settings.proxy.selectedProxy": "Selected Proxy",
"settings.proxy.searchEngine": "Search Engine",
"settings.proxy.openPageWith": "Open With",
"settings.proxy.openPageWith.embed": "Embed",
"settings.proxy.openPageWith.newTab": "New Tab",
"settings.proxy.searxngURL": "Searx URL",
"settings.proxy.transport": "Transport",
"settings.proxy.wispURL": "Wisp URL",
"settings.proxy.bareURL": "Bare URL",
"settings.customization": "Customization",
"settings.customization.theme": "Theme",
"settings.customization.theme.Alu": "Alu",
"settings.customization.theme.Macchiato": "Macchiato",
"settings.customization.theme.Mocha": "Mocha",
"settings.customization.language": "Language",
"settings.cloaking": "Cloaking",
"settings.cloaking.subtext": "Change how your tab looks...",
"settings.cloaking.updateCloak": "Update Cloak",
"settings.credits": "Credits",
"settings.credits.mochaandmacchiatothemes": "Mocha & Macchiato Themes",
"settings.credits.japaneseTranslations": "Japanese Translations"
}

5
src/i18n/en_US.json Normal file
View file

@ -0,0 +1,5 @@
{
"header.games": "Games",
"header.settings": "Settings",
"header.morelinks": "Want more links?"
}

View file

@ -1,65 +1,5 @@
{
"ultraviolet": "Ultraviolet",
"pages.home": "ホーム | Alu",
"pages.games": "ゲーム | Alu",
"pages.settings": "設定 | Alu",
"nav.brand": "Alu",
"nav.games": "ゲーム",
"nav.settings": "設定",
"menu.welcome": "Aluへようこそ",
"menu.search": "検索",
"faq.title": "よくある質問",
"faq.whatIsAProxy": "プロキシとは",
"faq.whatIsAProxy.answer": "プロキシは、インターネットを接続する際に、ネットワークの内部から外部へのアクセスを代理で行うシステムのことです。ウェブサイトにアクセスする際に自分のIPアドレスを隠すことができます。",
"faq.noBareClients": "エラー「there are no bare clients.」とは",
"faq.noBareClients.answer": "このエラーは、通常はプロキシのロードに失敗したことを意味します。ページをリロードするか、GitHubで問題を作成してください。",
"faq.contributeToAlu": "貢献をするには",
"faq.contributeToAlu.answer.segment1": "Alu を広めることは素晴らしいことです。プライベートリンクが必要な場合は、Patreon を通じて私をサポートすることを検討してください。",
"faq.contributeToAlu.answer.patreonLinkText": "ここで私に貢献できます",
"faq.contributeToAlu.answer.segment2": "Aluに貢献していただきありがとうございます。",
"footer.brand": "Alu",
"footer.madeWithLove": "wearrによる❤で作られました",
"footer.poweredBy": "Titanium Network",
"footer.services": "サービス",
"footer.socials": "ソーシャル",
"footer.aluProject": "Alu Project",
"games.title": "ゲーム",
"games.search": "検索...",
"settings.title": "設定",
"settings.proxy": "プロキシ",
"settings.proxy.auto": "自動",
"settings.proxy.selectedProxy": "選択したプロキシ",
"settings.proxy.searchEngine": "検索エンジン",
"settings.proxy.openPageWith": "開く",
"settings.proxy.openPageWith.embed": "埋め込み",
"settings.proxy.openPageWith.newTab": "新しいタブ",
"settings.proxy.searxngURL": "Searx URL",
"settings.proxy.transport": "Transport",
"settings.proxy.wispURL": "Wisp URL",
"settings.proxy.bareURL": "Bare URL",
"settings.customization": "カスタマイズ",
"settings.customization.theme": "テーマ",
"settings.customization.theme.Alu": "Alu",
"settings.customization.theme.Macchiato": "マキアート",
"settings.customization.theme.Mocha": "モカ",
"settings.customization.language": "言語",
"settings.cloaking": "クローキング",
"settings.cloaking.subtext": "タブの見た目を変更します...",
"settings.cloaking.updateCloak": "クロークを更新",
"settings.credits": "クレジット",
"settings.credits.mochaandmacchiatothemes": "モカとマキアートテーマ",
"settings.credits.japaneseTranslations": "日本語翻訳"
}
{
"header.games": "ゲーム",
"header.settings": "設定",
"header.morelinks": "リンク一覧"
}

View file

@ -1,9 +1,9 @@
import en from "./en.json";
import en_US from "./en_US.json";
import jp from "./jp.json";
export const defaultLang = "en";
export const defaultLang = "en_US";
export const ui = {
en,
en_US,
jp,
};

View file

@ -1,7 +1,7 @@
import { ui, defaultLang } from "./ui";
export const STATIC_PATHS = [
{ params: { lang: "en" } },
{ params: { lang: "en_US" } },
{ params: { lang: "jp" } },
];

View file

@ -19,7 +19,7 @@ const { title } = Astro.props;
<meta name="generator" content={Astro.generator} />
<title>{title}</title>
</head>
<body>
<body class="h-screen overflow-x-hidden">
<Header />
<slot />
</body>

View file

@ -0,0 +1,49 @@
---
import { STATIC_PATHS } from "../../i18n/utils";
import Layout from "../../layouts/Layout.astro";
import Card from "../../components/Card.astro";
import MobileNavigation from "../../components/MobileNavigation.astro";
export function getStaticPaths() {
return STATIC_PATHS;
}
---
<Layout title="Welcome to Astro.">
<p>The services</p>
<p id="">Mobile Navvy</p>
<div id="mobileNavMenu" class="hidden w-full">
<MobileNavigation />
</div>
</Layout>
<script>
import { isMobileNavOpen } from "../../store.js";
const mobileNavMenu = document.getElementById("mobileNavMenu");
// Listen to changes in the store, and show/hide the mobile navigation accordingly
isMobileNavOpen.subscribe((open) => {
if (open) {
if (mobileNavMenu) {
mobileNavMenu.style.display = "block";
}
} else {
if (mobileNavMenu) {
mobileNavMenu.style.display = "none";
}
}
});
</script>
<style>
#mobileNavMenu {
-webkit-transition-duration: 600ms;
transition-duration: 600ms;
}
@keyframes slide-left {
from {
padding-left: 100%;
}
to {
padding-left: 0%;
}
}
</style>

View file

@ -3,126 +3,39 @@ import Layout from "../layouts/Layout.astro";
import Card from "../components/Card.astro";
---
<meta http-equiv="refresh" content="0;url=/en/" />
<Layout title="Welcome to Astro.">
<main>
<svg
class="astro-a"
width="495"
height="623"
viewBox="0 0 495 623"
fill="none"
xmlns="http://www.w3.org/2000/svg"
aria-hidden="true"
>
<path
fill-rule="evenodd"
clip-rule="evenodd"
d="M167.19 364.254C83.4786 364.254 0 404.819 0 404.819C0 404.819 141.781 19.4876 142.087 18.7291C146.434 7.33701 153.027 0 162.289 0H332.441C341.703 0 348.574 7.33701 352.643 18.7291C352.92 19.5022 494.716 404.819 494.716 404.819C494.716 404.819 426.67 364.254 327.525 364.254L264.41 169.408C262.047 159.985 255.147 153.581 247.358 153.581C239.569 153.581 232.669 159.985 230.306 169.408L167.19 364.254ZM160.869 530.172C160.877 530.18 160.885 530.187 160.894 530.195L160.867 530.181C160.868 530.178 160.868 530.175 160.869 530.172ZM136.218 411.348C124.476 450.467 132.698 504.458 160.869 530.172C160.997 529.696 161.125 529.242 161.248 528.804C161.502 527.907 161.737 527.073 161.917 526.233C165.446 509.895 178.754 499.52 195.577 500.01C211.969 500.487 220.67 508.765 223.202 527.254C224.141 534.12 224.23 541.131 224.319 548.105C224.328 548.834 224.337 549.563 224.347 550.291C224.563 566.098 228.657 580.707 237.264 593.914C245.413 606.426 256.108 615.943 270.749 622.478C270.593 621.952 270.463 621.508 270.35 621.126C270.045 620.086 269.872 619.499 269.685 618.911C258.909 585.935 266.668 563.266 295.344 543.933C298.254 541.971 301.187 540.041 304.12 538.112C310.591 533.854 317.059 529.599 323.279 525.007C345.88 508.329 360.09 486.327 363.431 457.844C364.805 446.148 363.781 434.657 359.848 423.275C358.176 424.287 356.587 425.295 355.042 426.275C351.744 428.366 348.647 430.33 345.382 431.934C303.466 452.507 259.152 455.053 214.03 448.245C184.802 443.834 156.584 436.019 136.218 411.348Z"
fill="url(#paint0_linear_1805_24383)"></path>
<defs>
<linearGradient
id="paint0_linear_1805_24383"
x1="247.358"
y1="0"
x2="247.358"
y2="622.479"
gradientUnits="userSpaceOnUse"
>
<stop stop-opacity="0.9"></stop>
<stop offset="1" stop-opacity="0.2"></stop>
</linearGradient>
</defs>
</svg>
<h1>Welcome to <span class="text-gradient">Astro</span></h1>
<p class="instructions">
To get started, open the directory <code>src/pages</code> in your project.<br
/>
<strong>Code Challenge:</strong> Tweak the "Welcome to Astro" message above.
</p>
<ul role="list" class="link-card-grid">
<Card
href="https://docs.astro.build/"
title="Documentation"
body="Learn how Astro works and explore the official API docs."
/>
<Card
href="https://astro.build/integrations/"
title="Integrations"
body="Supercharge your project with new frameworks and libraries."
/>
<Card
href="https://astro.build/themes/"
title="Themes"
body="Explore a galaxy of community-built starter themes."
/>
<Card
href="https://astro.build/chat/"
title="Community"
body="Come say hi to our amazing Discord community. ❤️"
/>
</ul>
</main>
</Layout>
<style>
main {
margin: auto;
padding: 1rem;
width: 800px;
max-width: calc(100% - 2rem);
color: white;
font-size: 20px;
line-height: 1.6;
loading...
<script>
let currentLang = localStorage.getItem("selectedLanguage");
const redirect = (loc: string) => (window.location.href = loc);
if (currentLang) {
try {
let parsed = JSON.parse(currentLang).value;
switch (parsed) {
case "en_US":
redirect("/en_US/");
break;
case "jp":
redirect("/jp/");
break;
default:
redirect("/en/");
break;
}
} catch {
localStorage.clear();
window.location.reload();
}
} else {
if (navigator.language.includes("ja")) {
localStorage.setItem("selectedLanguage", JSON.stringify({ value: "jp" }));
redirect("/jp/");
} else {
localStorage.setItem(
"selectedLanguage",
JSON.stringify({ value: "en_US" })
);
redirect("/en_US/");
}
}
.astro-a {
position: absolute;
top: -32px;
left: 50%;
transform: translatex(-50%);
width: 220px;
height: auto;
z-index: -1;
}
h1 {
font-size: 4rem;
font-weight: 700;
line-height: 1;
text-align: center;
margin-bottom: 1em;
}
.text-gradient {
background-image: var(--accent-gradient);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-size: 400%;
background-position: 0%;
}
.instructions {
margin-bottom: 2rem;
border: 1px solid rgba(var(--accent-light), 25%);
background: linear-gradient(
rgba(var(--accent-dark), 66%),
rgba(var(--accent-dark), 33%)
);
padding: 1.5rem;
border-radius: 8px;
}
.instructions code {
font-size: 0.8em;
font-weight: bold;
background: rgba(var(--accent-light), 12%);
color: rgb(var(--accent-light));
border-radius: 4px;
padding: 0.3em 0.4em;
}
.instructions strong {
color: rgb(var(--accent-light));
}
.link-card-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(24ch, 1fr));
gap: 2rem;
padding: 0;
}
</style>
</script>
<noscript></noscript>You need to enable JavaScript to run this app.

3
src/store.js Normal file
View file

@ -0,0 +1,3 @@
import { atom } from "nanostores";
export const isMobileNavOpen = atom(false);