summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/run2
-rw-r--r--ui/routes/(app)/+layout.svelte35
2 files changed, 36 insertions, 1 deletions
diff --git a/tools/run b/tools/run
index 562a94d..ac42e93 100755
--- a/tools/run
+++ b/tools/run
@@ -6,7 +6,7 @@ if [ -z ${HI_DEV+x} ]; then
tools/build-ui
cargo run -- "$@"
else
- npm run dev & PIDS[0]=$!
+ npm run dev -- --host 192.168.68.57 & PIDS[0]=$!
cargo run -- "$@" & PIDS[1]=$!
trap "kill ${PIDS[*]}" SIGINT
diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte
index ae3dc6a..acaea53 100644
--- a/ui/routes/(app)/+layout.svelte
+++ b/ui/routes/(app)/+layout.svelte
@@ -25,6 +25,40 @@
messages.update((value) => value.setMessages(boot.messages));
}
+ function setTouchEvents() {
+ document.addEventListener("touchstart", processTouchStart);
+ document.addEventListener("touchmove", processTouchMove);
+ document.addEventListener("touchcancel", processTouchCancel);
+ document.addEventListener("touchend", processTouchEnd);
+ }
+
+ function processTouchStart(ev) {
+ ev.preventDefault();
+ switch (ev.touches.length) {
+ case 1:
+ console.log("touch: single");
+ break;
+ case 2:
+ console.log("touch: double");
+ break;
+ case 3:
+ console.log("touch: triple");
+ break;
+ default:
+ console.log("touch: unsupported");
+ break;
+ }
+ }
+
+ function processTouchMove(ev) {
+ }
+
+ function processTouchCancel(ev) {
+ }
+
+ function processTouchEnd(ev) {
+ }
+
onMount(async () => {
let response = await boot();
switch (response.status) {
@@ -45,6 +79,7 @@
break;
}
loading = false;
+ setTouchEvents();
});
onDestroy(async () => {