Add welcome logging, and create credits tab.

This commit is contained in:
wearrrrr 2024-01-31 13:51:39 -06:00
parent 7f41219948
commit 1ffea9ccaa
5 changed files with 25 additions and 3 deletions

View file

@ -196,7 +196,6 @@ const t = useTranslations(lang);
function setupCloakingSettings() {
Array.from(document.getElementById('cloak-list').children).forEach((cloak) => {
cloak.addEventListener('click', () => {
console.log("Here!")
let cloakName = cloak.dataset.cloakName
let cloakIcon = cloak.dataset.cloakIcon
@ -324,7 +323,11 @@ const t = useTranslations(lang);
document.addEventListener('setting-tabLoad', setupSettings)
function navigateToNewLangaugePage() {
switch (JSON.parse(localStorage.getItem("alu__selectedLanguage")).value) {
let value = JSON.parse(localStorage.getItem("alu__selectedLanguage")).value
let currentLanguage = window.location.pathname.split("/")[1]
// Do nothing.. because we're already on the page.
if (value == currentLanguage) return;
switch (value) {
case "en":
window.location.href = "/en/settings/"
break;

View file

@ -0,0 +1,11 @@
<script is:inline>
console.log("%cWelcome to Alu", "color: #0251d9; font-size: 2rem; font-weight: bold; text-shadow: 2px 2px 0 #033c9e;");
console.log("%cSystem Information: ", "color: #025bf5; font-size: 1rem; font-weight: bold;");
console.log("%cOS: %c" + navigator.platform, "color: #025bf5; font-size: 0.75rem; font-weight: bold;", "color: #025bf5; font-size: 0.75rem;");
console.log("%cBrowser: %c" + navigator.userAgent, "color: #025bf5; font-size: 0.75rem; font-weight: bold;", "color: #025bf5; font-size: 0.75rem;");
console.log("%cCPU Cores: %c" + navigator.hardwareConcurrency, "color: #025bf5; font-size: 0.75rem; font-weight: bold;", "color: #025bf5; font-size: 0.75rem;");
// Cmon firefox, do we really not support this?? Basic stuff here from the "indie browser".
console.log("%cMemory: %c" + navigator.deviceMemory + "GB", "color: #025bf5; font-size: 0.75rem; font-weight: bold;", "color: #025bf5; font-size: 0.75rem;");
console.log("%cPlease include this information in a bug report!", "color: #025bf5; font-size: 0.75rem; font-weight: bold;");
</script>

View file

@ -4,6 +4,7 @@ import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import ThemeLoader from '../components/ThemeLoader.astro';
import CloakLoader from '../components/CloakLoader.astro';
import WelcomeLogging from '../components/WelcomeLogging.astro';
type Preload = {
"href": string
@ -40,6 +41,7 @@ const { title, optionalPreloads } = Astro.props;
<body>
<Header></Header>
<slot transition:animate={"fade"} />
<WelcomeLogging />
<Footer></Footer>
</body>
</html>

View file

@ -12,7 +12,9 @@ import { ViewTransitions } from "astro:transitions";
if (localStorage.getItem("alu__selectedLanguage") === null) window.location.href = "/en/";
let currentLang = localStorage.getItem("alu__selectedLanguage");
if (currentLang) {
switch (JSON.parse(currentLang).value) {
try {
let parsed = JSON.parse(currentLang).value
switch (parsed) {
case "en":
window.location.href = "/en/";
break;
@ -23,6 +25,10 @@ import { ViewTransitions } from "astro:transitions";
window.location.href = "/en/";
break;
}
} catch {
localStorage.clear();
window.location.reload();
}
}
</script>