Skip to content

Commit 3a1e534

Browse files
committed
fix front page sponsors
1 parent 7bf3547 commit 3a1e534

File tree

1 file changed

+35
-24
lines changed

1 file changed

+35
-24
lines changed

src/components/Sponsors.vue

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,70 @@
11
<template>
2-
<div class="row bg-grey-dark-darkmode pt-medium pb-medium p-small">
2+
<div class="row bg-grey-dark-darkmode pt-medium pb-medium p-small mb-large">
33
<div class="col-sm-12 mb-xsmall type-center color-theme">
44
<h3>
55
{{ $t('development.sponsorBoxTitle') }}
66
</h3>
77
</div>
8-
<a
9-
v-for="sponsor in $tm('resourcesList.sponsors')"
10-
:key="sponsor.name"
11-
:href="sponsor.href"
12-
target="_blank"
13-
class="sponsor">
14-
<div
15-
class="cursor-pointer bg-white card">
16-
<div
17-
class="img-container mb-small"
18-
:style="`background-image: url(${publicPath}img/sponsors/${sponsor.img})`" />
19-
</div>
20-
</a>
8+
<div class="list-container">
9+
<a
10+
v-for="sponsor in sponsors"
11+
:key="sponsor.fields.name"
12+
:href="sponsor.fields.href"
13+
target="_blank"
14+
class="sponsor card mb-small">
15+
<div
16+
class="img-container mb-small"
17+
:style="`background-image: url(${sponsor.fields.logo.fields.file.url})`" />
18+
</a>
19+
</div>
2120
<div class="col-sm-12 type-small type-right pr-small" v-html="$t('development.howToJoin')" />
2221
</div>
2322
</template>
2423

2524
<script>
25+
import { getSponsors } from '../js/contentfulClient'
26+
2627
export default {
2728
name: 'Sponsors',
2829
data: () => ({
29-
publicPath: process.env.BASE_URL
30-
})
30+
publicPath: process.env.BASE_URL,
31+
sponsors: []
32+
}),
33+
async created() {
34+
this.sponsors = (await getSponsors()).sort((a, b) => a.fields.name < b.fields.name ? -1 : 1)
35+
}
3136
}
3237
</script>
3338

3439
<style scoped>
40+
.list-container {
41+
display: flex;
42+
flex-wrap: wrap;
43+
column-gap: 0.5rem;
44+
width: 100%;
45+
}
3546
.sponsor {
36-
flex-basis: 14.6%;
37-
max-width: 14.6%;
47+
flex: 1 0 19%;
48+
max-width: calc(20% - 0.5rem);
3849
transition: transform 0.2s;
39-
margin: 0 1%;
50+
cursor: pointer;
51+
background-color: var(--color-white);
4052
}
4153
.sponsor:hover {
4254
transform: scale(1.08);
4355
}
4456
.img-container {
4557
width: 80%;
46-
margin-left: auto;
47-
margin-right: auto;
58+
margin: 0.5rem auto;
4859
height: 4rem;
4960
background-repeat: no-repeat;
5061
background-size: contain;
5162
background-position: center;
5263
}
53-
@media screen and (max-width: 700px) {
64+
@media screen and (max-width: 1024px) {
5465
.sponsor {
55-
flex-basis: 31%;
56-
max-width: 31%;
66+
flex: 1 0 30%;
67+
max-width: 33%;
5768
}
5869
}
5970
</style>

0 commit comments

Comments
 (0)