schon/storefront/app/components/cards/brand.vue
2026-02-27 21:59:51 +03:00

70 lines
No EOL
1.3 KiB
Vue

<template>
<nuxt-link-locale
class="card"
:to="`/brand/${brand.slug}`"
>
<nuxt-img
v-if="brand.smallLogo"
format="webp"
densities="x1"
:src="brand.smallLogo"
:alt="brand.name"
class="card__image"
loading="lazy"
/>
<div class="card__image-placeholder" v-else />
<p>{{ brand.name }}</p>
</nuxt-link-locale>
</template>
<script setup lang="ts">
import type {IBrand} from '@types';
const props = defineProps<{
brand: IBrand;
}>();
</script>
<style lang="scss" scoped>
.card {
cursor: pointer;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
background-color: $white;
border-radius: 8px;
border: 1px solid #e5e7eb;
height: 100%;
padding: 23px;
transition: 0.2s;
@include hover {
box-shadow: 0 0 10px 2px rgba(0, 0, 0, 0.3);
border-color: #505052;
}
&__image {
width: 100%;
aspect-ratio: 1;
object-fit: contain;
object-position: center;
&-placeholder {
width: 100%;
aspect-ratio: 1;
background-color: $accentLight;
border-radius: $default_border_radius;
}
}
& p {
color: #1a1a1a;
text-align: center;
font-size: 16px;
font-weight: 500;
letter-spacing: -0.5px;
}
}
</style>