diff --git a/src/app.css b/src/app.css index 187fd53..18596bb 100644 --- a/src/app.css +++ b/src/app.css @@ -63,20 +63,25 @@ strong { } .clickEvent { - background-color: #3c3c40aa; - border-bottom: solid #ff5555 2px; - padding-top: 2px; - padding-bottom: 2px; + background-color: #45454e80; + border: solid #45454e 1px; + border-bottom: solid #a868e7 2px; z-index: 10; --custom-source-align: top; + padding-bottom: 1px +} + +.clickEvent:has(.hoverEvent) { + padding-bottom: 3px; } .hoverEvent { - background-color: #3c3c40aa; - border-bottom: solid #ffff55 2px; - padding-top: 4px; + background-color: #45454e80; + border: solid #45454e 1px; + border-bottom: solid #e57e2b 2px; z-index: 10; --custom-source-align: top; + padding-bottom: 1px } .obfuscated { diff --git a/src/lib/components/TopUI.svelte b/src/lib/components/TopUI.svelte index 0b11d36..8ff1b7d 100644 --- a/src/lib/components/TopUI.svelte +++ b/src/lib/components/TopUI.svelte @@ -28,10 +28,8 @@ function importToEditor() { const jsonContent = snbtToDocument(convertToTextOrEmpty(importText)); - console.log("importing to editor", jsonContent); editor?.commands.setContent(jsonContent, { emitUpdate: true }); importDialog?.close(); - console.log("imported to editor"); } diff --git a/src/lib/components/modals/InsertImageModal.svelte b/src/lib/components/modals/InsertImageModal.svelte new file mode 100644 index 0000000..9ca0a7c --- /dev/null +++ b/src/lib/components/modals/InsertImageModal.svelte @@ -0,0 +1,165 @@ + + + e.preventDefault()} /> + + +
+

A few things to note:

+
    +
  • Total transparency will become empty spaces
  • +
  • Non-zero alpha pixels will be converted to full alpha.
  • +
  • Large or complex images will produce a very long output
  • +
  • This tool makes no attempt to resize images
  • +
+ {#if !files} + + {:else} +

Selected file: {files[0].name}

+ {#if sizeWarning} +
+

This image may be too large to display properly, and may also cause performance issues to process, you have been warned!

+
+ {/if} +
+ + +
+ {/if} +
+
diff --git a/src/lib/components/modals/KeybindModal.svelte b/src/lib/components/modals/KeybindModal.svelte index 0569e23..ef8aa14 100644 --- a/src/lib/components/modals/KeybindModal.svelte +++ b/src/lib/components/modals/KeybindModal.svelte @@ -31,6 +31,7 @@ { keys: [modifierKey, "Shift", "I"], action: "Import Menu" }, { keys: [modifierKey, "Shift", "E"], action: "Export Menu" }, { keys: [modifierKey, "Shift", "L"], action: "Load a snapshot" }, + { keys: [modifierKey, "Shift", "M"], action: "Load an image (with block characters)" }, ]; diff --git a/src/lib/components/modals/topbar/SavedTextsModal.svelte b/src/lib/components/modals/topbar/SavedTextsModal.svelte index 4b2d000..a753689 100644 --- a/src/lib/components/modals/topbar/SavedTextsModal.svelte +++ b/src/lib/components/modals/topbar/SavedTextsModal.svelte @@ -28,37 +28,39 @@ -
+
{#if snapshots.length == 0}

You have not saved anything yet!

{/if} - {#each snapshots as snapshot (snapshot)} -
-
- +
+ {#each snapshots as snapshot (snapshot)} +
+
+ +
+
+ + +
-
- - -
-
- {/each} - + {/each} +
+
diff --git a/src/lib/components/text/MiniRenderer.svelte b/src/lib/components/text/MiniRenderer.svelte index f050c13..277cbe6 100644 --- a/src/lib/components/text/MiniRenderer.svelte +++ b/src/lib/components/text/MiniRenderer.svelte @@ -1,4 +1,5 @@ diff --git a/src/lib/components/toolbar/Toolbar.svelte b/src/lib/components/toolbar/Toolbar.svelte index ce61965..5a916d0 100644 --- a/src/lib/components/toolbar/Toolbar.svelte +++ b/src/lib/components/toolbar/Toolbar.svelte @@ -14,6 +14,7 @@ import IconHoverEvent from "~icons/tabler/pointer"; import IconSquare from "~icons/tabler/square-filled"; import IconHollow from "~icons/tabler/square-x"; + import IconUploadImage from "~icons/tabler/photo-scan"; import Modal from "../Modal.svelte"; import TextStyleButtons from "./TextStyleButtons.svelte"; import ToolbarButton from "./ToolbarButton.svelte"; @@ -47,6 +48,7 @@ let customDialog: Modal = $state()!; let unicodeSelectorDialog: Modal = $state()!; + let insertImageDialog: Modal = $state()!; function toTitleCase(str: string) { return str.replace( @@ -259,6 +261,11 @@
+