2018-02-05 03:15:35 +00:00
|
|
|
<ModalDialog :label :shown background="var(--main-bg)">
|
2018-02-04 23:59:42 +00:00
|
|
|
{{#if type === 'gifv'}}
|
|
|
|
<video
|
|
|
|
aria-label="Animated GIF: {{description || ''}}"
|
|
|
|
poster="{{poster}}"
|
|
|
|
src="{{src}}"
|
|
|
|
width="{{width}}"
|
|
|
|
height="{{height}}"
|
|
|
|
autoplay
|
|
|
|
muted
|
|
|
|
loop
|
|
|
|
playsinline
|
|
|
|
/>
|
|
|
|
{{else}}
|
|
|
|
<img
|
|
|
|
src="{{src}}"
|
|
|
|
width="{{width}}"
|
|
|
|
height="{{height}}"
|
2018-02-05 16:44:46 +00:00
|
|
|
alt="{{description || ''}}"
|
2018-02-04 23:59:42 +00:00
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</ModalDialog>
|
|
|
|
<style>
|
2018-02-05 03:15:35 +00:00
|
|
|
:global(#modal-dialog img, #modal-dialog video) {
|
2018-02-04 23:59:42 +00:00
|
|
|
object-fit: contain;
|
|
|
|
overflow: hidden;
|
|
|
|
max-width: calc(100vw - 20px);
|
|
|
|
max-height: calc(100vh - 100px);
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
<script>
|
|
|
|
import ModalDialog from '../ModalDialog.html'
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
ModalDialog
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
async show() {
|
|
|
|
this.set({shown: true})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|