|
9 | 9 | }" |
10 | 10 | > |
11 | 11 | <div class="flex flex-col items-center"> |
12 | | - <!-- <template v-for="({ tier, sponsors }) of sponsorGroups" :key="tier"> --> |
13 | 12 | <div class="w-full mb-24"> |
14 | | - <!-- <UBadge color="neutral" variant="subtle" class="capitalize mb-2"> |
15 | | - {{ tier }} sponsors |
16 | | - </UBadge> --> |
17 | | - |
18 | | - <div class="w-full border border-default rounded-lg"> |
19 | | - <table class="w-full"> |
20 | | - <tbody> |
21 | | - <template |
22 | | - v-for="(_, rowIndex) in Math.ceil(sponsors.length / 3)" |
23 | | - :key="rowIndex" |
24 | | - > |
25 | | - <tr> |
26 | | - <template v-for="colIndex in 3" :key="colIndex"> |
27 | | - <td |
28 | | - v-if="rowIndex * 3 + colIndex - 1 < sponsors.length" |
29 | | - class="border-b border-r border-default p-0 w-1/3 h-[120px]" |
30 | | - :class="{ |
31 | | - 'border-r-0': colIndex === 3, |
32 | | - 'border-b-0': |
33 | | - rowIndex === Math.ceil(sponsors.length / 3) - 1, |
34 | | - }" |
35 | | - > |
36 | | - <NuxtLink |
37 | | - :to="sponsors[rowIndex * 3 + colIndex - 1].url" |
38 | | - target="_blank" |
39 | | - class="flex items-center gap-2 justify-center h-full hover:bg-muted/50 transition-colors" |
40 | | - > |
41 | | - <NuxtImg |
42 | | - :src="`/sponsors/${sponsors[rowIndex * 3 + colIndex - 1]?.image.src}`" |
43 | | - :alt="`${sponsors[rowIndex * 3 + colIndex - 1]?.image.alt}`" |
44 | | - loading="lazy" |
45 | | - class="h-10 max-w-[140px] object-contain rounded-lg" |
46 | | - height="40" |
47 | | - width="40" |
48 | | - /> |
49 | | - <span class="text-base hidden sm:block font-semibold">{{ |
50 | | - sponsors[rowIndex * 3 + colIndex - 1].title |
51 | | - }}</span> |
52 | | - </NuxtLink> |
53 | | - </td> |
54 | | - <td |
55 | | - v-else |
56 | | - class="border-b border-r border-default p-0 w-1/3 h-[120px]" |
57 | | - :class="{ |
58 | | - 'border-r-0': colIndex === 3, |
59 | | - 'border-b-0': |
60 | | - rowIndex === Math.ceil(sponsors.length / 3) - 1, |
61 | | - }" |
62 | | - > |
63 | | - <div class="h-full" /> |
64 | | - </td> |
65 | | - </template> |
66 | | - </tr> |
67 | | - </template> |
68 | | - </tbody> |
69 | | - </table> |
70 | | - </div> |
| 13 | + <ul |
| 14 | + class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 w-full border border-default rounded-lg overflow-hidden list-none p-0" |
| 15 | + > |
| 16 | + <li |
| 17 | + v-for="(sponsor, index) in sponsors" |
| 18 | + :key="sponsor.url" |
| 19 | + class="h-[120px] border-default" |
| 20 | + :class="{ |
| 21 | + 'border-r': (index + 1) % 3 !== 0, |
| 22 | + 'border-b': index < sponsors.length - (sponsors.length % 3 || 3), |
| 23 | + }" |
| 24 | + > |
| 25 | + <NuxtLink |
| 26 | + :to="sponsor.url" |
| 27 | + target="_blank" |
| 28 | + class="flex items-center gap-2 justify-center h-full hover:bg-muted/50 transition-colors" |
| 29 | + > |
| 30 | + <NuxtImg |
| 31 | + :src="`/sponsors/${sponsor.image.src}`" |
| 32 | + :alt="sponsor.image.alt" |
| 33 | + loading="lazy" |
| 34 | + class="h-10 max-w-[140px] object-contain rounded-lg" |
| 35 | + height="40" |
| 36 | + width="40" |
| 37 | + /> |
| 38 | + <span class="text-base hidden sm:block font-semibold">{{ |
| 39 | + sponsor.title |
| 40 | + }}</span> |
| 41 | + </NuxtLink> |
| 42 | + </li> |
| 43 | + </ul> |
71 | 44 | </div> |
72 | | - <!-- </template> --> |
73 | 45 | </div> |
74 | 46 | </UPageSection> |
75 | 47 | </template> |
|
0 commit comments