Compare commits

19 Commits

Author SHA1 Message Date
70bd76f49e always show editor 2026-02-17 12:37:17 +13:00
c428aae077 fix create new entry endpoint 2026-02-17 12:36:02 +13:00
89d2aaca75 EDITOR WORK COMPLETE 2026-02-17 12:35:46 +13:00
4413374429 default editor to today 2026-02-17 11:58:22 +13:00
2a953ef5ce Add param matcher to ensure random paths dont crash the app 2026-02-17 11:34:23 +13:00
0b038f4dea okay working now, datevalue respects current page 2026-02-17 11:22:38 +13:00
1d6e5b5d4c Just need a checkpoint cos nothings working atm 2026-02-17 11:13:03 +13:00
c5d689a9a8 Implementing different page for the entries, for sharability ig 2026-02-13 10:37:17 +13:00
f557360105 max width only applies on large screens 2026-02-12 12:06:38 +13:00
caf6eabe32 more editor work 2026-02-12 09:01:33 +13:00
1eb42c7a18 poc of new editor is,, progressing 2026-02-11 22:07:30 +13:00
865846c6be schema update: change from timestamp to date 2026-02-11 21:55:35 +13:00
e978d0df97 Redesign entry summary view and more importantly rearchitected that awful state management 2026-02-11 20:51:45 +13:00
31bfbffb4d calendar takes up full width now 2026-02-11 20:12:17 +13:00
a0d63fc10e removed white text enforcement lol 2026-02-11 19:56:56 +13:00
09585d8954 images go behind the dates now 2026-02-11 19:55:48 +13:00
74023040fc i mean calendar *works* now, just gotta make it look okay 2026-02-11 19:25:34 +13:00
a61b342c4c calendar work is happening 2026-02-11 19:15:03 +13:00
b99e636e74 Add shadcn svelte, theme button 2026-02-11 18:41:42 +13:00
4 changed files with 11 additions and 11 deletions

View File

@@ -213,7 +213,7 @@
<img
src={entry.image}
alt="Entry"
class="w-full h-auto max-h-128 object-cover"
class="w-full h-auto max-h-96 object-cover"
/>
</div>
{:else}
@@ -256,7 +256,7 @@
<img
src={previewImage}
alt="Preview"
class="w-full h-auto max-h-128 object-cover"
class="w-full h-auto max-h-96 object-cover"
/>
<button
type="button"

View File

@@ -57,11 +57,17 @@ export async function updateEntry(entry) {
}
export async function deleteEntry(entry) {
await fetch(`/api/entry/delete`, {
const res = await fetch(`/api/entry/delete`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ id: entry.id })
});
if (res.ok) {
entry = null;
} else {
alert('Failed to delete entry');
}
}

View File

@@ -16,13 +16,10 @@
let { children, data } = $props();
let dateValue = $derived(data.date);
let entries = $derived(data.entries);
let title = $state("Memento")
$effect(() => {
// Navigate when dateValue changes
goto(`/${dateValue}`);
title = `Memento: ${dateValue}`
});
$effect(() => {
@@ -31,10 +28,7 @@
});
</script>
<svelte:head>
<title>{title}</title>
<link rel="icon" href={favicon} />
</svelte:head>
<svelte:head><link rel="icon" href={favicon} /></svelte:head>
<ModeWatcher />
<div

View File

@@ -61,7 +61,7 @@ async function getEntryByMonth(monthString: string) {
const endDate = new Date(year, month, 1, 0, 0, 0, 0)
const entries = await db.select().from(entryTable).where(
sql`${entryTable.date} >= ${startDate.toISOString()}::timestamp AND ${entryTable.date} < ${endDate.toISOString()}::timestamp ORDER BY ${entryTable.date} DESC`
sql`${entryTable.date} >= ${startDate.toISOString()}::timestamp AND ${entryTable.date} < ${endDate.toISOString()}::timestamp`
)
return httpResponse(entries, 200)