123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <nuxt-link :to="link" class="item">
- <div class="item-image">
- <img :src="item.image.url" :alt="item.image.title" />
- </div>
- <div class="item-title" v-html="item.title"></div>
- <div class="item-date">{{ date }}</div>
- </nuxt-link>
- </template>
- <script>
- export default {
- props: {
- item: {
- type: Object,
- required: true,
- },
- },
- computed: {
- link() {
- return {
- name: "podcasts-category-alias",
- params: {
- category: this.item.category.alias,
- alias: this.item.alias,
- },
- };
- },
- date() {
- const options = { month: "long", day: "numeric" };
- const date = new Date(this.item.start_activity * 1000);
- return date.toLocaleDateString("ru-RU", options);
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .item {
- aspect-ratio: 420 / 260;
- width: 100%;
- position: relative;
- display: flex;
- flex-direction: column;
- color: #fff;
- padding: 10px 25px;
- cursor: pointer;
- &-image {
- width: 100%;
- height: 100%;
- position: absolute;
- left: 0;
- top: 0;
- z-index: 0;
- filter: brightness(70%);
- transition: all 0.2s linear;
- img {
- width: 100%;
- height: 100%;
- object-fit: cover;
- }
- }
- &:hover &-image {
- filter: brightness(90%);
- }
- &-title {
- position: relative;
- z-index: 1;
- margin-top: auto;
- font-weight: bold;
- font-size: 24px;
- line-height: 120%;
- }
- &-date {
- margin-top: 10px;
- position: relative;
- z-index: 1;
- color: rgba(255, 255, 255, 0.5);
- }
- @media screen and(max-width: 1300px) {
- &-title {
- font-size: 1.8vw;
- }
- }
- @media screen and(max-width: 768px) {
- &-title {
- font-size: 18px;
- }
- }
- }
- </style>
|