From: PhiTux Date: Sat, 5 Apr 2025 17:31:35 +0000 (+0200) Subject: bunch of qol-updates and css-fixes X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=122da39319e99b54d013e0fd6f34bb1b2198a377;p=DailyTxT.git bunch of qol-updates and css-fixes --- diff --git a/backend/server/main.py b/backend/server/main.py index ab10bfd..86afc15 100644 --- a/backend/server/main.py +++ b/backend/server/main.py @@ -16,7 +16,9 @@ origins = [ "http://localhost:5173", "localhost:5173", "http://192.168.1.35:5173", - "192.168.1.35:5173" + "192.168.1.35:5173", + "http://100.100.87.111:5173", + "http://lab:5173" ] app.add_middleware( diff --git a/frontend/src/lib/ImageViewer.svelte b/frontend/src/lib/ImageViewer.svelte index 2ea5106..063e472 100644 --- a/frontend/src/lib/ImageViewer.svelte +++ b/frontend/src/lib/ImageViewer.svelte @@ -42,26 +42,36 @@ } } - // Variablen für die Swipe-Erkennung + // Variables for touch events let touchStartX = 0; let touchEndX = 0; // Swipe-Handler function handleTouchStart(event) { - touchStartX = event.touches[0].clientX; // X-Position des Touch-Starts speichern + touchStartX = event.touches[0].clientX; // save the initial touch position + touchEndX = touchStartX; } function handleTouchMove(event) { - touchEndX = event.touches[0].clientX; // X-Position während der Bewegung speichern + console.log('move'); + touchEndX = event.touches[0].clientX; // update the touch position } - function handleTouchEnd() { - // Prüfen, ob der Swipe nach links oder rechts ging + function handleTouchEnd(event) { + console.log(event.target.classList); + if ( + event.target.classList.contains('fullscreen-scroll') || + event.target.classList.contains('image') + ) { + return; // do nothing if the touch ends on the scroll area + } + + // calculate the swipe distance if (touchStartX - touchEndX > 50) { - // Swipe nach links + // Swipe left nextImage(); } else if (touchEndX - touchStartX > 50) { - // Swipe nach rechts + // Swipe right prevImage(); } } @@ -147,20 +157,18 @@ {/if} -