From f7d9841ceeac1f1a183e4fcdc8df5571b6337041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Pe=CC=81ault?= Date: Thu, 20 Feb 2020 19:02:07 +0100 Subject: [PATCH] Location: Pagination working! --- .../location/[country]/[location].svelte | 76 +++++++++++++++---- 1 file changed, 61 insertions(+), 15 deletions(-) diff --git a/src/routes/location/[country]/[location].svelte b/src/routes/location/[country]/[location].svelte index 880e946..237f73c 100644 --- a/src/routes/location/[country]/[location].svelte +++ b/src/routes/location/[country]/[location].svelte @@ -17,8 +17,10 @@ - Houses Of - Beautiful houses of {locationFull} + Houses Of - Beautiful houses of {location.name}, {location.country.name}
@@ -120,27 +156,37 @@
- {#each photos as photo, index} + {#each paginatedPhotos as photo, index} {/each}
- {#if photos.length}
-
+ {#if photos.length && currentIndex <= photos.length} +
pageTranslate = pageTranslate - ((100 / pagesTotal) * 0.666)} + on:mouseleave={() => pageTranslate = pageTranslate + ((100 / pagesTotal) * 0.666)} + >
page
-
- 3 - 2 - 1 +
+ {#each pages as page} + {page} + {/each}
/{pagesTotal}
-

See more photos

+

See more photos

+ + {:else} +
+

That's all folks!

+

Come back later to check out
new photos of {location.name}

+
+ {/if}
- {/if}