I fixed the thing by just using the node adapter.
I guess taht works. Cleaned up the clicker page a touch
This commit is contained in:
@@ -40,6 +40,7 @@
|
||||
:root {
|
||||
--green-42: oklch(0.42 0.042 142);
|
||||
--br: 0.375rem;
|
||||
--bs: 2px 2px 9px var(--primary-8);
|
||||
|
||||
--primary: 0;
|
||||
--primary-1: oklch(0.91 0.046 var(--primary));
|
||||
|
||||
@@ -30,18 +30,18 @@
|
||||
<h1>How many people are at Sludge Fest {data.year}?</h1>
|
||||
<div>
|
||||
<div>
|
||||
<h3>~{people} people</h3>
|
||||
<button data-id="people" onclick={add}>+</button>
|
||||
<h3>~{people} people</h3>
|
||||
<button data-id="people" onclick={subtract}>-</button>
|
||||
</div>
|
||||
<div>
|
||||
<h3>~{tents} tents</h3>
|
||||
<button data-id="tents" onclick={add}>+</button>
|
||||
<h3>~{tents} tents</h3>
|
||||
<button data-id="tents" onclick={subtract}>-</button>
|
||||
</div>
|
||||
<div>
|
||||
<h3>~{cars} cars</h3>
|
||||
<button data-id="cars" onclick={add}>+</button>
|
||||
<h3>~{cars} cars</h3>
|
||||
<button data-id="cars" onclick={subtract}>-</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,9 +54,16 @@
|
||||
</section>
|
||||
|
||||
<style lang="scss">
|
||||
@use "/src/app.scss" as *;
|
||||
@use "sass:color";
|
||||
|
||||
button {
|
||||
background: var(--primary-5);
|
||||
border-radius: 0.25rem;
|
||||
font-size: 2rem;
|
||||
border: none;
|
||||
box-shadow: var(--bs);
|
||||
&:hover {
|
||||
background: var(--primary-7);
|
||||
}
|
||||
}
|
||||
section {
|
||||
max-width: 60rem;
|
||||
margin: 1rem auto 0;
|
||||
@@ -69,29 +76,28 @@
|
||||
|
||||
div {
|
||||
text-align: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
justify-content: center;
|
||||
gap: 1rem;
|
||||
max-width: 30rem;
|
||||
div {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
h3 {
|
||||
font-size: 1.75rem;
|
||||
grid-column: 1 / 3;
|
||||
width: fit-content;
|
||||
}
|
||||
button {
|
||||
background: $yellow;
|
||||
border: solid 3px $yellow;
|
||||
border-radius: 0.25rem;
|
||||
margin: 0 1rem;
|
||||
font-size: 2rem;
|
||||
flex-basis: 4rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
form button {
|
||||
font-size: 2rem;
|
||||
margin: 1rem;
|
||||
background: $yellow;
|
||||
border: solid 3px $yellow;
|
||||
border-radius: 0.25rem;
|
||||
width: fit-content;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
import { encode } from 'proquint'
|
||||
import { randomBytes } from 'crypto'
|
||||
|
||||
import { get_all_threads, create_thread } from '$lib/db'
|
||||
|
||||
export async function load({ fetch, data, setHeaders, parent, depends}) {
|
||||
console.log("thread")
|
||||
let threads = await get_all_threads()
|
||||
for( let thread of threads ){
|
||||
thread.name = encode(Buffer.from(thread.id, "hex"))
|
||||
}
|
||||
|
||||
return {
|
||||
threads,
|
||||
uid: 42
|
||||
}
|
||||
}
|
||||
export const actions = {
|
||||
default: async({ request }) => {
|
||||
console.log("create thread")
|
||||
let data = await request.formData()
|
||||
console.log(data)
|
||||
await create_thread(data.get("title"), randomBytes(4), data.get("uid"))
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
<script lang="ts">
|
||||
let { data, form } = $props<{ threads: Array }>();
|
||||
$inspect(data)
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title></title>
|
||||
<meta name="description" content="" />
|
||||
</svelte:head>
|
||||
|
||||
<section>
|
||||
{#each data.threads as thread}
|
||||
<a href="thread/{thread.name}">{thread.title}</a>
|
||||
{/each}
|
||||
<form method="POST">
|
||||
<input type="text" name="title">
|
||||
<input hidden type="text" name="uid" bind:value={data.uid}>
|
||||
<button>Create</button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<style lang="scss">
|
||||
section {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -1,8 +0,0 @@
|
||||
export async function load({ params }) {
|
||||
console.log(params)
|
||||
}
|
||||
export const actions = {
|
||||
default: async({cookies, fetch, getClientAddress, locals, params, platform, request, route, setHeaders, url, isDataRequest}) => {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
<script lang="ts">
|
||||
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title></title>
|
||||
<meta name="description" content="" />
|
||||
</svelte:head>
|
||||
|
||||
<section>
|
||||
|
||||
</section>
|
||||
|
||||
<style lang="scss">
|
||||
section {
|
||||
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user