diff --git a/src/lib/style/elements/_popover.scss b/src/lib/style/elements/_popover.scss
new file mode 100644
index 00000000..2d9301c9
--- /dev/null
+++ b/src/lib/style/elements/_popover.scss
@@ -0,0 +1,51 @@
+$animation-duration: 150ms;
+$translate: translateY(8px);
+
+[popover] {
+ position: absolute;
+ inset: unset;
+ transform: $translate;
+
+ margin: 0;
+ padding: 8px;
+ border: 1px solid var(--md-sys-color-outline);
+ border-radius: 8px;
+
+ color: var(--md-sys-color-on-surface);
+
+ opacity: 0;
+ background: var(--md-sys-color-surface);
+
+ transition:
+ transform $animation-duration ease,
+ opacity $animation-duration ease,
+ overlay $animation-duration allow-discrete,
+ display $animation-duration allow-discrete;
+
+ position-area: bottom span-right;
+ position-try-fallbacks:
+ top span-right,
+ bottom span-left,
+ top span-left;
+
+ position-visibility: no-overflow;
+
+ &:popover-open {
+ transform: translateY(0);
+ opacity: 1;
+ }
+
+ > h1:first-child,
+ h2:first-child,
+ h3:first-child {
+ margin-top: 0;
+ text-align: center;
+ }
+}
+
+@starting-style {
+ [popover]:popover-open {
+ transform: $translate;
+ opacity: 0;
+ }
+}
diff --git a/src/lib/style/theme.scss b/src/lib/style/theme.scss
index 267275ac..d0c8c1d9 100644
--- a/src/lib/style/theme.scss
+++ b/src/lib/style/theme.scss
@@ -8,6 +8,7 @@
@use "print";
@use "elements/h1";
+@use "elements/popover";
body {
overflow: hidden;
diff --git a/src/routes/(app)/config/settings/+page.svelte b/src/routes/(app)/config/settings/+page.svelte
index f98cc76d..e4e19190 100644
--- a/src/routes/(app)/config/settings/+page.svelte
+++ b/src/routes/(app)/config/settings/+page.svelte
@@ -161,7 +161,10 @@
>reset_settingsReset Settings
{/if}
-
+
+
{/if}
diff --git a/src/routes/(app)/config/settings/ConfirmChallenge.svelte b/src/routes/(app)/config/settings/ConfirmChallenge.svelte
deleted file mode 100644
index 8c2c344a..00000000
--- a/src/routes/(app)/config/settings/ConfirmChallenge.svelte
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-Type the following to confirm the action
-
-{challengeString}
-
-
-
-
-
-
diff --git a/src/routes/(app)/config/settings/ResetPopup.svelte b/src/routes/(app)/config/settings/ResetPopup.svelte
index f57c4ae2..c184f865 100644
--- a/src/routes/(app)/config/settings/ResetPopup.svelte
+++ b/src/routes/(app)/config/settings/ResetPopup.svelte
@@ -1,5 +1,4 @@
Reset Device
+Resetting might take up to 2 Minutes.
{#each options as category, i}
{#if i > 0}
{/if}
{#each category as [command, description]}
- {
+ event.preventDefault();
+ $serialPort?.reset(command);
+ $serialPort = undefined;
+ }}
>
+
+
+
{/each}
{/each}
@@ -39,4 +44,43 @@
hr {
opacity: 0.25;
}
+
+ p {
+ width: 22ch;
+ }
+
+ button.icon {
+ font-size: 20px;
+ opacity: 0.5;
+ }
+
+ form {
+ display: flex;
+ align-items: center;
+ gap: 0.5rem;
+ margin-bottom: 1rem;
+ }
+
+ input[type="text"] {
+ color: inherit;
+ font-family: inherit;
+ background: none;
+ border: none;
+ border-bottom: 1px solid transparent;
+ width: fit-content;
+
+ &:focus {
+ outline: none;
+ border-color: var(--md-sys-color-outline);
+ }
+ }
+
+ input[type="text"]:valid {
+ color: var(--md-sys-color-error);
+
+ & + button {
+ color: var(--md-sys-color-error);
+ opacity: 1;
+ }
+ }
diff --git a/src/routes/(app)/config/settings/confirm-challenge.ts b/src/routes/(app)/config/settings/confirm-challenge.ts
deleted file mode 100644
index 0555d5fc..00000000
--- a/src/routes/(app)/config/settings/confirm-challenge.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-import type { Action } from "svelte/action";
-import ConfirmChallenge from "./ConfirmChallenge.svelte";
-import tippy from "tippy.js";
-import { mount, unmount } from "svelte";
-
-export const confirmChallenge: Action<
- HTMLElement,
- { onConfirm: () => void; challenge: string }
-> = (node, { onConfirm, challenge }) => {
- let component: {} | undefined;
- let target: HTMLElement | undefined;
- const edit = tippy(node, {
- interactive: true,
- trigger: "click",
- onShow(instance) {
- target = instance.popper.querySelector(".tippy-content") as HTMLElement;
- target.classList.add("active");
- if (component === undefined) {
- component = mount(ConfirmChallenge, {
- target,
- props: {
- challenge,
- onconfirm() {
- edit.hide();
- onConfirm();
- },
- },
- });
- }
- },
- onHidden() {
- if (component) {
- unmount(component);
- }
- target?.classList.remove("active");
- component = undefined;
- },
- });
-
- return {
- destroy() {
- edit.destroy();
- },
- };
-};