From 1418d7e7d2fc1db0c9497f816a4cd4813206422e Mon Sep 17 00:00:00 2001
From: Spectralitree <72747870+Spectralitree@users.noreply.github.com>
Date: Sat, 11 Dec 2021 15:56:47 +0100
Subject: [PATCH] feat: add beginnings of settings page
---
src/App.svelte | 4 +++
src/pages/Dash.svelte | 5 +++-
src/pages/Settings.svelte | 52 +++++++++++++++++++++++++++++++++++++++
3 files changed, 60 insertions(+), 1 deletion(-)
create mode 100644 src/pages/Settings.svelte
diff --git a/src/App.svelte b/src/App.svelte
index a9ebca60..1e4faf6f 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -3,6 +3,7 @@
import Navigation from "./lib/Navigation.svelte";
import Dash from "./pages/Dash.svelte";
import Home from "./pages/Home.svelte";
+ import Settings from './pages/Settings.svelte';
// theme cdns (I might make some myself too)
let light = "https://cdn.jsdelivr.net/npm/bootstrap@5.1.0/dist/css/bootstrap.min.css";
@@ -44,5 +45,8 @@
+
+
+
\ No newline at end of file
diff --git a/src/pages/Dash.svelte b/src/pages/Dash.svelte
index ddd55463..cb4568c7 100644
--- a/src/pages/Dash.svelte
+++ b/src/pages/Dash.svelte
@@ -30,6 +30,8 @@
navigate("/");
}
+ let settings = JSON.parse(localStorage.getItem("pk-settings"));
+
async function login(token: string) {
const api = new PKAPI();
try {
@@ -53,7 +55,8 @@
-{#if user && user.banner}
+
+{#if user && user.banner && settings && settings.appearance.banner_top}
{/if}
diff --git a/src/pages/Settings.svelte b/src/pages/Settings.svelte
new file mode 100644
index 00000000..d62e6bdf
--- /dev/null
+++ b/src/pages/Settings.svelte
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
Personal settings
+
+
+
+ These settings are saved in your localstorage. This means that you have to reapply these every time you visit in a different browser, or clear your browser's cookies.
+ Appearance
+
+
+
+ Show banners in the background? {settings.appearance.banner_top = !settings.appearance.banner_top; localStorage.setItem("pk-settings", JSON.stringify(settings));}}/>
+ Toggles banners from the top of the system, member and group pages.
+
+
+ Show banners at the bottom of cards? {settings.appearance.banner_bottom = !settings.appearance.banner_bottom; localStorage.setItem("pk-settings", JSON.stringify(settings));}}/>
+ Toggles banners at the bottom of the system, member and group cards.
+
+
+
+
+
+
+
\ No newline at end of file