-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
FeaturedSponsors.astro
59 lines (56 loc) · 1.42 KB
/
FeaturedSponsors.astro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
import featuredSponsors from "../featured-sponsors.json"
/**
* Sketchy array of classes that should be applied to specific logos
* in this context. Match the name from `featured-sponsors.json` if
* you need to add one.
*/
const nudges = {
"Platform.sh": "mt-12 h-11",
Tag1: "h-9",
"Oliver Wand": "h-12 w-12",
DrupalEasy: "h-10",
"Redfin Solutions": "h-16 w-16",
MacStadium: "h-15",
Lullabot: "h-9",
"Craft CMS": "h-11",
undpaul: "h-9",
"1xINTERNET": "h-11",
}
// Add class property to relevant sponsor objects
featuredSponsors.map((sponsor) => {
if (sponsor.name in nudges) {
sponsor.class = nudges[sponsor.name]
}
})
---
<div class="relative">
<div
class={`flex flex-wrap space-y-12 -mt-12 justify-center items-center content-center`}
>
{
featuredSponsors.map((sponsor) => (
<a
class={
`block relative overflow-hidden cursor-pointer h-12 mx-6` +
(sponsor.hasOwnProperty("class") ? ` ` + sponsor.class : ``)
}
title={sponsor.name}
href={sponsor.url}
target="_blank"
>
<picture>
<source
srcset={sponsor.darklogo}
media="(prefers-color-scheme: dark)">
<img
src={sponsor.logo}
class="block w-auto h-full"
alt={`${sponsor.name} logo`}
/>
</picture>
</a>
))
}
</div>
</div>