diff --git a/sludge-link.servce b/sludge-link.service similarity index 79% rename from sludge-link.servce rename to sludge-link.service index 8002ebb..ac95951 100644 --- a/sludge-link.servce +++ b/sludge-link.service @@ -7,6 +7,10 @@ StartLimitIntervalSec=10 Type=simple User=root WorkingDirectory=/root/build + +Environment="ORIGIN=https://sludge.link" +Environment="NODE_ENV=production" + ExecStart=/root/.bun/bin/bun run index.js Restart=always StartLimitBurst=3 diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index cd8d0e6..4615471 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -3,14 +3,18 @@ data: {}; children: any; } - let { data, children }: Props = $props(); - // $inspect("l",data); - let theme = $state("green"); - const THEMES = ["blue", "yellow", "orange", "brown", "green"]; + let { children }: Props = $props(); function change_theme() { - let index = THEMES.findIndex((color) => theme == color); - theme = THEMES[(index + 1) % THEMES.length]; + let TOLERANCE = 20; + let hue = parseFloat( + document.documentElement.style.getPropertyValue("--primary") || "0", + ); + let random = hue; + while (Math.abs(random - hue) <= TOLERANCE) { + random = Math.floor(Math.random() * 360); + } + document.documentElement.style.setProperty("--primary", String(random)); } @@ -19,13 +23,12 @@ -
+
@@ -35,95 +38,23 @@ diff --git a/src/routes/fest/clicker/+page.server.ts b/src/routes/fest/clicker/+page.server.ts index 3d0afb2..1870471 100644 --- a/src/routes/fest/clicker/+page.server.ts +++ b/src/routes/fest/clicker/+page.server.ts @@ -3,7 +3,7 @@ import { get_fest_counts, add_fest_counts } from '$lib/db' export async function load() { console.log('click') let { people, tents, cars, year } = await get_fest_counts() - console.log({ people, tents, cars, year }) + // console.log({ people, tents, cars, year }) return { people, tents, @@ -12,13 +12,13 @@ export async function load() { } } export const actions = { - default: async ({ cookies, fetch, getClientAddress, locals, params, platform, request, route, setHeaders, url, isDataRequest }) => { + default: async ({ request }) => { const data = await request.formData() - console.log("save", data) - const people = parseInt(data.get("people")) - const tents = parseInt(data.get("tents")) - const cars = parseInt(data.get("cars")) + // console.log("save", data) + const people = parseInt(String(data.get("people"))) + const tents = parseInt(String(data.get("tents"))) + const cars = parseInt(String(data.get("cars"))) const reply = add_fest_counts(people, tents, cars, 25) - console.log("reply", reply) + console.log("clicked", reply) } } diff --git a/src/routes/fest/clicker/+page.svelte b/src/routes/fest/clicker/+page.svelte index e66436f..32f6b81 100644 --- a/src/routes/fest/clicker/+page.svelte +++ b/src/routes/fest/clicker/+page.svelte @@ -1,19 +1,29 @@
@@ -21,24 +31,24 @@

~{people} people

- - + +

~{tents} tents

- - + +

~{cars} cars

- - + +
- - - + + +
diff --git a/src/routes/pork/+page.svelte b/src/routes/pork/+page.svelte index 30c61b7..0aff0da 100644 --- a/src/routes/pork/+page.svelte +++ b/src/routes/pork/+page.svelte @@ -1,5 +1,4 @@ @@ -106,9 +107,6 @@ flex-basis: 50%; text-align: center; text-shadow: 3px 3px 3px var(--primary-7); - &.small { - flex-basis: 25%; - } &:first-child { text-align: left; } diff --git a/svelte.config.js b/svelte.config.js index 1d5479b..2a5b95f 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -3,16 +3,19 @@ import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://svelte.dev/docs/kit/integrations - // for more information about preprocessors - preprocess: vitePreprocess(), + // Consult https://svelte.dev/docs/kit/integrations + // for more information about preprocessors + preprocess: vitePreprocess(), - kit: { - // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. - // If your environment is not supported, or you settled on a specific environment, switch out the adapter. - // See https://svelte.dev/docs/kit/adapters for more information about adapters. - adapter: adapter() - } + kit: { + // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. + // If your environment is not supported, or you settled on a specific environment, switch out the adapter. + // See https://svelte.dev/docs/kit/adapters for more information about adapters. + adapter: adapter(), + csrf: { + checkOrigin: true + } + } }; export default config;