add media description into media modal

This commit is contained in:
Henry Jameson 2021-08-15 19:45:48 +03:00
parent f5823a96e9
commit 34d265467a
2 changed files with 76 additions and 53 deletions

View file

@ -29,6 +29,9 @@ const MediaModal = {
media () { media () {
return this.$store.state.mediaViewer.media return this.$store.state.mediaViewer.media
}, },
description () {
return this.currentMedia.description
},
currentIndex () { currentIndex () {
return this.$store.state.mediaViewer.currentIndex return this.$store.state.mediaViewer.currentIndex
}, },

View file

@ -61,6 +61,12 @@
icon="chevron-right" icon="chevron-right"
/> />
</button> </button>
<span
v-if="description"
class="description"
>
{{ description }}
</span>
</Modal> </Modal>
</template> </template>
@ -69,6 +75,7 @@
<style lang="scss"> <style lang="scss">
.modal-view.media-modal-view { .modal-view.media-modal-view {
z-index: 1001; z-index: 1001;
flex-direction: column;
.modal-view-button-arrow { .modal-view-button-arrow {
opacity: 0.75; opacity: 0.75;
@ -84,6 +91,7 @@
} }
} }
.media-modal-view {
@keyframes media-fadein { @keyframes media-fadein {
from { from {
opacity: 0; opacity: 0;
@ -93,6 +101,17 @@
} }
} }
/* Hardcoded since background is also hardcoded */
.description {
color: white;
margin-top: 1em;
text-shadow: 0 0 10px black, 0 0 10px black;
max-width: 500px;
max-height: 9.5em;
overflow-y: auto;
padding: 0 2em;
}
.modal-image { .modal-image {
max-width: 90%; max-width: 90%;
max-height: 90%; max-height: 90%;
@ -144,4 +163,5 @@
} }
} }
} }
}
</style> </style>