diff options
| author | shpuld <shp@cock.li> | 2019-01-14 19:23:13 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-14 19:23:13 +0200 |
| commit | 17735943d5cdde1eb852d36f1c3bb699d23f7eb6 (patch) | |
| tree | d5a6b7f8d8c3512a6f262371f0038a2adb311288 /src/components/media_modal/media_modal.vue | |
| parent | a51167fa72a64505080c9aea47b5d3bc97a529b0 (diff) | |
Add media viewer module and media module component, modify attachment behavior
Diffstat (limited to 'src/components/media_modal/media_modal.vue')
| -rw-r--r-- | src/components/media_modal/media_modal.vue | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/components/media_modal/media_modal.vue b/src/components/media_modal/media_modal.vue new file mode 100644 index 00000000..6e291ac5 --- /dev/null +++ b/src/components/media_modal/media_modal.vue @@ -0,0 +1,40 @@ +<template> + <div class="modal-view" v-if="showing" @click.prevent="hide"> + <img class="modal-image" v-if="type === 'image'" :src="currentMedia.url"></img> + <video + class="modal-image" + v-if="type === 'video'" + :src="currentMedia.url" + @click.stop="" + controls autoplay + :loop="loopVideo" + @loadeddata="onVideoDataLoad"> + </video> + </div> +</template> + +<script src="./media_modal.js"></script> + +<style lang="scss"> +@import '../../_variables.scss'; + +.modal-view { + z-index: 1005; + 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> |
