summaryrefslogtreecommitdiff
path: root/src/routes
diff options
context:
space:
mode:
authorLogan Hunt <loganhunt@simponic.xyz>2022-06-26 15:29:04 -0700
committerLogan Hunt <loganhunt@simponic.xyz>2022-06-26 15:29:04 -0700
commitb74211c4e9a3bf86fa41175eab54417df0851220 (patch)
tree089e89389b3ebe8f77518f488d100031b2405b40 /src/routes
parent17df5367f994cf18fb80df018218dc13b79a7b4f (diff)
downloadmistymountainstherapy-b74211c4e9a3bf86fa41175eab54417df0851220.tar.gz
mistymountainstherapy-b74211c4e9a3bf86fa41175eab54417df0851220.zip
YAY SLIDER FINALLY DONE HOLY SHIT
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/index.svelte44
-rw-r--r--src/routes/team/index.svelte16
2 files changed, 44 insertions, 16 deletions
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 @@
<div class="row align-items-center py-2">
<div class="col-md-7">
- <img src="https://ztxoywaazhxdeiftmsiy.supabase.co/storage/v1/object/public/mistymountains/mountains.png" alt="mountains" class="img-fluid rounded shadow">
+ <Swiper
+ modules={[Navigation, Pagination, Scrollbar, A11y, Autoplay]}
+ class="rounded shadow"
+ spaceBetween={50}
+ slidesPerView={1}
+ autoHeight={true}
+ loop={true}
+ navigation
+ pagination={{ clickable: true }}
+ autoplay={true}
+ speed={1000}
+ on:slideChange={() => console.log('slide change')}
+ on:swiper={(e) => console.log(e.detail[0])}
+ >
+ {#each images as { image, alt } (image)}
+ <SwiperSlide>
+ <img class="image-fluid" style="width:100%" src={image} alt={alt} />
+ </SwiperSlide>
+ {/each}
+ </Swiper>
</div>
<div class="col-md-5 my-2">
<h2>Helping you conquer Mount Doom</h2>
@@ -8,7 +27,7 @@
</div>
</div>
-<div class="bg-light rounded py-3 shadow">
+<div class="bg-light rounded p-3 shadow">
<div class="d-flex justify-content-center">
<div class="col-md-8 mt-2 border-bottom">
<h3>"Darkness must pass, a new day will come, and when the sun shines, it will shine out the clearer."</h3>
@@ -32,4 +51,25 @@
</div>
</div>
</div>
+ <br>
</div>
+
+<script>
+ import { supabase } from '$lib/supabase';
+ import setImageUrl from '$lib/utils';
+ import { Navigation, Pagination, Scrollbar, A11y, Autoplay } from 'swiper';
+ import { Swiper, SwiperSlide } from 'swiper/svelte';
+ import 'swiper/css';
+ import 'swiper/css/navigation';
+ import 'swiper/css/pagination';
+ import 'swiper/css/scrollbar';
+ import 'swiper/css/autoplay';
+
+ const images = [
+ { image: 'mountains.png', alt: 'Cloudy mountains in a light sky' },
+ { image: 'office-1-1.jpeg', alt: 'Office room one' },
+ { image: 'office-1-2.jpeg', alt: 'Office room one angle two' },
+ { image: 'office-2-1.jpeg', alt: 'Office room two' },
+ { image: 'office-2-2.jpeg', alt: 'Office room two angle two' },
+ ].map(setImageUrl);
+</script> \ 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));
});
</script>