Add welcome logging, and create credits tab.
This commit is contained in:
parent
7f41219948
commit
1ffea9ccaa
5 changed files with 25 additions and 3 deletions
0
src/components/SettingsContent/CreditsTab.astro
Normal file
0
src/components/SettingsContent/CreditsTab.astro
Normal file
|
|
@ -196,7 +196,6 @@ const t = useTranslations(lang);
|
||||||
function setupCloakingSettings() {
|
function setupCloakingSettings() {
|
||||||
Array.from(document.getElementById('cloak-list').children).forEach((cloak) => {
|
Array.from(document.getElementById('cloak-list').children).forEach((cloak) => {
|
||||||
cloak.addEventListener('click', () => {
|
cloak.addEventListener('click', () => {
|
||||||
console.log("Here!")
|
|
||||||
let cloakName = cloak.dataset.cloakName
|
let cloakName = cloak.dataset.cloakName
|
||||||
let cloakIcon = cloak.dataset.cloakIcon
|
let cloakIcon = cloak.dataset.cloakIcon
|
||||||
|
|
||||||
|
|
@ -324,7 +323,11 @@ const t = useTranslations(lang);
|
||||||
document.addEventListener('setting-tabLoad', setupSettings)
|
document.addEventListener('setting-tabLoad', setupSettings)
|
||||||
|
|
||||||
function navigateToNewLangaugePage() {
|
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":
|
case "en":
|
||||||
window.location.href = "/en/settings/"
|
window.location.href = "/en/settings/"
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
11
src/components/WelcomeLogging.astro
Normal file
11
src/components/WelcomeLogging.astro
Normal 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>
|
||||||
|
|
@ -4,6 +4,7 @@ import Header from '../components/Header.astro';
|
||||||
import Footer from '../components/Footer.astro';
|
import Footer from '../components/Footer.astro';
|
||||||
import ThemeLoader from '../components/ThemeLoader.astro';
|
import ThemeLoader from '../components/ThemeLoader.astro';
|
||||||
import CloakLoader from '../components/CloakLoader.astro';
|
import CloakLoader from '../components/CloakLoader.astro';
|
||||||
|
import WelcomeLogging from '../components/WelcomeLogging.astro';
|
||||||
|
|
||||||
type Preload = {
|
type Preload = {
|
||||||
"href": string
|
"href": string
|
||||||
|
|
@ -40,6 +41,7 @@ const { title, optionalPreloads } = Astro.props;
|
||||||
<body>
|
<body>
|
||||||
<Header></Header>
|
<Header></Header>
|
||||||
<slot transition:animate={"fade"} />
|
<slot transition:animate={"fade"} />
|
||||||
|
<WelcomeLogging />
|
||||||
<Footer></Footer>
|
<Footer></Footer>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,9 @@ import { ViewTransitions } from "astro:transitions";
|
||||||
if (localStorage.getItem("alu__selectedLanguage") === null) window.location.href = "/en/";
|
if (localStorage.getItem("alu__selectedLanguage") === null) window.location.href = "/en/";
|
||||||
let currentLang = localStorage.getItem("alu__selectedLanguage");
|
let currentLang = localStorage.getItem("alu__selectedLanguage");
|
||||||
if (currentLang) {
|
if (currentLang) {
|
||||||
switch (JSON.parse(currentLang).value) {
|
try {
|
||||||
|
let parsed = JSON.parse(currentLang).value
|
||||||
|
switch (parsed) {
|
||||||
case "en":
|
case "en":
|
||||||
window.location.href = "/en/";
|
window.location.href = "/en/";
|
||||||
break;
|
break;
|
||||||
|
|
@ -23,6 +25,10 @@ import { ViewTransitions } from "astro:transitions";
|
||||||
window.location.href = "/en/";
|
window.location.href = "/en/";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
} catch {
|
||||||
|
localStorage.clear();
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue