aboutsummaryrefslogtreecommitdiff
path: root/src/components/media_modal/media_modal.vue
blob: eb8fca53371884a65afe5952c146fe8a09e28f12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<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">
    </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>