Files
front/components/UniversityCard.vue

85 lines
2.3 KiB
Vue
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { universityPath } from "~/data/universities";
import type { University } from "~/types";
/**
* Карточка вуза в каталоге страницы «Вузы»: фото, краткое описание,
* характеристики и переход на адресную страницу /vus/<slug>.
*/
const props = defineProps<{ university: University }>();
</script>
<template>
<article
class="container fon-vus university-card mb-3 reveal"
itemscope
itemtype="https://schema.org/EducationalOrganization"
>
<div class="row g-0">
<div v-if="props.university.heroImage" class="col-md-4 text-center p-3">
<img
:src="`/assets/img/${props.university.heroImage}`"
class="img-fluid rounded"
:alt="props.university.heroImageAlt"
itemprop="image"
loading="lazy"
/>
</div>
<div :class="props.university.heroImage ? 'col-md-8 p-3' : 'col-12 p-3'">
<h2 class="h4" itemprop="name">
{{ props.university.name }}
</h2>
<p itemprop="description">{{ props.university.summary }}</p>
<ul class="list-inline mb-3 university-card__badges">
<li
v-for="badge in props.university.badges"
:key="badge"
class="list-inline-item badge text-bg-light"
>
{{ badge }}
</li>
</ul>
<div class="d-flex flex-wrap gap-3">
<NuxtLink
class="btn btn-dark"
:to="universityPath(props.university.slug)"
>
Подробнее о вузе
</NuxtLink>
<a
v-if="props.university.website"
class="btn btn-outline-secondary"
:href="props.university.website"
target="_blank"
rel="noopener noreferrer"
itemprop="url"
>
Перейти на сайт
</a>
</div>
</div>
</div>
</article>
</template>
<style scoped>
.university-card {
transition:
transform 0.2s ease,
box-shadow 0.2s ease;
}
.university-card:hover {
transform: translateY(-2px);
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.university-card__badges {
font-size: 0.875rem;
}
</style>