diff --git a/src/lib/components/checkbox.svelte b/src/lib/components/checkbox.svelte new file mode 100644 index 0000000..7d2095c --- /dev/null +++ b/src/lib/components/checkbox.svelte @@ -0,0 +1,99 @@ + + +
+ +
+ + diff --git a/src/lib/components/task.svelte b/src/lib/components/task.svelte new file mode 100644 index 0000000..5c4ce68 --- /dev/null +++ b/src/lib/components/task.svelte @@ -0,0 +1,117 @@ + + + + +
+
+
+ +
+
+

{task.content}

+
+ {#if true} +
{@html [task.content, "
"].join().repeat(5)}
+ {/if} +
+ Due:
+ {new Date(task.created_at).toLocaleDateString()}
+ {new Date(task.created_at).toLocaleTimeString()} +
+
+
+ + + diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts new file mode 100644 index 0000000..823d1bf --- /dev/null +++ b/src/routes/+page.server.ts @@ -0,0 +1,24 @@ +import type { Actions, PageServerLoad } from "./$types" + +export const load: PageServerLoad = async ({ locals, fetch }) => { + + const response = await fetch("/api/users/tasks", { + method: "GET" + }) + + return { tasks: await response.json() } +} + +export const actions = { + create: async ({ request, fetch }) => { + + const data = await request.formData() + + const response = await fetch("/api/users/tasks/create", { + method: "POST", + body: data + }) + + return { } + } +} satisfies Actions diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index e69de29..db997c1 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -0,0 +1,42 @@ + + +
+

Tasks

+ +
+
+ +
+
+ + {#each data.tasks as task} + + {/each} +
+ + diff --git a/static/global.css b/static/global.css index cd95015..a474af2 100644 --- a/static/global.css +++ b/static/global.css @@ -1,3 +1,13 @@ -body { + +body { + --primary-bg-color: white; + --primary-text-color: black; + width: 100%; + background-color: var(--primary-bg-color, white); + +} + +* { + color: var(--primary-text-color, black); }