diff --git a/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue b/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue index c65bfd03..6f4db84d 100644 --- a/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue +++ b/src/renderer/components/TimelineSpace/Contents/Cards/Toot.vue @@ -52,8 +52,10 @@ -
- Attached media +
+ + GIF + VIDEO
@@ -355,7 +357,7 @@ export default { 'TimelineSpace/Modals/ImageViewer/openModal', { currentIndex: currentIndex, - mediaList: mediaList + mediaList: rawMediaList }) }, openUser (account) { @@ -564,6 +566,16 @@ export default { max-height: 200px; border-radius: 8px; } + + .media-label { + position: absolute; + bottom: 8px; + left: 8px; + color: #fff; + background: rgba(0, 0, 0, 0.5); + font-size: 0.8rem; + border-radius: 2px; + } } } diff --git a/src/renderer/components/TimelineSpace/Modals/ImageViewer.vue b/src/renderer/components/TimelineSpace/Modals/ImageViewer.vue index dd83e0ed..769b8b17 100644 --- a/src/renderer/components/TimelineSpace/Modals/ImageViewer.vue +++ b/src/renderer/components/TimelineSpace/Modals/ImageViewer.vue @@ -7,7 +7,7 @@
- +
@@ -31,6 +31,9 @@ export default { imageURL () { return this.$store.getters['TimelineSpace/Modals/ImageViewer/imageURL'] }, + imageType () { + return this.$store.getters['TimelineSpace/Modals/ImageViewer/imageType'] + }, showLeft () { return this.$store.getters['TimelineSpace/Modals/ImageViewer/showLeft'] }, diff --git a/src/renderer/components/TimelineSpace/Modals/Media.vue b/src/renderer/components/TimelineSpace/Modals/Media.vue index 4c309759..2f420475 100644 --- a/src/renderer/components/TimelineSpace/Modals/Media.vue +++ b/src/renderer/components/TimelineSpace/Modals/Media.vue @@ -1,5 +1,6 @@ @@ -9,14 +10,18 @@ export default { src: { type: String, default: '' + }, + type: { + type: String, + default: '' } }, methods: { - file_ext () { - return this.src.split('.').pop().toLowerCase() - }, isMovieFile () { - return ['mp4'].indexOf(this.file_ext()) >= 0 + return ['video'].includes(this.type) + }, + isGIF () { + return ['gifv'].includes(this.type) } } } diff --git a/src/renderer/store/TimelineSpace/Modals/ImageViewer.js b/src/renderer/store/TimelineSpace/Modals/ImageViewer.js index 141b5074..63b3b1d4 100644 --- a/src/renderer/store/TimelineSpace/Modals/ImageViewer.js +++ b/src/renderer/store/TimelineSpace/Modals/ImageViewer.js @@ -2,7 +2,7 @@ const ImageViewer = { namespaced: true, state: { modalOpen: false, - currentIndex: 0, + currentIndex: -1, mediaList: [] }, mutations: { @@ -30,7 +30,7 @@ const ImageViewer = { }, closeModal ({ commit }) { commit('changeModal', false) - commit('changeCurrentIndex', 0) + commit('changeCurrentIndex', -1) commit('changeMedliaList', []) }, incrementIndex ({ commit }) { @@ -42,7 +42,14 @@ const ImageViewer = { }, getters: { imageURL (state) { - return state.mediaList[state.currentIndex] + if (state.currentIndex >= 0) { + return state.mediaList[state.currentIndex].url + } + }, + imageType (state) { + if (state.currentIndex >= 0) { + return state.mediaList[state.currentIndex].type + } }, showLeft (state) { const notFirst = (state.currentIndex > 0)