From 5363954095515b178811040cb745b330ecb3c26e Mon Sep 17 00:00:00 2001 From: not manx Date: Sat, 1 Aug 2020 01:08:02 +0100 Subject: [PATCH] Add index.html --- .gitignore | 3 ++- public/index.html | 13 +++++++++++++ rollup.config.js | 4 +--- src/index.svelte | 6 +++--- src/lightbox.svelte | 42 ++++++++++++++++++++++++++++++------------ 5 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 public/index.html diff --git a/.gitignore b/.gitignore index 36170a7..c030c3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ node_modules -public +public/* +!public/index.html diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..92dfaf9 --- /dev/null +++ b/public/index.html @@ -0,0 +1,13 @@ + + + + + + + + Cute and Funny + + + + + diff --git a/rollup.config.js b/rollup.config.js index b8eb4ee..a14e955 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -43,9 +43,7 @@ export default { production && terser() ], - watch: { - clearScreen: false, - }, + watch: { clearScreen: false }, }; function serve() { diff --git a/src/index.svelte b/src/index.svelte index 3d42f5e..99728ac 100644 --- a/src/index.svelte +++ b/src/index.svelte @@ -16,7 +16,7 @@ file_list = await fetch(url.root + url.files) .then(resp => resp.text()) .then(data => data.split('\n')); - + // Loop backwards efficiently. for (let i = file_list.length - 2; i >= 0; i--) { const file = file_list[i]; @@ -34,9 +34,9 @@ {#if file_list} -
+
{#each thumb_list as thumb, i} - open_lightbox(i)} src="{url.root}{url.thumb}{thumb}" /> + open_lightbox(i)} src="{url.root}{url.thumb}{thumb}" /> {/each}
{/if} diff --git a/src/lightbox.svelte b/src/lightbox.svelte index 74be78c..db3cb76 100644 --- a/src/lightbox.svelte +++ b/src/lightbox.svelte @@ -47,6 +47,7 @@ switch(e.key) { case 'ArrowRight': open = open === (images.length - 2) ? 0 : open + 1; + slide_classes = 'slide-in-right'; break; case 'ArrowLeft': open = open === 0 ? images.length - 2 : open - 1; @@ -62,21 +63,38 @@