From ded276b8a0f87e80fee0999623849a83c037ad6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Mon, 22 Nov 2021 23:21:51 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20swipe=20gesture=20on=20photo?= =?UTF-8?q?=20Viewer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global.d.ts | 10 ++ .../[country]/[location]/[photo].svelte | 31 ++++++- src/style/_base.scss | 2 +- src/style/pages/_viewer-photo.scss | 2 + src/utils/interactions/swipe.ts | 91 +++++++++++++++++++ 5 files changed, 131 insertions(+), 5 deletions(-) create mode 100644 src/utils/interactions/swipe.ts diff --git a/src/global.d.ts b/src/global.d.ts index 63908c6..fcdb1bc 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -1 +1,11 @@ /// + +/** + * Custom Events + */ +// Swipe +declare namespace svelte.JSX { + interface HTMLAttributes { + onswipe?: (event: CustomEvent & { target: EventTarget & T }) => any + } +} \ No newline at end of file diff --git a/src/routes/[country]/[location]/[photo].svelte b/src/routes/[country]/[location]/[photo].svelte index 39a0892..3dff824 100644 --- a/src/routes/[country]/[location]/[photo].svelte +++ b/src/routes/[country]/[location]/[photo].svelte @@ -1,10 +1,11 @@ - + {#if currentPhoto}