Skip to content

Commit 788116d

Browse files
committed
add backside of sponsor cards with link
1 parent a12e9dc commit 788116d

File tree

1 file changed

+77
-21
lines changed

1 file changed

+77
-21
lines changed

packages/frontendmu-nuxt/components/home/SponsorCarousel.vue

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,31 +48,41 @@ const carouselRef = templateRef<HTMLDivElement>('carouselRef')
4848
tabindex="0"
4949
aria-label="Sponsor logos carousel"
5050
>
51-
<div
51+
<NuxtLink
5252
v-for="(sponsor) in sortedSponsors"
5353
:key="sponsor.id"
54-
class="grid place-items-center justify-center items-center bg-white p-4 rounded-md"
55-
:title="sponsor.name"
54+
:to="{
55+
name: 'meetup-id',
56+
params: {
57+
id: sponsor.meetups[0].id,
58+
},
59+
}"
60+
:title="`${sponsor.name} has sponsored the ${sponsor.meetups[0].title} meetup at ${sponsor.meetups[0].venue}`"
5661
>
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}`"
62+
<div
63+
64+
class="flip-card h-32 w-full object-contain rounded-md"
65+
:title="sponsor.name"
6666
>
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>
75-
</div>
67+
<div class="flip-card-inner">
68+
<div class="flip-card-front grid place-items-center justify-center items-center bg-white p-4 rounded-md">
69+
<img
70+
:src="sponsorLogoUrl(sponsor)"
71+
:alt="sponsor.name"
72+
:class="sponsor.darkbg ? 'dark:bg-verse-900 bg-gray-500' : ''"
73+
class="h-20 max-h-28 w-full object-contain rounded-md p-2"
74+
draggable="false"
75+
>
76+
</div>
77+
<div class="flip-card-back grid place-items-center justify-center items-center bg-white p-4 rounded-md">
78+
<span class="z-0 absolute inset-0 h-full text-center w-full items-center justify-center text-gray-200 text-[100px] flex gap-2">
79+
{{ sponsor.meetups[0].date.split('-')[0] }}
80+
</span>
81+
<span class="z-10 font-medium font-mono text-lg text-center w-full block">{{ `${sponsor.name} has sponsored the ${sponsor.meetups[0].title} meetup` }}</span>
82+
</div>
83+
</div>
84+
</div>
85+
</NuxtLink>
7686
</div>
7787
</div>
7888
<div class="text-center">
@@ -82,3 +92,49 @@ const carouselRef = templateRef<HTMLDivElement>('carouselRef')
8292
</div>
8393
</section>
8494
</template>
95+
96+
<style scoped>
97+
.flip-card {
98+
background: transparent;
99+
perspective: 200px;
100+
}
101+
102+
.flip-card-inner {
103+
position: relative;
104+
width: 100%;
105+
height: 100%;
106+
transition: transform 0.4s ease-in-out;
107+
transform-style: preserve-3d;
108+
/* transform-origin: 100px center; */
109+
}
110+
111+
.flip-card:hover .flip-card-inner,
112+
.flip-card:focus-within .flip-card-inner {
113+
transition: transform 0.6s cubic-bezier(0.68, -0.6, 0.32, 1.5);
114+
transform: rotateX(180deg);
115+
}
116+
117+
.flip-card-front, .flip-card-back {
118+
position: absolute;
119+
width: 100%;
120+
height: 100%;
121+
backface-visibility: hidden;
122+
display: flex;
123+
align-items: center;
124+
justify-content: center;
125+
border-radius: 0.375rem; /* match rounded-md */
126+
}
127+
128+
.flip-card-front {
129+
z-index: 2;
130+
}
131+
132+
.flip-card-back {
133+
transform: rotateX(180deg);
134+
z-index: 1;
135+
background: #fff;
136+
color: #222;
137+
padding: 1rem;
138+
box-sizing: border-box;
139+
}
140+
</style>

0 commit comments

Comments
 (0)