From cfc51f04c377b336eb3f0f665a1cf662f27fca2a Mon Sep 17 00:00:00 2001 From: not manx Date: Fri, 31 Jul 2020 03:54:55 +0100 Subject: [PATCH] Start implementing lightbox Moving between images works, and we preload one on either side of the current index. There's also the beginnings of some slide animations which is my next job. --- src/index.svelte | 38 +++++++++++++++- src/lightbox.svelte | 108 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 144 insertions(+), 2 deletions(-) create mode 100644 src/lightbox.svelte diff --git a/src/index.svelte b/src/index.svelte index b2b80aa..4daccd1 100644 --- a/src/index.svelte +++ b/src/index.svelte @@ -1,5 +1,39 @@ -

Hey {world}

+{#if file_list} +
+ {#each thumb_list as thumb, i} + open_lightbox(i)} src="{url.root}{url.thumb}{thumb}" /> + {/each} +
+{/if} + diff --git a/src/lightbox.svelte b/src/lightbox.svelte new file mode 100644 index 0000000..b4d5aa7 --- /dev/null +++ b/src/lightbox.svelte @@ -0,0 +1,108 @@ + + + + + + +