Update dependencies and add new features

This commit is contained in:
Sean Morley
2024-04-20 00:53:01 +00:00
parent da8b4c342d
commit 348c545419
10 changed files with 92 additions and 48 deletions

View File

@@ -9,6 +9,7 @@
import { page } from "$app/stores";
import { inject } from "@vercel/analytics";
import { injectSpeedInsights } from "@vercel/speed-insights/sveltekit";
import "iconify-icon";
if (data.usingVercel === "true") {
inject();

View File

@@ -3,7 +3,9 @@ import { fail, redirect } from "@sveltejs/kit";
import type { Actions, PageServerLoad } from "./$types";
export const load: PageServerLoad = async (event: { locals: { user: any; }; }) => {
export const load: PageServerLoad = async (event: {
locals: { user: any };
}) => {
if (event.locals.user)
return {
user: event.locals.user,
@@ -28,10 +30,15 @@ export const actions: Actions = {
});
return redirect(302, "/login");
},
setTheme: async ( { url, cookies }) => {
setTheme: async ({ url, cookies }) => {
const theme = url.searchParams.get("theme");
// change the theme only if it is one of the allowed themes
if (theme && ["light", "dark", "night", "retro", "forest", "nord"].includes(theme)) {
if (
theme &&
["light", "dark", "night", "retro", "forest", "aqua", "forest"].includes(
theme
)
) {
cookies.set("colortheme", theme, {
path: "/",
maxAge: 60 * 60 * 24 * 365,

View File

@@ -22,7 +22,7 @@
{/if}
<img src={campingDrawing} class="w-1/4 mb-4" alt="Logo" />
<button on:click={navToLog} class="btn btn-primary">Open Log</button>
<button on:click={navToLog} class="btn btn-primary mb-4">Open Log</button>
<div class="stats shadow">
<div class="stat">

View File

@@ -1,6 +1,5 @@
<script lang="ts">
export let data;
console.log(data.result);
import { goto } from "$app/navigation";
import AdventureCard from "$lib/components/AdventureCard.svelte";
import { visitCount } from "$lib/utils/stores/visitCountStore.js";