diff --git a/src/ext/extension-page/App.svelte b/src/ext/extension-page/App.svelte
index 60574f73..90d396b4 100644
--- a/src/ext/extension-page/App.svelte
+++ b/src/ext/extension-page/App.svelte
@@ -58,6 +58,29 @@
window.location.reload();
}
});
+
+ let splitterActive = false;
+ let sidebarHidden = false;
+ let sidebarWidth = "23svw";
+ const sidebarMinWidth = "20rem";
+ const editorMinWidth = "20rem";
+
+ function sidebarSwitch() {
+ sidebarHidden = !sidebarHidden;
+ }
+
+ function handleSplitterDrag(event) {
+ if (event.type === "mouseup") {
+ splitterActive = false;
+ } else if (event.type === "mousedown") {
+ splitterActive = true;
+ } else if (event.type === "mousemove") {
+ const vw = window.innerWidth;
+ const sw = (event.x / vw) * 100;
+ sidebarWidth = `max(min(${sw}svw, 100svw - ${editorMinWidth}), ${sidebarMinWidth})`;
+ }
+ event.preventDefault();
+ }
@@ -72,10 +95,30 @@
{/if}
{/if}
-
-
-
+
+ {#if !sidebarHidden}
+
+ {/if}
+
+
+{#if splitterActive}
+
+{/if}
{#each $notifications as item (item.id)}
notifications.remove(item.id)} {item} />
@@ -120,6 +163,34 @@
overflow: hidden;
}
+ .resize-mask {
+ background-color: transparent;
+ cursor: col-resize;
+ position: fixed;
+ inset: 0;
+ z-index: 200;
+ }
+
+ .splitter {
+ --splitter-width: 6px;
+ --splitter-offset: calc(var(--splitter-width) / 2);
+ --sidebar-fixed-width: max(var(--sidebar-min-width), var(--sidebar-width));
+
+ background-color: transparent;
+ cursor: col-resize;
+ position: fixed;
+ left: calc(var(--sidebar-fixed-width) - var(--splitter-offset));
+ width: var(--splitter-width);
+ height: 100svh;
+ z-index: 201;
+ transition: background-color 0.2s ease-in-out;
+
+ &:hover,
+ &.dragging {
+ background-color: var(--color-blue);
+ }
+ }
+
ul {
bottom: 1rem;
left: 50%;
diff --git a/src/ext/extension-page/Components/Editor/Editor.svelte b/src/ext/extension-page/Components/Editor/Editor.svelte
index 0bdd3507..ef47d3b6 100644
--- a/src/ext/extension-page/Components/Editor/Editor.svelte
+++ b/src/ext/extension-page/Components/Editor/Editor.svelte
@@ -13,6 +13,10 @@
import iconDownload from "@shared/img/icon-download.svg?raw";
import iconTrash from "@shared/img/icon-trash.svg?raw";
import iconSync from "@shared/img/icon-sync.svg?raw";
+ import iconSidebar from "@shared/img/icon-sidebar.svg?raw";
+
+ export let sidebarHidden;
+ export let sidebarSwitch;
// the data the populates editor elements
let canUpdate;
@@ -167,13 +171,22 @@
No Item Selected
{/if}