diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 7caad99..9b7c156 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -26,34 +26,14 @@ - - - - - - - - - - - - - - - - - - - - - + + + - - - + @@ -238,10 +218,11 @@ - - + + + @@ -254,20 +235,21 @@ - - + + + - + - + diff --git a/src/store.ts b/src/store.ts index c8cf7ae..581fc5e 100644 --- a/src/store.ts +++ b/src/store.ts @@ -93,10 +93,10 @@ export const examples = [ dimY: 3, dimZ: 3, cubes: [ - {space: 30n, color: "#ff0000"}, + {space: 58n, color: "#ff0000"}, {space: 29712n, color: "#ffff00"}, {space: 29216n, color: "#00ff00"}, - {space: 15392n, color: "#00ffff"}, + {space: 30n, color: "#00ffff"}, {space: 15364n, color: "#0000ff"}, {space: 536871032n, color: "#ff00ff"}, ], @@ -114,4 +114,17 @@ export const examples = [ {space: 120n, color: "#0000ff"}, ], }, -]; \ No newline at end of file +].concat(deserealiseSaves()); + +function deserealiseSaves() { + return localStorage.getItem("saves")?.split("@").map(save => JSON.parse(save)) ?? []; +} + +export function serialiseCurrentInput() { + return { + dimX: somaDimX.currentVal(), + dimY: somaDimY.currentVal(), + dimZ: somaDimZ.currentVal(), + cubes: polycubes.currentVal().map(cube => ({space: cube.getRaw().toString(), color: cube.getColor()})), + }; +} \ No newline at end of file diff --git a/src/ui/CubeInputSet.svelte b/src/ui/CubeInputSet.svelte index 01e9f00..4076119 100644 --- a/src/ui/CubeInputSet.svelte +++ b/src/ui/CubeInputSet.svelte @@ -1,21 +1,9 @@
diff --git a/src/ui/ExamplesList.svelte b/src/ui/ExamplesList.svelte index 8ca9ecb..0cc0069 100644 --- a/src/ui/ExamplesList.svelte +++ b/src/ui/ExamplesList.svelte @@ -1,8 +1,11 @@
@@ -26,10 +60,28 @@ onClick={(i) => hydrateExample(i)} />
+
+ + +
\ No newline at end of file diff --git a/src/ui/List.svelte b/src/ui/List.svelte index 299bd20..c8cb278 100644 --- a/src/ui/List.svelte +++ b/src/ui/List.svelte @@ -3,18 +3,21 @@ export let activeItem: number = 0; export let items: string[] = []; export let onClick = (itemNo: number) => { activeItem = itemNo }; + export let maxHeight: string = "auto"; -
    - {#if items.length === 0} -
  • {defaultText}
  • - {/if} - {#each items as item, i} -
  • onClick(i)}> - {item} -
  • - {/each} -
+
+
    + {#if items.length === 0} +
  • {defaultText}
  • + {/if} + {#each items as item, i} +
  • onClick(i)}> + {item} +
  • + {/each} +
+
\ No newline at end of file diff --git a/src/ui/Tabs.svelte b/src/ui/Tabs.svelte index 22ecfb3..8d25ab7 100644 --- a/src/ui/Tabs.svelte +++ b/src/ui/Tabs.svelte @@ -18,8 +18,9 @@ \ No newline at end of file