mirror of
https://github.com/CharaChorder/DeviceManager.git
synced 2026-04-25 07:38:57 +00:00
feat: chord editing prototype
feat: printing style for layout
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
<div class="actions">
|
||||
{#if $canShare}
|
||||
<button transition:fly={{x: -8}} class="icon" on:click={triggerShare}>share</button>
|
||||
<button transition:fly={{x: -8}} class="icon" on:click={() => print()}>print</button>
|
||||
<div transition:slide class="separator" />
|
||||
{/if}
|
||||
{#if import.meta.env.TAURI_FAMILY === undefined}
|
||||
@@ -128,7 +129,6 @@
|
||||
nav {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto 1fr;
|
||||
gap: 4px;
|
||||
|
||||
width: calc(min(100%, 28cm));
|
||||
margin-block: 8px;
|
||||
@@ -158,7 +158,7 @@
|
||||
justify-content: center;
|
||||
|
||||
aspect-ratio: 1;
|
||||
padding: 2px;
|
||||
padding: 0;
|
||||
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
@@ -177,7 +177,6 @@
|
||||
|
||||
.actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
|
||||
&:last-child {
|
||||
|
||||
@@ -48,14 +48,6 @@
|
||||
}).show()
|
||||
}
|
||||
|
||||
async function importLayout() {
|
||||
const file = await fileInput.files?.item(0)?.text()
|
||||
if (!file) return
|
||||
const importedLayout = isCsvLayout(file) ? csvLayoutToJson(file) : (JSON.parse(file) as CharaLayoutFile)
|
||||
if (importedLayout.type === "layout" && importedLayout.charaVersion === 1)
|
||||
$deviceLayout = importedLayout.layout
|
||||
}
|
||||
|
||||
setContext<VisualLayoutConfig>("visual-layout-config", {
|
||||
scale: 50,
|
||||
inactiveScale: 0.5,
|
||||
@@ -67,37 +59,22 @@
|
||||
})
|
||||
|
||||
setContext("active-layer", writable(0))
|
||||
|
||||
let fileInput: HTMLInputElement
|
||||
let layoutOverride: "ONE" | "LITE" | undefined = undefined
|
||||
</script>
|
||||
|
||||
<svelte:window use:share={shareLayout} />
|
||||
|
||||
<section>
|
||||
<select bind:value={layoutOverride}>
|
||||
<option value={undefined}>Auto</option>
|
||||
<option value="ONE">CC1</option>
|
||||
<option value="LITE">Lite</option>
|
||||
</select>
|
||||
<!-- <label class="icon"
|
||||
>upload_file<input
|
||||
bind:this={fileInput}
|
||||
on:input={importLayout}
|
||||
type="file"
|
||||
accept="text/csv, application/json"
|
||||
/></label
|
||||
> -->
|
||||
<Layout {layoutOverride} />
|
||||
<Layout />
|
||||
</section>
|
||||
|
||||
<style lang="scss">
|
||||
section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
input[type="file"] {
|
||||
|
||||
Reference in New Issue
Block a user