blob: 57cf5fa0e6803cd70482eb2c1a2681bf370506d1 (
plain)
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
60
61
62
63
|
<script setup lang="ts">
import showcases from "./showcases"
import Showcase from "./Showcase.vue"
</script>
<template>
<div class="Showcases">
<template v-for="(showcase, index) in showcases" :key="index">
<div v-if="Array.isArray(showcase)" class="row">
<div
v-for="(elem, elemIndex) in showcase"
:key="elemIndex"
class="item"
:class="`grid-${showcase.length}`"
>
<Showcase
:image="elem.image"
:url="elem.url"
:icon="elem.icon"
:title="elem.title"
:description="elem.description"
:author="elem.author"
/>
</div>
</div>
<Showcase
v-else
:image="showcase.image"
:url="showcase.url"
:icon="showcase.icon"
:title="showcase.title"
:description="showcase.description"
:author="showcase.author"
/>
</template>
</div>
</template>
<style scoped>
.Showcases {
margin-top: 24px;
display: flex;
flex-direction: column;
gap: 24px;
}
.row {
display: flex;
gap: 24px;
}
/* TODO: responsiveness on mobile */
.item.grid-2 {
width: calc(100% / 2);
}
.item.grid-3 {
width: calc(100% / 3);
}
.item.grid-4 {
width: calc(100% / 4);
}
</style>
|