Skip to content

Commit

Permalink
enhance(frontend): 노트에 2개 이상의 미디어가 있는 경우 아이콘으로 표시
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Oct 2, 2024
1 parent 5d29b05 commit 497e056
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions packages/frontend/src/pages/user/index.timeline.files.files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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"/>
Expand All @@ -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"
Expand All @@ -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>

Expand Down Expand Up @@ -81,6 +84,10 @@ onUnmounted(() => {
</script>

<style lang="scss" module>
.root {
position: relative;
}

.img {
display: flex;
position: relative;
Expand Down Expand Up @@ -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;
Expand All @@ -129,7 +147,6 @@ onUnmounted(() => {
}
}


@container (max-width: 530px) {
.img {
height: 145px;
Expand Down

0 comments on commit 497e056

Please sign in to comment.