2020-03-22 10:24:36 +00:00
|
|
|
<template>
|
2020-04-02 06:58:38 +00:00
|
|
|
<a
|
|
|
|
:href="url"
|
|
|
|
target="_blank"
|
|
|
|
rel="noreferrer noopener nofollow"
|
|
|
|
class="image"
|
|
|
|
>
|
2020-03-30 06:45:06 +00:00
|
|
|
<div class="wrap">
|
2021-12-21 06:32:43 +00:00
|
|
|
<img
|
|
|
|
:src="thumb"
|
|
|
|
alt="Picture message"
|
|
|
|
@click="onClick"
|
|
|
|
@error="onImgError"
|
|
|
|
/>
|
2020-03-30 06:45:06 +00:00
|
|
|
<span class="time">{{ readableTime }}</span>
|
|
|
|
</div>
|
2020-03-22 10:24:36 +00:00
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
2021-12-27 08:19:31 +00:00
|
|
|
props: {
|
|
|
|
url: { type: String, default: '' },
|
|
|
|
thumb: { type: String, default: '' },
|
|
|
|
readableTime: { type: String, default: '' },
|
|
|
|
},
|
2021-12-21 06:32:43 +00:00
|
|
|
methods: {
|
|
|
|
onImgError() {
|
|
|
|
this.$emit('error');
|
|
|
|
},
|
|
|
|
},
|
2020-03-22 10:24:36 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import '~widget/assets/scss/variables.scss';
|
|
|
|
|
|
|
|
.image {
|
|
|
|
display: block;
|
|
|
|
|
2020-03-30 06:45:06 +00:00
|
|
|
.wrap {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
max-width: 100%;
|
|
|
|
|
|
|
|
&::before {
|
|
|
|
background-image: linear-gradient(
|
|
|
|
-180deg,
|
|
|
|
transparent 3%,
|
2020-05-02 04:17:36 +00:00
|
|
|
$color-heading 130%
|
2020-03-30 06:45:06 +00:00
|
|
|
);
|
|
|
|
bottom: 0;
|
|
|
|
content: '';
|
|
|
|
height: 20%;
|
|
|
|
left: 0;
|
|
|
|
opacity: 0.8;
|
|
|
|
position: absolute;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-22 10:24:36 +00:00
|
|
|
img {
|
|
|
|
width: 100%;
|
2020-04-17 15:45:20 +00:00
|
|
|
max-width: 250px;
|
2020-03-22 10:24:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.time {
|
|
|
|
font-size: $font-size-small;
|
|
|
|
bottom: $space-smaller;
|
|
|
|
color: $color-white;
|
|
|
|
position: absolute;
|
2020-05-02 04:17:36 +00:00
|
|
|
right: $space-slab;
|
2020-03-22 10:24:36 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|