diff options
| -rwxr-xr-x | tools/run | 2 | ||||
| -rw-r--r-- | ui/routes/(app)/+layout.svelte | 35 |
2 files changed, 36 insertions, 1 deletions
@@ -5,7 +5,7 @@ if [ -z ${PILCROW_DEV+x} ]; then 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 86bc330..84c71ec 100644 --- a/ui/routes/(app)/+layout.svelte +++ b/ui/routes/(app)/+layout.svelte @@ -26,6 +26,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) { @@ -46,6 +80,7 @@ break; } loading = false; + setTouchEvents(); }); onDestroy(async () => { |
