1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-05 05:05:17 +02:00

Merge pull request #41 from seanmorley15/development

Development
This commit is contained in:
Sean Morley 2024-04-19 20:53:33 -04:00 committed by GitHub
commit 69a3d94701
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 133 additions and 64 deletions

67
package-lock.json generated
View file

@ -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"
},
@ -26,7 +27,7 @@
"autoprefixer": "^10.4.19",
"daisyui": "^4.9.0",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.20.14",
"drizzle-kit": "^0.20.16",
"lucia": "^3.1.1",
"pg": "^8.11.5",
"postcss": "^8.4.38",
@ -63,15 +64,6 @@
"node": ">=6.0.0"
}
},
"node_modules/@drizzle-team/studio": {
"version": "0.0.39",
"resolved": "https://registry.npmjs.org/@drizzle-team/studio/-/studio-0.0.39.tgz",
"integrity": "sha512-c5Hkm7MmQC2n5qAsKShjQrHoqlfGslB8+qWzsGGZ+2dHMRTNG60UuzalF0h0rvBax5uzPXuGkYLGaQ+TUX3yMw==",
"dev": true,
"dependencies": {
"superjson": "^2.2.1"
}
},
"node_modules/@emnapi/core": {
"version": "0.45.0",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-0.45.0.tgz",
@ -867,6 +859,30 @@
"node": ">=12"
}
},
"node_modules/@hono/node-server": {
"version": "1.11.0",
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.11.0.tgz",
"integrity": "sha512-TLIJq9TMtD1NEG1mVoqNUn1Ita0qSaB5XboZErjFBcO/GJYXwWY4dVdTi9G0lbxtu0x+hJXDItcLaFHb7rlFTw==",
"dev": true,
"engines": {
"node": ">=18.14.1"
}
},
"node_modules/@hono/zod-validator": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/@hono/zod-validator/-/zod-validator-0.2.1.tgz",
"integrity": "sha512-HFoxln7Q6JsE64qz2WBS28SD33UB2alp3aRKmcWnNLDzEL1BLsWfbdX6e1HIiUprHYTIXf5y7ax8eYidKUwyaA==",
"dev": true,
"peerDependencies": {
"hono": ">=3.9.0",
"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",
@ -3326,13 +3342,14 @@
}
},
"node_modules/drizzle-kit": {
"version": "0.20.14",
"resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.20.14.tgz",
"integrity": "sha512-0fHv3YIEaUcSVPSGyaaBfOi9bmpajjhbJNdPsRMIUvYdLVxBu9eGjH8mRc3Qk7HVmEidFc/lhG1YyJhoXrn5yA==",
"version": "0.20.16",
"resolved": "https://registry.npmjs.org/drizzle-kit/-/drizzle-kit-0.20.16.tgz",
"integrity": "sha512-WoqV0XDny8mHnVoLYcUs6H3Ae1HBxeV0zi3VXG/mTahIQYfadZmIc3eRqzXjD3yxemj+GdHI1nThddmsoabdIA==",
"dev": true,
"dependencies": {
"@drizzle-team/studio": "^0.0.39",
"@esbuild-kit/esm-loader": "^2.5.5",
"@hono/node-server": "^1.9.0",
"@hono/zod-validator": "^0.2.0",
"camelcase": "^7.0.1",
"chalk": "^5.2.0",
"commander": "^9.4.1",
@ -3341,9 +3358,11 @@
"esbuild-register": "^3.5.0",
"glob": "^8.1.0",
"hanji": "^0.0.5",
"hono": "^4.1.4",
"json-diff": "0.9.0",
"minimatch": "^7.4.3",
"semver": "^7.5.4",
"superjson": "^2.2.1",
"zod": "^3.20.2"
},
"bin": {
@ -4425,6 +4444,15 @@
"integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==",
"dev": true
},
"node_modules/hono": {
"version": "4.2.5",
"resolved": "https://registry.npmjs.org/hono/-/hono-4.2.5.tgz",
"integrity": "sha512-uonJD3i/yy005kQ7bPZRVfG3rejYJwyPqBmPoUGijS4UB/qM+YlrZ7xzSWy+ByDu9buGHUG+f+SKzz03Y6V1Kw==",
"dev": true,
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/https-proxy-agent": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz",
@ -4438,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",

View file

@ -25,7 +25,7 @@
"autoprefixer": "^10.4.19",
"daisyui": "^4.9.0",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.20.14",
"drizzle-kit": "^0.20.16",
"lucia": "^3.1.1",
"pg": "^8.11.5",
"postcss": "^8.4.38",
@ -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"
}

View file

@ -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>

View file

@ -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>

View file

@ -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 -->

View file

@ -1,5 +1,8 @@
import type { LayoutServerLoad, PageServerLoad } from "./$types";
import { USING_VERCEL } from "$env/static/private";
let USING_VERCEL: string;
try {
USING_VERCEL = require("$env/static/private").USING_VERCEL;
} catch (error) {}
export const load: LayoutServerLoad = async (event) => {
if (event.locals.user) {

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";

View file

@ -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"],
},
};