This commit is contained in:
MathMan05
2025-10-14 14:31:56 -05:00
parent a4a23a2616
commit e4bfab408b
5 changed files with 139 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>It seems you're lost</title>
<meta content="It seems you're lost" property="og:title" />
<meta
content="Maybe you meant for a different URL, this is not a part of Fermi"
property="og:description"
/>
<meta
name="description"
content="Maybe you meant for a different URL, this is not a part of Fermi"
/>
<meta content="/logo.webp" property="og:image" />
<meta content="#4b458c" name="theme-color" />
<link href="/style.css" rel="stylesheet" />
<link href="/themes.css" rel="stylesheet" id="lightcss" />
<style>
body.no-theme {
background: #16191b;
}
@media (prefers-color-scheme: light) {
body.no-theme {
background: #9397bd;
}
}
</style>
</head>
<body class="no-theme">
<div class="errorHTML">
<img src="./logo.svg" with="128" height="128" />
<div>
<h1 i18n="404.title">It seems you're lost</h1>
<h3 i18n="404.404">404 Page Not Found</h3>
<b i18n="404.listtitle">Maybe you meant to go to one of these places</b>
<ul>
<li><a href="/" i18n="404.home">Home Page</a></li>
<li><a href="/app" i18n="404.app">To the app</a></li>
<li><a href="/login" i18n="404.login">Login</a></li>
<li><a href="/reset" i18n="404.reset">Password reset page</a></li>
<li><a href="https://blog.fermi.chat" i18n="404.blog">The Fermi blog</a></li>
<li><a i18n="404.whereever" id="whereever">Wherever this is</a></li>
</ul>
<div>
<h3 i18n="404.report">If you found this page within the client please report it:</h3>
<a href="https://github.com/MathMan05/Fermi/issues">Github</a>
</div>
</div>
</div>
<script src="/404.js" type="module"></script>
</body>
</html>
+26
View File
@@ -0,0 +1,26 @@
import {I18n} from "./i18n";
import {setTheme} from "./utils/utils";
setTheme();
await I18n.done;
I18n.translatePage();
const easterEvents = [
() => {
window.open("https://youtube.com/watch?v=dQw4w9WgXcQ");
},
() => {
window.open("https://youtube.com/watch?v=fC7oUOUEEi4");
},
() => {
alert(I18n[404].whatelse());
},
];
const where = document.getElementById("whereever");
if (where) {
where.onclick = () => {
const event = easterEvents[Math.floor(Math.random() * easterEvents.length)];
event();
};
}
+11
View File
@@ -27,6 +27,17 @@ class I18n {
res();
}
static translatePage() {
const elms = document.querySelectorAll("[i18n]");
for (const elm of Array.from(elms)) {
const t = elm.getAttribute("i18n") as string;
try {
elm.textContent = this.getTranslation(t);
} catch {
console.error("Couldn't get " + t + "'s translation");
}
}
}
static getTranslation(msg: string, ...params: string[]): string {
let str: string | undefined;
const path = msg.split(".");
+35
View File
@@ -929,6 +929,41 @@ textarea {
transform: translate(-50%, 0);
}
}
.errorHTML {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
height: 100vh;
justify-content: center;
align-content: center;
h3 {
margin-bottom: 15px;
}
> div {
background: var(--primary-bg);
padding: 15px;
border-radius: 10px;
height: 60%;
width: 60%;
box-shadow: 5px 5px 5px black;
display: flex;
flex-direction: column;
> div {
padding: 10px;
box-shadow: 0px 0px 5px black;
border-radius: 10px;
margin-top: auto;
}
}
img {
background: var(--primary-bg);
padding: 10px;
border-radius: 10px 10px 0 0;
box-shadow: 5px 5px 5px black;
}
}
.editMessage {
background: var(--typebox-bg);
padding: 0.05in;
+13
View File
@@ -715,6 +715,19 @@
"errEmjMust": "Must include an emoji with your sticker",
"tags": "Associated Emoji: "
},
"404":{
"home":"Home page",
"title":"It seems you're lost",
"404":"404 Page Not Found",
"listtitle":"Maybe you meant to go to one of these places",
"app":"To the app",
"login":"Login",
"reset":"Password reset page",
"blog":"The Fermi blog",
"whereever":"Wherever this is",
"report":"If you found this page within the client please report it:",
"whatelse":"What else do you think should happen?"
},
"widget": "Guild Widget",
"widgetEnabled": "Widget enabled",
"incorrectURLS": "## This instance has likely sent the incorrect URLs.\n### If you're the instance owner please see [here](https://docs.spacebar.chat/setup/server/) under *Connecting from remote machines* to correct the issue.\n Would you like Fermi to automatically try to fix this error to let you connect to the instance?",