summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/routes/(app)/+layout.svelte35
1 files changed, 35 insertions, 0 deletions
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 () => {