-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathFeatureCard.vue
More file actions
53 lines (48 loc) · 885 Bytes
/
FeatureCard.vue
File metadata and controls
53 lines (48 loc) · 885 Bytes
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
<script setup lang="ts">
defineProps<{
title: string
imageSrc?: string
imageAlt?: string
toggleFn?: () => void
}>()
</script>
<template>
<section class="card">
<h2>{{ title }}</h2>
<div class="project-content">
<img
:alt="imageAlt || ''"
class="project-image"
:src="imageSrc || ''"
@click="toggleFn && toggleFn()"
>
<div class="project-description">
<slot name="description" />
</div>
</div>
<slot name="footer" />
</section>
</template>
<style scoped>
.project-content {
display: flex;
flex-wrap: wrap;
gap: 2rem;
justify-content: center;
}
.project-image {
width: 100%;
min-width: 200px;
max-width: 300px;
max-height: 300px;
border-radius: 2rem;
object-fit: contain;
}
.project-description {
flex: 1;
min-width: 200px;
p {
margin: 0 0 1rem;
}
}
</style>