|
| 1 | +<template> |
| 2 | + <div class="landing-cards"> |
| 3 | + <component |
| 4 | + :is="item.to ? 'NuxtLink' : 'div'" |
| 5 | + v-for="item in items" |
| 6 | + :key="item.title" |
| 7 | + :to="item.to" |
| 8 | + class="landing-card" |
| 9 | + :class="{ 'landing-card--link': item.to }" |
| 10 | + > |
| 11 | + <v-icon v-if="item.icon" class="landing-card__icon" size="32"> |
| 12 | + {{ item.icon }} |
| 13 | + </v-icon> |
| 14 | + <h3 class="landing-card__title">{{ item.title }}</h3> |
| 15 | + <p class="landing-card__text">{{ item.text }}</p> |
| 16 | + <span v-if="item.to" class="landing-card__more"> |
| 17 | + {{ item.linkText }} <v-icon size="16">mdi-arrow-right</v-icon> |
| 18 | + </span> |
| 19 | + </component> |
| 20 | + </div> |
| 21 | +</template> |
| 22 | + |
| 23 | +<script> |
| 24 | +export default { |
| 25 | + name: "LandingCards", |
| 26 | + props: { |
| 27 | + // [{ icon, title, text, to?, linkText? }] |
| 28 | + items: { type: Array, required: true }, |
| 29 | + }, |
| 30 | +}; |
| 31 | +</script> |
| 32 | + |
| 33 | +<style lang="scss" scoped> |
| 34 | +.landing-cards { |
| 35 | + display: grid; |
| 36 | + grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); |
| 37 | + gap: 1.2rem; |
| 38 | + margin-top: clamp(2.2rem, 5vw, 3.6rem); |
| 39 | + text-align: left; |
| 40 | +} |
| 41 | +
|
| 42 | +.landing-card { |
| 43 | + background: var(--landing-card-bg, #ffffff); |
| 44 | + color: var(--landing-card-fg, #1d1d1f); |
| 45 | + border-radius: 20px; |
| 46 | + padding: 1.8rem 1.6rem; |
| 47 | + box-shadow: var(--landing-card-shadow, none); |
| 48 | + text-decoration: none; |
| 49 | + display: flex; |
| 50 | + flex-direction: column; |
| 51 | +} |
| 52 | +
|
| 53 | +.landing-card--link { |
| 54 | + transition: transform 0.25s ease; |
| 55 | +
|
| 56 | + &:hover { |
| 57 | + transform: translateY(-4px); |
| 58 | + } |
| 59 | +} |
| 60 | +
|
| 61 | +.landing-card__icon { |
| 62 | + color: $c-blue-accent; |
| 63 | + margin-bottom: 1rem; |
| 64 | +} |
| 65 | +
|
| 66 | +.landing-card__title { |
| 67 | + font-size: 1.15rem; |
| 68 | + font-weight: 700; |
| 69 | + line-height: 1.3; |
| 70 | + margin: 0 0 0.6rem; |
| 71 | +} |
| 72 | +
|
| 73 | +.landing-card__text { |
| 74 | + font-size: 1rem; |
| 75 | + line-height: 1.55; |
| 76 | + color: var(--landing-card-muted, rgba(29, 29, 31, 0.68)); |
| 77 | + margin: 0; |
| 78 | +} |
| 79 | +
|
| 80 | +.landing-card__more { |
| 81 | + margin-top: auto; |
| 82 | + padding-top: 1rem; |
| 83 | + font-weight: 600; |
| 84 | + color: $c-blue-accent; |
| 85 | + display: inline-flex; |
| 86 | + align-items: center; |
| 87 | + gap: 0.3em; |
| 88 | +} |
| 89 | +</style> |
0 commit comments