1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-23 22:56:53 +09:00

enhance(frontend): 노트에 2개 이상의 미디어가 있는 경우 아이콘으로 표시

This commit is contained in:
NoriDev 2024-10-02 23:32:17 +09:00
parent 5d29b05a28
commit 497e0564af

View File

@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div v-if="files.files.length > 0">
<div v-if="files.files.length > 0" :class="$style.root">
<div v-if="files.files[0].isSensitive && !showingFiles.includes(files.files[0].id)" :key="files.id + files.files[0].id" :class="$style.img" @click="showingFiles.push(files.files[0].id)">
<!-- TODO: 画像以外のファイルに対応 -->
<ImgWithBlurhash :class="$style.sensitiveImg" :hash="files.files[0].blurhash" :src="thumbnail(files.files[0])" :title="files.files[0].name" :forceBlurhash="true"/>
@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</div>
</div>
<MkA v-else :class="$style.img" :to="notePage(files)">
<MkA v-else :class="[$style.img, { [$style.multipleImg]: files.files.length > 1 }]" :to="notePage(files)">
<!-- TODO: 画像以外のファイルに対応 -->
<ImgWithBlurhash
:hash="files.files[0].blurhash"
@ -27,6 +27,9 @@ SPDX-License-Identifier: AGPL-3.0-only
@touchend="defaultStore.state.showingAnimatedImages === 'interaction' ? playAnimation = false : ''"
/>
</MkA>
<div v-if="files.files.length > 1" :class="$style.multiple">
<i class="ti ti-box-multiple"></i>
</div>
</div>
</template>
@ -81,6 +84,10 @@ onUnmounted(() => {
</script>
<style lang="scss" module>
.root {
position: relative;
}
.img {
display: flex;
position: relative;
@ -117,6 +124,17 @@ onUnmounted(() => {
cursor: pointer;
}
.multipleImg {
filter: brightness(0.9);
}
.multiple {
position: absolute;
top: 10px;
right: 10px;
font-size: 20px;
}
@container (max-width: 785px) {
.img {
height: 192px;
@ -129,7 +147,6 @@ onUnmounted(() => {
}
}
@container (max-width: 530px) {
.img {
height: 145px;