11---
22import { getCollection } from " astro:content" ;
33import type { CollectionEntry } from " astro:content" ;
4+ import { Image } from " astro:assets" ;
45
56const allSpeakers = await getCollection (" speakers" );
67
@@ -33,10 +34,12 @@ const sectionSubtitle = "Meet some of our amazing speakers";
3334 <a href = { ` /speaker/${speaker .id } ` } class = " block group" >
3435 <div class = " bg-white rounded-lg shadow-md overflow-hidden transition-transform duration-300 group-hover:-translate-y-2" >
3536 <div class = " aspect-square overflow-hidden" >
36- <img
37+ <Image
3738 src = { speaker .data .avatar }
3839 alt = { ` ${speaker .data .name }'s profile picture ` }
3940 class = " w-full h-full object-cover transition-transform duration-300 group-hover:scale-105"
41+ height = { 250 }
42+ width = { 250 }
4043 loading = " eager"
4144 />
4245 </div >
@@ -88,7 +91,7 @@ const sectionSubtitle = "Meet some of our amazing speakers";
8891 function moveCarousel() {
8992 currentPosition += slideWidth;
9093
91- track.style.transition = 'transform 2000ms linear';
94+ track.style.transition = 'transform 1000ms linear';
9295 track.style.transform = `translateX(-${currentPosition}%)`;
9396
9497 if (currentPosition >= slideWidth * totalOriginalSlides) {
@@ -98,9 +101,9 @@ const sectionSubtitle = "Meet some of our amazing speakers";
98101 track.style.transform = `translateX(0)`;
99102
100103 setTimeout(() => {
101- track.style.transition = 'transform 2000ms linear';
104+ track.style.transition = 'transform 1000ms linear';
102105 }, 20);
103- }, 1000 );
106+ }, 4000 );
104107 }
105108 }
106109
0 commit comments