mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-07-25 07:49:37 +02:00
Update dependencies and add new features
This commit is contained in:
parent
da8b4c342d
commit
348c545419
10 changed files with 92 additions and 48 deletions
17
package-lock.json
generated
17
package-lock.json
generated
|
@ -12,6 +12,7 @@
|
|||
"@vercel/analytics": "^1.2.2",
|
||||
"@vercel/speed-insights": "^1.0.10",
|
||||
"drizzle-orm": "^0.30.6",
|
||||
"iconify-icon": "^2.1.0",
|
||||
"oslo": "^1.2.0",
|
||||
"postgres": "^3.4.4"
|
||||
},
|
||||
|
@ -877,6 +878,11 @@
|
|||
"zod": "^3.19.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@iconify/types": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@iconify/types/-/types-2.0.0.tgz",
|
||||
"integrity": "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="
|
||||
},
|
||||
"node_modules/@isaacs/cliui": {
|
||||
"version": "8.0.2",
|
||||
"resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz",
|
||||
|
@ -4460,6 +4466,17 @@
|
|||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/iconify-icon": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/iconify-icon/-/iconify-icon-2.1.0.tgz",
|
||||
"integrity": "sha512-lto4XU3bwTQnb+D/CsJ4dWAo0aDe+uPMxEtxyOodw9l7R9QnJUUab3GCehlw2M8mDHdeUu/ufx8PvRQiJphhXg==",
|
||||
"dependencies": {
|
||||
"@iconify/types": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/cyberalien"
|
||||
}
|
||||
},
|
||||
"node_modules/import-fresh": {
|
||||
"version": "3.3.0",
|
||||
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
"@vercel/analytics": "^1.2.2",
|
||||
"@vercel/speed-insights": "^1.0.10",
|
||||
"drizzle-orm": "^0.30.6",
|
||||
"iconify-icon": "^2.1.0",
|
||||
"oslo": "^1.2.0",
|
||||
"postgres": "^3.4.4"
|
||||
}
|
||||
|
|
|
@ -45,22 +45,16 @@
|
|||
<div class="card-body">
|
||||
<h2 class="card-title overflow-ellipsis">{name}</h2>
|
||||
{#if location !== ""}
|
||||
<p>
|
||||
<img
|
||||
src={locationDot}
|
||||
class="inline-block -mt-1 mr-1"
|
||||
alt="Logo"
|
||||
/>{location}
|
||||
</p>
|
||||
<div class="inline-flex items-center">
|
||||
<iconify-icon icon="mdi:map-marker" class="text-xl"></iconify-icon>
|
||||
<p class="ml-.5">{location}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{#if created !== ""}
|
||||
<p>
|
||||
<img
|
||||
src={calendar}
|
||||
class="inline-block -mt-1 mr-1"
|
||||
alt="Logo"
|
||||
/>{created}
|
||||
</p>
|
||||
<div class="inline-flex items-center">
|
||||
<iconify-icon icon="mdi:calendar" class="text-xl"></iconify-icon>
|
||||
<p class="ml-1">{created}</p>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="card-actions justify-end">
|
||||
<button class="btn btn-primary" on:click={edit}>Edit</button>
|
||||
|
@ -77,13 +71,10 @@
|
|||
<div class="card-body">
|
||||
<h2 class="card-title overflow-ellipsis">{name}</h2>
|
||||
{#if location != ""}
|
||||
<p>
|
||||
<img
|
||||
src={locationDot}
|
||||
class="inline-block -mt-1 mr-1"
|
||||
alt="Logo"
|
||||
/>{location}
|
||||
</p>
|
||||
<div class="inline-flex items-center">
|
||||
<iconify-icon icon="mdi:map-marker" class="text-xl"></iconify-icon>
|
||||
<p class="ml-.5">{location}</p>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="card-actions justify-end">
|
||||
<button class="btn btn-primary" on:click={add}>Add</button>
|
||||
|
@ -99,22 +90,16 @@
|
|||
<div class="card-body">
|
||||
<h2 class="card-title overflow-ellipsis">{name}</h2>
|
||||
{#if location !== ""}
|
||||
<p>
|
||||
<img
|
||||
src={locationDot}
|
||||
class="inline-block -mt-1 mr-1"
|
||||
alt="Logo"
|
||||
/>{location}
|
||||
</p>
|
||||
<div class="inline-flex items-center">
|
||||
<iconify-icon icon="mdi:map-marker" class="text-xl"></iconify-icon>
|
||||
<p class="ml-.5">{location}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{#if created !== ""}
|
||||
<p>
|
||||
<img
|
||||
src={calendar}
|
||||
class="inline-block -mt-1 mr-1"
|
||||
alt="Logo"
|
||||
/>{created}
|
||||
</p>
|
||||
<div class="inline-flex items-center">
|
||||
<iconify-icon icon="mdi:calendar" class="text-xl"></iconify-icon>
|
||||
<p class="ml-1">{created}</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -104,21 +104,55 @@
|
|||
<p class="font-bold">Adventures: {count}</p>
|
||||
<UserAvatar {user} />
|
||||
{/if}
|
||||
<button class="btn btn-neutral ml-4" on:click={showModal}>About</button>
|
||||
<button class="btn btn-neutral ml-4 btn-circle" on:click={showModal}
|
||||
><iconify-icon icon="mdi:information" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
<div class="dropdown dropdown-bottom dropdown-end">
|
||||
<div tabindex="0" role="button" class="btn m-1 ml-4">Themes</div>
|
||||
<div tabindex="0" role="button" class="btn m-1 ml-4">
|
||||
<iconify-icon icon="mdi:theme-light-dark" class="text-xl"
|
||||
></iconify-icon>
|
||||
</div>
|
||||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<ul
|
||||
tabindex="0"
|
||||
class="dropdown-content z-[1] menu p-2 shadow bg-base-100 rounded-box w-52"
|
||||
>
|
||||
<form method="POST" use:enhance={submitUpdateTheme}>
|
||||
<li><button formaction="/?/setTheme&theme=light">Light</button></li>
|
||||
<li><button formaction="/?/setTheme&theme=dark">Dark</button></li>
|
||||
<li><button formaction="/?/setTheme&theme=night">Night</button></li>
|
||||
<li>
|
||||
<button formaction="/?/setTheme&theme=light"
|
||||
>Light<iconify-icon icon="mdi:weather-sunny" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<button formaction="/?/setTheme&theme=dark"
|
||||
>Dark<iconify-icon icon="mdi:weather-night" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
</li>
|
||||
<li>
|
||||
<button formaction="/?/setTheme&theme=night"
|
||||
>Night<iconify-icon icon="mdi:weather-night" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
</li>
|
||||
<!-- <li><button formaction="/?/setTheme&theme=nord">Nord</button></li> -->
|
||||
<!-- <li><button formaction="/?/setTheme&theme=retro">Retro</button></li> -->
|
||||
<li><button formaction="/?/setTheme&theme=forest">Forest</button></li>
|
||||
<li>
|
||||
<button formaction="/?/setTheme&theme=forest"
|
||||
>Forest<iconify-icon icon="mdi:forest" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
<button formaction="/?/setTheme&theme=garden"
|
||||
>Garden<iconify-icon icon="mdi:flower" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
<button formaction="/?/setTheme&theme=aqua"
|
||||
>Aqua<iconify-icon icon="mdi:water" class="text-xl"
|
||||
></iconify-icon></button
|
||||
>
|
||||
</li>
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
||||
<ul
|
||||
tabindex="0"
|
||||
class="dropdown-content z-[1] menu p-2 shadow bg-neutral mt-2 rounded-box w-52"
|
||||
class="dropdown-content z-[1] menu p-2 shadow bg-primary-content mt-2 rounded-box w-52"
|
||||
>
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
<!-- svelte-ignore a11y-missing-attribute -->
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -6,6 +6,6 @@ export default {
|
|||
},
|
||||
plugins: [require("@tailwindcss/typography"), require("daisyui")],
|
||||
daisyui: {
|
||||
themes: ["light", "dark", "night", "retro", "forest", "nord"],
|
||||
themes: ["light", "dark", "night", "retro", "forest", "aqua", "garden"],
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue