diff --git a/src/lib/components/editor.svelte b/src/lib/components/editor.svelte index 1c2c6a2..4c828ea 100644 --- a/src/lib/components/editor.svelte +++ b/src/lib/components/editor.svelte @@ -1,56 +1,319 @@ -
-

{formatDate(entry.date)}

+
+ +
+

{formatDate(entry.date)}

+
+ {#if !edit} + + {:else} + + + + {/if} +
+
+ + + {#if error} +
+ {error} +
+ {/if} + + {#if !edit} - +
+ + {#if entry.image} +
+ Entry +
+ {:else} +
+ No image +
+ {/if} + + + {#if entry.content} +
+
+ {@html marked(entry.content)} +
+
+ {:else} +
+ No content yet +
+ {/if} +
+ + {:else} - - - +
+ +
+ + + {#if previewImage} +
+ Preview + +
+ {:else} +
{ + if (e.key === "Enter" || e.key === " ") { + fileInput?.click(); + } + }} + onclick={() => fileInput?.click()} + > + +

+ Click to upload or drag and drop +

+

+ PNG, JPG, GIF up to 5MB +

+
+ {/if} + + +
+ + +
+ +