2019-01-14 09:23:13 -08:00
|
|
|
<template>
|
|
|
|
<div class="modal-view" v-if="showing" @click.prevent="hide">
|
|
|
|
<img class="modal-image" v-if="type === 'image'" :src="currentMedia.url"></img>
|
2019-01-26 07:45:03 -08:00
|
|
|
<VideoAttachment
|
2019-01-14 09:23:13 -08:00
|
|
|
class="modal-image"
|
|
|
|
v-if="type === 'video'"
|
2019-01-26 07:45:03 -08:00
|
|
|
:attachment="currentMedia"
|
|
|
|
:controls="true"
|
|
|
|
@click.stop.native="">
|
|
|
|
</VideoAttachment>
|
2019-01-14 09:23:13 -08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./media_modal.js"></script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
@import '../../_variables.scss';
|
|
|
|
|
|
|
|
.modal-view {
|
2019-01-26 07:45:03 -08:00
|
|
|
z-index: 1000;
|
2019-01-14 09:23:13 -08:00
|
|
|
position: fixed;
|
|
|
|
width: 100vw;
|
|
|
|
height: 100vh;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
background-color: rgba(0, 0, 0, 0.5);
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.modal-image {
|
|
|
|
max-width: 90%;
|
|
|
|
max-height: 90%;
|
|
|
|
box-shadow: 0px 5px 15px 0 rgba(0, 0, 0, 0.5);
|
|
|
|
}
|
|
|
|
</style>
|