This commit is contained in:
syuilo
2018-11-08 02:09:15 +09:00
parent e0ec56abb5
commit 3261d54cd3
4 changed files with 13 additions and 7 deletions

View File

@@ -10,7 +10,6 @@ import window from './window.vue';
import noteFormWindow from './post-form-window.vue';
import renoteFormWindow from './renote-form-window.vue';
import mediaImage from './media-image.vue';
import mediaImageDialog from './media-image-dialog.vue';
import mediaVideo from './media-video.vue';
import notifications from './notifications.vue';
import noteForm from './post-form.vue';
@@ -39,7 +38,6 @@ Vue.component('mk-window', window);
Vue.component('mk-post-form-window', noteFormWindow);
Vue.component('mk-renote-form-window', renoteFormWindow);
Vue.component('mk-media-image', mediaImage);
Vue.component('mk-media-image-dialog', mediaImageDialog);
Vue.component('mk-media-video', mediaVideo);
Vue.component('mk-notifications', notifications);
Vue.component('mk-post-form', noteForm);

View File

@@ -1,69 +0,0 @@
<template>
<div class="mk-media-image-dialog">
<div class="bg" @click="close"></div>
<img :src="image.url" :alt="image.name" :title="image.name" @click="close"/>
</div>
</template>
<script lang="ts">
import Vue from 'vue';
import * as anime from 'animejs';
export default Vue.extend({
props: ['image'],
mounted() {
anime({
targets: this.$el,
opacity: 1,
duration: 100,
easing: 'linear'
});
},
methods: {
close() {
anime({
targets: this.$el,
opacity: 0,
duration: 100,
easing: 'linear',
complete: () => this.destroyDom()
});
}
}
});
</script>
<style lang="stylus" scoped>
.mk-media-image-dialog
display block
position fixed
z-index 2048
top 0
left 0
width 100%
height 100%
opacity 0
> .bg
display block
position fixed
z-index 1
top 0
left 0
width 100%
height 100%
background rgba(#000, 0.7)
> img
position fixed
z-index 2
top 0
right 0
bottom 0
left 0
max-width 100%
max-height 100%
margin auto
cursor zoom-out
</style>

View File

@@ -17,7 +17,7 @@
<script lang="ts">
import Vue from 'vue';
import MkMediaImageDialog from './media-image-dialog.vue';
import ImageViewer from '../../../common/views/components/image-viewer.vue';
export default Vue.extend({
props: {
@@ -58,7 +58,7 @@ export default Vue.extend({
},
onClick() {
(this as any).os.new(MkMediaImageDialog, {
(this as any).os.new(ImageViewer, {
image: this.image
});
}