2020-02-16 05:46:18 -08:00
|
|
|
|
<template>
|
2022-01-15 13:59:35 -08:00
|
|
|
|
<MkModal ref="modal" :z-priority="'middle'" @click="modal.close()" @closed="emit('closed')">
|
2020-10-17 04:12:00 -07:00
|
|
|
|
<div class="xubzgfga">
|
|
|
|
|
<header>{{ image.name }}</header>
|
2022-01-15 13:59:35 -08:00
|
|
|
|
<img :src="image.url" :alt="image.comment" :title="image.comment" @click="modal.close()"/>
|
2020-10-17 04:12:00 -07:00
|
|
|
|
<footer>
|
|
|
|
|
<span>{{ image.type }}</span>
|
|
|
|
|
<span>{{ bytes(image.size) }}</span>
|
2020-10-18 22:48:56 -07:00
|
|
|
|
<span v-if="image.properties && image.properties.width">{{ number(image.properties.width) }}px × {{ number(image.properties.height) }}px</span>
|
2020-10-17 04:12:00 -07:00
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
|
|
|
|
</MkModal>
|
2020-02-16 05:46:18 -08:00
|
|
|
|
</template>
|
|
|
|
|
|
2022-01-15 13:59:35 -08:00
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { } from 'vue';
|
|
|
|
|
import * as misskey from 'misskey-js';
|
2021-11-11 09:02:25 -08:00
|
|
|
|
import bytes from '@/filters/bytes';
|
|
|
|
|
import number from '@/filters/number';
|
2022-09-06 02:21:49 -07:00
|
|
|
|
import MkModal from '@/components/MkModal.vue';
|
2020-02-16 05:46:18 -08:00
|
|
|
|
|
2022-01-15 13:59:35 -08:00
|
|
|
|
const props = withDefaults(defineProps<{
|
|
|
|
|
image: misskey.entities.DriveFile;
|
|
|
|
|
}>(), {
|
|
|
|
|
});
|
2020-02-16 05:46:18 -08:00
|
|
|
|
|
2022-01-15 13:59:35 -08:00
|
|
|
|
const emit = defineEmits<{
|
2022-05-26 06:53:09 -07:00
|
|
|
|
(ev: 'closed'): void;
|
2022-01-15 13:59:35 -08:00
|
|
|
|
}>();
|
2020-02-16 05:46:18 -08:00
|
|
|
|
|
2023-01-02 20:37:32 -08:00
|
|
|
|
const modal = $shallowRef<InstanceType<typeof MkModal>>();
|
2020-02-16 05:46:18 -08:00
|
|
|
|
</script>
|
|
|
|
|
|
2022-12-27 01:29:39 -08:00
|
|
|
|
<style lang="scss" scoped>
|
2020-02-16 05:46:18 -08:00
|
|
|
|
.xubzgfga {
|
2023-01-14 04:04:30 -08:00
|
|
|
|
margin: auto;
|
2020-11-06 12:00:42 -08:00
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
height: 100%;
|
2020-10-17 04:12:00 -07:00
|
|
|
|
|
|
|
|
|
> header,
|
|
|
|
|
> footer {
|
2020-11-06 12:00:42 -08:00
|
|
|
|
align-self: center;
|
2020-10-17 04:12:00 -07:00
|
|
|
|
display: inline-block;
|
|
|
|
|
padding: 6px 9px;
|
|
|
|
|
font-size: 90%;
|
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
|
|
|
|
border-radius: 6px;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> header {
|
|
|
|
|
margin-bottom: 8px;
|
|
|
|
|
opacity: 0.9;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> img {
|
|
|
|
|
display: block;
|
2020-11-06 12:00:42 -08:00
|
|
|
|
flex: 1;
|
|
|
|
|
min-height: 0;
|
|
|
|
|
object-fit: contain;
|
|
|
|
|
width: 100%;
|
2020-10-17 04:12:00 -07:00
|
|
|
|
cursor: zoom-out;
|
|
|
|
|
image-orientation: from-image;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> footer {
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
opacity: 0.8;
|
|
|
|
|
|
|
|
|
|
> span + span {
|
|
|
|
|
margin-left: 0.5em;
|
|
|
|
|
padding-left: 0.5em;
|
|
|
|
|
border-left: solid 1px rgba(255, 255, 255, 0.5);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-02-16 05:46:18 -08:00
|
|
|
|
}
|
|
|
|
|
</style>
|