feat: add reset options

resolves #70
This commit is contained in:
2023-12-29 15:04:33 +01:00
parent a3857843d6
commit f2f61f32f2
6 changed files with 136 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<script lang="ts">
import {serialPort} from "$lib/serial/connection"
import {createEventDispatcher} from "svelte"
export let challenge: string
let challengeInput = ""
$: challengeString = `${challenge} ${$serialPort!.device}`
$: isValid = challengeInput === challengeString
const dispatch = createEventDispatcher()
</script>
<h3>Type the following to confim the action</h3>
<p>{challengeString}</p>
<input type="text" bind:value={challengeInput} placeholder={challengeString} />
<button disabled={!isValid} on:click={() => dispatch("confirm")}>Confirm {challenge}</button>
<style lang="scss">
input[type="text"] {
color: inherit;
font-family: inherit;
background: none;
border: none;
border-bottom: 1px solid currentcolor;
&:focus {
outline: none;
border-color: var(--md-sys-color-secondary);
}
}
button {
color: var(--md-sys-color-error);
}
</style>