@@ -17,6 +17,13 @@ const sortedSponsors = computed(() => {
17
17
})
18
18
})
19
19
20
+ function opacityValue(index : number ) {
21
+ // the lower the index, the closer it has to be to 100, the higher the index it has to reach 0
22
+ // the max index is sortedSponsors.length - 1
23
+ const maxIndex = sortedSponsors .value .length - 1
24
+ return Math .floor (100 - (index * 100 ) / maxIndex )
25
+ }
26
+
20
27
function sponsorLogoUrl(sponsor : any ) {
21
28
if (typeof sponsor .logo === ' string' ) {
22
29
return ` https://directus.frontend.mu/assets/${sponsor .logo } `
@@ -28,7 +35,7 @@ const carouselRef = templateRef<HTMLDivElement>('carouselRef')
28
35
</script >
29
36
30
37
<template >
31
- <section class =" relative w-full bg-white/50 dark:bg-verse-200/5 backdrop-blur-sm mx-auto py-6 md:py-10" >
38
+ <section class =" relative w-full dark:bg-verse-200/5 backdrop-blur-sm mx-auto py-6 md:py-10" >
32
39
<div class =" flex items-center justify-center mb-3 w-full" >
33
40
<h2 class =" font-heading tracking-tight text-verse-900 dark:text-verse-200 font-light text-3xl sm:text-4xl md:text-5xl" >
34
41
Sponsored by
@@ -37,22 +44,34 @@ const carouselRef = templateRef<HTMLDivElement>('carouselRef')
37
44
<div class =" w-full py-4 px-8 max-w-7xl mx-auto" >
38
45
<div
39
46
ref =" carouselRef"
40
- class =" grid grid-cols-6 gap-4 overflow-x-auto "
47
+ class =" grid lg: grid-cols-4 md:grid-cols-2 grid-cols-1 gap-8 "
41
48
tabindex =" 0"
42
49
aria-label =" Sponsor logos carousel"
43
50
>
44
51
<div
45
- v-for =" sponsor in sortedSponsors"
52
+ v-for =" ( sponsor) in sortedSponsors"
46
53
:key =" sponsor.id"
47
- class =" flex justify-center items-center bg-white p-4 rounded-md"
54
+ class =" grid place-items-center justify-center items-center bg-white p-4 rounded-md"
48
55
:title =" sponsor.name"
49
56
>
50
- <img
51
- :src =" sponsorLogoUrl(sponsor)"
52
- :alt =" sponsor.name"
53
- :class =" sponsor.darkbg ? 'dark:bg-verse-900 bg-gray-500' : ''"
54
- draggable =" false"
57
+ <!-- :style="{ opacity: `${opacityValue(index)}%`, width: `${opacityValue(index) / 6}%`, filter: `saturate(${opacityValue(index) / 100})` }" -->
58
+ <NuxtLink
59
+ :to =" {
60
+ name: 'meetup-id',
61
+ params: {
62
+ id: sponsor.meetups[0].id,
63
+ },
64
+ }"
65
+ :title =" `${sponsor.name} has sponsored the ${sponsor.meetups[0].title} meetup at ${sponsor.meetups[0].venue}`"
55
66
>
67
+ <img
68
+ :src =" sponsorLogoUrl(sponsor)"
69
+ :alt =" sponsor.name"
70
+ :class =" sponsor.darkbg ? 'dark:bg-verse-900 bg-gray-500' : ''"
71
+ class =" h-20 max-h-24 w-full object-contain rounded-md p-2"
72
+ draggable =" false"
73
+ >
74
+ </NuxtLink >
56
75
</div >
57
76
</div >
58
77
</div >
0 commit comments