From b74211c4e9a3bf86fa41175eab54417df0851220 Mon Sep 17 00:00:00 2001 From: Logan Hunt Date: Sun, 26 Jun 2022 15:29:04 -0700 Subject: YAY SLIDER FINALLY DONE HOLY SHIT --- src/routes/index.svelte | 44 ++++++++++++++++++++++++++++++++++++++++++-- src/routes/team/index.svelte | 16 ++-------------- 2 files changed, 44 insertions(+), 16 deletions(-) (limited to 'src/routes') diff --git a/src/routes/index.svelte b/src/routes/index.svelte index fa9fe28..5c67709 100644 --- a/src/routes/index.svelte +++ b/src/routes/index.svelte @@ -1,6 +1,25 @@
- mountains + console.log('slide change')} + on:swiper={(e) => console.log(e.detail[0])} + > + {#each images as { image, alt } (image)} + + {alt} + + {/each} +

Helping you conquer Mount Doom

@@ -8,7 +27,7 @@
-
+

"Darkness must pass, a new day will come, and when the sun shines, it will shine out the clearer."

@@ -32,4 +51,25 @@
+
+ + \ No newline at end of file diff --git a/src/routes/team/index.svelte b/src/routes/team/index.svelte index 489ae04..04c62b9 100644 --- a/src/routes/team/index.svelte +++ b/src/routes/team/index.svelte @@ -3,6 +3,7 @@ import { onMount } from 'svelte'; import { supabase } from '$lib/supabase'; + import setImageUrl from '$lib/utils'; const getPeople = async () => { const { data, error } = await supabase.from('people').select().order('id'); @@ -12,22 +13,9 @@ return []; } - const mapImages = (people) => { - return people.map((x) => { - const { publicURL, error } = supabase - .storage - .from('mistymountains') - .getPublicUrl(x.image); - if (!error) { - return { ...x, image: publicURL }; - } - return x; - }); - } - let people = []; onMount(async () => { - people = await getPeople().then(mapImages); + people = await getPeople().then((people) => people.map(setImageUrl)); }); -- cgit v1.2.3-70-g09d2