add layout edit placeholders

[deploy]
This commit is contained in:
2023-07-18 02:01:25 +02:00
parent b04ed7fe7f
commit 6facaad4a2
5 changed files with 37 additions and 10 deletions

View File

@@ -11,3 +11,5 @@ node_modules
pnpm-lock.yaml pnpm-lock.yaml
package-lock.json package-lock.json
yarn.lock yarn.lock
static/languages/*/.json

View File

@@ -13,6 +13,7 @@ const config: IconsConfig = {
"piano", "piano",
"keyboard", "keyboard",
"settings", "settings",
"edit",
"music_note", "music_note",
"avg_pace", "avg_pace",
"lyrics", "lyrics",

View File

@@ -10,7 +10,39 @@
{@const action = KEYMAP_CODES[layer[id]]} {@const action = KEYMAP_CODES[layer[id]]}
<tr> <tr>
<th class="icon">counter_{i + 1}</th> <th class="icon">counter_{i + 1}</th>
<td>{action?.id}</td> <td><button>{action?.title || action?.id} <span class="icon">edit</span></button></td>
</tr> </tr>
{/each} {/each}
</table> </table>
<style lang="scss">
span.icon {
opacity: 0;
transition: opacity 250ms ease;
}
button {
cursor: pointer;
display: flex;
gap: 4px;
align-items: center;
justify-content: space-between;
width: 100%;
font-family: "Noto Sans Mono", monospace;
font-weight: 600;
color: var(--md-sys-color-on-surface);
background: transparent;
border: none;
border-radius: 8px;
transition: all 250ms ease;
}
button:hover > span.icon {
opacity: 1;
}
</style>

View File

@@ -1,6 +1,5 @@
<script> <script>
import {serialPort, syncStatus} from "$lib/serial/connection" import {serialPort, syncStatus} from "$lib/serial/connection"
import {browser} from "$app/environment"
import {page} from "$app/stores" import {page} from "$app/stores"
import {slide, fly} from "svelte/transition" import {slide, fly} from "svelte/transition"
import {canShare, triggerShare} from "$lib/share" import {canShare, triggerShare} from "$lib/share"
@@ -37,14 +36,6 @@
{#await import("$lib/components/PwaStatus.svelte") then { default: PwaStatus }} {#await import("$lib/components/PwaStatus.svelte") then { default: PwaStatus }}
<PwaStatus /> <PwaStatus />
{/await} {/await}
{#if browser && !("serial" in navigator)}
<abbr
title="Your browser does not support serial connections. Try using Chrome instead."
class="icon error"
>
warning
</abbr>
{/if}
<a <a
title="Backup & Restore" title="Backup & Restore"
href="/backup/" href="/backup/"

View File

@@ -10,6 +10,7 @@ export const editableLayout: Action<HTMLButtonElement, {id: number; quadrant: nu
const edit = tippy(node, { const edit = tippy(node, {
interactive: true, interactive: true,
appendTo: document.body, appendTo: document.body,
trigger: "click",
placement: (["top", "right", "bottom", "left"] as const)[quadrant], placement: (["top", "right", "bottom", "left"] as const)[quadrant],
onShow(instance) { onShow(instance) {
component ??= new InputEdit({ component ??= new InputEdit({