|
1 | 1 | <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"> |
3 | 3 | <div class="col-sm-12 mb-xsmall type-center color-theme">
|
4 | 4 | <h3>
|
5 | 5 | {{ $t('development.sponsorBoxTitle') }}
|
6 | 6 | </h3>
|
7 | 7 | </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> |
21 | 20 | <div class="col-sm-12 type-small type-right pr-small" v-html="$t('development.howToJoin')" />
|
22 | 21 | </div>
|
23 | 22 | </template>
|
24 | 23 |
|
25 | 24 | <script>
|
| 25 | +import { getSponsors } from '../js/contentfulClient' |
| 26 | +
|
26 | 27 | export default {
|
27 | 28 | name: 'Sponsors',
|
28 | 29 | 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 | + } |
31 | 36 | }
|
32 | 37 | </script>
|
33 | 38 |
|
34 | 39 | <style scoped>
|
| 40 | +.list-container { |
| 41 | + display: flex; |
| 42 | + flex-wrap: wrap; |
| 43 | + column-gap: 0.5rem; |
| 44 | + width: 100%; |
| 45 | +} |
35 | 46 | .sponsor {
|
36 |
| - flex-basis: 14.6%; |
37 |
| - max-width: 14.6%; |
| 47 | + flex: 1 0 19%; |
| 48 | + max-width: calc(20% - 0.5rem); |
38 | 49 | transition: transform 0.2s;
|
39 |
| - margin: 0 1%; |
| 50 | + cursor: pointer; |
| 51 | + background-color: var(--color-white); |
40 | 52 | }
|
41 | 53 | .sponsor:hover {
|
42 | 54 | transform: scale(1.08);
|
43 | 55 | }
|
44 | 56 | .img-container {
|
45 | 57 | width: 80%;
|
46 |
| - margin-left: auto; |
47 |
| - margin-right: auto; |
| 58 | + margin: 0.5rem auto; |
48 | 59 | height: 4rem;
|
49 | 60 | background-repeat: no-repeat;
|
50 | 61 | background-size: contain;
|
51 | 62 | background-position: center;
|
52 | 63 | }
|
53 |
| -@media screen and (max-width: 700px) { |
| 64 | +@media screen and (max-width: 1024px) { |
54 | 65 | .sponsor {
|
55 |
| - flex-basis: 31%; |
56 |
| - max-width: 31%; |
| 66 | + flex: 1 0 30%; |
| 67 | + max-width: 33%; |
57 | 68 | }
|
58 | 69 | }
|
59 | 70 | </style>
|
0 commit comments