aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_modal/media_modal.vue
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2019-01-30 18:58:08 +0000
committerlambda <pleromagit@rogerbraun.net>2019-01-30 18:58:08 +0000
commit5b7b1dfebc37bd5db4e839973062b452b02c898d (patch)
treea517e4942725286b173b685cbe87bc6c7878b66e /src/components/media_modal/media_modal.vue
parentb1facdf7ad54436c2afde7c28c917cda87a5b7e3 (diff)
parentc7cffbb6c70bbb21cf787d96e82e0261427b9234 (diff)
Merge branch 'feat/media-modal' into 'develop'
modal for viewing attachments in-tab See merge request pleroma/pleroma-fe!468
Diffstat (limited to 'src/components/media_modal/media_modal.vue')
-rw-r--r--src/components/media_modal/media_modal.vue38
1 files changed, 38 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..796d4e40
--- /dev/null
+++ b/src/components/media_modal/media_modal.vue
@@ -0,0 +1,38 @@
+<template>
+ <div class="modal-view" v-if="showing" @click.prevent="hide">
+ <img class="modal-image" v-if="type === 'image'" :src="currentMedia.url"></img>
+ <VideoAttachment
+ class="modal-image"
+ v-if="type === 'video'"
+ :attachment="currentMedia"
+ :controls="true"
+ @click.stop.native="">
+ </VideoAttachment>
+ </div>
+</template>
+
+<script src="./media_modal.js"></script>
+
+<style lang="scss">
+@import '../../_variables.scss';
+
+.modal-view {
+ z-index: 1000;
+ 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>