diff --git a/package.json b/package.json index f1cb9ead..ab82ed65 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "amacc1ng", + "name": "charachorder-device-manager", "version": "0.6.5", "license": "AGPL-3.0-or-later", "private": true, "repository": { "type": "git", - "url": "https://github.com/Theaninova/amacc1ng.git" + "url": "https://github.com/CharaChorder/DeviceManager.git" }, - "homepage": "https://github.com/Theaninova/amacc1ng", + "homepage": "https://github.com/CharaChorder/DeviceManager", "bugs": { - "url": "https://github.com/Theaninova/amacc1ng/issues" + "url": "https://github.com/CharaChorder/DeviceManager/issues" }, "scripts": { "dev": "npm-run-all --parallel vite typesafe-i18n", @@ -81,4 +81,4 @@ "vitest": "^0.34.4" }, "type": "module" -} \ No newline at end of file +} diff --git a/src/lib/assets/layouts/lite.yml b/src/lib/assets/layouts/lite.yml new file mode 100644 index 00000000..f003090e --- /dev/null +++ b/src/lib/assets/layouts/lite.yml @@ -0,0 +1,87 @@ +name: Lite +row: + - col: + - id: 53 + - id: 54 + - id: 55 + - id: 56 + - id: 57 + - id: 58 + - id: 59 + - id: 60 + - id: 61 + - id: 62 + - id: 63 + - id: 64 + - id: 65 + - id: 66 + size: [ 2, 1 ] + - col: + - id: 39 + size: [ 1.5, 1 ] + - id: 40 + - id: 41 + - id: 42 + - id: 43 + - id: 44 + - id: 45 + - id: 46 + - id: 47 + - id: 48 + - id: 49 + - id: 50 + - id: 51 + - id: 52 + size: [ 1.5, 1 ] + - col: + - id: 26 + size: [ 1.75, 1 ] + - id: 27 + - id: 28 + - id: 29 + - id: 30 + - id: 31 + - id: 32 + - id: 33 + - id: 34 + - id: 35 + - id: 36 + - id: 37 + - id: 38 + size: [ 2.25, 1 ] + - col: + - id: 12 + size: [ 2, 1 ] + - id: 13 + - id: 14 + - id: 15 + - id: 16 + - id: 17 + - id: 18 + - id: 19 + - id: 20 + - id: 21 + - id: 22 + - id: 23 + - id: 24 + - id: 25 + - col: + - id: 0 + - id: 1 + size: [ 1.25, 1 ] + - id: 2 + size: [ 1.25, 1 ] + - id: 3 + size: [ 2, 1 ] + - id: 4 + - id: 5 + - id: 6 + size: [ 2, 1 ] + - id: 7 + size: [ 1.25, 1 ] + - id: 8 + size: [ 1.25, 1 ] + - id: 9 + - id: 10 + - id: 11 + diff --git a/src/lib/components/layout/ActionSelector.svelte b/src/lib/components/layout/ActionSelector.svelte index ce3e584b..67c916a9 100644 --- a/src/lib/components/layout/ActionSelector.svelte +++ b/src/lib/components/layout/ActionSelector.svelte @@ -165,6 +165,7 @@ .content { position: relative; + transform-origin: top left; overflow: hidden; display: flex; diff --git a/src/lib/components/layout/GenericLayout.svelte b/src/lib/components/layout/GenericLayout.svelte new file mode 100644 index 00000000..48198627 --- /dev/null +++ b/src/lib/components/layout/GenericLayout.svelte @@ -0,0 +1,296 @@ + + + + +

{layoutInfo.name}

+ + {#each layoutInfo.keys as key, i} + {@const posX = key.pos[0] * scale} + {@const posY = key.pos[1] * scale} + {@const sizeX = key.size[0] * scale} + {@const sizeY = key.size[1] * scale} + {@const middleX = sizeX / 2} + {@const middleY = sizeY / 2} + edit(i)} + on:keypress={({key}) => { + if (key === "Enter") { + edit(i) + } + }} + on:focusin={() => (focusKey = key)} + role="button" + tabindex={i + 1} + > + + {#each [1, 2, 0] as layer, i} + {@const [action, changed] = getActions(layer, key.id, $layout, $changes)} + {@const isActive = layer === activeLayer} + {@const direction = [ + (middleX - margin * 3) / (i % 2 === 0 ? -1 : 1), + (middleY - margin * 3) / (i < 2 ? -1 : 1), + ]} + {@const layerFontSize = action?.icon ? iconFontSize : fontSize} + + + {action?.icon || action?.id || action?.code || `{${key.id}}`} + {#if changed} + + {/if} + + + {/each} + + {/each} + + + diff --git a/src/lib/components/layout/Layout.svelte b/src/lib/components/layout/Layout.svelte index c37c52ef..c96f3e9f 100644 --- a/src/lib/components/layout/Layout.svelte +++ b/src/lib/components/layout/Layout.svelte @@ -2,6 +2,7 @@ import {serialPort} from "$lib/serial/connection" import LayoutCC1 from "$lib/components/layout/LayoutCC1.svelte" import {action} from "$lib/title" + import GenericLayout from "$lib/components/layout/GenericLayout.svelte" $: device = $serialPort?.device ?? "ONE" let activeLayer = 0 @@ -13,7 +14,7 @@ ] as const -
+
{#each layers as [title, icon, value]}