Chatwoot/app/javascript/widget/components/ImageBubble.vue

62 lines
1 KiB
Vue
Raw Normal View History

<template>
<a
:href="url"
target="_blank"
rel="noreferrer noopener nofollow"
class="image"
>
2020-03-30 06:45:06 +00:00
<div class="wrap">
<img :src="thumb" alt="Picture message" />
<span class="time">{{ readableTime }}</span>
</div>
</a>
</template>
<script>
export default {
2020-03-30 06:45:06 +00:00
props: ['url', 'thumb', 'readableTime'],
};
</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%,
$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%;
}
}
img {
width: 100%;
max-width: 250px;
}
.time {
font-size: $font-size-small;
bottom: $space-smaller;
color: $color-white;
position: absolute;
right: $space-slab;
white-space: nowrap;
}
}
</style>